Skip to content

perf(review): have code-reviewer and security-reviewer return a file pointer plus a bounded summary - #12294

Merged
kyle-sexton merged 3 commits into
mainfrom
work-resolve-issue/issue-12241-41390431108-1
Nov 2, 2026
Merged

kyle-sexton merged 3 commits into
mainfrom
work-resolve-issue/issue-12241-41390431108-1

Conversation

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor

Refs: #12241

Summary

Opened by the work-resolve-issue lane. The run's own summary:

review:code-reviewer and review:security-reviewer now write their full report, in their current Output format, to the path on the dispatch prompt's single Findings path: line. They then reply with only a fenced block: artifact, persistence (written or by-value), counts by severity, and a summary of one paragraph at most. With no path they reply by value and say so. Each agent gains Write, but its body limits it to that one file, shaped reviews/<branch-slug>/<stamp>-<agent>.md, plus its agent memory directory. A refused write is final, with no Bash workaround. The untrusted-content rules are kept, and only the dispatch prompt's path widens what the agent may write. Callers follow the new plugins/review/reference/reviewer-handback.md: they pass an absolute path under <memory_dir>/reviews/<branch-slug>/, follow the no-overwrite rule, and read the report from their own copy of the path. This follows the recorded decision on the issue, which cites the discovery explorer precedent. Design choices made on evidence: (1) The docs say memory: already auto-enables Read, Write and Edit, so the boundary allows the agent memory directory. (2) Workflow scripts cannot read files, so fanout-sweep.js takes a new findingsPaths argument, and the Stage-0 stage-normalizer, which already holds Read, reads the listed files. The file list sits outside the reviewer text, so a reply cannot name a file for it to read. (3) No path is passed under quality-gate --report-only, which promises the gate writes nothing. (4) /review:security-review and source-control prep.md need no change: security-review dispatches only review:lane-verifier, and prep.md runs /review:quality-gate or /review:fanout. Its only agent mention sits under 'Without that plugin'.

The run went past its turn budget (turns=104 max-turns=75): the work may be too big for one run.

Remaining work

  • Measure the after figure as the issue describes (final-report characters of review:code-reviewer and review:security-reviewer subagent transcripts in the local store, median and p90) once this change is in use; this lane has no access to that transcript store
  • Run the review evals against the changed agents and confirm no findings are lost

