De-fork the hook: adopt cli-guard's shared engine #37
No reviewers
Labels
No labels
burndown-2026-06
pressure-test
sunday-sprint
coherence-core
consult
headless
interactive
P0
P1
P2
P3
P4
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
coilyco-flight-deck/ward!37
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "chore/defork-cli-guard-hook"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
De-forks ward's hook off its private copy of the engine and onto cli-guard's shared
hookpackage. Closes #36 and unblocks the protected-binary half of #4.Commits
chore(deps): migrate cli-guard to the forgejo module path— drops the stalegithub.com/coilysiren/cli-guardpin for the canonicalforgejo.coilysiren.me/coilyco-flight-deck/cli-guard@e102d72(the merged protected-binary primitives, cli-guard #54/#55). Behavior-preserving.refactor(hook): adopt cli-guard's shared hook engine— deletes ward's forkedsplitSegments/stripEnvPrefix/leadingToken/checkBinaryPath/routeHint/tableFor/prefixand delegates the Bash decision tohook.PreToolUse. ward's route tables pass as[]hook.Route(gh-GraphQL suffix viaRoute.Extra), the guard-binary allow-list as[]hook.IntegrityRule. ward keeps what the engine doesn't own: the file-write sidequest-registry check and coily-vs-ward guard selection.Behavior
All existing hook tests pass unchanged. Adopting the engine gains the arbitrary-code-execution denies the fork lacked — interpreter (
python3 -c ...), exfil (echo $VAR), scratch-exec (/tmp/payload.sh) — a deliberate security improvement (see #19), locked by two new ward-level tests.Validation
go build ./...,go test ./...,go vet ./...green against the forgejo cli-guard module. Nogithub.com/coilysiren/cli-guardreferences remain.Next (not in this PR)
ward doctor security, thesecurity:-config →hook.Protectedwiring, andWARD_CONFIG/--configresolution land on top, under #4.