fix review findings: require session.jsonl for every snapshot scenario
The per-kind fixture guard claimed no-model scenarios need no session.jsonl, but the replay path requires one for ALL scenarios: runScenario() passes `fixtureFile: <dir>/session.jsonl` unconditionally and llm-replay's loadReplayScript() throws "fixture not found" when it is absent and no override replaces it. A no-model scenario ships a header-only session.jsonl that derives to an empty script. The guard + its comment now match that reality, so a future no-model scenario following them won't fail at subprocess startup.
This commit is contained in:
@@ -134,19 +134,21 @@ describe('snapshot fixtures', () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
it('every registered scenario has its required fixture files', async () => {
|
it('every registered scenario has its required fixture files', async () => {
|
||||||
// Required files are per-KIND. Every scenario has an input script and an
|
// Every scenario has an input script and an stdout golden. EVERY scenario
|
||||||
// stdout golden. Only model scenarios persist a session log, so only they
|
// also needs `session.jsonl`: the harness boots `llm-replay` with that path
|
||||||
// require `session.jsonl` (the replay source AND expected-log artifact);
|
// as the replay source for ALL scenarios (acp.snapshot.ts passes
|
||||||
// a no-model scenario boots `llm-replay` with an empty script and needs no
|
// `fixtureFile: <dir>/session.jsonl` unconditionally), and `loadReplayScript`
|
||||||
// session fixture. Authored scenarios additionally ship the
|
// throws "fixture not found" when it is absent and no override replaces it.
|
||||||
// `replay.override.json` sidecar that drives their model behavior.
|
// A no-model scenario ships a header-only `session.jsonl` (it derives to an
|
||||||
|
// empty script — no model call is made); a model scenario's fixture also
|
||||||
|
// doubles as the expected-log artifact the run is diffed against. An authored
|
||||||
|
// (non-`recorded`) model scenario additionally ships a `replay.override.json`
|
||||||
|
// sidecar for the throw/hang cases a derived script cannot express.
|
||||||
for (const { name, hasModelTurn, recorded } of SCENARIOS) {
|
for (const { name, hasModelTurn, recorded } of SCENARIOS) {
|
||||||
const dir = join(SNAPSHOTS_DIR, name)
|
const dir = join(SNAPSHOTS_DIR, name)
|
||||||
expect(existsSync(join(dir, 'input.json')), `${name}/input.json`).toBe(true)
|
expect(existsSync(join(dir, 'input.json')), `${name}/input.json`).toBe(true)
|
||||||
expect(existsSync(join(dir, 'stdout.golden.jsonl')), `${name}/stdout.golden.jsonl`).toBe(true)
|
expect(existsSync(join(dir, 'stdout.golden.jsonl')), `${name}/stdout.golden.jsonl`).toBe(true)
|
||||||
if (hasModelTurn) {
|
expect(existsSync(join(dir, 'session.jsonl')), `${name}/session.jsonl`).toBe(true)
|
||||||
expect(existsSync(join(dir, 'session.jsonl')), `${name}/session.jsonl`).toBe(true)
|
|
||||||
}
|
|
||||||
if (hasModelTurn && !recorded) {
|
if (hasModelTurn && !recorded) {
|
||||||
expect(existsSync(join(dir, 'replay.override.json')), `${name}/replay.override.json`).toBe(true)
|
expect(existsSync(join(dir, 'replay.override.json')), `${name}/replay.override.json`).toBe(true)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user