Skip to content

Commit e7bdec0

Browse files
committed
test(memory): an old title match survives the cut in one big step; .env's dot does not end a not
Two of 21 single-defect mutations of the review fixes passed every suite: limiting before ranking (the title match was found by the first step's no-read pass, so it was never cut), and splitting a clause at every dot (only a note that writes the file name differently from the quote shows it). Each now has a case.
1 parent 42e1f8d commit e7bdec0

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

‎extensions/levelcode-ai/test/memoryNotes.test.js‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ test('GROUND: the note keeps every not and never, and adds none', () => {
6868
assert.deepStrictEqual(mem.groundNote({ text: 'Use yarn', said: 'never use npm or yarn', personWords: ['never use npm or yarn'] }).reason, 'changes-a-not');
6969
assert.strictEqual(mem.groundNote({ text: 'Don\u2019t push to main', said: "don't push to main", personWords: ["don't push to main"] }).verified, true, 'curly and straight apostrophes are the same not');
7070
assert.strictEqual(mem.groundNote({ text: 'Never edit package.json by hand', said: 'never edit package.json by hand', personWords: ['never edit package.json by hand'] }).verified, true, 'a file name is one word, not two clauses');
71+
assert.strictEqual(mem.groundNote({ text: 'No env files in commits', said: 'no .env files in commits', personWords: ['no .env files in commits'] }).verified, true, 'the dot of .env does not end the "no"');
7172
});
7273
test('GROUND: a quote too short to mean anything is not enough', () => {
7374
assert.deepStrictEqual(mem.groundNote({ text: 'Yes', said: 'yes', personWords: ['yes'] }).reason, 'too-short');
@@ -268,6 +269,8 @@ test('SEARCH: an older title match outranks newer matches in the conversation, b
268269
assert.strictEqual(r.length, 5);
269270
assert.deepStrictEqual([r[0].id, r[0].inTitle], [idQuokkaTitle, true]);
270271
assert.strictEqual(big.search('quokka', { limit: 100 }).length, 41);
272+
// all in one step: the title match is the last one read, and must still survive the cut
273+
assert.deepStrictEqual(big.search('quokka', { limit: 5, readMax: 1000 })[0].id, idQuokkaTitle);
271274
});
272275
test('SEARCH: the first step reports a title match anywhere, with no read; a later step adds its snippet', () => {
273276
const first = big.searchStep('quokka migration', { readMax: 10 });

0 commit comments

Comments
 (0)