test(snapshot): expect rejection of invalid historical citations

The historical-comparison negative control replaces title.messageSeqs with [0], which cites a non-human event. The current Session validator correctly rejects this before normalization; comparing the malformed result for inequality made the otherwise passing built snapshot lane fail.

Assert the specific earlier-human-message validation error for that malformed control. Keep the valid prompt and model difference comparisons, every citation field, and all production restoration and normalization logic unchanged.

Validation: full DSH_EXAMPLE_MODE=lib DSH_SNAPSHOT=replay pnpm exec vitest run --config vitest.snapshot.config.ts reproduced the lone negative-control failure, then passed all 6 files and 126 tests after repair (2 existing PowerShell availability skips). PATH used the existing uv Python 3.14.5 bin; no software installed.
This commit is contained in:
Tianyi Cui committed 2026-09-06 20:42:43 +08:00
1 parent b4d8a31ae8
commit 1616c99dae
1 file changed
+2 -2
+2 -2
View File
@@ -645,10 +645,10 @@ describe('headless recorded-session snapshots', () => {
const header = rows.find(row => row.type === 'request/header')?.data as JsonObject
;((header.header as JsonObject).config as JsonObject).model = 'different-model'
})).not.toEqual(baseline)
expect(changed(rows => {
expect(() => changed(rows => {
const title = rows.find(row => row.type === 'session/title')?.data as JsonObject
title.messageSeqs = [0]
})).not.toEqual(baseline)
})).toThrow('messageSeqs must cite earlier human user/message events')
})
it('recognizes the supported OS-assigned listener forms', () => {