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.
2.9 KiB
2.9 KiB