Repository navigation
feat(pr-pipeline): give each pr-review-main chunk a manifest of the whole diff - #11223
Conversation
…hole diff A chunked review's prompt lists every file of the diff with its chunk and status, so a change that references a file another chunk holds is reported as a finding naming both paths. split-diff.py writes the manifest from git's own headers, capped at MANIFEST_BYTES; a one-chunk prompt is unchanged. The chunks notice adds manifest_paths=<n>. Closes #11177 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A long manifest ends with a count of the files it leaves out, so the note says so and makes a reference to an unlisted changed path a finding too. The fixture's quoted path no longer trips the typos check. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
claude-review reviewed No findings. I reviewed the incremental change since d44a96e (
Test. I counted the bytes for the six Not reported. If |
|
claude-security-review reviewed No security issues found in the incremental change since d44a96e. The change touches two files, both under the
No trust control is widened, no hold is weakened, and no manifest field changed. Nothing here can start a charge. critical-findings: 0 |
The chunk manifest held paths the pull request's author chose, and the chunked prompt carried them inline, past the trusted-text selection. The manifest now stays in the review data directory as manifest.txt, capped at what one Read returns whole (PART_BYTES), and the chunk note is fixed text that names the file, frames it as untrusted data and states the cross-chunk rule. A one-chunk prompt is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Post-merge mutation testingKilled 6, survived 1, timeout 0, no coverage 0, invalid 0, not run 0.
Surviving mutants
The run's summary has the full report. |
Closes #11177
Summary
pr-review-main reviews an oversize diff in up to 4 chunks (#11160), and each chunk's reviewer was told the other chunks were not its to judge. A change that ran, loaded or depended on a file in another chunk was therefore judged without that file. A chunked diff now writes a path-only manifest of the whole diff to
manifest.txtin the review data directory; each chunk's prompt names that file, and the reviewer reports a cross-chunk reference as a finding naming both paths.#11177 asks that each chunk's prompt include the manifest. That is met by the prompt naming the manifest file, which the reviewer reads with its existing
Read(./pr-review-main-data/**)grant. This keeps the untrusted path text out of the prompt body, per the claude-security-review finding on.github/workflows/pr-review-main.yml.Fix
split-diff.pytakes<manifest> <manifest-bytes>. With more than one chunk it writes one line per file,chunk <k> <added|modified|deleted|renamed> <path>, with a rename shown asold -> new. The paths come from git's own headers: therename from/tolines, otherwise half of thediff --gitline. Git C-quotes any control character, so a path cannot break a line. Lines past the cap are counted, not listed. The cap isPART_BYTES(15000), what one Read returns whole, so the reviewer can read the file in one call. Basis: the diff step's ownPART_BYTES/PART_LINESlimits; the shortest manifest line is 16 bytes, so 15000 bytes also stays under 1000 lines.$DATA/manifest.txt(inside the reviewer's read grant) and the multi-chunkCHUNK_NOTEis fixed text only: it names that file, tells the reviewer to read it whole as untrusted data, and states the cross-chunk rule. No path text reaches the prompt body; the only substituted values are the runner's data path, the chunk number and the chunk count.CHUNK_NOTEsits in prompt.md right afterDIFF_PARTS; an empty note renders the same bytes as main, so a one-chunk prompt is unchanged.pr-review-main chunksnotice addsmanifest_paths=<n>. The same edits are applied to all three legs.Verification
node --test .github/scripts/pr-review-main/*.test.mjs. Green after: 48 pass, 0 fail.`<data>/manifest.txt`with the untrusted-data wording, holds nochunk <k> <status>manifest line and none of the fixture's path text (lib/b & c.sh,docs/x.md,guide/x.md, the git-quoted résumé path), and thatmanifest.txtexists holding all 6 expected lines. Against the previous head it failed on the file reference; after the change all 37 tests inworkflow.test.mjspass.cmpreports them identical.write-verdict.mjsreadCoveragechecks only that each diff part was read whole, so the extra Read ofmanifest.txtdoes not void a review.check-changelog-fragments.sh --check-required origin/mainpass.Related
uses:pins, so its hunks do not overlap this change.Metrics
pr-review-main chunksnotice gainsmanifest_paths=<n>: the files the manifest lists, 0 for a one-chunk diff. It shows how often reviewers get a cross-chunk view, and how close the list comes to its cap.split-diff.py, all of which run locally. The record job is unchanged.Risk
The manifest's paths are PR-author-chosen text, now read only as a file the prompt frames as untrusted data, the same channel as the diff itself. A path containing
->can make a manifest line ambiguous, but the same text is already in the diff; accepted.🤖 Generated with Claude Code