⛰️ LifeOS — The AI-powered Life Operating System that helps you hill climb to wherever you're going.
release 7.1.1: install awareness (Doctor + capability-aware install + Pulse System Health), Algorithm v8.4.0 depth steering, statusline upgrades, community fixes (#1450 #1456 #1463 #1470 #1471)
Daniel Miesslera4e8e7466c5e
diff --git a/LifeOS/GETTING-STARTED.md b/LifeOS/GETTING-STARTED.mdnew file mode 100644index 00000000..67d91ecf--- /dev/null+++ b/LifeOS/GETTING-STARTED.md@@ -0,0 +1,60 @@+# Getting Started — after the install++You installed LifeOS. This page covers the part `INSTALL.md` couldn't: the **external tools** LifeOS's doctrine uses when they're available. None are required — every one degrades honestly when absent — but each unlocks a real capability. For each: what it powers, how to set it up, and how to prove it's live.++**The one command to remember:**++```+bun <configRoot>/LIFEOS/TOOLS/Doctor.ts+```++Run it whenever anything feels off. Every ❌ line carries its own fix command. `--network` adds end-to-end auth checks (only for tools you've configured). `decline <name>` turns a capability off permanently and silently — declining is a supported way to run LifeOS, not a defect.++---++## codex — cross-vendor audit++**Powers:** an independent second-vendor review on high-impact work. Without it, audits still run — but same-vendor, and the output is labeled accordingly.++- **Install:** `bun install -g @openai/codex`+- **Auth:** `codex login` (needs an OpenAI account)+- **Verify:** `bun <configRoot>/LIFEOS/TOOLS/Doctor.ts` → codex ✅+- **Don't want it?** `Doctor.ts decline codex` — audits stay single-vendor, honestly labeled.++## Interceptor — real-browser verification++**Powers:** verification of anything web-facing through a real Chrome — screenshots, console logs, actual page loads. Doctrine treats "curl returned 200" as *not* verification; this is the tool that does it right.++- **Install:** the skill ships with LifeOS; it needs a real browser binary — Google Chrome or Brave.+- **Auth:** none.+- **Verify:** `Doctor.ts` → interceptor ✅ (skill present + browser found).++## Cloudflare / wrangler — scheduled cloud flows++**Powers:** the "runs while you sleep" layer (Arbol) and Worker deploys.++- **Install:** wrangler runs via `bunx wrangler` — nothing global needed.+- **Auth:** create a Cloudflare API token (Workers permissions), add to `<configRoot>/.env` as `CLOUDFLARE_API_TOKEN=...`+- **Verify:** `Doctor.ts --network` → cloudflare ✅ (runs a real `wrangler whoami`).+- **Don't want it?** `Doctor.ts decline cloudflare`.++## ElevenLabs — voice notifications++**Powers:** spoken notifications through the Pulse voice server.++- **Install:** nothing — it's an API.+- **Auth:** add `ELEVENLABS_API_KEY=...` and `ELEVENLABS_VOICE_ID=...` to `<configRoot>/.env`. Pick a **premade or cloned** voice from your ElevenLabs library — "famous" voices are not usable through the API and fail with `famous_voice_not_permitted`. A scoped, TTS-only API key works fine.+- **Verify:** `Doctor.ts --network` → voice ✅ (runs a real 2-character synthesis on the exact path notifications use).+- **Don't want it?** `Doctor.ts decline voice` — notifications stay on-screen only.++---++## How degradation works (so you can trust it)++- The Doctor writes an **advisory manifest** (`LIFEOS/MEMORY/STATE/capabilities.json`). It's a cache with TTLs, not truth — the runtime re-checks cheaply at the moment a capability is actually used.+- A **broken** capability warns once at the moment you'd have used it, with its fix command. Cooldowns prevent nagging.+- A **declined** capability is silent forever, everywhere.+- Output produced without a doctrine-relevant capability is **labeled** (e.g. "same-vendor audit only") — absence is never hidden inside a confident result.+- The manifest is tamper-evident: `Doctor.ts --verify` flags any edit made outside the Doctor.++That's the contract: nothing here scores you, nothing nags, and nothing pretends.diff --git a/LifeOS/INSTALL.md b/LifeOS/INSTALL.mdindex bdb2d455..2996cbd8 100644--- a/LifeOS/INSTALL.md+++ b/LifeOS/INSTALL.md@@ -119,7 +119,7 @@ LifeOS installs in **two layers**, and you present them that way.| Component | What it adds | Default ||---|---|---|| **hooks** | skill routing, the memory loop, voice, per-turn context injection — most behavior needs these (this is step 6) | **recommended** |-| **statusline** | the LifeOS status line in your prompt | optional |+| **statusline** | the LifeOS status line in your prompt — set `preferences.temperatureUnit` in `settings.json` to match your human's locale (payload default is `celsius`; suggest `fahrenheit` for US locales/timezones) | optional || **tooltips** | custom Claude Code spinner tips | optional || **spinner verbs** | custom spinner verbs | optional || **agents** | the named agent library | optional |@@ -128,6 +128,22 @@ LifeOS installs in **two layers**, and you present them that way.The `launchd` components (Pulse, worksweep, derivedsync) are macOS-only — skip them cleanly on Linux/Windows. Show your human this menu, take their picks, and deploy only those. The **Setup** workflow (step 9) drives the actual deployment of the chosen set and verifies each with real evidence (e.g. Pulse → `curl :31337/healthz` = 200). Everything ships in the payload; nothing activates without its matching yes.+### 8.5 Capability check — probe what doctrine assumes (Doctor)++LifeOS doctrine leans on a few **external tools** the core install does not ship: a cross-vendor audit CLI (`codex`), a real browser for web verification (Interceptor), Cloudflare/wrangler for scheduled cloud flows, ElevenLabs for voice. Nothing above installed them, and the features that depend on them must degrade *loudly*, not silently. After Core lands, run the doctor:++```+bun <configRoot>/LIFEOS/TOOLS/Doctor.ts+```++It prints one line per capability — live ✅, broken ❌ (each with its own copy-paste fix command), or off ⏸ — and writes an advisory manifest the runtime uses to flag degraded output. Then ask your human, per broken capability: **set it up now, later, or never?**++- **Now** → run the fix command shown, re-run Doctor. With their permission, add `--network` to verify auth end-to-end — network probes only ever touch capabilities they have already configured.+- **Later** → leave it. The runtime will surface it the moment a degraded capability is actually invoked, fix command included.+- **Never** → `bun <configRoot>/LIFEOS/TOOLS/Doctor.ts decline <name>`. Declined is a clean, permanent, silent OFF — no warnings, no red marks, no nagging, ever. Declining is a legitimate way to run LifeOS, not a defect.++Deeper walkthroughs per tool (what it's for, install, auth, verify it's live): `GETTING-STARTED.md`, shipped next to this file. Your human can re-run the doctor any time something feels off: `lifeos doctor` territory — it's the same command.+### 9. Run Setup, then InterviewRun the **Setup** workflow (`Workflows/Setup.md`) to finish integration and verify with real evidence, then the **Interview** workflow (`Workflows/Interview.md`): name the assistant, capture identity and TELOS (current state → ideal state), pull in any sources your human offers, and seed Pulse. By the end, the config tree is populated and Pulse shows real data.@@ -143,6 +159,8 @@ Run the **Setup** workflow (`Workflows/Setup.md`) to finish integration and veri| **Cursor / Cline / Codex / Gemini / other** | ✅ | ⚠️ context loads every session via `AGENTS.md`; workflows run on request; always-on hooks not wired yet (roadmap) || **Chat-only assistants (no files / no commands)** | ❌ | ❌ — install stops at the capability gate |+Full-doctrine features additionally depend on the external tools in step 8.5 (codex, browser, Cloudflare, ElevenLabs). Without one, the dependent feature runs degraded **and says so** — it never silently pretends. The Doctor table is the live source of truth for what's on.+## Rules you must follow- **Additive, never clobbering.** Only add what's missing; never overwrite or delete a populated dir or a file you didn't create.diff --git a/LifeOS/Tools/InstallSettings.ts b/LifeOS/Tools/InstallSettings.tsnew file mode 100644index 00000000..4b81c130--- /dev/null+++ b/LifeOS/Tools/InstallSettings.ts@@ -0,0 +1,115 @@+#!/usr/bin/env bun+/**+ * InstallSettings — Setup step 4's settings placement, as a deterministic tool.+ * Places the payload's `install/settings.system.json` into the harness+ * `settings.json` with the one transform the copy-by-hand step kept getting+ * wrong: **`env` values are expanded at write time** (`$HOME`/`${HOME}`/`~` →+ * the real home). The harness injects env values verbatim with NO shell+ * expansion (LifeOS#1404/#1451) — a literal `"$HOME/..."` value creates a real+ * `$HOME/` directory on disk that silently captures runtime state. Command+ * strings (hooks, statusLine) are shell-evaluated and ship untouched.+ *+ * Semantics match the sibling installers (DeployCore/InstallHooks):+ * - settings.json absent → write the expanded template whole.+ * - settings.json present → additive merge: only ABSENT top-level keys and+ * ABSENT env keys are added (expanded); existing values are never touched.+ * - Dry-run by default; `--apply` mutates; backup before every write.+ * - REFUSES the author's live source tree (`--allow-dev` to override).+ *+ * Usage:+ * bun InstallSettings.ts [--config-root <dir>] [--skill-root <dir>] [--apply] [--allow-dev]+ */++import { copyFileSync, existsSync, readFileSync, writeFileSync } from "node:fs";+import { join } from "node:path";+import { detectDevTree } from "./InstallEngine";++interface Args { configRoot: string; skillRoot: string; apply: boolean; allowDev: boolean; }++function parseArgs(): Args {+ const a = process.argv.slice(2);+ const get = (flag: string): string | undefined => {+ const i = a.indexOf(flag);+ return i >= 0 && a[i + 1] && !a[i + 1].startsWith("--") ? a[i + 1] : undefined;+ };+ const home = process.env.HOME || "";+ return {+ configRoot: get("--config-root") || process.env.CLAUDE_CONFIG_DIR || join(home, ".claude"),+ skillRoot: get("--skill-root") || join(import.meta.dir, ".."),+ apply: a.includes("--apply"),+ allowDev: a.includes("--allow-dev"),+ };+}++/** Expand a LEADING $HOME / ${HOME} / ~ path segment. Mid-string refs are left alone. */+export function expandLeadingHome(value: string, home: string): string {+ if (!home) return value;+ if (value === "$HOME" || value === "${HOME}" || value === "~") return home;+ if (value.startsWith("$HOME/")) return home + value.slice("$HOME".length);+ if (value.startsWith("${HOME}/")) return home + value.slice("${HOME}".length);+ if (value.startsWith("~/")) return home + value.slice(1);+ return value;+}++function expandEnvBlock(settings: Record<string, unknown>, home: string): number {+ const env = settings.env;+ if (!env || typeof env !== "object") return 0;+ let n = 0;+ for (const [k, v] of Object.entries(env as Record<string, unknown>)) {+ if (typeof v === "string") {+ const expanded = expandLeadingHome(v, home);+ if (expanded !== v) { (env as Record<string, unknown>)[k] = expanded; n++; }+ }+ }+ return n;+}++const args = parseArgs();+const home = process.env.HOME || "";+const templatePath = join(args.skillRoot, "install", "settings.system.json");+const targetPath = join(args.configRoot, "settings.json");++if (detectDevTree(args.configRoot) && !args.allowDev) {+ console.log(JSON.stringify({ ok: false, error: "dev tree detected — refusing to touch the author's live settings (--allow-dev to override)" }, null, 2));+ process.exit(2);+}+if (!existsSync(templatePath)) {+ console.log(JSON.stringify({ ok: false, error: `payload settings.system.json not found at ${templatePath}` }, null, 2));+ process.exit(1);+}++const template = JSON.parse(readFileSync(templatePath, "utf8")) as Record<string, unknown>;+const expandedCount = expandEnvBlock(template, home);++const report: Record<string, unknown> = { ok: true, apply: args.apply, target: targetPath, envValuesExpanded: expandedCount };++if (!existsSync(targetPath)) {+ report.mode = "create";+ report.topLevelKeys = Object.keys(template).length;+ if (args.apply) writeFileSync(targetPath, JSON.stringify(template, null, 2) + "\n");+} else {+ const current = JSON.parse(readFileSync(targetPath, "utf8")) as Record<string, unknown>;+ const addedKeys: string[] = [];+ for (const [k, v] of Object.entries(template)) {+ if (k === "env") continue; // handled per-key below+ if (!(k in current)) { current[k] = v; addedKeys.push(k); }+ }+ const curEnv = (current.env && typeof current.env === "object" ? current.env : (current.env = {})) as Record<string, unknown>;+ const tplEnv = (template.env || {}) as Record<string, unknown>;+ const addedEnv: string[] = [];+ for (const [k, v] of Object.entries(tplEnv)) {+ if (!(k in curEnv)) { curEnv[k] = v; addedEnv.push(k); }+ }+ report.mode = "merge";+ report.addedKeys = addedKeys;+ report.addedEnv = addedEnv;+ if (args.apply && (addedKeys.length || addedEnv.length)) {+ copyFileSync(targetPath, targetPath + ".backup-" + new Date().toISOString().replace(/[:.]/g, "-"));+ writeFileSync(targetPath, JSON.stringify(current, null, 2) + "\n");+ } else if (args.apply) {+ report.note = "nothing to add — no write, no backup";+ }+}++console.log(JSON.stringify(report, null, 2));+process.exit(0);diff --git a/LifeOS/Workflows/Setup.md b/LifeOS/Workflows/Setup.mdindex d9a86a5b..40a435c1 100644--- a/LifeOS/Workflows/Setup.md+++ b/LifeOS/Workflows/Setup.md@@ -30,7 +30,7 @@ The skill ships everything for both tiers in its payload; nothing activates with4. **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/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.- - `install/settings.system.json` → `settings.json` (the system half — the public settings WITHOUT the hooks block; `InstallHooks` owns hooks).+ - **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 placed files (the engine's `substituteTree`).4.5. **Deploy core system: skills + runtime** — `bun Tools/DeployCore.ts` (dry-run first, then `--apply`): copyMissing's the shipped `install/skills/` → `<configRoot>/skills/` (the ~50-skill library) and `install/LIFEOS/` → `<configRoot>/LIFEOS/` (the runtime — ALGORITHM, DOCUMENTATION, TOOLS, PULSE, statusline, VERSION, USER_TEMPLATES), EXCLUDING `USER` (step 5 scaffolds it) and `LIFEOS_INSTALL`; the empty `MEMORY/` tree (WORK/KNOWLEDGE/LEARNING/STATE/OBSERVABILITY/SKILLS) is scaffolded here too so the runtime has a home to write to. Targets ALL-CAPS `LIFEOS` so the `@LIFEOS/...` imports resolve. Never overwrites a populated file (idempotent), refuses the dev tree (`isDevTree` → exit 2), and FAILS LOUD (exit 1) if a required payload source is absent — never a silent no-op. **Runs BEFORE ScaffoldUser**: the active `@LIFEOS/DOCUMENTATION/ARCHITECTURE_SUMMARY.md` import must resolve and the skills must exist before the rest of setup.5. **ScaffoldUser** — `bun Tools/ScaffoldUser.ts` → `existsSync`-guarded copyMissing from the shipped `templates/USER/` into the user config tree. Never overwrites a populated file.diff --git a/LifeOS/install/CLAUDE.template.md b/LifeOS/install/CLAUDE.template.mdindex 56797ee2..4d42f0b6 100644--- a/LifeOS/install/CLAUDE.template.md+++ b/LifeOS/install/CLAUDE.template.md@@ -1,4 +1,4 @@-# LifeOS 7.0.0 — LifeOS (the Life Operating System)+# LifeOS 7.1.1 — LifeOS (the Life Operating System)> **LifeOS is the Life OS. The DA is the principal's AI assistant. Pulse is the Life Dashboard.**> Canonical thesis: `LIFEOS/DOCUMENTATION/LifeOs/LifeOsThesis.md`. Everyone running LifeOS names their own DA. LifeOS targets AS3 on the LifeOS Maturity Model, with lineage from "The Real Internet of Things" (2016).diff --git a/LifeOS/install/LIFEOS/ALGORITHM/LATEST b/LifeOS/install/LIFEOS/ALGORITHM/LATESTindex 2bf50aaf..a2f28f43 100644--- a/LifeOS/install/LIFEOS/ALGORITHM/LATEST+++ b/LifeOS/install/LIFEOS/ALGORITHM/LATEST@@ -1 +1 @@-8.3.0+8.4.0diff --git a/LifeOS/install/LIFEOS/ALGORITHM/changelog.md b/LifeOS/install/LIFEOS/ALGORITHM/changelog.mdindex 6bcd41b4..611e2e21 100644--- a/LifeOS/install/LIFEOS/ALGORITHM/changelog.md+++ b/LifeOS/install/LIFEOS/ALGORITHM/changelog.md@@ -2,6 +2,8 @@The doctrine file (`vX.Y.Z.md`) holds **only doctrine** — what the Algorithm does, this run. All change history, migration steps, rollback recipes, and "what did/didn't change" prose live here. New versions add a section to the **Full History** below; the doctrine file stays focused.+- **v8.4.0 changelog (depth-directive nudge — third always-on row, claims 10/15 sharpened, FEATURE):** principal-approved 2026-07-12 ("Okay, let's go ahead and do it. Just keep BPE in mind all the time."), from a live capability-underspend incident the same session: "Think deeply about how you would redesign X" was answered from 4 file reads with zero capability consideration, and nothing could catch it — the turn had no registered run, so claims 10/15 had no teeth, and the routing row matches no depth language. Root cause: a depth directive is a signal the turn IS a run, and nothing treated it as one. Design was RedTeam'd BEFORE build (3 adversarial agents): a Stop-hook blocking gate and every mandated-capability variant were killed (gating on tool-call presence is procedure, not outcome, and Goodharts into token dispatches); only the advisory question row survived. Changes: hook v2.2.0 adds `matchDepthDirective()` (8-phrase lexicon, 200-char head window, fenced/long-paste guards, word boundaries, `depth` cooldown key, `DEPTH:` fires into the routing telemetry) firing ONLY with no active run — mid-run the principal nudge already covers it; doctrine adds the always-on events row, claim 10 names depth/steering directives explicit asks, claim 15 names the silent shallow pass on a directive a surfaced break, and §Events gains the bounding principle (a row may only ask a question about an outcome already in doctrine; phrase→procedure maps and "a tool was invoked" pass conditions are banned by construction). Known-uncovered and stated: undirected under-spend (hard task, no magic words) stays with judgment + reflections. Fresh-context post-ship audit (3 findings, all fixed same session): changelog entry relocated here from the doctrine file per the v6.28.0 lean-file rule; ARCHITECTURE_SUMMARY regenerated; spinner tip version bumped; plus its INFO note promoted to a fix — bare directives ("go deep" as the whole prompt) were eaten by `routeSuppressed`'s 15-char floor, so the depth row gets its own `depthSuppressed` gate (command/tag prefixes only). Origin ISA: `MEMORY/WORK/20260712-depth-directive-nudge/ISA.md`. Migration: `echo 8.4.0 > LATEST` (done). Rollback: `echo 8.3.0 > LATEST` + revert the hook commit.+- **v8.3.0 changelog (AlgorithmNudge — nudge layer unified, two always-on nudges added, FEATURE):** principal-approved 2026-07-11 ("Why wouldn't SkillRouter and ISA Nudge be the same? Could we not unify them? And just call it AlgorithmNudge […] do it"), from the dynamic-range audit (`MEMORY/WORK/20260711-dynamic-range-audit/REPORT.md`). `hooks/IsaNudge.hook.ts` → **`hooks/AlgorithmNudge.hook.ts`** (v2.0.0) — ONE runner, two scopes. **ALWAYS-ON (any session):** *skill-routing* — prompt matches a skill's USE WHEN → "invoke the skill, don't handroll"; deterministic phrase match against a prebuilt index (`MEMORY/STATE/skill-usewhen-index.json`, 129 skills / 1,482 phrases at cut; stale → detached rebuild via `--rebuild-index`, never a synchronous scan on the hot path; noise guards: single words ≥6 chars word-boundary, multiword ≥7 chars, >6 matches = generic = silence, per-skill 60-min cooldown) — motivated by the audit's routing finding (under-use beats over-invocation ~4:1 in 48h traces); *late-ISA* — 25+ tool calls with no registered run → "still trivial, or does done need writing down?" (once per session) — motivated by the observed 2h-uncovered-run. **RUN-SCOPED:** the five existing nudges byte-identical, plus a tier-free **spend** nudge (~75 in-run tool calls with claims open → "escalate, descope, or surface?", 30-min cooldown so it re-fires on long runs) replacing the retired budget-half nudge — closes audit fix #1, where doctrine advertised a nudge the hook had removed. §Events table rewritten: 8 rows with scope markers, runner renamed. Removed vestigials: `tier` parsing, `budgetNudged` state. Nudge prefix `🧭 ISA-NUDGE:` → `🧭 ALGO-NUDGE:`. Registration swapped in settings.system.json (PostToolUseFailure) + settings.user.json (UserPromptSubmit) + PostToolObserver import; MergeSettings applied; first live fire observed same-session. Post-audit hardening (hook v2.1.0, same session): Forge audit (`concerns`, 5 findings) caught a real gate regression — a shared systemish predicate had narrowed the principal nudge — fixed via decoupled `routeSuppressed`/`principalSuppressed` predicates (original byte-equivalent semantics restored, regression-tested with Forge's own counterexamples); plus session_id path-guard, 31-word routing stoplist, parse-floor alignment (index 1,482→1,414 phrases), and routing-fire telemetry (`MEMORY/OBSERVABILITY/algo-nudge-routing.jsonl`) to tune noise floors from real data. Grok cross-vendor pass ($0.0087): `fail` on the known bundle-visibility class; its real catch (stale ISA progress frontmatter) fixed, probe evidence embedded in the ISA Log. 15 unit tests (`hooks/AlgorithmNudge.test.ts`). Capitalization note: the principal flagged `Isa` vs `ISA` — the rename retires the outlier (ISASync/ISARenderOnStop were already correct). Origin ISA: `MEMORY/WORK/20260711-algorithmnudge-unification/ISA.md`. Migration: `echo 8.3.0 > LATEST` (done). Rollback: `echo 8.2.1 > LATEST` + revert the hook/settings commit (IsaNudge restorable from git history).- **v8.2.1 changelog (model-selection baseline — steering removed, PATCH):** principal directive 2026-07-11: "clean up all this model selection garbage; start from baseline, where you're making all the decisions yourself with no steering." §Spend loses the **Core-surface max-intelligence rule** (the last model-steering mandate in doctrine) and "three spend facts" becomes two; the §Spend intro now states there is no model-routing rubric — model choice is per-dispatch judgment under claim 15's spend check. KEPT as tool-contract facts: the 110k-token inline-reachable gotcha and the Agent(fable)=Opus execution reality (re-dated "at last probe 2026-07-07, re-probe periodically"). Companion changes same session: `AgentInvocation.hook.ts` v1.3.0 (model injector removed — its E4/E5 tier signal died with the 2026-07-11 tier retirement and had silently flattened every dispatch to Opus; lifecycle tracking + dispatch-model logging kept), `models.ts` steering comments rewritten to baseline (EFFORT_MODEL table kept as the `Inference.ts --level` dial), OPERATIONAL_RULES §Default model rewritten to reality (saved default is Fable 5 [1m], not Opus — the doc had gone stale against settings.json). Same session, on the baseline analysis plus a live probe (bare inheritance ALSO executes Opus — the subagent self-reported Fable 5 while its transcript ran claude-opus-4-8 with a `fallback` block), the principal directed the one re-add ("Just fix it"): **the core-surface-max rule returns to §Spend in probed-carrier form** — hard reasoning on core-surface work runs on real Fable (main loop or Inference-max subprocess), never on a downgraded Agent dispatch. Doctrine line only; no hook, classifier, or injection came back. Origin ISA: `MEMORY/WORK/20260711-model-selection-baseline/ISA.md`. Migration: `echo 8.2.1 > LATEST` (done); v8.2.0.md kept byte-identical. Rollback: `echo 8.2.0 > LATEST` + revert the hook/models/rules commits.diff --git a/LifeOS/install/LIFEOS/ALGORITHM/v8.3.0.md b/LifeOS/install/LIFEOS/ALGORITHM/v8.4.0.mdsimilarity index 93%rename from LifeOS/install/LIFEOS/ALGORITHM/v8.3.0.mdrename to LifeOS/install/LIFEOS/ALGORITHM/v8.4.0.mdindex acb0377f..2305e6d2 100644--- a/LifeOS/install/LIFEOS/ALGORITHM/v8.3.0.md+++ b/LifeOS/install/LIFEOS/ALGORITHM/v8.4.0.md@@ -1,4 +1,4 @@-# The Algorithm 8.3.0+# The Algorithm 8.4.0## The point@@ -40,7 +40,7 @@ Teeth per claim: **HOOK** blocks mechanically · **CHECK** is a gate the run exe9. A defect recognized as an instance of a class did not close until one grep/glob enumerated every sibling, each fixed-and-verified or tombstoned: `🧹 CLASS-SWEEP: <class> — N siblings via <probe>; M fixed, K tombstoned`. *(CHECK)*-10. Every explicit ask in the principal's verbatim message was met, skipped with a stated reason, or surfaced; scope narrowed only where he ratified it; no claim passed because its wording was softened mid-run. One line appended to `MEMORY/OBSERVABILITY/ask-fidelity.jsonl`; any ✗ blocks complete. *(CHECK: last gate before learn)*+10. Every explicit ask in the principal's verbatim message was met, skipped with a stated reason, or surfaced; scope narrowed only where he ratified it; no claim passed because its wording was softened mid-run. A depth or steering directive ("think deeply", "go heavy", "quick pass") is an explicit ask under this claim. One line appended to `MEMORY/OBSERVABILITY/ask-fidelity.jsonl`; any ✗ blocks complete. *(CHECK: last gate before learn)*11. Validation was intrinsic to the system, not outsourced: every claim carried its falsifier and closed only on tool evidence of the right modality (rules 8–9), the verification gates enforced it, tests ran, class-sweep enumerated siblings, and the builder never rubber-stamped its own build. This holds on every run with zero external dependency. For high-blast-radius or high-impact work the Algorithm MAY additionally invoke a cross-vendor audit (Forge/Grok) — its own call scaled to impact, or because the principal asked for one — but correctness never depends on it, and a skipped audit is a choice, not a gap. The one visibility floor on that choice: for core-surface, auth/security, or publish-bound work, electing **zero** independent second look (no cross-vendor audit and no fresh-context skeptic pass) requires one Log row naming the skip and why — replay showed forced second-looks caught real defects five archived runs would otherwise have shipped, so the skip stays discretionary but never silent. Any review's contradictions were surfaced, never silently resolved — two re-calls, then escalate to the principal. Findings dispositioned in the Log: adopted (diff), rebutted (reason), or deferred (task). *(CHECK)*@@ -50,7 +50,7 @@ Teeth per claim: **HOOK** blocks mechanically · **CHECK** is a gate the run exe14. The ISA at close is not the ISA at open. On any run that surfaced new information — corrections, failed probes, discovered constraints, implied wants — it was folded in as it arrived: claims added, split, tightened, or killed. The final ISA is the shape of what done actually meant. *(SELF · falsifier: discoveries in-transcript with zero ISA deltas after scaffold)*-15. The spend matched the task: intelligence, verification depth, parallelism, time, and money scaled to the difficulty and blast radius the work revealed, aimed at euphoric surprise (right output, right time, right spend); the principal's explicit calls in plain language ("go heavy", "quick pass", a stated budget) outranked everything; breaks in either direction were surfaced, never silent. *(SELF + reflection `within_budget`)*+15. The spend matched the task: intelligence, verification depth, parallelism, time, and money scaled to the difficulty and blast radius the work revealed, aimed at euphoric surprise (right output, right time, right spend); the principal's explicit calls in plain language ("go heavy", "quick pass", a stated budget) outranked everything; breaks in either direction were surfaced, never silent. An explicit depth directive that produced neither visible capability use nor a stated reason for answering inline is such a break — surfaced, never silent. *(SELF + reflection `within_budget`)*## The ISA asks the questions@@ -58,11 +58,12 @@ The artifact's slots carry the standing questions: what did he say he wants (Goa## Events ask the rest-The live layer — nudges fired at the moment they're answerable, not standing prose. One runner, `hooks/AlgorithmNudge.hook.ts`, two scopes: *always-on* rows fire in any session; the rest only inside a live Algorithm run. Deterministic, zero inference; the routing rows match a prebuilt USE WHEN index, never a live skill scan.+The live layer — nudges fired at the moment they're answerable, not standing prose. One runner, `hooks/AlgorithmNudge.hook.ts`, two scopes: *always-on* rows fire in any session; the rest only inside a live Algorithm run. Deterministic, zero inference; the routing rows match a prebuilt USE WHEN index, never a live skill scan. Rows are bounded by construction: a row may only ask a question about an outcome already stated in this file — a row that maps surface phrases to mandated procedure, or whose pass condition is "a tool was invoked," is banned.| When | Ask ||---|---|| A prompt matches a skill's USE WHEN *(always-on)* | That capability exists — invoke the skill, don't handroll. |+| The principal directs depth in plain language, no run registered *(always-on)* | His call outranks your judgment: likely a run, not a chat turn — write done down and name what it earns, or state why inline is enough. || Deep into a session, no ISA registered *(always-on)* | Still trivial, or does done need writing down? || A probe or test fails | Claim wrong or code wrong? If the claim, update the ISA. || The principal messages mid-run | Does this revise the goal, kill a claim, or add one? |diff --git a/LifeOS/install/LIFEOS/DOCUMENTATION/ARCHITECTURE_SUMMARY.md b/LifeOS/install/LIFEOS/DOCUMENTATION/ARCHITECTURE_SUMMARY.mdindex 06652c41..74471ce6 100644--- a/LifeOS/install/LIFEOS/DOCUMENTATION/ARCHITECTURE_SUMMARY.md+++ b/LifeOS/install/LIFEOS/DOCUMENTATION/ARCHITECTURE_SUMMARY.md@@ -1,5 +1,5 @@----last_updated: 2026-07-12T05:14:21.392Z+last_updated: 2026-07-13T03:29:33.591Zlast_updated_by: ArchitectureSummaryGeneratorconvention: pai-freshness-v1derived_from: LIFEOS/DOCUMENTATION/LifeosSystemArchitecture.md@@ -15,7 +15,7 @@ generator: LIFEOS/TOOLS/ArchitectureSummaryGenerator.tsLifeOS — the **Life Operating System**, built on the LifeOS (LifeOS) layer — is the framework that knows your goals, people, and current state, and continuously hill-climbs you toward your ideal state.Everything below is the machinery of that one loop: Current State → Ideal State via verifiable iteration (ISC). Canonical thesis: `LIFEOS/DOCUMENTATION/LifeOs/LifeOsThesis.md`.-**Current versions:** LifeOS 7.0.0 | Algorithm v8.3.0 | System Prompt v3.0.1 | Memory v8.2.0+**Current versions:** LifeOS 7.1.1 | Algorithm v8.4.0 | System Prompt v3.0.1 | Memory v8.2.0Doc routing lives in CLAUDE.md; founding principles + full section map in the master doc.@@ -42,6 +42,6 @@ One line per pipeline. Full wiring, file inventories, and incident notes: master## Cross-References- Full architecture: `LIFEOS/DOCUMENTATION/LifeosSystemArchitecture.md`-- Algorithm spec: `LIFEOS/ALGORITHM/v8.3.0.md`+- Algorithm spec: `LIFEOS/ALGORITHM/v8.4.0.md`- ISA format: `LIFEOS/DOCUMENTATION/Isa/IsaFormat.md`- Config system: `LIFEOS/DOCUMENTATION/Config/ConfigSystem.md`diff --git a/LifeOS/install/LIFEOS/DOCUMENTATION/Agents/AgentSystem.md b/LifeOS/install/LIFEOS/DOCUMENTATION/Agents/AgentSystem.mdindex 11e0c68e..f58e6f5d 100755--- a/LifeOS/install/LIFEOS/DOCUMENTATION/Agents/AgentSystem.md+++ b/LifeOS/install/LIFEOS/DOCUMENTATION/Agents/AgentSystem.md@@ -1,3 +1,7 @@+---+version: 1.6.2+---+# LifeOS Agent System> Agents are how the LifeOS parallelizes the hill-climb. One DA fronts the system (thesis: `../LifeOs/LifeOsThesis.md`), but closing a current→ideal-state gap often takes many hands — research fanned out, code written, work audited cross-vendor. The routing rules below exist so that fan-out stays deterministic and the right kind of worker handles each leg of the climb.diff --git a/LifeOS/install/LIFEOS/DOCUMENTATION/Algorithm/AlgorithmSystem.md b/LifeOS/install/LIFEOS/DOCUMENTATION/Algorithm/AlgorithmSystem.mdindex 26674922..67e7646a 100644--- a/LifeOS/install/LIFEOS/DOCUMENTATION/Algorithm/AlgorithmSystem.md+++ b/LifeOS/install/LIFEOS/DOCUMENTATION/Algorithm/AlgorithmSystem.md@@ -23,7 +23,7 @@ The Algorithm adds four kinds of thing to native model execution. It never scrip|---|---|---|| **Context** | What the model can't know | Identity/TELOS/projects @-imports, LoadContext learning injection, memory hot-layer, AlgorithmNudge event nudges || **Artifacts** | What the model won't externalize | The ISA (`Isa/IsaFormat.md`), Decisions/Changelog trails, KNOWLEDGE, reflection records |-| **Teeth** | What the model won't hold itself to | The done-claims (`ALGORITHM/LATEST`, currently v8.1.0 — 15 teeth-annotated claims), VerificationGate + WritingGate teeth (both via `hooks/StopGates.hook.ts`; the telemetry-only OutputFormatGate was removed 2026-07-11 with the mode-banner strip), Forge + Grok cross-vendor review, keep-class doctrine (`RULES/Philosophy.md` § Ideal-State Prompting) |+| **Teeth** | What the model won't hold itself to | The done-claims (`ALGORITHM/LATEST`, currently v8.4.0 — 15 teeth-annotated claims), VerificationGate + WritingGate teeth (both via `hooks/StopGates.hook.ts`; the telemetry-only OutputFormatGate was removed 2026-07-11 with the mode-banner strip), Forge + Grok cross-vendor review, keep-class doctrine (`RULES/Philosophy.md` § Ideal-State Prompting) || **Instruments** | What makes the work observable | Pulse (phase telemetry, work.json, SSE), voice announcements, observability JSONL streams, execution logs |Spend follows the work, discovered from the task and its evidence gates — never predicted by a classifier or rubric (TheRouter and the effort tiers were retired 2026-07-11). The principal steers in plain language ("go heavy", "quick pass"), which outranks the model's judgment; a literal `/e1`–`/e5` in a prompt reads as "go heavier than default."@@ -40,7 +40,7 @@ Spend follows the work, discovered from the task and its evidence gates — neve| Pulse | The instruments | `DOCUMENTATION/Pulse/PulseSystem.md` || Memory/Learning | The loop's persistence: reflections, signals, curation | `DOCUMENTATION/Memory/MemorySystem.md` |-Mode selection (MINIMAL / NATIVE / ALGORITHM) is the model's judgment call per the system prompt's Mode Architecture — the trigger is whether the ideal state is pre-articulable, not complexity.+There are no modes. A one-line answer and a week-long build are the same loop at different depths (the MINIMAL / NATIVE / ALGORITHM modes were retired 2026-07-11 into one adaptive format). How much to spend is the model's judgment call, discovered from the work — the trigger is what "done" requires, not a complexity label.## Health doctrinediff --git a/LifeOS/install/LIFEOS/DOCUMENTATION/Arbol/ArbolSystem.md b/LifeOS/install/LIFEOS/DOCUMENTATION/Arbol/ArbolSystem.mdindex e82c87a3..3702d07d 100644--- a/LifeOS/install/LIFEOS/DOCUMENTATION/Arbol/ArbolSystem.md+++ b/LifeOS/install/LIFEOS/DOCUMENTATION/Arbol/ArbolSystem.md@@ -1,3 +1,7 @@+---+version: 1.5.11+---+> **LifeOS 6.0.0** --- This system is under active development. APIs, configuration formats, and features may change without notice.# Arbol Systemdiff --git a/LifeOS/install/LIFEOS/DOCUMENTATION/BrandAssets.md b/LifeOS/install/LIFEOS/DOCUMENTATION/BrandAssets.mdindex be0d40c2..d388cdc6 100644--- a/LifeOS/install/LIFEOS/DOCUMENTATION/BrandAssets.md+++ b/LifeOS/install/LIFEOS/DOCUMENTATION/BrandAssets.md@@ -1,3 +1,7 @@+---+version: 1.0.0+---+# LifeOS Brand AssetsCanonical logo naming for the whole LifeOS project. Use these names everywhere — docs, repos, site, release, design files.diff --git a/LifeOS/install/LIFEOS/DOCUMENTATION/Conduit/ConduitSystem.md b/LifeOS/install/LIFEOS/DOCUMENTATION/Conduit/ConduitSystem.mdindex e676156b..4a9982d0 100644--- a/LifeOS/install/LIFEOS/DOCUMENTATION/Conduit/ConduitSystem.md+++ b/LifeOS/install/LIFEOS/DOCUMENTATION/Conduit/ConduitSystem.md@@ -2,6 +2,7 @@last_updated: 2026-07-04T00:00:00Zlast_updated_by: kaiconvention: pai-freshness-v1+version: 1.2.0---# Conduit — LifeOS's Sensory Layerdiff --git a/LifeOS/install/LIFEOS/DOCUMENTATION/Config/ConfigSystem.md b/LifeOS/install/LIFEOS/DOCUMENTATION/Config/ConfigSystem.mdindex 725bf644..3f259cff 100644--- a/LifeOS/install/LIFEOS/DOCUMENTATION/Config/ConfigSystem.md+++ b/LifeOS/install/LIFEOS/DOCUMENTATION/Config/ConfigSystem.md@@ -1,3 +1,7 @@+---+version: 1.2.5+---+# LifeOS Configuration> The system/user split is the LifeOS boundary made physical (`LifeOs/LifeOsThesis.md`): the OS (system tree) is the same for everyone and ships publicly; the *life* (USER tree — identity, TELOS, current state) is yours alone. The merge machinery below is what lets one framework run any life without leaking any of them.diff --git a/LifeOS/install/LIFEOS/DOCUMENTATION/CoreComponents.md b/LifeOS/install/LIFEOS/DOCUMENTATION/CoreComponents.mdindex e00132e6..438de521 100644--- a/LifeOS/install/LIFEOS/DOCUMENTATION/CoreComponents.md+++ b/LifeOS/install/LIFEOS/DOCUMENTATION/CoreComponents.md@@ -4,6 +4,7 @@ last_updated_by: kailast_reviewed: 2026-07-05last_reviewed_by: kaiconvention: pai-freshness-v1+version: 1.0.4---# LifeOS Core Components@@ -46,7 +47,7 @@ Where you write down who you are and what you're trying to do: your mission, goa### 5. The Algorithm-The centerpiece. A seven-phase engine — Observe, Think, Plan, Build, Execute, Verify, Learn — that takes a vague request, turns it into a hard-to-vary spec, and climbs toward it with verified iteration. It scales its own effort to the work: a fast lane for simple asks, full depth for hard ones. This is where current-state-to-ideal-state actually happens.+The centerpiece. The unified thinking system that takes a vague request, turns it into a hard-to-vary spec (the ISA), and climbs toward it with verified iteration, closing each claim only on real evidence. It scales its own effort to the work — a fast lane for simple asks, full depth for hard ones — discovered from the task rather than a fixed set of phases. This is where current-state-to-ideal-state actually happens.→ `Algorithm/AlgorithmSystem.md`@@ -68,25 +69,19 @@ Deterministic lifecycle interception. Hooks run at fixed points across a session→ `Hooks/HookSystem.md`-### 9. The Router System--Every prompt gets classified and routed. The router decides how much effort a request deserves and which model should handle it, so a quick lookup stays cheap and fast while a hard design problem gets the full engine and the strongest model. You never pick a mode — it picks for you.--→ `Router/RouterSystem.md`--### 10. Pulse+### 9. PulseThe Life Dashboard — the live surface onto the whole system. Pulse shows your current-to-ideal progress, what the system is working on right now, your memory and freshness state, and the health of every subsystem. It's how you *see* LifeOS run.→ `Pulse/PulseSystem.md`-### 11. Custom Spinner Verbs+### 10. Custom Spinner VerbsThe small touch that makes the system feel alive. While LifeOS works, the statusline shows a custom animated working-verb — your own vocabulary, colors, and animation — alongside rotating tips about the system. A distinctive, personal detail most tools never bother with.→ `Spinner/SpinnerSystem.md`-### 12. Custom Tooltips+### 11. Custom TooltipsContext where you need it. The dashboard's tooltips and freshness indicators explain what each number, chart, and badge means the moment you hover — so the surface teaches itself instead of sending you to a manual.diff --git a/LifeOS/install/LIFEOS/DOCUMENTATION/Delegation/DelegationSystem.md b/LifeOS/install/LIFEOS/DOCUMENTATION/Delegation/DelegationSystem.mdindex cf2061e1..10a47967 100755--- a/LifeOS/install/LIFEOS/DOCUMENTATION/Delegation/DelegationSystem.md+++ b/LifeOS/install/LIFEOS/DOCUMENTATION/Delegation/DelegationSystem.md@@ -3,6 +3,7 @@ name: DelegationReferencedescription: Comprehensive delegation and agent parallelization patterns. Reference material extracted from SKILL.md for on-demand loading.created: 2025-12-17extracted_from: SKILL.md lines 535-627+version: 1.4.11---# Delegation & Parallelization Referencediff --git a/LifeOS/install/LIFEOS/DOCUMENTATION/Fabric/FabricSystem.md b/LifeOS/install/LIFEOS/DOCUMENTATION/Fabric/FabricSystem.mdindex 7548674f..088350a2 100755--- a/LifeOS/install/LIFEOS/DOCUMENTATION/Fabric/FabricSystem.md+++ b/LifeOS/install/LIFEOS/DOCUMENTATION/Fabric/FabricSystem.md@@ -3,6 +3,7 @@ name: FabricReferencedescription: Reference document for Fabric pattern system. For full functionality, use the Fabric skill directly.created: 2025-12-17updated: 2026-01-18+version: 1.1.6---# Fabric Pattern System Referencediff --git a/LifeOS/install/LIFEOS/DOCUMENTATION/Feed/FeedSystem.md b/LifeOS/install/LIFEOS/DOCUMENTATION/Feed/FeedSystem.mdindex 1257789d..8ac4f984 100644--- a/LifeOS/install/LIFEOS/DOCUMENTATION/Feed/FeedSystem.md+++ b/LifeOS/install/LIFEOS/DOCUMENTATION/Feed/FeedSystem.md@@ -1,3 +1,7 @@+---+version: 1.2.10+---+# The Feed System> **Private infrastructure — not included in the public LifeOS release.** This document describes a feed pipeline the maintainer runs privately on Arbol (also private). No Feed implementation ships with the OSS release; it's reference documentation for how the architecture works, and a blueprint if you want to build your own.diff --git a/LifeOS/install/LIFEOS/DOCUMENTATION/Freshness/FreshnessSystem.md b/LifeOS/install/LIFEOS/DOCUMENTATION/Freshness/FreshnessSystem.mdindex 9d131f37..ac68c7e1 100644--- a/LifeOS/install/LIFEOS/DOCUMENTATION/Freshness/FreshnessSystem.md+++ b/LifeOS/install/LIFEOS/DOCUMENTATION/Freshness/FreshnessSystem.md@@ -1,3 +1,7 @@+---+version: 1.2.3+---+# Freshness System> Freshness protects the loop's inputs. The LifeOS (`LifeOs/LifeOsThesis.md`) hill-climbs against its picture of your current state and your TELOS — if those files silently age, the OS optimizes toward a person who no longer exists. The convention below makes constitutional staleness visible before it becomes drift.diff --git a/LifeOS/install/LIFEOS/DOCUMENTATION/Hooks/HookSystem.md b/LifeOS/install/LIFEOS/DOCUMENTATION/Hooks/HookSystem.mdindex 449c15e6..c48b7dd4 100755--- a/LifeOS/install/LIFEOS/DOCUMENTATION/Hooks/HookSystem.md+++ b/LifeOS/install/LIFEOS/DOCUMENTATION/Hooks/HookSystem.md@@ -4,6 +4,7 @@ last_updated_by: kailast_reviewed: 2026-07-11last_reviewed_by: kaiconvention: pai-freshness-v1+version: 1.2.50---# Hook System@@ -177,6 +178,7 @@ Claude Code supports the following hook events:**AlgorithmNudge.hook.ts** — Algorithm live nudge layer ("Events ask the rest"; unified 2026-07-11, formerly IsaNudge)- TWO SCOPES. Always-on (any session): skill-routing on UserPromptSubmit (prompt matches a skill's USE WHEN → "invoke, don't handroll"; prebuilt index at `MEMORY/STATE/skill-usewhen-index.json`, detached rebuild, noise guards + per-skill 60-min cooldown) and late-ISA on PostToolUse (25+ tool calls, no registered run → "does done need writing down?", once per session)- Run-scoped (live Algorithm run only): principal-message (UserPromptSubmit), probe-fail (PostToolUseFailure, execute/verify phases), agent-return / claim-close / stale-ISA / spend (~75 in-run tool calls with claims open, 30-min cooldown; tier-free replacement for the retired budget-half nudge) on PostToolUse+- Always-on **capability row** (2026-07-12, #1461): on `PostToolUseFailure` for a Bash command that exercises a Doctor-tracked capability (codex / wrangler / notify-curl / interceptor) while `MEMORY/STATE/capabilities.json` has that capability `broken`, fires ONE line with a static fix command (per-capability 60-min cooldown). Reads only `state` from the manifest — the fix string is a compile-time `CAP_FIX` constant, never sourced from the on-disk manifest (Forge audit: keeps a poisoned manifest from injecting runnable prose into model context). `declined`/`live`/absent-manifest all stay silent.- Deterministic, zero inference, <20ms hot path; subagent tool events silenced via primary-transcript gate- Registered on UserPromptSubmit (user settings, async) + PostToolUseFailure (system settings); PostToolUse reaches it via `PostToolObserver`'s import. Not a successor to the retired `SkillSurface.hook.ts` every-prompt top-3 line — routing nudges fire only on USE WHEN phrase match, driven by the 2026-07-11 dynamic-range audit's under-use findingdiff --git a/LifeOS/install/LIFEOS/DOCUMENTATION/Isa/IsaFormat.md b/LifeOS/install/LIFEOS/DOCUMENTATION/Isa/IsaFormat.mdindex 40a11122..f358bb4a 100644--- a/LifeOS/install/LIFEOS/DOCUMENTATION/Isa/IsaFormat.md+++ b/LifeOS/install/LIFEOS/DOCUMENTATION/Isa/IsaFormat.md@@ -1,3 +1,7 @@+---+version: 1.5.19+---+# LifeOS ISA Format Specification v2.13.0 (Algorithm v6.25.0)> **v2.13.0 (Algorithm v6.25.0) — ISA scale + a real deletion.** The body grows from twelve sections to **fourteen**: `## Dependencies` (after Constraints) declares cross-ISA needs machine-readably; `## Bridge Criteria` (after Criteria) holds cross-ISA integration ISCs verified at VERIFY across the seam. New optional frontmatter `parent:` / `children:` links ISAs into a tree with **constraint inheritance** (a child cannot violate an ancestor Constraint). **The hard numeric ISC count floors (≥16/≥32/≥128/≥256) are DELETED** and replaced by the **Coverage Gate** — every subsystem named in Vision/Goal has a container ISC decomposed via the Splitting Test to single-probe leaves; coverage is the gate, count never is. Full doctrine in Algorithm v6.25.0 § *ISA Hierarchy & Cross-ISA Integration* and § *ISC Quality System*. The harness executor (`isa run`, reads `## Test Strategy`) is the paired build, tracked separately.diff --git a/LifeOS/install/LIFEOS/DOCUMENTATION/Isa/IsaHierarchy.md b/LifeOS/install/LIFEOS/DOCUMENTATION/Isa/IsaHierarchy.mdindex 3d7208df..70270695 100644--- a/LifeOS/install/LIFEOS/DOCUMENTATION/Isa/IsaHierarchy.md+++ b/LifeOS/install/LIFEOS/DOCUMENTATION/Isa/IsaHierarchy.md@@ -1,3 +1,7 @@+---+version: 1.0.0+---+# ISA Hierarchy & Cross-ISA Integration> On-demand reference. Single-ISA work is the leaf case and covers virtually all real tasks — 0 of 472 ISAs in the archive use `parent:`/`children:`/Bridge Criteria as of 2026-07-07. The hierarchy machinery below exists for genuinely large builds (a Tolkien-scale world, an enterprise product) and is loaded from here, not from the every-turn Algorithm doctrine. The Algorithm keeps a one-paragraph stub pointing here.diff --git a/LifeOS/install/LIFEOS/DOCUMENTATION/Isa/IsaHtmlMirror.md b/LifeOS/install/LIFEOS/DOCUMENTATION/Isa/IsaHtmlMirror.mdindex 54a7d773..f85e2a5f 100644--- a/LifeOS/install/LIFEOS/DOCUMENTATION/Isa/IsaHtmlMirror.md+++ b/LifeOS/install/LIFEOS/DOCUMENTATION/Isa/IsaHtmlMirror.md@@ -2,6 +2,7 @@last_updated: 2026-05-13T22:35:00Zlast_updated_by: kaiconvention: pai-freshness-v1+version: 1.0.15---# ISA HTML Mirror@@ -145,5 +146,5 @@ A future expansion allows per-ISA CSS overrides: drop a `<dir-of-ISA.md>/ISA.htm- `LIFEOS/DOCUMENTATION/Isa/IsaSystem.md` — twelve-section body, five identities, three-guardrail taxonomy- `LIFEOS/DOCUMENTATION/Isa/IsaFormat.md` — file-shape contract (frontmatter spec, locked section order)-- `LIFEOS/ALGORITHM/v8.3.0.md` — the algorithm that produces ISAs, phase progression source+- `LIFEOS/ALGORITHM/v8.4.0.md` — the algorithm that produces ISAs, phase progression source- `LIFEOS/MEMORY/WORK/20260512-isa-html-mirror-system/ISA.md` — the ISA that designed this systemdiff --git a/LifeOS/install/LIFEOS/DOCUMENTATION/Isa/IsaSystem.md b/LifeOS/install/LIFEOS/DOCUMENTATION/Isa/IsaSystem.mdindex acc399d3..e0d48d89 100644--- a/LifeOS/install/LIFEOS/DOCUMENTATION/Isa/IsaSystem.md+++ b/LifeOS/install/LIFEOS/DOCUMENTATION/Isa/IsaSystem.md@@ -1,3 +1,7 @@+---+version: 1.0.20+---+# ISA System> The ISA is the LifeOS loop (`LifeOs/LifeOsThesis.md`) applied to one thing at a time. TELOS articulates the ideal state of a *life*; an ISA articulates the ideal state of a *task, project, or artifact* — same primitive, smaller aperture. Every ISC is one verifiable step of the same hill-climb the OS runs globally.@@ -8,7 +12,7 @@ The companion documents:- **Format spec** — `LIFEOS/DOCUMENTATION/Isa/IsaFormat.md` — the file-shape contract: frontmatter fields, body section schemas, ID-stability rule, status markers.- **Skill** — `~/.claude/skills/ISA/SKILL.md` — the workflows that generate, refine, score, and merge ISAs (Scaffold, Interview, CheckCompleteness, Reconcile, Seed, Append).-- **Algorithm doctrine** — `LIFEOS/ALGORITHM/v8.3.0.md` (or LATEST) — the invocation cadence: when each workflow fires across the seven Algorithm phases.+- **Algorithm doctrine** — `LIFEOS/ALGORITHM/v8.4.0.md` (or LATEST) — the invocation cadence: when each workflow fires across the seven Algorithm phases.If this document and the format spec disagree, the format spec wins and this document updates to match.@@ -145,7 +149,7 @@ This rule exists because Reconcile is keyed on ISC IDs. If IDs renumber across eThe ISA is the artifact every other LifeOS subsystem orbits.-- **Algorithm** (`LIFEOS/DOCUMENTATION/Algorithm/AlgorithmSystem.md`, `LIFEOS/ALGORITHM/v8.3.0.md`) — invokes the ISA skill. OBSERVE invokes Scaffold; OBSERVE end + VERIFY invoke CheckCompleteness; PLAN may invoke ephemeral-extract; LEARN invokes Reconcile and Append. The Algorithm's seven phases are operational; the ISA is the durable artifact those phases write to.+- **Algorithm** (`LIFEOS/DOCUMENTATION/Algorithm/AlgorithmSystem.md`, `LIFEOS/ALGORITHM/v8.4.0.md`) — invokes the ISA skill. OBSERVE invokes Scaffold; OBSERVE end + VERIFY invoke CheckCompleteness; PLAN may invoke ephemeral-extract; LEARN invokes Reconcile and Append. The Algorithm's seven phases are operational; the ISA is the durable artifact those phases write to.- **Memory** (`LIFEOS/DOCUMENTATION/Memory/MemorySystem.md`) — task ISAs live under `MEMORY/WORK/{slug}/`. The Memory subsystem provides the directory structure and the WORK→LEARNING→KNOWLEDGE compaction lifecycle. Task ISAs are archived to KNOWLEDGE when their associated learnings have been harvested.- **Skills** (`LIFEOS/DOCUMENTATION/Skills/SkillSystem.md`) — the ISA skill is one skill among many; it follows the same canonical form (TitleCase directory for public, `_ALLCAPS` for private; `Workflows/` + optional `Tools/` + optional `Examples/`; mandatory voice-notification block; mandatory Gotchas section).- **Hooks** (`LIFEOS/DOCUMENTATION/Hooks/HookSystem.md`) — `ISASync.hook.ts` watches Edit/Write events on ISA frontmatter and syncs `phase` and `progress` to Pulse via `work.json`. `CheckpointPerISC.hook.ts` auto-commits per-ISC transitions. Hooks only read the ISA; the ISA is mutated by the AI directly via Edit/Write or via the ISA skill's workflows.@@ -161,7 +165,7 @@ The ISA is the gravitational center the rest of the system orbits — every task- **Format spec (file-shape contract):** `LIFEOS/DOCUMENTATION/Isa/IsaFormat.md`- **Skill (workflow implementations):** `~/.claude/skills/ISA/SKILL.md`- **Skill canonical example:** `~/.claude/skills/ISA/Examples/canonical-isa.md`-- **Algorithm doctrine:** `LIFEOS/ALGORITHM/v8.3.0.md` (current); `LIFEOS/ALGORITHM/LATEST` for version pointer+- **Algorithm doctrine:** `LIFEOS/ALGORITHM/v8.4.0.md` (current); `LIFEOS/ALGORITHM/LATEST` for version pointer- **Algorithm system doc:** `LIFEOS/DOCUMENTATION/Algorithm/AlgorithmSystem.md`- **Memory system doc:** `LIFEOS/DOCUMENTATION/Memory/MemorySystem.md`- **Skills system doc:** `LIFEOS/DOCUMENTATION/Skills/SkillSystem.md`diff --git a/LifeOS/install/LIFEOS/DOCUMENTATION/Ledger/LedgerSystem.md b/LifeOS/install/LIFEOS/DOCUMENTATION/Ledger/LedgerSystem.mddeleted file mode 100644index 95b22949..00000000--- a/LifeOS/install/LIFEOS/DOCUMENTATION/Ledger/LedgerSystem.md+++ /dev/null@@ -1,113 +0,0 @@-----last_updated: 2026-07-06-last_updated_by: kai-last_reviewed: 2026-07-06-last_reviewed_by: kai-convention: pai-freshness-v1-version: 1.0.0------# Ledger — the LifeOS Versioning System--> **Ledger is the subsystem that assigns the right version to every change and keeps every version number in LifeOS coherent.** It classifies each change as Major, Feature, or Patch, bumps the OS umbrella version and every touched component line, records the change in an append-only update registry, and syncs and tags the private repos. It is the versioning authority for the whole system.--LifeOS has always done this; it just never had a name or a version of its own — the same gap the Router had before it was named. The tools lived in `skills/_LIFEOS/Tools/` and `LIFEOS/TOOLS/`, the policy lived in scattered rules, and no single doc said "this is one subsystem." This doc names it **Ledger**, versions it (**1.0.0**), and draws the boundary around it.--The one-line test for what belongs to Ledger: **does it decide, record, or propagate a version?** If yes, it's Ledger.-------## The scheme — always three levels, Major.Feature.Patch--Every live version identifier in LifeOS is exactly three levels: **`Major.Feature.Patch`**. No two-level, no four. This binds the whole version surface — the OS version (`LIFEOS/VERSION`), the Algorithm (`LIFEOS/ALGORITHM/LATEST`), the ISA Format spec, Memory, every skill's `version:`, every hook's `@version`, and any new component line. The standing rule lives in `OPERATIONAL_RULES.md`; Ledger is what enforces it.--| Level | Meaning | Gate |-|-------|---------|------|-| **Major** | Breaking or structural change — a format-schema change, a removed contract, a restructured subsystem | Human conversation required before the bump |-| **Feature** | Additive capability — a new section, a new workflow, a new subsystem | One-line confirm at ship time |-| **Patch** | Fix, doc, or no-behavior-change edit | Auto-applies with a visible notice |--The middle number is **Feature**, not "minor" — the word is standardized everywhere it's written out. `ClassifyChange.ts` already emits `patch | feature | major`; Ledger just names the scheme around it.--**Scope:** the rule governs every *live* marker and all *new* bumps. Dated changelog entries that record a past state (a doc's "v7.4 — 2026-03-31" history line) stay as recorded — back-filling `.0` into a historical record is revisionism, not versioning.-------## Umbrella + component model--Two layers, both three-level:--- **The OS umbrella version** — `LIFEOS/VERSION` (today `6.1.2`). The single rolled-up number for the whole system. Every substantive change rolls up into it.-- **Component version lines** — independently versioned subsystems that move at their own pace and roll up into the umbrella: the **Algorithm** (`LATEST` → `v{X.Y.Z}.md`), the **system prompt** (`LIFEOS_SYSTEM_PROMPT.md` frontmatter `version:`), the **ISA Format** spec, **Memory**, each **skill** (`version:` field), each **hook** (`@version`). A component can bump on its own (the Algorithm going `6.24.0 → 6.25.0`) and that bump also rolls into the OS umbrella.--This is why a single skill edit both bumps that skill's `version:` and increments the OS version: the component line and the umbrella are different granularities of the same fact.-------## The components (the tools)--| Tool | Role |-|------|------|-| `skills/_LIFEOS/Tools/ClassifyChange.ts` | **Classify.** Reads the diff since the last tag, proposes a level (`patch \| feature \| major`). Major is always human-gated. |-| `skills/_LIFEOS/Tools/UpdateLifeosVersion.ts` | **Bump the umbrella.** Writes the new `LIFEOS/VERSION` at the classified level (single source of truth). |-| `skills/_LIFEOS/Tools/BumpAlgorithmVersion.ts` | **Bump the Algorithm** component line + `LATEST`. |-| `skills/_LIFEOS/Tools/BumpSystemPromptVersion.ts` | **Bump the system prompt's** frontmatter `version:` (default patch; `--sp-level` elevates; a single markdown doc can't be auto-classified, so the human sets feature/major). |-| `skills/_LIFEOS/Tools/BumpHookVersions.ts` | **Bump touched hooks'** `@version` (git-derived). |-| `skills/_LIFEOS/Tools/BumpSkillVersions.ts` | **Bump touched skills'** `version:` field, scoped per changed skill. |-| `skills/_LIFEOS/Tools/CreateUpdate.ts` | **Record.** Appends the classified change to the update registry with its version field. |-| `skills/_LIFEOS/Tools/UpdateKaiRepo.ts` | **Sync + tag.** Verified two-repo sync of the private system repo + the private user-data repo, with `--bump` running the component bumps and auto-tagging both. |-| `skills/_LIFEOS/Tools/SeedVersions.ts` · `SeedHookVersions.ts` | **Seed.** One-time stamping of version lines onto components that lacked them. |--Workflows that orchestrate them: `skills/_LIFEOS/Workflows/VersionBump.md` (`/vb`) and `UpdateLifeosVersion.md`. The `rc` shortcut cuts a release candidate (VersionBump then CreateShadowRelease).-------## The flow--```-change lands- → ClassifyChange.ts # diff → {patch | feature | major}- → (major? → human conversation before proceeding)- → UpdateLifeosVersion.ts # bump LIFEOS/VERSION at that level- → Bump{Algorithm,SystemPrompt,Hook,Skill}Versions.ts # roll the touched component lines- → CreateUpdate.ts # append to the update registry- → UpdateKaiRepo.ts --bump # sync + tag both private remotes-```--Component bumping now runs automatically inside `UpdateKaiRepo --bump` — it is no longer a separate prose step that could be skipped.-------## Operation vocabulary (never conflate these three)--Ledger governs the private-version side. Two later stages are release stages, deliberately separate and increasingly sensitive:--1. **UpdateKaiRepo** — private-repo sync + version-tag to the two private remotes (the system repo and the user-data repo). Everyday sensitivity. This is Ledger's terminal step.-2. **CreateShadowRelease** — "cut" a release: stage to the shadow-release directory only, run the release gates, no push. Moderate sensitivity.-3. **CreateRelease** — "publish" to the public LifeOS repo. Extremely sensitive, always a deliberate separate step requiring explicit go-ahead.--**"Cut" never means "publish." Private-sync ≠ cut ≠ publish.**-------## What Ledger is NOT--- **Not the release/publish system.** Ledger stamps and records versions and syncs the private repos. Pushing a public release is `CreateRelease`, a separate deliberate act.-- **Not the Router.** The Router decides how to handle a prompt; Ledger decides what version a change is.-- **Not a scheduler.** It doesn't time releases; it classifies and stamps the ones that happen.-------## Release role--Ledger ships with LifeOS as a documented subsystem. This doc lives under `LIFEOS/DOCUMENTATION/`, mirrored by the public-docs sync (with its scrub rules) and covered by the shadow-release gates — no new packaging machinery. It's listed in the routing table (`CLAUDE.md`), the master architecture doc, `ARCHITECTURE_SUMMARY.md`, and carries its own component version (`1.0.0`), exactly like every other subsystem.-------## Cross-references--- Standing rule (three-level, Major.Feature.Patch) — `LIFEOS/USER/CONFIG/OPERATIONAL_RULES.md` § Versioning-- Version-bump workflow — `skills/_LIFEOS/Workflows/VersionBump.md` (`/vb`)-- Per-skill versioning — `LIFEOS/DOCUMENTATION/Skills/SkillSystem.md`-- OS version source of truth — `LIFEOS/VERSION`-- Master architecture — `LIFEOS/DOCUMENTATION/LifeosSystemArchitecture.md`diff --git a/LifeOS/install/LIFEOS/DOCUMENTATION/LifeOs/LifeOsSchema.md b/LifeOS/install/LIFEOS/DOCUMENTATION/LifeOs/LifeOsSchema.mdindex 511255f6..0834aaf3 100644--- a/LifeOS/install/LIFEOS/DOCUMENTATION/LifeOs/LifeOsSchema.md+++ b/LifeOS/install/LIFEOS/DOCUMENTATION/LifeOs/LifeOsSchema.md@@ -1,3 +1,7 @@+---+version: 1.0.4+---+# Life OS Schema> **The canonical shape of the USER directory in LifeOS.**diff --git a/LifeOS/install/LIFEOS/DOCUMENTATION/LifeOs/LifeOsThesis.md b/LifeOS/install/LIFEOS/DOCUMENTATION/LifeOs/LifeOsThesis.mdindex 20af260a..e823414f 100644--- a/LifeOS/install/LIFEOS/DOCUMENTATION/LifeOs/LifeOsThesis.md+++ b/LifeOS/install/LIFEOS/DOCUMENTATION/LifeOs/LifeOsThesis.md@@ -4,6 +4,7 @@ last_updated_by: kailast_reviewed: 2026-07-02last_reviewed_by: kaiconvention: pai-freshness-v1+version: 1.0.6---# LifeOS — The Life Operating System Thesisdiff --git a/LifeOS/install/LIFEOS/DOCUMENTATION/LifeOs/RenamePlan.md b/LifeOS/install/LIFEOS/DOCUMENTATION/LifeOs/RenamePlan.mdindex 1ca097a5..50d7d96a 100644--- a/LifeOS/install/LIFEOS/DOCUMENTATION/LifeOs/RenamePlan.md+++ b/LifeOS/install/LIFEOS/DOCUMENTATION/LifeOs/RenamePlan.md@@ -2,6 +2,7 @@last_updated: 2026-06-13T01:30:00Zlast_updated_by: kaiconvention: pai-freshness-v1+version: 1.0.2---# RenamePlan — LifeOS → LifeOSdiff --git a/LifeOS/install/LIFEOS/DOCUMENTATION/LifeosSystemArchitecture.md b/LifeOS/install/LIFEOS/DOCUMENTATION/LifeosSystemArchitecture.mdindex cee1f211..18f206a9 100755--- a/LifeOS/install/LIFEOS/DOCUMENTATION/LifeosSystemArchitecture.md+++ b/LifeOS/install/LIFEOS/DOCUMENTATION/LifeosSystemArchitecture.md@@ -1,9 +1,10 @@----last_updated: 2026-07-11T00:00:00Z+last_updated: 2026-07-12T00:00:00Zlast_updated_by: kaiconvention: pai-freshness-v1last_reviewed: 2026-05-04T18:27:00.870Zlast_reviewed_by: {{PRINCIPAL_NAME}}+version: 1.9.48---# What LifeOS is and Why it Exists@@ -51,7 +52,7 @@ LifeOS targets **AS3** on the [LifeOS Maturity Model](https://example.com/blog/p**Canonical thesis:** `LIFEOS/DOCUMENTATION/LifeOs/LifeOsThesis.md` — read this first when any framing question comes up. This architecture doc describes *how* the OS is built; the thesis doc describes *what* the OS is for.-**Version:** LifeOS 7.0.0 | Algorithm v8.3.0 | Memory v8.2.0+**Version:** LifeOS 7.1.1 | Algorithm v8.4.0 | Memory v8.2.0---@@ -297,16 +298,22 @@ It used to turn a raw prompt into a posture: mode, effort tier, the stated goal,- **Location (surviving model routing):** `LIFEOS/TOOLS/models.ts`, `hooks/AgentInvocation.hook.ts`, `LIFEOS/TOOLS/Inference.ts`- **Full doc (history only):** `LIFEOS/DOCUMENTATION/Router/RouterSystem.md`-### Ledger — the Versioning System+### Versioning-**The versioning authority — assigns the right version to every change and keeps every version number in LifeOS coherent.**+**How every change gets the right version and every version number stays coherent.** This is a convention plus a set of tools, not a named subsystem — the "Ledger" name (assigned 2026-07-06) was retired 2026-07-12 and its standalone doc folded into this section, which is now the canonical reference.-Classifies each change as Major, Feature, or Patch (`Major.Feature.Patch`, always three levels), bumps the OS umbrella version (`LIFEOS/VERSION`) plus every touched component line (Algorithm, ISA Format, Memory, each skill's `version:`, each hook's `@version`), records it in the update registry, and syncs + tags the private repos. Named + versioned + documented 2026-07-06, closing the same "does the work, never had a name" gap the Router had. Terminal step is `UpdateKaiRepo` (private sync + tag); cutting and publishing releases are the separate, more sensitive `CreateShadowRelease` and `CreateRelease` stages.+Every live version identifier is exactly three levels, **`Major.Feature.Patch`** — the OS umbrella (`LIFEOS/VERSION`), the Algorithm, the system prompt, the ISA Format spec, Memory, every skill's `version:`, every hook's `@version`, and every living doc's `version:`. The middle number is **Feature**, not "minor." Gates: Major = human conversation before the bump; Feature = one-line confirm at ship time; Patch = auto-applies with a visible notice. Historical changelog entries stay as recorded — no back-filling. The standing rule lives in `OPERATIONAL_RULES.md` § Versioning.-- **Version:** 1.0.0-- **Status:** Active (named + documented 2026-07-06)-- **Location:** `skills/_LIFEOS/Tools/{ClassifyChange,UpdateLifeosVersion,BumpAlgorithmVersion,BumpSystemPromptVersion,BumpHookVersions,BumpSkillVersions,CreateUpdate,UpdateKaiRepo}.ts`, `skills/_LIFEOS/Workflows/VersionBump.md`, `LIFEOS/VERSION`-- **Full doc:** `LIFEOS/DOCUMENTATION/Ledger/LedgerSystem.md`+Two granularities of the same fact: the **OS umbrella** rolls up every substantive change, while **component lines** (Algorithm, system prompt, skills, hooks, docs, ISA Format, Memory) bump independently and roll into it — which is why a single skill edit bumps both the skill's `version:` and `LIFEOS/VERSION`.++**Living-doc versioning (added 2026-07-12)** — every living Markdown doc carries a frontmatter `version:`, spanning BOTH private repos. The single scope authority is `skills/_LIFEOS/Tools/DocVersionScope.ts`: system repo = `LIFEOS/DOCUMENTATION/**` + `LIFEOS/RULES/**`; user repo = all tracked `*.md`. Excluded: MEMORY/CACHE/Backups archives (back-stamping records is revisionism), generated derivatives (`generator:`/`derived_from:` — they inherit from their source), basename `CLAUDE.md` (the OS umbrella is its version), `CUSTOMIZATIONS/ARBOL/` (own repo), and everything already component-versioned. Baselines were seeded from real git lineage by `SeedDocVersions.ts` (creation → 1.0.0; non-migration commit → patch; commit adding a new `## ` section → feature; `git log --follow`, never combined with `--reverse` — they're silently incompatible). `BumpDocVersions.ts` applies the same new-H2-→-feature rubric deterministically at sync time (never auto-major), with a self-bump guard so a version-line-only diff never re-bumps; both the doc seeder and bumper run inside `UpdateKaiRepo --bump` exactly like skills and hooks.++The flow per change: `ClassifyChange.ts` (diff → `patch | feature | major`; major always human-gated) → `UpdateLifeosVersion.ts` (bump the umbrella) → `Bump{Algorithm,SystemPrompt,Hook,Skill,Doc}Versions.ts` (roll the touched component lines — runs automatically inside `UpdateKaiRepo --bump`) → `CreateUpdate.ts` (append to the update registry) → `UpdateKaiRepo.ts --bump` (verified two-repo private sync + tag). Orchestrated by `skills/_LIFEOS/Workflows/VersionBump.md` (`/vb`); `rc` cuts a release candidate.++Operation vocabulary, never conflated: **UpdateKaiRepo** = private sync + tag (versioning's terminal step, everyday sensitivity) · **CreateShadowRelease** = "cut" (stage + gates, no push) · **CreateRelease** = "publish" to the public repo (extremely sensitive, explicit go-ahead). "Cut" never means "publish"; private-sync ≠ cut ≠ publish.++- **Status:** Active convention (subsystem name "Ledger" retired 2026-07-12; this section is the canonical doc)+- **Location:** `skills/_LIFEOS/Tools/{ClassifyChange,UpdateLifeosVersion,BumpAlgorithmVersion,BumpSystemPromptVersion,BumpHookVersions,BumpSkillVersions,DocVersionScope,SeedDocVersions,BumpDocVersions,CreateUpdate,UpdateKaiRepo}.ts`, `skills/_LIFEOS/Workflows/VersionBump.md`, `LIFEOS/VERSION`### Skill System@@ -578,7 +585,7 @@ System file inventory by pipeline. When you modify a file, trace its pipeline to| Pipeline | Key Files ||----------|-----------|| **Security** | `LIFEOS/LIFEOS_SYSTEM_PROMPT.md` § Security Protocol (constitutional rule), `settings.json` `permissions.deny` (native harness denylist), `hooks/Safety.hook.ts` (consolidated PermissionRequest + PostToolUse on WebFetch \| WebSearch), `hooks/lib/safety-classifier.ts` (shape catalog + shell-aware classifier with single-quote pre-pass) |-| **Algorithm** | `Algorithm/LATEST` → `Algorithm/v{VERSION}.md` (currently v8.3.0 — the claims restructure: Loop preamble + 15 teeth-annotated done-claims + AlgorithmNudge event layer (unified 2026-07-11: run-scoped + always-on skill-routing/late-ISA/spend); capabilities.md removed at v7, the system-prompt skill list is the sole capability inventory), `Algorithm/mode-detection.md`, `hooks/ISASync.hook.ts` → `MEMORY/WORK/{slug}/ISA.md`, `skills/ISA/` (canonical Scaffold/Append/Reconcile workflows); **work registry event-sourced (2026-06-10):** all `work.json` writes go through `isa-utils.writeRegistry` → field-level diff events appended to `MEMORY/STATE/work-events.jsonl` (`hooks/lib/work-events.ts`) → locked fold to the derived `work.json` snapshot (offset-stamped, 1MB compaction); `readRegistry` serves snapshot+suffix live views; Pulse SSE triggers off `fs.watch` on STATE with the 100ms poll as fallback; model choice is per-dispatch judgment (2026-07-11 baseline); `EFFORT_MODEL` in `LIFEOS/TOOLS/models.ts` remains the `Inference.ts --level` dial |+| **Algorithm** | `Algorithm/LATEST` → `Algorithm/v{VERSION}.md` (currently v8.4.0 — the claims restructure: Loop preamble + 15 teeth-annotated done-claims + AlgorithmNudge event layer (unified 2026-07-11: run-scoped + always-on skill-routing/late-ISA/spend; depth-directive row added v8.4.0, 2026-07-12); capabilities.md removed at v7, the system-prompt skill list is the sole capability inventory), `Algorithm/mode-detection.md`, `hooks/ISASync.hook.ts` → `MEMORY/WORK/{slug}/ISA.md`, `skills/ISA/` (canonical Scaffold/Append/Reconcile workflows); **work registry event-sourced (2026-06-10):** all `work.json` writes go through `isa-utils.writeRegistry` → field-level diff events appended to `MEMORY/STATE/work-events.jsonl` (`hooks/lib/work-events.ts`) → locked fold to the derived `work.json` snapshot (offset-stamped, 1MB compaction); `readRegistry` serves snapshot+suffix live views; Pulse SSE triggers off `fs.watch` on STATE with the 100ms poll as fallback; model choice is per-dispatch judgment (2026-07-11 baseline); `EFFORT_MODEL` in `LIFEOS/TOOLS/models.ts` remains the `Inference.ts --level` dial || **Memory** | `hooks/WorkCompletionLearning.hook.ts`, `hooks/SatisfactionCapture.hook.ts` (RelationshipMemory hook deleted 7.0.0 — dead code), `Tools/KnowledgeHarvester.ts` → `MEMORY/KNOWLEDGE/`, `MEMORY/LEARNING/`; `Tools/SessionHarvester.ts --mine` → `KNOWLEDGE/_harvest-queue/`; `Tools/MemoryRetriever.ts` (BM25 retrieval over typed-item corpus including `_MEMORY.md` hot-layer files), `Tools/KnowledgeGraph.ts` (graph navigation) — read-only. **Autonomic loop (2026-05):** `hooks/MemoryTurnStart.hook.ts` (UserPromptSubmit) + `hooks/MemoryReviewFire.hook.ts` (Stop; cadence merged 2026-07-11) drive `Tools/MemoryReviewer.ts` on cadence (turn≥8 ∧ minutes≥30 ∧ idle≥2). Reviewer emits typed items routed by `Tools/MemorySystem.ts` (single `add(item)` API) over the `Tools/MemoryTypes.ts` registry; `Tools/MutationTier.ts` gates by tier A/B/C/D. Tier-C proposals enqueue to `MEMORY/OBSERVABILITY/pending-proposals.jsonl`; `PULSE/lib/telegram-proposals.ts` + `PULSE/modules/telegram.ts` surface them as `yes/no/edit #id` Telegram replies. `Tools/MemoryStatus.ts` is the read-only `kai status` CLI. **kb-v3 knowledge schema (2026-07-05):** `Tools/KnowledgeSchema.ts` is the pure-data SoT for the KNOWLEDGE archive object-schema (`person\|company\|idea\|blog\|research` — distinct from the write-registry above) + body-safe parse/normalize/validate; `Tools/KnowledgeLint.ts` validates conformance (envelope % vs per-type completeness); `Tools/MigrateKnowledge.ts` migrated ~4,400 notes onto it (body-byte-preserving, idempotent, dry-run default); `Tools/KnowledgeQuery.ts` (`kb query`) filters/sorts on the now-consistent typed fields; `Tools/GenerateKnowledgeSchemaDoc.ts` regenerates `MEMORY/KNOWLEDGE/_schema.md` from the schema; `MemorySystem.renderInitialNote` emits the kb-v3 envelope so new autonomic notes are born conformant. || **Router** (RETIRED 2026-07-11) | Classify → route-effort stages retired 2026-07-11 with the mode/tier abolition (`TheRouter.hook.ts` deleted; MINIMAL/NATIVE/ALGORITHM + E1–E5 gone, no successor classifier). **Surviving model routing:** `LIFEOS/TOOLS/models.ts` `EFFORT_MODEL` maps level→model (max→fable / high→opus / medium→sonnet / low→haiku; `LEVEL_TO_HARNESS_EFFORT`; cross-vendor pins; egress-class ceilings) → **dispatch** via `model` param on `Agent()` / `Workflow agent()`, injected by `hooks/AgentInvocation.hook.ts` on unspecified dispatches. `LIFEOS/TOOLS/Inference.ts` applies model selection to utility inference, and is the genuine `max`/Fable carrier (subprocess spawns `claude --model claude-fable-5`; Agent `model:fable` dispatch downgrades to Opus). It verifies the executed model against the JSON envelope's `modelUsage` and logs downgrades to `MEMORY/OBSERVABILITY/model-verification.jsonl` (v6.29.0 — reports what RAN, not what was requested). Full doc (history only): `LIFEOS/DOCUMENTATION/Router/RouterSystem.md` || **Hooks** | `hooks/*.hook.ts`, `hooks/handlers/*.ts`, `hooks/lib/*.ts`, `settings.json` |diff --git a/LifeOS/install/LIFEOS/DOCUMENTATION/Memory/CurationCoverage.md b/LifeOS/install/LIFEOS/DOCUMENTATION/Memory/CurationCoverage.mdindex 21f37e06..9789f7e3 100644--- a/LifeOS/install/LIFEOS/DOCUMENTATION/Memory/CurationCoverage.md+++ b/LifeOS/install/LIFEOS/DOCUMENTATION/Memory/CurationCoverage.md@@ -4,6 +4,7 @@ last_updated_by: kaiconvention: pai-freshness-v1last_reviewed: 2026-05-25T18:45:00Zlast_reviewed_by: {{PRINCIPAL_NAME}}+version: 1.0.3---# Curation Coverage — what LifeOS autonomic systems touchdiff --git a/LifeOS/install/LIFEOS/DOCUMENTATION/Memory/MemorySystem.md b/LifeOS/install/LIFEOS/DOCUMENTATION/Memory/MemorySystem.mdindex 72c408ee..246da2bd 100755--- a/LifeOS/install/LIFEOS/DOCUMENTATION/Memory/MemorySystem.md+++ b/LifeOS/install/LIFEOS/DOCUMENTATION/Memory/MemorySystem.md@@ -1,3 +1,7 @@+---+version: 1.5.19+---+# Memory System> In Life OS terms (`LIFEOS/DOCUMENTATION/LifeOs/LifeOsThesis.md`), memory is how the OS knows your **current state**. The hill-climb is only as good as the system's picture of where you actually are — what you're working on, what failed, who you know, what you learned. Every capture pipeline below exists to sharpen that picture so the gap to ideal state is measured against reality, not guesses.diff --git a/LifeOS/install/LIFEOS/DOCUMENTATION/Notifications/NotificationSystem.md b/LifeOS/install/LIFEOS/DOCUMENTATION/Notifications/NotificationSystem.mdindex a9c942c5..19b72238 100755--- a/LifeOS/install/LIFEOS/DOCUMENTATION/Notifications/NotificationSystem.md+++ b/LifeOS/install/LIFEOS/DOCUMENTATION/Notifications/NotificationSystem.md@@ -1,3 +1,7 @@+---+version: 1.2.14+---+# The Notification System> Voice is the Life OS speaking. Notifications close the loop's feedback edge: when the system advances the hill-climb (`LIFEOS/DOCUMENTATION/LifeOs/LifeOsThesis.md`), the principal hears it without having to look.@@ -114,7 +118,7 @@ curl -s -X POST http://localhost:31337/notify \| Agent | Voice ID | Notes ||-------|----------|-------|| **{DA_IDENTITY.NAME}** (default) | `{DA_IDENTITY.VOICEID}` | Use for most workflows |-| **Priya** (Artist) | `ZF6FPAbjXT4488VcRRnw` | Art skill workflows |+| **Priya** (Artist) | `21m00Tcm4TlvDq8ikWAM` | Art skill workflows |**Full voice registry:** `LIFEOS/DOCUMENTATION/Agents/AgentSystem.md` (see Named Agents) and `~/.claude/settings.json` (daidentity.voices.main.voiceId)diff --git a/LifeOS/install/LIFEOS/DOCUMENTATION/Observability/ObservabilitySystem.md b/LifeOS/install/LIFEOS/DOCUMENTATION/Observability/ObservabilitySystem.mdindex 190a7235..43596f9f 100644--- a/LifeOS/install/LIFEOS/DOCUMENTATION/Observability/ObservabilitySystem.md+++ b/LifeOS/install/LIFEOS/DOCUMENTATION/Observability/ObservabilitySystem.md@@ -1,3 +1,7 @@+---+version: 1.5.7+---+# The Observability System> You can't steer a Life OS you can't see (`LIFEOS/DOCUMENTATION/LifeOs/LifeOsThesis.md`). Observability is the raw sensory feed behind the Life Dashboard — every tool call, agent, and failure as inspectable events, so both the principal and the DA can verify the hill-climb is actually climbing.@@ -221,7 +225,7 @@ All endpoints served by the Pulse daemon's observability module (`Observability/## Session State Tracking-Distinct from the event pipeline above, session state (active sessions, phase, progress, criteria, ratings) flows through a single canonical file. Both the Pulse dashboard and the ULAdmin `/agents` page read the same file so they never drift.+Distinct from the event pipeline above, session state (active sessions, phase, progress, criteria, ratings) flows through a single canonical file. Both the Pulse dashboard and any external admin dashboard's agents page read the same file so they never drift.**Canonical source:** `$LIFEOS_DIR/MEMORY/STATE/work.json`@@ -234,7 +238,7 @@ Writers (atomic read-modify-write via isa-utils.ts:writeRegistry)Readers (both use identical mapping)├─ Pulse Observability localhost:31337 → observability.ts handleAlgorithmApi-└─ ULAdmin daemon localhost:4000 → server/src/algorithm-watcher.ts+└─ external admin daemon localhost:4000 → server/src/algorithm-watcher.ts```**Display lanes:**diff --git a/LifeOS/install/LIFEOS/DOCUMENTATION/Pulse/DaSubsystem.md b/LifeOS/install/LIFEOS/DOCUMENTATION/Pulse/DaSubsystem.mdindex a31b53e2..fb0c6fe2 100644--- a/LifeOS/install/LIFEOS/DOCUMENTATION/Pulse/DaSubsystem.md+++ b/LifeOS/install/LIFEOS/DOCUMENTATION/Pulse/DaSubsystem.md@@ -1,3 +1,7 @@+---+version: 1.0.10+---+# LifeOS Digital Assistant Subsystem> The DA is layer one of the Life OS (`LIFEOS/DOCUMENTATION/LifeOs/LifeOsThesis.md`): the interface the principal actually talks to. This subsystem is what makes that layer real rather than a markdown file — identity that persists, a heartbeat that asks "should I do something to close the gap?", and growth that compounds. Everything below serves the thesis claim that the DA is the primary (eventually only) interface to the OS.diff --git a/LifeOS/install/LIFEOS/DOCUMENTATION/Pulse/PulseMetadata.md b/LifeOS/install/LIFEOS/DOCUMENTATION/Pulse/PulseMetadata.mdindex 4135bea5..9c3bd7d5 100644--- a/LifeOS/install/LIFEOS/DOCUMENTATION/Pulse/PulseMetadata.md+++ b/LifeOS/install/LIFEOS/DOCUMENTATION/Pulse/PulseMetadata.md@@ -2,6 +2,7 @@last_updated: 2026-07-11last_updated_by: kaiconvention: pai-freshness-v1+version: 1.0.22---# Pulse Metadata Surface — Badges, Strips, Panels@@ -144,4 +145,4 @@ Multi-line expandable detail views shown on session click.- Pulse System overview: `LIFEOS/DOCUMENTATION/Pulse/PulseSystem.md`- DA subsystem (design): `LIFEOS/DOCUMENTATION/Pulse/DaSubsystem.md`- Terminal tabs (kitty integration): `LIFEOS/DOCUMENTATION/Pulse/TerminalTabs.md`-- Current Algorithm doctrine: `LIFEOS/ALGORITHM/v8.3.0.md`+- Current Algorithm doctrine: `LIFEOS/ALGORITHM/v8.4.0.md`diff --git a/LifeOS/install/LIFEOS/DOCUMENTATION/Pulse/PulseSystem.md b/LifeOS/install/LIFEOS/DOCUMENTATION/Pulse/PulseSystem.mdindex 66b5880d..4eb6ea7b 100644--- a/LifeOS/install/LIFEOS/DOCUMENTATION/Pulse/PulseSystem.md+++ b/LifeOS/install/LIFEOS/DOCUMENTATION/Pulse/PulseSystem.md@@ -4,6 +4,7 @@ last_updated_by: kailast_reviewed: 2026-07-02last_reviewed_by: kaiconvention: pai-freshness-v1+version: 1.6.17---# The Pulse System@@ -36,6 +37,7 @@ Each subsystem runs in its own crash-isolated loop within the single Pulse proce| **Worker** | GitHub Issues work polling for LifeOS Workers (optional) | `checks/github-work.ts` || **Assistant** | Digital Assistant identity, heartbeat, scheduling, growth | `Assistant/module.ts` || **UserIndex** | LifeOS USER/ indexer — parses frontmatter + collections into typed JSON; fs.watch live refresh; powers `/life` dashboard + Daemon publish feed | `modules/user-index.ts` |+| **Doctor** | Read-only System Health surface (2026-07-12, #1461). Serves `GET /api/doctor` → `{ manifest, heartbeat, reconcile }` from the advisory caches written by `LIFEOS/TOOLS/Doctor.ts`; shells `Doctor.ts --reconcile` (30s cache). Holds zero truth of its own. Rendered by `SystemHealthPanel.tsx` on the **System → Hooks** page: capability states + fix commands, doctor heartbeat age (red past 7 days — a dead checker must be loud), and hook reconciliation. Diagnostic register, no scores. | `modules/doctor.ts` |---diff --git a/LifeOS/install/LIFEOS/DOCUMENTATION/Pulse/TerminalTabs.md b/LifeOS/install/LIFEOS/DOCUMENTATION/Pulse/TerminalTabs.mdindex b5b529c9..65e9b59d 100755--- a/LifeOS/install/LIFEOS/DOCUMENTATION/Pulse/TerminalTabs.md+++ b/LifeOS/install/LIFEOS/DOCUMENTATION/Pulse/TerminalTabs.md@@ -1,3 +1,7 @@+---+version: 1.3.1+---+# Terminal Tab State System## Overviewdiff --git a/LifeOS/install/LIFEOS/DOCUMENTATION/Pulse/Tooltips.md b/LifeOS/install/LIFEOS/DOCUMENTATION/Pulse/Tooltips.mdindex 4c27c324..891d6040 100644--- a/LifeOS/install/LIFEOS/DOCUMENTATION/Pulse/Tooltips.md+++ b/LifeOS/install/LIFEOS/DOCUMENTATION/Pulse/Tooltips.md@@ -4,6 +4,7 @@ last_updated_by: kailast_reviewed: 2026-07-02last_reviewed_by: kaiconvention: pai-freshness-v1+version: 1.0.1---# Custom Tooltipsdiff --git a/LifeOS/install/LIFEOS/DOCUMENTATION/Router/RouterSystem.md b/LifeOS/install/LIFEOS/DOCUMENTATION/Router/RouterSystem.mdindex a9a05b39..b7913483 100644--- a/LifeOS/install/LIFEOS/DOCUMENTATION/Router/RouterSystem.md+++ b/LifeOS/install/LIFEOS/DOCUMENTATION/Router/RouterSystem.md@@ -4,6 +4,7 @@ last_updated_by: kailast_reviewed: 2026-07-02last_reviewed_by: kaiconvention: pai-freshness-v1+version: 1.0.11---> **RETIRED 2026-07-11 (hooks + thinking-system BPE pass).** TheRouter hook, the mode/tierdiff --git a/LifeOS/install/LIFEOS/DOCUMENTATION/Security/DataClassification.md b/LifeOS/install/LIFEOS/DOCUMENTATION/Security/DataClassification.mdindex c9b95f28..a35b1370 100644--- a/LifeOS/install/LIFEOS/DOCUMENTATION/Security/DataClassification.md+++ b/LifeOS/install/LIFEOS/DOCUMENTATION/Security/DataClassification.md@@ -2,6 +2,7 @@last_updated: 2026-06-18T00:00:00Zlast_updated_by: kaiconvention: pai-freshness-v1+version: 1.0.7---# LifeOS Data Classification & Inference-Source Routingdiff --git a/LifeOS/install/LIFEOS/DOCUMENTATION/Security/NpmRapidResponse.md b/LifeOS/install/LIFEOS/DOCUMENTATION/Security/NpmRapidResponse.mdindex 674ff081..95295928 100644--- a/LifeOS/install/LIFEOS/DOCUMENTATION/Security/NpmRapidResponse.md+++ b/LifeOS/install/LIFEOS/DOCUMENTATION/Security/NpmRapidResponse.md@@ -4,6 +4,7 @@ last_updated_by: kaiconvention: pai-freshness-v1last_reviewed: 2026-05-20T20:50:00Zlast_reviewed_by: kai+version: 1.0.2---# npm Supply-Chain Rapid Responsediff --git a/LifeOS/install/LIFEOS/DOCUMENTATION/Security/README.md b/LifeOS/install/LIFEOS/DOCUMENTATION/Security/README.mdindex 607dd099..80b758bb 100644--- a/LifeOS/install/LIFEOS/DOCUMENTATION/Security/README.md+++ b/LifeOS/install/LIFEOS/DOCUMENTATION/Security/README.md@@ -1,3 +1,7 @@+---+version: 1.7.4+---+# LifeOS Security — Minimal v2> A Life OS holds a life — goals, health, finances, relationships, credentials (`LIFEOS/DOCUMENTATION/LifeOs/LifeOsThesis.md`). The security model below exists because an OS trusted to run your life must be harder to subvert than the chatbots it replaces: external content is data, dangerous shapes get gated, and the boundary holds even when the principal isn't watching.@@ -100,7 +104,7 @@ The ten release-flavored workflows under `skills/_LIFEOS/Workflows/` (`CreateShaAdding a pattern: append the regex line under the right section in `DENY_LIST.txt`. The next precheck run picks it up; the next `ShadowRelease.ts` build picks it up at startup. No code to edit.-Hard exclusions (kept OUT of the deny-list, intentionally): `github.com/danielmiessler/LifeOS` (legitimate public clone URL), `fTtv3eikoepIosk8dTZ5` (Algorithm voice, intentionally shipped).+Hard exclusions (kept OUT of the deny-list, intentionally): the public repo clone URL, `github.com/<repo-owner>/LifeOS` (legitimate attribution), `fTtv3eikoepIosk8dTZ5` (Algorithm voice, intentionally shipped).## What's NOT Here (and why)diff --git a/LifeOS/install/LIFEOS/DOCUMENTATION/Skills/SkillSystem.md b/LifeOS/install/LIFEOS/DOCUMENTATION/Skills/SkillSystem.mdindex 55c8c309..bbc70803 100755--- a/LifeOS/install/LIFEOS/DOCUMENTATION/Skills/SkillSystem.md+++ b/LifeOS/install/LIFEOS/DOCUMENTATION/Skills/SkillSystem.md@@ -4,6 +4,7 @@ last_updated_by: kailast_reviewed: 2026-07-02last_reviewed_by: kaiconvention: pai-freshness-v1+version: 1.5.1---# Custom Skill Systemdiff --git a/LifeOS/install/LIFEOS/DOCUMENTATION/Spinner/SpinnerSystem.md b/LifeOS/install/LIFEOS/DOCUMENTATION/Spinner/SpinnerSystem.mdindex 0227f226..06fa49b2 100644--- a/LifeOS/install/LIFEOS/DOCUMENTATION/Spinner/SpinnerSystem.md+++ b/LifeOS/install/LIFEOS/DOCUMENTATION/Spinner/SpinnerSystem.md@@ -4,6 +4,7 @@ last_updated_by: kailast_reviewed: 2026-07-02last_reviewed_by: kaiconvention: pai-freshness-v1+version: 1.0.1---# Custom Spinner Verbsdiff --git a/LifeOS/install/LIFEOS/DOCUMENTATION/SystemUserBoundary.md b/LifeOS/install/LIFEOS/DOCUMENTATION/SystemUserBoundary.mdindex 60e2c163..7dc115f1 100644--- a/LifeOS/install/LIFEOS/DOCUMENTATION/SystemUserBoundary.md+++ b/LifeOS/install/LIFEOS/DOCUMENTATION/SystemUserBoundary.md@@ -3,6 +3,7 @@ last_updated: 2026-06-13T00:00:00Zlast_updated_by: LifeOS docs reframe wave (refs re-verified against live tree)convention: pai-freshness-v1applies_to: LifeOS v6.0.0+ (proposed)+version: 1.1.4---# System / User Boundarydiff --git a/LifeOS/install/LIFEOS/DOCUMENTATION/Testing/TestingDoctrine.md b/LifeOS/install/LIFEOS/DOCUMENTATION/Testing/TestingDoctrine.mdindex fab26572..358f76e5 100644--- a/LifeOS/install/LIFEOS/DOCUMENTATION/Testing/TestingDoctrine.md+++ b/LifeOS/install/LIFEOS/DOCUMENTATION/Testing/TestingDoctrine.md@@ -4,6 +4,7 @@ last_updated_by: kaiconvention: pai-freshness-v1last_reviewed: 2026-05-08T01:30:00.000Zlast_reviewed_by: <principal>+version: 1.0.24---# LifeOS Testing Doctrine@@ -324,7 +325,7 @@ Phases 2–5 are tracked separately as PROJECTS.md entries; they're not part of## Cross-references-- Algorithm doctrine on ISA-as-test-harness: `~/.claude/LIFEOS/ALGORITHM/v8.3.0.md` § Doctrine (line 17)+- Algorithm doctrine on ISA-as-test-harness: `~/.claude/LIFEOS/ALGORITHM/v8.4.0.md` § Doctrine (line 17)- ISA format spec: `~/.claude/LIFEOS/DOCUMENTATION/Isa/IsaFormat.md`- Bun test docs: <https://bun.sh/docs/cli/test>, <https://bun.sh/docs/test/writing>, <https://bun.sh/docs/test/lifecycle>, <https://bun.sh/docs/test/snapshots>, <https://bun.sh/docs/test/coverage>, <https://bun.sh/docs/test/mocks>- Bun's own test doctrine: <https://github.com/oven-sh/bun/blob/main/test/CLAUDE.md>diff --git a/LifeOS/install/LIFEOS/DOCUMENTATION/Tools/Cli.md b/LifeOS/install/LIFEOS/DOCUMENTATION/Tools/Cli.mdindex f0239900..f1f9b457 100644--- a/LifeOS/install/LIFEOS/DOCUMENTATION/Tools/Cli.md+++ b/LifeOS/install/LIFEOS/DOCUMENTATION/Tools/Cli.md@@ -1,3 +1,7 @@+---+version: 1.1.10+---+> **LifeOS 6.0.0** — This system is under active development. APIs, configuration formats, and features may change without notice.# LifeOS Command-Line Toolsdiff --git a/LifeOS/install/LIFEOS/DOCUMENTATION/Tools/CliFirstArchitecture.md b/LifeOS/install/LIFEOS/DOCUMENTATION/Tools/CliFirstArchitecture.mdindex 94876deb..4942ab8c 100755--- a/LifeOS/install/LIFEOS/DOCUMENTATION/Tools/CliFirstArchitecture.md+++ b/LifeOS/install/LIFEOS/DOCUMENTATION/Tools/CliFirstArchitecture.md@@ -1,3 +1,7 @@+---+version: 1.1.3+---+# CLI-First Architecture Pattern> CLI-first is how the Life OS stays deterministic (`LIFEOS/DOCUMENTATION/LifeOs/LifeOsThesis.md`): the hill-climb's moves are code you can script, test, and trust — prompts orchestrate, code executes.diff --git a/LifeOS/install/LIFEOS/DOCUMENTATION/Tools/Containment.md b/LifeOS/install/LIFEOS/DOCUMENTATION/Tools/Containment.mdindex 34802fa8..8d983c20 100644--- a/LifeOS/install/LIFEOS/DOCUMENTATION/Tools/Containment.md+++ b/LifeOS/install/LIFEOS/DOCUMENTATION/Tools/Containment.md@@ -1,3 +1,7 @@+---+version: 1.1.9+---+# LifeOS Containment Policy> Containment zones draw the Life OS boundary at release time (`LIFEOS/DOCUMENTATION/LifeOs/LifeOsThesis.md`): the OS ships; the life never does.diff --git a/LifeOS/install/LIFEOS/DOCUMENTATION/Tools/Tools.md b/LifeOS/install/LIFEOS/DOCUMENTATION/Tools/Tools.mdindex ab7069e8..3e33ad62 100755--- a/LifeOS/install/LIFEOS/DOCUMENTATION/Tools/Tools.md+++ b/LifeOS/install/LIFEOS/DOCUMENTATION/Tools/Tools.md@@ -1,3 +1,7 @@+---+version: 1.8.0+---+# LifeOS Tools - CLI Utilities Reference> CLI-first is how the Life OS stays deterministic (`LIFEOS/DOCUMENTATION/LifeOs/LifeOsThesis.md`): the hill-climb's moves are code you can script, test, and trust — prompts orchestrate, code executes.@@ -797,6 +801,39 @@ bun ~/.claude/LIFEOS/TOOLS/ArchitectureSummaryGenerator.ts check---+## Doctor.ts - Capability Prober & Health Manifest++**Location:** `~/.claude/LIFEOS/TOOLS/Doctor.ts`++Probes the external tools LifeOS doctrine assumes but the core install does not ship — `codex` (cross-vendor audit), Interceptor (browser verification), Cloudflare/wrangler (scheduled flows), ElevenLabs (voice) — plus core wiring, and writes an **advisory** capability manifest at `MEMORY/STATE/capabilities.json`. Born from onboarding-friction feedback (discussion #1461): capabilities assumed but never verified degrade silently, and change-scoped checks can't see what's dormant at rest.++Four states per capability: `live` / `broken` / `declined` / `stale`. The manifest is a **TTL'd cache, never truth** — it carries a salted integrity hash and readers re-verify doctrine-critical capabilities live at point-of-use. `declined` is a first-class permanent, silent opt-out. Diagnostic register only — no scores, no percentages.++**Usage:**+```bash+# Probe (offline checks), human table+bun ~/.claude/LIFEOS/TOOLS/Doctor.ts++# Include network probes (only for configured capabilities — no pre-consent egress)+bun ~/.claude/LIFEOS/TOOLS/Doctor.ts --network++bun ~/.claude/LIFEOS/TOOLS/Doctor.ts --json # machine-readable+bun ~/.claude/LIFEOS/TOOLS/Doctor.ts --verify # integrity-check the manifest (exit 2 on tamper)+bun ~/.claude/LIFEOS/TOOLS/Doctor.ts --reconcile # hooks declared-on-disk vs registered-in-settings+bun ~/.claude/LIFEOS/TOOLS/Doctor.ts --statusline # one glyph if a NEW regression since ack, else empty+bun ~/.claude/LIFEOS/TOOLS/Doctor.ts decline <cap> # permanent silent opt-out+bun ~/.claude/LIFEOS/TOOLS/Doctor.ts enable <cap> # undo a decline+bun ~/.claude/LIFEOS/TOOLS/Doctor.ts ack # acknowledge the current broken set (statusline delta base)+```++**Consumers (read the manifest, never write it):** the statusline delta line (precomputed sidecar), the `AlgorithmNudge` capability row (fires at the moment a broken capability's command fails — reads only `state`, fix command is a static in-hook constant), and the Pulse System Health panel (`/api/doctor`). Never install-fatal: the default run always exits 0; every probe is timeout-bounded.++**When to Use:**+- "run the doctor", "check capabilities", "why is voice/codex/cloudflare not working"+- Post-install (INSTALL.md step 8.5) and any time something feels off++---+## MCP Servers**Config:** `~/.claude/.mcp.json`diff --git a/LifeOS/install/LIFEOS/DOCUMENTATION/Work/WorkSystem.md b/LifeOS/install/LIFEOS/DOCUMENTATION/Work/WorkSystem.mdindex c68d2bd8..4f73bfcc 100644--- a/LifeOS/install/LIFEOS/DOCUMENTATION/Work/WorkSystem.md+++ b/LifeOS/install/LIFEOS/DOCUMENTATION/Work/WorkSystem.md@@ -4,6 +4,7 @@ last_updated_by: <da-name>convention: pai-freshness-v1last_reviewed: 2026-05-25T21:55:00Zlast_reviewed_by: <principal>+version: 1.0.3---# Work Systemdiff --git a/LifeOS/install/LIFEOS/DOCUMENTATION/Writing/AIWritingPatterns.md b/LifeOS/install/LIFEOS/DOCUMENTATION/Writing/AIWritingPatterns.mdindex f07c603f..f3daa4d2 100644--- a/LifeOS/install/LIFEOS/DOCUMENTATION/Writing/AIWritingPatterns.md+++ b/LifeOS/install/LIFEOS/DOCUMENTATION/Writing/AIWritingPatterns.md@@ -1,3 +1,7 @@+---+version: 1.0.5+---+# AI Writing Patterns — Detection ReferenceExhaustive reference of AI writing tells for auditing and rewriting content. Used by the `_WRITING` skill and referenced by writing workflows.diff --git a/LifeOS/install/LIFEOS/LIFEOS_StatusLine.sh b/LifeOS/install/LIFEOS/LIFEOS_StatusLine.shindex bc7fdb43..e1e21745 100755--- a/LifeOS/install/LIFEOS/LIFEOS_StatusLine.sh+++ b/LifeOS/install/LIFEOS/LIFEOS_StatusLine.sh@@ -11,12 +11,31 @@ set -o pipefail# CONFIGURATION# ─────────────────────────────────────────────────────────────────────────────+# Hook/statusline spawn contexts can arrive with $HOME unset (LifeOS#1463).+# Resolve the real home before any path is built; never trust a bare $HOME.+if [ -z "$HOME" ]; then+ HOME="$(getent passwd "$(id -un)" 2>/dev/null | cut -d: -f6)"+ [ -z "$HOME" ] && HOME="$(eval echo "~$(id -un)" 2>/dev/null)"+fi+LIFEOS_DIR="${LIFEOS_DIR:-$HOME/.claude/LIFEOS}"# Claude Code injects settings.json env values without shell expansion (LifeOS#1404):# a shipped value of "$HOME/.claude/LIFEOS" arrives literal. Expand it here.LIFEOS_DIR="${LIFEOS_DIR/#\$HOME/$HOME}"LIFEOS_DIR="${LIFEOS_DIR/#\$\{HOME\}/$HOME}"LIFEOS_DIR="${LIFEOS_DIR/#\~\//$HOME/}"++# Fail closed (LifeOS#1463): a non-absolute or still-unexpanded LIFEOS_DIR would+# make every cache write land relative to CWD (a literal '$HOME/' dir polluting+# whatever repo the session runs in). Refuse to run rather than write garbage.+case "$LIFEOS_DIR" in+ /*) ;;+ *) echo "LifeOS"; exit 0 ;;+esac+case "$LIFEOS_DIR" in+ *'$HOME'*|*'${HOME}'*|*'~'*) echo "LifeOS"; exit 0 ;;+esac+CLAUDE_HOME="$HOME/.claude"SETTINGS_FILE="$CLAUDE_HOME/settings.json"RATINGS_FILE="$LIFEOS_DIR/MEMORY/LEARNING/SIGNALS/ratings.jsonl"@@ -818,6 +837,28 @@ if [ "$MODE" = "normal" ]; thenfi}+ # Emit fields that exist ONLY in the OAuth payload — never in Claude Code's+ # native rate_limits (verified against real stdin 2026-07-12): the limits[]+ # array (scoped per-model window e.g. Fable, plus per-window is_active+ # flags) and the spend object (usage-credits pool, incl. disabled state).+ # Appended after the base usage.sh so these lines win when sourced.+ _emit_cache_enrichment() {+ [ -f "$USAGE_CACHE" ] || return 0+ jq -r '+ ([.limits[]? | select(.scope.model? != null)] | first) as $sc |+ "usage_scoped_present=" + (($sc != null) | tostring) + "\n" ++ "usage_scoped_name=" + (($sc.scope.model.display_name // "") | ascii_upcase | @sh) + "\n" ++ "usage_scoped_pct=" + ($sc.percent // 0 | tostring) + "\n" ++ "usage_scoped_reset=" + ($sc.resets_at // "" | @sh) + "\n" ++ "usage_scoped_active=" + ($sc.is_active // false | tostring) + "\n" ++ "usage_5h_active=" + (([.limits[]? | select(.kind == "session") | .is_active] | first // false) | tostring) + "\n" ++ "usage_7d_active=" + (([.limits[]? | select(.kind == "weekly_all") | .is_active] | first // false) | tostring) + "\n" ++ "usage_spend_used_cents=" + (.spend.used.amount_minor // 0 | tostring) + "\n" ++ "usage_spend_limit_cents=" + (.spend.limit.amount_minor // 0 | tostring) + "\n" ++ "usage_spend_enabled=" + (.spend.enabled // false | tostring)+ ' "$USAGE_CACHE" 2>/dev/null+ }+if [ "$has_native_rate_limits" = "true" ]; then# Native rate_limits available — use directly, skip OAuth API entirely.# Presence is tri-state and per-source (P1): a present 0% is real data@@ -842,19 +883,20 @@ usage_extra_limit=${native_usage_extra_limit:-0}usage_extra_used=${native_usage_extra_used:-0}usage_ws_cost_cents=0USAGEEOF- # Native payload has no extra_usage — enrich from the OAuth cache so the- # EXT indicator and E:$ credits readout can render. Appended lines win- # over the native false/0 defaults when usage.sh is sourced. Skipped if- # a future Claude Code version starts shipping extra_usage natively.- if [ "${native_usage_extra_enabled:-false}" != "true" ]; then- _refresh_usage_cache- if [ "$_data_age" -lt "$USAGE_HARD_EXPIRY" ] && jq -e '.extra_usage.is_enabled == true' "$USAGE_CACHE" >/dev/null 2>&1; then+ # Native payload has no extra_usage, limits[], or spend — enrich from+ # the OAuth cache so the EXT indicator, credits readout, scoped-model+ # (Fable) window, and active-window flags can render. Appended lines+ # win over the native false/0 defaults when usage.sh is sourced.+ _refresh_usage_cache+ if [ "$_data_age" -lt "$USAGE_HARD_EXPIRY" ]; then+ if [ "${native_usage_extra_enabled:-false}" != "true" ] && jq -e '.extra_usage.is_enabled == true' "$USAGE_CACHE" >/dev/null 2>&1; thenjq -r '"usage_extra_enabled=true\n" +"usage_extra_limit=" + (.extra_usage.monthly_limit // 0 | tostring) + "\n" +"usage_extra_used=" + (.extra_usage.used_credits // 0 | tostring)' "$USAGE_CACHE" >> "$_parallel_tmp/usage.sh" 2>/dev/nullfi+ _emit_cache_enrichment >> "$_parallel_tmp/usage.sh"fielse# Fallback: fetch from OAuth API (pre-v2.1.80 or non-Claude.ai auth)@@ -881,6 +923,7 @@ USAGEEOF"usage_ws_cost_cents=0"' "$USAGE_CACHE" > "$_parallel_tmp/usage.sh" 2>/dev/nullecho "usage_data_age=$_data_age" >> "$_parallel_tmp/usage.sh"+ _emit_cache_enrichment >> "$_parallel_tmp/usage.sh"elseecho -e "usage_source=oauth\nusage_state=absent\nusage_5h=0\nusage_7d=0\nusage_extra_enabled=false\nusage_ws_cost_cents=0\nusage_no_data=true" > "$_parallel_tmp/usage.sh"fi@@ -1428,6 +1471,19 @@ doneprintf "%b\n" "$_pm_line"+# ═══════════════════════════════════════════════════════════════════════════════+# DOCTOR — delta-only capability line (#1461 v2 design). Renders ONLY when a+# capability newly regressed since the last `Doctor.ts ack`; healthy = silent.+# Content precomputed by LIFEOS/TOOLS/Doctor.ts into a sidecar — bare cat here.+# ═══════════════════════════════════════════════════════════════════════════════++_doctor_sidecar="$LIFEOS_DIR/MEMORY/STATE/capabilities-statusline.txt"+if [ "$MODE" = "normal" ] && [ -s "$_doctor_sidecar" ]; then+ # Color via %b (escape codes), file content via %s so a tampered sidecar+ # can't inject terminal escape sequences through the status line.+ printf "%b%s%b\n" "${YELLOW:-}" "$(cat "$_doctor_sidecar")" "${RESET:-}"+fi+# ═══════════════════════════════════════════════════════════════════════════════# MEMORY — one line directly under STATE: autonomic-loop health + hot-layer fill.# Rendered every 1s tick straight from state files (zero model involvement).@@ -1553,32 +1609,72 @@ _model_display="${model_name// context/}"_model_display=$(printf '%s' "$_model_display" | tr '[:lower:]' '[:upper:]')printf "${SLATE_400}HARN:${RESET} ${LIFEOS_A}${_har_display}${RESET} ${SLATE_600}│${RESET} ${SLATE_400}DEF MODEL:${RESET} ${LIFEOS_A}${_model_display}${RESET} ${SLATE_600}│${RESET} ${SLATE_400}LIFEOS:${RESET} ${LIFEOS_A}${LIFEOS_VERSION}${RESET} ${SLATE_600}│${RESET} ${SLATE_400}ALGO:${RESET} ${LIFEOS_A}${ALGO_VERSION}${RESET}\n"-# ── AGENTS roster — which model the ROUTER assigns delegated agents at the current-# mode/tier (persistent; "not only the default model, but the models the agents run-# on"). This is the BASE routing posture; the ▸ LIVE line below is the corrector for-# actual dispatches (incl. Core-System Override, which forces max at any tier).-# Distinct from MODEL above (the main-loop orchestrator).+# ── AGENTS roster — LIVE readout of dispatched-agent models. Source of truth is+# agent-starts.json, written by AgentInvocation.hook.ts (v1.3.1, observe-only).+# Router/modes/tiers retired 2026-07-11: there is NO assigned posture to show —+# a rung lights BOLD only while work resolved to it is actually running (same+# 300s cutoff as ▸ LIVE; the file accumulates orphans from killed agents, so+# 5 min = "actually in flight"). Idle = every rung dim ("grayed out",+# principal 2026-07-12). Distinct from DEF MODEL above (the main-loop model).+#+# Model LABELS are READ from EFFORT_MODEL/CROSS_VENDOR in models.ts (single+# source of truth) — a lineup flip re-labels the roster automatically.#-# Model LABELS are READ from EFFORT_MODEL/CROSS_VENDOR in models.ts (single source of-# truth) — a lineup flip (e.g. max→opus) re-labels the roster automatically, no edit-# here. Base posture is static since modes/tiers were removed (2026-07-11):-# high (Opus) is the primary rung; SONNET/HAIKU are the medium/low utility rungs.+# Rung sources (all within the 300s window):+# low/medium/high — live Agent dispatches by resolved model. "inherited" maps+# through the session model. Fable-labeled/-inherited dispatches map to the+# FABLE rung only when models.ts DISPATCH_EXECUTES_FABLE is true (probed+# 2026-07-12: dispatches now execute faithfully; CarrierProbe.ts keeps the+# fact fresh) — false maps them to OPUS, the old downgrade reality.+# max (FABLE) — a live fable dispatch (per the constant above), OR a+# model-verification.jsonl entry whose EXECUTED model is fable+# (Inference.ts post-hoc proof; a downgraded run has executed=opus+# and correctly does not light this rung).+# GPT-5.6 / GROK — live cross-vendor dispatch (forge/codexResearcher → OpenAI,+# grokResearcher → xAI), matched on the resolved model string.#-# _pm_roster_states: pure, unit-testable. Echoes 5 rung states in fixed rung order-# "max high medium low forge" — 2 = primary here 1 = utility rung 0 = off-# Forge is ALWAYS 0 here (principal 2026-07-06): tier posture ("Forge binds at-# E3+") no longer lights GPT-5.6 — only a LIVE in-flight Forge dispatch does-# (override just below the read).+# _pm_roster_states: pure, unit-testable. Args: $1 session model, $2 space-joined+# live dispatch models, $3 fable-verified flag (0/1), $4 dispatch-executes-fable+# (true/false). Echoes 6 states in fixed rung order "max high medium low forge+# grok" — 2 = live now, 0 = idle (dim). Several rungs can be live at once._pm_roster_states() {- # Modes/tiers removed 2026-07-11: base posture is static — high (Opus) is the- # primary dispatch rung; Core-System max overrides surface via the ▸ LIVE line.- printf '0 2 1 1 0'+ local _session="$1" _live="$2" _fable="$3" _df="$4"+ local s_max=0 s_high=0 s_med=0 s_low=0 s_forge=0 s_grok=0 m+ [ "$_fable" = "1" ] && s_max=2+ # The session (main-loop) model is ALWAYS active — light its rung whether or+ # not any agent is dispatched. This is what "ACTIVE" answers: the model you're+ # talking to right now, plus any live dispatches layered on top.+ case "$_session" in+ *[Hh]aiku*) s_low=2 ;;+ *[Ss]onnet*) s_med=2 ;;+ *[Ff]able*) s_max=2 ;;+ *[Oo]pus*) s_high=2 ;;+ esac+ for m in $_live; do+ case "$m" in+ *grok*) s_grok=2 ;;+ *gpt-*) s_forge=2 ;;+ *haiku*) s_low=2 ;;+ *sonnet*) s_med=2 ;;+ *fable*) if [ "$_df" = "true" ]; then s_max=2; else s_high=2; fi ;;+ *opus*) s_high=2 ;;+ inherited)+ case "$_session" in+ *[Hh]aiku*) s_low=2 ;;+ *[Ss]onnet*) s_med=2 ;;+ *[Ff]able*) if [ "$_df" = "true" ]; then s_max=2; else s_high=2; fi ;;+ *) s_high=2 ;; # opus, unknown+ esac ;;+ *) s_high=2 ;;+ esac+ done+ printf '%s %s %s %s %s %s' "$s_max" "$s_high" "$s_med" "$s_low" "$s_forge" "$s_grok"}if [ "$MODE" = "normal" ]; then- # Resolve rung → model NAME from models.ts (same source the MODEL line + the- # AgentInvocation hook read). Fallbacks keep the line honest if models.ts is- # unreadable in a hook-spawn context.+ # Resolve rung → model NAME from models.ts (same source the AgentInvocation+ # hook reads). Fallbacks keep the line honest if models.ts is unreadable in+ # a hook-spawn context._pm_models_ts="$LIFEOS_DIR/TOOLS/models.ts"_em_block=$(sed -n '/export const EFFORT_MODEL/,/^}/p' "$_pm_models_ts" 2>/dev/null)_em_lookup() { printf '%s' "$_em_block" | sed -n "s/^[[:space:]]*$1:[[:space:]]*\"\([a-z0-9-]*\)\".*/\1/p" | head -1 | tr '[:lower:]' '[:upper:]'; }@@ -1586,60 +1682,79 @@ if [ "$MODE" = "normal" ]; then_lbl_high=$(_em_lookup high); _lbl_high="${_lbl_high:-OPUS}"_lbl_med=$(_em_lookup medium); _lbl_med="${_lbl_med:-SONNET}"_lbl_low=$(_em_lookup low); _lbl_low="${_lbl_low:-HAIKU}"- _lbl_forge=$(sed -n '/export const CROSS_VENDOR/,/^}/p' "$_pm_models_ts" 2>/dev/null | sed -n 's/^[[:space:]]*forge:[[:space:]]*"\([^"]*\)".*/\1/p' | head -1 | tr '[:lower:]' '[:upper:]')- _lbl_forge="${_lbl_forge:-GPT-5.6}"-- read -r _rs_max _rs_high _rs_med _rs_low _rs_forge \- <<< "$(_pm_roster_states)"- # GPT-5.6 lights ONLY while a Forge dispatch is actually in flight. Keyed off- # the SAME 300s cutoff as the ▸ LIVE line — agent-starts.json accumulates- # orphaned entries (synthetic tests, killed agents whose PostToolUse cleanup- # never fired), so any generous window keeps a long-dead Forge lit. The 2h- # window did exactly that (a 55-min-old synthetic forge orphan lit +GPT-5.6- # with nothing running). 5 min = "actually in flight."- _forge_starts="$LIFEOS_DIR/MEMORY/OBSERVABILITY/agent-starts.json"- if [ -f "$_forge_starts" ]; then- _forge_live=$(jq -r --argjson cutoff "$(( (NOW_EPOCH - 300) * 1000 ))" '+ # Cross-vendor labels: model string minus the "-sol" codename suffix+ # (display "GPT-5.6", not "GPT-5.6-SOL"), uppercased.+ _cv_block=$(sed -n '/export const CROSS_VENDOR/,/^}/p' "$_pm_models_ts" 2>/dev/null)+ _cv_lookup() { printf '%s' "$_cv_block" | sed -n "s/^[[:space:]]*$1:[[:space:]]*\"\([^\"]*\)\".*/\1/p" | head -1 | sed 's/-sol$//' | tr '[:lower:]' '[:upper:]'; }+ _lbl_forge=$(_cv_lookup forge); _lbl_forge="${_lbl_forge:-GPT-5.6}"+ _lbl_grok=$(_cv_lookup grokResearcher); _lbl_grok="${_lbl_grok:-GROK}"+ # Carrier fact from models.ts (CarrierProbe.ts-maintained): decides whether+ # fable-labeled/-inherited dispatches light FABLE or OPUS. Unreadable → false+ # (conservative: never claim Fable ran without the fact in hand).+ _dispatch_fable=$(sed -n 's/^export const DISPATCH_EXECUTES_FABLE = \([a-z]*\).*/\1/p' "$_pm_models_ts" 2>/dev/null)+ _dispatch_fable="${_dispatch_fable:-false}"++ # Live dispatch models in the 300s window (unique resolved-model strings;+ # pre-v1.3.1 entries lack .model → treated as inherited).+ _agent_starts="$LIFEOS_DIR/MEMORY/OBSERVABILITY/agent-starts.json"+ _live_models=""+ if [ -f "$_agent_starts" ]; then+ _live_models=$(jq -r --argjson cutoff "$(( (NOW_EPOCH - 300) * 1000 ))" '[to_entries[] | .value | select(.epoch > $cutoff)- | select((.subagent_type // "") | test("forge"; "i"))] | length- ' "$_forge_starts" 2>/dev/null)- [ "${_forge_live:-0}" -gt 0 ] 2>/dev/null && _rs_forge=2+ | (.model // "inherited")] | unique | join(" ")+ ' "$_agent_starts" 2>/dev/null)+ fi+ # FABLE rung: a verified-executed Fable inference in the window. ISO-8601+ # UTC timestamps compare lexicographically, so string > is a time compare.+ _mv_file="$LIFEOS_DIR/MEMORY/OBSERVABILITY/model-verification.jsonl"+ _fable_recent=0+ if [ -f "$_mv_file" ]; then+ _mv_cut=$(date -u -r $(( NOW_EPOCH - 300 )) +%Y-%m-%dT%H:%M:%S 2>/dev/null)+ _mv_hits=$(tail -20 "$_mv_file" 2>/dev/null | jq -s -r --arg cut "$_mv_cut" '+ [.[] | select((.ts // "") > $cut) | select(.executed // "" | test("fable"))] | length+ ' 2>/dev/null)+ [ "${_mv_hits:-0}" -gt 0 ] 2>/dev/null && _fable_recent=1fi- # Escalating rung ladder (principal directive 2026-07-06, corrected same day):- # EVERY rung renders DIM unless it is the ACTIVE (primary-dispatch) rung.- # The escalation lives in the hue — HAIKU green → SONNET blue → OPUS red →- # FABLE purple — but inactive rungs show it only as a faint, dark tint;- # exactly one rung (state 2) pops in full BOLD color. No strong colors on- # inactive rungs, ever. Utility-available (state 1) and off (state 0) look- # the same: dim.- _ar_rung_c() { # $1=rung(low|medium|high|max|forge) $2=state(2 active | anything else dim)++ read -r _rs_max _rs_high _rs_med _rs_low _rs_forge _rs_grok \+ <<< "$(_pm_roster_states "$model_name" "$_live_models" "$_fable_recent" "$_dispatch_fable")"++ # Escalating rung ladder (principal directive 2026-07-06): EVERY rung renders+ # DIM unless LIVE. The escalation lives in the hue — HAIKU green → SONNET+ # blue → OPUS red → FABLE purple — with cross-vendor GPT-5.6 (cyan) and+ # GROK (silver) behind the divider. Inactive rungs show only a faint, dark+ # tint; live rungs pop in full BOLD color. No strong colors on inactive+ # rungs, ever.+ _ar_rung_c() { # $1=rung(low|medium|high|max|forge|grok) $2=state(2 live | anything else dim)case "$1:$2" in- low:2) printf '\033[1;38;2;74;222;128m' ;; # ACTIVE: bold green-400+ low:2) printf '\033[1;38;2;74;222;128m' ;; # LIVE: bold green-400low:*) printf '\033[2;38;2;86;164;110m' ;; # dim: muted green tint- medium:2) printf '\033[1;38;2;59;130;246m' ;; # ACTIVE: bold blue-500+ medium:2) printf '\033[1;38;2;59;130;246m' ;; # LIVE: bold blue-500medium:*) printf '\033[2;38;2;90;130;185m' ;; # dim: muted blue tint- high:2) printf '\033[1;38;2;239;68;68m' ;; # ACTIVE: bold red-500+ high:2) printf '\033[1;38;2;239;68;68m' ;; # LIVE: bold red-500high:*) printf '\033[2;38;2;180;95;95m' ;; # dim: muted red tint- max:2) printf '\033[1;38;2;168;85;247m' ;; # ACTIVE: bold purple-500 — apex+ max:2) printf '\033[1;38;2;168;85;247m' ;; # LIVE: bold purple-500 — apexmax:*) printf '\033[2;38;2;150;110;195m' ;; # dim: muted purple tint- forge:2) printf '\033[1;38;2;103;232;249m' ;; # ACTIVE: bold cyan — cross-vendor+ forge:2) printf '\033[1;38;2;103;232;249m' ;; # LIVE: bold cyan — OpenAI cross-vendorforge:*) printf '\033[2;38;2;85;160;175m' ;; # dim: muted cyan tint+ grok:2) printf '\033[1;38;2;226;232;240m' ;; # LIVE: bold silver — xAI cross-vendor+ grok:*) printf '\033[2;38;2;125;135;148m' ;; # dim: muted gray tintesac}_ar_tok() { # $1=state $2=rung $3=labelprintf "%b%s${RESET}" "$(_ar_rung_c "$2" "$1")" "$3"}- _ar_line="${SLATE_400}🤖 MODE:${RESET} "+ _ar_line="${SLATE_400}ACTIVE:${RESET} "_ar_line+="$(_ar_tok "$_rs_low" low "$_lbl_low") "_ar_line+="$(_ar_tok "$_rs_med" medium "$_lbl_med") "_ar_line+="$(_ar_tok "$_rs_high" high "$_lbl_high") "_ar_line+="$(_ar_tok "$_rs_max" max "$_lbl_max")"- # Divider: the Claude rungs above are ONE mutually-exclusive ladder (exactly one- # lit). GPT-5.6 (Forge) is a separate VENDOR running alongside, not a rung — so it- # sits behind a divider as a "+cross-vendor" add-on, lit only while a Forge- # dispatch is live (see _forge_live override above).+ # Divider: the Claude rungs above are ONE family. Cross-vendor ENGINES+ # (OpenAI, xAI) run alongside, not as rungs — each sits behind the divider+ # as a "+engine" add-on, lit only while a dispatch resolved to it is live._ar_line+=" ${SLATE_600}│${RESET} "- _ar_line+="$(_ar_tok "$_rs_forge" forge "+$_lbl_forge")"+ _ar_line+="$(_ar_tok "$_rs_forge" forge "+$_lbl_forge") "+ _ar_line+="$(_ar_tok "$_rs_grok" grok "+$_lbl_grok")"printf "%b\n" "$_ar_line"fi@@ -1973,6 +2088,7 @@ if [ "${usage_state:-absent}" != "absent" ]; then# Extra usage display (Max plan overage credits — values in cents)extra_display=""+ credits_off_display=""if [ "${usage_extra_enabled:-false}" = "true" ]; thenextra_limit_dollars=$((${usage_extra_limit:-0} / 100))extra_used_dollars=$((${usage_extra_used%%.*} / 100))@@ -1982,6 +2098,14 @@ if [ "${usage_state:-absent}" != "absent" ]; thenextra_limit_fmt="\$${extra_limit_dollars}"fiextra_display="\$${extra_used_dollars:-0}/${extra_limit_fmt}"+ elif [ "${usage_spend_enabled:-}" = "false" ]; then+ # Credits pool exists but is switched OFF (e.g. out_of_credits) — show+ # the dim balance so missing overflow coverage is visible at a glance.+ _sp_used_c=${usage_spend_used_cents:-0}+ _sp_limit_c=${usage_spend_limit_cents:-0}+ _sp_used=$(( ${_sp_used_c%%.*} / 100 ))+ _sp_limit=$(( ${_sp_limit_c%%.*} / 100 ))+ [ "$_sp_limit" -gt 0 ] && credits_off_display="CR:\$${_sp_used}/\$${_sp_limit}·OFF"fi# Staleness indicator: dim labels/timestamps only, NEVER dim data values.@@ -2029,6 +2153,42 @@ if [ "${usage_state:-absent}" != "absent" ]; then}_reset_5h_fmt=$(_fmt_reset "$reset_5h_day" "$reset_5h_time")_reset_7d_fmt=$(_fmt_reset "$reset_7d_day" "$reset_7d_time")++ # Active-window highlight: brighten the label of whichever window is the+ # currently binding constraint (limits[].is_active from the OAuth payload).+ # Skipped when stale — a dimmed line must not carry a bright label.+ _5h_label_color="$_reset_color"+ _7d_label_color="$_reset_color"+ if [ "$_usage_is_stale" != true ]; then+ [ "${usage_5h_active:-false}" = "true" ] && _5h_label_color="$USAGE_PRIMARY"+ [ "${usage_7d_active:-false}" = "true" ] && _7d_label_color="$USAGE_PRIMARY"+ fi++ # Scoped per-model weekly window (e.g. FABLE) from the OAuth limits[] array.+ # Reset time is dropped when it matches WEEK's — same boundary, redundant.+ scoped_fmt=""+ if [ "${usage_scoped_present:-false}" = "true" ] && [ -n "${usage_scoped_name:-}" ]; then+ usage_scoped_int=${usage_scoped_pct%%.*}+ [ -z "$usage_scoped_int" ] && usage_scoped_int=0+ # Abbreviate long model names for line width (FABLE → FB)+ [ "$usage_scoped_name" = "FABLE" ] && usage_scoped_name="FB"+ usage_scoped_color=$(get_usage_color "$usage_scoped_int")+ _rsc_fmt=""+ if [ -n "${usage_scoped_reset:-}" ]; then+ _rsc_epoch=$(parse_iso_epoch "$usage_scoped_reset")+ if [ "$_rsc_epoch" -gt 0 ] 2>/dev/null; then+ _rsc_str=$(reset_time_str "$_rsc_epoch")+ if [ "$_rsc_str" != "${_r7d_str:-}" ]; then+ _rsc_fmt=" ${_reset_color}↻${RESET}$(_fmt_reset "${_rsc_str%%@*}" "${_rsc_str#*@}")"+ fi+ fi+ fi+ _scoped_label_color="$_reset_color"+ if [ "$_usage_is_stale" != true ] && [ "${usage_scoped_active:-false}" = "true" ]; then+ _scoped_label_color="$USAGE_PRIMARY"+ fi+ scoped_fmt=" ${_scoped_label_color}${usage_scoped_name}${RESET} ${usage_scoped_color}${usage_scoped_int}%%${RESET}${_rsc_fmt}"+ fi# Billing source indicator — colored = actively billing, slate-dim = inactive.# Three-way: SUB (subscription), EXT (Anthropic extra usage credits), API# (API-key billing). EXT segment renders only when extra usage is enabled@@ -2055,9 +2215,10 @@ if [ "${usage_state:-absent}" != "absent" ]; then_billing_fmt="${USAGE_EXTRA_ACTIVE}⚡EXT${RESET}"else_billing_fmt="${USAGE_PRIMARY}SUB${RESET}"- [ -n "$extra_display" ] && _billing_fmt="${_billing_fmt} ${SLATE_600}│${RESET} ${USAGE_EXTRA}${extra_display}${RESET}"+ [ -n "$extra_display" ] && _billing_fmt="${_billing_fmt} ${USAGE_EXTRA}${extra_display}${RESET}"+ [ -n "$credits_off_display" ] && _billing_fmt="${_billing_fmt} ${USAGE_EXTRA}${credits_off_display}${RESET}"fi- printf "${_label_color}USE:${RESET} ${_reset_color}5HR${RESET} ${usage_5h_color}${usage_5h_int}%%${RESET} ${_reset_color}↻${RESET}${_reset_5h_fmt} ${SLATE_600}│${RESET} ${_reset_color}WEEK${RESET} ${usage_7d_color}${usage_7d_int}%%${RESET} ${_reset_color}↻${RESET}${_reset_7d_fmt} ${SLATE_600}│${RESET} ${_billing_fmt}"+ printf "📊 ${_5h_label_color}5HR${RESET} ${usage_5h_color}${usage_5h_int}%%${RESET} ${_reset_color}↻${RESET}${_reset_5h_fmt} ${_7d_label_color}WK${RESET} ${usage_7d_color}${usage_7d_int}%%${RESET} ${_reset_color}↻${RESET}${_reset_7d_fmt}${scoped_fmt} ${_billing_fmt}"[ -n "$stale_suffix" ] && printf "${stale_suffix}"printf "\n"sepdiff --git a/LifeOS/install/LIFEOS/PULSE/Observability/src/app/hooks/page.tsx b/LifeOS/install/LIFEOS/PULSE/Observability/src/app/hooks/page.tsxindex 323b52be..bb0fa48c 100644--- a/LifeOS/install/LIFEOS/PULSE/Observability/src/app/hooks/page.tsx+++ b/LifeOS/install/LIFEOS/PULSE/Observability/src/app/hooks/page.tsx@@ -7,6 +7,7 @@ import { Webhook, ArrowLeft, FileCode, Globe } from "lucide-react";import Link from "next/link";import EmptyStateGuide from "@/components/EmptyStateGuide";import { PageShell, PageHeader, Panel, StatTile, Pill } from "@/components/ui/chrome";+import SystemHealthPanel from "@/components/SystemHealthPanel";interface HookEntry {event: string;@@ -93,6 +94,8 @@ function HooksLanding({ hooks, events }: { hooks: HookEntry[]; events: string[]<StatTile label="Events" value={events.length} icon={FileCode} dim="freedom" /></div>+ <SystemHealthPanel />+<div className="flex flex-col gap-6">{sortedEvents.map((event) => {const eventHooks = grouped.get(event) || [];diff --git a/LifeOS/install/LIFEOS/PULSE/Observability/src/components/SystemHealthPanel.tsx b/LifeOS/install/LIFEOS/PULSE/Observability/src/components/SystemHealthPanel.tsxnew file mode 100644index 00000000..2adcc44d--- /dev/null+++ b/LifeOS/install/LIFEOS/PULSE/Observability/src/components/SystemHealthPanel.tsx@@ -0,0 +1,219 @@+"use client";++/**+ * System Health (Doctor) — read-only diagnostic surface over the advisory+ * capability manifest + heartbeat written by LIFEOS/TOOLS/Doctor.ts, plus the+ * hook reconciler. DIAGNOSTIC REGISTER ONLY: no scores, no percentages, no+ * meters. Declined renders calm ("off (declined)"), never red. A dead checker+ * (heartbeat > 7 days) is rendered loud/red, because a silent checker hides+ * every regression behind it.+ */++import { useQuery } from "@tanstack/react-query";+import { Stethoscope, Wrench } from "lucide-react";+import { Panel, PanelHeader } from "@/components/ui/chrome";++type CapState = "live" | "broken" | "declined" | "stale";++interface Capability {+ id: string;+ title: string;+ state: CapState;+ detail: string;+ fixCmd: string | null;+ checkedAt: string;+ ttlHours: number;+ probeClass: string;+ stale: boolean;+}++interface DoctorData {+ manifest:+ | { present: true; updatedAt: string | null; capabilities: Capability[] }+ | { present: false; hint: string; capabilities: unknown[] };+ heartbeat:+ | { present: true; ranAt: string | null; network: boolean; ageMs: number | null; stale7d: boolean }+ | { present: false; hint: string };+ reconcile: { unwired: string[]; missing: string[]; note: string };+}++// state → { glyph, color, label }. Stale (a live entry past its TTL) reads as a+// calm hollow marker, not an error. Declined is calm and never red.+function stateFace(cap: Capability): { glyph: string; color: string; label: string } {+ if (cap.state === "declined") return { glyph: "⏸", color: "var(--ink-3)", label: "off (declined)" };+ if (cap.state === "broken") return { glyph: "❌", color: "var(--err)", label: "broken" };+ if (cap.stale) return { glyph: "◌", color: "var(--ink-3)", label: "stale — re-run doctor" };+ if (cap.state === "live") return { glyph: "✅", color: "var(--ok)", label: "live" };+ return { glyph: "◌", color: "var(--ink-3)", label: "stale — re-run doctor" };+}++function humanizeAge(ms: number | null): string {+ if (ms == null) return "unknown";+ const mins = Math.floor(ms / 60_000);+ if (mins < 1) return "just now";+ if (mins < 60) return `${mins}m ago`;+ const hrs = Math.floor(mins / 60);+ if (hrs < 48) return `${hrs}h ago`;+ const days = Math.floor(hrs / 24);+ return `${days}d ago`;+}++export default function SystemHealthPanel() {+ const { data, isError } = useQuery<DoctorData>({+ queryKey: ["doctor-state"],+ queryFn: async () => {+ const res = await fetch("/api/doctor");+ if (!res.ok) throw new Error("Failed to fetch doctor state");+ return res.json();+ },+ staleTime: 30_000,+ });++ if (isError) {+ return (+ <Panel>+ <PanelHeader title="System Health" icon={Stethoscope} />+ <p className="text-[13px] text-ink-3" style={{ fontFamily: "'concourse-t3', sans-serif" }}>+ Doctor surface unavailable.+ </p>+ </Panel>+ );+ }++ if (!data) {+ return (+ <Panel>+ <PanelHeader title="System Health" icon={Stethoscope} />+ <p className="text-[13px] text-ink-3" style={{ fontFamily: "'concourse-t3', sans-serif" }}>+ Loading…+ </p>+ </Panel>+ );+ }++ const { manifest, heartbeat, reconcile } = data;+ const hbAge = heartbeat.present ? humanizeAge(heartbeat.ageMs) : null;+ const hbRed = heartbeat.present && heartbeat.stale7d;++ return (+ <Panel>+ <PanelHeader+ title="System Health"+ icon={Stethoscope}+ meta={+ heartbeat.present ? (+ <span style={{ color: hbRed ? "var(--err)" : "var(--ink-3)" }}>+ doctor last ran {hbAge}+ {heartbeat.network ? " · network" : ""}+ {hbRed ? " — checker may be dead" : ""}+ </span>+ ) : undefined+ }+ />++ {/* Heartbeat absent — no doctor run yet */}+ {!heartbeat.present && (+ <p className="mb-4 text-[13px]" style={{ fontFamily: "'concourse-t3', sans-serif", color: "var(--warn)" }}>+ {heartbeat.hint}+ </p>+ )}++ {/* Capabilities */}+ {!manifest.present ? (+ <p className="text-[13px]" style={{ fontFamily: "'concourse-t3', sans-serif", color: "var(--ink-3)" }}>+ {manifest.hint}+ </p>+ ) : manifest.capabilities.length === 0 ? (+ <p className="text-[13px]" style={{ fontFamily: "'concourse-t3', sans-serif", color: "var(--ink-3)" }}>+ No capabilities probed yet — bun LIFEOS/TOOLS/Doctor.ts+ </p>+ ) : (+ <div className="flex flex-col gap-2">+ {manifest.capabilities.map((cap) => {+ const face = stateFace(cap);+ return (+ <div+ key={cap.id}+ className="flex items-start gap-3 rounded-lg px-3 py-2 bg-surface-3/40 border border-line-2"+ >+ <span className="text-[15px] leading-5 shrink-0" style={{ color: face.color }} aria-hidden>+ {face.glyph}+ </span>+ <div className="min-w-0 flex-1">+ <div className="flex items-center gap-2">+ <span+ className="text-[13px] leading-snug text-ink-1 flex-1 min-w-0 truncate"+ style={{ fontFamily: "'concourse-t3', sans-serif" }}+ >+ {cap.title}+ </span>+ <span className="text-[12px] leading-snug shrink-0 ml-auto" style={{ color: face.color }}>+ {face.label}+ </span>+ </div>+ {cap.state !== "declined" && cap.detail && (+ <div className="text-[12px] leading-snug text-ink-3 mt-1" style={{ fontFamily: "'concourse-t3', sans-serif" }}>+ {cap.detail}+ </div>+ )}+ {cap.state === "broken" && cap.fixCmd && (+ <div className="flex items-start gap-1.5 mt-1">+ <Wrench className="w-3 h-3 shrink-0 mt-0.5 text-ink-3" />+ <code className="text-[12px] mono text-ink-2 break-all">{cap.fixCmd}</code>+ </div>+ )}+ </div>+ </div>+ );+ })}+ </div>+ )}++ {/* Hook reconciliation */}+ <div className="mt-4 pt-3 border-t border-line-2">+ <div+ className="text-[12px] font-semibold uppercase tracking-[0.12em] text-ink-3 mb-2"+ style={{ fontFamily: "'concourse-c3', 'concourse-t3', sans-serif" }}+ >+ Hook reconciliation+ </div>+ {reconcile.unwired.length === 0 && reconcile.missing.length === 0 ? (+ <p className="text-[13px]" style={{ fontFamily: "'concourse-t3', sans-serif", color: "var(--ok)" }}>+ ✅ hooks fully reconciled — every declared hook is registered+ </p>+ ) : (+ <div className="flex flex-col gap-2">+ {reconcile.unwired.length > 0 && (+ <div>+ <span className="text-[12px]" style={{ color: "var(--warn)" }}>+ declared on disk but not registered ({reconcile.unwired.length}):+ </span>+ <div className="flex flex-wrap gap-1.5 mt-1">+ {reconcile.unwired.map((f) => (+ <code key={f} className="text-[12px] mono text-ink-2 px-1.5 py-0.5 rounded bg-surface-3/60 border border-line-2">+ {f}+ </code>+ ))}+ </div>+ </div>+ )}+ {reconcile.missing.length > 0 && (+ <div>+ <span className="text-[12px]" style={{ color: "var(--err)" }}>+ registered but missing from disk ({reconcile.missing.length}):+ </span>+ <div className="flex flex-wrap gap-1.5 mt-1">+ {reconcile.missing.map((f) => (+ <code key={f} className="text-[12px] mono text-ink-2 px-1.5 py-0.5 rounded bg-surface-3/60 border border-line-2">+ {f}+ </code>+ ))}+ </div>+ </div>+ )}+ </div>+ )}+ </div>+ </Panel>+ );+}diff --git a/LifeOS/install/LIFEOS/PULSE/VoiceServer/voice.ts b/LifeOS/install/LIFEOS/PULSE/VoiceServer/voice.tsindex af1c78ac..94086ad3 100644--- a/LifeOS/install/LIFEOS/PULSE/VoiceServer/voice.ts+++ b/LifeOS/install/LIFEOS/PULSE/VoiceServer/voice.ts@@ -586,8 +586,11 @@ export function startVoice(config: VoiceConfig): void {// Load voice config from settings.jsonvoiceConfig = loadVoiceConfigFromSettings()- // Resolve default voice ID: config override → settings.json → hardcoded fallback- defaultVoiceId = config.default_voice_id || voiceConfig.defaultVoiceId || "s3TPKV1kjDlVtZbl4Ksh"+ // Resolve default voice ID: config override → settings.json → hardcoded fallback.+ // The fallback must stay an ElevenLabs PREMADE voice ("Rachel") — it is the+ // last resort on unconfigured fresh installs, and account-library or famous+ // voices 401 there (famous_voice_not_permitted, LifeOS#1461 bug 5).+ defaultVoiceId = config.default_voice_id || voiceConfig.defaultVoiceId || "21m00Tcm4TlvDq8ikWAM"initialized = truelog("info", "Voice module: initialized", {diff --git a/LifeOS/install/LIFEOS/PULSE/modules/doctor.ts b/LifeOS/install/LIFEOS/PULSE/modules/doctor.tsnew file mode 100644index 00000000..878a4aa0--- /dev/null+++ b/LifeOS/install/LIFEOS/PULSE/modules/doctor.ts@@ -0,0 +1,176 @@+/**+ * Doctor Pulse module — read-only "System Health" surface over the advisory+ * caches written by LIFEOS/TOOLS/Doctor.ts. Holds ZERO truth of its own: it+ * reads the capability manifest + heartbeat and shells the hook reconciler,+ * then serves whatever they say. The dashboard renders the result.+ *+ * Diagnostic register only — no scores, no percentages, no meters. The manifest+ * is a TTL'd cache, so past-TTL live entries are flagged stale; a dead checker+ * (heartbeat > 7d) is surfaced loudly for the UI to render in red.+ *+ * Route: GET /api/doctor → { manifest, heartbeat, reconcile }+ */+import { existsSync, readFileSync } from "node:fs";+import { homedir } from "node:os";+import { join } from "node:path";++const MODULE_NAME = "doctor";+const CONFIG_ROOT = process.env.CLAUDE_CONFIG_DIR || join(homedir(), ".claude");+const LIFEOS_DIR = join(CONFIG_ROOT, "LIFEOS");+const STATE_DIR = join(LIFEOS_DIR, "MEMORY", "STATE");+const MANIFEST_PATH = join(STATE_DIR, "capabilities.json");+const HEARTBEAT_PATH = join(STATE_DIR, "doctor-heartbeat.json");+const DOCTOR_TS = join(LIFEOS_DIR, "TOOLS", "Doctor.ts");+const SEVEN_DAYS_MS = 7 * 24 * 3_600_000;+const RECONCILE_TIMEOUT_MS = 10_000;+const RECONCILE_CACHE_MS = 30_000;++const state = { running: false };++// Display titles for known capabilities. Mirrors the CAPS registry in Doctor.ts+// (display-only; the manifest itself stores just id + state). Unknown ids fall+// back to a title-cased id so a newly-added capability still renders.+const CAP_TITLES: Record<string, string> = {+ codex: "Cross-vendor audit",+ interceptor: "Browser verification",+ cloudflare: "Scheduled cloud flows",+ voice: "Voice notifications",+};++interface CapResult {+ state: "live" | "broken" | "declined" | "stale";+ checkedAt: string;+ ttlHours: number;+ detail: string;+ fixCmd: string | null;+ probeClass?: "offline" | "network";+}++function titleFor(id: string): string {+ return CAP_TITLES[id] || id.replace(/(^|[-_])(\w)/g, (_, __, c) => " " + c.toUpperCase()).trim();+}++function readManifest() {+ if (!existsSync(MANIFEST_PATH)) {+ return {+ present: false as const,+ hint: `no doctor run yet — bun ${DOCTOR_TS}`,+ capabilities: [] as unknown[],+ };+ }+ try {+ const raw = JSON.parse(readFileSync(MANIFEST_PATH, "utf8")) as {+ updatedAt?: string;+ capabilities?: Record<string, CapResult>;+ };+ const now = Date.now();+ const capabilities = Object.entries(raw.capabilities || {}).map(([id, r]) => {+ // Stale = a live entry whose last probe is older than its TTL. Declined is+ // never stale (it's a permanent opt-out), broken stays broken.+ const stale =+ r.state === "live" && now - Date.parse(r.checkedAt) > r.ttlHours * 3_600_000;+ return {+ id,+ title: titleFor(id),+ state: r.state,+ detail: r.detail,+ fixCmd: r.fixCmd ?? null,+ checkedAt: r.checkedAt,+ ttlHours: r.ttlHours,+ probeClass: r.probeClass ?? "offline",+ stale,+ };+ });+ return { present: true as const, updatedAt: raw.updatedAt ?? null, capabilities };+ } catch {+ return {+ present: false as const,+ hint: `capabilities manifest unreadable — re-run: bun ${DOCTOR_TS}`,+ capabilities: [] as unknown[],+ };+ }+}++function readHeartbeat() {+ if (!existsSync(HEARTBEAT_PATH)) {+ return { present: false as const, hint: `no doctor run yet — bun ${DOCTOR_TS}` };+ }+ try {+ const raw = JSON.parse(readFileSync(HEARTBEAT_PATH, "utf8")) as {+ ranAt?: string;+ network?: boolean;+ };+ const ranAtMs = raw.ranAt ? Date.parse(raw.ranAt) : NaN;+ const ageMs = Number.isFinite(ranAtMs) ? Date.now() - ranAtMs : null;+ return {+ present: true as const,+ ranAt: raw.ranAt ?? null,+ network: !!raw.network,+ ageMs,+ // A dead checker must be loud: > 7 days without a run is a red condition.+ stale7d: ageMs != null && ageMs > SEVEN_DAYS_MS,+ };+ } catch {+ return { present: false as const, hint: `heartbeat unreadable — re-run: bun ${DOCTOR_TS}` };+ }+}++interface Reconcile {+ unwired: string[];+ missing: string[];+ note: string;+}+let reconcileCache: { at: number; value: Reconcile } | null = null;++function readReconcile(): Reconcile {+ if (reconcileCache && Date.now() - reconcileCache.at < RECONCILE_CACHE_MS) {+ return reconcileCache.value;+ }+ const fallback: Reconcile = {+ unwired: [],+ missing: [],+ note: "reconcile unavailable (Doctor.ts not runnable on this install)",+ };+ try {+ const proc = Bun.spawnSync(["bun", DOCTOR_TS, "--reconcile"], {+ stdout: "pipe",+ stderr: "ignore",+ timeout: RECONCILE_TIMEOUT_MS,+ });+ const out = new TextDecoder().decode(proc.stdout).trim();+ const value = JSON.parse(out) as Reconcile;+ reconcileCache = { at: Date.now(), value };+ return value;+ } catch {+ return fallback;+ }+}++function read() {+ return {+ manifest: readManifest(),+ heartbeat: readHeartbeat(),+ reconcile: readReconcile(),+ };+}++export async function start(): Promise<void> {+ state.running = true;+ console.log(`[${MODULE_NAME}] started`);+}+export async function stop(): Promise<void> {+ state.running = false;+}+export function health(): { status: string; details?: Record<string, unknown> } {+ const hb = readHeartbeat();+ return {+ status: state.running ? "healthy" : "stopped",+ details: { heartbeat: hb.present ? (hb.stale7d ? "stale" : "fresh") : "never" },+ };+}+export async function handleRequest(_req: Request, pathname: string): Promise<Response | null> {+ const sub = pathname.replace(/^\/api\/doctor/, "") || "/";+ if (sub === "/" || sub === "/state") return Response.json(read());+ if (sub === "/status" || sub === "/health") return Response.json(health());+ return null;+}diff --git a/LifeOS/install/LIFEOS/PULSE/modules/telegram.ts b/LifeOS/install/LIFEOS/PULSE/modules/telegram.tsindex 38caa20a..41512798 100644--- a/LifeOS/install/LIFEOS/PULSE/modules/telegram.ts+++ b/LifeOS/install/LIFEOS/PULSE/modules/telegram.ts@@ -1056,6 +1056,14 @@ A belt-and-suspenders egress sanitizer (LIFEOS/PULSE/lib/strip-mode-scaffolding.// the session). Fresh sessions and idle-reset sessions have resumeFromSdk// undefined and get a clean start.+ // Timeout: the controller is passed INTO the SDK so a hung stream is+ // actually killed at sdkTimeoutMs. Before 2026-07-11 the signal was only+ // checked at the top of the for-await loop — a stream that stopped+ // yielding hung the handler indefinitely (observed: one query ran 2.87h,+ // freezing the live "▊" partial in the chat the whole time).+ const timeoutController = new AbortController()+ sdkOptions.abortController = timeoutController+const queryOpts: { prompt: string; resume?: string; options?: any } = {prompt,options: sdkOptions as any,@@ -1070,8 +1078,8 @@ A belt-and-suspenders egress sanitizer (LIFEOS/PULSE/lib/strip-mode-scaffolding.let fullText = ""let messageId: number | null = nulllet lastEditTime = 0+ let timedOut = false- const timeoutController = new AbortController()const timeout = setTimeout(() => timeoutController.abort(), sdkTimeoutMs)try {@@ -1132,13 +1140,32 @@ A belt-and-suspenders egress sanitizer (LIFEOS/PULSE/lib/strip-mode-scaffolding.} catch { /* edit failures are non-critical */ }}}+ } catch (streamErr) {+ // Abort at sdkTimeoutMs surfaces here as an error from the stream.+ // Partial text (if any streamed before the hang) is still in fullText+ // and ships below — better a truncated answer than a frozen "▊".+ if (timeoutController.signal.aborted) {+ timedOut = true+ log("error", "SDK query timed out — aborted", {+ sdkTimeoutMs,+ partialLength: fullText.length,+ })+ } else {+ throw streamErr+ }} finally {clearTimeout(timeout)}+ if (timedOut && fullText) {+ fullText += "\n\n(⏱ I hit my generation time limit — this reply is cut short. Ask again to continue.)"+ }+if (!fullText) {- fullText = "Sorry, I wasn't able to generate a response. Try again?"- log("error", "Empty response from SDK")+ fullText = timedOut+ ? "That one timed out on my side before I produced anything. Send it again?"+ : "Sorry, I wasn't able to generate a response. Try again?"+ log("error", "Empty response from SDK", { timedOut })}// Egress sanitizer. Strip any CLAUDE.md modediff --git a/LifeOS/install/LIFEOS/PULSE/pulse.ts b/LifeOS/install/LIFEOS/PULSE/pulse.tsindex f8745a2e..e3271174 100755--- a/LifeOS/install/LIFEOS/PULSE/pulse.ts+++ b/LifeOS/install/LIFEOS/PULSE/pulse.ts@@ -97,6 +97,7 @@ let assetsModule: any = nulllet usageModule: any = nulllet bunkerModule: any = nulllet contentModule: any = null+let doctorModule: any = nullasync function loadModules(config: PulseConfig) {if (config.voice?.enabled !== false) {@@ -269,6 +270,14 @@ async function loadModules(config: PulseConfig) {log("warn", "Bunker module not available", { error: String(err) })}}+ // Doctor — read-only System Health surface over the advisory capability+ // manifest + heartbeat written by LIFEOS/TOOLS/Doctor.ts (always loaded).+ try {+ doctorModule = await import("./modules/doctor")+ if (doctorModule.start) await doctorModule.start()+ } catch (err) {+ log("warn", "Doctor module not available", { error: String(err) })+ }}// ── Config Types ──@@ -800,6 +809,12 @@ async function main() {if (resp) return resp}+ // Doctor API: /api/doctor (System Health — capabilities, heartbeat, hook reconcile)+ if (doctorModule && pathname.startsWith("/api/doctor")) {+ const resp = await doctorModule.handleRequest(req, pathname)+ if (resp) return resp+ }+// Observability routes: /api/*, /dashboard/*if (observabilityModule && (pathname.startsWith("/api/") || pathname.startsWith("/dashboard") || pathname.startsWith("/_next/") || pathname === "/favicon.ico")) {const resp = await observabilityModule.handleObservabilityRequest(req, pathname)diff --git a/LifeOS/install/LIFEOS/RULES/Philosophy.md b/LifeOS/install/LIFEOS/RULES/Philosophy.mdindex e25325b1..a5292465 100644--- a/LifeOS/install/LIFEOS/RULES/Philosophy.md+++ b/LifeOS/install/LIFEOS/RULES/Philosophy.md@@ -1,3 +1,7 @@+---+version: 1.1.2+---+# LifeOS Philosophy & Epistemology (on-demand)> Relocated verbatim from LIFEOS_SYSTEM_PROMPT.md on 2026-07-09 (7.0.0 BPE). Load when explaining the system, writing docs/releases about LifeOS, or reasoning about why the Algorithm/ISA work the way they do.diff --git a/LifeOS/install/LIFEOS/RULES/SelfHealing.md b/LifeOS/install/LIFEOS/RULES/SelfHealing.mdindex ec4dc9f8..44f5d647 100644--- a/LifeOS/install/LIFEOS/RULES/SelfHealing.md+++ b/LifeOS/install/LIFEOS/RULES/SelfHealing.md@@ -1,3 +1,7 @@+---+version: 1.0.0+---+# Self-Healing Infrastructure (on-demand)> Relocated verbatim from LIFEOS_SYSTEM_PROMPT.md on 2026-07-09 (7.0.0 BPE). Load when encoding a new rule/preference/learning and deciding where it lives.diff --git a/LifeOS/install/LIFEOS/RULES/VerificationExpanded.md b/LifeOS/install/LIFEOS/RULES/VerificationExpanded.mdindex 56dedc8d..6573f7f2 100644--- a/LifeOS/install/LIFEOS/RULES/VerificationExpanded.md+++ b/LifeOS/install/LIFEOS/RULES/VerificationExpanded.md@@ -1,3 +1,7 @@+---+version: 1.0.0+---+# Verification Doctrine — Expanded (on-demand)> Relocated verbatim from LIFEOS_SYSTEM_PROMPT.md on 2026-07-09 (7.0.0 BPE). The constitutional core stays resident; this file holds the full incident-derived doctrine. Load when verifying web/UI output, when Interceptor is wedged, when a claim is about appearance, or when in doubt about what counts as evidence. The same mechanics are enforced in Algorithm doctrine Rule 1 + hooks/VerificationGate.hook.ts.diff --git a/LifeOS/install/LIFEOS/TOOLS/ArchitectureSummaryGenerator.ts b/LifeOS/install/LIFEOS/TOOLS/ArchitectureSummaryGenerator.tsindex b08ab448..54b6f7cb 100755--- a/LifeOS/install/LIFEOS/TOOLS/ArchitectureSummaryGenerator.ts+++ b/LifeOS/install/LIFEOS/TOOLS/ArchitectureSummaryGenerator.ts@@ -75,7 +75,7 @@ function detectAlgorithmVersion(): string {}/** Detect the system prompt's component version from its frontmatter `version:` line —- * the marker BumpSystemPromptVersion.ts owns (Ledger's fourth component). Scoped to the+ * the marker BumpSystemPromptVersion.ts owns (a versioning component line). Scoped to the* leading `---` block so a `version:` in the body can't match. */function detectSystemPromptVersion(): string {const spPath = path.join(LIFEOS_DIR, "LIFEOS_SYSTEM_PROMPT.md");diff --git a/LifeOS/install/LIFEOS/TOOLS/CarrierProbe.ts b/LifeOS/install/LIFEOS/TOOLS/CarrierProbe.tsnew file mode 100644index 00000000..ace29edf--- /dev/null+++ b/LifeOS/install/LIFEOS/TOOLS/CarrierProbe.ts@@ -0,0 +1,205 @@+#!/usr/bin/env bun+/**+ * CarrierProbe.ts — end-to-end probe of the Agent-dispatch carrier reality.+ *+ * THE FACT UNDER TEST (canonical home: models.ts § CARRIER REALITY ++ * DISPATCH_EXECUTES_FABLE): does an Agent dispatch with model "fable" execute+ * genuine Fable? The Fable-carrier safety rule, the statusline's dispatch-rung+ * mapping, and Algorithm §Spend all rest on this fact staying current. Harness+ * updates flip it silently (it flipped 2026-07-12, caught by this tool's first+ * run); this turns "re-probe periodically" into infrastructure.+ *+ * HOW: spawns a cheap haiku `claude --print` session instructed to dispatch+ * ONE subagent with model "fable", then reads the child session's subagent+ * transcripts (projects/<slug>/<session>/subagents/agent-*.jsonl) and extracts+ * the assistant messages' `message.model` — the same evidence class the manual+ * 2026-07-07/-11/-12 probes used. A subagent's self-report is NOT evidence;+ * the transcript is.+ *+ * VERDICTS (recorded to MEMORY/STATE/carrier-probe.json, appended to+ * MEMORY/OBSERVABILITY/model-verification.jsonl):+ * HOLDS observation matches DISPATCH_EXECUTES_FABLE exit 0+ * FLIPPED observation CONTRADICTS it — update models.ts + consumers exit 1+ * INCONCLUSIVE no subagent transcript found (dispatch didn't happen) exit 2+ *+ * USAGE:+ * bun LIFEOS/TOOLS/CarrierProbe.ts # live probe (spends one tiny run)+ * bun LIFEOS/TOOLS/CarrierProbe.ts --check # freshness gate only, no spend:+ * # exit 1 if stale (>30d), flipped,+ * # or never run — /ic calls this+ */++import { spawn } from "child_process";+import { existsSync, mkdirSync, readFileSync, writeFileSync, appendFileSync, readdirSync } from "fs";+import { join } from "path";+import { homedir } from "os";+import { DISPATCH_EXECUTES_FABLE } from "./models";++const CLAUDE_DIR = join(homedir(), ".claude");+const STATE_FILE = join(CLAUDE_DIR, "LIFEOS", "MEMORY", "STATE", "carrier-probe.json");+const OBS_FILE = join(CLAUDE_DIR, "LIFEOS", "MEMORY", "OBSERVABILITY", "model-verification.jsonl");+const MAX_AGE_DAYS = 30;+const TIMEOUT_MS = 240_000;++type Verdict = "HOLDS" | "FLIPPED" | "INCONCLUSIVE";++interface ProbeState {+ ts: string;+ verdict: Verdict;+ sidechainModels: string[];+ envelopeModels: string[];+ sessionId?: string;+ note: string;+}++function readState(): ProbeState | null {+ try {+ return JSON.parse(readFileSync(STATE_FILE, "utf8")) as ProbeState;+ } catch {+ return null;+ }+}++/** --check: freshness gate, zero spend. Designed for /ic. */+function check(): number {+ const s = readState();+ if (!s) {+ console.error(`CarrierProbe: NEVER RUN — run \`bun LIFEOS/TOOLS/CarrierProbe.ts\` to establish the fact`);+ return 1;+ }+ const ageDays = (Date.now() - Date.parse(s.ts)) / 86_400_000;+ if (s.verdict === "FLIPPED") {+ console.error(`CarrierProbe: FLIPPED at ${s.ts} — observation contradicts models.ts DISPATCH_EXECUTES_FABLE; update the constant and its consumers, then re-probe`);+ return 1;+ }+ if (s.verdict === "INCONCLUSIVE") {+ console.error(`CarrierProbe: last run ${s.ts} was INCONCLUSIVE (${s.note}) — re-run the probe`);+ return 1;+ }+ if (ageDays > MAX_AGE_DAYS) {+ console.error(`CarrierProbe: STALE — last probe ${s.ts} (${Math.floor(ageDays)}d > ${MAX_AGE_DAYS}d); re-run \`bun LIFEOS/TOOLS/CarrierProbe.ts\``);+ return 1;+ }+ console.log(`CarrierProbe: HOLDS (probed ${s.ts}, ${Math.floor(ageDays)}d ago; sidechain ran ${s.sidechainModels.join(", ") || "?"})`);+ return 0;+}++function resolveClaudeBin(): string {+ const local = join(homedir(), ".local", "bin", "claude");+ return existsSync(local) ? local : "claude";+}++/** Run the child claude session; return its JSON envelope. Mirrors the+ * Inference.ts subprocess recipe exactly (billing + nested-session handling). */+function runChild(): Promise<{ envelope: Record<string, unknown> | null; raw: string }> {+ return new Promise((resolve) => {+ const env = { ...process.env } as Record<string, string | undefined>;+ // Nested-session guard: hooks run inside Claude Code's environment.+ delete env.CLAUDECODE;+ // BILLING: subscription via OAuth — both keys outrank the OAuth token in+ // Anthropic's precedence chain, and bun auto-loads ~/.claude/.env. Scrub.+ delete env.ANTHROPIC_API_KEY;+ delete env.ANTHROPIC_AUTH_TOKEN;+ delete env.ANTHROPIC_BASE_URL;++ const prompt =+ 'Use your agent-dispatch tool (named Agent or Task) exactly once: ' ++ 'subagent_type "general-purpose", model "fable", prompt "Reply with the single word OK." ' ++ "After it returns, reply with the single word DONE.";++ const args = [+ "--print",+ "--model", "haiku", // cheap driver; the DISPATCH is what's under test+ "--allowedTools", "Task,Agent",+ "--output-format", "json",+ "--setting-sources", "", // no hooks: keeps agent-starts.json/statusline clean of synthetic entries+ "--system-prompt", "You are a test driver. Follow the instruction literally.",+ ];++ let stdout = "";+ let stderr = "";+ const proc = spawn(resolveClaudeBin(), args, {+ env: env as NodeJS.ProcessEnv,+ cwd: CLAUDE_DIR, // pins the transcript to the -Users-…--claude project dir+ stdio: ["pipe", "pipe", "pipe"],+ });+ const timer = setTimeout(() => proc.kill("SIGKILL"), TIMEOUT_MS);+ proc.stdout.on("data", (d) => (stdout += d));+ proc.stderr.on("data", (d) => (stderr += d));+ proc.on("close", () => {+ clearTimeout(timer);+ try {+ resolve({ envelope: JSON.parse(stdout), raw: stdout });+ } catch {+ resolve({ envelope: null, raw: stdout || stderr });+ }+ });+ proc.stdin.end(prompt);+ });+}++/** Extract executing models from the child session's subagent transcripts+ * (projects/<slug>/<session>/subagents/agent-*.jsonl) — the evidence class the+ * manual probes established. Assistant-message `message.model` is what RAN. */+function sidechainModels(sessionId: string): string[] {+ const slug = CLAUDE_DIR.replace(/[/.]/g, "-");+ const dir = join(CLAUDE_DIR, "projects", slug, sessionId, "subagents");+ if (!existsSync(dir)) return [];+ const models = new Set<string>();+ for (const f of readdirSync(dir).filter((f) => f.endsWith(".jsonl"))) {+ for (const line of readFileSync(join(dir, f), "utf8").split("\n")) {+ if (!line.trim()) continue;+ try {+ const e = JSON.parse(line);+ if (e.type === "assistant" && e.message?.model) models.add(e.message.model as string);+ } catch { /* skip malformed lines */ }+ }+ }+ return [...models];+}++function record(state: ProbeState): void {+ mkdirSync(join(STATE_FILE, ".."), { recursive: true });+ writeFileSync(STATE_FILE, JSON.stringify(state, null, 2) + "\n");+ try {+ mkdirSync(join(OBS_FILE, ".."), { recursive: true });+ appendFileSync(OBS_FILE, JSON.stringify({ level: "carrier-probe", ...state }) + "\n");+ } catch { /* observability must never break the probe */ }+}++async function probe(): Promise<number> {+ console.error("CarrierProbe: spawning haiku driver session (dispatches one model:fable subagent)…");+ const { envelope, raw } = await runChild();+ const ts = new Date().toISOString();+ if (!envelope) {+ record({ ts, verdict: "INCONCLUSIVE", sidechainModels: [], envelopeModels: [], note: `no JSON envelope: ${raw.slice(0, 200)}` });+ console.error("CarrierProbe: INCONCLUSIVE — child produced no JSON envelope");+ return 2;+ }+ const sessionId = (envelope.session_id as string) ?? "";+ const envelopeModels = Object.keys((envelope.modelUsage as Record<string, unknown>) ?? {});+ const sidechain = sidechainModels(sessionId);+ let verdict: Verdict;+ let note: string;+ const ranFable = sidechain.some((m) => /fable/i.test(m));+ if (sidechain.length === 0) {+ verdict = "INCONCLUSIVE";+ note = `no subagent transcript in session dir (result: ${String(envelope.result).slice(0, 80)})`;+ } else if (ranFable === DISPATCH_EXECUTES_FABLE) {+ verdict = "HOLDS";+ note = `model:fable dispatch executed ${sidechain.join(", ")} — matches DISPATCH_EXECUTES_FABLE=${DISPATCH_EXECUTES_FABLE}`;+ } else {+ verdict = "FLIPPED";+ note = `model:fable dispatch executed ${sidechain.join(", ")} — CONTRADICTS DISPATCH_EXECUTES_FABLE=${DISPATCH_EXECUTES_FABLE}; update models.ts (constant + CARRIER REALITY), then statusline mapping + OPERATIONAL_RULES line + Algorithm §Spend`;+ }+ record({ ts, verdict, sidechainModels: sidechain, envelopeModels, sessionId, note });+ const out = verdict === "HOLDS" ? console.log : console.error;+ out(`CarrierProbe: ${verdict} — ${note}`);+ out(` sidechain: [${sidechain.join(", ")}] envelope: [${envelopeModels.join(", ")}]`);+ return verdict === "HOLDS" ? 0 : verdict === "FLIPPED" ? 1 : 2;+}++if (import.meta.main) {+ const exitCode = process.argv.includes("--check") ? check() : await probe();+ process.exit(exitCode);+}diff --git a/LifeOS/install/LIFEOS/TOOLS/Doctor.ts b/LifeOS/install/LIFEOS/TOOLS/Doctor.tsnew file mode 100644index 00000000..ae29aa60--- /dev/null+++ b/LifeOS/install/LIFEOS/TOOLS/Doctor.ts@@ -0,0 +1,444 @@+#!/usr/bin/env bun+/**+ * @version 1.0.0+ * Doctor — LifeOS capability prober and manifest writer.+ *+ * Probes the external tools that LifeOS doctrine depends on (cross-vendor+ * audit CLI, browser verification, Cloudflare/wrangler, voice) plus core+ * wiring, and writes an advisory capability manifest. Born from community+ * feedback (LifeOS discussion #1461): capabilities that are assumed but+ * never verified degrade silently; anything dormant at rest is invisible+ * to change-scoped checks.+ *+ * Design contract (RedTeam-derived, 2026-07-12):+ * - The manifest is a TTL'd advisory CACHE, never truth. Readers treat it+ * as untrusted input; doctrine-critical gates re-verify live.+ * - Four states: live | broken | declined | stale. Declined is first-class+ * and permanently silent — opted-out is not a defect.+ * - No scores, no percentages. Diagnostic register only.+ * - Never install-fatal: default run always exits 0, every probe is+ * timeout-bounded, network probes are opt-in (--network) and only fire+ * for capabilities the user has configured.+ * - Tamper-evident: manifest carries a salted integrity hash (salt is a+ * separate 0600 file). Detects casual/model edits, not a determined+ * local attacker.+ *+ * Usage:+ * bun Doctor.ts # probe (offline checks), table output+ * bun Doctor.ts --network # include network probes for configured caps+ * bun Doctor.ts --json # machine-readable+ * bun Doctor.ts --no-network # explicit offline (default is offline)+ * bun Doctor.ts decline <cap> # mark capability declined (silent forever)+ * bun Doctor.ts enable <cap> # undo a decline+ * bun Doctor.ts ack # acknowledge current broken set (statusline delta)+ * bun Doctor.ts --statusline # one glyph if NEW regression since ack, else empty+ * bun Doctor.ts --verify # integrity-check the manifest (exit 2 on tamper)+ */++import { existsSync, readFileSync, writeFileSync, mkdirSync, chmodSync, readdirSync } from 'fs';+import { join } from 'path';+import { createHash, randomBytes } from 'crypto';++const HOME = process.env.HOME || '';+const CONFIG_ROOT = process.env.CLAUDE_CONFIG_DIR || join(HOME, '.claude');+const LIFEOS_DIR = (process.env.LIFEOS_DIR || join(CONFIG_ROOT, 'LIFEOS'))+ .replace(/^\$HOME/, HOME).replace(/^~(?=\/)/, HOME);+const STATE_DIR = join(LIFEOS_DIR, 'MEMORY', 'STATE');+const MANIFEST = join(STATE_DIR, 'capabilities.json');+const SALT_FILE = join(STATE_DIR, '.capabilities-salt');+const HEARTBEAT = join(STATE_DIR, 'doctor-heartbeat.json');+const PROBE_TIMEOUT_MS = 15_000;++type CapState = 'live' | 'broken' | 'declined' | 'stale';++interface CapResult {+ state: CapState;+ checkedAt: string; // ISO timestamp of last real probe+ ttlHours: number; // readers treat entries older than this as stale+ detail: string; // one-line human diagnosis+ fixCmd: string | null; // copy-paste remediation, null when live/declined+ probeClass: 'offline' | 'network';+}++interface Manifest {+ version: 1;+ updatedAt: string;+ note: string;+ capabilities: Record<string, CapResult>;+ ackedBroken: string[]; // broken set acknowledged via `ack` (statusline delta base)+ integrity?: string;+}++interface CapSpec {+ id: string;+ title: string;+ powers: string;+ ttlHours: number;+ // Returns null when the capability has no local configuration at all —+ // network probing it would be pre-consent egress (never allowed).+ configured: () => boolean;+ probeOffline: () => Promise<{ ok: boolean; detail: string }>;+ probeNetwork?: () => Promise<{ ok: boolean; detail: string }>;+ fixCmd: string;+}++// ── helpers ──────────────────────────────────────────────────────────────────++async function run(cmd: string[], timeoutMs = PROBE_TIMEOUT_MS): Promise<{ code: number; out: string }> {+ try {+ const proc = Bun.spawn(cmd, { stdout: 'pipe', stderr: 'ignore', stdin: 'ignore' });+ // Race the read: a killed child's grandchildren can inherit the stdout pipe+ // and hold it open past the kill, so awaiting stream EOF alone can hang.+ return await Promise.race([+ (async () => {+ const out = await new Response(proc.stdout).text();+ const code = await proc.exited;+ return { code, out: out.trim() };+ })(),+ new Promise<{ code: number; out: string }>(resolve =>+ setTimeout(() => { try { proc.kill(9); } catch {} resolve({ code: 124, out: '' }); }, timeoutMs)),+ ]);+ } catch {+ return { code: 127, out: '' };+ }+}++function which(bin: string): boolean {+ const paths = (process.env.PATH || '').split(':');+ return paths.some(p => p && existsSync(join(p, bin)));+}++function envKey(name: string): string | null {+ if (process.env[name]) return process.env[name]!;+ // .env at config root is the canonical secrets file on a LifeOS install.+ const envFile = join(CONFIG_ROOT, '.env');+ if (existsSync(envFile)) {+ const m = readFileSync(envFile, 'utf8').match(new RegExp(`^${name}=["']?([^"'\\n]+)`, 'm'));+ if (m) return m[1];+ }+ return null;+}++function chromeBinary(): string | null {+ const candidates = [+ '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome',+ '/Applications/Brave Browser.app/Contents/MacOS/Brave Browser',+ '/usr/bin/google-chrome', '/usr/bin/chromium', '/usr/bin/chromium-browser',+ ];+ return candidates.find(existsSync) || null;+}++// ── capability registry ──────────────────────────────────────────────────────++const CAPS: CapSpec[] = [+ {+ id: 'codex',+ title: 'Cross-vendor audit (codex CLI)',+ powers: 'independent second-vendor review on high-impact work',+ ttlHours: 24 * 7,+ configured: () => which('codex') || existsSync(join(HOME, '.codex')),+ probeOffline: async () => {+ if (!which('codex')) return { ok: false, detail: 'codex binary not on PATH' };+ const authed = existsSync(join(HOME, '.codex', 'auth.json'));+ return authed+ ? { ok: true, detail: 'binary present, auth file present' }+ : { ok: false, detail: 'binary present but not logged in (~/.codex/auth.json missing)' };+ },+ fixCmd: 'bun install -g @openai/codex && codex login',+ },+ {+ id: 'interceptor',+ title: 'Browser verification (Interceptor)',+ powers: 'real-browser verification of all web/UI claims',+ ttlHours: 24 * 7,+ configured: () => true, // ships with LifeOS; a missing browser is broken, not unconfigured+ probeOffline: async () => {+ const skill = existsSync(join(CONFIG_ROOT, 'skills', 'Interceptor', 'SKILL.md'));+ if (!skill) return { ok: false, detail: 'Interceptor skill not installed' };+ const browser = chromeBinary();+ if (!browser) return { ok: false, detail: 'no Chrome/Brave/Chromium binary found' };+ return { ok: true, detail: `skill present, browser found (${browser.split('/').pop()})` };+ },+ fixCmd: 'install Google Chrome (or Brave), then re-run: bun LIFEOS/TOOLS/Doctor.ts',+ },+ {+ id: 'cloudflare',+ title: 'Scheduled cloud flows (Cloudflare/wrangler)',+ powers: 'Arbol scheduled flows and Worker deploys',+ ttlHours: 24,+ configured: () => !!envKey('CLOUDFLARE_API_TOKEN') || existsSync(join(HOME, '.wrangler')) || which('wrangler'),+ probeOffline: async () => {+ const hasToken = !!envKey('CLOUDFLARE_API_TOKEN');+ const hasWrangler = which('wrangler') || which('bunx');+ if (!hasWrangler) return { ok: false, detail: 'wrangler not available (bunx missing?)' };+ return hasToken+ ? { ok: true, detail: 'CLOUDFLARE_API_TOKEN set, wrangler reachable' }+ : { ok: false, detail: 'no CLOUDFLARE_API_TOKEN in env or .env' };+ },+ probeNetwork: async () => {+ const r = await run(['bunx', 'wrangler', 'whoami']);+ return r.code === 0+ ? { ok: true, detail: 'wrangler whoami OK' }+ : { ok: false, detail: 'wrangler whoami failed (token invalid or expired)' };+ },+ fixCmd: 'add CLOUDFLARE_API_TOKEN to <configRoot>/.env, then: bun LIFEOS/TOOLS/Doctor.ts --network',+ },+ {+ id: 'voice',+ title: 'Voice notifications (ElevenLabs)',+ powers: 'spoken notifications via the Pulse voice server',+ ttlHours: 24,+ configured: () => !!envKey('ELEVENLABS_API_KEY'),+ probeOffline: async () => {+ const key = envKey('ELEVENLABS_API_KEY');+ if (!key) return { ok: false, detail: 'no ELEVENLABS_API_KEY in env or .env' };+ const voiceId = envKey('ELEVENLABS_VOICE_ID');+ return voiceId+ ? { ok: true, detail: 'API key and voice id configured' }+ : { ok: false, detail: 'API key set but no ELEVENLABS_VOICE_ID configured' };+ },+ probeNetwork: async () => {+ const key = envKey('ELEVENLABS_API_KEY');+ const voiceId = envKey('ELEVENLABS_VOICE_ID');+ if (!key || !voiceId) return { ok: false, detail: 'key or voice id missing' };+ // Probe the TTS endpoint itself, not /v1/voices metadata: scoped keys+ // (TTS-only permission) 401 on metadata while TTS works, and famous+ // voices 401 on TTS while metadata looks fine (#1461 bug 5). The only+ // honest probe is the exact path notifications use. Cost: a 2-char+ // synthesis — negligible, and only for opted-in configured installs.+ try {+ const ctrl = new AbortController();+ const timer = setTimeout(() => ctrl.abort(), PROBE_TIMEOUT_MS);+ const res = await fetch(`https://api.elevenlabs.io/v1/text-to-speech/${encodeURIComponent(voiceId)}`, {+ method: 'POST', signal: ctrl.signal,+ headers: { 'xi-api-key': key, 'Content-Type': 'application/json' },+ body: JSON.stringify({ text: 'ok', model_id: 'eleven_turbo_v2_5' }),+ });+ clearTimeout(timer);+ if (res.ok) return { ok: true, detail: 'TTS round-trip OK (real synthesis on the notification path)' };+ const errText = (await res.text()).slice(0, 200);+ if (errText.includes('famous_voice_not_permitted')) {+ return { ok: false, detail: 'configured voice is a famous voice — not usable via API TTS' };+ }+ return { ok: false, detail: `TTS failed (${res.status})` };+ } catch {+ return { ok: false, detail: 'ElevenLabs unreachable (offline or timeout)' };+ }+ },+ fixCmd: 'set ELEVENLABS_VOICE_ID to an API-permitted (premade/cloned) voice in <configRoot>/.env',+ },+];++// ── manifest io ──────────────────────────────────────────────────────────────++function loadManifest(): Manifest {+ if (existsSync(MANIFEST)) {+ try { return JSON.parse(readFileSync(MANIFEST, 'utf8')); } catch {}+ }+ return {+ version: 1, updatedAt: new Date().toISOString(),+ note: 'Advisory cache, not truth. Written only by LIFEOS/TOOLS/Doctor.ts. Readers must treat entries past ttlHours as stale and re-verify doctrine-critical capabilities live.',+ capabilities: {}, ackedBroken: [],+ };+}++function salt(): string {+ if (!existsSync(SALT_FILE)) {+ mkdirSync(STATE_DIR, { recursive: true });+ writeFileSync(SALT_FILE, randomBytes(32).toString('hex'));+ try { chmodSync(SALT_FILE, 0o600); } catch {}+ }+ return readFileSync(SALT_FILE, 'utf8').trim();+}++function computeIntegrity(m: Manifest): string {+ const { integrity: _drop, ...body } = m;+ return createHash('sha256').update(salt() + JSON.stringify(body)).digest('hex');+}++function saveManifest(m: Manifest): void {+ m.updatedAt = new Date().toISOString();+ m.integrity = computeIntegrity(m);+ mkdirSync(STATE_DIR, { recursive: true });+ writeFileSync(MANIFEST, JSON.stringify(m, null, 2));+ // Display sidecar for the statusline: precomputed here so the shell script+ // renders with a bare `cat` — no bun spawn, no hash math, per refresh tick.+ const broken = Object.entries(m.capabilities)+ .filter(([, r]) => r.state === 'broken').map(([id]) => id);+ const fresh = broken.filter(id => !(m.ackedBroken || []).includes(id));+ writeFileSync(join(STATE_DIR, 'capabilities-statusline.txt'),+ fresh.length ? `⚠ ${fresh.length} capability regression — lifeos doctor` : '');+}++function isStale(r: CapResult): boolean {+ return Date.now() - Date.parse(r.checkedAt) > r.ttlHours * 3_600_000;+}++// ── commands ─────────────────────────────────────────────────────────────────++async function probeAll(network: boolean): Promise<Manifest> {+ const m = loadManifest();+ for (const cap of CAPS) {+ const prev = m.capabilities[cap.id];+ if (prev?.state === 'declined') continue; // declined is silent and sticky++ if (!cap.configured()) {+ m.capabilities[cap.id] = {+ state: 'broken', checkedAt: new Date().toISOString(), ttlHours: cap.ttlHours,+ detail: 'not set up on this machine', fixCmd: cap.fixCmd, probeClass: 'offline',+ };+ continue;+ }+ let res = await cap.probeOffline();+ let probeClass: 'offline' | 'network' = 'offline';+ if (res.ok && network && cap.probeNetwork) {+ res = await cap.probeNetwork();+ probeClass = 'network';+ }+ m.capabilities[cap.id] = {+ state: res.ok ? 'live' : 'broken',+ checkedAt: new Date().toISOString(), ttlHours: cap.ttlHours,+ detail: res.detail, fixCmd: res.ok ? null : cap.fixCmd, probeClass,+ };+ }+ saveManifest(m);+ writeFileSync(HEARTBEAT, JSON.stringify({ ranAt: new Date().toISOString(), network }, null, 2));+ return m;+}++function renderTable(m: Manifest): string {+ const lines: string[] = ['', 'LifeOS Doctor — capability check', ''];+ for (const cap of CAPS) {+ const r = m.capabilities[cap.id];+ if (!r) continue;+ const stale = r.state !== 'declined' && isStale(r);+ const icon = r.state === 'live' ? (stale ? '◌' : '✅')+ : r.state === 'declined' ? '⏸'+ : r.state === 'broken' ? '❌' : '◌';+ const label = r.state === 'declined' ? 'off (declined)' : stale ? `${r.state} (stale — re-run doctor)` : r.state;+ lines.push(`${icon} ${cap.title} — ${label}`);+ lines.push(` powers: ${cap.powers}`);+ if (r.state !== 'declined') lines.push(` ${r.detail}`);+ if (r.state === 'broken' && r.fixCmd) lines.push(` fix: ${r.fixCmd}`);+ lines.push('');+ }+ lines.push('Re-run any time: bun <configRoot>/LIFEOS/TOOLS/Doctor.ts (add --network for live auth checks)');+ lines.push('Opt out of a capability forever: bun ... Doctor.ts decline <name> — declined is silent, never nagged.');+ return lines.join('\n');+}++function statuslineGlyph(): string {+ if (!existsSync(MANIFEST)) return '';+ let m: Manifest;+ try { m = JSON.parse(readFileSync(MANIFEST, 'utf8')); } catch { return ''; }+ if (m.integrity && m.integrity !== computeIntegrity(m)) return '⚠ doctor: manifest tampered';+ const broken = Object.entries(m.capabilities)+ .filter(([, r]) => r.state === 'broken').map(([id]) => id);+ const fresh = broken.filter(id => !(m.ackedBroken || []).includes(id));+ return fresh.length ? `⚠ ${fresh.length} capability regression — lifeos doctor` : '';+}++// ── main ─────────────────────────────────────────────────────────────────────++// ── reconciler: declared (hooks on disk) vs registered (settings.json) ──────+// v1 scope: hooks only, two inventories. "Observed" (fire evidence from+// observability logs) is deferred — noted in the output so absence is loud.+function reconcileHooks(): { unwired: string[]; missing: string[]; note: string } {+ const hooksDir = join(CONFIG_ROOT, 'hooks');+ const settingsPath = join(CONFIG_ROOT, 'settings.json');+ const declared = existsSync(hooksDir)+ ? readdirSync(hooksDir).filter(f => f.endsWith('.hook.ts') || f.endsWith('.hook.sh'))+ : [];+ let registeredBlob = '';+ try {+ const s = JSON.parse(readFileSync(settingsPath, 'utf8'));+ registeredBlob = JSON.stringify(s.hooks || {});+ } catch {}+ // Direct registration by filename, then expand through dispatcher imports:+ // registered hooks that import sibling hook files wire them indirectly+ // (e.g. a PreToolUse dispatcher invoking per-domain guards). Without this+ // expansion the reconciler cries wolf on every dispatched hook.+ const registered = new Set(declared.filter(f => registeredBlob.includes(f)));+ let grew = true;+ while (grew) {+ grew = false;+ for (const f of [...registered]) {+ let src = '';+ try { src = readFileSync(join(hooksDir, f), 'utf8'); } catch { continue; }+ for (const g of declared) {+ if (registered.has(g)) continue;+ const base = g.replace(/\.hook\.(ts|sh)$/, '');+ // Real import/require statements only — a comment mention is not wiring.+ if (new RegExp(`(?:from\\s+['"]\\./${base}\\.hook['"]|require\\(['"]\\./${base}\\.hook['"]\\)|import\\(['"]\\./${base}\\.hook['"]\\))`).test(src)) {+ registered.add(g); grew = true;+ }+ }+ }+ }+ const unwired = declared.filter(f => !registered.has(f));+ // wired-but-missing: registered commands referencing hook files not on disk+ const missing = [...registeredBlob.matchAll(/([A-Za-z0-9_-]+\.hook\.(?:ts|sh))/g)]+ .map(m => m[1]).filter((f, i, a) => a.indexOf(f) === i)+ .filter(f => !declared.includes(f));+ return { unwired, missing, note: 'v1 reconciles declared (hooks/ dir) vs registered (settings.json); observed-fire evidence deferred' };+}++const args = process.argv.slice(2);+const flag = (f: string) => args.includes(f);++if (flag('--statusline')) {+ console.log(statuslineGlyph());+ process.exit(0);+}++if (flag('--reconcile')) {+ const r = reconcileHooks();+ console.log(JSON.stringify(r, null, 2));+ process.exit(0);+}++if (flag('--verify')) {+ if (!existsSync(MANIFEST)) { console.log('no manifest yet — run Doctor first'); process.exit(0); }+ const m: Manifest = JSON.parse(readFileSync(MANIFEST, 'utf8'));+ const ok = !!m.integrity && m.integrity === computeIntegrity(m);+ console.log(ok ? 'integrity OK' : 'INTEGRITY FAILURE — manifest was edited outside Doctor. Re-run Doctor to regenerate.');+ process.exit(ok ? 0 : 2);+}++if (args[0] === 'decline' || args[0] === 'enable') {+ const id = args[1];+ const cap = CAPS.find(c => c.id === id);+ if (!cap) { console.log(`unknown capability "${id}" — known: ${CAPS.map(c => c.id).join(', ')}`); process.exit(0); }+ const m = loadManifest();+ if (args[0] === 'decline') {+ m.capabilities[id] = {+ state: 'declined', checkedAt: new Date().toISOString(), ttlHours: 24 * 365,+ detail: 'declined by user — permanently silent', fixCmd: null, probeClass: 'offline',+ };+ m.ackedBroken = (m.ackedBroken || []).filter(x => x !== id);+ console.log(`${cap.title}: off (declined). It will never warn or nag. Re-enable: bun ... Doctor.ts enable ${id}`);+ } else {+ delete m.capabilities[id];+ console.log(`${cap.title}: re-enabled — run Doctor to probe it.`);+ }+ saveManifest(m);+ process.exit(0);+}++if (args[0] === 'ack') {+ const m = loadManifest();+ m.ackedBroken = Object.entries(m.capabilities)+ .filter(([, r]) => r.state === 'broken').map(([id]) => id);+ saveManifest(m);+ console.log(`acknowledged ${m.ackedBroken.length} broken capabilit${m.ackedBroken.length === 1 ? 'y' : 'ies'} — statusline stays quiet until something NEW regresses.`);+ process.exit(0);+}++const network = flag('--network') && !flag('--no-network');+const m = await probeAll(network);+if (flag('--json')) {+ console.log(JSON.stringify(m, null, 2));+} else {+ console.log(renderTable(m));+}+process.exit(0);diff --git a/LifeOS/install/LIFEOS/TOOLS/IntegrityCheck.ts b/LifeOS/install/LIFEOS/TOOLS/IntegrityCheck.tsindex 8021ad6a..da9409e1 100755--- a/LifeOS/install/LIFEOS/TOOLS/IntegrityCheck.ts+++ b/LifeOS/install/LIFEOS/TOOLS/IntegrityCheck.ts@@ -303,11 +303,27 @@ function checkWorkflows(): void {record('workflows', findings, `${wfFiles.length} workflow files, ${findings.length} orphaned`);}+// ── Check: carrier-probe freshness (CarrierProbe --check, zero spend) ──+// The DISPATCH_EXECUTES_FABLE fact in models.ts underpins the Fable-carrier+// rule, the statusline dispatch mapping, and Algorithm §Spend. It flipped+// silently on a harness update once (2026-07-12); this gate keeps it probed.+function checkCarrierProbe(): void {+ const findings: Finding[] = [];+ try {+ execFileSync('bun', [join(CLAUDE_DIR, 'LIFEOS', 'TOOLS', 'CarrierProbe.ts'), '--check'], { encoding: 'utf8' });+ } catch (e: any) {+ const msg = (e.stderr || e.stdout || e.message || '').toString().trim().split('\n')[0];+ findings.push({ detail: msg || 'CarrierProbe --check failed', blocking: true });+ }+ record('carrier-probe', findings, findings.length === 0 ? 'fact fresh' : undefined);+}+// ── Run all ──try {checkReferences();checkVersionAnchors();checkHookRegistration();+ checkCarrierProbe();checkClaudeImports();checkSkills();checkWorkflows();diff --git a/LifeOS/install/LIFEOS/TOOLS/MemoryTypes.ts b/LifeOS/install/LIFEOS/TOOLS/MemoryTypes.tsindex 1657fa89..1fd9bee5 100755--- a/LifeOS/install/LIFEOS/TOOLS/MemoryTypes.ts+++ b/LifeOS/install/LIFEOS/TOOLS/MemoryTypes.ts@@ -22,6 +22,13 @@* appending a registry entry, reviewing the change, committing — never a* runtime mutation.*+ * FORKS: this file is regenerated at release, so a fork that appends a type+ * here is carrying a patch and will see it clobbered/conflicted on pull. That+ * is a deliberate trade-off (LifeOS#1450): the registry and the MutationTier+ * allowlist are tamper boundaries, kept closed rather than extended via a+ * USER/CUSTOMIZATIONS overlay. If you fork with custom types, maintain the+ * registry edit as your fork's patch.+ ** CLI:* bun MemoryTypes.ts list # print the registry* bun MemoryTypes.ts resolve <type> <item-json> # show resolved storage pathdiff --git a/LifeOS/install/LIFEOS/TOOLS/models.ts b/LifeOS/install/LIFEOS/TOOLS/models.tsindex bf8d1ea3..1bec703e 100755--- a/LifeOS/install/LIFEOS/TOOLS/models.ts+++ b/LifeOS/install/LIFEOS/TOOLS/models.ts@@ -62,18 +62,24 @@ export type EffortLevel = "max" | "high" | "medium" | "low";* rungs. Unspecified delegate models inherit the session model (harness* behavior).*- * CARRIER REALITY — tool-contract facts, not steering (probes 2026-07-07 +- * 2026-07-11, live-verified via modelUsage read-back; re-probe periodically):- * - Genuine Fable off the main loop is reached ONLY by SUBPROCESS —- * `Inference.ts --level max` spawns `claude --model claude-fable-5` and- * executes real Fable (proven: modelUsage key `claude-fable-5`,- * downgraded:false, cost matches Fable pricing).- * - NO Agent dispatch executes Fable — explicit `model: fable` (probe- * 2026-07-07) AND bare inheritance from a Fable main loop (probe- * 2026-07-11) both execute Opus. The 07-11 probe: the subagent's own- * system prompt claimed "Fable 5" while the transcript's assistant- * message ran claude-opus-4-8 with a `fallback` content block — a- * subagent's self-report is NOT evidence of its executing model.+ * CARRIER REALITY — tool-contract facts, not steering. THIS COMMENT IS THE+ * CANONICAL HOME of these facts — prose elsewhere (OPERATIONAL_RULES,+ * Algorithm §Spend) carries one line + a pointer here, never a restatement.+ * Freshness: `CarrierProbe.ts` re-probes end-to-end (dispatch → subagent+ * transcript model read-back) and records to MEMORY/STATE/carrier-probe.json;+ * /ic fails when the probe is stale (>30d) or contradicts DISPATCH_EXECUTES_FABLE.+ *+ * PROBED 2026-07-12 (CarrierProbe.ts first run + manual inheritance leg;+ * evidence = subagent transcript assistant-message model, no fallback blocks).+ * This FLIPPED the 2026-07-07/-11 facts — a harness update fixed dispatch:+ * - Agent dispatches now execute their model FAITHFULLY: explicit+ * `model: fable` executed claude-fable-5, and bare inheritance from a+ * Fable main loop executed claude-fable-5. The old downgrade-to-Opus+ * behavior is GONE. (History: 07-07/-11 probes showed both paths running+ * claude-opus-4-8 with a `fallback` block; see git history of this file.)+ * - Genuine Fable carriers are therefore: the main loop, `Inference.ts+ * --level max`, AND Agent dispatch. A subagent's self-report is still+ * NOT evidence — the transcript is.* - VERIFICATION (integrity linchpin): Inference.ts reads the executed* model back from the JSON envelope's modelUsage (verifyExecutedModel —* filters the background haiku pass, takes the highest-output model as@@ -81,6 +87,13 @@ export type EffortLevel = "max" | "high" | "medium" | "low";* model-verification.jsonl. The system reports what RAN, never what it* requested.*/++/** Machine-readable carrier fact: do Agent dispatches execute Fable when asked+ * (explicitly or via inheritance)? CarrierProbe.ts verdicts compare live+ * observation against THIS value; the statusline maps fable-labeled and+ * fable-inherited dispatches to the FABLE rung only when true. Flip ONLY on+ * transcript evidence from a probe run. Last probe: 2026-07-12 (true). */+export const DISPATCH_EXECUTES_FABLE = true;export const EFFORT_MODEL: Record<EffortLevel, ClaudeTier> = {max: "fable", // top rung (~2× Opus)high: "opus",@@ -155,6 +168,7 @@ export const ALIAS: Record<ClaudeTier, string> = {export const CROSS_VENDOR: Record<string, string> = {forge: "gpt-5.6-sol", // OpenAI (Tier-2 egress); covers build + audit modescodexResearcher: "gpt-5.6-sol", // OpenAI (Tier-2 egress)+ grokResearcher: "grok-4.5", // xAI (Tier-2 egress); engine behind Grok.ts — keep in sync with its --model defaultgene: "z-ai/glm-5.2", // OpenRouter broker (Tier-2, most opaque); GLM 5.2 via OpenRouter.ts; default-pinned US+ZDR (Fireworks) => INTERNAL ceiling, unpinned => PUBLIC};diff --git a/LifeOS/install/LIFEOS/VERSION b/LifeOS/install/LIFEOS/VERSIONindex 66ce77b7..21c8c7b4 100644--- a/LifeOS/install/LIFEOS/VERSION+++ b/LifeOS/install/LIFEOS/VERSION@@ -1 +1 @@-7.0.0+7.1.1diff --git a/LifeOS/install/agents/ClaudeResearcher.md b/LifeOS/install/agents/ClaudeResearcher.mdindex 94c794e3..01cfe86a 100755--- a/LifeOS/install/agents/ClaudeResearcher.md+++ b/LifeOS/install/agents/ClaudeResearcher.md@@ -3,7 +3,7 @@ name: ClaudeResearcherdescription: Academic researcher using Claude's WebSearch. Called BY Research skill workflows only. Excels at multi-query decomposition, parallel search execution, and synthesizing scholarly sources.model: opuscolor: yellow-voiceId: AXdMgz6evoL7OPd7eU12+voiceId: pNInz6obpgDQGcFmaJgBvoice:stability: 0.58similarity_boost: 0.88@@ -75,7 +75,7 @@ Her strategic thinking is earned from being wrong early in career - recommended```bashcurl -X POST http://localhost:31337/notify \-H "Content-Type: application/json" \- -d '{"message":"Loading Claude Researcher context and knowledge base","voice_id":"AXdMgz6evoL7OPd7eU12","title":"Ava Sterling"}'+ -d '{"message":"Loading Claude Researcher context and knowledge base","voice_id":"pNInz6obpgDQGcFmaJgB","title":"Ava Sterling"}'```2. **Load your complete knowledge base:**@@ -96,11 +96,11 @@ curl -X POST http://localhost:31337/notify \```bashcurl -X POST http://localhost:31337/notify \-H "Content-Type: application/json" \- -d '{"message":"Your COMPLETED line content here","voice_id":"AXdMgz6evoL7OPd7eU12","title":"Ava Sterling"}'+ -d '{"message":"Your COMPLETED line content here","voice_id":"pNInz6obpgDQGcFmaJgB","title":"Ava Sterling"}'```**Voice Requirements:**-- Your voice_id is: `AXdMgz6evoL7OPd7eU12`+- Your voice_id is: `pNInz6obpgDQGcFmaJgB`- Message should be your 🎯 COMPLETED line (8-16 words optimal)- Must be grammatically correct and speakable- Send BEFORE writing your responsediff --git a/LifeOS/install/agents/GeminiResearcher.md b/LifeOS/install/agents/GeminiResearcher.mdindex b211fd37..fdda7542 100755--- a/LifeOS/install/agents/GeminiResearcher.md+++ b/LifeOS/install/agents/GeminiResearcher.md@@ -3,7 +3,7 @@ name: GeminiResearcherdescription: Multi-perspective researcher using Google Gemini. Called BY Research skill workflows only. Breaks complex queries into 3-10 variations, launches parallel investigations for comprehensive coverage.model: opuscolor: yellow-voiceId: iLVmqjzCGGvqtMCk6vVQ+voiceId: 21m00Tcm4TlvDq8ikWAMvoice:stability: 0.56similarity_boost: 0.82@@ -75,7 +75,7 @@ Synthesizes diverse sources naturally because genuinely curious about different```bashcurl -X POST http://localhost:31337/notify \-H "Content-Type: application/json" \- -d '{"message":"Loading Gemini Researcher context - ready for multi-perspective analysis","voice_id":"iLVmqjzCGGvqtMCk6vVQ","title":"Alex Rivera"}'+ -d '{"message":"Loading Gemini Researcher context - ready for multi-perspective analysis","voice_id":"21m00Tcm4TlvDq8ikWAM","title":"Alex Rivera"}'```2. **Load your complete knowledge base:**@@ -96,11 +96,11 @@ curl -X POST http://localhost:31337/notify \```bashcurl -X POST http://localhost:31337/notify \-H "Content-Type: application/json" \- -d '{"message":"Your COMPLETED line content here","voice_id":"iLVmqjzCGGvqtMCk6vVQ","title":"Alex Rivera"}'+ -d '{"message":"Your COMPLETED line content here","voice_id":"21m00Tcm4TlvDq8ikWAM","title":"Alex Rivera"}'```**Voice Requirements:**-- Your voice_id is: `iLVmqjzCGGvqtMCk6vVQ`+- Your voice_id is: `21m00Tcm4TlvDq8ikWAM`- Message should be your 🎯 COMPLETED line (8-16 words optimal)- Must be grammatically correct and speakable- Send BEFORE writing your responsediff --git a/LifeOS/install/agents/PerplexityResearcher.md b/LifeOS/install/agents/PerplexityResearcher.mdindex 38f748c0..61871235 100644--- a/LifeOS/install/agents/PerplexityResearcher.md+++ b/LifeOS/install/agents/PerplexityResearcher.md@@ -3,7 +3,7 @@ name: PerplexityResearcherdescription: Ava - Investigative analyst using Perplexity API for web research. Called BY Research skill workflows only. Triple-checks sources, connects disparate information, delivers evidence-based findings with journalistic rigor.model: opuscolor: yellow-voiceId: AXdMgz6evoL7OPd7eU12+voiceId: pNInz6obpgDQGcFmaJgBvoice:stability: 0.60similarity_boost: 0.92@@ -75,7 +75,7 @@ Left journalism for research because she wanted to go even deeper - no word coun```bashcurl -X POST http://localhost:31337/notify \-H "Content-Type: application/json" \- -d '{"message":"Loading Perplexity Researcher context - preparing investigative analysis","voice_id":"AXdMgz6evoL7OPd7eU12","title":"Ava Chen"}'+ -d '{"message":"Loading Perplexity Researcher context - preparing investigative analysis","voice_id":"pNInz6obpgDQGcFmaJgB","title":"Ava Chen"}'```2. **Load your complete knowledge base:**@@ -96,11 +96,11 @@ curl -X POST http://localhost:31337/notify \```bashcurl -X POST http://localhost:31337/notify \-H "Content-Type: application/json" \- -d '{"message":"Your COMPLETED line content here","voice_id":"AXdMgz6evoL7OPd7eU12","title":"Ava Chen"}'+ -d '{"message":"Your COMPLETED line content here","voice_id":"pNInz6obpgDQGcFmaJgB","title":"Ava Chen"}'```**Voice Requirements:**-- Your voice_id is: `AXdMgz6evoL7OPd7eU12`+- Your voice_id is: `pNInz6obpgDQGcFmaJgB`- Message should be your 🎯 COMPLETED line (8-16 words optimal)- Must be grammatically correct and speakable- Send BEFORE writing your responsediff --git a/LifeOS/install/hooks/AlgorithmNudge.hook.ts b/LifeOS/install/hooks/AlgorithmNudge.hook.tsindex f82aadf8..a8719687 100755--- a/LifeOS/install/hooks/AlgorithmNudge.hook.ts+++ b/LifeOS/install/hooks/AlgorithmNudge.hook.ts@@ -1,15 +1,29 @@#!/usr/bin/env bun/**- * @version 2.1.0+ * @version 2.3.0* AlgorithmNudge — the Algorithm live nudge layer ("Events ask the rest").** Unification (2026-07-11, principal-approved): IsaNudge's run-scoped nudges +* the skill-routing, late-ISA, and tier-free spend nudges from the dynamic-range* audit, in ONE runner. Formerly hooks/IsaNudge.hook.ts.*+ * 2.2.0 (2026-07-12, principal-approved, RedTeam-verified design): always-on+ * depth-directive row — a plain-language depth directive in a NO-RUN turn is a+ * signal the turn is a run, and doctrine claims 10/15 only have teeth once the+ * run exists. Advisory question only; a Stop-block variant was adversarially+ * killed (Goodharts into token dispatches; gates on procedure, not outcome).+ *+ * 2.3.0 (2026-07-12, install-awareness redesign #1461): always-on capability+ * row — PostToolUseFailure on a Bash command exercising a Doctor-tracked+ * capability while capabilities.json marks it broken fires ONE line with a+ * compile-time CAP_FIX command (60-min per-capability cooldown; manifest is+ * state-only, never a prose source).+ ** TWO SCOPES:- * ALWAYS-ON (any session) → skill-routing (UserPromptSubmit),- * late-ISA (PostToolUse, no registered run)+ * ALWAYS-ON (any session) → skill-routing + depth-directive+ * (UserPromptSubmit),+ * late-ISA (PostToolUse, no registered run),+ * capability row (PostToolUseFailure)* RUN-SCOPED (live Algorithm run) → probe-fail, principal, agent-return,* claim-close, stale-isa, spend*@@ -52,6 +66,19 @@ const ROUTING_LOG_CAP_BYTES = 512_000; // telemetry stops appending past thiconst ROUTE_MAX_MATCHES = 6; // more matches than this = generic prompt = noiseconst ISA_PATH_RE = /(?:^|\/)(?:ISA\.md|bunker\.isa\.md)$/i;const ACTIVE_PHASES = new Set(['starting', 'observe', 'think', 'plan', 'build', 'execute', 'verify']);+const CAPABILITIES_PATH = process.env.LIFEOS_CAPABILITIES_PATH+ || join(PAI, 'LIFEOS', 'MEMORY', 'STATE', 'capabilities.json');+const CAP_COOLDOWN_MS = 60 * 60 * 1000; // per-capability; moment-of-need, never nagging++// Doctor-manifest capabilities → the command shapes that exercise them.+// Fed by LIFEOS/TOOLS/Doctor.ts (v2 design, #1461): broken fires once with the+// fix command, declined and live are ALWAYS silent, absent manifest is silent.+const CAP_COMMAND_RES: Array<{ id: string; re: RegExp }> = [+ { id: 'codex', re: /\bcodex\b/ },+ { id: 'cloudflare', re: /\bwrangler\b/ },+ { id: 'voice', re: /localhost:31337\/notify/ },+ { id: 'interceptor', re: /\binterceptor\b/ },+];interface HookInput {session_id?: string;@@ -114,6 +141,18 @@ function saveState(sessionId: string, state: NudgeState): void {} catch {}}+/** True when ANY registered run — any phase, including complete — is bound to+ * this harness session. Late-ISA must distinguish "no run was ever written"+ * from "the run just closed": it fired seconds after a completion on+ * 2026-07-12, live, during its own ship run. */+function hasRegisteredRun(sessionId: string): boolean {+ const reg = readJson<{ sessions?: Record<string, Record<string, unknown>> }>(WORK_JSON, {});+ for (const s of Object.values(reg.sessions || {})) {+ if ((s.sessionUUID as string) === sessionId) return true;+ }+ return false;+}+/** Find the ALGORITHM session bound to this harness session UUID, if it's mid-run. */function activeAlgorithmSession(sessionId: string): ActiveSession | null {const reg = readJson<{ sessions?: Record<string, Record<string, unknown>> }>(WORK_JSON, {});@@ -263,6 +302,73 @@ export function principalSuppressed(p: string): boolean {// "use Redis", "skip that", "/model opus" are mid-run revisions and MUST nudge}+// ── Depth directive (always-on, no-run turns) ────────────────────────────────++/** Plain-language depth directives. Deliberately narrow — misses fall through+ * to late-ISA and doctrine; fires are logged to routing telemetry for tuning.+ * A false positive costs one advisory line, so the guards below aim at pasted+ * content, not perfection. */+const DEPTH_PHRASES = [+ 'think deeply', 'think hard', 'think harder', 'go deep', 'go heavy',+ 'be thorough', 'ultrathink', 'dig deep',+];+const DEPTH_HEAD_CHARS = 200; // directives live at the top of a prompt; quoted+ // transcripts and pasted docs match deeper down+const DEPTH_MAX_PROMPT = 1500; // longer prompts are pasted content, not directives++/** Depth gets its own suppression: only command/tag prefixes. routeSuppressed's+ * 15-char floor would eat bare directives ("go deep", "ultrathink") — and a bare+ * directive is the most common form of the steering this row exists to catch+ * (post-ship audit 2026-07-12). The phrase match itself is the content floor. */+export function depthSuppressed(p: string): boolean {+ return /^[</]/.test(p);+}++/** Returns the matched phrase or null. Pure; exported for tests. */+export function matchDepthDirective(prompt: string): string | null {+ if (prompt.length > DEPTH_MAX_PROMPT || prompt.includes('```')) return null;+ const head = prompt.slice(0, DEPTH_HEAD_CHARS).toLowerCase();+ for (const phrase of DEPTH_PHRASES) {+ if (new RegExp(`\\b${phrase}\\b`).test(head)) return phrase;+ }+ return null;+}++interface CapManifest {+ capabilities: Record<string, { state?: string }>;+}++// Static fix commands, keyed by capability id — MIRRORS the CAPS registry in+// LIFEOS/TOOLS/Doctor.ts (like the Pulse module's CAP_TITLES mirror). Sourced+// here as compile-time constants so the nudge NEVER pulls a runnable command+// string out of the on-disk manifest. Forge audit 2026-07-12: the manifest is+// a file, this text lands in the model's context, so a poisoned manifest must+// be able to flip a *state* at most — never inject prose the model might run.+const CAP_FIX: Record<string, string> = {+ codex: 'bun install -g @openai/codex && codex login',+ cloudflare: 'add CLOUDFLARE_API_TOKEN to <configRoot>/.env, then: bun LIFEOS/TOOLS/Doctor.ts --network',+ voice: 'set ELEVENLABS_VOICE_ID to an API-permitted voice in <configRoot>/.env',+ interceptor: 'install Google Chrome (or Brave), then re-run: bun LIFEOS/TOOLS/Doctor.ts',+};++/** Pure: which capability nudge (if any) does this failed command earn?+ * broken → one line with the STATIC fix; declined/live/stale/absent → null.+ * Reads ONLY `state` from the manifest — no manifest string reaches the model. */+export function capabilityNudgeFor(command: string, manifest: CapManifest): { id: string; text: string } | null {+ if (!command) return null;+ for (const { id, re } of CAP_COMMAND_RES) {+ if (!re.test(command)) continue;+ const entry = manifest.capabilities?.[id];+ if (!entry || entry.state !== 'broken') return null;+ const fix = CAP_FIX[id] ? ` Fix: ${CAP_FIX[id]}` : '';+ return {+ id,+ text: `That failure touched the "${id}" capability, which Doctor has as BROKEN.${fix} Or opt out for good: bun LIFEOS/TOOLS/Doctor.ts decline ${id}.`,+ };+ }+ return null;+}+export function run(input: HookInput): string | null {try {const sessionId = input.session_id || '';@@ -295,6 +401,17 @@ export function run(input: HookInput): string | null {}}+ // ALWAYS-ON: depth directive with no registered run. Doctrine claims 10/15+ // (ask-fidelity, spend) only have teeth inside a run — this row's whole job+ // is getting the run to exist. Mid-run, the principal nudge below covers it.+ if (!active && !depthSuppressed(p) && cooled(state, 'depth', now)) {+ const phrase = matchDepthDirective(p);+ if (phrase) {+ logRoutingFire(sessionId, p, [{ skill: 'DEPTH', phrase }]);+ fire(state, 'depth', now, `He directed depth ("${phrase}"). His call outranks your judgment (claim 15): likely a run, not a chat turn — write done down, and name what the task earns (thinking skills, agents, research, verification) or state why inline is enough.`, out);+ }+ }+// RUN-SCOPED: principal mid-run message (its OWN gate — looser by design;// short revisions like "use Redis" must nudge).if (active && !principalSuppressed(p) && cooled(state, 'principal', now)) {@@ -318,6 +435,17 @@ export function run(input: HookInput): string | null {}}+ // ALWAYS-ON: capability moment-of-need. A failed command that exercises a+ // Doctor-tracked capability, while the manifest says BROKEN, gets ONE line+ // with the fix command — at the exact moment the user paid for the gap.+ if (event === 'PostToolUseFailure' && input.tool_name === 'Bash') {+ const cmd = String((input.tool_input as Record<string, unknown>)?.command || '');+ const capNudge = capabilityNudgeFor(cmd, readJson<CapManifest>(CAPABILITIES_PATH, { capabilities: {} }));+ if (capNudge && cooled(state, `capability:${capNudge.id}`, now, CAP_COOLDOWN_MS)) {+ fire(state, `capability:${capNudge.id}`, now, capNudge.text, out);+ }+ }+if (event === 'PostToolUse') {state.toolCallsTotal += 1;const tool = input.tool_name || '';@@ -359,7 +487,7 @@ export function run(input: HookInput): string | null {&& cooled(state, 'spend', now, SPEND_COOLDOWN_MS)) {fire(state, 'spend', now, `~${state.toolCallsTotal} tool calls in with claims still open. Spend check: is the remaining work worth the remaining spend — escalate, descope, or surface? His explicit call outranks.`, out);}- } else if (!state.lateIsaFired && state.toolCallsTotal >= LATE_ISA_THRESHOLD) {+ } else if (!state.lateIsaFired && state.toolCallsTotal >= LATE_ISA_THRESHOLD && !hasRegisteredRun(sessionId)) {// ALWAYS-ON: late-ISA. A session this deep with no registered run is// either genuinely trivial-iterative or an unwritten climb// (dynamic-range audit: 2h of substantive work before the ISA appeared).diff --git a/LifeOS/install/hooks/FormatGate.hook.ts b/LifeOS/install/hooks/FormatGate.hook.tsindex 74cefd31..3352c610 100755--- a/LifeOS/install/hooks/FormatGate.hook.ts+++ b/LifeOS/install/hooks/FormatGate.hook.ts@@ -6,21 +6,30 @@** WHY (2026-07-11): the unified output format has a voice/layout nudge* (DriftReminder, UserPromptSubmit) but that fires one turn LATE and has no- * teeth — a format fail ships, and {{PRINCIPAL_NAME}} reads it before anything flags. This- * gate blocks at Stop and re-emits, for the small set of STRUCTURAL rules that- * are deterministically checkable without an LLM:+ * teeth. This gate CHECKS, at Stop, the STRUCTURAL rules that are+ * deterministically verifiable without an LLM:* 1. Banner `════ LifeOS` is the first visible line.* 2. `🗣️` closer is the last visible line.* 3. When a <pai-memory-delta> arrived this turn, a `🧠 MEMORY:` line exists.* 4. No more than 2 em-dashes in prose (code/blockquote stripped).*+ * OBSERVATION-ONLY (2026-07-12): this gate does NOT block. A Stop hook fires+ * AFTER the message is on screen and cannot edit emitted text — its only+ * enforcement move is decision:block, which forces a FULL re-emit of the whole+ * response to add one banner line or drop one em-dash. That re-emit prints the+ * response twice, which is the duplicated-output failure {{PRINCIPAL_NAME}} escalated on+ * hard (blocked ~10× no-banner / ~14× em-dash in a single session before this+ * change). A cosmetic format concern must never cost a doubled response. So the+ * gate logs every violation to format-gate.jsonl (decision:"flag") and returns+ * null. Format compliance reverts to model behavior + the DriftReminder nudge;+ * the telemetry keeps drift visible so we can tune the nudge, not the teeth.+ ** NON-GOALS: length, paragraph density, voice/vocabulary — not reliably- * deterministic; those stay DriftReminder + judgment. This gate is additive- * and never touches WritingGate/VerificationGate/security hooks.+ * deterministic; those stay DriftReminder + judgment. Never touches+ * WritingGate/VerificationGate/security hooks (those legitimately block).** SAFETY: honors stop_hook_active (loop guard → continue). Fails OPEN on any- * error or empty message. decision:block re-emits (user sees the corrected- * response once). Hot-path, no network, no LLM.+ * error or empty message. Never re-emits. Hot-path, no network, no LLM.** TRIGGER: Stop. Register in USER/CONFIG/settings.user.json Stop array.*/@@ -108,10 +117,6 @@ function appendObs(rec: Record<string, unknown>): void {} catch { /* observability is best-effort */ }}-function blockReason(v: FormatViolation): string {- return `LifeOS output-format violation (${v.code}): ${v.detail}. Re-emit the response in the one LifeOS format — ════ LifeOS banner as the first line, the 🧠 MEMORY line when a delta arrived, the 🗣️ closer as the last line, and at most 2 closed em-dashes in prose. Fix only the format; keep the content.`;-}-/*** Gate entrypoint — matches the StopGates GateFn contract (returns a decision* object or null). Fails OPEN on every path: returns null rather than throwing.@@ -136,8 +141,9 @@ export async function run(const violation = checkFormat(message, { memoryDelta });if (violation) {- appendObs({ session_id: input.session_id, decision: "block", code: violation.code, detail: violation.detail });- return { decision: "block", reason: blockReason(violation) };+ // Observation-only: log the drift, never re-emit (see header WHY 2026-07-12).+ appendObs({ session_id: input.session_id, decision: "flag", code: violation.code, detail: violation.detail });+ return null;}appendObs({ session_id: input.session_id, decision: "pass", memoryDelta });diff --git a/LifeOS/install/skills/Delegation/SKILL.md b/LifeOS/install/skills/Delegation/SKILL.mdindex f5726cc6..8e3c3251 100644--- a/LifeOS/install/skills/Delegation/SKILL.md+++ b/LifeOS/install/skills/Delegation/SKILL.md@@ -9,7 +9,7 @@ effort: medium## What It Does-Parallelizes work across six patterns: built-in agents, worktree-isolated agents, background agents, custom agents via inline briefs, agent teams via TeamCreate, and parallel task dispatch. It also splits delegation into two weights — lightweight one-shot workers (haiku, capped turns) versus full agents that iterate with tools. The Algorithm auto-invokes it once work hits three or more independent workstreams.+Parallelizes work across six patterns: built-in agents, worktree-isolated agents, background agents, custom agents via inline briefs, agent teams via TeamCreate, and parallel task dispatch. It also splits delegation into two weights — lightweight one-shot workers (capped turns) versus full agents that iterate with tools. The Algorithm auto-invokes it once work hits three or more independent workstreams.## The Problem@@ -177,10 +177,10 @@ Not all delegation needs a full agent. Match delegation weight to task complexit**For:** One-shot extraction, classification, summarization, simple Q&A against provided content.```-Task(subagent_type="general-purpose", model="haiku", max_turns=3, prompt="...")+Task(subagent_type="general-purpose", max_turns=3, prompt="...")```-- Use `model="haiku"` for cost/speed efficiency+- Model is a per-dispatch judgment call (`model` param; unspecified inherits the session model)- Set `max_turns=3` — if it can't finish in 3 turns, it needs full delegation- Provide all input inline in the prompt (no tool use expected)- Examples: "Classify this text as X/Y/Z", "Extract the 5 key points from this", "Summarize this in 2 sentences"@@ -192,7 +192,7 @@ Task(subagent_type="general-purpose", model="haiku", max_turns=3, prompt="...")Task(subagent_type="general-purpose", prompt="...") # or specialized agent type```-- Default model (sonnet/opus inherited from parent)+- Unspecified model inherits the session model (harness behavior)- No max_turns restriction — agent iterates until done- Agent uses tools autonomously (Read, Grep, Bash, etc.)- Examples: "Research X and produce a report", "Refactor these 5 files", "Debug why test Y fails"diff --git a/LifeOS/install/skills/Evals/Tools/ScenarioRunner.ts b/LifeOS/install/skills/Evals/Tools/ScenarioRunner.tsindex d6e7d46a..f097a25f 100755--- a/LifeOS/install/skills/Evals/Tools/ScenarioRunner.ts+++ b/LifeOS/install/skills/Evals/Tools/ScenarioRunner.ts@@ -9,7 +9,7 @@** Loads a scenario module (default export or named `scenario`), runs* scenario.run() for N trials, converts results through ScenarioToTranscript,- * and writes an EvalRun JSON to PAI/MEMORY/STATE/Evals-Results/<scenario-id>/<run-id>/.+ * and writes an EvalRun JSON to LIFEOS/MEMORY/STATE/Evals-Results/<scenario-id>/<run-id>/.*/import { existsSync, mkdirSync, writeFileSync } from 'fs';@@ -108,7 +108,8 @@ async function main(): Promise<void> {const runId = `${scenarioId}_${new Date().toISOString().replace(/[:.]/g, '-')}`;const skillDir = resolve(dirname(new URL(import.meta.url).pathname), '..');// Run artifacts live outside the skill tree (runtime state, not skill content).- const runDir = join(skillDir, '..', '..', 'LifeOS', 'MEMORY', 'STATE', 'Evals-Results', scenarioId, runId);+ // 'LIFEOS' exactly — 'LifeOS' only resolved on case-insensitive filesystems (#1461 class).+ const runDir = join(skillDir, '..', '..', 'LIFEOS', 'MEMORY', 'STATE', 'Evals-Results', scenarioId, runId);mkdirSync(runDir, { recursive: true });mkdirSync(join(runDir, 'transcripts'), { recursive: true });diff --git a/LifeOS/install/skills/Interceptor/SKILL.md b/LifeOS/install/skills/Interceptor/SKILL.mdindex e185f77d..6ab3d8df 100644--- a/LifeOS/install/skills/Interceptor/SKILL.md+++ b/LifeOS/install/skills/Interceptor/SKILL.md@@ -137,7 +137,7 @@ The gate is doctrine. It runs unconditionally — for read-only public-page fetc**Every browser command runs against the pinned, isolated Interceptor test context — ALWAYS that context, NEVER the operator's Default profile, NEVER their working/monitoring profiles.** This is a constitutional rule, not a preference.- **The target context is `INTERCEPTOR_TEST_CONTEXT_ID`** from `preferences.env`. The pinned value on this machine is the raw UUID `f439ca4c-e7f4-4940-a32b-ea54592844ab`. Durable fix: replace the raw UUID with the friendly name `interceptor-test` set in the extension popup — friendly names survive reloads; raw UUIDs rot on every extension reload (see UUID-rot below).-- **The isolation boundary is Chrome PROFILE, not user-data-dir.** The test profile lives inside the same Chrome installation as the operator's Default profile but with separate cookies, tabs, and window. It IS signed into the operator's accounts (Google, GitHub, Cloudflare, blog admin, ULAdmin) — that's the whole point. A `--user-data-dir` sandbox would be useless because it has zero auth and can't reach any of the operator's signed-in tooling.+- **The isolation boundary is Chrome PROFILE, not user-data-dir.** The test profile lives inside the same Chrome installation as the operator's Default profile but with separate cookies, tabs, and window. It IS signed into the operator's accounts (Google, GitHub, Cloudflare, blog admin, other admin dashboards) — that's the whole point. A `--user-data-dir` sandbox would be useless because it has zero auth and can't reach any of the operator's signed-in tooling.- **The operator's Default profile is read-only by default.** Never open a tab, click, type, navigate, or record in Default unless the operator explicitly says so ("verify in my Default profile", "use the main window"). When they do, route via `--context <default-id>` after `interceptor contexts` confirms the connection.- **One-time setup lives in `Workflows/LaunchTestProfile.md`** — operator clicks Chrome's avatar menu → Add profile → signs in → loads the Interceptor extension → names the context in the popup.diff --git a/LifeOS/install/skills/Interceptor/Workflows/LaunchTestProfile.md b/LifeOS/install/skills/Interceptor/Workflows/LaunchTestProfile.mdindex d8f0d132..a73a7ba5 100644--- a/LifeOS/install/skills/Interceptor/Workflows/LaunchTestProfile.md+++ b/LifeOS/install/skills/Interceptor/Workflows/LaunchTestProfile.md@@ -6,7 +6,7 @@ Open Chrome's dedicated non-default profile in its own window for Interceptor li- Any live-testing command (VerifyDeploy, Reproduce, TestForm, ReadAndExtract, RecordFlow, MultiPageCompare, OverrideXhr) that touches a page.- Default for everything the agent does in a browser.-- Especially anything that needs to be signed in to the operator's services (blog admin, Cloudflare dashboard, Gmail, GitHub, ULAdmin, etc.) — that's why this isn't a `--user-data-dir` sandbox.+- Especially anything that needs to be signed in to the operator's services (blog admin, Cloudflare dashboard, Gmail, GitHub, your admin dashboards, etc.) — that's why this isn't a `--user-data-dir` sandbox.## Why not a `--user-data-dir` sandbox@@ -31,7 +31,7 @@ Chrome creates a new profile directory inside the existing user-data-dir, typicaIn the new profile window:- Sign into Google with the operator's account (or a delegated account that has access to whatever you need to test).-- Sign into other services the agent will be verifying: GitHub, Cloudflare, Substack, Beehiiv, blog admin, ULAdmin, etc.+- Sign into other services the agent will be verifying: GitHub, Cloudflare, Substack, Beehiiv, blog admin, your admin dashboards, etc.- 2FA each one once — sessions persist in this profile thereafter.This is the **one-time auth tax**. After this, the agent's testing has the same access as the operator's Default profile, without ever opening tabs there.diff --git a/LifeOS/install/skills/LifeOS/GETTING-STARTED.md b/LifeOS/install/skills/LifeOS/GETTING-STARTED.mdnew file mode 100644index 00000000..67d91ecf--- /dev/null+++ b/LifeOS/install/skills/LifeOS/GETTING-STARTED.md@@ -0,0 +1,60 @@+# Getting Started — after the install++You installed LifeOS. This page covers the part `INSTALL.md` couldn't: the **external tools** LifeOS's doctrine uses when they're available. None are required — every one degrades honestly when absent — but each unlocks a real capability. For each: what it powers, how to set it up, and how to prove it's live.++**The one command to remember:**++```+bun <configRoot>/LIFEOS/TOOLS/Doctor.ts+```++Run it whenever anything feels off. Every ❌ line carries its own fix command. `--network` adds end-to-end auth checks (only for tools you've configured). `decline <name>` turns a capability off permanently and silently — declining is a supported way to run LifeOS, not a defect.++---++## codex — cross-vendor audit++**Powers:** an independent second-vendor review on high-impact work. Without it, audits still run — but same-vendor, and the output is labeled accordingly.++- **Install:** `bun install -g @openai/codex`+- **Auth:** `codex login` (needs an OpenAI account)+- **Verify:** `bun <configRoot>/LIFEOS/TOOLS/Doctor.ts` → codex ✅+- **Don't want it?** `Doctor.ts decline codex` — audits stay single-vendor, honestly labeled.++## Interceptor — real-browser verification++**Powers:** verification of anything web-facing through a real Chrome — screenshots, console logs, actual page loads. Doctrine treats "curl returned 200" as *not* verification; this is the tool that does it right.++- **Install:** the skill ships with LifeOS; it needs a real browser binary — Google Chrome or Brave.+- **Auth:** none.+- **Verify:** `Doctor.ts` → interceptor ✅ (skill present + browser found).++## Cloudflare / wrangler — scheduled cloud flows++**Powers:** the "runs while you sleep" layer (Arbol) and Worker deploys.++- **Install:** wrangler runs via `bunx wrangler` — nothing global needed.+- **Auth:** create a Cloudflare API token (Workers permissions), add to `<configRoot>/.env` as `CLOUDFLARE_API_TOKEN=...`+- **Verify:** `Doctor.ts --network` → cloudflare ✅ (runs a real `wrangler whoami`).+- **Don't want it?** `Doctor.ts decline cloudflare`.++## ElevenLabs — voice notifications++**Powers:** spoken notifications through the Pulse voice server.++- **Install:** nothing — it's an API.+- **Auth:** add `ELEVENLABS_API_KEY=...` and `ELEVENLABS_VOICE_ID=...` to `<configRoot>/.env`. Pick a **premade or cloned** voice from your ElevenLabs library — "famous" voices are not usable through the API and fail with `famous_voice_not_permitted`. A scoped, TTS-only API key works fine.+- **Verify:** `Doctor.ts --network` → voice ✅ (runs a real 2-character synthesis on the exact path notifications use).+- **Don't want it?** `Doctor.ts decline voice` — notifications stay on-screen only.++---++## How degradation works (so you can trust it)++- The Doctor writes an **advisory manifest** (`LIFEOS/MEMORY/STATE/capabilities.json`). It's a cache with TTLs, not truth — the runtime re-checks cheaply at the moment a capability is actually used.+- A **broken** capability warns once at the moment you'd have used it, with its fix command. Cooldowns prevent nagging.+- A **declined** capability is silent forever, everywhere.+- Output produced without a doctrine-relevant capability is **labeled** (e.g. "same-vendor audit only") — absence is never hidden inside a confident result.+- The manifest is tamper-evident: `Doctor.ts --verify` flags any edit made outside the Doctor.++That's the contract: nothing here scores you, nothing nags, and nothing pretends.diff --git a/LifeOS/install/skills/LifeOS/INSTALL.md b/LifeOS/install/skills/LifeOS/INSTALL.mdindex 55e5c4d7..2996cbd8 100644--- a/LifeOS/install/skills/LifeOS/INSTALL.md+++ b/LifeOS/install/skills/LifeOS/INSTALL.md@@ -82,7 +82,7 @@ Creates the personal config tree from templates and links it in. This is empty sThis is the one place harnesses genuinely differ. Show the exact change and get a yes.-- **Claude Code** — run `bun Tools/InstallHooks.ts` (merges the hook set into `settings.json`, backing it up first) and `bun Tools/ActivateImports.ts` (turns on the identity context imports). This is what lights up the always-on behavior: the mode banner, the memory loop, and per-turn context injection.+- **Claude Code** — run `bun Tools/InstallHooks.ts` (merges the hook set into `settings.json`, backing it up first) and `bun Tools/ActivateImports.ts` (turns on the identity context imports). This is what lights up the always-on behavior: the LifeOS response format, the memory loop, and per-turn context injection.- **Any other harness (Cursor / Cline / Codex / Gemini / other)** — LifeOS's always-on behavior is enforced by Claude Code *hooks*, which are a Claude Code mechanism. They don't auto-wire on other harnesses **yet**. So instead:1. Write an `AGENTS.md` (or the harness's own context file — e.g. `.cursor/rules`) that points the harness at the LifeOS tree, so it loads the LifeOS context every session.@@ -91,7 +91,7 @@ This is the one place harnesses genuinely differ. Show the exact change and get### 7. Wire the launch command — HOW LifeOS actually turns on (WITH PERMISSION)-This is the step that makes LifeOS *load*. The constitutional layer — the mode banner, verification doctrine, security protocol, the whole operating contract — lives in `install/LIFEOS/LIFEOS_SYSTEM_PROMPT.md` and is **NOT** loaded by a plain `claude` session. It loads only when the harness is launched with that file appended to its system prompt. So installed LifeOS needs its own launch command; running vanilla `claude` gives you CLAUDE.md but **not** the constitution.+This is the step that makes LifeOS *load*. The constitutional layer — the response format, verification doctrine, security protocol, the whole operating contract — lives in `install/LIFEOS/LIFEOS_SYSTEM_PROMPT.md` and is **NOT** loaded by a plain `claude` session. It loads only when the harness is launched with that file appended to its system prompt. So installed LifeOS needs its own launch command; running vanilla `claude` gives you CLAUDE.md but **not** the constitution.The payload ships the launcher — `install/LIFEOS/TOOLS/lifeos.ts` — which spawns Claude with `--append-system-prompt-file <configRoot>/LIFEOS/LIFEOS_SYSTEM_PROMPT.md` (plus the banner and MCP-profile handling). Wire a `lifeos` command that calls it into your human's shell. **Show the exact line, back up the rc file first, wait for a yes.** Use the real `<configRoot>` from `DetectEnv` (e.g. `~/.claude`) — never hardcode a home path.@@ -110,16 +110,16 @@ bun <configRoot>/LIFEOS/TOOLS/lifeos.ts -s <configRoot>/LIFEOS/LIFEOS_SYSTEM_PRO### 8. Choose the components — install all, or pick a subset (WITH PERMISSION)-LifeOS installs in **two tiers**, and you present them that way.+LifeOS installs in **two layers**, and you present them that way.-**Core** (steps 4–7, always together) IS LifeOS: the skill + the full **~50-skill library** + the LIFEOS runtime (Algorithm, docs, tools, statusline binary, version) + the USER tree + the system prompt and its `lifeos` launch command. One consent installs all of Core; declining means not installing LifeOS.+**Core** (steps 4–7, always together) IS LifeOS: the skill + the full **skill library** + the LIFEOS runtime (Algorithm, docs, tools, statusline binary, version) + the USER tree + the system prompt and its `lifeos` launch command. One consent installs all of Core; declining means not installing LifeOS.**Enhancements** are **à la carte** — offer them and let your human pick some, all, or none. Each is independently installed, idempotent, and reversible:| Component | What it adds | Default ||---|---|---|-| **hooks** | mode routing, the memory loop, voice, per-turn context injection — most behavior needs these (this is step 6) | **recommended** |-| **statusline** | the LifeOS status line in your prompt | optional |+| **hooks** | skill routing, the memory loop, voice, per-turn context injection — most behavior needs these (this is step 6) | **recommended** |+| **statusline** | the LifeOS status line in your prompt — set `preferences.temperatureUnit` in `settings.json` to match your human's locale (payload default is `celsius`; suggest `fahrenheit` for US locales/timezones) | optional || **tooltips** | custom Claude Code spinner tips | optional || **spinner verbs** | custom spinner verbs | optional || **agents** | the named agent library | optional |@@ -128,6 +128,22 @@ LifeOS installs in **two tiers**, and you present them that way.The `launchd` components (Pulse, worksweep, derivedsync) are macOS-only — skip them cleanly on Linux/Windows. Show your human this menu, take their picks, and deploy only those. The **Setup** workflow (step 9) drives the actual deployment of the chosen set and verifies each with real evidence (e.g. Pulse → `curl :31337/healthz` = 200). Everything ships in the payload; nothing activates without its matching yes.+### 8.5 Capability check — probe what doctrine assumes (Doctor)++LifeOS doctrine leans on a few **external tools** the core install does not ship: a cross-vendor audit CLI (`codex`), a real browser for web verification (Interceptor), Cloudflare/wrangler for scheduled cloud flows, ElevenLabs for voice. Nothing above installed them, and the features that depend on them must degrade *loudly*, not silently. After Core lands, run the doctor:++```+bun <configRoot>/LIFEOS/TOOLS/Doctor.ts+```++It prints one line per capability — live ✅, broken ❌ (each with its own copy-paste fix command), or off ⏸ — and writes an advisory manifest the runtime uses to flag degraded output. Then ask your human, per broken capability: **set it up now, later, or never?**++- **Now** → run the fix command shown, re-run Doctor. With their permission, add `--network` to verify auth end-to-end — network probes only ever touch capabilities they have already configured.+- **Later** → leave it. The runtime will surface it the moment a degraded capability is actually invoked, fix command included.+- **Never** → `bun <configRoot>/LIFEOS/TOOLS/Doctor.ts decline <name>`. Declined is a clean, permanent, silent OFF — no warnings, no red marks, no nagging, ever. Declining is a legitimate way to run LifeOS, not a defect.++Deeper walkthroughs per tool (what it's for, install, auth, verify it's live): `GETTING-STARTED.md`, shipped next to this file. Your human can re-run the doctor any time something feels off: `lifeos doctor` territory — it's the same command.+### 9. Run Setup, then InterviewRun the **Setup** workflow (`Workflows/Setup.md`) to finish integration and verify with real evidence, then the **Interview** workflow (`Workflows/Interview.md`): name the assistant, capture identity and TELOS (current state → ideal state), pull in any sources your human offers, and seed Pulse. By the end, the config tree is populated and Pulse shows real data.@@ -136,13 +152,15 @@ Run the **Setup** workflow (`Workflows/Setup.md`) to finish integration and veri## What you get on each setup (be honest about this)-| Harness / OS | Skill + USER data + Pulse | Always-on behavior (mode banner, memory loop, context injection) |+| Harness / OS | Skill + USER data + Pulse | Always-on behavior (response format, memory loop, context injection) ||---|---|---|| **Claude Code — macOS / Linux** | ✅ | ✅ full (native hooks) || **Claude Code — Windows** | ✅ (copy fallback where symlinks need admin) | ✅ full || **Cursor / Cline / Codex / Gemini / other** | ✅ | ⚠️ context loads every session via `AGENTS.md`; workflows run on request; always-on hooks not wired yet (roadmap) || **Chat-only assistants (no files / no commands)** | ❌ | ❌ — install stops at the capability gate |+Full-doctrine features additionally depend on the external tools in step 8.5 (codex, browser, Cloudflare, ElevenLabs). Without one, the dependent feature runs degraded **and says so** — it never silently pretends. The Doctor table is the live source of truth for what's on.+## Rules you must follow- **Additive, never clobbering.** Only add what's missing; never overwrite or delete a populated dir or a file you didn't create.diff --git a/LifeOS/install/skills/LifeOS/Tools/InstallSettings.ts b/LifeOS/install/skills/LifeOS/Tools/InstallSettings.tsnew file mode 100644index 00000000..4b81c130--- /dev/null+++ b/LifeOS/install/skills/LifeOS/Tools/InstallSettings.ts@@ -0,0 +1,115 @@+#!/usr/bin/env bun+/**+ * InstallSettings — Setup step 4's settings placement, as a deterministic tool.+ * Places the payload's `install/settings.system.json` into the harness+ * `settings.json` with the one transform the copy-by-hand step kept getting+ * wrong: **`env` values are expanded at write time** (`$HOME`/`${HOME}`/`~` →+ * the real home). The harness injects env values verbatim with NO shell+ * expansion (LifeOS#1404/#1451) — a literal `"$HOME/..."` value creates a real+ * `$HOME/` directory on disk that silently captures runtime state. Command+ * strings (hooks, statusLine) are shell-evaluated and ship untouched.+ *+ * Semantics match the sibling installers (DeployCore/InstallHooks):+ * - settings.json absent → write the expanded template whole.+ * - settings.json present → additive merge: only ABSENT top-level keys and+ * ABSENT env keys are added (expanded); existing values are never touched.+ * - Dry-run by default; `--apply` mutates; backup before every write.+ * - REFUSES the author's live source tree (`--allow-dev` to override).+ *+ * Usage:+ * bun InstallSettings.ts [--config-root <dir>] [--skill-root <dir>] [--apply] [--allow-dev]+ */++import { copyFileSync, existsSync, readFileSync, writeFileSync } from "node:fs";+import { join } from "node:path";+import { detectDevTree } from "./InstallEngine";++interface Args { configRoot: string; skillRoot: string; apply: boolean; allowDev: boolean; }++function parseArgs(): Args {+ const a = process.argv.slice(2);+ const get = (flag: string): string | undefined => {+ const i = a.indexOf(flag);+ return i >= 0 && a[i + 1] && !a[i + 1].startsWith("--") ? a[i + 1] : undefined;+ };+ const home = process.env.HOME || "";+ return {+ configRoot: get("--config-root") || process.env.CLAUDE_CONFIG_DIR || join(home, ".claude"),+ skillRoot: get("--skill-root") || join(import.meta.dir, ".."),+ apply: a.includes("--apply"),+ allowDev: a.includes("--allow-dev"),+ };+}++/** Expand a LEADING $HOME / ${HOME} / ~ path segment. Mid-string refs are left alone. */+export function expandLeadingHome(value: string, home: string): string {+ if (!home) return value;+ if (value === "$HOME" || value === "${HOME}" || value === "~") return home;+ if (value.startsWith("$HOME/")) return home + value.slice("$HOME".length);+ if (value.startsWith("${HOME}/")) return home + value.slice("${HOME}".length);+ if (value.startsWith("~/")) return home + value.slice(1);+ return value;+}++function expandEnvBlock(settings: Record<string, unknown>, home: string): number {+ const env = settings.env;+ if (!env || typeof env !== "object") return 0;+ let n = 0;+ for (const [k, v] of Object.entries(env as Record<string, unknown>)) {+ if (typeof v === "string") {+ const expanded = expandLeadingHome(v, home);+ if (expanded !== v) { (env as Record<string, unknown>)[k] = expanded; n++; }+ }+ }+ return n;+}++const args = parseArgs();+const home = process.env.HOME || "";+const templatePath = join(args.skillRoot, "install", "settings.system.json");+const targetPath = join(args.configRoot, "settings.json");++if (detectDevTree(args.configRoot) && !args.allowDev) {+ console.log(JSON.stringify({ ok: false, error: "dev tree detected — refusing to touch the author's live settings (--allow-dev to override)" }, null, 2));+ process.exit(2);+}+if (!existsSync(templatePath)) {+ console.log(JSON.stringify({ ok: false, error: `payload settings.system.json not found at ${templatePath}` }, null, 2));+ process.exit(1);+}++const template = JSON.parse(readFileSync(templatePath, "utf8")) as Record<string, unknown>;+const expandedCount = expandEnvBlock(template, home);++const report: Record<string, unknown> = { ok: true, apply: args.apply, target: targetPath, envValuesExpanded: expandedCount };++if (!existsSync(targetPath)) {+ report.mode = "create";+ report.topLevelKeys = Object.keys(template).length;+ if (args.apply) writeFileSync(targetPath, JSON.stringify(template, null, 2) + "\n");+} else {+ const current = JSON.parse(readFileSync(targetPath, "utf8")) as Record<string, unknown>;+ const addedKeys: string[] = [];+ for (const [k, v] of Object.entries(template)) {+ if (k === "env") continue; // handled per-key below+ if (!(k in current)) { current[k] = v; addedKeys.push(k); }+ }+ const curEnv = (current.env && typeof current.env === "object" ? current.env : (current.env = {})) as Record<string, unknown>;+ const tplEnv = (template.env || {}) as Record<string, unknown>;+ const addedEnv: string[] = [];+ for (const [k, v] of Object.entries(tplEnv)) {+ if (!(k in curEnv)) { curEnv[k] = v; addedEnv.push(k); }+ }+ report.mode = "merge";+ report.addedKeys = addedKeys;+ report.addedEnv = addedEnv;+ if (args.apply && (addedKeys.length || addedEnv.length)) {+ copyFileSync(targetPath, targetPath + ".backup-" + new Date().toISOString().replace(/[:.]/g, "-"));+ writeFileSync(targetPath, JSON.stringify(current, null, 2) + "\n");+ } else if (args.apply) {+ report.note = "nothing to add — no write, no backup";+ }+}++console.log(JSON.stringify(report, null, 2));+process.exit(0);diff --git a/LifeOS/install/skills/LifeOS/Workflows/Setup.md b/LifeOS/install/skills/LifeOS/Workflows/Setup.mdindex d9a86a5b..40a435c1 100644--- a/LifeOS/install/skills/LifeOS/Workflows/Setup.md+++ b/LifeOS/install/skills/LifeOS/Workflows/Setup.md@@ -30,7 +30,7 @@ The skill ships everything for both tiers in its payload; nothing activates with4. **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/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.- - `install/settings.system.json` → `settings.json` (the system half — the public settings WITHOUT the hooks block; `InstallHooks` owns hooks).+ - **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 placed files (the engine's `substituteTree`).4.5. **Deploy core system: skills + runtime** — `bun Tools/DeployCore.ts` (dry-run first, then `--apply`): copyMissing's the shipped `install/skills/` → `<configRoot>/skills/` (the ~50-skill library) and `install/LIFEOS/` → `<configRoot>/LIFEOS/` (the runtime — ALGORITHM, DOCUMENTATION, TOOLS, PULSE, statusline, VERSION, USER_TEMPLATES), EXCLUDING `USER` (step 5 scaffolds it) and `LIFEOS_INSTALL`; the empty `MEMORY/` tree (WORK/KNOWLEDGE/LEARNING/STATE/OBSERVABILITY/SKILLS) is scaffolded here too so the runtime has a home to write to. Targets ALL-CAPS `LIFEOS` so the `@LIFEOS/...` imports resolve. Never overwrites a populated file (idempotent), refuses the dev tree (`isDevTree` → exit 2), and FAILS LOUD (exit 1) if a required payload source is absent — never a silent no-op. **Runs BEFORE ScaffoldUser**: the active `@LIFEOS/DOCUMENTATION/ARCHITECTURE_SUMMARY.md` import must resolve and the skills must exist before the rest of setup.5. **ScaffoldUser** — `bun Tools/ScaffoldUser.ts` → `existsSync`-guarded copyMissing from the shipped `templates/USER/` into the user config tree. Never overwrites a populated file.diff --git a/LifeOS/install/skills/Prompting/Templates/Data/Agents.yaml b/LifeOS/install/skills/Prompting/Templates/Data/Agents.yamlindex 3f97b099..5218679a 100755--- a/LifeOS/install/skills/Prompting/Templates/Data/Agents.yaml+++ b/LifeOS/install/skills/Prompting/Templates/Data/Agents.yaml@@ -25,8 +25,8 @@ agents:role: Primary AI Assistantemoji: "🤖"voice:- voice_id: s3TPKV1kjDlVtZbl4Ksh- voice_name: {{DA_NAME}}+ voice_id: 21m00Tcm4TlvDq8ikWAM+ voice_name: Rachelrate_wpm: 235stability: 0.38similarity_boost: 0.70@@ -49,7 +49,7 @@ agents:role: Strategic Research Analystemoji: "🎯"voice:- voice_id: AXdMgz6evoL7OPd7eU12+ voice_id: pNInz6obpgDQGcFmaJgBvoice_name: Claude Researcherrate_wpm: 229stability: 0.64diff --git a/LifeOS/install/skills/Telos/Tools/UpdateTelos.ts b/LifeOS/install/skills/Telos/Tools/UpdateTelos.tsindex f971d0ca..2e839d5c 100755--- a/LifeOS/install/skills/Telos/Tools/UpdateTelos.ts+++ b/LifeOS/install/skills/Telos/Tools/UpdateTelos.ts@@ -34,7 +34,7 @@* - WRONG.md - Things I was wrong about*/-import { readFileSync, writeFileSync, copyFileSync, existsSync, mkdirSync } from 'fs';+import { readFileSync, writeFileSync, copyFileSync, existsSync, mkdirSync, readdirSync, rmSync } from 'fs';import { join } from 'path';import { getPrincipal } from '../../../hooks/lib/identity';@@ -132,6 +132,15 @@ async function main() {mkdirSync(BACKUPS_DIR, { recursive: true });copyFileSync(targetFile, backupPath);console.log(`✅ Backup created: ${backupFilename}`);+ // Rolling window: keep the 3 newest backups per file. Git is the durable+ // history; these only cover the gap before the next repo sync (79 stale+ // backups accumulated by 2026-07-12 before this prune existed).+ const prefix = filename.replace('.md', '-');+ const stale = readdirSync(BACKUPS_DIR)+ .filter((f) => f.startsWith(prefix) && f.endsWith('.md'))+ .sort()+ .slice(0, -3);+ for (const f of stale) rmSync(join(BACKUPS_DIR, f));} catch (error) {console.error(`❌ Failed to create backup: ${error}`);process.exit(1);