diff --git a/LifeOS/Tools/InstallEngine.ts b/LifeOS/Tools/InstallEngine.ts index b5b1b76b4d..7fd5b89675 100644 --- a/LifeOS/Tools/InstallEngine.ts +++ b/LifeOS/Tools/InstallEngine.ts @@ -748,10 +748,12 @@ export function activateImports(claudeMdPath: string, configRoot: string): { act const skipped: string[] = []; if (!existsSync(claudeMdPath)) return { activated, skipped }; const lines = readFileSync(claudeMdPath, "utf-8").split("\n"); - // Two dormant-import conventions: the public CLAUDE.md ships `# @LIFEOS/USER/...` - // (hash-prefixed so the @ isn't at line-start and Claude Code skips it); the - // older form is ``. Activation strips the prefix so the - // import sits at line-start and resolves. + // Two dormant-import conventions, both accepted. The shipped template uses + // ``: Claude Code skips imports inside an HTML comment. + // The hash-prefixed `# @LIFEOS/USER/...` form is still matched so CLAUDE.md files + // from older installs activate, but it was never dormant: Claude Code resolves + // `@path` inside a heading line, so it loaded the USER templates at every + // session start (public issue #2296). Activation strips the wrapper either way. const commented = /^\s*#\s+(@[\w./-]+)\s*$|^\s*\s*$/; const out = lines.map((line) => { const m = line.match(commented); diff --git a/LifeOS/Workflows/Setup.md b/LifeOS/Workflows/Setup.md index ec1a24ba4a..befe8e9b3c 100644 --- a/LifeOS/Workflows/Setup.md +++ b/LifeOS/Workflows/Setup.md @@ -28,7 +28,7 @@ The skill ships everything for both tiers in its payload; nothing activates with ### — LifeOS Core (steps 4–6, 8; one consent) — 4. **System overlay** — place the harness-root system files (each `existsSync`-guarded — never clobber a populated harness): - - `install/CLAUDE.template.md` → `CLAUDE.md` (the routing table; its identity `@`-imports ship dormant as `# @LIFEOS/USER/...` and are activated later by `ActivateImports`). + - `install/CLAUDE.template.md` → `CLAUDE.md` (the routing table; its identity `@`-imports ship dormant as `` and are activated later by `ActivateImports`; an HTML comment is the dormant form because Claude Code resolves `@path` inside a `# ` heading line). - `install/LIFEOS/LIFEOS_SYSTEM_PROMPT.md` → the system prompt. This is the real, public-clean system prompt shipped in the payload — used directly, no separate template. - **settings → `bun Tools/InstallSettings.ts`** (dry-run first, then `--apply`): places `install/settings.system.json` → `settings.json` (the system half — WITHOUT hooks; `InstallHooks` owns hooks). The tool expands `$HOME`/`~` in `env` values at write time — the harness injects env values verbatim (#1404/#1451), so a hand copy ships literal `$HOME/...` strings that create a real `$HOME/` junk directory at runtime. Never copy this file by hand. - Substitute `{{LIFEOS_VERSION}}` / `{{DA_NAME}}` / `{{PRINCIPAL_NAME}}` placeholders in the files placed by THIS step (the engine's `substituteTree`). Note the scope: skills and the LIFEOS runtime don't exist yet — they land in 4.5 — so this pass cannot reach them. The full-tree pass and its verification are step 9(d), and that is what makes the install identity-correct. diff --git a/LifeOS/install/CLAUDE.template.md b/LifeOS/install/CLAUDE.template.md index 22d6750147..a1164d9e94 100644 --- a/LifeOS/install/CLAUDE.template.md +++ b/LifeOS/install/CLAUDE.template.md @@ -6,11 +6,11 @@ @LIFEOS/DOCUMENTATION/ARCHITECTURE_SUMMARY.md # Identity @-imports below are activated by the agentic `/LifeOS setup` (via `skills/LifeOS/Tools/ActivateImports.ts`) once the principal scaffolds USER files. # Claude Code does not follow transitive @-imports, so each must be listed here directly. -# @LIFEOS/USER/TELOS/PRINCIPAL_TELOS.md -# @LIFEOS/USER/PRINCIPAL/PRINCIPAL_IDENTITY.md -# @LIFEOS/USER/DIGITAL_ASSISTANT/DA_IDENTITY.md -# @LIFEOS/USER/PROJECTS.md -# @LIFEOS/USER/CONFIG/OPERATIONAL_RULES.md + + + + + ## Constitutional layer diff --git a/LifeOS/install/skills/LifeOS/Tools/InstallEngine.ts b/LifeOS/install/skills/LifeOS/Tools/InstallEngine.ts index b5b1b76b4d..7fd5b89675 100644 --- a/LifeOS/install/skills/LifeOS/Tools/InstallEngine.ts +++ b/LifeOS/install/skills/LifeOS/Tools/InstallEngine.ts @@ -748,10 +748,12 @@ export function activateImports(claudeMdPath: string, configRoot: string): { act const skipped: string[] = []; if (!existsSync(claudeMdPath)) return { activated, skipped }; const lines = readFileSync(claudeMdPath, "utf-8").split("\n"); - // Two dormant-import conventions: the public CLAUDE.md ships `# @LIFEOS/USER/...` - // (hash-prefixed so the @ isn't at line-start and Claude Code skips it); the - // older form is ``. Activation strips the prefix so the - // import sits at line-start and resolves. + // Two dormant-import conventions, both accepted. The shipped template uses + // ``: Claude Code skips imports inside an HTML comment. + // The hash-prefixed `# @LIFEOS/USER/...` form is still matched so CLAUDE.md files + // from older installs activate, but it was never dormant: Claude Code resolves + // `@path` inside a heading line, so it loaded the USER templates at every + // session start (public issue #2296). Activation strips the wrapper either way. const commented = /^\s*#\s+(@[\w./-]+)\s*$|^\s*\s*$/; const out = lines.map((line) => { const m = line.match(commented); diff --git a/LifeOS/install/skills/LifeOS/Workflows/Setup.md b/LifeOS/install/skills/LifeOS/Workflows/Setup.md index ec1a24ba4a..befe8e9b3c 100644 --- a/LifeOS/install/skills/LifeOS/Workflows/Setup.md +++ b/LifeOS/install/skills/LifeOS/Workflows/Setup.md @@ -28,7 +28,7 @@ The skill ships everything for both tiers in its payload; nothing activates with ### — LifeOS Core (steps 4–6, 8; one consent) — 4. **System overlay** — place the harness-root system files (each `existsSync`-guarded — never clobber a populated harness): - - `install/CLAUDE.template.md` → `CLAUDE.md` (the routing table; its identity `@`-imports ship dormant as `# @LIFEOS/USER/...` and are activated later by `ActivateImports`). + - `install/CLAUDE.template.md` → `CLAUDE.md` (the routing table; its identity `@`-imports ship dormant as `` and are activated later by `ActivateImports`; an HTML comment is the dormant form because Claude Code resolves `@path` inside a `# ` heading line). - `install/LIFEOS/LIFEOS_SYSTEM_PROMPT.md` → the system prompt. This is the real, public-clean system prompt shipped in the payload — used directly, no separate template. - **settings → `bun Tools/InstallSettings.ts`** (dry-run first, then `--apply`): places `install/settings.system.json` → `settings.json` (the system half — WITHOUT hooks; `InstallHooks` owns hooks). The tool expands `$HOME`/`~` in `env` values at write time — the harness injects env values verbatim (#1404/#1451), so a hand copy ships literal `$HOME/...` strings that create a real `$HOME/` junk directory at runtime. Never copy this file by hand. - Substitute `{{LIFEOS_VERSION}}` / `{{DA_NAME}}` / `{{PRINCIPAL_NAME}}` placeholders in the files placed by THIS step (the engine's `substituteTree`). Note the scope: skills and the LIFEOS runtime don't exist yet — they land in 4.5 — so this pass cannot reach them. The full-tree pass and its verification are step 9(d), and that is what makes the install identity-correct. diff --git a/LifeOS/install/skills/LifeOS/install/CLAUDE.template.md b/LifeOS/install/skills/LifeOS/install/CLAUDE.template.md index 22d6750147..a1164d9e94 100644 --- a/LifeOS/install/skills/LifeOS/install/CLAUDE.template.md +++ b/LifeOS/install/skills/LifeOS/install/CLAUDE.template.md @@ -6,11 +6,11 @@ @LIFEOS/DOCUMENTATION/ARCHITECTURE_SUMMARY.md # Identity @-imports below are activated by the agentic `/LifeOS setup` (via `skills/LifeOS/Tools/ActivateImports.ts`) once the principal scaffolds USER files. # Claude Code does not follow transitive @-imports, so each must be listed here directly. -# @LIFEOS/USER/TELOS/PRINCIPAL_TELOS.md -# @LIFEOS/USER/PRINCIPAL/PRINCIPAL_IDENTITY.md -# @LIFEOS/USER/DIGITAL_ASSISTANT/DA_IDENTITY.md -# @LIFEOS/USER/PROJECTS.md -# @LIFEOS/USER/CONFIG/OPERATIONAL_RULES.md + + + + + ## Constitutional layer