Skip to content

fix(telos): unified TELOS.md must take precedence over legacy per-topic files - #1809

Open
0bsolescence wants to merge 1 commit into
danielmiessler:mainfrom
0bsolescence:fix/telos-unified-precedence
Open

fix(telos): unified TELOS.md must take precedence over legacy per-topic files#1809
0bsolescence wants to merge 1 commit into
danielmiessler:mainfrom
0bsolescence:fix/telos-unified-precedence

Conversation

@0bsolescence

Copy link
Copy Markdown

Problem

readTelosFile() checks the legacy per-topic path first and only falls through to the unified TELOS.md section when that file is absent:

const path = join(TELOS_DIR, filename);
if (existsSync(path)) { return readFileSync(path, 'utf-8')... }

ScaffoldUser copies the legacy template stubs into every fresh install, so those files always exist and always win. The documented contract that LIFEOS/USER/TELOS/TELOS.md is the single source of truth as of 2026-05-01 is therefore never true on a new install.

Observed on 7.28.3: after writing a real TELOS.md, PRINCIPAL_TELOS.md rendered (sample) template content, and MISSION.md tripped the zero-items guard so the summary refused to generate at all.

Fix

Prefer the unified section whenever it carries content; fall back to the per-file path otherwise, preserving back-compat for pre-unification installs.

Verification

Three cases on a live install:

  • stub present + TELOS.md section present → TELOS.md wins (previously the stub won)
  • TELOS.md section absent, stub present → output byte-identical to unpatched upstream, confirming the legacy path is not regressed
  • neither present → unchanged

Found and fixed with AI assistance while installing 7.28.3; verified on a live install rather than by inspection.

readTelosFile() checked the legacy per-file path FIRST and only fell through to
the unified TELOS.md section when the file was absent. ScaffoldUser copies the
legacy template stubs into every fresh install, so those stubs always existed
and always shadowed the user's real TELOS.md.

Effect: the documented 'TELOS.md is the single source of truth as of 2026-05-01'
was never true for a new install. PRINCIPAL_TELOS.md, which is @-imported at
every session start, silently rendered '(sample)' template data instead of the
user's content, or tripped the zero-items guard and refused to generate at all.

Inverts the precedence: prefer the unified section whenever it carries content,
falling back to the per-file path for installs that predate unification.

Verified three ways on a live install:
  - stub present + TELOS.md section present  -> TELOS.md wins (was: stub won)
  - TELOS.md section absent, stub present    -> identical output to unpatched
    upstream, so the legacy path is not regressed
  - normal case                              -> unchanged
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