You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(web): fail closed on malformed persisted turn-change records #698
At latest origin/main 3cb2ecf, readTurnChangesDetail accepts persisted JSON with state: [complete] because its enum guard uses String(value). It returns the array as a WebTurnChanges state and bypasses the state === complete consistency checks. statsUnavailable has the same coercion pattern. The record byte budget also counts path and diff but excludes previousPath.
Production-function evidence
Imported the actual web/protocol/turn-changes.ts in isolated Node. Input {version:2,source:file-tools,sessionId:s,promptEntryId:p,state:[complete],fileCount:0,files:[],additions:0,deletions:0} is accepted and returned unchanged in the state field. No model, live runtime or private Session was involved.
Requirement
Require actual strings from the enum allowlists; reject malformed previous paths consistently; account for retained previousPath UTF-8 bytes in the existing record budget. Keep valid v1/v2 records and current full/partial/unavailable semantics. Add baseline-failing decoder regressions, run check/test and publish a standalone PR.
Deduplication and claim
All-state searches turn changes validation, turn changes malformed and readTurnChangesDetail found no equivalent fix. Claimed on independent fix/turn-change-record-validation, based on latest origin/main above.
Evidence record and validation boundary are in the branch docs/research record; targeted regression was red on origin/main and green after the fix. Full local Windows limitations are stated in the PR.
Activity
outlier27-cell commentedon Oct 7, 2026
Evidence record and validation boundary are in the branch docs/research record; targeted regression was red on origin/main and green after the fix. Full local Windows limitations are stated in the PR.