Repository navigation
fix(review): review pages number their source lines - #528
Merged
Merged
Conversation
Review pages gave the model source without line numbers, and a later part of a split file started mid-file with no offset, so every reported line was the model's own count: the #415 defect at line 248 was reported at lines 127-130. - Every page line carries its line number in the file and a tab, counted at newlines only. Diffs carry new-file numbers; removed lines carry the tab alone. - Split pages overlap and repeat the file header or diff preamble, including when the pipeline re-splits a page for a smaller window; it used to cut at arbitrary lines. - The verifier finds a finding's excerpt by number in any part of its file, and reads the whole file numbered. - Persona prompts ask for the shown numbers; contract grounding reads imports through the number column. On the 10-defect corpus, injections found at their line rose from 4 to 7 of the 7 found, and prompt tokens per review rose 3.1%. Closes #499
This was referenced Sep 24, 2026
Merged
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.
Closes #499.
Problem
Review pages gave the model source text without line numbers, and a later part of a split file started mid-file with no offset. Every reported line range was therefore the model's own count; the #415 defect at
crypto/known_hosts.py:248was reported at lines 127–130. Line numbers drive patching, duplicate consolidation by line overlap and the verifier's out-of-range check.Split pages lost more than the offset (from #515):
Changes
chunker.number_source_lines): every page line carries its line number in the file and a tab. Lines are counted at newlines only, as git and editors count them, so a form feed no longer adds a line.number_diff_lines): context and added lines carry new-file numbers; removed lines carry the tab alone. The hunk lengths in@@headers decide where a hunk ends, so a removed line reading--- xis not taken for a file header.split_review_pages). Every window repeats the### File:title and fence, or the diff preamble.strip_line_numbers).Live corpus (#415, seed 1, 10 injections, all personas, same gateway)
crypto/known_hosts.py:248core/repo.py:250security/suppression.py:200core/audit.py:95Token cost:
o200k_base). Source is a minority of each prompt, and the whole review rose 3.1%.Test plan
tests/test_review_page_line_numbers.py(13 tests):uv run devops ci --force: all 13 gates pass