Skip to content

Fix the triage bot's blocked test runs, and drop the dead Write() rules - #4704

Merged
springfall2008 merged 2 commits into
mainfrom
fix/triage-bot-write-permission-rule
Aug 24, 2026
Merged

Fix the triage bot's blocked test runs, and drop the dead Write() rules#4704
springfall2008 merged 2 commits into
mainfrom
fix/triage-bot-write-permission-rule

Conversation

@springfall2008

@springfall2008 springfall2008 commented Aug 24, 2026

Copy link
Copy Markdown
Owner

Follow-up to #4703, two fixes to the triage bot's permissions.

Test runs were still being denied

The bot reported ./run_all --test solis denied even though Bash(./run_all*) was allowed. The rule was never the problem. Per the permissions docs, a cd combined with an output redirect prompts, "because Claude Code can't determine which directory the redirect target resolves against after the cd runs" — and the skill's recipe was exactly that shape:

cd coverage && ./run_all --test <name> > <scratch>/test.log 2>&1

So it was refused under dontAsk regardless of what was in the allowlist. run_all has to execute with coverage/ as the working directory, so the cd can't simply be dropped.

tools/triage_test.sh (new) keeps both the cd and the redirect inside the script, leaving one plain command for the permission check to match:

tools/triage_test.sh solis <scratch>/test.log

It prints the exit status and the last 30 lines of the log, and exits with the test run's own status. The skill now tells the bot to use it and says why, so it doesn't improvise the denied form again.

Also drops the coverage/run_all rules added in #4703 — those forms can't work at runtime anyway, since run_all sources setup.csh and resolves unit_test.py relative to coverage/ — and switches the remaining run_all rules to the word-boundary form (Bash(./run_all *) rather than Bash(./run_all*), which would also match ./run_all_anything).

Dead Write() rules

Write(path) rules are not matched by the file permission check — only Edit(path) rules are, and an Edit rule covers every file-editing tool, Write included. The two Write(...) entries granted nothing; the Edit(...) rules beside them already cover the clone and the scratch directory. Removed, with a comment so they don't come back.

Testing

Ran the wrapper end to end against a real test module (tools/triage_test.sh units <log>): exit 0, log written, pass/fail summary in the printed tail. pre-commit passes on all three files.

🤖 Generated with Claude Code

Write(path) rules are not matched by the file permission check - only
Edit(path) rules are, and those cover every file-editing tool including
Write. The two Edit rules already grant the clone and scratch paths, so
the Write entries granted nothing.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings August 24, 2026 12:56

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The change is a small, localized allowlist cleanup with no functional code-path modifications beyond removing redundant entries and adding clarifying commentary.

Pull request overview

Removes two redundant Write(path) allowlist entries from the triage bot tooling, relying solely on the existing Edit(path) scopes for file modifications and documenting why Write(...) should not be reintroduced.

Changes:

  • Dropped Write({EDIT_SCOPE}) and Write({SCRATCH_SCOPE}) entries from ALLOWED_TOOLS.
  • Added an inline comment explaining that Edit(path) already covers file-editing tools and to avoid re-adding Write(path) rules.
File summaries
File Description
tools/triage_daemon.py Removes redundant allowlist entries and documents the intended permission-scoping approach.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Running a targeted test was still denied despite the ./run_all rule being
present. The rule was not the problem: Claude Code prompts on a `cd`
combined with an output redirect, because it cannot tell which directory
the redirect target resolves against once the `cd` has run. The skill's
recipe was exactly that shape - `cd coverage && ./run_all --test X >
log 2>&1` - so it was refused under dontAsk no matter what was allowed.

run_all has to execute with coverage/ as the working directory, so the cd
cannot simply be dropped. tools/triage_test.sh keeps both the cd and the
redirect inside the script, leaving one plain command for the permission
check to match. It prints the exit status and the tail of the log, and
exits with the test run's own status.

Also drops the coverage/run_all rules added earlier: those forms cannot
work at runtime, since run_all sources setup.csh and resolves unit_test.py
relative to coverage/.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@springfall2008 springfall2008 changed the title Drop the dead Write() permission rules from the triage bot Fix the triage bot's blocked test runs, and drop the dead Write() rules Aug 24, 2026
@springfall2008
springfall2008 merged commit 76816bf into main Aug 24, 2026
2 checks passed
@springfall2008
springfall2008 deleted the fix/triage-bot-write-permission-rule branch August 24, 2026 14:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants