Block Bash writes to docs/adr in the os-adr hook #1012

Open
opened 2026-10-15 17:17:20 +00:00 by jared · 0 comments
Owner

Problem

ADR-0296 makes adr-new the only way to change an ADR. The os-adr PreToolUse hook denies only Write, Edit, MultiEdit and NotebookEdit on docs/adr/. A Bash command can still write, move or delete ADR files without the reversal judge. So the "one way" rule is not enforced for Bash.

Observed

During the 2026-10-15 ADR cleanup, an agent repaired the frontmatter of docs/adr/0154-*.md and docs/adr/0189-*.md outside adr-new. No hook stopped it.

Reproduce

n/a: design gap. Any Bash command such as sed -i 's/x/y/' docs/adr/0003-*.md writes the file without a deny.

Origin

  • Trigger: bulk adr-new challenge run on 2026-10-15 (ADR-0296 cleanup).
  • Improvised this session: none. The repaired files were later deleted by the judge.
  • Chain: ADR file changed without the judge ← Bash is not matched by the hook ← plugins/os-adr/hooks/hooks.json matcher is Write|Edit|MultiEdit|NotebookEdit (DESIGN, ADR-0296).
  • Root candidate: this ticket.
  • Where: plugins/os-adr/hooks/pre_tool_use.py, plugins/os-adr/hooks/hooks.json
  • Session: dc4053c4-4f38-4e1b-b4f9-aa3849695102
  • Transcript: /home/jared/.claude/projects/-home-jared-dev-cc-os/dc4053c4-4f38-4e1b-b4f9-aa3849695102.jsonl

VERDICT: CREATE
REASON: The user directed "there should be only one way to create an ADR"; this is the root for Bash enforcement.

## Problem ADR-0296 makes `adr-new` the only way to change an ADR. The os-adr PreToolUse hook denies only Write, Edit, MultiEdit and NotebookEdit on `docs/adr/`. A Bash command can still write, move or delete ADR files without the reversal judge. So the "one way" rule is not enforced for Bash. ## Observed During the 2026-10-15 ADR cleanup, an agent repaired the frontmatter of `docs/adr/0154-*.md` and `docs/adr/0189-*.md` outside `adr-new`. No hook stopped it. ## Reproduce n/a: design gap. Any Bash command such as `sed -i 's/x/y/' docs/adr/0003-*.md` writes the file without a deny. ## Origin - Trigger: bulk `adr-new challenge` run on 2026-10-15 (ADR-0296 cleanup). - Improvised this session: none. The repaired files were later deleted by the judge. - Chain: ADR file changed without the judge ← Bash is not matched by the hook ← `plugins/os-adr/hooks/hooks.json` matcher is `Write|Edit|MultiEdit|NotebookEdit` (DESIGN, ADR-0296). - Root candidate: this ticket. - Where: `plugins/os-adr/hooks/pre_tool_use.py`, `plugins/os-adr/hooks/hooks.json` - Session: dc4053c4-4f38-4e1b-b4f9-aa3849695102 - Transcript: /home/jared/.claude/projects/-home-jared-dev-cc-os/dc4053c4-4f38-4e1b-b4f9-aa3849695102.jsonl VERDICT: CREATE REASON: The user directed "there should be only one way to create an ADR"; this is the root for Bash enforcement.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
jared/cc-os#1012
No description provided.