Skip to content

Dodaios is an open-source agent OS for your desktop: it runs your coding agents, browser and apps by voice or chat, on your own machine. Formerly Personal Jarvis.

docs: one rulebook instead of four

Harald5b01e6b1468c
diff --git a/.agents/agents/code-reviewer.md b/.agents/agents/code-reviewer.md
index 4065768e9b..597c3ba6d4 100644
--- a/.agents/agents/code-reviewer.md
+++ b/.agents/agents/code-reviewer.md
@@ -1,6 +1,6 @@
---
name: code-reviewer
-description: Use proactively after writing or modifying substantial code in the current session. NEVER as part of a push or release — version bumps, changelog entries, tags, and pushing already-committed work spawn no review (maintainer directive 2026-08-12; CLAUDE.md §2, a push is `git push`). Senior code review against the anti-pattern register in `docs/agent-contract.md` §7 and the CLAUDE.md conventions.
+description: Use proactively after writing or modifying substantial code in the current session. NEVER as part of a push or release — version bumps, changelog entries, tags, and pushing already-committed work spawn no review (maintainer directive 2026-08-12; CLAUDE.md §2, a push is `git push`). Senior code review against the rules in CLAUDE.md.
tools: Read, Grep, Glob
model: sonnet
role: reviewer
@@ -8,7 +8,6 @@ domain: generic
phase: any
must_read:
- CLAUDE.md
- - docs/agent-contract.md
when_to_use: Diff review after writing substantial code in the session — generic, any area, BLOCKER/MAJOR/MINOR findings with file:line evidence. Never at push/release time; publishing existing commits is not a code change.
---
@@ -17,12 +16,11 @@ problems and propose concrete fixes with `file:line` evidence.
## Mandatory reading before every review
-1. `docs/agent-contract.md` §7 — the anti-pattern register **AP-1..AP-31**. This
- is the only live register. (`AGENTS.md` is a byte-identical twin of
- `CLAUDE.md`, not a second document — reading both is reading one.)
-2. `CLAUDE.md` — the compressed index of the same contract.
-3. `docs/BUGS.md` §8 bug classes — what these anti-patterns cost in production.
-4. The changed files themselves, read in full, not just the diff.
+1. `CLAUDE.md` — the whole rulebook, single source. (`AGENTS.md` is its
+ byte-identical twin, not a second document; reading both is reading one.)
+2. `docs/BUGS.md` — what these traps cost in production, when you need the
+ history behind a rule or an `AP-nn` marker you found in a code comment.
+3. The changed files themselves, read in full, not just the diff.
Area-specific, only when the diff touches it:
@@ -141,5 +139,5 @@ is worse than no review.
```
If the review is fully clean, say so explicitly — `Clean review — no issues
-found, conforms to the contract in docs/agent-contract.md` — and return
+found, conforms to CLAUDE.md` — and return
`APPROVE`. Do not invent findings to look thorough.
diff --git a/.agents/agents/phase7-selfmod-auditor.md b/.agents/agents/phase7-selfmod-auditor.md
index 65b1d1ea33..4e3a31523f 100644
--- a/.agents/agents/phase7-selfmod-auditor.md
+++ b/.agents/agents/phase7-selfmod-auditor.md
@@ -8,7 +8,6 @@ domain: phase-spezifisch
phase: 7
must_read:
- CLAUDE.md
- - docs/agent-contract.md
- docs/self_mod.md
when_to_use: Phase-7 self-mod code review — allowlist hardcoding, pre-validate pipeline, backup atomicity, echo-confirmation pattern match, skill-draft forcing
---
@@ -21,8 +20,8 @@ You are paranoid. You write NO code. You deliver PASS/FAIL verdicts with `file:l
1. **The AP-SM1..SM14 checks below — this file carries them in full.** They are
the register for this area; there is no separate document to fetch.
-2. `docs/agent-contract.md` §5 (self-mod pipeline, AP-7/AP-13/AP-14/AP-16) and
- §6 (risk tiers) — the project-wide rules these checks specialise, plus
+2. `CLAUDE.md` section 3 — the project-wide rules these checks specialise
+ (atomic config writes, risk tiers, `ToolExecutor`, skills stay draft), plus
`docs/self_mod.md` for the pipeline itself.
3. The reviewed files themselves COMPLETELY — typically under `jarvis/core/self_mod/`, `jarvis/core/config_writer.py`, `jarvis/setup/wizard.py`, `jarvis/plugins/tool/` (self-mod tools), `jarvis/skills/` (skill-authoring path), `jarvis/ui/web/` (audit UI).
diff --git a/.agents/agents/win32-specialist.md b/.agents/agents/win32-specialist.md
index a8d96b2058..821166e013 100644
--- a/.agents/agents/win32-specialist.md
+++ b/.agents/agents/win32-specialist.md
@@ -21,8 +21,7 @@ You are a senior Windows systems engineer for Personal Jarvis. You are called wh
2. `jarvis/vision/uia_tree.py` — reference for UIA walking + pruning + thread discipline.
3. `jarvis/awareness/watchers/window.py` and `idle.py` — the two live watchers;
they are the reference for hook lifecycle and the one permitted polling site.
-4. `CLAUDE.md` §5 "Architecture essentials" → platform gotchas, and
- `docs/agent-contract.md` §5 for the full wording.
+4. `CLAUDE.md` — sections 1 (traps) and 3 (architecture).
## Binding patterns
@@ -42,9 +41,9 @@ You are a senior Windows systems engineer for Personal Jarvis. You are called wh
## Output
-When you write code: Edit/Write directly into the target file. Everything you commit is English (CLAUDE.md §1) — identifiers, comments, docstrings, log and error messages. Comments explain the WHY, not the WHAT.
+When you write code: Edit/Write directly into the target file. Everything you commit is English (CLAUDE.md section 2) — identifiers, comments, docstrings, log and error messages. Comments explain the WHY, not the WHAT.
-Windows is one of three first-class targets, never the baseline (CLOUD.md Rule #1). Every Win32 backend sits behind a capability probe with an honest, English-language no-op on macOS and Linux, and a tracked entry in `docs/os-parity.md` when a sibling backend is still missing.
+Windows is one of three first-class targets, never the baseline (CLAUDE.md section 2). Every Win32 backend sits behind a capability probe with an honest, English-language no-op on macOS and Linux, and a tracked entry in `docs/os-parity.md` when a sibling backend is still missing.
When you review: findings as a numbered list with severity (BLOCKER/MAJOR/MINOR), file-path:line, concrete fix.
diff --git a/.claude/agents/code-reviewer.md b/.claude/agents/code-reviewer.md
index 4065768e9b..597c3ba6d4 100644
--- a/.claude/agents/code-reviewer.md
+++ b/.claude/agents/code-reviewer.md
@@ -1,6 +1,6 @@
---
name: code-reviewer
-description: Use proactively after writing or modifying substantial code in the current session. NEVER as part of a push or release — version bumps, changelog entries, tags, and pushing already-committed work spawn no review (maintainer directive 2026-08-12; CLAUDE.md §2, a push is `git push`). Senior code review against the anti-pattern register in `docs/agent-contract.md` §7 and the CLAUDE.md conventions.
+description: Use proactively after writing or modifying substantial code in the current session. NEVER as part of a push or release — version bumps, changelog entries, tags, and pushing already-committed work spawn no review (maintainer directive 2026-08-12; CLAUDE.md §2, a push is `git push`). Senior code review against the rules in CLAUDE.md.
tools: Read, Grep, Glob
model: sonnet
role: reviewer
@@ -8,7 +8,6 @@ domain: generic
phase: any
must_read:
- CLAUDE.md
- - docs/agent-contract.md
when_to_use: Diff review after writing substantial code in the session — generic, any area, BLOCKER/MAJOR/MINOR findings with file:line evidence. Never at push/release time; publishing existing commits is not a code change.
---
@@ -17,12 +16,11 @@ problems and propose concrete fixes with `file:line` evidence.
## Mandatory reading before every review
-1. `docs/agent-contract.md` §7 — the anti-pattern register **AP-1..AP-31**. This
- is the only live register. (`AGENTS.md` is a byte-identical twin of
- `CLAUDE.md`, not a second document — reading both is reading one.)
-2. `CLAUDE.md` — the compressed index of the same contract.
-3. `docs/BUGS.md` §8 bug classes — what these anti-patterns cost in production.
-4. The changed files themselves, read in full, not just the diff.
+1. `CLAUDE.md` — the whole rulebook, single source. (`AGENTS.md` is its
+ byte-identical twin, not a second document; reading both is reading one.)
+2. `docs/BUGS.md` — what these traps cost in production, when you need the
+ history behind a rule or an `AP-nn` marker you found in a code comment.
+3. The changed files themselves, read in full, not just the diff.
Area-specific, only when the diff touches it:
@@ -141,5 +139,5 @@ is worse than no review.
```
If the review is fully clean, say so explicitly — `Clean review — no issues
-found, conforms to the contract in docs/agent-contract.md` — and return
+found, conforms to CLAUDE.md` — and return
`APPROVE`. Do not invent findings to look thorough.
diff --git a/.claude/agents/phase7-selfmod-auditor.md b/.claude/agents/phase7-selfmod-auditor.md
index 65b1d1ea33..4e3a31523f 100644
--- a/.claude/agents/phase7-selfmod-auditor.md
+++ b/.claude/agents/phase7-selfmod-auditor.md
@@ -8,7 +8,6 @@ domain: phase-spezifisch
phase: 7
must_read:
- CLAUDE.md
- - docs/agent-contract.md
- docs/self_mod.md
when_to_use: Phase-7 self-mod code review — allowlist hardcoding, pre-validate pipeline, backup atomicity, echo-confirmation pattern match, skill-draft forcing
---
@@ -21,8 +20,8 @@ You are paranoid. You write NO code. You deliver PASS/FAIL verdicts with `file:l
1. **The AP-SM1..SM14 checks below — this file carries them in full.** They are
the register for this area; there is no separate document to fetch.
-2. `docs/agent-contract.md` §5 (self-mod pipeline, AP-7/AP-13/AP-14/AP-16) and
- §6 (risk tiers) — the project-wide rules these checks specialise, plus
+2. `CLAUDE.md` section 3 — the project-wide rules these checks specialise
+ (atomic config writes, risk tiers, `ToolExecutor`, skills stay draft), plus
`docs/self_mod.md` for the pipeline itself.
3. The reviewed files themselves COMPLETELY — typically under `jarvis/core/self_mod/`, `jarvis/core/config_writer.py`, `jarvis/setup/wizard.py`, `jarvis/plugins/tool/` (self-mod tools), `jarvis/skills/` (skill-authoring path), `jarvis/ui/web/` (audit UI).
diff --git a/.claude/agents/win32-specialist.md b/.claude/agents/win32-specialist.md
index a8d96b2058..821166e013 100644
--- a/.claude/agents/win32-specialist.md
+++ b/.claude/agents/win32-specialist.md
@@ -21,8 +21,7 @@ You are a senior Windows systems engineer for Personal Jarvis. You are called wh
2. `jarvis/vision/uia_tree.py` — reference for UIA walking + pruning + thread discipline.
3. `jarvis/awareness/watchers/window.py` and `idle.py` — the two live watchers;
they are the reference for hook lifecycle and the one permitted polling site.
-4. `CLAUDE.md` §5 "Architecture essentials" → platform gotchas, and
- `docs/agent-contract.md` §5 for the full wording.
+4. `CLAUDE.md` — sections 1 (traps) and 3 (architecture).
## Binding patterns
@@ -42,9 +41,9 @@ You are a senior Windows systems engineer for Personal Jarvis. You are called wh
## Output
-When you write code: Edit/Write directly into the target file. Everything you commit is English (CLAUDE.md §1) — identifiers, comments, docstrings, log and error messages. Comments explain the WHY, not the WHAT.
+When you write code: Edit/Write directly into the target file. Everything you commit is English (CLAUDE.md section 2) — identifiers, comments, docstrings, log and error messages. Comments explain the WHY, not the WHAT.
-Windows is one of three first-class targets, never the baseline (CLOUD.md Rule #1). Every Win32 backend sits behind a capability probe with an honest, English-language no-op on macOS and Linux, and a tracked entry in `docs/os-parity.md` when a sibling backend is still missing.
+Windows is one of three first-class targets, never the baseline (CLAUDE.md section 2). Every Win32 backend sits behind a capability probe with an honest, English-language no-op on macOS and Linux, and a tracked entry in `docs/os-parity.md` when a sibling backend is still missing.
When you review: findings as a numbered list with severity (BLOCKER/MAJOR/MINOR), file-path:line, concrete fix.
diff --git a/.codex/agents/code-reviewer.toml b/.codex/agents/code-reviewer.toml
index e8e72b5a16..faccf58dcd 100644
--- a/.codex/agents/code-reviewer.toml
+++ b/.codex/agents/code-reviewer.toml
@@ -1,17 +1,16 @@
name = "code-reviewer"
-description = "Use proactively after writing or modifying substantial code in the current session. NEVER as part of a push or release — version bumps, changelog entries, tags, and pushing already-committed work spawn no review (maintainer directive 2026-08-12; CLAUDE.md §2, a push is `git push`). Senior code review against the anti-pattern register in `docs/agent-contract.md` §7 and the CLAUDE.md conventions."
+description = "Use proactively after writing or modifying substantial code in the current session. NEVER as part of a push or release — version bumps, changelog entries, tags, and pushing already-committed work spawn no review (maintainer directive 2026-08-12; CLAUDE.md §2, a push is `git push`). Senior code review against the rules in CLAUDE.md."
developer_instructions = '''
You are the senior code reviewer for Personal Jarvis. You write NO code; you find
problems and propose concrete fixes with `file:line` evidence.
## Mandatory reading before every review
-1. `docs/agent-contract.md` §7 — the anti-pattern register **AP-1..AP-31**. This
- is the only live register. (`AGENTS.md` is a byte-identical twin of
- `CLAUDE.md`, not a second document — reading both is reading one.)
-2. `CLAUDE.md` — the compressed index of the same contract.
-3. `docs/BUGS.md` §8 bug classes — what these anti-patterns cost in production.
-4. The changed files themselves, read in full, not just the diff.
+1. `CLAUDE.md` — the whole rulebook, single source. (`AGENTS.md` is its
+ byte-identical twin, not a second document; reading both is reading one.)
+2. `docs/BUGS.md` — what these traps cost in production, when you need the
+ history behind a rule or an `AP-nn` marker you found in a code comment.
+3. The changed files themselves, read in full, not just the diff.
Area-specific, only when the diff touches it:
@@ -130,6 +129,6 @@ is worse than no review.
```
If the review is fully clean, say so explicitly — `Clean review — no issues
-found, conforms to the contract in docs/agent-contract.md` — and return
+found, conforms to CLAUDE.md` — and return
`APPROVE`. Do not invent findings to look thorough.
'''
diff --git a/.codex/agents/phase7-selfmod-auditor.toml b/.codex/agents/phase7-selfmod-auditor.toml
index b13f2d33db..1900f5b634 100644
--- a/.codex/agents/phase7-selfmod-auditor.toml
+++ b/.codex/agents/phase7-selfmod-auditor.toml
@@ -9,8 +9,8 @@ You are paranoid. You write NO code. You deliver PASS/FAIL verdicts with `file:l
1. **The AP-SM1..SM14 checks below — this file carries them in full.** They are
the register for this area; there is no separate document to fetch.
-2. `docs/agent-contract.md` §5 (self-mod pipeline, AP-7/AP-13/AP-14/AP-16) and
- §6 (risk tiers) — the project-wide rules these checks specialise, plus
+2. `CLAUDE.md` section 3 — the project-wide rules these checks specialise
+ (atomic config writes, risk tiers, `ToolExecutor`, skills stay draft), plus
`docs/self_mod.md` for the pipeline itself.
3. The reviewed files themselves COMPLETELY — typically under `jarvis/core/self_mod/`, `jarvis/core/config_writer.py`, `jarvis/setup/wizard.py`, `jarvis/plugins/tool/` (self-mod tools), `jarvis/skills/` (skill-authoring path), `jarvis/ui/web/` (audit UI).
diff --git a/.codex/agents/win32-specialist.toml b/.codex/agents/win32-specialist.toml
index d48ee34017..5d32992c68 100644
--- a/.codex/agents/win32-specialist.toml
+++ b/.codex/agents/win32-specialist.toml
@@ -9,8 +9,7 @@ You are a senior Windows systems engineer for Personal Jarvis. You are called wh
2. `jarvis/vision/uia_tree.py` — reference for UIA walking + pruning + thread discipline.
3. `jarvis/awareness/watchers/window.py` and `idle.py` — the two live watchers;
they are the reference for hook lifecycle and the one permitted polling site.
-4. `CLAUDE.md` §5 "Architecture essentials" → platform gotchas, and
- `docs/agent-contract.md` §5 for the full wording.
+4. `CLAUDE.md` — sections 1 (traps) and 3 (architecture).
## Binding patterns
@@ -30,9 +29,9 @@ You are a senior Windows systems engineer for Personal Jarvis. You are called wh
## Output
-When you write code: Edit/Write directly into the target file. Everything you commit is English (CLAUDE.md §1) — identifiers, comments, docstrings, log and error messages. Comments explain the WHY, not the WHAT.
+When you write code: Edit/Write directly into the target file. Everything you commit is English (CLAUDE.md section 2) — identifiers, comments, docstrings, log and error messages. Comments explain the WHY, not the WHAT.
-Windows is one of three first-class targets, never the baseline (CLOUD.md Rule #1). Every Win32 backend sits behind a capability probe with an honest, English-language no-op on macOS and Linux, and a tracked entry in `docs/os-parity.md` when a sibling backend is still missing.
+Windows is one of three first-class targets, never the baseline (CLAUDE.md section 2). Every Win32 backend sits behind a capability probe with an honest, English-language no-op on macOS and Linux, and a tracked entry in `docs/os-parity.md` when a sibling backend is still missing.
When you review: findings as a numbered list with severity (BLOCKER/MAJOR/MINOR), file-path:line, concrete fix.
diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml
index 4af090c613..cd4e1295a5 100644
--- a/.github/ISSUE_TEMPLATE/feature_request.yml
+++ b/.github/ISSUE_TEMPLATE/feature_request.yml
@@ -36,5 +36,5 @@ body:
options:
- label: I searched existing issues and this is not a duplicate.
required: true
- - label: This fits the cross-platform, provider-agnostic direction (see docs/PHILOSOPHY.md).
+ - label: This fits the cross-platform, provider-agnostic direction (see CLAUDE.md).
required: false
diff --git a/.github/workflows/macos-desktop.yml b/.github/workflows/macos-desktop.yml
index dbbcf96e2f..b2cdc49989 100644
--- a/.github/workflows/macos-desktop.yml
+++ b/.github/workflows/macos-desktop.yml
@@ -8,7 +8,7 @@ name: macOS desktop
# Trigger note (2026-08-20): this ran on `pull_request` only, and the project
# has no PR flow — 0 merge commits in the last 200 — so the macOS leg had not
-# fired in months while CLOUD.md Rule #1 called macOS a first-class target "in
+# fired in months while CLAUDE.md called macOS a first-class target "in
# the SAME change". A non-negotiable rule whose proof never runs is a rule on
# paper. The path filters below keep the cost honest: the expensive runners
# wake only for a change that can actually break the desktop.
diff --git a/AGENTS.md b/AGENTS.md
index fbb602a9ba..9dd94c65e9 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -1,131 +1,159 @@
# CLAUDE.md
-Compressed index of the binding agent rules. The FULL contract (same section
-numbers, unabridged) is [`docs/agent-contract.md`](docs/agent-contract.md) —
-read it before deep work.
-
-## 0. Mirror rule (BINDING)
-THREE trees, one source: `CLAUDE.md` ≡ `AGENTS.md` (byte-identical);
-`.claude/{agents,commands,skills}/` ≡ `.agents/{...}`; `.codex/agents/*.toml`
-is a GENERATED projection of `.claude/agents/*.md` — never hand-edit it.
-Auto-synced by hook + pre-commit + CI (`sync_agents_md.py`,
-`sync_agents_dir.py`, `sync_codex_agents.py`, each with `--check`). Write for
-EVERY coding agent, never Claude Code alone.
-
-## 1. Language (BINDING, HIGHEST PRIORITY)
-Every committed artifact is ENGLISH. German ONLY on the closed product surface
-(runtime voice/chat output, i18n files, speech-input vocabulary, tests quoting
-them); register `scripts/ci/german-allowlist.txt` / inline `i18n-allow`;
-translate legacy German you touch. Runtime output language: ONE resolver
-(`jarvis/core/turn_language.py::resolve_output_language`) decides each turn
-for ALL layers; no layer re-derives it; all locales (de/en/es/…) equal.
-
-## 2. GitHub (BINDING)
-ONE public repo: `github.com/PersonalJarvis/PersonalJarvis`. **A push is
-`git push`** — no staging trees, clones, builds, file audits, or review
-sub-agents (review happens when code is written, never at push time). `.gitignore`
-first (data/, .env, jarvis.toml, Vault, keys never tracked); never commit
-credentials; secret scanning ON; whole-tree checks live in CI, never pre-push.
-Default = after each completed commit on the shared primary checkout, rebase
-onto origin if needed and `git push` (never `--force`; never from a linked
-worktree). Release ONLY when explicitly asked (SemVer + tag + CHANGELOG +
-published GitHub Release; `check_release_completeness.py` before and after).
-
-## 3. Open-source universality (BINDING)
-Assume an arbitrary downloader, never the maintainer: ANY single key works
-(capability-gated, cross-family fallback, honest degradation, AP-21/22); every
-OS incl. headless `python:3.11-slim` (base install + boot must succeed there;
-extras group, env marker, or lazy import — whichever fits); credentials
-recoverable IN-APP (keyring → ENV → file). Enumerate providers from the CODE
-(`jarvis/core/config.py`, `jarvis/realtime/factory.py`), NEVER from the dev
-box's `jarvis.toml`. A transport-specific trick is ONE declared capability;
-every other transport gets the generic path, an emulation, or honest
-degradation with a stated reason.
-
-**Proportionality (BINDING).** The evidence a change owes is set by the surface
-it touches. Decide the tier in one line, then owe only that tier:
-**T1 local** (styling, copy, one view, a test, a doc, a refactor behind one
-call site) → nothing extra, ship it; a matrix here is noise, not diligence.
-**T2 one surface** (an existing adapter, transport, channel, or OS backend,
+The binding rules for every coding agent in this repo — Claude Code, Codex,
+Gemini CLI, whichever. This is the whole rulebook; there is no longer a fuller
+version to read first. Write everything here so it addresses ANY agent.
+
+**Twin:** `AGENTS.md` is byte-identical to this file. `.claude/{agents,skills}/`
+↔ `.agents/{…}`, and `.codex/agents/*.toml` is a generated projection of
+`.claude/agents/*.md` — never hand-edit it. Three sync engines hold all of it
+(`sync_agents_md.py`, `sync_agents_dir.py`, `sync_codex_agents.py`); a hook,
+pre-commit and CI run them. Edit the canonical side and let them work.
+
+---
+
+## 1. Traps no one guesses
+
+These cost real bugs. Nothing catches them but you.
+
+- **Restore trap.** A fix works in tests and changes nothing after restart:
+ live Python imports from elsewhere. New worktree → `pwsh scripts/preflight.ps1`,
+ then `python -c "import jarvis; print(jarvis.__file__)"`. (AP-8)
+- **The working tree is SHARED** with other agent sessions. Stage only YOUR
+ paths — `git add -p` or an explicit pathspec, and `git commit --only -- <paths>`.
+ `git add -A` sweeps someone else's half-finished work into your commit.
+- **`jarvis.toml` only through `jarvis/core/config_writer.py`** — lock, tempfile,
+ BOM-safe. A raw write leaves the backend unbootable. (AP-7)
+- **Never share a native inference engine** (ctranslate2, ONNX) between callers.
+ It wedges permanently and a timeout does NOT recover it: non-blocking
+ per-instance lock + `recover()` that rebuilds a fresh model. (AP-24)
+- **Every `subprocess` passes `NO_WINDOW_CREATIONFLAGS`** from
+ `jarvis.core.process_utils`, and stdout is UTF-8 (Windows defaults cp1252). (AP-1)
+- **Don't "clean up" the `openclaw` strings.** The external binary name and the
+ read-time back-compat aliases are load-bearing; retired codenames stay dead
+ everywhere else.
+- **A stall watchdog resets its counter per unit of work** (AP-19); a WebSocket
+ receive loop treats ANY read error as terminal and breaks (AP-20); a subscriber
+ exception never leaves `EventBus._safe_dispatch` (AP-18).
+- **No Windows Service** — SYSTEM has no microphone. (AP-17)
+- **Never gate a CI check on `isinstance` against an unpinned library.** Green
+ locally, red in CI on the next release. Discriminate by capability. (AP-28)
+- **The desktop app is a WebView** — no F5, no console, no dev tools. A frontend
+ fix is `npm run build` in `jarvis/ui/web/frontend/` and nothing else; open
+ windows reload themselves (`src/lib/bundleWatch.ts`). Never end a frontend
+ change by asking for a restart.
+- **Read `MEMORY.md`** (`~/.claude/projects/.../memory/`) before larger decisions.
+
+## 2. What the product is
+
+Assume an arbitrary downloader, never the maintainer — their box is <0.1 % of
+the install base, and "works on my machine" is the defect. (AP-23)
+
+- **Any single key must work.** Gate on capability, never a provider name or
+ model id (AP-21). A tier whose primary AND fallback share one provider family
+ is a brick — every chain crosses families or degrades honestly (AP-22).
+- **Every OS**, including a headless `python:3.11-slim` with no GPU, audio or
+ native API: base install + boot must succeed there. Extras group, environment
+ marker or lazy import — whichever fits.
+- **Credentials are recoverable IN-APP** (keyring → ENV → file). Never make
+ someone hand-edit `jarvis.toml` or export a variable.
+- **Enumerate providers from the CODE** (`jarvis/core/config.py`,
+ `jarvis/realtime/factory.py`), never from this box's `jarvis.toml`.
+- **Everything committed is ENGLISH** — code, comments, docstrings, logs, commit
+ messages. German only on the closed product surface: runtime voice/chat output,
+ i18n files, speech-input vocabulary, and tests quoting them
+ (`scripts/ci/german-allowlist.txt`, inline `i18n-allow`). Translate legacy
+ German in files you touch. Runtime output language is decided ONCE per turn by
+ `jarvis/core/turn_language.py`; no layer re-derives it, all locales are equal.
+
+**Proportionality — the evidence a change owes scales with what it touches.**
+Name the tier in one line, then owe only that tier.
+**T1 local** (styling, copy, one view, a test, a doc, a refactor behind one call
+site) → nothing extra. A matrix here is noise, not diligence.
+**T2 one surface** (an existing adapter, transport, channel or OS backend,
shared contract unchanged) → name the cells you touched and what the others do
-(unchanged / emulated / degraded) + tests for that family.
+(unchanged / emulated / degraded), plus tests for that family.
**T3 contract** (a capability, shared interface, turn-taking, credentials,
-config schema, a NEW provider/transport/OS backend) → full treatment: matrix
-named, `tests/contract/` per family, the five non-maintainer paths verified,
-all three OSes in the SAME change behind one capability probe (+
-`docs/os-parity.md`). Unsure between T2 and T3 → it is T3. Over-tiering is
-also a defect. Full table + the five paths: `docs/agent-contract.md` §3.
-
-Device triage: version lag → setup divergence → OS gap.
-Ollama/llama.cpp defaults, recommendations, and examples must be verified
-against the official live catalog when changed and use a current,
-hardware-fitting generation/quantization; an artifact shown as one year old
-or older must never be a default or recommendation. A measured compatibility
-pin may remain only as a documented non-general exception with a removal test.
-**Marketplace** — the standard binds US first: only a registry-published entry
-is a listing; `seed_catalog.json` connectors ship with the app and are NOT
-listings; a built-in reaches the store only via a registry PR like anyone
-else's; "Official" names the author, never a review. Binds app + registry +
-storefront alike. Full rules: `docs/agent-contract.md` §3.
-
-## 4. Naming (BINDING)
-Internal: **Jarvis-Agents**. User-visible brand is DYNAMIC from the wake word
-(`{name}-Agent`, fallback "Assistant-Agent") — never hardcode. Retired
-codenames stay dead; `openclaw` binary strings + back-compat aliases stay AS-IS.
-
-## 5. Architecture essentials (+ §6 safety)
-8-layer rule (protocols down, frozen `EventBus` events laterally); plugins via
-entry-points, no `jarvis.*` import inside (then `pip install -e . --no-deps`);
-streaming-first; secrets only via `get_secret`; brain multi-provider +
-capability-gated; router = pure dispatcher over `ROUTER_TOOLS` (ADR-0011);
-`scrub_for_voice` regex-only; `jarvis.toml` only via `config_writer.py`;
-CLI-first contract (feature = REST route → auto-CLI + registry + danger
-metadata); five-layer enum pattern; workers in fresh git worktrees w/
-kill-on-crash + tool broker (ADR-0025/26); UTF-8 + `NO_WINDOW_CREATIONFLAGS`
-on every subprocess. Safety tiers safe/monitor/ask/block, blacklist >
-whitelist > default; only `ToolExecutor.execute()`; skills stay `draft`.
-
-## 7. Anti-patterns AP-1..32 (BINDING)
-Full register: `docs/agent-contract.md` §7; §8 there reads it backward
-(symptom → cause) when you are debugging. Essence: no keys via voice/chat;
-enum strings in ALL five layers; no spawn tools in worker sets; atomic TOML
-writes only; preflight every new worktree (restore trap!); nothing heavy on
-the boot critical path; no LLM in the voice scrubber; native inference = lock
-+ fresh-model recover; GPU wake gates ONLY on the inference probe; wake
-verification word-agnostic, never transcript content; no `isinstance` gates
-on unpinned libs; signing private keys ONLY in GH Actions secrets; no silent
-`except`; no unread config switch; a WebGL scene releases its context and
-survives losing it.
-
-## 9. Operational reality & git
-Working tree is SHARED: stage only YOUR files (`git add -p`/pathspec, never
-`git add -A`/`.`); auto-commit each logical step (Conventional Commits) then
-`git push` (ff-only; `git pull --rebase --ff-only` first if origin moved);
-never from a linked/mission worktree; never commit secrets. Desktop lifecycle actions are
-maintainer-gated: agents may restart, quit, kill, or relaunch the desktop app
-ONLY after the maintainer explicitly authorizes that exact action in the current
-conversation. Generic "fix/finish/verify" approval is insufficient. Verify the
-exact Personal Jarvis PID + command first and never affect unrelated processes.
-Without explicit approval, explain why a restart is needed and let the maintainer
-click Restart in the desktop UI. The desktop WebView
-has no F5/console — frontend fix = `npm run build` in
-`jarvis/ui/web/frontend/`, nothing else: open windows reload themselves
-(`src/lib/bundleWatch.ts`). Never end a frontend change by asking for a restart.
-Every frontend change works in BOTH light and dark mode (and the terminal
-panes' own appearance): colours come from theme tokens or the per-appearance
-tables in `terminalThemes.ts`, never one hardcoded mode (CLOUD.md →
-"Frontend theming"). Check `MEMORY.md` before larger decisions.
-
-## 10. Run & test
-Install `pip install -e . --no-deps` + `-r requirements.txt` + `".[dev]"`;
-launch `run.bat` (`--headless` = API only); lint `ruff check jarvis/ && ruff
-format jarvis/ && mypy jarvis/`; tests `pytest tests/` (fakes, not mocks;
-fast `-m "not slow"`); guards `test_routing.py`, `test_output_filter.py`,
-`test_hangup_reason_parity.py`; new providers pass `tests/contract/`.
-
-## 11. Pointers
-[`docs/agent-contract.md`](docs/agent-contract.md) (FULL contract) ·
-[`docs/architecture-overview.md`](docs/architecture-overview.md) ·
-[`CLOUD.md`](CLOUD.md) · [`docs/PHILOSOPHY.md`](docs/PHILOSOPHY.md) ·
-[`docs/BUGS.md`](docs/BUGS.md) · `docs/adr/` ·
+config schema, a NEW provider/transport/OS backend) → the full treatment: all
+three OSes in the same change behind one capability probe, `tests/contract/`
+per family, `docs/os-parity.md` updated, and a fresh install with ONE arbitrary
+key verified end to end. Unsure between T2 and T3 → it is T3. Over-tiering is
+also a defect.
+
+## 3. Architecture you must respect
+
+Higher layers reach lower ones only through `jarvis/core/protocols.py`; lateral
+traffic is `frozen=True` events on `EventBus` carrying `trace_id`. Plugins live
+under `jarvis/plugins/<group>/`, register via entry-points, import no `jarvis.*`
+(then `pip install -e . --no-deps`). Brain/STT/TTS/Harness are streaming-first.
+Secrets only via `get_secret` — never in code, `jarvis.toml`, or a commit, and
+voice/chat must never accept one (AP-2). Signing private keys live only in
+GitHub Actions secrets (AP-29). The router is a pure dispatcher over
+`ROUTER_TOOLS` (ADR-0011) and no spawn tool ever enters a worker set (AP-5/14);
+extending it means amending the ADR and `test_routing.py`. `scrub_for_voice` is
+regex-only, never an LLM call (AP-11). Any value crossing Python ↔ SQL ↔ Pydantic
+↔ TS ↔ UI uses the five-layer pattern plus a parity test (AP-4). Mission workers
+run in a fresh `git worktree` with kill-on-crash containment (AP-10). Nothing
+initializes on the boot critical path (AP-26). Risk tiers are safe / monitor /
+ask / block with blacklist > whitelist > default; only `ToolExecutor.execute()`
+is authorized (AP-3), and generated skills stay `draft` (AP-15).
+
+Two the gates catch but models still write: never swallow an exception without
+logging, re-raising, or saying why silence is right (AP-30), and never add a
+config field nothing reads (AP-31).
+
+The rest of the register, one line each, because code comments cite these
+numbers: never hardcode an Anthropic/Claude client (AP-6); keep awareness and
+wiki code off the voice critical path (AP-9); never put a key in `jarvis.toml`
+or commit `.env` (AP-12); never block on a watchdog reload to verify an atomic
+write (AP-13); never reintroduce a sub tier or `SUB_TOOLS` set — Wave 4 deleted
+it (AP-14); new `[phase6.*]` / `[memory.wiki.*]` keys need
+`ConfigDict(extra="allow")` or pre-validate rejects them (AP-16); gate the GPU
+wake upgrade only on the out-of-process inference probe, never on CUDA presence
+(AP-25); verify a wake word on audio energy and candidate shape, never on
+transcript content (AP-27); a WebGL scene releases its context and survives
+losing it (AP-32). Detail and history for any of them: `docs/BUGS.md`.
+
+## 4. How work ships
+
+Commit each finished step (Conventional Commits), then `git push` — that is
+standing authorization, no need to ask. `git pull --rebase --ff-only` first if
+origin moved. Never `--force`, never `--no-verify`, never push from a linked or
+mission worktree — the parent lands that work. **A push is `git push`:** nothing
+is built, cloned, audited, or reviewed on the way. Review happens when code is
+written, never when it is published. A check that reads the whole tree belongs
+in CI, never in `pre-push`. A release (SemVer + tag + CHANGELOG + published
+GitHub Release) happens ONLY when explicitly asked.
+
+Every frontend change works in BOTH light and dark mode, and on the terminal
+panes' own appearance — colours come from theme tokens or the per-appearance
+tables in `terminalThemes.ts`, never one hardcoded mode.
+
+**Maintainer-gated:** restarting, quitting or killing the desktop app needs
+explicit approval for that exact action in the current conversation. "Fix it"
+or "verify" is not approval. Explain why a restart is needed and let them click
+Restart.
+
+Local model defaults (Ollama/llama.cpp) are checked against the live catalog
+when changed; nothing a year old or older ships as a default.
+
+## 5. Run & test
+
+`pip install -e . --no-deps` + `-r requirements.txt` + `".[dev]"`; launch
+`run.bat` (`--headless` = API only); `ruff check jarvis/ && ruff format jarvis/
+&& mypy jarvis/`; `pytest tests/` with fakes from `tests/fakes/`, never
+`unittest.mock`. New providers pass `tests/contract/`. Four guards must stay
+green and have their own blocking CI step: `test_routing`, `test_output_filter`,
+`test_hangup_reason_parity`, `test_turn_language`.
+
+Everything else is enforced by a gate in `scripts/ci/` via pre-commit and CI —
+German, private keys, bundle consistency, CLI coverage, danger metadata, unwired
+switches, silent handlers, import cleanliness, the dependency/lockfile matrix,
+and the three mirrors. Don't spend attention re-checking them by hand; a failure
+fails the build. The one exception with no gate: run `check_boot_budget.py`
+yourself after touching startup.
+
+**Pointers:** [`docs/architecture-overview.md`](docs/architecture-overview.md) ·
+[`docs/BUGS.md`](docs/BUGS.md) (symptom → cause) · `docs/adr/` ·
+[`docs/os-parity.md`](docs/os-parity.md) ·
[`docs/jarvis-cli.md`](docs/jarvis-cli.md).
diff --git a/CLAUDE.md b/CLAUDE.md
index fbb602a9ba..9dd94c65e9 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -1,131 +1,159 @@
# CLAUDE.md
-Compressed index of the binding agent rules. The FULL contract (same section
-numbers, unabridged) is [`docs/agent-contract.md`](docs/agent-contract.md) —
-read it before deep work.
-
-## 0. Mirror rule (BINDING)
-THREE trees, one source: `CLAUDE.md` ≡ `AGENTS.md` (byte-identical);
-`.claude/{agents,commands,skills}/` ≡ `.agents/{...}`; `.codex/agents/*.toml`
-is a GENERATED projection of `.claude/agents/*.md` — never hand-edit it.
-Auto-synced by hook + pre-commit + CI (`sync_agents_md.py`,
-`sync_agents_dir.py`, `sync_codex_agents.py`, each with `--check`). Write for
-EVERY coding agent, never Claude Code alone.
-
-## 1. Language (BINDING, HIGHEST PRIORITY)
-Every committed artifact is ENGLISH. German ONLY on the closed product surface
-(runtime voice/chat output, i18n files, speech-input vocabulary, tests quoting
-them); register `scripts/ci/german-allowlist.txt` / inline `i18n-allow`;
-translate legacy German you touch. Runtime output language: ONE resolver
-(`jarvis/core/turn_language.py::resolve_output_language`) decides each turn
-for ALL layers; no layer re-derives it; all locales (de/en/es/…) equal.
-
-## 2. GitHub (BINDING)
-ONE public repo: `github.com/PersonalJarvis/PersonalJarvis`. **A push is
-`git push`** — no staging trees, clones, builds, file audits, or review
-sub-agents (review happens when code is written, never at push time). `.gitignore`
-first (data/, .env, jarvis.toml, Vault, keys never tracked); never commit
-credentials; secret scanning ON; whole-tree checks live in CI, never pre-push.
-Default = after each completed commit on the shared primary checkout, rebase
-onto origin if needed and `git push` (never `--force`; never from a linked
-worktree). Release ONLY when explicitly asked (SemVer + tag + CHANGELOG +
-published GitHub Release; `check_release_completeness.py` before and after).
-
-## 3. Open-source universality (BINDING)
-Assume an arbitrary downloader, never the maintainer: ANY single key works
-(capability-gated, cross-family fallback, honest degradation, AP-21/22); every
-OS incl. headless `python:3.11-slim` (base install + boot must succeed there;
-extras group, env marker, or lazy import — whichever fits); credentials
-recoverable IN-APP (keyring → ENV → file). Enumerate providers from the CODE
-(`jarvis/core/config.py`, `jarvis/realtime/factory.py`), NEVER from the dev
-box's `jarvis.toml`. A transport-specific trick is ONE declared capability;
-every other transport gets the generic path, an emulation, or honest
-degradation with a stated reason.
-
-**Proportionality (BINDING).** The evidence a change owes is set by the surface
-it touches. Decide the tier in one line, then owe only that tier:
-**T1 local** (styling, copy, one view, a test, a doc, a refactor behind one
-call site) → nothing extra, ship it; a matrix here is noise, not diligence.
-**T2 one surface** (an existing adapter, transport, channel, or OS backend,
+The binding rules for every coding agent in this repo — Claude Code, Codex,
+Gemini CLI, whichever. This is the whole rulebook; there is no longer a fuller
+version to read first. Write everything here so it addresses ANY agent.
+
+**Twin:** `AGENTS.md` is byte-identical to this file. `.claude/{agents,skills}/`
+↔ `.agents/{…}`, and `.codex/agents/*.toml` is a generated projection of
+`.claude/agents/*.md` — never hand-edit it. Three sync engines hold all of it
+(`sync_agents_md.py`, `sync_agents_dir.py`, `sync_codex_agents.py`); a hook,
+pre-commit and CI run them. Edit the canonical side and let them work.
+
+---
+
+## 1. Traps no one guesses
+
+These cost real bugs. Nothing catches them but you.
+
+- **Restore trap.** A fix works in tests and changes nothing after restart:
+ live Python imports from elsewhere. New worktree → `pwsh scripts/preflight.ps1`,
+ then `python -c "import jarvis; print(jarvis.__file__)"`. (AP-8)
+- **The working tree is SHARED** with other agent sessions. Stage only YOUR
+ paths — `git add -p` or an explicit pathspec, and `git commit --only -- <paths>`.
+ `git add -A` sweeps someone else's half-finished work into your commit.
+- **`jarvis.toml` only through `jarvis/core/config_writer.py`** — lock, tempfile,
+ BOM-safe. A raw write leaves the backend unbootable. (AP-7)
+- **Never share a native inference engine** (ctranslate2, ONNX) between callers.
+ It wedges permanently and a timeout does NOT recover it: non-blocking
+ per-instance lock + `recover()` that rebuilds a fresh model. (AP-24)
+- **Every `subprocess` passes `NO_WINDOW_CREATIONFLAGS`** from
+ `jarvis.core.process_utils`, and stdout is UTF-8 (Windows defaults cp1252). (AP-1)
+- **Don't "clean up" the `openclaw` strings.** The external binary name and the
+ read-time back-compat aliases are load-bearing; retired codenames stay dead
+ everywhere else.
+- **A stall watchdog resets its counter per unit of work** (AP-19); a WebSocket
+ receive loop treats ANY read error as terminal and breaks (AP-20); a subscriber
+ exception never leaves `EventBus._safe_dispatch` (AP-18).
+- **No Windows Service** — SYSTEM has no microphone. (AP-17)
+- **Never gate a CI check on `isinstance` against an unpinned library.** Green
+ locally, red in CI on the next release. Discriminate by capability. (AP-28)
+- **The desktop app is a WebView** — no F5, no console, no dev tools. A frontend
+ fix is `npm run build` in `jarvis/ui/web/frontend/` and nothing else; open
+ windows reload themselves (`src/lib/bundleWatch.ts`). Never end a frontend
+ change by asking for a restart.
+- **Read `MEMORY.md`** (`~/.claude/projects/.../memory/`) before larger decisions.
+
+## 2. What the product is
+
+Assume an arbitrary downloader, never the maintainer — their box is <0.1 % of
+the install base, and "works on my machine" is the defect. (AP-23)
+
+- **Any single key must work.** Gate on capability, never a provider name or
+ model id (AP-21). A tier whose primary AND fallback share one provider family
+ is a brick — every chain crosses families or degrades honestly (AP-22).
+- **Every OS**, including a headless `python:3.11-slim` with no GPU, audio or
+ native API: base install + boot must succeed there. Extras group, environment
+ marker or lazy import — whichever fits.
+- **Credentials are recoverable IN-APP** (keyring → ENV → file). Never make
+ someone hand-edit `jarvis.toml` or export a variable.
+- **Enumerate providers from the CODE** (`jarvis/core/config.py`,
+ `jarvis/realtime/factory.py`), never from this box's `jarvis.toml`.
+- **Everything committed is ENGLISH** — code, comments, docstrings, logs, commit
+ messages. German only on the closed product surface: runtime voice/chat output,
+ i18n files, speech-input vocabulary, and tests quoting them
+ (`scripts/ci/german-allowlist.txt`, inline `i18n-allow`). Translate legacy
+ German in files you touch. Runtime output language is decided ONCE per turn by
+ `jarvis/core/turn_language.py`; no layer re-derives it, all locales are equal.
+
+**Proportionality — the evidence a change owes scales with what it touches.**
+Name the tier in one line, then owe only that tier.
+**T1 local** (styling, copy, one view, a test, a doc, a refactor behind one call
+site) → nothing extra. A matrix here is noise, not diligence.
+**T2 one surface** (an existing adapter, transport, channel or OS backend,
shared contract unchanged) → name the cells you touched and what the others do
-(unchanged / emulated / degraded) + tests for that family.
+(unchanged / emulated / degraded), plus tests for that family.
**T3 contract** (a capability, shared interface, turn-taking, credentials,
-config schema, a NEW provider/transport/OS backend) → full treatment: matrix
-named, `tests/contract/` per family, the five non-maintainer paths verified,
-all three OSes in the SAME change behind one capability probe (+
-`docs/os-parity.md`). Unsure between T2 and T3 → it is T3. Over-tiering is
-also a defect. Full table + the five paths: `docs/agent-contract.md` §3.
-
-Device triage: version lag → setup divergence → OS gap.
-Ollama/llama.cpp defaults, recommendations, and examples must be verified
-against the official live catalog when changed and use a current,
-hardware-fitting generation/quantization; an artifact shown as one year old
-or older must never be a default or recommendation. A measured compatibility
-pin may remain only as a documented non-general exception with a removal test.
-**Marketplace** — the standard binds US first: only a registry-published entry
-is a listing; `seed_catalog.json` connectors ship with the app and are NOT
-listings; a built-in reaches the store only via a registry PR like anyone
-else's; "Official" names the author, never a review. Binds app + registry +
-storefront alike. Full rules: `docs/agent-contract.md` §3.
-
-## 4. Naming (BINDING)
-Internal: **Jarvis-Agents**. User-visible brand is DYNAMIC from the wake word
-(`{name}-Agent`, fallback "Assistant-Agent") — never hardcode. Retired
-codenames stay dead; `openclaw` binary strings + back-compat aliases stay AS-IS.
-
-## 5. Architecture essentials (+ §6 safety)
-8-layer rule (protocols down, frozen `EventBus` events laterally); plugins via
-entry-points, no `jarvis.*` import inside (then `pip install -e . --no-deps`);
-streaming-first; secrets only via `get_secret`; brain multi-provider +
-capability-gated; router = pure dispatcher over `ROUTER_TOOLS` (ADR-0011);
-`scrub_for_voice` regex-only; `jarvis.toml` only via `config_writer.py`;
-CLI-first contract (feature = REST route → auto-CLI + registry + danger
-metadata); five-layer enum pattern; workers in fresh git worktrees w/
-kill-on-crash + tool broker (ADR-0025/26); UTF-8 + `NO_WINDOW_CREATIONFLAGS`
-on every subprocess. Safety tiers safe/monitor/ask/block, blacklist >
-whitelist > default; only `ToolExecutor.execute()`; skills stay `draft`.
-
-## 7. Anti-patterns AP-1..32 (BINDING)
-Full register: `docs/agent-contract.md` §7; §8 there reads it backward
-(symptom → cause) when you are debugging. Essence: no keys via voice/chat;
-enum strings in ALL five layers; no spawn tools in worker sets; atomic TOML
-writes only; preflight every new worktree (restore trap!); nothing heavy on
-the boot critical path; no LLM in the voice scrubber; native inference = lock
-+ fresh-model recover; GPU wake gates ONLY on the inference probe; wake
-verification word-agnostic, never transcript content; no `isinstance` gates
-on unpinned libs; signing private keys ONLY in GH Actions secrets; no silent
-`except`; no unread config switch; a WebGL scene releases its context and
-survives losing it.
-
-## 9. Operational reality & git
-Working tree is SHARED: stage only YOUR files (`git add -p`/pathspec, never
-`git add -A`/`.`); auto-commit each logical step (Conventional Commits) then
-`git push` (ff-only; `git pull --rebase --ff-only` first if origin moved);
-never from a linked/mission worktree; never commit secrets. Desktop lifecycle actions are
-maintainer-gated: agents may restart, quit, kill, or relaunch the desktop app
-ONLY after the maintainer explicitly authorizes that exact action in the current
-conversation. Generic "fix/finish/verify" approval is insufficient. Verify the
-exact Personal Jarvis PID + command first and never affect unrelated processes.
-Without explicit approval, explain why a restart is needed and let the maintainer
-click Restart in the desktop UI. The desktop WebView
-has no F5/console — frontend fix = `npm run build` in
-`jarvis/ui/web/frontend/`, nothing else: open windows reload themselves
-(`src/lib/bundleWatch.ts`). Never end a frontend change by asking for a restart.
-Every frontend change works in BOTH light and dark mode (and the terminal
-panes' own appearance): colours come from theme tokens or the per-appearance
-tables in `terminalThemes.ts`, never one hardcoded mode (CLOUD.md →
-"Frontend theming"). Check `MEMORY.md` before larger decisions.
-
-## 10. Run & test
-Install `pip install -e . --no-deps` + `-r requirements.txt` + `".[dev]"`;
-launch `run.bat` (`--headless` = API only); lint `ruff check jarvis/ && ruff
-format jarvis/ && mypy jarvis/`; tests `pytest tests/` (fakes, not mocks;
-fast `-m "not slow"`); guards `test_routing.py`, `test_output_filter.py`,
-`test_hangup_reason_parity.py`; new providers pass `tests/contract/`.
-
-## 11. Pointers
-[`docs/agent-contract.md`](docs/agent-contract.md) (FULL contract) ·
-[`docs/architecture-overview.md`](docs/architecture-overview.md) ·
-[`CLOUD.md`](CLOUD.md) · [`docs/PHILOSOPHY.md`](docs/PHILOSOPHY.md) ·
-[`docs/BUGS.md`](docs/BUGS.md) · `docs/adr/` ·
+config schema, a NEW provider/transport/OS backend) → the full treatment: all
+three OSes in the same change behind one capability probe, `tests/contract/`
+per family, `docs/os-parity.md` updated, and a fresh install with ONE arbitrary
+key verified end to end. Unsure between T2 and T3 → it is T3. Over-tiering is
+also a defect.
+
+## 3. Architecture you must respect
+
+Higher layers reach lower ones only through `jarvis/core/protocols.py`; lateral
+traffic is `frozen=True` events on `EventBus` carrying `trace_id`. Plugins live
+under `jarvis/plugins/<group>/`, register via entry-points, import no `jarvis.*`
+(then `pip install -e . --no-deps`). Brain/STT/TTS/Harness are streaming-first.
+Secrets only via `get_secret` — never in code, `jarvis.toml`, or a commit, and
+voice/chat must never accept one (AP-2). Signing private keys live only in
+GitHub Actions secrets (AP-29). The router is a pure dispatcher over
+`ROUTER_TOOLS` (ADR-0011) and no spawn tool ever enters a worker set (AP-5/14);
+extending it means amending the ADR and `test_routing.py`. `scrub_for_voice` is
+regex-only, never an LLM call (AP-11). Any value crossing Python ↔ SQL ↔ Pydantic
+↔ TS ↔ UI uses the five-layer pattern plus a parity test (AP-4). Mission workers
+run in a fresh `git worktree` with kill-on-crash containment (AP-10). Nothing
+initializes on the boot critical path (AP-26). Risk tiers are safe / monitor /
+ask / block with blacklist > whitelist > default; only `ToolExecutor.execute()`
+is authorized (AP-3), and generated skills stay `draft` (AP-15).
+
+Two the gates catch but models still write: never swallow an exception without
+logging, re-raising, or saying why silence is right (AP-30), and never add a
+config field nothing reads (AP-31).
+
+The rest of the register, one line each, because code comments cite these
+numbers: never hardcode an Anthropic/Claude client (AP-6); keep awareness and
+wiki code off the voice critical path (AP-9); never put a key in `jarvis.toml`
+or commit `.env` (AP-12); never block on a watchdog reload to verify an atomic
+write (AP-13); never reintroduce a sub tier or `SUB_TOOLS` set — Wave 4 deleted
+it (AP-14); new `[phase6.*]` / `[memory.wiki.*]` keys need
+`ConfigDict(extra="allow")` or pre-validate rejects them (AP-16); gate the GPU
+wake upgrade only on the out-of-process inference probe, never on CUDA presence
+(AP-25); verify a wake word on audio energy and candidate shape, never on
+transcript content (AP-27); a WebGL scene releases its context and survives
+losing it (AP-32). Detail and history for any of them: `docs/BUGS.md`.
+
+## 4. How work ships
+
+Commit each finished step (Conventional Commits), then `git push` — that is
+standing authorization, no need to ask. `git pull --rebase --ff-only` first if
+origin moved. Never `--force`, never `--no-verify`, never push from a linked or
+mission worktree — the parent lands that work. **A push is `git push`:** nothing
+is built, cloned, audited, or reviewed on the way. Review happens when code is
+written, never when it is published. A check that reads the whole tree belongs
+in CI, never in `pre-push`. A release (SemVer + tag + CHANGELOG + published
+GitHub Release) happens ONLY when explicitly asked.
+
+Every frontend change works in BOTH light and dark mode, and on the terminal
+panes' own appearance — colours come from theme tokens or the per-appearance
+tables in `terminalThemes.ts`, never one hardcoded mode.
+
+**Maintainer-gated:** restarting, quitting or killing the desktop app needs
+explicit approval for that exact action in the current conversation. "Fix it"
+or "verify" is not approval. Explain why a restart is needed and let them click
+Restart.
+
+Local model defaults (Ollama/llama.cpp) are checked against the live catalog
+when changed; nothing a year old or older ships as a default.
+
+## 5. Run & test
+
+`pip install -e . --no-deps` + `-r requirements.txt` + `".[dev]"`; launch
+`run.bat` (`--headless` = API only); `ruff check jarvis/ && ruff format jarvis/
+&& mypy jarvis/`; `pytest tests/` with fakes from `tests/fakes/`, never
+`unittest.mock`. New providers pass `tests/contract/`. Four guards must stay
+green and have their own blocking CI step: `test_routing`, `test_output_filter`,
+`test_hangup_reason_parity`, `test_turn_language`.
+
+Everything else is enforced by a gate in `scripts/ci/` via pre-commit and CI —
+German, private keys, bundle consistency, CLI coverage, danger metadata, unwired
+switches, silent handlers, import cleanliness, the dependency/lockfile matrix,
+and the three mirrors. Don't spend attention re-checking them by hand; a failure
+fails the build. The one exception with no gate: run `check_boot_budget.py`
+yourself after touching startup.
+
+**Pointers:** [`docs/architecture-overview.md`](docs/architecture-overview.md) ·
+[`docs/BUGS.md`](docs/BUGS.md) (symptom → cause) · `docs/adr/` ·
+[`docs/os-parity.md`](docs/os-parity.md) ·
[`docs/jarvis-cli.md`](docs/jarvis-cli.md).
diff --git a/CLOUD.md b/CLOUD.md
deleted file mode 100644
index 029bc7acb7..0000000000
--- a/CLOUD.md
+++ /dev/null
@@ -1,135 +0,0 @@
-# CLOUD.md — Cross-Platform & Cloud-First Charter
-
-> **Binding top-level charter — established 2026-05-29.**
-> This is the short, loud manifesto. The full doctrine lives in [`docs/PHILOSOPHY.md`](docs/PHILOSOPHY.md).
-> On conflict over hardware/OS assumptions, this charter and `PHILOSOPHY.md` win over any ADR, plan, or phase doc.
-
----
-
-## Canonical repository
-
-The one project repository is the public flagship
-[`PersonalJarvis/PersonalJarvis`](https://github.com/PersonalJarvis/PersonalJarvis).
-Normal development branches, `main`, tags, and GitHub Releases all share that
-history. A lowercase `personal-jarvis` remote may exist as a local backup, but it
-is never the deliverable and is not a second project.
-
-Every contributor must keep local configuration and credentials outside Git:
-`.env`, `jarvis.toml`, `data/`, Vault content, private keys, and signing secrets
-must never be tracked. GitHub secret scanning and push protection remain
-fail-closed. An ordinary update pushes reviewed commits without creating a tag;
-an explicit release additionally updates SemVer and the changelog, creates the
-tag, publishes the GitHub Release, and verifies its signed assets.
-
-Do not rename the Python package or keyring service `personal-jarvis`; those are
-stable technical identifiers and are independent of the repository's display
-name.
-
----
-
-## Rule #1 — Everything we build must run on Linux, macOS, AND Windows. (NON-NEGOTIABLE)
-
-**Every feature, module, dependency, default, and PR must work end-to-end on all three desktop platforms — Linux, macOS, and Windows — plus a headless Linux server.**
-
-This is the first and highest rule. It sits above every other consideration in this repo.
-
-Why this rule exists: the project was bootstrapped on a single Windows 11 workstation, and a lot of code silently encoded "Windows" as the baseline. **That is now treated as a defect, not a default.** As of 2026-05-29 we are actively shifting the codebase back toward true cross-platform parity.
-
-Concretely, Rule #1 means:
-
-1. **No platform may be a second-class citizen.** Linux, macOS, and Windows are all first-class targets. A feature that only works on one of them is **incomplete**, not "done with a known limitation".
-2. **The base `pip install` must succeed and the app must boot on a fresh `python:3.11-slim` Linux container, on macOS, and on Windows** — with no GPU, no audio hardware, no native OS API, and only a network connection.
-3. **OS-specific code is allowed only when:**
- - (a) it lives behind a runtime capability check (not an `import` at module top level that crashes on the wrong OS), **and**
- - (b) it sits inside an optional extras group (`[desktop]`, `[local-stt]`, `[vision-local]`, …), **and**
- - (c) it degrades to a graceful, clearly-messaged no-op (in English) on the platforms where it is unavailable.
-4. **No new dependency that can break the base install or the boot.** The test is behavioural, not a name list: `pip install` and `import jarvis` must succeed on a fresh `python:3.11-slim` with no GPU, no audio device, and no native OS API. Three mechanisms satisfy it, and a package may use whichever fits: an **extras group** (`[desktop]`, `[desktop-linux]`, `[desktop-macos]`, `[local-voice]`), an **environment marker** that keeps the wheel off the platforms it cannot serve, or a **lazy import behind a capability probe** so the module never loads where it would fail. `pywin32`, `pywinauto`, `pyautogui`, `faster-whisper`, `onnxruntime-gpu`, `global-hotkeys`, `mss` and `pywebview` are extras. `sounddevice`, `openwakeword`, `onnxruntime`, `vosk` and `aiortc` sit in the base install *by marker and lazy import* — they install cleanly, and the features that need them degrade honestly when the system library or device is absent. Gates: `check_import_clean.py` (module-scope platform imports), `check_requirements_sync.py` and `check_lockfile_universal.py` (torch-free, universal lock), `check_portable_install_matrix.py` (the install itself). Adding a package that fails any of those is the defect — the wording here follows the gates, not a frozen list of names.
-5. **Use cross-platform primitives by default:** `pathlib.Path` over hand-built `\`/`/` paths, `sys.platform` / capability probes over assuming Windows, `subprocess` flags guarded per-OS, UTF-8 everywhere (never assume cp1252), and config/data dirs resolved via a platform-aware helper rather than hardcoded `C:\Users\...`.
-6. **CI must prove it.** Cross-platform parity is verified, not assumed — the test matrix should exercise Linux, macOS, and Windows (at minimum: import + boot + base test suite on each).
-
-**The maintainer's Windows + RTX workstation is a power-user profile, not the baseline.** Tray app, Orb overlay, global-hotkey wake, local Whisper, in-process Silero-VAD, drift-guard daemon, Computer-Use harness — all opt-in extras, all degrade gracefully when absent.
-
-**Grandfather clause:** pre-existing Windows-only code is grandfathered *until touched*. Any *touch* of a violating path is an opportunity to migrate it toward cross-platform, not extend the violation.
-
----
-
-## Rule #2 — Everything we build must work with every provider, every API key, and every mode. (NON-NEGOTIABLE, added 2026-08-18)
-
-**Every feature, and every analysis or plan that precedes it, targets the FULL provider × mode × OS matrix from the first sentence — never the maintainer's current setup.**
-
-Rule #1 says "every OS". Rule #2 is its sibling for everything else the user can plug in:
-
-1. **Every provider family and every key the app accepts** — all Brain / Tool-Model providers (cloud AND local Ollama/llama.cpp), every realtime transport (`openai-realtime`, `gemini-live`, `vertex-live`, the tool-less handoff transports), every STT / TTS / Vision / Wake provider. The list is the code (`jarvis/core/config.py`, `jarvis/realtime/factory.py`) — never the dev box's `jarvis.toml`.
-2. **Every mode and surface** — the realtime engine AND the classic pipeline, text chat (desktop, headless launcher, browser UI), channels (Telegram / Discord / webhook / SMS), the CLI.
-3. **A provider-specific mechanism is ONE declared capability**, never the design. Every other provider gets the same user-visible behaviour through the generic path or an emulation, or degrades honestly with a stated reason (capability-gated, AP-21).
-4. **"Works on vertex-live" / "works in realtime mode" is one cell, not done.** Plans, ADRs, and PRs name the cells they cover natively, emulate, and degrade — and an analysis that reasons only from the maintainer's provider is incomplete and is redone.
-
-The maintainer's `vertex-live` + Vertex tool model + realtime mode is a sample of one. Full text: `docs/agent-contract.md` §3 "Provider & mode parity".
-
----
-
-## The rest of the doctrine (summary — full text in `docs/PHILOSOPHY.md`)
-
-- **All five provider classes (Brain, STT, TTS, Vision, Wake) have a fully cloud-reachable default path** — no required local GPU, model, microphone, speaker, or OS API.
-- **Headless VPS + browser UI is a first-class runtime.** Browser `getUserMedia` → WebSocket, or a channel adapter (Telegram, Discord, SMS, webhook), reaches the full Router-Brain → Worker-Critic → Mission-Manager experience with zero native installs.
-- **Defaults in `jarvis.toml` cannot assume CUDA, local audio, or Windows paths.** STT/TTS default to cloud providers; wake defaults to a server-side gate (browser PTT / channel / webhook).
-- **Local-model recommendations stay current.** Every Ollama/llama.cpp default, recommendation, managed profile, and current setup example must be verified against the official live catalog when changed and use a hardware-fitting current generation/quantization. An artifact shown as one year old or older is forbidden as a default or recommendation; a measured compatibility pin is allowed only as a documented non-general exception with a removal test.
-- **Docs, defaults, install instructions, and onboarding lead with the cloud + cross-platform path.** Windows-desktop instructions are a footnote in an "Optional power-user extras" section.
-- **Maintainer dev tooling under `scripts/` may stay Windows-PowerShell-only.** The line is the boundary between `scripts/` (developer tools — may stay Windows-only) and the importable `jarvis/` package (runtime — must run on Linux, macOS, and Windows).
-
----
-
-## Decision lens for any PR
-
-> *Would this PR work, end-to-end, on a fresh `python:3.11-slim` Linux container, on macOS, and on Windows — with no GPU, no audio hardware, no native OS API, and only a network connection?*
-
-If **yes** → merge.
-If **no** → either (a) the OS/hardware-specific portion is correctly gated behind an extras group with a graceful no-op fallback in the base install, or (b) split the PR.
-
----
-
-## Repo hygiene — no stray screenshots or binary scratch (added 2026-05-30)
-
-**Screenshots and ad-hoc image scratch do not belong in the repo.** UI captures, GitHub screenshots, `Screenshot *.png` dumps, debug frames, and design-reference images are throwaway artifacts: they bloat the working tree, inflate clone size, and are never load-bearing. Keep them outside the repo (e.g. `~/Downloads`).
-
-- **Never commit** UI / debug / GitHub screenshots or `Screenshot *.png`-style captures. If one ever appears in `git status`, delete it — do not commit it.
-- The **only** images that belong in the repo are load-bearing assets: shipped frontend assets under `jarvis/ui/web/frontend/public/` and `jarvis/ui/web/dist/`, app icons under `assets/icons/`, the chosen mascot art, and `OS-Level/overlay-ui/.../mascot-fallback.png`. Anything else is suspect.
-- Runtime telemetry under `data/flight_recorder/blobs/` is gitignored and can grow to tens of GB (the Vision flight-recorder writes one screenshot per frame). Purge it periodically — `FlightRecorder` recreates the directory on boot (`recorder.py`, `mkdir(parents=True, exist_ok=True)`), so deleting it is safe and loses only old replay history.
-- `.gitignore` enforces this: root-level `*.png/*.jpg/*.jpeg/*.gif/*.webp/*.bmp` are ignored, plus `Screenshot *.png` anywhere in the tree.
-
----
-
-## In-app updates — every release reaches users via the "Update available" button (added 2026-07-03)
-
-**The desktop app self-updates.** Since 2026-07-03 the top bar carries an in-app updater (`jarvis/ui/web/update_routes.py` + `jarvis/ui/web/frontend/src/components/layout/TopBar.tsx`): when a newer version is published, an **"Update available · vX.Y.Z"** button appears next to Restart; one click pulls the new code and restarts, so an end user never re-runs the installer from a terminal. This is now **the** way a new version reaches everyone, so the release process must keep it working:
-
-1. **A user-visible update = a real GitHub Release (a `vX.Y.Z` tag).** The button detects the newest *published Release* (`api.github.com/repos/PersonalJarvis/PersonalJarvis/releases/latest`), NOT raw `main`. A **DISCREET** snapshot (no tag) deliberately does NOT surface an update — only the **RELEASE** ceremony does (bump + tag + GitHub Release; see the "Canonical repositories" section above). So "ship an update our users actually see" means run the RELEASE ceremony, not a discreet snapshot. The Release notes (`body`) are what the button shows on hover — write them for users, not for maintainers.
-2. **The pull needs the prebuilt frontend + the marker.** Each public release must ship a freshly built `jarvis/ui/web/dist/` (the release skill already rebuilds it) so the update's `git fetch` + `git reset --hard origin/main` refreshes the UI with no Node/npm on the user's machine. The updater is active **only** on an installer-managed checkout — proven by BOTH a `.jarvis-managed-install` marker (written by `install/installer.py`, gitignored so it never ships) AND an `origin` resolving exactly to `PersonalJarvis/PersonalJarvis`. A dev tree, a manual clone, or a look-alike fork never shows the button and can never be self-reset. That guard is load-bearing — do not weaken it.
-3. **Cross-platform, like everything else (Rule #1).** The updater rides git + the existing detached relauncher, so it behaves identically on Windows/macOS/Linux and degrades honestly on a headless host (the restart step returns 503 → "update installed, please restart manually"). It adds no OS-bound dependency.
-
----
-
-## Frontend theming — every UI change ships in light AND dark mode (added 2026-08-12)
-
-**Neither theme is "the" theme.** The web app has a light and a dark theme
-(`jarvis/ui/web/frontend/src/index.css` tokens), and the Agentic IDE's terminal
-panes additionally carry their own light/dark appearance that may differ from
-the app theme. Any frontend change — component, colour, chart, notice — must:
-
-1. **Read its colours from the theme system, never hardcode one mode.**
- App-level surfaces use the CSS tokens (`--background`, `--primary`, …);
- anything drawn on a terminal pane's own ground keys off the pane's
- `TerminalAppearance` (the per-appearance tables in
- `src/components/agentic/terminalThemes.ts`), because an app token lands on
- the wrong ground exactly when pane and app disagree.
-2. **Be checked legible in BOTH modes before it is called done.** The brand
- accent is signal-yellow `#FFD60A` on dark grounds and gold `#A86B00` on
- light paper — never the same hex on both.
-
----
-
-## Pointer network
-
-- Full doctrine: [`docs/PHILOSOPHY.md`](docs/PHILOSOPHY.md)
-- Binding agent guidance: [`CLAUDE.md`](CLAUDE.md) §"Cloud-First Philosophy"
-- Recurring maintainer-machine bugs that prove the rule: [`docs/BUGS.md`](docs/BUGS.md) (BUG-009, BUG-014, BUG-026, BUG-027)
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 335660c67d..5d633b5f87 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -62,7 +62,7 @@ voice path worse than it was.
After that, cross-platform work. Linux, macOS, Windows and headless servers are equal here,
and a feature that only runs on one of them is unfinished rather than done. The reasoning is
-in [`docs/PHILOSOPHY.md`](docs/PHILOSOPHY.md).
+in [`CLAUDE.md`](CLAUDE.md) section 2.
Then security hardening: prompt injection, the boundary between what the user said and what
a tool merely observed, the risk-tier policy, path traversal, privilege escalation. See
@@ -125,7 +125,7 @@ The router dispatches rather than doing. Heavy work becomes a mission in an isol
For the deep version, read [`docs/LLM-CONTEXT.md`](docs/LLM-CONTEXT.md), which is a dense
engineering snapshot, [`CLAUDE.md`](CLAUDE.md) for the binding conventions, and
-[`docs/PHILOSOPHY.md`](docs/PHILOSOPHY.md) for the cross-platform doctrine.
+[`CLAUDE.md`](CLAUDE.md) section 2 for the cross-platform doctrine.
## Plugin, tool, or skill?
diff --git a/README.md b/README.md
index 115c978d21..eaf6e47d20 100644
--- a/README.md
+++ b/README.md
@@ -538,7 +538,7 @@ PersonalJarvis/
| [`docs/architecture-overview.md`](https://github.com/PersonalJarvis/PersonalJarvis/blob/main/docs/architecture-overview.md) | The full architecture: layers, module catalog, data flow |
| [`docs/LLM-CONTEXT.md`](https://github.com/PersonalJarvis/PersonalJarvis/blob/main/docs/LLM-CONTEXT.md) | Dense project snapshot, built to paste into an LLM chat whole |
| [`CLAUDE.md`](https://github.com/PersonalJarvis/PersonalJarvis/blob/main/CLAUDE.md) | Binding contributor guide: conventions, doctrine, anti-patterns |
-| [`docs/PHILOSOPHY.md`](https://github.com/PersonalJarvis/PersonalJarvis/blob/main/docs/PHILOSOPHY.md) | Cross-platform, provider-agnostic design doctrine |
+| [`CLAUDE.md`](https://github.com/PersonalJarvis/PersonalJarvis/blob/main/CLAUDE.md) | Cross-platform, provider-agnostic design doctrine + the contributor rules |
| [`docs/adr/`](https://github.com/PersonalJarvis/PersonalJarvis/tree/main/docs/adr/) | Architecture Decision Records |
| [`docs/BUGS.md`](https://github.com/PersonalJarvis/PersonalJarvis/blob/main/docs/BUGS.md) | The recurring-bug register |
| [`docs/BRAND.md`](https://github.com/PersonalJarvis/PersonalJarvis/blob/main/docs/BRAND.md) | Brand guidelines: colors, typography, the wordmark |
diff --git a/docs/LLM-CONTEXT.md b/docs/LLM-CONTEXT.md
index e458682509..f0d3ff3dff 100644
--- a/docs/LLM-CONTEXT.md
+++ b/docs/LLM-CONTEXT.md
@@ -12,13 +12,13 @@
**Personal Jarvis** is a voice-driven **Supervisor-Agent meta-orchestrator** — not a classical voice assistant. The core pattern is a fast **Router-Brain** that dispatches work to interchangeable executors: router-tier tools, a computer-use harness, and — for heavy work — isolated mission workers (`ClaudeDirectWorker`, `CodexDirectWorker`, `GoogleCliWorker`, in-process `ApiAgentWorker`). NB: only two `jarvis.harness` entry points are registered, `python-script` and `screenshot` (`pyproject.toml`); `open_interpreter.py` is a stub that returns `exit_code=1` and `mcp_remote.py` is unregistered — `tests/contract/test_harness_protocol.py` asserts both are unavailable. MCP reaches the brain as *tools* via the `mcp-tools` loader, not as a harness. The voice layer is just the I/O surface; the soul is the dispatcher discipline that keeps the Router-Brain lean and delegates heavy reasoning to specialized Jarvis-Agents under critic-loop + worktree-isolation guard rails. The project is **provider-agnostic by mandate** — assume the downloader has exactly one credential, from any vendor, and never assume it is an Anthropic API key (subscription OAuth is used only inside workers) — and **self-modifying** via an atomic config-writer with a 10-step validate-backup-tempfile-replace-rollback-audit pipeline.
> ### Cloud-First — Read This Before The Install Section
-> **Target runtime is any €5 / month VPS or low-spec laptop** with a modern browser. **The maintainer's RTX 5070 Ti / Windows 11 Pro workstation is not a requirement** — it represents fewer than 0.1 % of the install base this project is being designed for. All Brain / STT / TTS / Vision / Wake providers default to cloud APIs; no GPU, no local models, no Windows APIs, no microphone are required in the base install. Windows-desktop features (tray app, Orb overlay, global hotkey wake, local Whisper, Silero-VAD-in-process, Computer-Use harness, PowerShell drift-guard daemon) are **opt-in `[desktop]` extras**, not requirements. **Binding doctrine: [`docs/PHILOSOPHY.md`](docs/PHILOSOPHY.md)**. On conflict between this README and `PHILOSOPHY.md`, the doctrine wins.
+> **Target runtime is any €5 / month VPS or low-spec laptop** with a modern browser. **The maintainer's RTX 5070 Ti / Windows 11 Pro workstation is not a requirement** — it represents fewer than 0.1 % of the install base this project is being designed for. All Brain / STT / TTS / Vision / Wake providers default to cloud APIs; no GPU, no local models, no Windows APIs, no microphone are required in the base install. Windows-desktop features (tray app, Orb overlay, global hotkey wake, local Whisper, Silero-VAD-in-process, Computer-Use harness, PowerShell drift-guard daemon) are **opt-in `[desktop]` extras**, not requirements. **Binding doctrine: [`CLAUDE.md`](CLAUDE.md)**. On conflict between this README and `PHILOSOPHY.md`, the doctrine wins.
- **Base runtime:** Linux / macOS / Windows with Python 3.11+ and a network connection. Headless VPS + browser UI is a first-class deployment target.
- **Maintainer's reference machine** (the project is developed on, but **does not require**, this hardware): RTX 5070 Ti, 32 GB RAM, CUDA 12.8, Windows 11 Pro — unlocks the optional `[desktop]` extras.
- **Repo root** (maintainer's workstation; not relevant to consumers): `<USER_HOME>\Desktop\Personal Jarvis`
- **Binding plan:** `~/.claude/plans/also-er-muss-auch-lexical-pond.md` (plan wins on plan-vs-code conflict). <!-- i18n-allow -->
-- **Binding doctrine:** [`docs/PHILOSOPHY.md`](docs/PHILOSOPHY.md) (cloud-first; wins over the binding plan when the two disagree on hardware assumptions).
+- **Binding doctrine:** [`CLAUDE.md`](CLAUDE.md) (cloud-first; wins over the binding plan when the two disagree on hardware assumptions).
---
@@ -88,7 +88,7 @@ The base + cloud-voice experience is fully cross-platform. The six desktop power
| Orb overlay | 🟡 unverified-on-real-desktop (best-effort; ⚙ tray fallback) | 🟡 unverified-on-real-desktop (Tk `-transparentcolor`) | ✅ |
| Admin-helper / elevation | 🟡 unverified-on-real-desktop (pkexec/sudo; ⚙ NullElevator) | 🟡 unverified-on-real-desktop (Authorization Services) | ✅ UAC |
-> macOS / Linux get the full Router-Brain → Worker-Critic → Mission-Manager experience — including voice, local Whisper, and the **screenshot → click → type** Computer-Use loop: the vision model picks pixel targets, and `mss` (screen capture) + `pyautogui` (click / type / scroll) are cross-platform **base** dependencies, not Windows-only. The six former Windows-only desktop features — the built-in terminal, launch-app-by-name, click-by-UI-element-name (UIA / AX / AT-SPI accessibility trees), global-hotkey wake, the Orb overlay, and the admin-helper / elevation — are now **cross-platform behind the `jarvis/platform/` seam** (one per-OS implementation per feature, selected by a `detect_platform()` factory, each degrading to a logged English no-op when its capability is absent). They remain **opt-in `[desktop]` / `[desktop-macos]` extras** (the headless €5-VPS base install ships none of them). Terminal and launch-by-name are fully CI-provable on the ubuntu/macos runners; UI-element-click, global-hotkey capture, the Orb transparency, and the elevation prompt are live GUI/permission behaviors that need a one-time sign-off on a real device (AD-3) — see the per-feature verdicts in [Verification status](#verification-status). See the `[desktop]` extras in [`pyproject.toml`](pyproject.toml), the cloud-first doctrine in [`docs/PHILOSOPHY.md`](docs/PHILOSOPHY.md), and ADR-0020 (cross-platform elevation, supersedes ADR-0001).
+> macOS / Linux get the full Router-Brain → Worker-Critic → Mission-Manager experience — including voice, local Whisper, and the **screenshot → click → type** Computer-Use loop: the vision model picks pixel targets, and `mss` (screen capture) + `pyautogui` (click / type / scroll) are cross-platform **base** dependencies, not Windows-only. The six former Windows-only desktop features — the built-in terminal, launch-app-by-name, click-by-UI-element-name (UIA / AX / AT-SPI accessibility trees), global-hotkey wake, the Orb overlay, and the admin-helper / elevation — are now **cross-platform behind the `jarvis/platform/` seam** (one per-OS implementation per feature, selected by a `detect_platform()` factory, each degrading to a logged English no-op when its capability is absent). They remain **opt-in `[desktop]` / `[desktop-macos]` extras** (the headless €5-VPS base install ships none of them). Terminal and launch-by-name are fully CI-provable on the ubuntu/macos runners; UI-element-click, global-hotkey capture, the Orb transparency, and the elevation prompt are live GUI/permission behaviors that need a one-time sign-off on a real device (AD-3) — see the per-feature verdicts in [Verification status](#verification-status). See the `[desktop]` extras in [`pyproject.toml`](pyproject.toml), the cloud-first doctrine in [`CLAUDE.md`](CLAUDE.md), and ADR-0020 (cross-platform elevation, supersedes ADR-0001).
#### Verification status
@@ -716,4 +716,4 @@ Neither blocks anything — but a fresh chat parroting CLAUDE.md verbatim will b
**No warranty for self-modifying behaviour.** The Phase-7 self-mod tools (`set_config_value`, `spawn-skill-author`) and the Phase-6 Worker-Critic loop can write to `jarvis.toml`, generate skills (created with `state="draft"`, never auto-activated — AP-15), and create isolated `git worktree` branches under `<repo_parent>/sub-agents-outputs/`. The 10-step atomic-write pipeline (allowlist → pre-validate → backup → tempfile → synchronous reload → rollback → audit) is designed to be safe and reversible, but the MIT "as is" disclaimer applies in full: the maintainers are not liable for any state the system writes on your behalf, on your filesystem or against the third-party APIs you have configured.
-**Contributing.** Pull requests are welcome. By contributing you agree that your contribution is licensed under the MIT License above. See [`CLAUDE.md`](CLAUDE.md) and [`docs/PHILOSOPHY.md`](docs/PHILOSOPHY.md) for the binding output-language policy (English-only artifacts) and the cloud-first design doctrine. The repository's bug register lives at [`docs/BUGS.md`](docs/BUGS.md); architecture decisions are recorded under [`docs/adr/`](docs/adr/).
+**Contributing.** Pull requests are welcome. By contributing you agree that your contribution is licensed under the MIT License above. See [`CLAUDE.md`](CLAUDE.md) and [`CLAUDE.md`](CLAUDE.md) for the binding output-language policy (English-only artifacts) and the cloud-first design doctrine. The repository's bug register lives at [`docs/BUGS.md`](docs/BUGS.md); architecture decisions are recorded under [`docs/adr/`](docs/adr/).
diff --git a/docs/PHILOSOPHY.md b/docs/PHILOSOPHY.md
deleted file mode 100644
index a6ac3f212d..0000000000
--- a/docs/PHILOSOPHY.md
+++ /dev/null
@@ -1,141 +0,0 @@
-# Cloud-First Philosophy
-
-> **Binding architectural doctrine — established 2026-05-18.**
-> This document sits **above** ADRs, plans, and phase docs.
-> On conflict with anything written before 2026-05-18, **this wins**.
-> Future ADRs must cite this document when proposing a feature that depends on local hardware and must justify why a cloud fallback is impossible (or accept the feature being relegated to an opt-in `[desktop]` extras group).
-
----
-
-## 1. The Pivot
-
-Personal Jarvis was bootstrapped on a single workstation: Windows 11 Pro, an RTX 5070 Ti, 32 GB RAM, CUDA 12.8, a wired headset, an Obsidian vault on the desktop, a tray icon, a global hotkey, an Orb overlay. Many design decisions silently encoded that environment as the baseline — `faster-whisper-large` on CUDA, `openWakeWord` on the CPU, `Silero-VAD` in-process, WASAPI audio routing, a `pywebview` desktop window, a PowerShell drift-guard daemon polling `jarvis.toml` every five minutes.
-
-**That baseline is no longer the project's target.**
-
-Personal Jarvis is being released as **open source on GitHub**. The realistic profile of a future contributor or user is one of:
-
-- A **€5 / month VPS** — 1 vCPU, 1–2 GB RAM, no GPU, no audio hardware, headless Linux.
-- A **mid-range laptop** — integrated graphics, 8–16 GB RAM, Windows / macOS / Linux, browser-based interaction.
-
-The maintainer's RTX 5070 Ti / 32 GB Windows workstation represents **fewer than 0.1 %** of the install base we should design for. Treating it as the default has already cost the project real pain — `BUG-009` (wake threshold tuned to one specific microphone), `BUG-014` (audio host-API picked from one specific Realtek + Sennheiser driver set), `BUG-026` (an STT model name only meaningful on the maintainer's local Hugging Face cache), `BUG-027` (an Orb overlay relying on a specific multi-monitor layout). **Each of those would not occur on a cloud-first deployment.**
-
-The maintainer's machine is the *exception*, not the *default*.
-
----
-
-## 2. The Doctrine
-
-From **2026-05-18 forward**, every architectural decision is evaluated against the **€5 VPS user**, not the maintainer.
-
-Concretely:
-
-1. **All five provider classes — Brain, STT, TTS, Vision, Wake — must have a fully cloud-reachable default path.** No required local GPU. No required local model download. No required Windows API. No required microphone. No required speaker. If a provider class only works locally today, it gets a cloud-default *before* it ships any new feature.
-2. **No new hard dependency on Windows-specific or GPU-specific packages.** Anything that imports `pywin32`, `pywinauto`, `pyautogui`, `sounddevice`, `faster-whisper`, `onnxruntime-gpu`, `openwakeword`, `global-hotkeys`, `mss`, `pywebview`, or any other OS- or device-bound library belongs in an **optional install extra** (e.g. `pip install personal-jarvis[desktop]`, `[local-stt]`, `[vision-local]`), never in the base `pip install personal-jarvis`.
-3. **The maintainer's setup is a power-user profile, not a baseline.** Tray icon, `pywebview` window, Orb overlay, global-hotkey wake, local Whisper, in-process Silero-VAD, PowerShell drift-guard daemon, Computer-Use harness — **all opt-in extras**. They light up when the relevant extras are installed; they degrade gracefully (with a clear, English-language message) when they are not.
-4. **The headless VPS path is a first-class runtime.** A user pointing a browser at the FastAPI / WebSocket interface, talking through the browser's microphone and speakers (or via a channel adapter — Telegram, Discord, SMS, webhook), must reach the **full** Router-Brain → Worker-Critic → Mission-Manager experience without ever installing a Windows binary, a CUDA toolkit, or a native audio driver.
-5. **Defaults in `jarvis.toml` cannot assume CUDA, local audio, or Windows paths.** STT defaults to a cloud provider (Deepgram / Google Cloud STT / Whisper-API). TTS defaults to a cloud provider (Gemini Flash TTS / Grok Voice / ElevenLabs). Wake defaults to a server-side gate (browser PTT button, channel adapter, webhook) — never a local KWS model. Brain has been provider-agnostic from day one and stays that way.
-6. **Documentation, defaults, install instructions, and onboarding lead with the cloud path.** README quick-install, CLAUDE.md, every phase doc and ADR opens with the VPS / laptop story and treats the workstation profile as a footnote inside an "Optional power-user extras" section. Re-order the doc when in doubt.
-
----
-
-## 3. Per-Layer Mapping
-
-| Layer | Cloud-First Default (base install) | Local-Optional (power-user extras) |
-|---|---|---|
-| L0 OS / Hardware | Any Python 3.11+ host (Linux container, macOS, Windows); no native binaries required | Win32 hotkeys, CUDA, WASAPI, headset detection |
-| L1 Audio I/O | Browser `getUserMedia` → WebSocket; channel adapters (Telegram, Discord, SMS, webhook) | `sounddevice` + WASAPI, shortest-token device matching, drift-guarded `jarvis.toml` |
-| L2 Speech | Cloud STT (Deepgram / Google STT / Whisper-API); cloud TTS (Gemini Flash / Grok Voice / ElevenLabs); **server-side push-to-talk replaces local wake** | `faster-whisper` + Silero-VAD + openWakeWord on local GPU; SAPI5 fallback TTS |
-| L3 Intent / Risk | Unchanged — pure Python logic | Unchanged |
-| L4 Brain | Unchanged — already five cloud providers (OpenRouter, OpenAI, Gemini, Grok, Claude-Max-OAuth-inside-workers); no Anthropic-API hard-dep | Future Ollama-local optional path |
-| L5 Harness-Adapter | Jarvis-Agents via cloud subprocess host; MCP-Remote; Codex CLI on a worker container | POAV computer-use, local PowerShell, in-tree subprocess |
-| L6 Orchestrator | Unchanged | Unchanged |
-| L7 UI / UX | FastAPI + React **served as a web app** — reachable in any browser, no native window | `pywebview` window, tray, Orb overlay, global hotkey |
-
----
-
-## 4. Honest Gap Statement
-
-This document declares the **target**, not the **current state**.
-
-**Status of the original backlog (re-checked 2026-08-20).** The list below was
-written on 2026-05-18. Most of it has since been paid off, and leaving the old
-wording in place did active harm: a paragraph that is *wholly* stale stops being
-read, and a real violation hiding inside it goes unnoticed. Current state:
-
-- **Done** — `faster-whisper`, `pywin32`, `pywinauto`, `pyautogui`,
- `global-hotkeys`, `mss` and `pywebview` all left the base install. The base is
- torch-free and enforced (`check_requirements_sync.py`,
- `check_lockfile_universal.py`), the package imports clean on Linux and macOS
- (`check_import_clean.py`), and CI proves the install across the matrix
- (`check_portable_install_matrix.py`).
-- **Done differently than planned** — `sounddevice`, `openwakeword`,
- `onnxruntime`, `vosk` and `aiortc` stayed in the base install but are gated by
- environment marker and lazy import instead of an extras group. That satisfies
- the doctrine's actual test (install and boot succeed on `python:3.11-slim`);
- `CLOUD.md` Rule #1 point 4 now names all three permitted mechanisms rather
- than a fixed list of package names.
-- **Still open** — the maintainer's operational scripts remain PowerShell-only
- (`preflight.ps1`, `run.bat`, `drift-guard-daemon.ps1`,
- `check-working-tree.ps1`, `auto-push-eod.ps1`). That is deliberate and
- permitted: see §6. The ADRs named in the original list still describe
- Windows APIs without marking them optional; `docs/os-parity.md` is the live
- register of what actually degrades where.
-
-**A stale backlog is a doc bug.** When you pay an item off, strike it here in
-the same change — the value of this section is that a reader can trust it.
-This document remains the **North Star**; future PRs steer toward it.
-
-**Pre-existing code is grandfathered until touched.** A code path that already violates the doctrine does not need to be rewritten in a panic. But any new change from 2026-05-18 forward is evaluated against this doctrine. Any *touch* of a violating code path is an opportunity to migrate it toward the cloud-first default, not extend the violation.
-
-**Maintainer dev tooling may stay Windows-PowerShell-only.** That is the *developer's* environment, not the *user's* runtime. The line is drawn at the boundary between `scripts/` (developer tools — fair game to stay Windows-only) and the importable `jarvis/` package (runtime — must run on a Linux VPS).
-
----
-
-## 5. Three Non-Negotiable Rules
-
-Three rules supersede everything else in this repo:
-
-1. **A new feature that only works on the maintainer's hardware is incomplete.** It needs either a cloud-equivalent or a graceful no-op (with a clear English-language message) when the local dependency is absent.
-2. **A new hard dependency that does not `pip install` on a fresh Linux VPS is a bug.** Move it into an extras group. The base install must succeed on `python:3.11-slim` with nothing but a network connection and the standard tooling.
-3. **A doc paragraph that describes "the user's mic", "the user's GPU", or "the Windows tray" without **first** describing the VPS / browser path is a doc bug.** Re-order the doc.
-
----
-
-## 6. What Stays The Maintainer's
-
-These are explicitly **maintainer-only**, will never become part of the open-source user experience, and may stay Windows-PowerShell-only without violating the doctrine:
-
-- `scripts/preflight.ps1` — worktree drift recovery (BUG-006 / BUG-014 / BUG-015 defense).
-- `scripts/check-working-tree.ps1` — pre-boot drift restore invoked by `run.bat`.
-- `scripts/drift-guard-daemon.ps1` — `jarvis.toml` self-healing daemon (BUG-010 triple defense).
-- `scripts/auto-push-eod.ps1` + `scripts/install-auto-push-task.ps1` — nightly tag-and-push crash-backup (primary path is push-after-commit on the shared checkout).
-- `scripts/jarvis-config-drift-guard.ps1` — config drift defense.
-- The maintainer's private GitHub CI bot integration (runs only on the maintainer's own private repositories).
-- The `~/.claude/` private configuration directory (memory, plans, brand guidelines).
-
-These are the maintainer's *operational rituals* — they keep the maintainer's workstation healthy, but they have no place in an open-source user's runtime, and they would not work there either.
-
----
-
-## 7. Pointer Network
-
-This document is referenced from:
-
-- [`README.md`](../README.md) §1 (top of file)
-- [`CLAUDE.md`](../CLAUDE.md) §"Cloud-First Philosophy" (binding doctrine block)
-- [`docs/jarvis-agents-bridge.md`](jarvis-agents-bridge.md) — preamble (planned: Jarvis-Agents harness must support a cloud-subprocess-host transport, not only local Windows subprocesses)
-- [`docs/BUGS.md`](BUGS.md) — recurring bug classes 1, 4, and 5 (restore-trap, subprocess flicker, audio host-API) are explicitly **maintainer-machine bugs** that would not occur on a cloud-first deployment, and serve as evidence for this doctrine
-
----
-
-## 8. Decision Lens For Any PR
-
-Before merging any PR from 2026-05-18 forward, the reviewer asks **one question**:
-
-> *Would this PR work, end-to-end, for a user on a fresh `python:3.11-slim` Linux container with 1 vCPU, 1 GB RAM, no GPU, no audio hardware, no Windows APIs, and only a network connection?*
-
-If **yes** — merge.
-If **no** — either (a) the local-only portion is correctly gated behind an extras group with a graceful no-op fallback in the base install, or (b) the PR is rejected and asked to split.
-
-That single question is the operational expression of this doctrine.
diff --git a/docs/agent-contract.md b/docs/agent-contract.md
deleted file mode 100644
index e0e4b2462d..0000000000
--- a/docs/agent-contract.md
+++ /dev/null
@@ -1,752 +0,0 @@
-# Agent contract — full detail
-
-This is the unabridged agent contract for Personal Jarvis. `CLAUDE.md` /
-`AGENTS.md` at the repo root is the compressed, always-loaded index of these
-rules; THIS file carries the full wording, rationale, and history. On any
-conflict, treat the two as one document — the root file is a summary of this
-one. Section numbers here match the root file's section numbers.
-
----
-
-## 0. Mirror rule — THREE trees, one source (BINDING)
-
-`CLAUDE.md` is canonical; `AGENTS.md` is its **byte-identical twin** for other
-tools. The same holds for the versioned agent-knowledge trees:
-`.claude/{agents,commands,skills}/` ↔ `.agents/{agents,commands,skills}/` —
-everything in them addresses **every** coding agent (Codex, Gemini CLI, ...),
-never Claude Code alone; write it accordingly.
-
-A **third** tree exists: `.codex/agents/*.toml`, the same definitions in the
-shape Codex reads. It is a **generated projection** of `.claude/agents/*.md`,
-not a twin — front matter becomes `name` / `description`, the Markdown body
-becomes `developer_instructions`, and Claude-Code-only fields (`tools`,
-`model`, `must_read`) are dropped rather than invented. **Never hand-edit a
-`.toml` there**; the next run overwrites it. This tree went unnamed in this
-contract and unsynced by any engine until 2026-08-20, and drifted the whole
-time — its `code-reviewer` still demanded a `SUB_TOOLS` set that AP-14 forbids
-while its Markdown source had moved on. A mirror nothing verifies is not a
-mirror.
-
-Sync engines `scripts/ci/sync_agents_md.py`, `sync_agents_dir.py` and
-`sync_codex_agents.py` run as a live `PostToolUse` hook,
-`.githooks/pre-commit --stage`, and a `--check` CI gate (the `repo-hygiene`
-job). After editing the canonical side, sync before committing. Deletions
-propagate. Gitignored/private entries (e.g. `.claude/skills/security-github/`)
-stay out of the mirror on every side.
-
----
-
-## 1. Language — English-only artifacts, fail-closed (BINDING, HIGHEST PRIORITY)
-
-Personal Jarvis is an international open-source project — assume an arbitrary
-downloader anywhere on earth. **Everything an agent commits is English**: code,
-comments, docstrings, log/exception/error messages, Markdown (READMEs, ADRs,
-plans, handoffs, forensic docs), `SKILL.md`, commit messages, PR/issue text,
-test names and docstrings, CLI help, route/schema descriptions, telemetry
-names, UI strings (i18n key + **English** source). When in doubt, English.
-Never invent a new German-allowed category — ask instead of committing German.
-
-**The ONLY German permitted — the multilingual product surface (CLOSED list):**
-
-1. **Runtime voice/TTS + chat output** — governed by the resolver below.
-2. **i18n / locale source files + the website's localized copy** — German
- there *is* the product.
-3. **Speech-recognition input vocabulary** — German tokens a classifier must
- literally contain to match German utterances. Matching *data*, not prose.
-4. **Tests / fixtures + forensic voice-bug deep-dives** quoting 1–3 as the
- content under test.
-
-Materialized file-by-file in `scripts/ci/german-allowlist.txt` — a curated,
-justified register, never a free pass: every entry names its reason, and an
-inline `i18n-allow` comment on the one load-bearing line beats a whole-file
-exemption. **Pre-existing German is backlog, not protected:** when you edit a
-file and pass non-product-surface German, translate it on the way through —
-never preserve or extend it. The CI gate (`scripts/ci/check_no_new_german.py`)
-only sees what a diff ADDS, so the agent is the first line of defense.
-Conversation language is each contributor's own choice (personal global
-config); the repo fixes only the artifacts.
-
-### Runtime output language (voice + chat) — BINDING
-
-Supported locales are equal — `de`, `en`, `es`, any future one; never a
-German- or English-only bias. This governs what Jarvis speaks/writes back and
-does NOT weaken the English-artifact rule.
-
-1. **One resolver decides a turn's output language** —
- `jarvis/core/turn_language.py::resolve_output_language`. Precedence:
- `brain.reply_language` pin → conversation stickiness (a one/two-word
- interjection must NOT flip it; only a substantive turn switches) → detected
- input language → `DEFAULT_LOCALE`.
-2. It applies to **ALL user-facing output**: deep reply, ack preamble, spawn
- announcements, every canned status/error/clarify phrase, deterministic
- readbacks, AND the TTS voice/BCP-47 pick. A mid-session flip between
- layers is a bug.
-3. **No layer re-derives the language** — no `_looks_german()`-style
- heuristics (drops `es`), no de/en-only phrase table, no per-layer default.
- New phrase tables carry ALL supported languages and resolve through the
- one resolver.
-4. A layer that genuinely can't tell falls back to `DEFAULT_LOCALE`. Durable
- pin: `brain.reply_language` (`auto` | `de` | `en` | `es`), editable in the
- desktop **Languages** view. Guards: `tests/unit/core/test_turn_language.py`,
- `tests/unit/speech/test_phrase_language.py`,
- `tests/unit/brain/test_*language*.py`.
-
----
-
-## 2. GitHub — ONE public repo, fail-closed credential protection (BINDING)
-
-The ONE project repo is the public flagship
-**`https://github.com/PersonalJarvis/PersonalJarvis`**; every maintainer
-"commit / push / save to GitHub / sichere den Stand" targets it — never ask
-"which repo". <!-- i18n-allow: quoted German maintainer trigger phrase -->
-Lowercase `personal-jarvis` (remote `origin`) is a silent local backup, never
-the deliverable. The former depersonalization/snapshot gate is RETIRED
-(maintainer directive 2026-07-17): ONE shared git history, every machine
-pushes and pulls it normally.
-
-**A push is `git push`.** This repo is an ordinary open-source project and
-ships like one. Forbidden as part of pushing (maintainer directive
-2026-08-05, after a measured ~440k tokens per push): building a parallel
-"clean" staging tree, cloning the target repo to reconcile into, running
-`npm ci`/a frontend build, and above all dispatching a sub-agent to read
-every file in the tree looking for personal data. That audit re-read 5,481
-already-published files on every push; a regex scan, `.gitignore`, and
-GitHub's own push protection already cover it. If you find yourself
-preparing a snapshot instead of pushing a commit, stop — that is the
-retired gate growing back. The same ban covers review sub-agents
-(maintainer directive 2026-08-12): a push or release ships commits that
-already exist, and that code was reviewed when it was written — spawning
-`code-reviewer` (or any reviewer) at push time is the retired ceremony in
-a different costume. Review happens when code is authored, never when it
-is published.
-
-What remains, fail-closed:
-
-1. **`.gitignore` first** — `data/`, `.env`, `jarvis.toml`, the Vault, and
- key material are never tracked. This is the load-bearing layer: nothing
- personal is in the tree, so nothing personal can be pushed.
-2. **Never commit credentials** — API keys, tokens, private keys (incl.
- `*.key.enc`, AP-29), passphrases. `check_no_private_keys.py` + the secret
- sweep stay wired in pre-commit and pre-push.
-3. **GitHub secret scanning + push protection stay ON.** A blocked push is a
- real finding: stop and fix — never bypass or allowlist around it.
-4. **Trademark/brand review is a human release checkpoint** — flag concerns
- to the maintainer instead of shipping them.
-
-**Gate placement is a rule, not a preference.** A check that reads the whole
-tree belongs in CI (`.github/workflows/ci.yml`), never in `pre-push`. Only a
-check that (a) judges the pushed change alone and (b) guards something
-unrecoverable — a leaked credential — may block a push. Everything else
-reports on GitHub's runners, where a red result costs a notification rather
-than a debugging session. Adding a gate to `.githooks/pre-push` requires the
-maintainer's explicit say-so; adding one to CI does not.
-
-**Two volumes:** *Update (DEFAULT)* — "push", "sichere den Stand" → normal
-push, no bump/tag/release. *Release (explicit only)* — "Mach ein Release",
-"mach eine neue Version" → SemVer bump + tag + CHANGELOG, shipping the ENTIRE
-current local state (reconcile with `public/main` first; never knowingly ship
-a release lacking local fixes without saying so). <!-- i18n-allow: quoted German maintainer trigger phrases -->
-When ambiguous, update. **Pre-tag gate:** run
-`python scripts/ci/check_release_completeness.py` before tagging and again
-with `--verify-release` after publishing — a pushed tag without a *published*
-GitHub Release updates no managed install.
-
-**Finished work ships.** On the shared primary checkout (`.git` is a
-directory, not a linked worktree), after each completed logical step is
-committed, land it: `git pull --rebase --ff-only` if `origin` has moved,
-then `git push`. That is the standing authorization — do not wait for a
-separate "push" utterance. Linked worktrees (mission workers, isolated
-agent worktrees) commit locally and do not push; the parent on the
-primary checkout lands that work. Never `--force`, never `--no-verify`.
-Maintainer phrases "push" / "sichere den Stand" remain valid for anything
-still local (crash before push). Releases stay explicit-only (volumes
-above). Doctrine: [`CLOUD.md`](../CLOUD.md).
-<!-- i18n-allow: quoted German maintainer trigger phrase -->
-
----
-
-## 3. Open-source universality — the maintainer's config is NEVER the baseline (BINDING)
-
-**Assume an arbitrary downloader, never the maintainer.** This governs the
-whole product surface and the entire credential/integration surface — brains,
-STT, TTS, Vision, Wake, Telephony, Channels, Marketplace plugins (OAuth +
-MCP), and credential STORAGE itself. Every one must:
-
-- **Work with WHATEVER single key/login the user has** — no provider, model,
- or integration is load-bearing; a missing / depleted / 429 / 402 /
- unreachable one degrades or crosses to a **different family** with an
- honest message, never bricking a core path. Primary AND fallback in the
- same family = a single-provider brick (AP-22); gate on **capability**,
- never a provider name/model id (AP-21).
-- **Work on EVERY OS, incl. a headless `python:3.11-slim` VPS** with no
- keyring, GPU, audio, or Windows APIs — base `pip install` + boot must
- succeed there. Use `pathlib` + capability probes + UTF-8; never hardcode
- `<USER_HOME>` or assume cp1252. **Base install stays torch-/GPU-free**,
- enforced by `check_requirements_sync.py` + `check_lockfile_universal.py`
- (GPU/torch deps live only in the opt-in `[local-voice]` extra); regenerate
- the lock only with `uv pip compile --universal`. The ONE advertised install
- path is the `[full]` profile; the torch-free base is the internal floor for
- CI and tiny servers (`--headless`).
-- **Be recoverable IN-APP** — entering/switching/recovering a credential
- never requires hand-editing `jarvis.toml` or exporting ENV vars.
-- **Store credentials portably** — OS keyring → ENV/.env → local-file
- fallback (`config._ensure_keyring_backend`); a save/connect must never 500
- on a host without a Secret Service.
-
-### Provider & mode parity — every key, every engine, every surface (BINDING)
-
-The maintainer's current setup — one realtime transport, one brain family,
-one voice mode, one OS — is a sample of ONE, never the design target. Every
-feature, and every analysis, plan, estimate, or ADR that precedes it, is
-designed for the FULL matrix from the first sentence (maintainer directive
-2026-08-18):
-
-- **Every provider family and every key the app accepts** — all Brain /
- Tool-Model providers (cloud AND local Ollama/llama.cpp), every realtime
- transport (`openai-realtime`, `gemini-live`, `vertex-live`, the tool-less
- handoff transports), every STT / TTS / Vision / Wake provider. The
- enumeration is the CODE — `jarvis/core/config.py` (credential families,
- provider ids) and `jarvis/realtime/factory.py` — never this file and never
- the dev box's `jarvis.toml`.
-- **Every mode and surface** — the realtime engine AND the classic pipeline
- (`[voice].mode`), text chat (desktop app, headless launcher, browser UI),
- channels (Telegram / Discord / webhook / SMS), the CLI.
-- **Every OS** — see the next subsection.
-
-**Proportionality (BINDING, added 2026-08-20).** This section states the
-standard, not the ceremony every change must perform. The evidence a change
-owes is set by the SURFACE IT TOUCHES, in three tiers — decide the tier first,
-in one line, and then owe only that tier:
-
-| Tier | What you touched | What you owe |
-|---|---|---|
-| **1 — Local** | Styling, copy, a single view, a test, a doc, a refactor behind one call site. Nothing provider-, mode-, or OS-facing. | Nothing extra. Ship it. Naming a matrix here is noise, not diligence. |
-| **2 — One surface** | An existing provider adapter, one transport, one channel, one OS backend — without changing the shared contract. | Name the cells you touched and what happens on the others (unchanged / emulated / degraded). Tests for the family you touched. |
-| **3 — Contract** | A capability, a shared interface, turn-taking, credentials, config schema, a new provider/transport/OS backend, anything the five paths below can brick. | The full treatment: the matrix named, `tests/contract/` coverage per family, and the five non-maintainer paths verified. |
-
-Tier 3 is where this project earns its promise; tiers 1 and 2 are where it
-stays fast. **Mis-tiering downward is the defect** — if you are unsure whether a
-change is 2 or 3, it is 3. Mis-tiering *upward* is also a defect: a CSS fix
-that arrives with a provider matrix wasted the effort that a real tier-3
-change deserved. State the tier in the PR or commit body; one line is enough.
-
-Rules:
-
-1. **Design once, capability-gated (AP-21).** A transport- or
- provider-specific mechanism (a native async function call, a streaming
- flag, a voice pin, a schema subset) is ONE capability the adapter
- declares. Every other provider gets the same user-visible behaviour
- through the generic path or an emulation, or degrades honestly with a
- stated reason. "Works on vertex-live" or "works in realtime mode" is one
- cell of the matrix, not done.
-2. **Name the matrix before building — at tier 2 and above.** An assessment,
- plan, ADR, or PR that touches a provider- or mode-facing path states which
- cells it covers natively, which it emulates, and which degrade — and why.
- The maintainer's cell is never the implicit reference; an analysis that
- reasons only from the dev box's current provider is incomplete and is
- redone. At tier 1 this rule does not apply at all.
-3. **Test the families, not the favourite.** A change to a provider-facing
- contract lands with `tests/contract/` coverage or fakes for each family
- it touches; a change to turn-taking, acknowledgments, interim speech, or
- result delivery lands with tests for BOTH voice engines and the chat
- surface.
-4. **Read the enumerations from the code**, never from what is currently
- configured: `git show`/grep the provider tables before scoping, and list
- every entry, including the ones the dev box has no key for.
-
-### OS feature parity — macOS and Linux are first-class (BINDING)
-
-Every feature that TOUCHES an OS-specific path ships working on **all three
-OSes in the SAME change**, never as a "later" follow-up. (Tier 1 work touches
-no such path and owes nothing here — a component that only renders does not
-need a macOS story.) OS-specific backends live behind ONE capability probe
-(Win32/UIA ↔ AppleScript/Quartz/AXUIElement ↔ xdotool/AT-SPI/D-Bus);
-`sys.platform == "win32"` with silent nothing elsewhere is a defect. Where a
-backend is genuinely impossible (headless), degrade to a clearly-messaged
-English no-op. A Windows-only implementation lands ONLY with the capability
-gate + honest degradation + a tracked entry in
-[`docs/os-parity.md`](os-parity.md).
-
-**Definition of done — TIER 3 ONLY** (a capability, a shared interface,
-credentials, config schema, a new provider / transport / OS backend). At tier 1
-and 2 this list does not apply; see the proportionality table above. When it
-does apply, verify the FIVE non-maintainer paths (test or honest manual trace):
-
-1. **Fresh install, ONE arbitrary key** reaches a working path (chat + voice
- + Jarvis-Agent + the touched feature), entirely in-app.
-2. **Headless Linux** — base install + boot + the feature on
- `python:3.11-slim`; local-only parts degrade to a logged no-op.
-3. **macOS** — works there, or degrades honestly + `docs/os-parity.md` entry.
-4. **Cross-family fallback** — a dead/absent configured provider crosses to
- whatever the user actually has, or degrades honestly.
-5. **Provider & mode parity** — the feature behaves the same, or degrades
- honestly per declared capability, on EVERY provider family the touched
- surface accepts (all realtime transports, all brain families incl. local,
- all STT/TTS/Vision/Wake) and in EVERY mode and surface it is reachable
- from (realtime engine, classic pipeline, chat, channels, CLI) — with the
- covered / emulated / degraded cells named in the change.
-
-"It works on my machine" is the *defect* — the maintainer's box is <0.1 % of
-the install base. Doctrine: [`CLOUD.md`](../CLOUD.md) +
-[`docs/PHILOSOPHY.md`](PHILOSOPHY.md) (doctrine wins). See AP-21/22/23.
-
-### Local-model currency (BINDING)
-
-Every Ollama or llama.cpp model used as a default, recommendation, managed
-profile, or current setup example must be checked against the official live
-catalog when it is added or changed. Select the newest capable generation and
-the strongest quantization that fits the target hardware honestly; never keep
-an older id merely because it was once tested on the maintainer's machine. An
-artifact whose official catalog entry is shown as one year old or older is
-forbidden in those surfaces. A benchmark-specific compatibility pin may remain
-only outside the general defaults, with its measured reason and the test or
-condition that removes it. The live Ollama catalog guard is
-`tests/integration/test_ollama_catalog_is_current.py`.
-
-### Device-parity triage ritual (BINDING)
-
-"Works on the dev box, broken on device X" has THREE independent causes —
-check in order, name the layer (runbook:
-[`docs/device-parity-debugging.md`](device-parity-debugging.md)):
-
-1. **Version lag** — compare `GET /api/update/status` → `current` vs the dev
- box; uncommitted/unpublished work exists nowhere else, and the in-app
- updater only moves between **published** GitHub Releases.
-2. **Setup divergence** — config, keys, and data never travel with the code;
- key-aware fallbacks (AP-22) degrade QUIETLY, so "broken" is usually
- "downgraded for lack of a key". Align providers, mode, and wake word
- in-app before debugging.
-3. **OS gap** — assumed only after 1+2 match; then the parity rules above
- apply.
-
-### Marketplace — the standard binds US first (BINDING)
-
-Same figure as the rest of this section: the project's own work is never the
-exception. We publish a submission standard, so **everything the marketplace
-lists meets it — starting with ours.**
-
-1. **A listing is something that was published.** To appear anywhere in the
- store — the browse list, the counts, the search, the category chips, the
- sort tabs, a detail page — an entry must have come through the registry
- (`PersonalJarvis/marketplace`) as an Agent Plugins **1.0.0** `plugin.json`
- (+ `mcp.json` where it talks to a server), and therefore carry a
- publisher, a version, a published date, a readable folder, and an install
- command. No manifest, no listing.
-2. **What ships inside the app is NOT a listing.** The connectors in
- `jarvis/marketplace/seed_catalog.json` are described by our internal
- schema, cannot be installed, and must never be mixed into the catalog,
- the totals, the search index, or a listing page. They belong in the
- "built in" connector wall / product surface, which says plainly that they
- come with the app. Reintroducing them as listings is the defect this rule
- exists to prevent (2026-08-16: 21 of 22 store plugins were un-installable
- built-ins under an "Official" tick, sorted ahead of the published work).
-3. **A built-in reaches the store only the way a stranger does** — a registry
- PR, the standard manifest, the same CI. There is no internal shortcut and
- no second, laxer shape.
-4. **"Official" says who wrote it, never that anyone checked it.** Every
- registry entry — ours included — carries the "Not human-reviewed" mark,
- because the merge is automated. An official tick that implies review is a
- lie about the gate.
-5. Binds ALL THREE repos: the app (seed catalog + the Plugins view), the
- registry (validation), and the storefront (`personal-jarvis-webui`, whose
- `AGENTS.md`/`CLAUDE.md` carry the same rule in its own terms). This file
- is the source; a change here is a change there, the same discipline as the
- argument rules already shared across the three.
-
----
-
-## 4. Naming — internal "Jarvis-Agents", user-visible brand is DYNAMIC (BINDING)
-
-1. **Internal name** (code identifiers, files, docs, comments, commits, log
- lines, i18n KEYS, API paths): **Jarvis-Agents** / singular
- **Jarvis-Agent**. No other internal names.
-2. **User-visible brand** (UI labels, TTS output, transcript labels, API
- strings the UI displays, tool-schema prose spoken by the router): derived
- from the configured wake word — "Hey Nova" → **"Nova-Agent(s)"**, any
- wake word likewise, neutral fallback **"Assistant-Agent"**. NEVER hardcode
- a fixed name in a user-visible string. Plumbing: i18n token `{name}-Agent`;
- `agentBrand`/`useAgentBrand` (`src/lib/agentBrand.ts`);
- `agent_brand`/`agent_brand_from_name`
- (`jarvis/brain/assistant_name.py`). Tests pin an arbitrary brand (e.g.
- "Nova-Agent"), never the host's live wake-word config.
-
-**Glossary:** the retired internal codenames ("Subagents" / "sub_jarvis" /
-the old bridge codename) stay dead repo-wide. The old bridge codename
-survives ONLY where functional: (a) the external `openclaw` npm worker
-binary — an outside project; invocation strings, env vars, and install
-commands stay literal; (b) read-time back-compat aliases that keep old
-installs booting (`[brain.worker]`/`[harness.jarvis_agent]` still accept
-`[brain.sub_jarvis]`/`[harness.openclaw]`; legacy `openclaw_state` dirs are
-recognized) plus their pinning tests. Do not reintroduce it elsewhere — and
-do not "clean up" those aliases or literal binary strings either.
-
----
-
-## 5. Architecture essentials (respect on every change)
-
-Full model + module catalog:
-[`docs/architecture-overview.md`](architecture-overview.md).
-
-- **8-layer dependency rule:** higher layers reach lower ones only via
- protocols (`jarvis/core/protocols.py`); lateral communication only via
- typed `frozen=True` events on `EventBus` (`jarvis/core/bus.py`) carrying
- `trace_id` + `timestamp_ns`. A broken subscriber is logged in
- `_safe_dispatch`, never propagated (AP-18).
-- **Plugins are structural:** `jarvis/plugins/<group>/<name>.py`, registered
- via `pyproject.toml` entry-points, no `jarvis.*` import in the plugin
- module. After editing entry-points: `pip install -e . --no-deps`. Groups:
- wakeword, stt, tts, brain, harness, tool, channel.
-- **Streaming first:** Brain/STT/TTS/Harness methods return
- `AsyncIterator[...]` (non-streaming yields one element).
-- **Secrets** only via `jarvis.core.config.get_secret` (keyring → ENV →
- `.env` → local file). Never in code / `jarvis.toml` / commits /
- `.claude/`. Installer signing PRIVATE keys live ONLY in GitHub Actions
- secrets (AP-29). Voice/chat must never accept secrets (AP-2).
-- **Brain is multi-provider** — never hardcode Anthropic/Claude (AP-6); gate
- on capabilities (`supports_vision`, `supports_tools`, `can_call_tools()`),
- never provider/model ids (AP-21). Persona via
- `jarvis/brain/persona_loader.py`, never hardcoded.
-- **Router discipline (ADR-0011):** the router-tier brain is a pure
- dispatcher over the `ROUTER_TOOLS` frozenset (`jarvis/brain/factory.py`);
- no spawn tool ever enters a worker set (AP-5/AP-14). Extending
- `ROUTER_TOOLS` → amend ADR-0011 + `tests/unit/brain/test_routing.py`.
-- **Voice scrub:** brain→TTS goes through `scrub_for_voice`
- (`jarvis/brain/output_filter.py`) — regex only, no LLM call (AP-11,
- ADR-0010).
-- **Atomic config writes:** mutate `jarvis.toml` only via
- `jarvis/core/config_writer.py` (lock + tempfile + BOM-safe, AP-7). The
- self-mod pipeline (Allowlist → Pre-Validate → Backup → replace → sync
- reload-test → Rollback → Audit) is non-negotiable (AP-13/14).
-- **CLI-first feature contract (mandate 2026-07-11):** every user-facing
- capability ships its actions as REST routes under
- `jarvis/ui/web/*_routes.py`, mounted + tagged (enforced by
- `scripts/ci/check_cli_coverage.py`) — each action becomes a
- `jarvis api <tag> <op>` CLI command automatically. UI-only / internal-only
- / brain-tool-only features are NOT done. On top: voice/agent-relevant
- actions add a Command-Registry entry (`jarvis/commands/registry.py`,
- drift-gated by `gen_commands_reference.py --check`); destructive routes
- declare `openapi_extra={"x-jarvis-dangerous": True}`
- (`check_danger_metadata.py`); high-value routes get a curated
- `jarvis <group> <command>` (checklist: the `generate-cli-command` skill).
-- **Multi-layer enum drift:** any value crossing Python ↔ SQL ↔ Pydantic ↔
- TS ↔ UI uses the five-layer pattern
- (`docs/anti-drift-three-layer.md`) + a parity test, preemptively (BUG-008
- recurred 4×).
-- **Worker isolation:** every mission worker runs in a fresh `git worktree`
- under `<repo_parent>/jarvis-agent-outputs/` (legacy `sub-agents-outputs/`
- read as fallback) with kill-on-crash containment (Job Object on Windows,
- process-group reaper on POSIX). Headless installs keep outputs + per-user
- `HOME` under `JARVIS_DATA_DIR` (ADR-0027). `MAX_CRITIC_LOOPS = 3` is fixed.
-- **Worker tool broker:** tools delegated to mission workers use a
- short-lived, mission-scoped supervisor grant (ADR-0025); tool objects and
- credentials stay in the supervisor; every call runs through `ToolExecutor`.
- Recursive/skill/secret/config-mutation tools are never exported; an
- unattended ask-tier action never becomes an implicit yes.
-- **Native Windows Codex workers:** keep `--ignore-user-config`, use the
- ACL-bounded `unelevated` sandbox, recover rejected file-change tools only
- through BOM-free UTF-8 writes inside the current worktree (ADR-0026).
-- **Platform gotchas:** UTF-8 stdout (Windows defaults cp1252); every
- subprocess passes `NO_WINDOW_CREATIONFLAGS` (AP-1); WASAPI audio, WDM-KS
- forbidden (BUG-014); no Windows Service (SYSTEM has no mic); UAC
- `asInvoker`, elevate per-action.
-
----
-
-## 6. Safety / risk tiers
-
-Four tiers `safe` / `monitor` / `ask` / `block`, priority **blacklist >
-whitelist > tool default** (`jarvis/safety/risk_tier.py`); whitelist
-downgrades to `safe` (anti-confirmation-fatigue contract). Direct
-`Tool.execute()` is a bug — only `ToolExecutor.execute()` is authorized
-(AP-3). Generated skills land as `state="draft"`, never auto-activated
-(AP-15).
-
----
-
-## 7. Critical anti-patterns (do not do this)
-
-| # | If you do this... | ...you get this bug |
-|---|---|---|
-| AP-1 | `subprocess.Popen` without `NO_WINDOW_CREATIONFLAGS` | BUG-012 flicker storm under `pythonw.exe` |
-| AP-2 | Accept API keys via voice/chat | STT log leak — credential exfiltration |
-| AP-3 | Call `Tool.execute()` directly | Risk-tier/whitelist/plausibility skipped |
-| AP-4 | Add a `hangup_reason`/mission-status string in one site only | BUG-008: HTTP 500, empty UI |
-| AP-5 | Put a spawn/`dispatch-with-review`/`run-skill` tool in a worker tool set | Recursion: worker spawns supervisor |
-| AP-6 | Hardcode the `Claude`/`Anthropic` API client | Breaks `cfg.brain.primary` for non-Anthropic users |
-| AP-7 | Write `jarvis.toml` without `_WRITE_LOCK` + tempfile + BOM handling | BUG-018: corrupted TOML, backend won't boot |
-| AP-8 | Skip `scripts/preflight.ps1` in a new worktree | BUG-006/014: edits go where live Python doesn't import from |
-| AP-9 | Run awareness/wiki code in the voice critical path | Latency regression — awareness stays off the hot path |
-| AP-10 | Write a worker without `git worktree` + Job Object | Races + zombie processes on crash |
-| AP-11 | Add an LLM call inside `scrub_for_voice` | TTS latency tank |
-| AP-12 | Encode API keys in `jarvis.toml` or commit `.env` | Credential leak, bypasses keyring audit |
-| AP-13 | Block on watchdog reload for atomic-write verification | Race: file half-applied, no sync rollback |
-| AP-14 | Re-add a sub-tier or `SUB_TOOLS` set | Breaks the agent-harness bridge contract |
-| AP-15 | Auto-activate generated skills (`state` ≠ `draft`) | Skills run without review |
-| AP-16 | Add `[phase6.*]`/`[memory.wiki.*]` keys without `ConfigDict(extra="allow")` | Pre-validate rejects → boot fails after self-mod |
-| AP-17 | Run Jarvis as a Windows Service | SYSTEM has no mic/headset access |
-| AP-18 | Propagate a subscriber exception from `EventBus._safe_dispatch` | One handler kills the pipeline |
-| AP-19 | Reuse a process-global progress counter in a stall watchdog without per-unit reset | BUG-032: watchdog fires between units, aborts a fresh answer |
-| AP-20 | `continue` a WS receive loop on a non-`WebSocketDisconnect` error | Loop spins on a dead socket; catch `RuntimeError` and `break` |
-| AP-21 | Pin a feature to a provider name/model id instead of a capability | Breaks for every other provider; fix the capability flag instead |
-| AP-22 | Give a tier a primary AND fallback in the SAME provider family, or hardcode provider names in a chain | Single-provider brick; resolve every tier through one key-aware, family-crossing chain that degrades honestly |
-| AP-23 | Build or test only against the maintainer's config/keys/OS and claim done | Whole surface bricked for every other downloader; verify §3's paths |
-| AP-30 | Catch an exception and neither log, re-raise, nor say why silence is right | The feature just does nothing and nobody can tell it failed — the single largest source of "it only half works" (gate: `check_silent_exception_handlers.py`) |
-| AP-31 | Add a config field nothing reads, or leave a switch whose value is ignored | `jarvis.toml` and the settings screen promise behaviour that does not exist (gate: `check_config_switches_wired.py`) |
-| AP-32 | Mount a WebGL renderer without giving the context back | A browser allows ~16 live contexts and kills the OLDEST to make room, so the leak kills a DIFFERENT, innocent scene — and the browser paints its broken-canvas placeholder there (gate: `check_webgl_contexts_released.py`) |
-
-### AP-32 — Never mount a WebGL renderer without a release path
-
-A browser gives a page a small, fixed number of live WebGL contexts (Chromium:
-16) and enforces the cap by silently taking the OLDEST one away. `dispose()`
-does not return a context — only `WEBGL_lose_context` / `forceContextLoss()`
-does. So the component that leaks is never the one that breaks: the scene that
-dies is whichever has been running longest, and the browser paints its own
-broken-canvas placeholder there — a white rectangle with a small sad face —
-while the app carries on believing everything is fine. Measured 2026-08-21:
-fourteen trips into the Wiki section and back left fifteen live contexts behind
-ONE canvas, and the deck's memory map (mounted since boot) went white.
-
-Two obligations, and the second is as binding as the first, because a GPU reset
-takes every context no matter how clean the release path is:
-
-1. **Give it back.** On unmount, hand the context to the browser.
-2. **Survive losing it.** `webglcontextlost` must call `preventDefault()` —
- without it the browser never fires `webglcontextrestored` — and the scene
- must be rebuilt on a fresh canvas. When rebuilding fails repeatedly, degrade
- honestly (the flat map) with the REAL reason, never a dead canvas.
-
-Both live in `jarvis/ui/web/frontend/src/hooks/useWebglSurface.ts`; use it
-rather than re-deriving them. Note the trap it documents: React commits the
-rebuilt child BEFORE running the old effect's cleanup, so touching the graph
-ref in that cleanup reaches the NEW scene and pauses it.
-
-### AP-24 — Never share a native inference engine between concurrent callers
-
-ctranslate2/faster-whisper and ONNX/torch sessions are not thread-safe; a
-concurrent call wedges them permanently, and a timeout only BOUNDS a hung
-`to_thread`, never recovers it. Fix: a non-blocking per-instance inference
-lock (second caller skips) + a `recover()` that rebuilds a FRESH model after
-N failures (BUG-036). Never "recover" by re-polling the same wedged engine.
-
-### AP-25 — Never enable GPU wake on CUDA *presence* or a hardware name
-
-CUDA presence and CUDA *usability* diverge (a present-but-broken runtime once
-left wake permanently deaf). Gate the GPU wake upgrade ONLY on the
-out-of-process **inference probe**
-(`jarvis.plugins.stt._wake_gpu_inference_verified`: one real turbo/cuda
-transcribe in a killable subprocess, stdout-marker verdict — never the exit
-code; cached per ctranslate2 version in `data/wake_gpu_probe.json`). Keep the
-probe off the boot path (background hot-swap only), a FIXED `cpu_threads` on
-the CPU floor, and the live backstop (a wedge swaps back to the retained
-cpu fallback + `mark_wake_gpu_bad()`). `[stt].wake_high_accuracy=false` is
-the hard opt-out. Truly instant custom-word wake needs a trained neural KWS
-model, not transcription. Detail:
-`docs/local-wakeword/WAKE-RELIABILITY-DEEPDIVE.md`.
-
-### AP-26 — Never put a feature's init/import on the startup critical path
-
-Nothing initializes before `APP_INTERACTIVE` / `VOICE_USABLE`: no sync load
-in `_run_backend`, the `WebServer` ctor, or `_start_speech_and_orb`; no
-module-level heavy import. New subsystems hook into `_heavy_backend_bg`, a
-deferred registry scan, or a post-ready task; heavy imports stay lazy; routes
-answer 503/None while warming. Measured by the BOOT BUDGET harness
-(`scripts/ci/check_boot_budget.py`: window ≤ 8 s, voice-usable +
-app-interactive ≤ 20 s). It is an **on-demand local command**, not a push
-gate (2026-08-05): it boots the whole application, so as a pre-push hook it
-cost a full cold boot per push and counted the inevitable failed boot of a
-dependency-less fresh worktree as a budget violation. It has no CI home
-either — a GitHub runner has no audio device, so the harness cannot measure
-`VOICE_USABLE` there and would either self-skip or false-fail. Run it by
-hand after touching the startup path:
-`python scripts/ci/check_boot_budget.py`. Doctrine:
-`docs/diagnostics/BOOT-TTU-NOTES.md`.
-
-### AP-27 — Never gate a wake word on transcript CONTENT
-
-This is a property of EVERY wake engine that verifies via a transcript, not
-an engine quirk: a bias-primed model hallucinates the phrase on silence AND
-garbles it on real speech, and every wake word is out-of-vocabulary for some
-installed language model — so any content rule that suppresses ghosts also
-rejects genuine wakes ("fires on silence" and "goes deaf" share ONE root),
-and no spelling threshold can separate them. Verify only on WORD-AGNOSTIC
-properties: raw audio ENERGY at the match site (`stt_match`:
-`RollingWhisperWake._match_min_rms`; keep the bias-echo confirm PERMISSIVE
-and skip it on a loud window) and the SHAPE of the candidate span
-(`vosk_kws`: `candidate_shape_ok` — duration, word count, free-decoder
-confidence, all derived from the configured phrase, never its spelling). A
-spelling match may only ever ACCEPT (bonus path), never reject. Guards:
-`tests/unit/speech/test_rolling_whisper_wake_silence_ghost.py`,
-`tests/unit/plugins/wake/test_vosk_wake_word_agnostic.py`. Measurements +
-history: `docs/local-wakeword/WAKE-RELIABILITY-DEEPDIVE.md`, BUG-037.
-
-### AP-28 — Never gate CI checks on `isinstance` against an unpinned third-party lib
-
-CI installs newest; the lib's next release changes internals and the gate
-false-fails in CI while green locally (Typer 0.26 vendored its own Click,
-fix 621f837a). Discriminate by CAPABILITY (`.commands`, Click's stable
-`param_type_name`), never concrete type. Before anything goes public: CI must
-be green and every red cause understood — reproduce against the SAME unpinned
-versions CI installs, not your local pins.
-
-### AP-29 — Never commit a signing PRIVATE key, its passphrase, or a `*.key.enc` copy
-
-Installer signing private keys (Wave 2 Ed25519, Wave 4 ML-DSA-65) live ONLY
-in GitHub Actions secrets (`WAVE2_OFFLINE_KEY_B64` / `WAVE4_MLDSA65_KEY_B64`),
-backup in the maintainer's password manager; the repo holds ONLY public keys
-(`install/keys/*.pub*`) + inlined verifier copies. (An earlier in-repo
-"encrypted at rest" scheme leaked its passphrase into 14 permanent public
-snapshots.) Rotation = new keypair → `gh secret set` → swap public keys +
-verifier blocks + fingerprints. Enforced by
-`scripts/ci/check_no_private_keys.py` (pre-commit + pre-push). Doctrine:
-`docs/supply-chain/wave2-key-ceremony.md`.
-
----
-
-## 8. Recurring bug classes — symptom → cause
-
-§7 reads forward (*don't do this*). This table reads BACKWARD: you are staring
-at a symptom and want the anti-pattern behind it. That is its whole job — it
-adds no rules of its own. Detail in [`docs/BUGS.md`](BUGS.md).
-
-| You are seeing… | It is | Fix |
-|---|---|---|
-| Fix works in tests, behaviour unchanged after restart | Restore trap (BUG-006/014/015) | `pwsh scripts/preflight.ps1`, then `python -c "import jarvis; print(jarvis.__file__)"` (AP-8) |
-| Empty UI list while the DB has rows; Pydantic `literal_error` | Enum drift (BUG-008, 4× recurrence) | Five-layer pattern + parity test (AP-4) |
-| A `jarvis.toml` switch silently rolls back | Config drift (BUG-010) | Drift-guard daemon + ENV override + BOM-safe writer (AP-7) |
-| Console windows flickering under `pythonw` | Console flicker (BUG-012) | `NO_WINDOW_CREATIONFLAGS` from `jarvis.core.process_utils` (AP-1) |
-| TTS silent, PortAudio crashes | Audio host-API trap (BUG-014) | `_FORBIDDEN_OUTPUT_HOSTAPIS` + shortest-unique-token matching |
-| Watchdog aborts a fresh answer | Stale counter (BUG-032) | Reset per unit of work (AP-19) |
-| Receive loop spinning on a dead socket | Socket teardown | Any read error is terminal — `break` (AP-20) |
-| STT wedged permanently, timeouts do not recover it | Wedged native inference (BUG-036, BUG-151 open) | Non-blocking lock + rebuild a fresh model (AP-24) |
-| Wake fires on silence, or goes deaf on its own word | Wake transcript trap (BUG-037) | One root, not two: word-agnostic verification only (AP-27) |
-| A feature "half works" and nothing is logged | Silent handler | Log, re-raise, or say why silence is right (AP-30) |
-| A settings switch changes nothing | Unwired config | Read the value or delete the field (AP-31) |
-| A white rectangle with a small sad face where a 3D view was | Lost WebGL context | Release the context on unmount and rebuild on loss — `useWebglSurface` (AP-32) |
-
----
-
-## 9. Operational reality & Git workflow
-
-- **The working tree is frequently SHARED** — several agent sessions edit it
- at once. Never assume the staged diff is only yours; commit hunk-isolated
- (`git add -p` / pathspec-scoped). A large uncommitted diff is normal. On a
- corrupted-looking index/HEAD, recover via temp-index commit + `update-ref`
- CAS + safety branch (`git-rescue` on repo-wide disorder).
-- **Desktop lifecycle actions are maintainer-gated.** Coding agents must not
- restart, quit, kill, or relaunch the desktop app unless the maintainer
- explicitly authorizes that exact lifecycle action in the current
- conversation. A task such as "finish", "verify", or "fix it" is not restart
- approval, and `--yes` is not human presence. Before an authorized action,
- verify the exact Personal Jarvis PID and command line with read-only checks;
- target only that process and never a name-wide Python/process set. Prefer the
- supported in-app relauncher. If the UI is absent, an authorized agent may
- terminate only the verified process and relaunch `jarvis.ui.web.launcher`
- with the same interpreter and repository working directory. Verify the new
- PID, API reachability, and desktop window afterward. Without explicit
- approval, state why a fresh process is needed and let the maintainer click
- Restart in the desktop UI. The server still rejects Control-API/Bearer
- restart requests so unattended automation remains fail-closed.
-- **Jarvis is used as a DESKTOP APP, not a browser tab.** The window is an
- embedded WebView (`jarvis/ui/desktop_app.py`) with no address bar, no
- reload button and no dev tools, so "press Ctrl+R / F5", "hard-refresh",
- "clear the browser cache" and "open the console" are instructions that
- cannot be followed — never end a frontend change with one. A frontend fix
- reaches the user in exactly ONE step: `npm run build` in
- `jarvis/ui/web/frontend/` (the app serves the built `dist/`, never Vite).
- Every open window then picks the new bundle up by itself within seconds —
- `src/lib/bundleWatch.ts` compares the hashed assets the server would hand a
- fresh window against the ones this one is running, and reloads once the
- change has settled and the user has stopped typing. **Do not end a frontend
- change by asking for a restart**: restarting stops the voice stack and the
- live terminal panes to replace files the window fetches on its own. Running
- from a browser against `--dev` is a contributor path, not the maintainer's.
-- **Frontend changes ship in BOTH themes.** The app has a light and a dark
- mode, and the Agentic IDE's terminal panes carry their own light/dark
- appearance on top that may disagree with the app theme. A UI change is done
- only when it reads its colours from the theme system — the app's CSS tokens
- (`--background`, `--primary`, …) for app-level surfaces, the per-appearance
- tables in `jarvis/ui/web/frontend/src/components/agentic/terminalThemes.ts`
- (`PANE_BRAND` / `PANE_CHROME`) for anything on a pane's own ground — and has
- been checked legible in both modes. Hardcoding one mode's colours is a
- defect, not a default. (Full rule: `CLOUD.md` → "Frontend theming".)
-- **New worktree:** run `pwsh scripts/preflight.ps1` before writing code;
- non-zero exit → fix first (BUG-006/014).
-- **Memory:** check `MEMORY.md` (`~/.claude/projects/.../memory/`) before
- larger decisions.
-
-### Git workflow
-
-*(Also pinned in the maintainer's personal global config; restated here so
-every contributor and agent follows it.)*
-
-- **Auto-commit after each completed logical step**, staging only YOUR files
- by explicit path or `git add -p` — never `git add -A` / `git add .`
- (sweeps another session's in-flight, possibly secret-bearing work in).
-- **Conventional-Commit messages** (`feat:`, `fix:`, `refactor:`, `docs:`,
- `chore:`).
-- **Then push** from the primary shared checkout (`git pull --rebase
- --ff-only` if origin moved, then `git push`). Linked/mission worktrees
- do not push. Never `--force`.
-- **Never commit secrets / `.env` / keys / tokens.** If any appear
- untracked: stop, flag, don't commit.
-- **Pushing is one command.** `git push <remote> <branch>` — nothing is built,
- copied, cloned, or audited on the way (§2). The hooks take about a second
- and a half; if a push turns into a work session, something regrew that
- belongs in CI. When a hook does block, it found a credential: fix the
- finding, never reach for `--no-verify` as the first move.
-
----
-
-## 10. Run & test
-
-```bash
-# Install / activate entry-points (BUG-006/014 recovery) + full deps + dev tools
-pip install -e . --no-deps
-pip install -r requirements.txt
-pip install -e ".[dev]" # pytest, ruff, mypy
-
-# Launch
-run.bat # tray app + voice + Orb (recommended)
-run.bat --headless # API/WS only, no voice
-python -m jarvis.ui.web.launcher --dev # frontend from Vite :5173
-python -m jarvis --wizard | --check | --plugins | --debug | --phase5-doctor
-
-# Lint / typecheck
-ruff check jarvis/ && ruff format jarvis/ && mypy jarvis/
-
-# Frontend (jarvis/ui/web/frontend/)
-npm install && npm run dev # build → npm run build ; tests → npm run test
-```
-
-```bash
-# Tests (asyncio_mode=auto; fakes in tests/fakes/, not unittest.mock)
-pytest tests/ # full suite
-pytest tests/unit/ -v # per-module
-pytest tests/integration/ -v # phase-level E2E (self-skips when prereqs missing)
-pytest tests/missions/ -v # Phase 6
-pytest -m "not slow" # fast subset
-# Markers: phase5, skip_ci, e2e, voice_latency, eval, slow, integration.
-# Targeted guards: test_routing.py (router), test_output_filter.py (scrubber),
-# test_hangup_reason_parity.py (enum drift). New STT/Brain/Tool/Channel
-# providers must pass tests/contract/.
-```
-
----
-
-## 11. Pointers
-
-- **Architecture + module catalog:**
- [`docs/architecture-overview.md`](architecture-overview.md).
-- **Doctrine:** [`CLOUD.md`](../CLOUD.md),
- [`docs/PHILOSOPHY.md`](PHILOSOPHY.md).
-- **Bug register:** [`docs/BUGS.md`](BUGS.md). **Anti-drift:**
- [`docs/anti-drift-three-layer.md`](anti-drift-three-layer.md).
- **Self-Mod:** [`docs/self_mod.md`](self_mod.md).
-- **ADRs:** `docs/adr/0001..0023` (ADR-0001 superseded by ADR-0020).
- **Phase docs:** `docs/phase{0,1,1a,1c,2,4,5,6}-*.md`.
-- **Operational scripts:** `scripts/preflight.ps1`,
- `scripts/drift-guard-daemon.ps1`, `scripts/README-auto-push.md`.
-- **Jarvis control CLI** (drive a running Jarvis from a terminal/agent):
- `docs/jarvis-cli.md` + generated `docs/jarvis-cli-reference.md`
- (`jarvis/cli_ctl/`, binaries `jarvis`/`jarvisctl`/`jctl`). New REST routes
- must stay mounted — enforced by `scripts/ci/check_cli_coverage.py`.