Skip to content

fix(review): review pages carry no line numbers, so reported line ranges are guesses #499

Closed

Description

@dan-petty

Problem

Review pages give the model source text without line numbers (_render_source_block in src/devops_cli/ai/review/chunker.py). A long file split into parts (### File: x.py (part 2/3)) starts mid-file, with no offset. So every line range a persona reports is the model's own count, and on long files it is a guess.

Evidence

A synthetic defect corpus (#415) injected mkdir(mode=0o777, ...) at line 248 of crypto/known_hosts.py. Two personas reported it ("Insecure directory permissions when creating known_hosts parent directory"), at lines 106–108 and 112–115. The defect was found, but its location was wrong by about 140 lines.

Effects

Line numbers affect:

  • the locations shown to users and patched by devops review apply-patch;
  • duplicate consolidation, which relies on line overlap within DEFAULT_REVIEW_LINE_OVERLAP_TOLERANCE;
  • the verifier's invalidation of findings "beyond file length";
  • the corpus score's location match.

Proposed solution

Prefix each source line in a review page with its absolute line number, including in the parts of a split file, and tell the persona prompts that locations must use those numbers. Measure the change with the synthetic corpus (share of injections matched by line, before and after) and with devops review benchmark (the extra prompt tokens).

Acceptance criteria

  • Page lines carry absolute numbers; a part of a split file starts at its true offset.
  • On the synthetic corpus, the share of injections matched by line rises. The before and after numbers are recorded in the task file.
  • The extra prompt tokens per review are measured and recorded.

Added from #515

Path-mode pages larger than the page size fall back to _split_text_lines (chunker.py), which splits with no overlap and repeats no file header on later pages. A defect spanning the boundary is never seen whole, and later pages lose their file name. Split pages should overlap and repeat the file header, alongside the line numbers.

Activity

  1. added this to the v0.2.23 milestone on Sep 24, 2026
  2. added
    type/bug
    scope/review
    priority/p1-high
    on Sep 24, 2026
  3. dan-petty commented on Sep 24, 2026

    @dan-petty
    OwnerAuthor

    Closed by #528, merged into release/v0.2.23.

    GitHub only acts on closing keywords when a pull request merges into the default branch, so this was closed by devops gh issues close-merged.

  4. added a commit that references this issue on Sep 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority/p1-highscope/reviewtype/bug

    Type

    No type

    Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions