Repository navigation
feat(review): let /review:quality-gate review a phase diff in a separate worktree - #8348
Conversation
Every quality-gate mode takes --worktree, --base, --quality-bar and --report-only, so an orchestrator can review a phase diff in a worker's worktree. With a base SHA no pull-request lookup or fetch runs. Adds the qg-phase-boundary-worktree eval case. Refs #8327 Co-Authored-By: Claude Opus 5.5 <[email protected]>
The phase-boundary inputs are passed explicitly by an orchestrator, so the description needs no new trigger phrase. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…-gate-phase-boundary-inputs
…d grants Restore the argument-hint to the mode set so it fits the 100-character budget and matches the lead of the Arguments line; the phase-boundary flags stay documented in the Arguments line and context/phase-boundary.md. Remove the allowed-tools entries that put a wildcard before the git subcommand (git -C * ...). A wildcard there also approves options such as -c core.fsmonitor=<cmd>, which runs a program, in a skill that reviews untrusted diffs. Worktree-targeted commands go through normal permission handling. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Under --base or --worktree, code mode skips the pr-review-toolkit path for its code-reviewer fallback, and downstream mode skips the remote downstream_probe layer and treats the floor as report. Under --report-only the size-crossing loop reads git diff -z instead of a written path file. Name the modes --quality-bar applies to, pass spec text to the spec reviewer, and fail the eval grader only on a finding in admin.js, not on a note that it predates the base. Co-Authored-By: Claude Opus 5.5 <[email protected]>
- Name pr and close-out in the --quality-bar row; brief reviewers with each mode's own required inputs; restatement dispatches under --base. - Under --report-only the standards ladder takes its non-interactive rung. - code skips size crossings under --worktree; define the report-only base. - Step 0 skips the PR-exists signal with --base; drop restated upstream. - Eval: fail on any Write, add a no-Edit grader. Co-Authored-By: Claude Opus 5.5 <[email protected]>
code-reviewer, security-reviewer and architecture-guardian run only the change-set commands their brief supplies (worktree path and base SHA), with no gh lookup, fetch or ls-remote; without one, step 2 is unchanged. phase-boundary.md says the brief replaces that step. criteria mode under --base or --worktree dispatches a fresh-context review:brief-reviewer instead of reviewing inline. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Restatement mode now dispatches its batch reviewer under --worktree as well as --base, so a worktree-only run no longer reviews inline from the invoking checkout. The phase-boundary reviewer brief names the worktree's absolute path as the file-read root, and code-reviewer, security-reviewer and architecture-guardian resolve every Read, Grep, Glob and listed untracked path under a supplied worktree. The advisory line no longer reads as if per-slice passes the plan's rationale. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Replace the per-command worktree anchoring with one rule: when the brief supplies a worktree, every command and tool call in the review targets it (git via git -C, Read/Grep/Glob, untracked paths, and any other command such as a dependency audit), never the invoking checkout. Stated identically in code-reviewer, security-reviewer and architecture-guardian, and in the quality-gate phase-boundary brief for every dispatched reviewer, review:brief-reviewer included. The downstream probe's repository root is the worktree path under --worktree. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
claude-security-review reviewed No security findings in the incremental change since Scope: Instruction-surface check: The diff edits a standing instruction, so I read it under the instruction-surface lens instead of skipping it as prose-only. It replaces "Rate findings only on lines the phase diff adds or changes" with "Rate a finding only when the phase diff causes it". The new rule covers added or changed lines, things the diff leaves out that the change requires, and files outside the diff, such as a caller the change breaks. Problems the diff did not cause stay in the unrated
I did not read |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a3c0d8e577
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
claude-review reviewed Incremental review of
|
…alternation typos read the [Ss]earch character class as the misspelling "earch" and failed lint-repo. (?:search|Search) matches the same strings. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The reviewer's brief under --base or --worktree now carries a verbatim rule: findings are rated only on lines the phase diff adds or changes, and anything noticed outside it goes in an unrated `Outside this phase` list with no verdict effect, so pre-existing debt never blocks a phase. Co-Authored-By: Claude Opus 5.5 <[email protected]>
downstream, restatement and spec name files outside the diff by design; the out-of-phase rule now keys on cause, not on the file a finding names. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Closes #8327
Summary
/review:quality-gatecould not review a plan phase from an orchestrator: it read only the session's own checkout, looked up the pull request on the forge, and could stop to ask questions. This PR adds four inputs (--worktree,--base,--quality-bar,--report-only) so an orchestrator can review one phase's diff in a worker's separate worktree, with no forge lookup, no remote read, no file writes and no questions. It is the first item of spec container #8326, and the phase-boundary dispatch in #8331 builds on it.Fix
quality-gate/context/phase-boundary.md(new) holds one input table, saying which modes read each input and what it changes, plus per-mode notes.prandclose-outstop when given--baseor--worktree.criteriaandrestatementhand their review to a fresh-contextreview:brief-reviewerinstead of reviewing inline. Code mode uses its owncode-reviewerpath instead of the pull-request plugin path. Downstream skips its remote policy read.downstream,restatementandspec. Problems the diff did not cause go in an unratedOutside this phaselist that never affects the verdict.review:security-reviewer,review:code-reviewerandreview:architecture-guardianeach gain one sentence in step 2: a change set supplied in the brief replaces their owngh/fetch/ls-remoteblock, and a supplied worktree is the target of every command. Without a supplied change set the block runs unchanged. The maintainer approved widening the item's scope to these agents on 2026-10-18.qg-phase-boundary-worktree: security mode run against a separate worktree and base SHA, 8 deterministic graders. One changelog fragment for the review plugin.Deliberately not done: the item asks that
allowed-toolscover the worktree-targeted diff form. Nogit -C *rule was added, because a wildcard before the subcommand also auto-approves-c core.fsmonitor=<cmd>, which runs a program, in a skill that reviews untrusted diffs. As a result,git -C <path>calls go through normal permission handling. On 2026-10-18 the maintainer deferred how unattended dispatch gets that permission to #8331.Behavior shift: briefs that already supply diff commands to the three agents (
fanout-sweep.js:147,153, quality-gateself.md,per-slice.md) now take the supplied-change-set branch and skip the agents' own unresolved-base handling. fanout-sweep validates its base, andself.mdhas its own unresolved-base clause.Verification
scripts/check-affected.sh --tests --base origin/main, run from the branch worktree: 8 passed, 1 skipped (ruff: no.pychanged).plugins/review/tests/change-set-block.test.sh: 11 cases passed.validate-cases.py plugins/review/evals: exit 0, no FAIL, every grader sorts its samples.a2c7aadfcreported all PASS and no regression for callers that pass no new flag.claude plugin eval plugins/review --case qg-phase-boundary-worktree --scaffold --allow-tools Bash,Write,Edit --trust-plugin --judge-model opus --threshold 0.8 --max-cost-usd 5 --no-publish.06183950b: with plugin 0.857 (all 3 runs failedstays-in-phase-diff: the reviewer rated pre-existingadmin.jsoutside the phase diff), without 0.714, delta +0.143, cost $1.94.1347a220dadded the out-of-phase rule.1347a220d: with plugin 1.0 (3/3 runs pass every grader), without 0.619 (0/3 pass; failingcites-search-sqli,diffs-worktree-from-base,security-reviewer-dispatched), delta +0.381, cost $1.95. Traces show the reviewer'sgit -C .worktrees/phase-2 diff <sha>calls reach the graders and no forge or remote lookup ran.security-reviewer(npm auditand similar) still make network calls under--base.Related
Acceptance criteria
/review:quality-gatedocuments worktree path, base SHA, quality bar and report-only inputs for every modeallowed-toolscovers the worktree-targeted diff form (deliberately not met, see Fix)qg-phase-boundary-worktreepasses under/evals:plugin-evalwith and without the plugin, difference recorded (with 1.0, without 0.619, delta +0.381; see Verification)check-changed-skills.sh origin/mainandcheck-affected.sh --testsexit 0 with noSKIPline other than ruff for no Python changes🤖 Generated with Claude Code