You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(toc_extractor): LLM refiner returning empty tuple silently demotes document to Scenario C with no log #249
When the LLM refiner returns an empty tuple, _derive_page_ranges([]) returns () (falsy), and the Scenario B path falls through to Scenario C (fallback_only=True) with no exception, no WARNING log, and no sections persisted. Any refiner bug that returns an empty result causes silent data loss — the document appears indexed but returns zero results.
Root Cause
ingestion/toc_extractor.py around line 307:
raw=llm_refiner.refine(raw, ...)
heuristic=_derive_page_ranges(raw, total_pages) # () when raw is []ifheuristic: # ← False when refiner returns emptyreturnTocResult(entries=heuristic, scenario='B', fallback_only=False)
# falls through to Scenario C silently:returnTocResult(entries=(), scenario='C', fallback_only=True)
There is no log entry when a non-empty raw list is passed to the refiner and an empty result comes back — a complete structural erasure is indistinguishable from a document that genuinely had no structure.
Failure Scenario
LLM refiner has a bug and returns () for a document with 15 clear heuristic headers.
Activity
piyushmakhija28 commentedon Jun 21, 2026
Fixed in PR #280 (Sprint R3/R4: fix(sprint-r3): root-cause fixes for all 39 bugs from code review round 3 + Sprint R4 round 4)