Not verified

  • node --test plugins/review/tests/fanout-sweep.test.mjs was not executed here (the lane runs no interpreter; the review subagent's node run was denied); left to the PR's CI
  • Tidy skipped: the change is 19 files across two areas (plugins/review, plugins/source-control), over the 10-file, 300-line and 1-area cutoffs
  • review venue file review-venue.txt was absent, so the review ran locally as one fresh-context subagent
  • plugins/work-items/reference/pipeline-shape.md:45 names review:code-reviewer as a pipeline stage but gives no dispatch instruction; left unchanged (the agent stays backward compatible by value)
  • Review evals (plugins/review/evals/*) were not run; they need live model runs. The review subagent read the graders and found qg-phase-boundary-worktree uses --report-only (no path, so its Write max 0 grader holds) and code-reviewer-duplicated-code-severity passes no path (the reply stays the plain

Fix

  • plugins/review/agents/code-reviewer.md: adds Write to tools, a Handback section (one-file write boundary with path-shape check, refused write is final with no Bash workaround, pointer block with counts and a one-paragraph summary cap, by-value with no path), and a line in the untrusted-content rule
  • plugins/review/agents/security-reviewer.md: the same Handback section with P1-P5 counts, and the same untrusted-content line
  • plugins/review/agents/stage-normalizer.md: reads only the findings files its brief lists outside the reviewer output
  • plugins/review/reference/reviewer-handback.md: new caller contract covering path resolution, naming, no-overwrite, the last-line Findings path: placement, no path under --report-only, and reading back from the caller's own copy (by-value or block-less replies are written by the caller)
  • plugins/review/workflows/fanout-sweep.js: new findingsPaths arg (validated per leaf: one line, reviews/<slug>/<stamp>-<agent>[-n].md, no '..'), appended to that leaf's prompt, listed to the Stage-0 extractor to read, and returned under lens diversity
  • plugins/review/tests/fanout-sweep.test.mjs: tests for path routing to the right leaf and the extractor, malformed or misnamed paths dropped and logged, Windows and numbered paths accepted, none returned under model diversity, and no path without the arg
  • plugins/review/skills/quality-gate/SKILL.md: Shared inputs gains a 'Reviewer handback' bullet (no path under --report-only)
  • plugins/review/skills/quality-gate/context/code.md, security.md, pr.md, self.md, per-slice.md, phase-boundary.md, criteria.md: each code-reviewer/security-reviewer dispatch passes a findings path and reads the report from the file; self.md's template allows writing only that file; phase-boundary pas
  • plugins/review/skills/fanout/context/default-mode.md: new 'Reviewer findings files' section; Stage 0 reads those leaves from file
  • plugins/review/skills/fanout/context/run-everything-mode.md: launch passes findingsPaths, return lists it, step 6 reconcile and the coverage-parity fallback read the files
  • plugins/source-control/skills/pull-request/reference/ready-for-review.md: direct dispatch of the review plugin's reviewer agents follows the reviewer handback
  • .changes/review/work-resolve-issue-issue-12241-41390431108-1-d3be895c.md: minor fragment
  • .changes/source-control/work-resolve-issue-issue-12241-41390431108-1-d011c6df.md: patch fragment

Verification

The runner ran each check from the base copy against 707ec2d:

  • scripts/check-changelog-fragments.sh --check: passed
  • scripts/check-changed-skills.sh --merge-base: passed

The run reports:

  • check-changelog-fragments: all 5 fragments valid
  • check-changed-skills: fanout, quality-gate, pull-request PASS, 0 errors (warnings were already there; quality-gate SKILL.md body grew 169 -> 170 lines for the new Shared inputs bullet)
  • check-affected: 11 passed, 7 skipped, 0 failed over 19 changed files
  • read https: //code.claude.com/docs/en/sub-agents: the memory field automatically enables Read, Write and Edit so the subagent can manage its memory files (basis for allowing the memory directory in the write boundary)
  • fresh-context review subagent over the whole diff: 3 medium and 3 low findings, all fixed (self.md template contradiction, a second Findings path: line pasted from untrusted text, the coverage-parity fallback missed, findingsPaths returned under model diversity, extractor relying on the reply's pe
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/41390431108

Left out: the items under Not verified.

Related

#12241

Lane-Activity: work-resolve-issue/resolve-issue
@github-actions

github-actions Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

claude-security-review reviewed 26a8f8a6086ba2fad9eb8e4777a54f4c3b99c5ef: read 2 of 2 changed file(s); 0 finding(s), 0 as inline comments.

Security review: PR #12294 (incremental, head 26a8f8a)

I found no security issues in the change since 8fd5ef85.

What I read. Both hunks in .claude-lane/incremental.diff: one sentence in the Handback "Write boundary" of plugins/review/agents/code-reviewer.md and the same sentence in plugins/review/agents/security-reviewer.md. Neither file matches a trusted-path glob. This increment changes no plugin manifest.

The change. Before, the path on the Findings path: line had to end with /reviews/<branch-slug>/<stamp>-<agent>.md. Now each separator in that ending may be either / or \. This makes the agents agree with the fanout-sweep.js check, which already accepted both. It is the fix asked for in the settled thread on code-reviewer.md line 118. I did not raise that point again.

Can the agent now write somewhere it couldn't before? No.

  • Where the path comes from: it is still taken only from the dispatch prompt's single Findings path: line, which the caller writes. The rule against taking a path from the change set or from documents the agent reads is unchanged. Untrusted review content still cannot name a file.
  • The rest of the rule: the exactly-one-line requirement, the ban on .. segments, the rule that a refused or failed write is final, and the no-Bash-workaround clause are all unchanged.
  • The directory part: the rule only fixes how the path ends. The directory in front was already up to the caller, so accepting \ gives no new place to write.
  • On Linux: \ is an ordinary filename character, not a separator. A \-separated path there becomes a single oddly named file in a directory the caller chose. ..\ does not climb out of a directory on Linux.
  • On Windows: a .. segment between backslashes is still a .. segment, so the existing ban covers it.

Instruction-surface lens. The change narrows no standing guardrail. It widens one accepted path shape to match the workflow's existing check, and what the rule forbids stays the same. docs/contracts/instruction-exception-register/README.md was not needed: no rule was removed or softened.

PR context and settled threads. Neither file contains embedded text aimed at this lane. The settled threads hold only the reviewers' findings, the owner's "please fix this finding" request and the bot's fix report.

Prior findings. The one earlier post (the summary at 8fd5ef85) reported 0 findings, so nothing carries over. Round cap: not past it (0 of 3).

Spend. None.

critical-findings: 0

@github-actions github-actions Bot 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.

claude-review: 2 inline finding(s) on 707ec2dac2c6e9489e7a91f84701d3c8b1d5cd3f; the summary is in this lane's pull request comment.

claude-lane: claude-review

Comment thread plugins/review/agents/code-reviewer.md Resolved
@github-actions

github-actions Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

claude-review reviewed 26a8f8a6086ba2fad9eb8e4777a54f4c3b99c5ef: read 2 of 2 changed file(s); 0 finding(s), 0 as inline comments.

Code review (incremental): PR #12294

What I reviewed: only the change since 8fd5ef85, from .claude-lane/incremental.diff. That is one hunk in each of plugins/review/agents/code-reviewer.md and plugins/review/agents/security-reviewer.md, in the Handback "Write boundary" sentence. I also compared it with the path check the workflow applies, at fanout-sweep.js:51-53.

Result of the incremental change

  • The earlier advisory finding is fixed. It said the agents and the workflow disagreed about Windows path separators (discussion_r4439172984).
    • Both agents now accept a path that ends <sep>reviews<sep><branch-slug><sep><stamp>-<agent>.md (or -<agent>-<n>.md), where each <sep> is / or \.
    • This matches the workflow's check. The workflow's regex accepts [\\/] at each separator, mixed separators included, takes the optional -<n> suffix, and rejects any .. segment split on either separator.
    • Both agents still require no .. segment, so the two sides now accept the same set of paths.
  • I found nothing new in either hunk. Every other sentence of the boundary is unchanged, including exactly one Findings path: line, no paths taken from reviewed content, and "a refused write is final".

Other checks

  • Prior findings: this is round 3 of 3. The prompt says the cap has not been passed, so the round-cap rule did not apply. Both earlier inline findings are fixed, and nothing is carried forward.
  • Closing issues: the PR context only says Refs: #12241 and has no closing-issue section, so there were no acceptance criteria to check.
  • Plugin manifests: no plugin.json or marketplace.json is in this incremental scope.
  • Embedded instructions: none in the PR context, settled-threads or prior-findings files. The owner reply "pr-fix lane: please fix this finding" asks for a fix. It is not a decision that settles the point, and this change makes that fix.
  • Verification: I ran nothing, because this lane has no shell. Whether node --test plugins/review/tests/fanout-sweep.test.mjs passes is still up to CI.

@melodic-automation-lanes

melodic-automation-lanes Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor Author

Unattended merge: native auto-merge leaves this pull request unarmed at head 26a8f8a6086ba2fad9eb8e4777a54f4c3b99c5ef. The lanes clear this reason on their own; the next scheduled run judges it again.

pr-merge's gate refuses its verifier verdict (verify:missing)

@melodic-automation-lanes melodic-automation-lanes Bot added the needs-session A pr-unblock stop a session builder takes: a change the lane cannot make. Not an owner stop. label Nov 2, 2026
@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The pr-unblock lane stopped address-feedback on this pull request: the pull request has an unresolved review thread the lane does not take (a reviewer it does not act on, a review of an older head, or a thread it already answered), so no lane resolves it and a session builder takes it. The lane labels it needs-session for a session builder, who makes the change this lane cannot, and the run ends in a failing pr-unblock/address-feedback status on the head the lane gated.

When a retry on this head can change the outcome, the lane runs one on its own, up to its per-head cap, and edits this comment if it stops again; a run that does not stop clears the status. When no retry can (a review thread the lane does not take or settle, or a failing check after the retries are spent), a person resolves the threads or gets the checks green, then dispatches the workflow below: that run finds the cause gone and clears the status. On a pull request the lanes App opened, the dispatchers start that run once per stop; on any other, a person does. A new commit to the branch starts clean.

To run it again on this head now, dispatch the pr-unblock workflow:

gh workflow run pr-unblock.yml -R melodic-software/claude-code-plugins -f pr-number=12294 -f activity=address-feedback

Lane-Activity: pr-unblock/address-feedback
Lane-Thread: PRRT_kwDOTCGFQM6yiysu
@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

pr-unblock / address-feedback finished round 1 of max 4 on 26a8f8a.

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.

1 participant