Files
stack/tests/pfs/test_descriptors.py
kert c8ba1bbefa fix(pfs): C1 — descriptor-stem regex and element-paragraph heuristic swallow FR cross-reference lines
`_stem_pattern`'s `re.I` made `[A-Z]` match any letter, so an enumeration
item like "( 9) 99439 (code for non-complex chronic care management)."
read as the opening of 99439's own descriptor; `descriptor_runs` then
consumed the following list item as an element paragraph, and
`extract_run` minted rows anchored to a paragraph naming a different
code entirely. Live table already held wrong rows from this (an APCM
paragraph under 99439, a TCM enumeration line under 99490).

Keep the stem match case-insensitive (some rules print descriptors
lowercase) but reject the cross-reference form with a negative lookahead
on "code(s)". `is_element_paragraph` also rejects lines that open with
an enumeration marker or contain "code(s) for" — the same enumeration
items were passing its ")."-ending heuristic too.

Claude-Session: https://claude.ai/code/session_01Aum3pEMAM3yQVdFSdVe6Gc
2026-09-09 14:10:14 -04:00

7.6 KiB