Repository navigation
fix(verify): check harness logins before any install or GitHub write (#146) - #149
Conversation
…146) Co-Authored-By: Claude Opus 5.5 <[email protected]>
Merge Protections🟢 All 2 merge protections satisfied — ready to merge. Show 2 satisfied protections🟢 Queue ready pull requestsAutomatically queue non-draft pull requests targeting main after verify, Unfret, and live-gate pass on the head.
🟢 🚦 Auto-queueWhen all merge protections are satisfied and these conditions match, this pull request will be queued automatically.
|
…record the Codex login result (#146) Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
| f.options.driver = new MacDriver(run, async () => { throw new Error('no session expected'); }); | ||
| await expect(verify(f.options)).rejects.toThrow('Claude login check failed: `claude auth status` did not report "loggedIn": true; run `claude auth login` from a shell on this Mac, not over SSH'); |
There was a problem hiding this comment.
MacDriver.preflight() passes the real process.platform to doctor(), which rejects Linux before running the mocked Claude login command. This test therefore gets “Live gate requires an operator Mac” instead of the expected login error, breaking bun run test on Linux. Set and restore process.platform for this test, as the existing driver tests do, or inject the platform.
✅ No blocking findingsWalkthroughThis PR makes the verifier check that the Claude and Codex harnesses are logged in before it installs anything, runs any session, or writes to GitHub. Previously an expired login only surfaced at the first live session, which then posted a misleading failure comment and set
Advisories (1)
Details
First review of this pull request. @unfret review · @unfret status · @unfret help |
Live evidence: Open Pstack
|
Merge Queue Status
This pull request spent 2 minutes in the queue, including 1 minute 48 seconds running CI. Required conditions to merge
|
Live evidence: Open Pstack
|
Closes #146
Summary
A failed login now stops
verify.sh runbefore thetryblock, so the run publishes nothing. The CLI prints the harness name and the fix on stderr.verify.sh doctorrecords the same login checks indoctor.json.doctor --candidateis unchanged.Evidence
claude -psession. The verifier then posted a failed evidence comment and setlive-gate=failure, although no feature had run.verify.test.tscase runs the realMacDriver. Its stubbedclaude auth statusprints{"loggedIn": false}and exits 1, which is what Claude Code 2.1.289 does when logged out. Here is how that was observed:verify()rejects with the Claude fix message, that no comment or status was published, and that nogit cloneorcodex plugininstall command ran.verify.sh doctorexit 0;claude login: logged in; the Codex check passed (exit 0) through the probe home; the probe.codexwas removed; the account email appears 0 times indoctor.json.live-gatecomment for this head.Merge Danger
Door: two-way. The change is verifier tooling only, so a revert restores the old order.
Blast Radius: verifier
The change affects only
.claude/skills/verify-open-pstack/, which does not ship in the plugin. If a login check misfires, it blocks a live-gate run before it publishes anything. It cannot publish a wronglive-gate.Acceptance criteria
verify.sh runchecks the login of each harness that has a named feature,--self-testincluded."verify.tscallsdriver.preflightwhenrequiredHarnesses(receipt)is non-empty, before the publishingtry.verify.test.ts: "a logged-out Claude stops the real driver before any install or GitHub write", and the ordering assertionpreflight<prepare.isolatedEnv(probe-home), which keeps the real HOME, USER and LOGNAME and the normal operator config. The doctor test assertsHOME.LoginRequiredis printed to stderr bycli.ts.doctor.test.tscovers four failures: logged out,loggedIn:falsewith exit 0, malformed output, and a Codex nonzero exit.verify.sh doctorreports the same login checks indoctor.json. Candidate-mode doctor stays as it is."claude loginandcodex login.doctor.json.claude auth statusandcodex login status.linkCodexAuthcreates a symlink and never reads the file. The doctor test asserts that the operator'sauth.jsonbytes are unchanged and that the probe.codexis removed.runbefore any GitHub call. The live gate runsproject-skillin both harnesses (--self-test)." The test is above. The live gate runs--feature claude:project-skill --feature codex:project-skill --self-testfrom this head's checkout, so the publisher revision equals the candidate SHA.Gate results
On e231949, which fixes the Linux CI failure of the new test and records
codex login: logged in(codex login statusprints on stderr): the same checks, plus the verifier suite replayed withprocess.platformforced to linux, all exited 0 (112 pass, 0 fail each). Earlier, on 3b965f2: install, Bun tests, strict typecheck, manifest parse, static invariants (PSTACK_STATIC_ONLY=1 bash tests/skill-collision-repro.sh),claude plugin validate plugins/pstack, and the verifier's ownbun run testandbun run typecheckall exited 0. The verifier suite ran 112 pass, 0 fail.Not verified
codex login statuswith a logged-out Codex. It was not run against the operator account, because that would mean logging out. With an emptyCODEX_HOMEit prints "Not logged in" and exits 1, and the check treats any nonzero exit as a failure.harness.test.ts("prepare pins local Git candidate"). Across all runs on this branch it failed about 1% of the time, with two symptoms: asessionsmismatch, andpreparethrowing beforestate/claudeexists, which the test'sfinallythen masks. A 150-run loop had 1 real failure (run 113). Its other failure, run 36, was the loop reading a mid-edit tree.mainhad 0 failures in 80 runs, which is too few to show the flake is new. I found no code path from this change to that test.🤖 Generated with Claude Code