Files
stack/tests/llm/test_chunk.py
kert fce24fec6b fix(llm,pfs): thread one code_index into chunk_doc so index and restamp agree (F1)
llm.chunk.chunk_doc scanned the import-time pfs.families.FAMILIES (five
hand families) at chunk time, while `stack llm restamp` refreshed from
the DuckDB replica first — an indexed chunk's `families` metadata could
disagree with what a restamp of the same text would compute.

chunk_doc now takes an optional `code_index` (pfs.anchors.code_family_
index(families)) and threads it into every anchor_metadata call, on
both the section-chunking and paragraph-chunking paths. llm.index.
index_refs builds one such index per run — hand families plus
pfs.families.refresh_from against the DuckDB replica when it exists,
the same mechanism `stack llm restamp` already used — and passes it to
every chunk_doc call for the run. Corrected pfs/anchors.py's docstring,
which claimed the two paths already wrote identical values.
2026-09-09 20:57:43 -04:00

9.5 KiB