Skip to content

Pin the compiler/repair no-cookie guarantee with a tripwire test #101

Description

@myselfsiddharth

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:

  1. 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.
  2. 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

npm run test
npm run ci

Before you open the PR

  • Tripwire test(s) added and passing
  • docs/privacy/session-custody.md SC-04 status upgraded from "enforced by construction" to "enforced by construction + test"

Metadata

Metadata

Labels

area: compilerTouches compilerarea: runnerTouches runnerprivacy-boundaryTouches the privacy boundary — canary is merge-blockingsecuritySecurity-relatedtrack-1Technical gate / churn harness

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions