refactor(acp-example): snapshot goldens are JSONL, not pretty-printed .txt

The goldens now mirror the shape of the surfaces they capture — one compact
JSON record per line — matching the wire (NDJSON stdout) and disk (JSONL
session log) formats, renamed *.golden.jsonl. They stay grep/jq-able and
faithful to what the agent emits, where the prior pretty-printed .txt was a
reformatted representation. Both normalizers drop the 2-space indent; the
normalizer spec asserts the compact form. All 11 goldens regenerated; replay
remains deterministic (8/8 across runs).
This commit is contained in:
Tianyi Cui
2026-06-19 09:29:41 +08:00
parent b3caabb05d
commit ec73e11c9b
26 changed files with 366 additions and 4895 deletions
+3 -3
View File
@@ -72,12 +72,12 @@ for (const scenario of SCENARIOS) {
}
await expect(normalizeStdout(result.rawStdout, ctx))
.toMatchFileSnapshot(join(dir, 'stdout.golden.txt'))
.toMatchFileSnapshot(join(dir, 'stdout.golden.jsonl'))
if (scenario.hasModelTurn) {
expect(result.sessionLog, 'a model scenario must persist a session log').toBeDefined()
await expect(normalizeSessionLog(result.sessionLog as string, ctx))
.toMatchFileSnapshot(join(dir, 'session.golden.txt'))
.toMatchFileSnapshot(join(dir, 'session.golden.jsonl'))
}
})
})
@@ -99,7 +99,7 @@ describe('snapshot fixtures', () => {
const dir = join(SNAPSHOTS_DIR, name)
expect(existsSync(join(dir, 'input.json')), `${name}/input.json`).toBe(true)
expect(existsSync(join(dir, 'session.jsonl')), `${name}/session.jsonl`).toBe(true)
expect(existsSync(join(dir, 'stdout.golden.txt')), `${name}/stdout.golden.txt`).toBe(true)
expect(existsSync(join(dir, 'stdout.golden.jsonl')), `${name}/stdout.golden.jsonl`).toBe(true)
}
})
})