Skip to content

Normalize recoverable leaf finding ranges - #180

Merged
Jesper Schulz-Wedde (JesperSchulz) merged 2 commits into
mainfrom
jesperschulz-normalize-leaf-finding-range
Sep 11, 2026
Merged

Normalize recoverable leaf finding ranges#180
Jesper Schulz-Wedde (JesperSchulz) merged 2 commits into
mainfrom
jesperschulz-normalize-leaf-finding-range

Conversation

@JesperSchulz

Copy link
Copy Markdown
Contributor

Problem

A controlled 25-issue fixture produced an otherwise valid Luna performance leaf with location.line = 37 and location.range = { start-line: 36, end-line: 38 }. The strict range equality check rejected the complete leaf, dropping seven valid findings.

Behavior

  • Preserve the exact Task return unchanged as the immutable raw audit payload.
  • Create only a deep-copied candidate when line, start-line, and end-line are positive integers, start-line <= line <= end-line, start-line != line, and suggested-code is absent.
  • Remove only the optional location.range, retain the primary line and all other content, and record normalization separately in private telemetry/artifacts.
  • Run the complete existing strict acceptance gate against the normalized candidate before rollup.

Safety

All other invalid or ambiguous cases still fail the whole leaf. The exception does not repair JSON, references, paths, missing fields, reversed or out-of-bounds ranges, or findings containing suggested-code, and it does not salvage arbitrary individual findings.

Validation

  • pwsh .\tools\Test-ReviewContract.ps1 -Root . — 8 cases
  • pwsh .\tools\Test-ReviewFixtures.ps1 -Root . — 34 cases across 17 domains
  • python .github\scripts\validate_frontmatter.py --root . — 0 errors, 0 warnings
  • git diff --check

Limitation

BCQuality has no executable findings-report consumer. External hosts implement this contract; the focused regression test operationalizes the predicate and keeps the DO, coordinator, and standalone-runner surfaces aligned.

Jesper Schulz-Wedde and others added 2 commits September 11, 2026 15:18
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@JesperSchulz
Jesper Schulz-Wedde (JesperSchulz) merged commit 35d0966 into main Sep 11, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant