Repository navigation
fix(pipeline): read diff path headers only before a file's first hunk - #687
Merged
Merged
Conversation
A removed '-- comment' line or an added '++ x' line appears in a hunk as '--- ...' or '+++ ...', and the parser read it as a path header, replacing the file's paths. Headers now count only between 'diff --git' and the first '@@'. Fixes #686
monit-reviewer
approved these changes
Oct 22, 2026
monit-reviewer
left a comment
There was a problem hiding this comment.
Automated PR Review
Reviewed commit: 84b2861152b7
Profile: claude-monit-reviewer - Posting as: monit-reviewer
Summary
| Reviewer | Findings |
|---|---|
| go:implementation-tests | 0 |
| harness-engineering:repo-health | 0 |
| security:code-auditor | 0 |
Reviewer Coverage
Complete coverage details are retained in the local coverage.json artifact.
go:implementation-tests— complete (broad); scope: 2 files; examples:internal/pipeline/diff.go,internal/pipeline/diff_test.go; body-inspected: 2 files; examples:internal/pipeline/diff.go,internal/pipeline/diff_test.go; skipped: none; constraints: Reviewed the diff only; did not run go test or golangci-lint.harness-engineering:repo-health— complete (constrained); scope: 2 files; examples:internal/pipeline/diff.go,internal/pipeline/diff_test.go; body-inspected: 2 files; examples:internal/pipeline/diff.go,internal/pipeline/diff_test.go; skipped: none; constraints: Reviewed the diff only; did not run tests or linters.security:code-auditor— complete (constrained); scope: 1 file; examples:internal/pipeline/diff.go; body-inspected: 1 file; examples:internal/pipeline/diff.go; skipped: none; constraints: Reviewed only the parseUnifiedDiff change in internal/pipeline/diff.go; tests were not run.
0 PR discussion threads considered. 0 summarized; 0 resolved.
Completed in 1m 04s | ~$0.27 (est.) | claude-sonnet-5-5 | cr 0.10.345
| Field | Value |
|---|---|
| Model | claude-sonnet-5-5 |
| Reviewers | go:implementation-tests, harness-engineering:repo-health, security:code-auditor |
| Engine | claude_cli · claude-sonnet-5-5 |
| Reviewed by | cr · monit-reviewer |
| Duration | 1m 04s wall · 1m 37s compute |
| Cost | ~$0.27 (est.) |
| Pricing basis | baseline-2026-10-02/pricing |
| Tokens | 34 in / 4.2k out |
Per-workstream usage
orchestrator-selection— claude-sonnet-5-5- In: 6
- Out: 996
- Cache read: 23.0k
- Cache create: 10.9k
- Cost: ~$0.06 (est.)
- Duration: 14s
go:implementation-tests— claude-sonnet-5-5- In: 8
- Out: 1.0k
- Cache read: 42.2k
- Cache create: 12.2k
- Cost: ~$0.07 (est.)
- Duration: 23s
harness-engineering:repo-health— claude-sonnet-5-5- In: 8
- Out: 874
- Cache read: 42.6k
- Cache create: 12.3k
- Cost: ~$0.07 (est.)
- Duration: 26s
security:code-auditor— claude-sonnet-5-5- In: 6
- Out: 896
- Cache read: 26.2k
- Cache create: 11.8k
- Cost: ~$0.06 (est.)
- Duration: 23s
orchestrator-rollup— claude-sonnet-5-5- In: 6
- Out: 374
- Cache read: 45.1k
- Cache create: 2.3k
- Cost: ~$0.02 (est.)
- Duration: 9s
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #686.
parseUnifiedDiffnow reads---/+++path headers only before a file's first@@hunk header. After that, a removed-- commentline (--- comment) or an added++ xline (+++ x) stays hunk content instead of replacing the file's paths. Git writes no path header after a file's hunks begin, so nothing legitimate is skipped.Tests
TestParseUnifiedDiffKeepsHeaderLikeHunkLinesAsContent: two files that each remove a-- TODOline, one also adding++ counterand one with an added+++ /dev/nullcontent line. Both keep their paths, hunk counts and content, and neither is marked deleted.old "TODO" path "counter"andold "TODO" ... deleted true.go test ./...andgolangci-lint runpass.Model: Claude Opus 5.5 (1M context, xhigh effort) in Claude Code.