Repository navigation
feat(checks): let the ADR guard allow appends and cover Bash writes - #59
Merged
Merged
Conversation
The PreToolUse guard blocked every edit to an existing ADR and pointed at a kill-switch only the session's launcher can set, so the repo's own required appends (amendments, graduation-log entries) had no move an agent could take. It also watched only Edit and Write, so a shell command rewrote an ADR without touching the hook. - Allow Edit/Write/MultiEdit on an existing ADR when the result keeps all existing text and only adds after it; keep blocking everything else - Extend the matcher to MultiEdit and Bash; block shell writes to existing protected files (heuristic guard rail, not a security boundary) - Protect only numbered ADR files, leaving docs/adrs/README.md free for a generated index - Reword rejections to name moves the agent can take - Add stdlib unittest coverage and run it in the enforcement CI job - Record the change as an appended amendment to ADR 0012 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Summary
docs/adrs/README.mdfree for a generated index.Attack surface
None added. This narrows what an agent session can do to ADR files through the shell.
Cost
One new CI step in the existing enforcement job: stdlib
unittest, about one second. No new dependency.Test plan
python -m unittest discover -s checks/tests— 15 tests passpython checks/run_checks.py --ci— 0 findingsADR impact
Notes for reviewers
The hook matcher change takes effect in new sessions. Running sessions keep the matcher they started with.
🤖 Generated with Claude Code