Repository navigation
/analysis-workflow:allow <guard>: the human lifts a guard for a session - #29
Merged
Merged
Conversation
…sion A rule is broken only with the human's approval, noted as `CONVENTIONS.md` says. A guard's refusal names the command; a UserPromptExpansion hook, which fires only for a command the human types, records the guard for the session, and the guards read that. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
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.
Closes #24. A rule of these conventions can now be broken on purpose, behind two gates: the human's approval and a note in the PR.
What the human does. A guard's refusal now ends with the command that lifts it, so nobody has to know the guards in advance. The agent passes it on; the human types
/analysis-workflow:allow <guard>(layout,paths,pixiorshared-writes), and that guard lets calls through for the rest of the session, its subagents and a resume included. Other guards and other sessions are unaffected.How. A
UserPromptExpansionhook records the guard for the session in the plugin's data directory, and the guards read that record. The event fires only for a command the human types. Tested with Claude Code 2.1.327, it did not fire when the model loaded the skill, when a subagent's report or another session's message was the command line, or for a scheduled prompt. Two simpler channels were ruled out by test: a plain line read byUserPromptSubmit(a scheduled prompt arrives there looking exactly like a typed one), and an environment variable (anenvblock written to a settings file mid-session reaches the hooks, and it would have to be set before the guard is known).Rules no hook enforces. One sentence in the session rules: a rule is broken only with the human's explicit approval, noted as
CONVENTIONS.mdsays (quadbio/analysis_template#32).Limits. Like the guards, this stops accidents: an agent that sets out to can write the session's record itself, which the session rule forbids. Records are never deleted (a few bytes each), so a resumed session keeps its exception. Headless, the model can load the
allowskill's text, so that text claims nothing: only the hook's message says a guard was lifted.+215 −22 lines.
Tests: 176 pass. End to end, in a throwaway repo that enables the plugin, with this branch loaded by
--plugin-dir: an off-layout README edit was refused and the agent passed on the command; once it was typed, the edit and a subagent's off-layout write went through and the stop check stayed quiet; acpintoprocessed/was still refused; a write still passed after--resume; a fresh session in the same repo was refused;allow nonsensewas refused with the four names. Not done: the same run in a repo rendered from the template.🤖 Generated with Claude Code