WriteGuard covers only the Write tool; Edit and Bash bypass the role scopes #474
Labels
No labels
P0
P1
P2
P3
bug
create
delete
enhancement
filed-by/agent
filed-by/user
frozen
lint-rule
needs-info
needs-triage
next
plugin/cc-architect
plugin/os
plugin/os-adr
plugin/os-aidd-lint
plugin/os-backlog
plugin/os-context
plugin/os-doc-hygiene
plugin/os-sdlc
plugin/os-vault
project/cc-os
ready-for-agent
ready-for-human
recurring
review
update
waiting
wayfinder:grilling
wayfinder:map
wayfinder:map
wayfinder:research
wayfinder:task
wayfinder:task
wontfix
worklist/deviations
worklist/lint-rule
worklist/new-implement-build
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
jared/cc-os#474
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Context
Blueprint §9 close-out check (#468) found criteria 4 and 5 only partially met: the three-scope WriteGuard (#466) gates the Write tool, but agents/test-writer.md grants Edit and Bash, and programmer/refactorer grant Bash — a test-writer can Edit production files and any writer role can shell-write; the no-test-run/no-lint-run rules are prose-only. Fix path: extend the guard hook to Edit (same role×path table) and decide whether Bash gets command-pattern gating or the tool grants get narrowed in agent frontmatter.
Skeptic verdict: CREATE — real enforcement gap, distinct root, validation hard floor.
Origin
Work started on branch 473-474-guards. Design: WriteGuard extends to Edit; new BashGuard denies judges on write-shaped commands and writer roles on out-of-scope extractable targets (fail-open otherwise, boundary documented in tests); shared ScopePolicy extracted; hook matcher ^(Write|Edit|Bash)$; hook-level subprocess tests. Codex-reviewed package.
Resolution
Done: PreToolUse guard now covers Edit (WriteGuard MUTATING_TOOLS) and Bash (new BashGuard: judges denied on any mutation evidence incl. fd redirects, >|, tee, sed/perl -i, mutating segment-head executables; writer roles denied on out-of-scope extractable targets, fail-open otherwise). Role/scope rules unified in ScopePolicy; hook matcher ^(Write|Edit|Bash)$; hook subprocess + manifest under direct test.
Evidence: Commits
63e06f6+7283e51, merged2d4babeon main; ADR-0156 amends ADR-0138/0126; new tests bash_guard_test.rb, tests/hooks/pre_tool_use_hook_test.rb, Edit rows in write_guard_scope_test.rb; full suite 1218 runs 0 failures; plugin cache refreshed.Follow-ups: none — Bash sieve blind spots (git commit, ruby -e File.write) are the declared boundary per ADR-0156, documented by allow-tests; deliberately not hardened