Repository navigation
fix(review): align code-reviewer Duplicated Code severity with code-design - #8395
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]>
…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 mode loads the consumer's review criteria through the standards resolution ladder, falls back to small bundled criteria (Duplicated Code, Shotgun Surgery, Speculative Generality), and dispatches a fresh-context brief-reviewer. Repetition is CRITICAL only when the diff introduces an unsynced copy in code, naming the fact and the diverging change; Markdown, cascades and the prototype bar stay SUGGESTION. A contradicting consumer standard wins and the report names the overridden default; with no quality bar the review assumes production and says so. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Five plugin-eval cases cover the mode's severity rules: an introduced, unsynced code copy is CRITICAL with the production assumption named; a declared-registry entry and a file move are not CRITICAL; Markdown repetition and the prototype bar stay SUGGESTION; a contradicting docs/standards file produces the override line. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The no-critical and repetition-is-suggestion graders now fail only on a rated finding (a severity table cell, a line that starts with the severity, a (CRITICAL) or [CRITICAL] label, or Severity: CRITICAL) and pass a negated mention such as "Not CRITICAL: setup.md is Markdown". The cascade grader requires the CRITICAL finding to name FREE_SHIPPING_THRESHOLD or 50, not the word threshold. code-design.md states that its repetition rule overrides severity.md's "code duplication" IMPORTANT example. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…esign code-reviewer now treats the bundled code-design criteria as the documented rule that licenses escalating Duplicated Code, and only Duplicated Code: an introduced, unsynced copy in code is CRITICAL when the finding names the repeated fact and the diverging change, and may carry Confidence: high once verified at every copy. Shotgun Surgery and other repetition stay SUGGESTION, as do Markdown and a prototype bar. With no Quality bar: line it rates as production and says so. brief-reviewer lists code-design among the quality-gate modes that dispatch it. Adds eval case code-reviewer-duplicated-code-severity. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ts quality-bar line - code-reviewer reads the code-design "Bundled criteria" section and no longer restates its Markdown, prototype and Shotgun Surgery ratings. - Self mode's worker template and code-reviewer's exact-output rule allow the required `Quality bar:` line. - Fanout's parse contract notes the Duplicated Code confidence exception. - The duplicated-constant-critical grader no longer passes a summary count line; two count-line fail samples and a pass sample added. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…r-duplicated-code-severity
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-review reviewed Review of #8395 (code-reviewer Duplicated Code severity)No findings. I read all 14 changed files and the closing issue #8330, and checked the new Closing issue #8330
Minor note (not raised as a finding)
|
|
claude-security-review reviewed Security review: no findingsI reviewed all 14 files in PR #8395 at head
No Actions workflow or permission changes are in the diff. |
Closes #8330
Summary
The
code-revieweragent rated Duplicated Code as an advisory SUGGESTION, while/review:quality-gate code-designrates an introduced, unsynced copy CRITICAL under its cascade rule. The two reviewers disagreed on the same diff. This alignscode-reviewerwith the code-design criteria for Duplicated Code only.Fix
plugins/review/agents/code-reviewer.md: a "Repetition severity" paragraph points at the bundled code-design criteria (skills/quality-gate/context/code-design.md, "Bundled criteria", "The cascade rule", "Exempt from CRITICAL") and rates introduced Duplicated Code CRITICAL when the cascade rule holds. Shotgun Surgery and other repetition stay SUGGESTION, as do Markdown and aprototypequality bar. With noQuality bar:line in the brief it rates as production and says so. A Duplicated Code finding that names the repeated fact and the diverging change may carryConfidence: highonce verified at every copy. A project's own severity vocabulary or criteria still win.plugins/review/skills/quality-gate/context/self.md: the self-mode prompt allows thatQuality bar:line.plugins/review/skills/fanout/context/findings-normalization.md: the confidence column notes the Duplicated Code exception.plugins/review/agents/brief-reviewer.md: listscode-designamong the quality-gate modes that dispatch it.plugins/review/evals/code-reviewer-duplicated-code-severity(dispatch, duplicated-constant CRITICAL, Shotgun Surgery not blocking) and a changelog fragment.Because the merge lane blocks on CRITICAL, an introduced, unsynced copy now blocks an unattended merge.
Verification
code-reviewer-duplicated-code-severity: with the branch's plugin 1.0, without the plugin 0.0 (+1.0).bash scripts/check-affected.sh --tests --base origin/mainafter merging main: 8 passed, 1 skipped (no changed.py).typosclean over the changed paths.Related
/review:quality-gatecode-design mode), merged into this branch from main🤖 Generated with Claude Code