ci: allow git push in bot-write-docs allowlist - #2537
Conversation
The first end-to-end run of the docs-request path on issue #2536 ([#25619794274](https://github.com/wheels-dev/wheels/actions/runs/25619794274)) revealed that bot-write-docs's allowlist scoped git too narrowly: specific subcommands (status, log, diff, show, grep, add, commit) but not push. The bot wrote the docs, committed them, then attempted `gh pr create` — which needs the branch on remote, but the bot couldn't push it. The workflow's "Push branch" step ran AFTER the bot finished, pushing too late for the bot's `gh pr create` call. Result: the docs/bot-2536-* branch landed on origin with full content, but no PR was opened. The bot caught this in its issue comment and explained the situation correctly ("the workflow's push step will publish the branch after this run; once it is on the remote, the draft PR can be opened from that branch") — high-quality failure reporting, but the cascade stopped there. Add `Bash(git push:*)` to the allowlist. The wheels-bot push-scope ruleset (16174270) restricts WHERE the bot can push to bot/**, fix/bot-*/**, and docs/bot-*/**, so granting push capability does not expand the bot's blast radius — it just lets the bot execute the push the ruleset will permit anyway. Mirrors propose-fix's `Bash(git:*)` wildcard (which has been working since #2533). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Wheels Bot — Reviewer A
TL;DR: This PR adds Bash(git push:*) to the bot's allowedTools in bot-write-docs.yml to unblock end-to-end runs of the docs pipeline. The permission grant is correct and necessary, but the fix is incomplete: .claude/commands/write-docs.md step 7 still explicitly tells the bot not to push ("The caller workflow handles the actual git push"), so the bot may not use the new permission. Without also updating the command's push instruction, gh pr create in step 8 will fail for the same reason as before.
Correctness
Stale prompt instruction in write-docs.md contradicts the intent of this fix.
.claude/commands/write-docs.md, step 7 (line 130):
The caller workflow handles the actual `git push` — just commit
cleanly. Do **not** use `--amend` or `--force`.
Step 8 (line 133) then asks the bot to:
gh pr create --draft --base developgh pr create requires the branch to exist on origin. Step 7 explicitly tells the bot the caller handles the push. Step 8 asks the bot to open the PR itself. These two instructions are contradictory, and this PR does not touch write-docs.md to resolve that contradiction.
The permission grant is necessary — without Bash(git push:*) the bot cannot push even if it tries. But it is not sufficient. A bot following step 7 literally will skip the push and arrive at step 8 with the branch still only on the local runner, causing the identical gh pr create failure this PR is meant to fix.
The complete fix requires updating write-docs.md step 7 (or adding a step 7a) to replace the stale instruction with an explicit push command:
git push -u origin HEADAnd removing the sentence that says the caller handles the push, since the bot is now responsible for it.
Docs
The "Push branch" step (lines 106-120) is now a safety net rather than the primary push path. Its change-detection heuristic (git diff --quiet origin/develop -- && git diff --cached --quiet) compares the working tree to origin/develop, so when the bot has committed new doc files the step will still see differences and attempt a second git push, which succeeds silently as a no-op if the bot already pushed. This is harmless, but a comment on the step explaining it is now a fallback for failed bot pushes would reduce future confusion.
Commits
ci: allow git push in bot-write-docs allowlist — valid commitlint format (type ci, no scope per CLAUDE.md convention for .github/workflows/ changes, subject under 100 chars, not ALL-CAPS). No issue here.
Security
Bash(git push:*) is broader than needed (covers --force, --delete, tag pushes), but this is consistent with bot-propose-fix.yml's Bash(git:*) wildcard which covers all git subcommands. The repository ruleset 16174270 is the correct defense-in-depth layer, and the PR's reasoning on why this is safe holds.
Wheels Bot — Reviewer B (round 1)A's review is accurate and well-reasoned. The core finding — that granting SycophancyNone detected. A requested changes despite the PR being a clear one-liner with a reasonable motivation. False positivesNone detected. I verified each claim:
Missed issuesNone significant. The diff is a single-line change; A correctly identified that the incomplete fix lives in the prose of the prompt command, not in the workflow YAML itself. A's suggested fix (replace step 7's "caller handles push" sentence with an explicit One very minor omission: the Verdict alignment
|
Summary
One-line fix to unblock end-to-end runs of the docs-request path. The first real-world run on issue #2536 (run #25619794274) successfully wrote and committed the Debug Panel guide, but couldn't open the draft PR — the bot's allowlist had specific git subcommands (
status,log,diff,show,grep,add,commit) but notpush. The workflow's "Push branch" step ran after the bot finished, pushing the branch too late for the bot's owngh pr createto use.What changed
--allowedTools "Bash(gh:*),Bash(git status),Bash(git log:*),Bash(git diff:*),Bash(git show:*),Bash(git grep:*),Bash(git add:*),Bash(git commit:*),Read,Edit,Write,Grep,Glob" + --allowedTools "Bash(gh:*),Bash(git status),Bash(git log:*),Bash(git diff:*),Bash(git show:*),Bash(git grep:*),Bash(git add:*),Bash(git commit:*),Bash(git push:*),Read,Edit,Write,Grep,Glob"Why this is safe
The repository's
wheels-bot push scoperuleset (16174270) restricts WHERE the bot can push to:bot/**fix/bot-*/**docs/bot-*/**So granting
Bash(git push:*)to the bot does not expand its blast radius — it just lets the bot execute the push the ruleset will permit anyway. Mirrorsbot-propose-fix.yml'sBash(git:*)wildcard, which has been working safely since PR #2533.What this means for issue #2536
The branch
docs/bot-2536-debug-panel-features-have-no-dedicated-docs-sectiois already on origin with the bot's full docs content. Two options after this PR merges:Manually open a PR from that branch — fastest way to see the rest of the cascade run tonight (TDD gate skip, Reviewer A, Reviewer B). The PR would be authored by you (not the bot), and would include the bot's commits as-is. The issue's
wheels-bot:write-docs:2536marker correctly belongs to the bot, so don't add additional bot markers in the new PR.Delete the branch and re-trigger via a fresh issue — cleaner test of the full pipeline (with this fix in place, the bot will open its own PR). Requires a new docs-request issue since Debug Panel features have no dedicated docs section in the guides #2536's existing
wheels-bot:write-docs:2536marker would block re-triggering on the same issue.Test plan
docs-confidence:hightriggers write-docs, the bot pushes its own branch, andgh pr createsucceeds inside the bot run (not deferred to manual).🤖 Generated with Claude Code