When the dominant heading level repeats and becomes the split backbone, a long section is sub-split via SplitText and every sub-chunk inherited the section-level breadcrumb. Deep `###`/`####` headings that define a sub-chunk's meaning were dropped from Chunk.ContextHeader, so queries about content nested far below a shallow heading failed to retrieve it. Track the heading hierarchy across the section and assign each sub-chunk the breadcrumb in effect at its start offset, so the deepest active heading reaches the breadcrumb. Adds a regression test. Fixes #1674 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| header_tracker.go | ||
| heading_hierarchy.go | ||
| heading_hierarchy_test.go | ||
| heading_splitter.go | ||
| heading_splitter_test.go | ||
| heuristic_splitter.go | ||
| heuristic_splitter_test.go | ||
| patterns.go | ||
| patterns_test.go | ||
| profiler.go | ||
| profiler_test.go | ||
| splitter.go | ||
| splitter_test.go | ||
| strategy.go | ||
| strategy_diagnostics_test.go | ||
| strategy_test.go | ||
| strategy_token_test.go | ||
| tokens.go | ||
| tokens_test.go | ||
| validator.go | ||