fix(jsonl): reject negative-zero timestamps

This commit is contained in:
Hypatia May
2026-07-24 11:01:08 +08:00
parent 19b96037f6
commit 352934b9ec
2 changed files with 6 additions and 0 deletions
@@ -574,6 +574,11 @@ describe('SessionPersistenceJsonl: scanLog unit', () => {
expect(() => scanLog(Buffer.from(log))).toThrow(/session header/)
})
it('rejects a session header with negative-zero createdAt', () => {
const log = '{"type":"session","version":0,"id":"invalid-created-at","createdAt":-0,"delegationDepth":0}\n'
expect(() => scanLog(Buffer.from(log))).toThrow(/session header/)
})
it.each([
['missing', undefined],
['a string', '1'],