WeKnora/internal/infrastructure/chunker
wizardchen ad69240ac1 fix(chunker): heuristic splitter drops boundaries inside protected spans
Heuristic boundary detection (numbered sections, all-caps headings,
\\n{3,} blank blocks, etc.) ran on the raw text and could land inside
atomic regions handled by protectedPatterns — most notably LaTeX
$$...$$ blocks, Markdown tables, fenced code, and image/link refs.
A boundary inside such a region would cause the bin-packer to slice
through protected content, defeating the protection.

Convert protectedSpans output to rune offsets once and filter the
boundary list before bin-packing. Boundaries on a span edge are kept
(they align with the span) — only strictly-interior ones are dropped.
2026-05-06 21:16:48 +08:00
..
header_tracker.go feat(chunker): implement header tracking for Markdown tables during chunking 2026-04-01 13:38:40 +08:00
heading_hierarchy.go feat(chunker): heading hierarchy tracker 2026-05-06 17:17:07 +08:00
heading_hierarchy_test.go feat(chunker): heading hierarchy tracker 2026-05-06 17:17:07 +08:00
heading_splitter.go perf(chunker): thread DocProfile through splitter dispatch 2026-05-06 21:16:48 +08:00
heading_splitter_test.go perf(chunker): thread DocProfile through splitter dispatch 2026-05-06 21:16:48 +08:00
heuristic_splitter.go fix(chunker): heuristic splitter drops boundaries inside protected spans 2026-05-06 21:16:48 +08:00
heuristic_splitter_test.go fix(chunker): heuristic splitter drops boundaries inside protected spans 2026-05-06 21:16:48 +08:00
patterns.go feat(chunker): foundation for adaptive 3-tier chunking 2026-05-06 17:17:07 +08:00
patterns_test.go feat(chunker): foundation for adaptive 3-tier chunking 2026-05-06 17:17:07 +08:00
profiler.go refactor(chunker): drop redundant TierRecursive 2026-05-06 20:23:05 +08:00
profiler_test.go refactor(chunker): drop redundant TierRecursive 2026-05-06 20:23:05 +08:00
splitter.go fix(chunker): heuristic splitter drops boundaries inside protected spans 2026-05-06 21:16:48 +08:00
splitter_test.go fix(chunker): QA audit — position invariant, recursive split, perf 2026-05-06 17:17:07 +08:00
strategy.go perf(chunker): thread DocProfile through splitter dispatch 2026-05-06 21:16:48 +08:00
strategy_diagnostics_test.go fix(chunker): post-review fixes for preview endpoint robustness 2026-05-06 17:17:07 +08:00
strategy_test.go fix(chunker): QA audit — position invariant, recursive split, perf 2026-05-06 17:17:07 +08:00
strategy_token_test.go feat(chunker): recursive priority splitting + token-aware budget 2026-05-06 17:17:07 +08:00
tokens.go fix(chunker): post-review fixes for preview endpoint robustness 2026-05-06 17:17:07 +08:00
tokens_test.go feat(chunker): foundation for adaptive 3-tier chunking 2026-05-06 17:17:07 +08:00
validator.go feat(chunker): foundation for adaptive 3-tier chunking 2026-05-06 17:17:07 +08:00