Skip to content

fix: reconcile the line-number convention — chunkers emit 1-based, responses pass through - #347

Merged
flupkede merged 1 commit into
developfrom
fix/line-convention-reconcile
Oct 17, 2026
Merged

flupkede merged 1 commit into
developfrom
fix/line-convention-reconcile

Conversation

@flupkede

Copy link
Copy Markdown
Owner

Follow-up to PR #308's merge: the merge combined two internally-consistent line conventions into an inconsistent tree. develop's chunkers emit 1-based editor lines (the find → find_impact position round-trip fix, PR #313), while the pilot batch's emit boundaries added +1 on top of the then-0-based chunkers. Result: every response reported line N as N+1 for real chunks, and get_chunk's context_before included the chunk's own first line — re-breaking the exact live workflow PR #313 fixed.

Reconciled to: chunker emits 1-based, emit boundaries pass through.

  • Stripped the +1 at all 22 emit sites (find, explore, get_chunk, graph, search funnel, CLI renderer) — all introduced by the pilot batch, verified against both parents (develop had 0, the PR head had all 22).
  • get_chunk's context windows restored to the 1-based reading; the pin test had hand-built a 0-based fixture no real chunk matches.
  • Response-level fixtures moved to 1-based values so they represent real chunks.
  • Chunk doc comment now states the shipped convention.
  • New end-to-end test ties the real SemanticChunker to the get_chunk response, so producer and emitter can no longer drift apart silently (the two green-but-contradictory test halves could not see this bug).
  • CHANGELOG entry describes the shipped mechanism.

Validation: fmt clean, clippy --all-targets -D warnings clean, cargo test --lib --bins fully green.

…sponses pass through

The PR #308 merge combined two internally-consistent conventions into an
inconsistent tree: develop's chunkers emit 1-based editor lines (the
find -> find_impact position round-trip fix), while the pilot batch's
emit boundaries added +1 on top of the then-0-based chunkers. Every
response reported line N as N+1 for real chunks, and get_chunk's
context_before included the chunk's own first line.

Reconciled to: chunker emits 1-based, emit boundaries pass through.
- stripped the +1 at all 22 emit sites (find, explore, get_chunk, graph,
  search funnel, CLI renderer) — all introduced by the pilot batch,
  verified against both parents
- get_chunk's context windows restored to the 1-based reading (the
  before-window's saturating_sub(1) was correct all along; the pin test
  had hand-built a 0-based fixture no real chunk matches)
- response-level fixtures moved to 1-based values so they represent real
  chunks
- Chunk doc comment now states the shipped convention
- new end-to-end test ties the real SemanticChunker to the get_chunk
  response (producer and emitter can no longer drift apart silently)
- CHANGELOG entry describes the shipped mechanism
@flupkede
flupkede merged commit e962c44 into develop Oct 17, 2026
3 of 6 checks passed
@flupkede
flupkede deleted the fix/line-convention-reconcile branch October 17, 2026 19:38
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