fix(review): fetch truncated modified-file grounding#4087
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4087 +/- ##
=======================================
Coverage 93.63% 93.63%
=======================================
Files 384 384
Lines 35822 35830 +8
Branches 13146 13149 +3
=======================================
+ Hits 33543 33551 +8
Misses 1618 1618
Partials 661 661
🚀 New features to boost your workflow:
|
|
Warning 🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨 ⏸️ Gittensory review result - manual review recommendedReview updated: 2026-07-08 00:14:13 UTC
⏸️ Suggested Action - Manual Review
Review summary Nits — 5 non-blocking
Concerns raised — review before merging
Review context
Contributor next steps
Signal definitions
🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.
|
Motivation
additions/deletionscounts that can include omitted hunks, allowing a false-positive skip.Description
diffFullyCoversFileto require that the observed hunk+/-counts parsed fromfile.patchmatch the file-leveladditions/deletionsbefore treating a modified file as fully covered.countObservedHunkChanges(patch)to compute observed additions and deletions from the patch and use those observed counts in the coverage math.observedvalues instead of trustingfile.additions/file.deletionswhen deciding to skip the fetch.test/unit/review-grounding.test.tscovering truncated modified patches, the fetch fallback when the visible patch omits later hunks, and an ambiguous trailing-context case on the post-change side.Testing
git diff --check(no whitespace/conflict issues) which passed.npm test -- test/unit/review-grounding.test.ts, and all tests passed.tsc --noEmit, which passed.npm run test:coverage -- test/unit/review-grounding.test.ts), which exercised the new tests but the coverage remapping step failed withTypeError: jsTokens is not a function(coverage remapping error).npm run test:ci); the run progressed through several checks but was interrupted/failed in the longer coverage/CI stage andnpm audit --audit-level=moderatereturned a registry error (403), so the end-to-end gate was not fully completed in this environment.Codex Task