🐛 fix: P-18 the owner's SSH route covered
Slice: #46
Covers the owner's SSH route to GitHub (finding (c)). After machine signed gh out of the owner, git still reached GitHub as the owner over SSH, using the owner's ~/.ssh/id_ed25519 from the SSH agent. Stacked on #61 (P-17), whose env lock this relies on. It retargets to main once #61 merges.
-
The pre-push identity guard, for every adopter (spec G-6).
onboardnow writes the pre-push hook withidentityalone, not only withwork-rules, and replaces the hook older releases wrote.process-rules pre-pushnow takes git's remote URL and first checks who the push reaches GitHub as. In an agent session, it refuses:- a push to GitHub over SSH, because it would use this Mac's keys, which are the owner's;
- over HTTPS, a push with credentials that are not the agent's. It asks
git credential fill(never prompting) for the credentials git would push with, then asks GitHub's/userwhose they are. A refusal names the account.
An agent session is one where
PROCESS_RULES_AGENTis set, or any shell where Claude Code setsCLAUDECODE=1, so the guard holds in a session whose Claude Code hooks never ran. The owner's own pushes are left alone. The hook runs the launcher from #61 and refuses an agent session's push when no CLI can run. The work rules follow as before whenwork-rulesis on. -
machineanddoctorname the route. They runssh -T -o BatchMode=yes git@github.comand name the account GitHub greets, other than the agent, with what covers it. Removing the route is out of scope, asdocs/decisions.mdrecords: the key is the owner's own way to GitHub, and an agent session runs as the same macOS user. The coverage is #61'senvlock (SSH remotes on HTTPS, SSH refused) plus this guard. Only a separate macOS user would close a session that works around both on purpose.
Proof against the sandbox (athya-hq/process-rules-sandbox, cloned locally, this build's pre-push hook, the launcher pointing at this build; --dry-run, so nothing could be pushed):
- A Claude Code shell with the identity removed, pushing to
git@github.com:athya-hq/process-rules-sandbox.git: SSH authenticated as the owner, then the guard refused with✗ this push goes to GitHub over SSH, with this Mac's SSH keys, which reach GitHub as their owner, not AthyaBot…. - The agent session over HTTPS: the identity check passed, and the work rules then refused the slice-less probe commit.
- The owner's terminal (no
CLAUDECODE) over SSH: the push went ahead.
git ls-remote shows no probe branch on the sandbox. On this Mac, this build's doctor printed ! ssh reaches GitHub as AlokBansal8 with this Mac's keys; ….
pnpm check passes (500 tests).
🤖 Generated with Claude Code