Pre-tool-use hook cannot learn the target at a multi-target root, so the write guard stays permissive there [capture] #575
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#575
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
#571 made
ScopePolicy.loadresolve the project from cwd viaProject.load(target: ENV["OS_SDLC_TARGET"]), rescuing onlyTargetSelectionErrorto a niltest_path(ADR-0178). At the cc-os root,.sdlc/project.yamldefines five named targets. The hook process inherits the Claude Code session env, andOS_SDLC_TARGETis unset in a normal session (verified 2026-09-14). So at this root the guard still allows a test-writer to write production code.VERDICT: CREATE
REASON: Reproduced security gap — write guard is provably permissive at multi-target roots without user env export, matching a recorded ADR-0178 consequence, not a hardening speculation; this is the root (design gap, not another symptom of #572-574).
Observed
Prints nothing (allow). With
OS_SDLC_TARGET=os-sdlcexported the same event prints a deny.Reproduce
Expected
The hook denies the write at a multi-target root during a pipeline run without the user exporting an env var. Candidate sources for the target: the open implementation row in
.sdlc/pipeline.db(the runner already knows the target per ADR-0169), or the runner exportingOS_SDLC_TARGETinto agent env at dispatch.Origin
Resolution
Done: Won't-fix by deletion: the PreToolUse write guard is removed (hook, WriteGuard, BashGuard, ScopePolicy, six tests, hooks.json entry). The OS_SDLC_TARGET read that #571 added to ScopePolicy.load is gone with the file.
Evidence: Transcript search of every session and subagent file since 2026-08-18: zero live denials, only self-tests. One run failure caused by the guard (#528 impl 8). Merged to main
4a5e0c3, ADR-0182 supersedes ADR-0126/0156, voids ADR-0138 guard clauses and the ADR-0178 ScopePolicy clause. Suite 1159 runs, 0 failures. Plugin cache refreshed.Follow-ups: none