🐛 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. It builds on P-17 (#61), whose env lock it relies on. It replaces #62, which auto-merge merged into the stacked P-17 branch by mistake; that merge was undone there.
-
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, and so are cloud sessions' pushes: they reach GitHub as the account connected to them. 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 (508 tests).
Release v0.6.0, with P-17 and P-18. #64 had already merged before the decision to make this one release, so package.json and the README install line on main already say 0.6.0, and nothing is tagged yet. Once this merges, tag v0.6.0 on this pull request's merge commit; the release then ships both slices:
- P-17 (#61): the
envlock in the client's settings, the PreToolUseguard, the launchermachinewrites (doctorchecks it), session-start's failures reaching the session, onboard's Verified check retrying, and hook entries upgraded in place. - P-18 (this pull request): the pre-push identity guard for every adopter, and
machine/doctornaming the owner's SSH route.
After the release:
- On each Mac: install 0.6.0, then run
process-rules machine <agent>once to write the launcher.doctorfails until it exists. - In each client: run
onboardagain to upgrade.claude/settings.jsonand the pre-push hook. - In this repository: a follow-up moves the workflow pin to v0.6.0, and
.claude/settings.jsonand the pre-push hook to this release's. That has to wait for the release, because the 0.5.0 CLI has noguard.
🤖 Generated with Claude Code