From 5739c97ede70c490f7b324b3cfccde60e979486d Mon Sep 17 00:00:00 2001 From: Daniel Date: Sun, 9 Aug 2026 19:43:20 -0700 Subject: [PATCH] fix(telos): read Context Filter from TELOS.md instead of a hardcoded value GenerateTelosSummary emitted a hardcoded Context Filter string into PRINCIPAL_TELOS.md, which is @-imported at every session start. The literal carried one specific person's values ('human flourishing, Human 3.0 transition, ...'), so every install silently overwrote the user's own Context Filter with someone else's, no matter what TELOS.md said. Reads the '## Context Filter' section from unified TELOS.md, falling back to a neutral prompt when absent. Verified: with the user's own filter in TELOS.md, PRINCIPAL_TELOS.md now renders that filter rather than the literal. --- .../LIFEOS/TOOLS/GenerateTelosSummary.ts | 23 ++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/LifeOS/install/LIFEOS/TOOLS/GenerateTelosSummary.ts b/LifeOS/install/LIFEOS/TOOLS/GenerateTelosSummary.ts index d253c1414e..51df0375f8 100755 --- a/LifeOS/install/LIFEOS/TOOLS/GenerateTelosSummary.ts +++ b/LifeOS/install/LIFEOS/TOOLS/GenerateTelosSummary.ts @@ -188,6 +188,24 @@ function paragraphItems(content: string, prefix: string): ParsedItem[] { /** * Parse mission items from MISSION.md */ +/** Read the "## Context Filter" H2 body from the unified TELOS.md. */ +function readContextFilter(): string { + try { + const raw = readFileSync(join(TELOS_DIR, 'TELOS.md'), 'utf-8'); + const i = raw.indexOf('## Context Filter'); + if (i < 0) return ''; + const rest = raw.slice(i + '## Context Filter'.length); + const nxt = rest.indexOf('\n## '); + const m: string[] | null = ['', nxt >= 0 ? rest.slice(0, nxt) : rest]; + if (!m) return ''; + return m[1] + .split('\n') + .filter(l => !l.trim().startsWith('