docs(privacy): session-custody requirements checklist + gap analysis - #104
Open
myselfsiddharth wants to merge 1 commit into
Open
docs(privacy): session-custody requirements checklist + gap analysis#104myselfsiddharth wants to merge 1 commit into
myselfsiddharth wants to merge 1 commit into
Conversation
…37) Restates PRD §7's five Fork-A session-custody requirements as six checkable SC-01..SC-06 rows (splitting "never written to logs or trajectories" since the two have different enforcement today) and reads the code at HEAD against each, citing file:function and verifying rather than assuming: - SC-02 (trajectories) and SC-04 (compiler input) are enforced by construction: no code path reads cookies/storage in the first place, the recorder's own output-object construction never serializes runtime bindings, and additionalProperties:false closes every schema in the pipeline. One residual gap each, filed as follow-ups. - SC-03 (logs) is conventional only, and empirically weaker than CONTRIBUTING.md's "secret-scanning CI fails the build on matches" claims: a synthetic Playwright storageState()-shaped fixture matched zero of secret-scan.mjs's eight patterns. Filed as #100. - SC-01 (encryption at rest) and SC-05 (consent language) are not addressed — no persistence mechanism and no consent copy exist yet. - SC-06 (ToS per anchor site) is not addressed and currently inapplicable: no vertical is locked (ADR-0004) and Track 1 is self-hosted by design (ADR-0003), so there is no third party's ToS in play yet. Explicitly separates this from docs/privacy/boundary-spec.md's pooling allowlist (different boundary, different failure mode, canary tests cover only the first) and states Track-1's fixture-credential posture plainly. Six follow-up issues filed and linked from the table (#98-#103). One one-line fix taken inline: a stale redact.ts line citation in architecture.md's invariant list. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #37.
Summary
docs/privacy/session-custody.mdrestates PRD §7's Fork-A session-custody requirements as six checkable rows (SC-01..SC-06) and audits the code at HEAD against each — citing file:function for every "enforced" claim and verifying it, not assuming it, per the issue's core ask.Notable findings
TrajectoryRecorder.toTrajectory()never serializes runtime bindings (only the type map), andadditionalProperties: falsecloses every schema in the pipeline (trajectory → cache-row → assertion → metrics) — a cookie field isn't just unpopulated, it's invalid. Verified by walking the schemas directly, not by reading the doc comment.CONTRIBUTING.mdclaims "Secret-scanning CI fails the build on matches" for session/storage dumps. I built a synthetic (fake-valued) fixture shaped exactly like a real PlaywrightstorageState()dump and ran it against all eight ofsecret-scan.mjs's patterns: zero matched. The existing patterns look forSet-Cookie:text or a"sessionid"-named key — not thecookies: [{name, value, domain, httpOnly, sameSite}]array shape Playwright actually produces. No real session material was used or committed anywhere in this process.docs/privacy/boundary-spec.md's canary tests (verified by readingtests/canary/*.test.ts) seed fake account ids/names/thresholds and prove they don't reach the pool — that's a different boundary (cross-tenant leakage) with a different failure mode than custody (session material at rest anywhere, including tenant-scoped rows and logs).Follow-up issues filed (linked from the doc's table)
toTrajectory()bypass gap + auto-discover trajectories for schema validationsecret-scan.mjsto catch a realstorageState()shape (with the empirical gap reproduced as a fixture)One-line fix taken inline
docs/architecture.mdinvariant 3 citedsrc/recorder/redact.ts:66-81forassertNoLiteralSecrets; verified the function is actually at lines 102-117 at HEAD. Corrected, and bumped the doc'supdateddate.Test plan
npm run secret-scan— clean (had to reword three spots in the new doc that literally contained the trigger substringSet-Cookie:while describing the existing pattern — confirmed the fix empirically before and after)npm run test:canary— clean, confirms the canary still only tests the pooling boundary, not custodynpm run lint:docs— clean (46 docs)npm run ci— clean (secret-scan, contracts, lint, typecheck, unit + integration)Checklist (from the issue)
docs/README.mdprivacy table row addedtrack1/b5-session-custody🤖 Generated with Claude Code