Skip to content

ci(claude-review): grant Task and pass --comment so reviews stop stubbing - #50

Merged
d-morrison merged 2 commits into
mainfrom
ci/claude-review-tools-and-comment-flag
Aug 8, 2026
Merged

ci(claude-review): grant Task and pass --comment so reviews stop stubbing#50
d-morrison merged 2 commits into
mainfrom
ci/claude-review-tools-and-comment-flag

Conversation

@d-morrison

@d-morrison d-morrison commented Aug 8, 2026

Copy link
Copy Markdown
Collaborator

Closes #49

Correction to the first commit on this branch (16e1887): adding Task
to allowedTools was based on a wrong mechanism claim. I verified locally
that claude --allowedTools excluding Task still lets a Task call
through with zero permission denials -- it isn't gated the way Bash
subcommands are. That fix was a no-op.

What's actually going on: this file was a hand-rolled, pre-migration
copy of the review job -- literally the "qwt" template's original version,
one of the three repos (serodynamics / qwt / rme) that
gha's own claude-code-review.yml
says it was ported from. wai never migrated to consume its own canonical
port, so it carried the original config gaps gha has since fixed across
15+ documented incidents (gha#173, #185, #198, #201, #218, #219, #235,
#244, #312, #318, #381, #392, and cross-referenced incidents in
Lacaedemon/sparta and d-morrison/rme):

  • The plugin's own /code-review command declares Bash(gh pr list:*),
    Bash(gh issue view:*), Bash(gh issue list:*), Bash(gh search:*) as
    tools its 4 parallel sub-agents need -- wai's allowlist only granted
    gh pr view/diff/comment. Missing tools means denied calls across the
    sub-agent fan-out.
  • Having the agent itself call gh pr comment (gated behind --comment,
    my second commit's fix) is fragile compared to gha's approach: gha
    denies that tool outright and has the workflow post the review
    from the agent's final text message instead, with an automatic
    same-run retry when a stub (no verdict) is detected.

This PR now replaces the whole hand-rolled job with a thin caller, matching
wai's own established pattern for consuming gha
(check-links.yml,
check-bibliography-dois.yml,
check-non-standard-chars.yaml):
same job id (so the status-check context doesn't change), same triggers,
same pr_number interface claude.yml already dispatches through, the
repo's two submodules checked out (checkout-submodules: true), and the
qwt-specific Quarto/R prompt addendum carried over verbatim.

As before: this PR edits claude-code-review.yml itself, so its own
review is skipped by the self-mod guard (401s on workflow validation
until merged) -- gets a real review, from gha's own hardened workflow,
on the next PR once this lands. actionlint and a YAML parse both pass
clean.

Worth a separate follow-up, not bundled into this PR: claude.yml
also calls anthropics/claude-code-action@v1 directly rather than
delegating to Morrison-Lab/gha's reusable claude.yml, and several
other workflows in this repo (check-spelling.yaml, preview.yml,
preview-deploy.yml, publish.yml, summary.yml) look like similar
stale, hand-rolled duplicates of gha capabilities. Filed as #51 rather
than scope-creeping this one.

…bing

The code-review@claude-code-plugins command spawns subagents (Task
tool) for its own review steps and gates all posting behind a
--comment flag the workflow never supplied. Neither was in scope
before: claude_args only allowlisted three gh Bash patterns, and the
prompt invoked the slash command with no --comment. Both silently
degrade to a run that does real work (turns, cost) and never calls
gh pr comment.

Closes #49
Copilot AI lite review requested due to automatic review settings August 8, 2026 17:54

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@d-morrison
d-morrison requested a lite review from Copilot August 8, 2026 17:55

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Correction to the previous commit on this branch (16e1887): adding Task
to allowedTools was based on a wrong mechanism claim -- verified locally
that claude --allowedTools excluding Task still lets a Task call through
with zero permission denials, so Task was never actually gated the way
Bash subcommands are.

The real story is broader: this file was a hand-rolled, pre-gha-migration
copy of the review job -- literally the 'qwt' template's original version,
one of the three repos (serodynamics / qwt / rme) gha's own
claude-code-review.yml says it was ported FROM. wai never migrated to
consume its own canonical port, so it carried the original config gaps
gha has since fixed across 15+ documented incidents: the plugin's own
sub-agents need gh pr list/issue view/issue list/search (not just
view/diff/comment), and having the agent itself call gh pr comment
(gated behind --comment) is fragile compared to gha's approach of
denying that tool and having the WORKFLOW post the review from the
agent's final message, with an automatic same-run retry on a detected
stub.

Replaces the whole hand-rolled job with a thin caller matching this
repo's own established pattern for consuming gha (check-links.yml,
check-bibliography-dois.yml, check-non-standard-chars.yaml): same job
id, same triggers, same pr_number interface claude.yml already dispatches
through, the repo's two submodules checked out, and the qwt-specific
Quarto/R prompt addendum carried over verbatim.

Closes #49
Copilot AI review requested due to automatic review settings August 8, 2026 18:08

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@d-morrison

Copy link
Copy Markdown
Collaborator Author

Self-review, since this PR's own review is skipped by design (self-mod guard -- confirmed the new gha-delegated version fires it identically, all 21 downstream steps in claude-review / claude-review correctly skipped) and Copilot is still quota-exhausted on every request, including the one from this push.

Verdict: clean, no findings. PR is ready.

What I checked:

  • actionlint and a YAML parse both pass on the rewritten file.
  • The job id (claude-review), triggers (pull_request types, workflow_dispatch with a pr_number number input), and the pr-number interface claude.yml dispatches through are all unchanged from the original -- claude.yml's gh workflow run claude-code-review.yml -f pr_number=... calls keep working with no changes needed there.
  • checkout-submodules: true preserves the original submodules: recursive behavior -- confirmed both of this repo's submodules (macros, .ai-config) are public, so no SUBMODULES_TOKEN is needed.
  • secrets.ANTHROPIC_API_KEY / secrets.SUBMODULES_TOKEN are passed through even though this repo only has CLAUDE_CODE_OAUTH_TOKEN configured -- gha declares both required: false, and an unset secret reference evaluates to an empty string rather than erroring.
  • Confirmed via gh api .../rulesets that main has no required_status_checks rule naming claude-review by exact context, so the check-name shape (now claude-review / claude-review and claude-review / require-review instead of a single claude-review) can't break branch protection.
  • The prompt-addendum content is the original qwt-specific Quarto/R guidance carried over verbatim, with the now-obsolete posting instructions (draft-comment format, "post findings in the top-level comment") dropped since gha's own prompt already handles posting, inline-vs-summary fallback, and the ### Verdict requirement.
  • All 11 checks green at the current head, mergeStateStatus: CLEAN, no CHANGES_REQUESTED.

What I can't verify from inside this PR (same limitation as before, stated plainly rather than assumed): the actual review path -- gha's multi-agent fan-out, the retry-on-stub logic, the posted verdict -- only exercises once this merges, since the self-mod guard skips it here by design.

@d-morrison
d-morrison merged commit 155af1a into main Aug 8, 2026
11 checks passed
@d-morrison
d-morrison deleted the ci/claude-review-tools-and-comment-flag branch August 8, 2026 18:23
@github-actions

github-actions Bot commented Aug 8, 2026

Copy link
Copy Markdown
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-08-08 18:23 UTC

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.

claude-review stubs: allowedTools omits Task (subagents) and prompt omits --comment

2 participants