Context
Follow-up from #37 (docs/privacy/session-custody.md, requirement SC-04). Verified at audit time: src/compiler/types.ts's Trajectory/TrajectoryStep/Fingerprint interfaces and src/runner/types.ts's PageStateSnapshot (the repair-model input) both have no cookie/storage-shaped field, matching contracts/trajectory.schema.json's additionalProperties: false. This is real today — the gap is that nothing pins it. A future field addition to any of these types (or a loosened schema) would silently reopen the compiler's / repair model's exposure, and nothing in CI would notice.
What to produce
A small unit test (or a couple) that:
- Asserts a fixed forbidden-key list (
cookies, cookie, storageState, storage_state, localStorage, sessionStorage) never appears as a key anywhere in a JSON.stringify'd Trajectory/TrajectoryStep/Fingerprint produced from realistic compiler input.
- Does the same for
PageStateSnapshot / RepairContext.page_state in src/runner/.
This is a tripwire, not new enforcement — it should currently pass trivially. Its only job is to fail loudly the day someone adds a field it shouldn't.
How to test
Before you open the PR
Context
Follow-up from #37 (
docs/privacy/session-custody.md, requirement SC-04). Verified at audit time:src/compiler/types.ts'sTrajectory/TrajectoryStep/Fingerprintinterfaces andsrc/runner/types.ts'sPageStateSnapshot(the repair-model input) both have no cookie/storage-shaped field, matchingcontracts/trajectory.schema.json'sadditionalProperties: false. This is real today — the gap is that nothing pins it. A future field addition to any of these types (or a loosened schema) would silently reopen the compiler's / repair model's exposure, and nothing in CI would notice.What to produce
A small unit test (or a couple) that:
cookies,cookie,storageState,storage_state,localStorage,sessionStorage) never appears as a key anywhere in aJSON.stringify'dTrajectory/TrajectoryStep/Fingerprintproduced from realistic compiler input.PageStateSnapshot/RepairContext.page_stateinsrc/runner/.This is a tripwire, not new enforcement — it should currently pass trivially. Its only job is to fail loudly the day someone adds a field it shouldn't.
How to test
npm run test npm run ciBefore you open the PR
docs/privacy/session-custody.mdSC-04 status upgraded from "enforced by construction" to "enforced by construction + test"