Repository navigation
feat(report): report access on by default under its own switch; stricter unlock - #164
Merged
Merged
Conversation
…k checks the id, the address and repeat readers AEO_REPORT_GATE (enforce unless off/observe) now governs report access and unlock readiness, separate from the run gate. The unlock proof key falls back to an HKDF key derived from the server key, so no new setting is needed. Unlock refuses a non-UUID id, reserved example/test email domains, and a sixth distinct email per audit; a repeat email unlocks without a second write or CRM call. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…sts the session; doc and comment wording Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
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.
What
Report access gets its own switch,
AEO_REPORT_GATE, and is on by default. It no longer waits for the run gate (AEO_GATE_MODE, still off by default).enforce(default),observe(log only),off(the off switch).AEO_UNLOCK_COOKIE_SECRETwhen set, otherwise an HKDF key derived from the server's database key, so no new setting is needed. With no key at all, reports stay locked.npm run gate:checkprints the report gate on its own line. Guide and CLAUDE.md updated.Before this goes live (owner)
AEO_STAFF_EMAILSand signed in, which needs draft 008 applied first (see feat: staff mode (sign-in + allow-list; no lead, cap exempt; ships inert) [rebased #160] #162). Otherwise they unlock with the prospect's email, which writes nothing new.Pipeline: /tdd (gate.report.test 8 red first; unlock id/address/repeat/limit cases 8 red, the after-write limit and staff-session cases 2 red; route specs updated where they assumed "unset = off") → code-reviewer subagent → /security-review
Risk tier: high (public route, lead data)
Risk
AEO_REPORT_GATE=offand redeploy, or revert.AEO_UNLOCK_COOKIE_SECRETis later set or the database key rotated, earlier unlocks re-lock; visitors unlock again.Code review: the code-reviewer subagent found no leak or forgery path. It raised: concurrent requests could beat the 5-reader limit (fixed: recount after the write gates CRM and cookie, with a test); staff cookies lasting a year (fixed: session cookie, with a test); the HKDF test was too weak (fixed: compared against a proof signed with the raw key); a guide line missing the status API's preview tips (fixed). CRM reps seeing the preview is an ops step, listed above. Pre-existing and left as is: staff can't run custom questions on an audit with no public lead.
Security review: no findings at confidence ≥ 8 (proof bound to the audit id, constant-time compare, every reader of report data checks access, no PII in new log lines).
Checks:
npx vitest run273/273 in 25 files;npx tsc --noEmitclean; eslint on changed files 0 errors.🤖 Generated with Claude Code