Repository navigation
fix(pr-pipeline): cut a hunk larger than one chunk between its lines - #18705
Conversation
diff_chunking.py split gains --cut-lines: a hunk that with its file's header is over one chunk is cut between its lines, each cut under an @@ header recounted for the lines it holds, and a "\ No newline" mark stays with its line. Only a single line over a chunk is then too large. pr-verify's chunk-diff.sh and pr-review-main's three legs pass the flag; the default keeps the refusal ci-workflows' generate-review-chunks relies on. The chunk prompts, final-judge spec prompt, step comments, too-large message and pr-pipeline README say a piece can hold part of a hunk. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Codex Review Summary: ✅ CompletedThis 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 Security review: PR #18705, incremental since
|
|
claude-review reviewed Code review (incremental, blocking only): no findingsScope: this push changes one file since What I checked (by reading the code; I ran nothing):
The earlier reviews covered the rest of the PR, including closing issue #18178's done-when items; this push leaves them unchanged. This is a blocking-only review, because this lane already reviewed an earlier head. I found no instructions embedded in the PR context. Loosened checks would be marked: fail. That is the default, because the prompt gave no No plugin manifests changed in this push. Uncovered rules (1)
Verifier dropped 0 of 0 candidates. Uncovered rules (1)
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 99107eaaee
ℹ️ 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".
…ge_settings.py Test Selection's strict trace failed on run https://github.com/melodic-software/claude-code-plugins/actions/runs/45335096019: the suite reads plugins/source-control/skills/babysit-prs/scripts/babysit_merge_settings.py without a test-scope line, so a change to that file did not select it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The three --cut-lines tests in diff-chunking.test.mjs now run git diff in a temp repository (global and system config off) and split its real output, asserting git's own hunk header before checking the recounted cuts. This drops the impossible `@@ -1 +1 @@` header over a lone addition; the long-line case is now a real one-line replacement, and the new-file case takes git's no-newline mark. Caps are the file header's length plus a fixed room, so git's index line does not shift them. All three still fail on the splitter before --cut-lines. Finding: #18705 (comment) Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
pr-review-main claude-review SUGGESTION at d1f57de ( |
Post-merge mutation testingKilled 5, survived 2, timeout 0, no coverage 0, invalid 0, not run 0.
Surviving mutants
The run's summary has the full report. |
Closes #18178
Siblings: #18196
Summary
#18196 cut a file larger than one chunk into pieces at its hunks, but a file whose one hunk is over a chunk (300,000 bytes) with its header still left pr-verify and pr-review-main with no verdict. That was the last part of done-when item 1 and the issue's "A single hunk larger than a chunk is cut at line boundaries."
diff_chunking.py splitgains--cut-lines. With it, such a hunk is cut between its lines, and each cut goes under its own@@header, recounted for the lines it holds, so a reviewer can still place every line. pr-verify and pr-review-main pass the flag. Without the flag the splitter still refuses the hunk, which is what ci-workflows'generate-review-chunks/split.shrelies on, so that caller is unchanged.Fix
.github/scripts/diff-chunking/diff_chunking.py:cut_hunkcuts an oversize hunk between its lines into hunks that fit beside the file's header. Each gets a recounted@@ -a,b +c,d @@header and keeps the original header's function context. A side with no lines in a cut names the line before it, as git does (-0,0for a new file). A\ No newline at end of fileline stays with the line before it. Only a single line over the chunk with its headers is still too large; it exits 3 with "a file has a line larger than one chunk". MAX_CHUNKS stays the cost guard..github/scripts/pr-verify/chunk-diff.shand the threepr-review-main.ymllegs callsplitwith--cut-lines.chunk-note.md, the final judge's manifest description inspec-prompt.md, and pr-review-main's chunk note in all three legs.pr-verify.ymlandpr-review-main.yml, pr-review-main'stoo-largestop message, thechunk-diff.shheader, anddocs/conventions/pr-pipeline/README.md. Apr-pipelinechangelog fragment is added.split.shin ci-workflows callssplitwithout the flag, so its refusal and partial review are unchanged. No cross-repo change is needed. Basis:split.shin melodic-software/ci-workflows, "A file with a hunk over the budget with its header is not cut, so the split refuses it and the review stays partial", and itssplitter=(... diff_chunking.py split)call with no flag.Verification
node --test --test-concurrency=4:diff-chunking/diff-chunking.test.mjs: 15 passedpr-verify/chunk-diff.test.mjs: 19 passedpr-verify/spec-prompt-text.test.mjsandpr-verify/workflow.test.mjs: 57 passedpr-review-main/workflow.test.mjs: the four diff tests passed after the change. An earlier full run of the suite had 47 passed and 2 failed, and those two are the tests this PR updates.-10,2 +10,1,-11,0 +11,2,-12,2 +13,2) and the manifest'spiece <i> of 3-0,0 +1,2,-0,0 +3,1), with a no-newline mark kept with its linechunks=2with no::error::scripts/run-ruff.sh checkandformat --checkondiff_chunking.py: clean.scripts/check-affected.sh --base HEAD~1: 21 passed, 3 skipped.git apply(the local scratch harness was refused by the session's permission classifier), and the full.githubsuite (per-machine limit; CI runs it). pr-verify and pr-review-main run the cutter from main's checkout (.base), so this PR's own run uses the old cutter; the line cut first runs live after merge.Related
diff-chunking/diff_chunking.py.🤖 Generated with Claude Code