Fix GenerateTelosSummary parser for real TELOS files#1260
Open
atabisz wants to merge 2 commits into
Open
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes
GenerateTelosSummary.tsparser failures against real TELOS source files. The existing parser was over-specific and produced empty sections for several TELOS files.Changes
Four parser fixes:
parseItems— broadened regex to match all three bullet variants (- **ID:** text,- **ID**: text,- ID: text)parseStrategies— switched to bullet format (- **S0:** ...); kept legacy## S0:header parsing as fallbackparseModels— rewrote for ID-less bold bullets (- **Name** — description), which matchesMODELS.mdshapePRINCIPAL_IDENTITY.md**Name:**field instead of hardcoded placeholderTesting
Added
GenerateTelosSummary.test.ts— 6 fixture-based tests covering all 4 parser changes plus regression coverage forparseProblems(## P0:headers) and the active-vs-deferred goal split.The test isolates against a temp
HOMEdirectory 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.