Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions LifeOS/Tools/InstallEngine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 `<!-- @LIFEOS/USER/... -->`. Activation strips the prefix so the
// import sits at line-start and resolves.
// Two dormant-import conventions, both accepted. The shipped template uses
// `<!-- @LIFEOS/USER/... -->`: 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*(@[\w./-]+)\s*-->\s*$/;
const out = lines.map((line) => {
const m = line.match(commented);
Expand Down
2 changes: 1 addition & 1 deletion LifeOS/Workflows/Setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 `<!-- @LIFEOS/USER/... -->` 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.
Expand Down
10 changes: 5 additions & 5 deletions LifeOS/install/CLAUDE.template.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
<!-- @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

Expand Down
10 changes: 6 additions & 4 deletions LifeOS/install/skills/LifeOS/Tools/InstallEngine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 `<!-- @LIFEOS/USER/... -->`. Activation strips the prefix so the
// import sits at line-start and resolves.
// Two dormant-import conventions, both accepted. The shipped template uses
// `<!-- @LIFEOS/USER/... -->`: 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*(@[\w./-]+)\s*-->\s*$/;
const out = lines.map((line) => {
const m = line.match(commented);
Expand Down
2 changes: 1 addition & 1 deletion LifeOS/install/skills/LifeOS/Workflows/Setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 `<!-- @LIFEOS/USER/... -->` 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.
Expand Down
10 changes: 5 additions & 5 deletions LifeOS/install/skills/LifeOS/install/CLAUDE.template.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
<!-- @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

Expand Down