Files
stack/tests/pfs/test_anchors.py
kert c244cebba1 fix(pfs): code→family index keeps every family so indexed and scan anchors agree (refs #688)
code_family_index kept only the first family per code (setdefault),
while anchor_metadata's un-indexed scan unions every qualifying
family a code belongs to — so stack llm index (no code_index) and
stack llm restamp (always indexed) would write different 'families'
values for the same text once a code belongs to two families, which
the next slice (CPT headings intersecting hand families) will create.

Ruling A6: code_family_index now maps each code to the sorted tuple
of every qualifying (>=2-code) family key, and anchor_metadata unions
those tuples across all matched codes. The indexed and un-indexed
paths are now equivalent by construction. Also drops the dead
`fams = ...` computation in anchor_metadata when code_index is given.

Does not touch the running background comments restamp — the five
live hand families (ACP, CCM, PCM, TCM, APCM) don't share any codes,
so its output is unaffected today.
2026-09-09 16:12:13 -04:00

2.9 KiB