disclosure-bureau/investigator-runtime
Luiz Gustavo aaf5618466 fix(case-writer): doc-scoped retrieval for per-document case files
A per-document case_report grounded itself via hybridSearch keyed on the
document's auto-derived topic ("Fbi Photo B20", "Doc 59 214434 …"). That
garbage topic has no semantic neighbours, so the dense gate rejected every
chunk and the narrator saw zero scenes — skipping 61 of 75 batch documents
that in fact had dozens of embedded chunks.

When doc_id is set, fetch the document's own substantive chunks in reading
order (fetchDocChunks) instead of searching the corpus. Corpus-wide topic
reports still use hybridSearch.

Verified post-deploy: fbi-photo-b19 0→10 scenes, doc-65 →24, dow-uap-d44 →11.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-25 04:05:33 -03:00
..
prompts W5.5 (Phase 3C): Sun-Tzu strategist feeder + entity hero illustrations 2026-05-24 16:41:20 -03:00
scripts W5.3 (Phase 3A): entity summaries — sub-pages get magazine-grade prose 2026-05-24 15:37:01 -03:00
src fix(case-writer): doc-scoped retrieval for per-document case files 2026-05-25 04:05:33 -03:00
Dockerfile W3.1-W3.4: Investigation Bureau foundation — migrations, runtime, Locard 2026-05-23 19:49:33 -03:00
package-lock.json W3.1-W3.4: Investigation Bureau foundation — migrations, runtime, Locard 2026-05-23 19:49:33 -03:00
package.json W3.1-W3.4: Investigation Bureau foundation — migrations, runtime, Locard 2026-05-23 19:49:33 -03:00
tsconfig.json W3.1-W3.4: Investigation Bureau foundation — migrations, runtime, Locard 2026-05-23 19:49:33 -03:00