Skip to content

Fix GenerateTelosSummary parser for real TELOS files#1260

Open
atabisz wants to merge 2 commits into
danielmiessler:mainfrom
atabisz:fix/telos-summary-parser
Open

Fix GenerateTelosSummary parser for real TELOS files#1260
atabisz wants to merge 2 commits into
danielmiessler:mainfrom
atabisz:fix/telos-summary-parser

Conversation

@atabisz
Copy link
Copy Markdown
Contributor

@atabisz atabisz commented May 14, 2026

Summary

Fixes GenerateTelosSummary.ts parser failures against real TELOS source files. The existing parser was over-specific and produced empty sections for several TELOS files.

Changes

Four parser fixes:

  1. parseItems — broadened regex to match all three bullet variants (- **ID:** text, - **ID**: text, - ID: text)
  2. parseStrategies — switched to bullet format (- **S0:** ...); kept legacy ## S0: header parsing as fallback
  3. parseModels — rewrote for ID-less bold bullets (- **Name** — description), which matches MODELS.md shape
  4. Title — sourced from PRINCIPAL_IDENTITY.md **Name:** field instead of hardcoded placeholder

Testing

Added GenerateTelosSummary.test.ts — 6 fixture-based tests covering all 4 parser changes plus regression coverage for parseProblems (## P0: headers) and the active-vs-deferred goal split.

$ bun test ./Releases/v5.0.0/.claude/PAI/TOOLS/GenerateTelosSummary.test.ts
 6 pass
 0 fail
 11 expect() calls
Ran 6 tests across 1 file. [74.00ms]

The test isolates against a temp HOME directory with synthetic TELOS fixtures — no real TELOS data is touched.

Caveat

The parser-shape assumptions are derived from a single TELOS instance (mine). If upstream maintains different canonical TELOS shape conventions, this may need to be schema-aware or gated on file-structure detection. Happy to adjust based on maintainer guidance.

atabisz added 2 commits May 14, 2026 20:20
Parser failed against actual TELOS source shape. Four changes:

- parseItems: broaden regex to match looser bullet/ID variants
- parseStrategies: switch to bullet format (was ID-prefixed)
- parseModels: rewrite for ID-less bullets
- title: read from PRINCIPAL_IDENTITY instead of hardcoded

Caveat: shape assumptions are derived from a single TELOS instance.
If upstream maintains different canonical TELOS shape conventions,
this may need to be schema-aware or gated on file structure
detection.
Covers all four parser changes:
- parseItems: `- **ID:** text` mission/challenge bullets
- parseStrategies: bullet-format S0/S1
- parseModels: ID-less bold bullets (`- **Name** — text`)
- title sourced from PRINCIPAL_IDENTITY.md

Plus regression coverage for parseProblems (## P0: headers) and the
active-vs-deferred goal split. Builds a temp HOME with synthetic
TELOS fixtures, runs the generator under that HOME, and asserts on
the produced PRINCIPAL_TELOS.md content.

Run: bun test ./Releases/v5.0.0/.claude/PAI/TOOLS/GenerateTelosSummary.test.ts
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.

1 participant