Repository navigation
feat(cli): deny a role's pane what the guard watches - #34
Merged
Merged
Conversation
baton hook guard is the plugin's preToolUse hook. In a role's pane it denies a bash call that the guard can't read or that runs a command that the guard watches, but baton's commands for a role, and a create or edit of a file in baton's folder, however its path names it. It says nothing in the orchestrator's pane yet, and fails, so that copilot denies, when it can't decide (decision 52). A live check with the real copilot under --allow-all saw the hook deny tmux and a create in baton's folder, and let other writes run (fact 36).
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Step
guard-hook(docs/plan.md §0):baton hook guard, the plugin'spreToolUsehook.What it does
In a role's pane (decision 52):
bashcall whose script the guard can't read, or that runs a command that the guard watches (decision 51), but baton's commands for a role:baton wait,handover,ask,statusand help;createoreditof a file in baton's folder, however its path names it: relative, through a symlink, in other case on a disk that ignores case, or a new file in a new folder (anos.SameFilewalk up the path's folders);guard-orchestrator;BATON_ROLE, a folder outside a repo.Each reason starts with "baton's guard stopped this call, and none of it ran." and says what the role can do instead.
hooks.jsongains thepreToolUsehook, run throughBATON_BINas the stop hook is.Checks
guard_test.go(27 script rows, other tools, the orchestrator's pane) andguard_files_test.go(13 paths × create/edit, a repo without baton's folder, 9 failure rows, an output it can't write).guard.go100%,internal/cli99.8%, total 99.3%.resolve's root guard, whichEvalSymlinksnever reaches at/or.).copilot -pwith Claude Haiku 5.5,--allow-all, deny rules, a throwawayCOPILOT_HOMEand a throwaway repo with no remote, 0.21 AI credits. The hook deniedtmux -Vand acreatein baton's folder, and let acreateand aneditelsewhere run. The hook's input showedtoolArgsas objects forbash,createandedit(fact 36). The user's~/.copilotand Keychain item were unchanged.Known gaps
The guard stops a role's mistakes, not a role that sets out to get past it (decision 52, risks 2, 11 and 12):
bash's own writes (into baton's folder, or over the binary thatBATON_BINnames), a hard link to a file in baton's folder, data in aweb_fetchURL, and writes to the plugin's cache, whose folder baton trusts by its name. The new stepplugin-checkcloses the cache gap for the file tools and the next panes;beltis for the rest.Decision 52 is a lead's call, flagged for the end review.