pfs: descriptor_runs absorbs multi-thousand-character background paragraphs as a descriptor stem (G0502/G0503 self-referential addon-of bridges CoCM into CCM) #700
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Found by the P49 slice-1 final-review pipeline re-run (report
.superpowers/sdd/2026-09-09-code-family-foundation/final-fix-wave-report.md, Step 3).Symptom. After
stack pfs families --write, CCM = hand list + G2058 (correct) plus G0502 and G0503 — the CY2017 psychiatric Collaborative Care Management codes, which are not CCM.Mechanism. A ~5,543-character FR paragraph that recounts G0502/G0503's CY2017 descriptors inline (background prose in a later rule) matches
_stem_patternand is absorbed wholesale as G0502's descriptor.parse_descriptoron that text yields self-referentialrelation/addon-ofrows (G0502→G0502,G0502→G0503) plus generic phrase hits (activity=comprehensive-care-plan,medical-decision-making,population=multiple-chronic-conditions-12-months,significant-risk).derive_familiesthen bridges the G0502/G0503 component into CCM via the stem-token + identical-activity Jaccard rule (not via addon-of). Reproduces on9691d4aand on the fix-wave head; C1 (stem case-insensitivity) did not cover it.Fix. In
pfs/descriptors.py: cap the stem paragraph length used for parsing (e.g. parse only the parenthetical that opens at the code, up to its matching close paren, not the whole paragraph), and drop relation elements whose target is the code itself (pfs/elements.pyorpfs/extract.py). Test with the real G0502 paragraph. Then re-runstack pfs elements --code G0502 --code G0503andfamilies --write; expected CCM = hand list + G2058 only.Done when CCM's derived membership equals the hand list + G2058 and no
addon-ofrow hasdetail == code.Fixed in
2de806d: descriptor_runs now trims the stem paragraph to the code's own parenthetical (pfs.descriptors.descriptor_span — the code through the balanced close paren, capped at 1,500 chars, sentence cut past the cap). The 5,543-char CY2027 NPRM paragraph (5ITGVDJV ¶509) no longer yields G0502/G0503 elements. Live: elements re-extracted for the five hand families and families rebuilt — CCM is now 99437, 99439, 99487, 99489, 99490, 99491 + predecessor G2058; G0502/G0503 are out, and the chat's CCM history no longer narrates the psychiatric CoCM codes as early CCM.