refactor(vector): address PR #775 review round 3 — fix unused var, harden boundary lookup, rename trace span
- pdf_highlighter.compute_chunk_bboxes_batch: drop unused chunk_text destructure (SonarQube finding), and replace positional page_boundaries[page_num - 1] with a key-based next() match so reordered or non-1-indexed boundaries can't silently shift the bbox. Convert touched f-string log to lazy %s formatting. - vector/processor: rename the trace_operation span from "vector_sync.generate_highlights" to "vector_sync.compute_chunk_bboxes" to match what the function actually does. - Add test_compute_chunk_bboxes_handles_unordered_page_boundaries — reverses the boundaries list and asserts identical results to the in-order case, guarding the boundary-lookup regression class. - Pin pre-push-review skill to sonnet model. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.7
parent
8bc87ed37d
commit
0b004f54bd
@@ -582,7 +582,7 @@ async def _index_document(
|
||||
assert content_bytes is not None
|
||||
|
||||
with trace_operation(
|
||||
"vector_sync.generate_highlights",
|
||||
"vector_sync.compute_chunk_bboxes",
|
||||
attributes={
|
||||
"vector_sync.chunk_count": len(chunks),
|
||||
"vector_sync.pdf_size": len(content_bytes),
|
||||
|
||||
Reference in New Issue
Block a user