Personal_AI_Infrastructure icon indicating copy to clipboard operation
Personal_AI_Infrastructure copied to clipboard

GenerateTelosSummary: H2 "## ID: title" entries with multi-paragraph bodies silently fragment into fake sequential items

Open waveman2020-sudo opened this issue 4 months ago • 1 comments

File: LifeOS/install/LIFEOS/TOOLS/GenerateTelosSummary.ts

Environment: LifeOS 7.1.1, Claude Code 2.1.206, Bun 1.3.11, Ubuntu 24.04.4 LTS, ThinkPad (AMD Ryzen AI 9 HX PRO 370, 24 threads, 86GB RAM).

Summary

parseItems() recognizes typed-ID TELOS entries in two forms only: bullets (- **ID**: text) and H3 headings (### ID: text). A source file using H2 headings (## T0: title) with a multi-paragraph prose body underneath — the shape produced by a voice-capture/raw-transcript convention, one heading, several paragraphs — matches neither regex. items.length comes back 0, so the code falls through to the documented ID-less-prose fallback (paragraphItems), which treats every blank-line-separated paragraph in the file as its own new item, ID assigned positionally.

Net effect: a single legitimate multi-paragraph entry silently explodes into N fake sequential entries (e.g. one ## T0: entry with 7 paragraphs becomes items T0 through T6), and the fragmentation compounds any time a new paragraph is appended (a follow-up note, a later addendum) — each one becomes yet another fake entry. This lands directly in PRINCIPAL_TELOS.md, which is @-imported into every session. Reproduced on this install: a real 7-paragraph TRAUMAS.md entry and a 2-paragraph WRONG.md entry, both fragmented exactly as described.

Repro

Create a TELOS split file (e.g. WRONG.md) with:

## W0: Some belief
First paragraph of the entry.

Second paragraph, still the same entry, just a line break.

Run GenerateTelosSummary.ts. Output renders two separate bullet items instead of one — the second paragraph gets no ID at all (prefix is empty for that file), just a bare - text line.

Suggested fix

Extend parseItems()'s regex set to also match H2 ## ID: text headings (mirroring the existing H3 case at line ~131), and treat everything up to the next ## heading as that item's full body instead of falling through per-paragraph. The H2-form should take the same "explicit IDs always win" precedence the H3/bullet forms already get over the prose fallback.

waveman2020-sudo avatar Jul 19 '26 03:07 waveman2020-sudo

Fixed in source. parseItems now consumes ## ID: title sections (heading plus body up to the next heading) when no bullet or H3 items matched, so multi-paragraph bodies stay attached to their entry instead of fragmenting into positional fakes. Existing formats are untouched. The clean repro made this easy to verify. Ships with the next release.

danielmiessler avatar Jul 22 '26 04:07 danielmiessler