Personal_AI_Infrastructure icon indicating copy to clipboard operation
Personal_AI_Infrastructure copied to clipboard

Pulse: text after the last ## section of TELOS.md lands in that section, so the scaffold's closing note becomes a Wisdom entry

Open rain77-work opened this issue 2 months ago • 1 comments

Version

LifeOS 7.40.4 / Pulse

What is broken

Text after the last ## section of TELOS.md is parsed into that section.

The shipped scaffold ends with a horizontal rule and an italic closing note ("This file is the canonical TELOS. …") after the Wisdom section. parseTelosUnified closes a section only at the next ## heading, so the rule and the note become part of Wisdom. parseSections removes the rule and keeps the note. /api/life/goals then returns the note as a second wisdom item, next to the user's own lessons.

Where (file:line)

Reader: LIFEOS/PULSE/Observability/observability.ts:3484-3503 (parseTelosUnified: a section ends only at a ## line) and :2295 (parseSections: strips --- lines and HTML comments, keeps other text).

Writer: the scaffold USER/TELOS/TELOS.md, last two lines.

Repro on a clean tree

cd ~/.claude && F=LIFEOS/PULSE/Observability/observability.ts
{ sed -n '2291,2361p' "$F"; cat <<'EOF'
import { readFileSync } from "node:fs";
const t = readFileSync("skills/LifeOS/install/USER/TELOS/TELOS.md", "utf8");
// parseTelosUnified ends a section only at the next "## " heading,
// so the last section's body runs to the end of the file:
const wisdom = t.split(/^## Wisdom[^\n]*\n/m)[1];
console.log(JSON.stringify(parseSections(wisdom).map(s => s.heading), null, 1));
EOF
} > /tmp/wisdom-repro.ts && bun /tmp/wisdom-repro.ts

The script copies parseSections out of the shipped file by line range and runs it on the scaffold's Wisdom section, taken the way parseTelosUnified takes it.

Live form on a fresh install: curl -s localhost:31337/api/life/goals | jq '.wisdom'.

Negative control

On unpatched 7.40.4:

[
 "(sample) A lesson you've learned that guides you.",
 "*This file is the canonical TELOS. The DA and Pulse read it directly; the spl..."
]

Two items come back. The second is the scaffold's closing note.

Suggested fix

Untested. Put the closing note inside an HTML comment in the scaffold (parseSections already strips comments), or end the last section at a trailing horizontal rule.

Before submitting

  • [x] I searched open and closed issues for this defect.
  • [x] The repro runs against a clean tree of the version above, not against my modified install.
  • [x] I removed personal data from the pasted output — real names, absolute home paths, tokens, my own content.

rain77-work avatar Oct 03 '26 09:10 rain77-work

[!NOTE] 🤖 Kai (AI assistant) responding on behalf of Daniel Miessler

Thanks @rain77-work. You were right: the --- rule and italic closing note at the end of the TELOS.md scaffold were read as part of the last section and showed up as a Wisdom entry.

Fixed in source. The scaffold now carries that note as one HTML comment with the same text, and comments are stripped before parsing. A test reads the shipped template and checks that Wisdom holds only its sample entry.

Installs that already copied the old footer keep it until you delete that line. This ships in the next release.

danielmiessler avatar Oct 28 '26 18:10 danielmiessler