Skip to content

Commit dfbc684

Browse files
committed
test(eval,doctor): pin reclaim row and baseline delta; reword WAL note
The doctor row test now fails on the old literal, the baseline test asserts a delta computed from the baseline ranks, the capture provenance is named in words, and the checkpoint-busy note says the freed figure may count the main file only.
1 parent 3c9bfcf commit dfbc684

3 files changed

Lines changed: 9 additions & 6 deletions

File tree

‎src/index_reclaim.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ export function reclaimNotes(result: ReclaimResult, dbName: string): string[] {
226226
if (result.checkpointBusy) {
227227
notes.push(
228228
`a concurrent reader blocked WAL truncation, so some space is still held in ` +
229-
`${dbName}-wal and the figures above count the main file only. The next ` +
229+
`${dbName}-wal and the freed figure may count the main file only. The next ` +
230230
`checkpoint releases it`,
231231
)
232232
}

‎tests/cli_doctor_index_threshold.test.ts‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,14 +133,16 @@ describe('doctor index size threshold and auto-reclaim', () => {
133133
invalidateConfigCache()
134134

135135
expect(repairRes.errors).toEqual([])
136-
expect(repairRes.repairs.some((r) => r.includes('Auto-reclaimed embeddings'))).toBe(true)
136+
const row = repairRes.repairs.find((r) => r.includes('Auto-reclaimed embeddings'))
137+
expect(row?.startsWith('Auto-reclaimed embeddings from global.db (')).toBe(true)
138+
expect(row).not.toContain('and compacted')
137139

138140
const chunkCount = (db.prepare('SELECT count(*) as c FROM chunks').get() as { c: number }).c
139141
expect(chunkCount).toBe(0)
140142
})
141143
})
142144

143-
// Provenance: the first row is CAPTURE, the ReclaimResult reclaimIndex returned in C:/tgwt/triage_a/repro3b.mts (a second connection held a read transaction during an embeddings-only reclaim of global.db); the others are HAND-DERIVED sizes in MiB.
145+
// Provenance: the first row is CAPTURE, the ReclaimResult that reclaimIndex(dbPath, { embeddingsOnly: true }) returned on this Windows machine on 2026-10-17 while a second node:sqlite connection held a read transaction on a global.db seeded with one 1.2 MB chunk (beforeBytes 1792208, afterBytes 3559240, beforeDbBytes 4096, afterDbBytes 1486848, checkpointBusy true, vacuumDeferred false); the others are HAND-DERIVED sizes in MiB.
144146
describe('autoReclaimRow', () => {
145147
const MIB = 1024 * 1024
146148
const result = (over: Partial<ReclaimResult>): ReclaimResult => ({

‎tests/eval_retrieval_harness_wiring.test.ts‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,13 +95,14 @@ describe('eval-retrieval --baseline', () => {
9595
return file
9696
}
9797

98-
it('compares against a baseline in the shape toBaseline writes and prints a delta line for both splits', () => {
98+
it('compares against a baseline in the shape toBaseline writes and prints the paired delta its ranks give for both splits', () => {
9999
const rows = goldenIds().map((id) => ({ id, kind: 'doc', rank: 2 }))
100100
const file = writeBaseline(toBaseline({ semantic: rows }, 0))
101101
const r = runHarness({}, ['--baseline', file])
102102
expect(r.status, r.stderr).toBe(0)
103-
expect(r.stdout).toMatch(/^delta semantic\s+train\s+MRR@10/m)
104-
expect(r.stdout).toMatch(/^delta semantic\s+test\s+MRR@10/m)
103+
// HAND-DERIVED: the stand-in ranks the one answerable query of each split first (reciprocal rank 1) and the baseline recorded rank 2 (0.5), so each split's one paired query moves by exactly +0.500.
104+
expect(r.stdout).toMatch(/^delta semantic\s+train\s+MRR@10 \+0\.500 \[0\.500, 0\.500\]\s{2}improved$/m)
105+
expect(r.stdout).toMatch(/^delta semantic\s+test\s+MRR@10 \+0\.500 \[0\.500, 0\.500\]\s{2}improved$/m)
105106
}, 60_000)
106107

107108
it('exits 1 naming the arm when a baseline arm is neither a row list nor a rank map', () => {

0 commit comments

Comments
 (0)