telos: make TelosFreshness and InterviewScan split-file aware#1587
Open
asdf8675309 wants to merge 1 commit into
Open
telos: make TelosFreshness and InterviewScan split-file aware#1587asdf8675309 wants to merge 1 commit into
asdf8675309 wants to merge 1 commit into
Conversation
## What LifeOS supports a split-file TELOS: TELOS.md is a thin index, and each section lives in its own ALLCAPS file (MISSION.md, GOALS.md, ...). GenerateTelosSummary already reads those, but TelosFreshness and InterviewScan only ever looked at TELOS.md's H2 headings. So on a split-file setup, freshness misses every section and the interview report scores them as "does not exist." ## Change (two files, one concern) - TelosFreshness.ts: adds SPLIT_FILE_BY_SLUG (the inverse of GenerateTelosSummary's LEGACY_FILE_TO_SECTION) and an exported splitFilePathForSlug(). readTelosFreshness now surfaces each split file as its own section, and the freshness bump writes the split file. One shared extractPreview() helper feeds both the H2 scan and the split scan. - InterviewScan.ts: extractSectionBody reads the split file's body as the real source. It imports from TelosFreshness, which is why this is one PR. When a section shows up as both a TELOS.md H2 and a split file, the split file wins — same as GenerateTelosSummary, and same as what TELOS.md itself says. In a normal thin-index setup nothing lives in both, so this only settles the odd overlap case. ## Why it's safe For a plain unified TELOS.md there's no split file, so none of this runs and nothing changes. The split path only kicks in when the sibling file exists. A populated split file wins; an empty one falls back to the H2, so a half-made file can't hide real content. Nothing gets counted twice. The only write is the existing freshness bump, now pointed at the right file. ## Verification Tested on macOS, Bun 1.3.14, against a real split-file TELOS (thin index plus 21 ALLCAPS files). | TELOS shape | TelosFreshness sections | InterviewScan on Mission | |-------------|-------------------------|--------------------------| | unified (H2 per section) | all H2 sections (unchanged) | reads H2 body (unchanged) | | split, BEFORE this change | 3 (only the index H2s) | 0% "section does not exist" | | split, AFTER this change | 24 (3 H2 + 21 split, real per-file freshness) | 100% (reads MISSION.md body) | | split, sibling genuinely absent | not surfaced | 0% "section does not exist" (correct) | ## Known follow-up SPLIT_FILE_BY_SLUG and LEGACY_FILE_TO_SECTION are the same mapping in two directions, kept by hand in two different tools — add a TELOS concept and you have to update both. A single shared map would kill the drift risk. Left it out here to keep this to one concern. ## Scope TelosFreshness.ts + InterviewScan.ts. No new dependency. Unified-TELOS users see no change. Co-authored-by: Claude <noreply@anthropic.com>
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.
What
LifeOS supports a split-file TELOS: TELOS.md is a thin index, and each section lives in its own ALLCAPS file (MISSION.md, GOALS.md, ...). GenerateTelosSummary already reads those, but TelosFreshness and InterviewScan only ever looked at TELOS.md's H2 headings. So on a split-file setup, freshness misses every section and the interview report scores them as "does not exist."
Change (two files, one concern)
When a section shows up as both a TELOS.md H2 and a split file, the split file wins — same as GenerateTelosSummary, and same as what TELOS.md itself says. In a normal thin-index setup nothing lives in both, so this only settles the odd overlap case.
Why it's safe
For a plain unified TELOS.md there's no split file, so none of this runs and nothing changes. The split path only kicks in when the sibling file exists. A populated split file wins; an empty one falls back to the H2, so a half-made file can't hide real content. Nothing gets counted twice. The only write is the existing freshness bump, now pointed at the right file.
Verification
Tested on macOS, Bun 1.3.14, against a real split-file TELOS (thin index plus 21 ALLCAPS files).
| TELOS shape | TelosFreshness sections | InterviewScan on Mission | |-------------|-------------------------|--------------------------| | unified (H2 per section) | all H2 sections (unchanged) | reads H2 body (unchanged) | | split, BEFORE this change | 3 (only the index H2s) | 0% "section does not exist" | | split, AFTER this change | 24 (3 H2 + 21 split, real per-file freshness) | 100% (reads MISSION.md body) | | split, sibling genuinely absent | not surfaced | 0% "section does not exist" (correct) |
Known follow-up
SPLIT_FILE_BY_SLUG and LEGACY_FILE_TO_SECTION are the same mapping in two directions, kept by hand in two different tools — add a TELOS concept and you have to update both. A single shared map would kill the drift risk. Left it out here to keep this to one concern.
Scope
TelosFreshness.ts + InterviewScan.ts. No new dependency. Unified-TELOS users see no change.