Skip to content

docs(protected-paths): correct the rule, and make preflight refuse before it stalls - #108

Merged
Ardnived merged 1 commit into
mainfrom
claude/fix-protected-paths-doc
Sep 17, 2026
Merged

Ardnived merged 1 commit into
mainfrom
claude/fix-protected-paths-doc

Conversation

@Ardnived

Copy link
Copy Markdown
Contributor

Six consecutive loop-WeMeditateWeb runs died on WeMeditateWeb#97, whose whole deliverable is a one-line .npmrc change. Each stalled about 90 seconds in, on the same event:

permission prompt Write: Claude requested permissions to edit
  /home/user/WeMeditateWeb/.claude/worktrees/no-auto-install-peers/.npmrc
  which is a sensitive file.

then sat at worker_status: requires_action until its 150-minute lease expired. Seven dispatches across three days, no branch, no PR, no journal entry, three attempts-exhausted notices.

What this repo had wrong

.claude/worktrees is exempt from the guard. implement-issue step 6 is correct as written. Runs have been taking --no-worktree to dodge a guard that was never there — and journalling that belief as measured fact, which is how it spread. Step 6 is deliberately left unchanged by this PR.

The guard reaches far beyond .claude/. .npmrc, .yarnrc*, .pnpmfile.cjs, bunfig.toml, .gitconfig, .gitmodules, .pre-commit-config.yaml, lefthook.*, .mcp.json, .claude.json, and the .git, .husky, .vscode, .devcontainer, .yarn directories all stall a run identically. Nothing in the loop's docs said so, and handler-preflight — the file every run reads first — said nothing about protected paths at all. Nothing warned a run before step 6.

The one thing that was right: permissions.allow cannot pre-empt the guard, because it runs first. Which also means the Edit(**/.claude/**) / Write(**/.claude/**) entries on all five loop routines do nothing and imply a protection that is not there. Worth removing from the routine configs separately — it is an account-level change, not a repo one.

The guardrail

handler-preflight now carries a Protected paths — check before you plan section: decide whether you can write the ticket's targets before planning how; when you cannot, comment which file forces it and that the change needs an attended run, unlock, and stop. Explicitly: do not route around the prompt with sed -i, a heredoc redirect or git apply — that is answering a safety prompt with nobody present.

Also

docs/why.md's "You cannot detect having been blocked" is now "A blocked run cannot see that it is blocked". From inside a run the original claim holds. From outside it does not — the routines API reports requires_action within ~90 seconds, and the dispatcher simply does not poll for it. Recorded as a known gap rather than a law of nature. The old heading had no inbound anchor references; #documentation-lives-outside-claude is referenced by finalize-pr and was kept.

Verification

  • claude plugin validate ./workflow --strict — passed
  • node --test dispatcher/test/*.test.mjs — 75/75 pass
  • grep for both edited anchors across the repo; only #documentation-lives-outside-claude has an inbound reference, and it still resolves

Sources: Claude Code protected paths, plus the run logs for cse_01Xeg72w69V2bwRYV1QsjJwg and cse_011o2eUogG7UT5zzb73yNQWu, 29 hours apart and ending identically.

🤖 Generated with Claude Code

…fore it stalls

Six consecutive `loop-WeMeditateWeb` runs died on WeMeditateWeb#97, whose whole
deliverable is a one-line `.npmrc` change. Each stalled ~90 seconds in on

    permission prompt Write: ... /.npmrc which is a sensitive file.

and then sat at `worker_status: requires_action` until its 150-minute lease
expired — seven dispatches, no branch, no PR, no journal entry.

Two things this repo asserted were wrong, and both changed run behaviour.

**`.claude/worktrees` is exempt from the guard.** `implement-issue` step 6 is
correct as written. Runs have been taking `--no-worktree` to dodge a guard that
was never there, and journalling that belief as measured fact.

**The guard reaches far beyond `.claude/`.** `.npmrc`, `.yarnrc*`,
`.pnpmfile.cjs`, `bunfig.toml`, `.gitconfig`, `.gitmodules`,
`.pre-commit-config.yaml`, `lefthook.*`, `.mcp.json`, `.husky/`, `.git/` and
more all stall a run identically. Nothing in the loop's docs said so, and
`handler-preflight` — the file every run reads first — said nothing about
protected paths at all, so nothing warned a run before it hit the wall.

`handler-preflight` now carries the check: decide whether you *can* write the
ticket's targets before planning how, hand the ticket back when you cannot, and
never route around the prompt with `sed -i`, a heredoc or `git apply`.

Also softened "you cannot detect having been blocked" in why.md. From inside a
run that holds; from outside, the routines API reports `requires_action` within
about 90 seconds. The dispatcher not polling for it is a known gap, not a law of
nature.

`permissions.allow` genuinely cannot pre-empt the guard — that part was right.
Which means the `Write(**/.claude/**)` entries on the loop routines do nothing.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@Ardnived
Ardnived marked this pull request as ready for review September 17, 2026 01:16
@Ardnived
Ardnived merged commit 82b1559 into main Sep 17, 2026
5 checks passed
@Ardnived
Ardnived deleted the claude/fix-protected-paths-doc branch September 17, 2026 01:16
@sydevs-bot

Copy link
Copy Markdown
Contributor

I could not request a reviewer here, so this is the step left for you.

  • request a reviewer — GitHub said: Review cannot be requested from pull request author. - https://docs.github.com/rest/pulls/review-requests#request-reviewers-for-a-pull-request

🤖 sydevs dispatcher

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

2 participants