Skip to content

fix(telos): align v5 templates and parsers on bullet format#1114

Open
wojteksbt wants to merge 2 commits intodanielmiessler:mainfrom
wojteksbt:fix/telos-template-bullet-format
Open

fix(telos): align v5 templates and parsers on bullet format#1114
wojteksbt wants to merge 2 commits intodanielmiessler:mainfrom
wojteksbt:fix/telos-template-bullet-format

Conversation

@wojteksbt
Copy link
Copy Markdown

@wojteksbt wojteksbt commented Apr 30, 2026

Closes #1113.

What

Aligns v5 TELOS templates and the GenerateTelosSummary.ts parsers on a single bullet-based convention - **ID**: text for all six ID-bearing files (MISSION, GOALS, PROBLEMS, STRATEGIES, CHALLENGES, NARRATIVES).

Two coordinated changes:

  1. Templates (18 lines, 6 files): - **ID:**- **ID**: (colon outside the bold span). Required so parseItems regex captures the value cleanly. Full rationale in TELOS template/parser mismatch breaks PRINCIPAL_TELOS.md rendering #1113.

  2. Parsers (Releases/v5.0.0/.claude/PAI/TOOLS/GenerateTelosSummary.ts):

    • parseStrategies — was header-only (## S0: / ### S0:), now reads bullets via parseItems with an S\d+ ID filter. Without this change, the shipped STRATEGIES template never renders into PRINCIPAL_TELOS.md because the template is bullet-based and the parser only matched headers.
    • parseProblems — was header-first with bullet fallback. Drops the header path, becomes bullet-only with a P\d+ ID filter. Same rationale: shipped template is bullets; the dual-format complexity wasn't earning its keep.

After this PR, every ID-bearing TELOS file uses the same shape (bullets with **ID**:) and every parser reads the same shape via parseItems.

Why

Without the parser change, the template fix alone is incomplete. Anyone running the bootstrap renderer would get:

  • PRINCIPAL_TELOS.md ## Strategies → empty (parser ignores template bullets entirely)
  • PRINCIPAL_TELOS.md ## Problems Being Solved → renders, but via a fallback path that only existed to paper over the template/parser mismatch

Fixing both at once gives the maintainer one clean "templates and parsers are now consistent" merge, instead of a follow-up PR to make the first one actually work.

Files changed

Templates:

  • Releases/v5.0.0/.claude/PAI/USER/TELOS/MISSION.md
  • Releases/v5.0.0/.claude/PAI/USER/TELOS/GOALS.md
  • Releases/v5.0.0/.claude/PAI/USER/TELOS/PROBLEMS.md
  • Releases/v5.0.0/.claude/PAI/USER/TELOS/STRATEGIES.md
  • Releases/v5.0.0/.claude/PAI/USER/TELOS/CHALLENGES.md
  • Releases/v5.0.0/.claude/PAI/USER/TELOS/NARRATIVES.md

Parser:

  • Releases/v5.0.0/.claude/PAI/TOOLS/GenerateTelosSummary.tsparseStrategies, parseProblems

Breaking change — migration note

Users whose existing STRATEGIES.md or PROBLEMS.md files use H2/H3 headers (## S0: title or ### P0: title) will stop rendering after this merge. Migrate to bullet format - **S0**: title to match the unified convention.

The shipped v5.0.0 templates already use bullets, so users who never customized their files are not affected.

Out of scope

Verification

After merge, running the renderer against the as-shipped v5.0.0 templates produces clean, complete output:

$ bun PAI/TOOLS/GenerateTelosSummary.ts
$ cat PAI/USER/TELOS/PRINCIPAL_TELOS.md

## Missions
- **M0**: (sample) Help one million people make better decisions...
- **M1**: (sample) Build infrastructure that lets individuals own...
- **M2**: (sample — aspirational, optional) Leave behind work...

## Active Goals (2026)
- **G0**: (sample) Ship MVP of Project X by 2026-Q2...
- **G1**: (sample) Publish 24 newsletter issues this year...

## Problems Being Solved
- **P0**: (sample) Most knowledge workers spend more time fighting...
- **P1**: (sample) High-quality information is unevenly distributed...
- **P2**: (sample) Personal data is held by platforms...

## Strategies
- **S0**: (sample) Ship the crappy version, then iterate in public...
- **S1**: (sample) Write before building...
- **S2**: (sample) Default to open...

All six sections render with no ** artifact, no silent drops.

Wojtek added 2 commits April 30, 2026 20:46
The TELOS bootstrap templates use `- **ID:**` (colon inside bold), but
the regex in GenerateTelosSummary.ts:53 expects `- **ID**:` (colon
outside bold):

    /^-\s+\*?\*?(\w+)\*?\*?:\s*(.+)/

When the parser reads the as-shipped template, it captures the trailing
`**` as part of the value, so PRINCIPAL_TELOS.md ends up with garbage
prefixes like:

    - **M0**: ** (sample) Help one million people...

Fixing the templates is the smaller change (18 lines, no code) and keeps
the parser logic untouched.

Affected files:
- MISSION.md, GOALS.md, PROBLEMS.md, STRATEGIES.md, CHALLENGES.md, NARRATIVES.md
The shipped v5 templates use bullets (`- **S0**: text`), but
`parseStrategies` matched only H2/H3 headers and `parseProblems` matched
headers first with a bullet fallback. Result: STRATEGIES section silently
empty in PRINCIPAL_TELOS.md; PROBLEMS path was unnecessarily forked.

Standardize both on `parseItems` with an ID-prefix filter, mirroring how
`parseMissions`, `parseGoals`, `parseNarratives`, and `parseChallenges`
already work. Single convention across all ID-bearing TELOS files.

Breaking change: existing user STRATEGIES.md / PROBLEMS.md files that
relied on H2/H3 header parsing (`## S0: title`) need to migrate to
bullet format (`- **S0**: title`) to render. The shipped v5.0.0
templates already use bullets, so users who never customized are
unaffected.
@wojteksbt wojteksbt changed the title fix(telos): use parser-compatible bullet format in v5 templates fix(telos): align v5 templates and parsers on bullet format Apr 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TELOS template/parser mismatch breaks PRINCIPAL_TELOS.md rendering

1 participant