Skip to content

fix(person-gate): strip every spelling of the person token; check inherited env - #710

Merged
davesheffer merged 2 commits into
mainfrom
fix/person-token-residuals-2
Nov 26, 2026
Merged

davesheffer merged 2 commits into
mainfrom
fix/person-token-residuals-2

Conversation

@davesheffer

Copy link
Copy Markdown
Owner

Follow-ups to #709.

  • takePersonToken still reads the token from HUNCH_PERSON_TOKEN, and now deletes every case-insensitive spelling of the name from process.env, the same way hunch ui does for its children. Before this, a process that started with two spellings (a case-sensitive parent on Windows) kept one, and children inherited it.
  • hasPersonToken(undefined) now checks process.env, which is what run() inherits, instead of reporting no token.
  • A test pins the anonymous lane's absence check. It is a source-text test, because runAnonymousLane clones repos and runs the installed CLI.

Checks:

  • tsc: exit 0
  • test/matrix-release-verification.test.ts: 14/0
  • test/person-gate.test.ts: 22/0
  • test/env-surface.test.ts: 7/0

critic-risk (security): PASS.

Residuals:

  • On Windows, the new strip test also passes on base, because the spellings collapse into one variable. It fails on base only on POSIX. The Windows duplicate-case env block is checked by a manual probe only, not by a test.
  • The test's cleanup does not restore a HUNCH_PERSON_TOKEN* that was already in the developer's shell. The older test does the same.
  • hasPersonToken(undefined) === true is conservative: run() strips the token unless allowPersonToken is set. The only production caller passes actor.env, so runtime behaviour is unchanged today.
  • Several working-copy files are CRLF despite .gitattributes eol=lf. Committed blobs are LF.

🤖 Generated with Claude Code

…erited env

Follow-ups to #709: takePersonToken deletes every case-insensitive
spelling of HUNCH_PERSON_TOKEN, hasPersonToken(undefined) checks
process.env, and a test pins the anonymous lane's absence check.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
hunch Ready Ready Preview Nov 26, 2026 12:54pm UTC

@github-actions

github-actions Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

🧠 Hunch — Engineering Memory Guard

✅ This PR touches no recorded invariants (directly or via blast radius) and re-introduces nothing deliberately retired across 5 changed file(s).

📜 Hunch Constitution — 2 policy receipt(s)

  • ✅ pol_01cf084e1e satisfied — symbol:renderAdoptedDoc does not reach symbol:writeFileAtomic
    • receipt: sha1:8fb90196147575398f80f4dfa1073f399034ef91
  • ✅ pol_3f3aee11ad satisfied — symbol:src/store/db.ts:openDb does not reach external:better-sqlite3
    • receipt: sha1:4593e4a21a7e1f67a68edb9d746d9b8d1e4c55f8

@davesheffer
davesheffer merged commit f01dcc5 into main Nov 26, 2026
25 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 26, 2026

This branch was successfully deployed

1 active deployment
Preview — 152096bd Deployed Nov 26, 2026 by vercel[bot]
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant