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.
Python agent-orchestrationai-agentai-coding-assistantclaude-codecoding-agentcomputer-usedesktop-applocal-firstmcppersonal-jarvisvoice-assistantvoice-coding
docs: reflow CLAUDE.md/AGENTS.md into clean readable markdown
Ruben Lütke7122b5b343f3
diff --git a/AGENTS.md b/AGENTS.mdindex 637e446f1e..d356f8a752 100644--- a/AGENTS.md+++ b/AGENTS.md@@ -1,45 +1,45 @@# CLAUDE.mdBinding rules for any coding agent in this repo — respect them on **every**-change. Architecture/product detail lives in+change. Architecture and product detail live in[`docs/architecture-overview.md`](docs/architecture-overview.md).---## 0. CLAUDE.md ≡ AGENTS.md (mirror rule — BINDING)-`CLAUDE.md` and `AGENTS.md` are **byte-identical twins** (`CLAUDE.md` is-canonical; `AGENTS.md` is the cross-tool standard name other agents read).-**Every edit to one is mirrored into the other automatically — never let them-drift.** Sync engine: `scripts/ci/sync_agents_md.py` (live `PostToolUse` hook +-`.githooks/pre-commit --stage` + a `--check` CI gate). After editing either,-run the sync (or copy one onto the other) before you commit.+`CLAUDE.md` and `AGENTS.md` are **byte-identical twins**: `CLAUDE.md` is+canonical, `AGENTS.md` is the cross-tool standard name other agents read.+Never let them drift. Sync engine: `scripts/ci/sync_agents_md.py` (live+`PostToolUse` hook + `.githooks/pre-commit --stage` + a `--check` CI gate).+After editing either file, run the sync (or copy one onto the other) before+you commit.---## 1. Language — English-only artifacts, fail-closed (BINDING, HIGHEST PRIORITY)-**Everything an agent commits is English — full stop, no exception outside the-closed list below.** Personal Jarvis is an international open-source project;-assume an arbitrary downloader anywhere on earth, so English is **always**-preferred and never weighed against any single locale. This is **English-only-for artifacts**, not "English-first, German-tolerated". Any "German project" /-"internationales deutsches Projekt" label is **dead**, overridden here. <!-- i18n-allow: names the dead German label being retired -->--**Fail-closed default.** Every line you write *or touch* — code, comments,-docstrings, log/exception/error messages, Markdown (READMEs, ADRs, plans,-`BUGS.md`, handoffs, design/forensic docs), `SKILL.md`, commit messages, PR-titles/bodies, test names + docstrings, CLI help, FastAPI route descriptions,-JSON-schema `description` fields, audit-log entries, telemetry names, UI strings-(i18n key + **English** source) — is English **unless it provably falls inside-the closed product-surface list below.** When in doubt, English. "It's only a-comment / test / internal doc / quick note" is **not** an exemption — those are-where German keeps leaking in. Don't invent a new German-allowed category; if+**Everything an agent commits is English — no exception outside the closed+list below.** Personal Jarvis is an international open-source project; assume+an arbitrary downloader anywhere on earth. This is English-only for artifacts,+not "English-first, German-tolerated". Any "German project" / "internationales+deutsches Projekt" label is dead, overridden here. <!-- i18n-allow: names the dead German label being retired -->++**Fail-closed default.** Every line you write *or touch* is English: code,+comments, docstrings, log/exception/error messages, Markdown (READMEs, ADRs,+plans, `BUGS.md`, handoffs, design/forensic docs), `SKILL.md`, commit messages,+PR titles/bodies, test names and docstrings, CLI help, FastAPI route+descriptions, JSON-schema `description` fields, audit-log entries, telemetry+names, UI strings (i18n key + **English** source) — unless it provably falls+inside the closed list below. When in doubt, English. "It's only a comment /+test / internal doc / quick note" is **not** an exemption — that is exactly+where German keeps leaking in. Never invent a new German-allowed category; ifyou think one exists, stop and ask rather than commit the German.**The ONLY German permitted — the multilingual *product surface* (CLOSED list):**+1. **Runtime voice/TTS + chat output** Jarvis speaks/writes back — governed by- the per-turn resolver in the Runtime-output subsection below.+ the per-turn resolver in the subsection below.2. **i18n / locale *source* files + the website's localized copy** (`*/i18n/*`,`*/locales/*`, `*.de.json`, `*.de.ts`, etc.) — German there *is* the product.3. **Speech-recognition *input vocabulary*** — the German tokens a classifier@@ -48,51 +48,53 @@ you think one exists, stop and ask rather than commit the German.4. **Tests / fixtures + forensic voice-bug deep-dives** that quote 1–3 as thecontent under test.-Materialized file-by-file in `scripts/ci/german-allowlist.txt`. **Anything-outside those four buckets must be English** — German elsewhere is a *defect*,-translate it.+Materialized file-by-file in `scripts/ci/german-allowlist.txt`. German anywhere+else is a **defect** — translate it.- **The allowlist is a curated, justified register, never a free pass.** Every- entry names which of the four reasons it serves. **"Whole-file scope, narrow- later" and "shared tree, do it later" are no longer acceptable.** Prefer an- inline `i18n-allow` on the one load-bearing German line over exempting a whole- file, so a future English line in that file is still checked.+ entry names which of the four reasons it serves. "Whole-file scope, narrow+ later" and "shared tree, do it later" are not acceptable. Prefer an inline+ `i18n-allow` on the one load-bearing German line over exempting a whole file,+ so a future English line in that file is still checked.- **Pre-existing German is *backlog*, not protected.** The old- "don't retro-translate / already-committed is exempt" carve-out is **removed**.- No mass-rewrite mandate (a shared tree makes a giant sweep risky), but when you- edit a file and pass non-product-surface German, **translate it on the way- through** — don't preserve, copy forward, or add more beside it.-- **The CI gate only sees what a PR diff ADDS** (`scripts/ci/check_no_new_german.py`)- — structurally blind to the backlog. So the agent is the first line of defense.-- **Chat/conversation language is each contributor's own choice**, set in their- personal global config (`~/.claude/CLAUDE.md` / `AGENTS.md`). The repo fixes- only the **artifacts** as English. Conversation = your choice; artifacts =- English, always.+ "don't retro-translate / already-committed is exempt" carve-out is removed.+ No mass-rewrite mandate (a shared tree makes a giant sweep risky), but when+ you edit a file and pass non-product-surface German, **translate it on the+ way through** — never preserve, copy forward, or add more beside it.+- **The CI gate only sees what a PR diff ADDS**+ (`scripts/ci/check_no_new_german.py`) — structurally blind to the backlog,+ so the agent is the first line of defense.+- **Chat/conversation language is each contributor's own choice**, set in+ their personal global config (`~/.claude/CLAUDE.md` / `AGENTS.md`). The repo+ fixes only the artifacts. Conversation = your choice; artifacts = English,+ always.### Runtime output language (voice + chat) — BINDING-Governs what Jarvis **speaks/writes back** (a multilingual product surface; does-NOT weaken the English-artifact rule). Supported languages are equal — `de`,-`en`, `es`, any future locale; never a German- or English-only bias.+Governs what Jarvis **speaks/writes back** (a multilingual product surface;+does NOT weaken the English-artifact rule). Supported languages are equal —+`de`, `en`, `es`, any future locale; never a German- or English-only bias.-1. **A turn's output language is decided once, by one resolver —+1. **A turn's output language is decided once, by one resolver** —`jarvis/core/turn_language.py::resolve_output_language` — and every output- layer consumes that decision.** Precedence: explicit `brain.reply_language`- pin → conversation stickiness (a thin one/two-word interjection stays in the- running `conversation_language` and must NOT flip it; only a substantive turn- switches) → detected input language → configured `DEFAULT_LOCALE`.+ layer consumes that decision. Precedence: explicit `brain.reply_language`+ pin → conversation stickiness (a thin one/two-word interjection stays in+ the running `conversation_language` and must NOT flip it; only a+ substantive turn switches) → detected input language → configured+ `DEFAULT_LOCALE`.2. **Applies to ALL user-facing output** — deep reply, ack preamble, spawn- announcements, every canned status/error/clarify/timeout/provider-down phrase,- every deterministic Computer-Use/local-action readback, AND the TTS- voice/BCP-47 pick. A mid-session flip between layers is a bug.-3. **No layer re-derives the language** — no `"de" if _looks_german() else "en"`- (drops `es`), no de/en-only phrase table, no per-layer hardcoded default, no- path that ignores the pin. New phrase tables carry **all** supported languages- and resolve their key through the one resolver.-4. **Honesty over guessing** — a layer that genuinely can't tell falls back to- `DEFAULT_LOCALE`. The durable single-language guarantee is `brain.reply_language`- (`auto` | `de` | `en` | `es`), editable from the desktop **Languages** view.- Guards: `tests/unit/core/test_turn_language.py`,+ announcements, every canned status/error/clarify/timeout/provider-down+ phrase, every deterministic Computer-Use/local-action readback, AND the+ TTS voice/BCP-47 pick. A mid-session flip between layers is a bug.+3. **No layer re-derives the language** — no `"de" if _looks_german() else+ "en"` (drops `es`), no de/en-only phrase table, no per-layer hardcoded+ default, no path that ignores the pin. New phrase tables carry **all**+ supported languages and resolve their key through the one resolver.+4. **Honesty over guessing** — a layer that genuinely can't tell falls back+ to `DEFAULT_LOCALE`. The durable single-language guarantee is+ `brain.reply_language` (`auto` | `de` | `en` | `es`), editable from 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`.@@ -103,101 +105,108 @@ NOT weaken the English-artifact rule). Supported languages are equal — `de`,**ONE project repo: the public flagship`https://github.com/PersonalJarvis/PersonalJarvis`** (PascalCase). EVERYmaintainer "commit / push / save to GitHub / sichere den Stand" targets THIS-repo. <!-- i18n-allow: quoted German maintainer trigger phrase --> The lowercase-`personal-jarvis` (remote `origin`) is a **silent local backup** only, never the-deliverable. Never ask "which repo".+repo. <!-- i18n-allow: quoted German maintainer trigger phrase --> The+lowercase `personal-jarvis` (remote `origin`) is a **silent local backup**+only, never the deliverable. Never ask "which repo".**Why the gate exists:** public history is world-readable forever. One leakedAPI key, real name, personal path (`C:\Users\<name>\...`), private email,internal project id, or Windows SID is permanent — deleting it later does NOTun-publish it (it survives in clones, forks, caches). So every push is rebuiltas a **depersonalized snapshot** through the gate below, in order,-**fail-closed** — any uncertainty at any step STOPS the push.+**fail-closed** — any uncertainty at any step STOPS the push:1. **Tracked-files-only export** — `.gitignore` is the first cut for free:`data/`, `.env`, `jarvis.toml`, the Vault, key material are never candidates.-2. **Distribution denylist** — strips tracked-but-non-public files: internal dev- docs, scratch/experiment scripts, signing keys, red-team notes.+2. **Distribution denylist** — strips tracked-but-non-public files: internal+ dev docs, scratch/experiment scripts, signing keys, red-team notes.3. **Deterministic PII scrub** — masks the maintainer's real name, personal- paths, machine/user identifiers, internal project ids across every staged file.-4. **Mandatory sub-agent privacy review** — reads the ENTIRE staged snapshot and- reports anything the regex scanners could miss. **Additive-only:** it can ADD- a blocking finding but never clear a deterministic one. One finding STOPS.+ paths, machine/user identifiers, internal project ids across every staged+ file.+4. **Mandatory sub-agent privacy review** — reads the ENTIRE staged snapshot+ and reports anything the regex scanners could miss. **Additive-only:** it+ can ADD a blocking finding but never clear a deterministic one. One finding+ STOPS.5. **Deterministic secret/PII scan** — final regex sweep tuned to realcredential shapes/lengths (catches a real key, not every hex string),fail-closed.-6. **Human review** — explicit maintainer go-ahead before any byte crosses the- network. No silent auto-publish.+6. **Human review** — explicit maintainer go-ahead before any byte crosses+ the network. No silent auto-publish.**Isolation:** the push runs from a **separate clean clone**, never your liveworking tree, so raw un-scrubbed state cannot leak through. Backstop: the-pre-push guard (`scripts/ci/guard_no_raw_public_push.py` + `privacy_pre_push.py`,-via `.githooks/pre-push`, `core.hooksPath=.githooks`) HARD-BLOCKS any raw push to-the public repo — it already caught a real Windows-SID leak (blocked, then purged-with filter-repo). Don't remove or weaken it. Engine: `scripts/ci/privacy_gate/`.--**Two volumes, same gate:** *Discreet (DEFAULT)* — "push", "sichere den Stand",-"update GitHub" → clean snapshot, **no bump / tag / release**. *Release (explicit-only)* — "Mach ein Release", "Publish release" → the gate **plus** a SemVer bump-+ git tag + CHANGELOG entry. <!-- i18n-allow: quoted German maintainer trigger phrases --> When ambiguous, default to discreet.--**Guardrails:** **Do not PUSH unless the maintainer asks** (local auto-commit is-fine, governed by §9). `save-to-github` and `github-version` MUST NOT run here —-they push raw state and bypass this gate. Doctrine: [`CLOUD.md`](CLOUD.md).+pre-push guard (`scripts/ci/guard_no_raw_public_push.py` ++`privacy_pre_push.py`, via `.githooks/pre-push`, `core.hooksPath=.githooks`)+HARD-BLOCKS any raw push to the public repo — it already caught a real+Windows-SID leak (blocked, then purged with filter-repo). Never remove or+weaken it. Engine: `scripts/ci/privacy_gate/`.++**Two volumes, same gate:** *Discreet (DEFAULT)* — "push", "sichere den+Stand", "update GitHub" → clean snapshot, **no bump / tag / release**.+*Release (explicit only)* — "Mach ein Release", "Publish release" → the gate+**plus** a SemVer bump + git tag + CHANGELOG entry. <!-- i18n-allow: quoted German maintainer trigger phrases -->+When ambiguous, default to discreet.++**Guardrails:** **Do not PUSH unless the maintainer asks** (local auto-commit+is fine, governed by §9). `save-to-github` and `github-version` MUST NOT run+here — they push raw state and bypass this gate. Doctrine:+[`CLOUD.md`](CLOUD.md).---## 3. Open-source universality — the maintainer's config is NEVER the baseline (BINDING)The recurring, expensive bug class: **building/testing a feature against the-maintainer's own machine, keys, providers, and OS — then shipping it broken for-everyone else.** One rule: **assume an arbitrary downloader, never the-maintainer.** It governs the whole product surface, and the **entire API-Keys /-credential / integration surface — not just brain providers:** STT, TTS, Vision,-Wake, **Telephony (Twilio), Channels (Telegram/Discord), 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 / empty / depleted / 429 / 402 /+maintainer's own machine, keys, providers, and OS — then shipping it broken+for everyone else.** One rule: **assume an arbitrary downloader, never the+maintainer.** It governs the whole product surface and the **entire API-keys /+credential / integration surface — not just brain providers:** STT, TTS,+Vision, Wake, Telephony (Twilio), Channels (Telegram/Discord), 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 / empty / depleted / 429 / 402 /unreachable one degrades or crosses to a **different family** with an honestmessage, never bricking a core path (router, ack/flash, STT, Jarvis-Agentworker, mission critic). Primary AND fallback in the SAME family = asingle-provider brick (AP-22). Gate on **capability**, never a providername/model id (AP-21).-- **work on EVERY OS, incl. a headless `python:3.11-slim` VPS** with no keyring,- D-Bus Secret Service, GPU, audio, or Windows APIs. Base `pip install` + boot- must succeed there. OS-specific code only behind (a) a runtime capability- check, (b) an extras group, (c) a graceful English-message no-op elsewhere.- Use `pathlib` + capability probes + UTF-8; never hardcode `C:\Users\...` or- assume cp1252. **Base install stays torch-/GPU-free + universal**, enforced by- `check_requirements_sync.py` (source ↔ `pyproject`) and- `check_lockfile_universal.py` (compiled `requirements.txt` keeps its- `--universal` marker, admits no `nvidia-*`/`torch`/CUDA/`faster-whisper` — those- live only in the opt-in `[local-voice]` extra); regenerate the lock only with+- **Work on EVERY OS, incl. a headless `python:3.11-slim` VPS** with no+ keyring, D-Bus Secret Service, GPU, audio, or Windows APIs. Base+ `pip install` + boot must succeed there. OS-specific code only behind (a) a+ runtime capability check, (b) an extras group, or (c) a graceful+ English-message no-op elsewhere. Use `pathlib` + capability probes + UTF-8;+ never hardcode `C:\Users\...` or assume cp1252. **Base install stays+ torch-/GPU-free and universal**, enforced by `check_requirements_sync.py`+ (source ↔ `pyproject`) and `check_lockfile_universal.py` (compiled+ `requirements.txt` keeps its `--universal` marker, admits no+ `nvidia-*`/`torch`/CUDA/`faster-whisper` — those live only in the opt-in+ `[local-voice]` extra). Regenerate the lock only with`uv pip compile --universal`, never plain `pip-compile`.-- **be recoverable IN-APP** — entering / switching / connecting a credential and- recovering from a dead one happens inside the app, never by hand-editing+- **Be recoverable IN-APP** — entering / switching / connecting a credential+ and recovering from a dead one happens inside the app, never by hand-editing`jarvis.toml`, exporting an ENV var, or spinning up a cloud instance.-- **store credentials portably** — OS keyring → ENV/.env → local-file fallback+- **Store credentials portably** — OS keyring → ENV/.env → local-file fallback(`config._ensure_keyring_backend`). A save/connect must never 500 on a hostwithout a Secret Service.-**Definition of done (NON-NEGOTIABLE).** A change touching config, credentials,-a provider/integration, or OS-specific code is NOT done until you verify (test or-honest manual trace) the THREE non-maintainer paths:-1. **Fresh install, ONE arbitrary key** — a downloader whose only credential is- for a DIFFERENT provider reaches a working path (chat + voice + Jarvis-Agent +- the touched feature), entirely in-app.+**Definition of done (NON-NEGOTIABLE).** A change touching config,+credentials, a provider/integration, or OS-specific code is NOT done until you+verify (test or honest manual trace) the THREE non-maintainer paths:++1. **Fresh install, ONE arbitrary key** — a downloader whose only credential+ is for a DIFFERENT provider reaches a working path (chat + voice ++ Jarvis-Agent + the touched feature), entirely in-app.2. **Headless Linux** — base `pip install` + boot + the feature work on`python:3.11-slim`; local-only parts degrade to a logged no-op.-3. **Cross-family fallback** — when the configured provider/integration is absent- or dead, the path crosses to whatever the user actually has, or degrades- honestly.+3. **Cross-family fallback** — when the configured provider/integration is+ absent or dead, the path crosses to whatever the user actually has, or+ degrades honestly.**"It works on my machine" is the *defect*.** The maintainer's RTX-5070-Ti /-Windows box with Gemini + OpenRouter keys is <0.1 % of the install base. When in-doubt, gate behind an extras group with a graceful no-op and lead the docs with-the VPS path. Doctrine: [`CLOUD.md`](CLOUD.md) ++Windows box with Gemini + OpenRouter keys is <0.1 % of the install base. When+in doubt, gate behind an extras group with a graceful no-op and lead the docs+with the VPS path. Doctrine: [`CLOUD.md`](CLOUD.md) +[`docs/PHILOSOPHY.md`](docs/PHILOSOPHY.md) (doctrine wins). See AP-21/22/23.---@@ -207,8 +216,8 @@ the VPS path. Doctrine: [`CLOUD.md`](CLOUD.md) +The internal agent/mission/harness system is named **Jarvis-Agents** (singular**Jarvis-Agent**) everywhere a human or LLM could read it — UI labels, docs,comments, new code identifiers, log/voice text. No other names. **Glossary:**-formerly "Subagents" / "Sub-Agent" / "sub_jarvis" / "SubJarvis" and "OpenClaw" /-"openclaw", renamed repo-wide 2026-06-30. Surviving old-name occurrences are+formerly "Subagents" / "Sub-Agent" / "sub_jarvis" / "SubJarvis" and "OpenClaw"+/ "openclaw", renamed repo-wide 2026-06-30. Surviving old-name occurrences areintentional: the external `openclaw` npm worker binary (it owns that name),read-time back-compat config aliases (new `[brain.worker]` /`[harness.jarvis_agent]` still accept old `[brain.sub_jarvis]` /@@ -218,60 +227,65 @@ read-time back-compat config aliases (new `[brain.worker]` /## 5. Architecture essentials (respect on every change)-Full model + module catalog: [`docs/architecture-overview.md`](docs/architecture-overview.md). Rules you cannot break:+Full model + module catalog:+[`docs/architecture-overview.md`](docs/architecture-overview.md). Rules you+cannot break:- **8-layer dependency rule:** higher layers reach lower ones **only viaprotocols** (`jarvis/core/protocols.py`); lateral communication **only** viatyped `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).+ `trace_id` + `timestamp_ns`. A broken subscriber is logged in+ `_safe_dispatch`, never propagated (AP-18).- **Plugins are structural:** under `jarvis/plugins/<group>/<name>.py`,- registered via `pyproject.toml` entry-points, and **must not import `jarvis.*`**- in the plugin module. After editing entry-points: `pip install -e . --no-deps`.- Groups: wakeword, stt, tts, brain, harness, tool, channel.+ registered via `pyproject.toml` entry-points, and **must not import+ `jarvis.*`** in the plugin module. After editing entry-points:+ `pip install -e . --no-deps`. Groups: wakeword, stt, tts, brain, harness,+ tool, channel.- **Streaming first:** all Brain/STT/TTS/Harness methods return`AsyncIterator[...]` (non-streaming yields one element).-- **Secrets** only via `jarvis.core.config.get_secret`: OS keyring → ENV → `.env`- → local-file fallback. Never put keys in code / `jarvis.toml` / commits /- `.claude/`. **Installer signing PRIVATE keys live ONLY in GitHub Actions- secrets — never in the repo, not even encrypted; only PUBLIC keys ship- (AP-29).** Voice/chat must never accept secrets (AP-2).+- **Secrets** only via `jarvis.core.config.get_secret`: OS keyring → ENV →+ `.env` → local-file fallback. Never put keys in code / `jarvis.toml` /+ commits / `.claude/`. **Installer signing PRIVATE keys live ONLY in GitHub+ Actions secrets — never in the repo, not even encrypted; only PUBLIC keys+ ship (AP-29).** Voice/chat must never accept secrets (AP-2).- **Brain is multi-provider** — never hardcode Anthropic/Claude (AP-6); gatefeatures on a **capability** (`supports_vision`, `supports_tools`,- `can_call_tools()`), never a provider name/model id (AP-21). Persona comes from- `jarvis/brain/persona_loader.py` (editable override → packaged+ `can_call_tools()`), never a provider name/model id (AP-21). Persona comes+ from `jarvis/brain/persona_loader.py` (editable override → packaged`JARVIS_PERSONA.md`); never hardcode it.- **Router discipline (ADR-0011):** the router-tier brain is a pure dispatcherover the `ROUTER_TOOLS` frozenset (`jarvis/brain/factory.py`). No spawn toolever enters a worker set (AP-5/AP-14). Extending `ROUTER_TOOLS` → amendADR-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.+ (`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). Self-mod- pipeline (Allowlist→Pre-Validate→Backup→replace→sync reload-test→Rollback→Audit)- is non-negotiable (AP-13/14).-- **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/` still read- as fallback) with kill-on-crash containment (Job Object on Windows;- process-group reaper on POSIX). `MAX_CRITIC_LOOPS = 3` is fixed.+ `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).+- **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/`+ still read as fallback) with kill-on-crash containment (Job Object on+ Windows; process-group reaper on POSIX). `MAX_CRITIC_LOOPS = 3` is fixed.- **Platform gotchas:** UTF-8 stdout (cp1252 default on Windows); everysubprocess 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.+ forbidden (BUG-014); no Windows Service (SYSTEM has no mic); UAC+ `asInvoker`, elevate per-action.---## 6. Safety / risk tiersFour tiers: `safe` / `monitor` / `ask` / `block`, priority **blacklist >-whitelist > tool default** (`jarvis/safety/risk_tier.py`). Whitelist downgrades-to `safe` — the anti-confirmation-fatigue contract. **Direct `Tool.execute()` is-a bug; only `ToolExecutor.execute()` is authorized (AP-3).** Generated skills-land as `state="draft"` and are never auto-activated (AP-15).+whitelist > tool default** (`jarvis/safety/risk_tier.py`). Whitelist+downgrades to `safe` — the anti-confirmation-fatigue contract. **Direct+`Tool.execute()` is a bug; only `ToolExecutor.execute()` is authorized+(AP-3).** Generated skills land as `state="draft"` and are never+auto-activated (AP-15).---@@ -300,55 +314,158 @@ land as `state="draft"` and are never auto-activated (AP-15).| AP-19 | Reuse a process-global progress counter in a stall/heartbeat watchdog without resetting it per unit of work | BUG-032: watchdog measures the idle gap *between* turns → spuriously aborts a fresh TTS answer before its first frame || AP-20 | `continue` (instead of `break`) a WS receive loop on a non-`WebSocketDisconnect` error | Unclean disconnect raises `RuntimeError` → loop re-reads a dead socket forever → log storm + self-restart. Catch `RuntimeError` and `break` || AP-21 | Pin a feature to a provider **name** or **model id** instead of a **capability** | Silently breaks for every other provider. Gate on `supports_vision` / `supports_tools` / `can_call_tools()`; if a flag is wrong/missing, fix/add the capability — don't pin the feature |-| AP-22 | Configure a tier (router/ack/STT/TTS/worker/critic/fallback) whose primary AND fallback resolve to the SAME provider family, or build a fallback chain from hardcoded provider NAMES | Single-provider brick: one missing key / 429 / 402 / outage kills the whole tier even with a healthy DIFFERENT provider present. Resolve every tier through one key-aware chain that skips the dead/keyless provider, crosses families, and degrades honestly only when NO family is reachable — recoverable in-app |-| AP-23 | Build or TEST a feature only against the maintainer's config / keys / provider / OS and claim it done | The whole API-Keys surface silently bricked for every other downloader + on a headless VPS (credentials couldn't be SAVED, ENV keys read as "not configured", channels/plugins/OAuth 500'd). Verify the three non-maintainer paths in §3 |-| AP-24 | Call a shared native inference engine (ctranslate2/faster-whisper, an ONNX/torch session) concurrently from two callers, OR "recover" a hung inference with only a timeout that re-polls the SAME wedged engine | `WhisperModel.transcribe` is NOT thread-safe: the wake poll loop + VAD probe sharing one provider hung it forever; a hung `to_thread` can't be cancelled, so a timeout only BOUNDS, never RECOVERS. Fix: a non-blocking per-instance inference lock (2nd call → skip) + a `recover()` that rebuilds a FRESH model after N failures (BUG-036) |-| AP-25 | Run the always-on wake/keyword Whisper on the **GPU** via CTranslate2/faster-whisper on the basis of CUDA *presence* alone, or hand-pin the upgrade to a hardware name | CUDA presence and CUDA *usability* diverge: on the maintainer's Blackwell GPU (RTX 5070 Ti / sm_120) CTranslate2 `model.transcribe` once **HUNG every inference** under the then-current runtime (8 s timeout → self-heal rebuilds the model → the cold rebuild hangs again → wake **permanently DEAF**), while `get_cuda_device_count()` was happily > 0; the same class hit `base`/`cpu` when ctranslate2's auto thread-pool deadlocked vs PyTorch's OpenMP in the shared process. Re-measured 2026-07-05 on the SAME GPU (ctranslate2 4.7.1 + torch 2.11-cu128): 40/40 turbo/cuda inferences under in-process torch-OpenMP load, zero hangs, p50 117 ms — the hang was **constellation-specific, not "Blackwell forever"**. Rule: gate the GPU wake upgrade on the automated 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, CUDA teardown can die after correct work — cached per ctranslate2 version in `data/wake_gpu_probe.json`), keep the probe OFF the boot path (only non-`fast_first` builds, i.e. the background hot-swap), keep a FIXED `cpu_threads` on the CPU floor, and keep the live backstop (a wedge on the swapped-in GPU model swaps back to the retained base/cpu fallback + `mark_wake_gpu_bad()`). `[stt].wake_high_accuracy=false` stays the hard opt-out. Truly instant+accurate custom-word wake still needs a trained neural KWS model (openWakeWord `custom_onnx`), NOT transcription. See `docs/local-wakeword/WAKE-RELIABILITY-DEEPDIVE.md` |-| AP-26 | Put a feature's init/import on the startup critical path (before `APP_INTERACTIVE` / `VOICE_USABLE`) — sync load in `_run_backend`, the `WebServer` ctor, `_start_speech_and_orb`, or a module-level heavy import | Boot creep: every feature "only adds a second" until boot takes 30+ s (TTU forensic: one wake change added a 114.7 s cascade). New subsystems hook into `_heavy_backend_bg`, a deferred registry scan, or a post-ready task; heavy imports stay lazy or use a `warmup_prefetch` daemon; routes answer 503/None while warming. **Enforced by the pre-push BOOT BUDGET gate** (`scripts/ci/check_boot_budget.py`: window ≤ 8 s, voice-usable + app-interactive ≤ 20 s). Doctrine: `docs/diagnostics/BOOT-TTU-NOTES.md` |-| AP-27 | Suppress `stt_match` wake ghosts by tightening TRANSCRIPT CONTENT — require the bias-echo confirm's unbiased pass to reproduce the wake word, raise phrase-matcher strictness on the confirm, or add any second content check that must contain the phrase | Kills recognition ENTIRELY: "fires on silence" flips to "never fires". A bias-primed local Whisper (`initial_prompt=<phrase>`, needed for proper-noun recall) HALLUCINATES the phrase on silence AND GARBLES it on speech (`'Mythos'`→`'Mütos'`/`'Hey, Mut!'`, `'Fable'`→`'Farbe'`); the unprimed base model can't spell a hard custom wake — so NO transcript-content rule separates ghost from wake without rejecting genuine wakes. The ONLY word-agnostic discriminator is raw audio ENERGY. Fix: suppress silence at the match site via the RMS gate (`RollingWhisperWake._match_min_rms`, ghost ≤ 0.0043 vs quiet-mic recall 0.009); keep the bias-echo confirm PERMISSIVE (heard any real speech → genuine, fail-open) and SKIP it on a loud window (`_ECHO_CONFIRM_SKIP_RMS`, latency). Guard: `tests/unit/speech/test_rolling_whisper_wake_silence_ghost.py::test_loud_wake_fires_even_when_unbiased_pass_garbles_the_hard_word` | <!-- i18n-allow: forensic quotes of the German STT-garble tokens under test -->-| AP-28 | Gate a pre-push / CI check on `isinstance` against the *installed* copy of a third-party lib that CI installs **unpinned** (newest), then trust "green on my machine" | Version-skew brick: the lib's next release changes internals and the gate CRASHES or false-fails in CI while green locally. Typer 0.26 vendored its own Click (`typer._click`), so `typer.main.get_command`'s root group + params stopped being `isinstance` of the *external* `click.Group`/`Argument`/`Option` → the CLI-drift gate `AssertionError`'d on every push though green on local Typer 0.21 (fix 621f837a). Discriminate by CAPABILITY, never concrete type (`.commands`, Click's stable `param_type_name`). **Before anything goes PUBLIC: CI must be GREEN and every red cause understood + fixed — reproduce against the SAME unpinned versions CI installs, not your local pins.** |-| AP-29 | Commit a signing PRIVATE key — or its passphrase, or a `*.key.enc` "encrypted at rest" copy — into the repo | The installer is signed on key-bound axes (Wave 2 Ed25519, Wave 4 ML-DSA-65). The former scheme stored encrypted private keys in-repo + a DEMO passphrase in plaintext docs; that passphrase leaked into 14 public snapshots (v0.1.0..v0.9.1), permanent + world-readable — so any key it wrapped is forgeable. Private keys now live ONLY in GitHub Actions secrets (base64 PKCS#8 PEM: `WAVE2_OFFLINE_KEY_B64` / `WAVE4_MLDSA65_KEY_B64`), local backup in the maintainer's password manager; the repo holds ONLY public keys (`install/keys/*.pub*`) + inlined verifier copies. 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):** a full PEM PRIVATE KEY block, a tracked `*.key`/`*.key.enc`, or a `WAVE2_CEREMONY_PASSPHRASE=<value>` line blocks it. Doctrine: `docs/supply-chain/wave2-key-ceremony.md`. |+| AP-22 | Configure a tier (router/ack/STT/TTS/worker/critic/fallback) whose primary AND fallback resolve to the SAME provider family, or build a fallback chain from hardcoded provider NAMES | Single-provider brick: one missing key / 429 / 402 / outage kills the whole tier even with a healthy DIFFERENT provider present. Resolve every tier through one key-aware chain that skips dead/keyless providers, crosses families, and degrades honestly only when NO family is reachable — recoverable in-app |+| AP-23 | Build or TEST a feature only against the maintainer's config / keys / provider / OS and claim it done | The whole API-keys surface silently bricked for every other downloader + on a headless VPS (credentials couldn't be SAVED, ENV keys read as "not configured", channels/plugins/OAuth 500'd). Verify the three non-maintainer paths in §3 |++The remaining anti-patterns need more context than a table cell allows:++### AP-24 — Never share a native inference engine between concurrent callers++Never call a shared native inference engine (ctranslate2/faster-whisper, an+ONNX/torch session) concurrently from two callers, and never "recover" a hung+inference with only a timeout that re-polls the SAME wedged engine.+`WhisperModel.transcribe` is NOT thread-safe: the wake poll loop + VAD probe+sharing one provider hung it forever, and a hung `to_thread` can't be+cancelled — a timeout only BOUNDS, never RECOVERS. Fix: a non-blocking+per-instance inference lock (second call → skip) + a `recover()` that rebuilds+a FRESH model after N failures (BUG-036).++### AP-25 — Never enable GPU wake on CUDA *presence* or a hardware name++Never run the always-on wake/keyword Whisper on the GPU via+CTranslate2/faster-whisper based on CUDA *presence* alone, and never hand-pin+the upgrade to a hardware name. CUDA presence and CUDA *usability* diverge: on+the maintainer's Blackwell GPU (RTX 5070 Ti / sm_120), CTranslate2+`model.transcribe` once HUNG every inference under the then-current runtime+(8 s timeout → self-heal rebuilds the model → the cold rebuild hangs again →+wake **permanently DEAF**) while `get_cuda_device_count()` was happily > 0;+the same class hit `base`/`cpu` when ctranslate2's auto thread-pool deadlocked+against PyTorch's OpenMP in the shared process. Re-measured 2026-07-05 on the+SAME GPU (ctranslate2 4.7.1 + torch 2.11-cu128): 40/40 turbo/cuda inferences+under in-process torch-OpenMP load, zero hangs, p50 117 ms — the hang was+**constellation-specific, not "Blackwell forever"**.++Rule: gate the GPU wake upgrade on the automated 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, CUDA teardown can die after correct work — cached per+ctranslate2 version in `data/wake_gpu_probe.json`). Keep the probe OFF the+boot path (only non-`fast_first` builds, i.e. the background hot-swap), keep a+FIXED `cpu_threads` on the CPU floor, and keep the live backstop (a wedge on+the swapped-in GPU model swaps back to the retained base/cpu fallback ++`mark_wake_gpu_bad()`). `[stt].wake_high_accuracy=false` stays the hard+opt-out. Truly instant + accurate custom-word wake still needs a trained+neural KWS model (openWakeWord `custom_onnx`), NOT transcription. See+`docs/local-wakeword/WAKE-RELIABILITY-DEEPDIVE.md`.++### AP-26 — Never put a feature's init/import on the startup critical path++Never put init/import work before `APP_INTERACTIVE` / `VOICE_USABLE` — no sync+load in `_run_backend`, the `WebServer` ctor, `_start_speech_and_orb`, or a+module-level heavy import. Boot creep: every feature "only adds a second"+until boot takes 30+ s (TTU forensic: one wake change added a 114.7 s+cascade). New subsystems hook into `_heavy_backend_bg`, a deferred registry+scan, or a post-ready task; heavy imports stay lazy or use a `warmup_prefetch`+daemon; routes answer 503/None while warming. **Enforced by the pre-push BOOT+BUDGET gate** (`scripts/ci/check_boot_budget.py`: window ≤ 8 s, voice-usable ++app-interactive ≤ 20 s). Doctrine: `docs/diagnostics/BOOT-TTU-NOTES.md`.++### AP-27 — Never suppress wake ghosts by tightening transcript content++Never suppress `stt_match` wake ghosts via TRANSCRIPT CONTENT — requiring the+bias-echo confirm's unbiased pass to reproduce the wake word, raising+phrase-matcher strictness on the confirm, or adding any second content check+that must contain the phrase. That kills recognition ENTIRELY: "fires on+silence" flips to "never fires". A bias-primed local Whisper+(`initial_prompt=<phrase>`, needed for proper-noun recall) HALLUCINATES the+phrase on silence AND GARBLES it on speech+(`'Mythos'`→`'Mütos'`/`'Hey, Mut!'`, `'Fable'`→`'Farbe'`); <!-- i18n-allow: forensic quotes of the German STT-garble tokens under test -->+the unprimed base model can't spell a hard+custom wake — so NO transcript-content rule separates ghost from wake without+rejecting genuine wakes. The ONLY word-agnostic discriminator is raw audio+ENERGY. Fix: suppress silence at the match site via the RMS gate+(`RollingWhisperWake._match_min_rms`, ghost ≤ 0.0043 vs quiet-mic recall+0.009); keep the bias-echo confirm PERMISSIVE (heard any real speech →+genuine, fail-open) and SKIP it on a loud window (`_ECHO_CONFIRM_SKIP_RMS`,+latency). Guard:+`tests/unit/speech/test_rolling_whisper_wake_silence_ghost.py::test_loud_wake_fires_even_when_unbiased_pass_garbles_the_hard_word`.++### AP-28 — Never gate CI checks on `isinstance` against an unpinned third-party lib++Never gate a pre-push / CI check on `isinstance` against the *installed* copy+of a third-party lib that CI installs **unpinned** (newest), then trust "green+on my machine". Version-skew brick: the lib's next release changes internals+and the gate CRASHES or false-fails in CI while green locally. Typer 0.26+vendored its own Click (`typer._click`), so `typer.main.get_command`'s root+group + params stopped being `isinstance` of the *external*+`click.Group`/`Argument`/`Option` → the CLI-drift gate `AssertionError`'d on+every push though green on local Typer 0.21 (fix 621f837a). Discriminate by+CAPABILITY, never concrete type (`.commands`, Click's stable+`param_type_name`). **Before anything goes PUBLIC: CI must be GREEN and every+red cause understood + fixed — reproduce against the SAME unpinned versions CI+installs, not your local pins.**++### AP-29 — Never commit a signing PRIVATE key (or its passphrase, or an encrypted copy)++Never commit a signing PRIVATE key — nor its passphrase, nor a `*.key.enc`+"encrypted at rest" copy. The installer is signed on key-bound axes (Wave 2+Ed25519, Wave 4 ML-DSA-65). The former scheme stored encrypted private keys+in-repo + a DEMO passphrase in plaintext docs; that passphrase leaked into 14+public snapshots (v0.1.0..v0.9.1), permanent + world-readable — so any key it+wrapped is forgeable. Private keys now live ONLY in GitHub Actions secrets+(base64 PKCS#8 PEM: `WAVE2_OFFLINE_KEY_B64` / `WAVE4_MLDSA65_KEY_B64`), local+backup in the maintainer's password manager; the repo holds ONLY public keys+(`install/keys/*.pub*`) + inlined verifier copies. 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):**+a full PEM PRIVATE KEY block, a tracked `*.key`/`*.key.enc`, or a+`WAVE2_CEREMONY_PASSPHRASE=<value>` line blocks it. Doctrine:+`docs/supply-chain/wave2-key-ceremony.md`.---## 8. Recurring bug classes (must internalize)-Detail in [`docs/BUGS.md`](docs/BUGS.md). Recognize the signal, apply the defense:+Detail in [`docs/BUGS.md`](docs/BUGS.md). Recognize the signal, apply the+defense:1. **Restore trap** (BUG-006/014/015): worktree + frontend build + RAM +- editable-install pinned to a deleted clone. Signal: fix "works in tests" but- behavior unchanged after restart. Defense: `pwsh scripts/preflight.ps1` +- `python -c "import jarvis; print(jarvis.__file__)"`.-2. **Multi-layer enum drift** (BUG-008): empty UI list while DB has rows, HTTP- 500, Pydantic `literal_error`. Defense: five-layer pattern + parity test.+ editable-install pinned to a deleted clone. Signal: fix "works in tests"+ but behavior unchanged after restart. Defense: `pwsh scripts/preflight.ps1`+ + `python -c "import jarvis; print(jarvis.__file__)"`.+2. **Multi-layer enum drift** (BUG-008): empty UI list while DB has rows,+ HTTP 500, Pydantic `literal_error`. Defense: five-layer pattern + parity+ test.3. **Config drift** (BUG-010): parallel sessions rewriting `jarvis.toml`,- silently rolling back provider switches. Defense: `scripts/drift-guard-daemon.ps1`- + ENV overrides + BOM-safe writer.-4. **Subprocess console flicker** (BUG-012): missing `NO_WINDOW_CREATIONFLAGS`.- Defense: import from `jarvis.core.process_utils`.+ silently rolling back provider switches. Defense:+ `scripts/drift-guard-daemon.ps1` + ENV overrides + BOM-safe writer.+4. **Subprocess console flicker** (BUG-012): missing+ `NO_WINDOW_CREATIONFLAGS`. Defense: import from+ `jarvis.core.process_utils`.5. **Audio host-API blocking-write trap** (BUG-014): WDM-KS auto-picked,- PortAudio crashes. Defense: `_FORBIDDEN_OUTPUT_HOSTAPIS` + shortest-unique-token- matching.+ PortAudio crashes. Defense: `_FORBIDDEN_OUTPUT_HOSTAPIS` ++ shortest-unique-token matching.6. **Watchdog stale cross-unit counter** (BUG-032): a stall watchdog reads a- process-global counter never reset per unit → fires between units. Defense:- reset at unit start; re-arm the "not started" guard per unit.-7. **Loop on an unexpected teardown error** (AP-20): a socket loop `continue`s on- a non-`WebSocketDisconnect` error → spins on a dead socket. Defense: treat any- read error as terminal — `break`.+ process-global counter never reset per unit → fires between units.+ Defense: reset at unit start; re-arm the "not started" guard per unit.+7. **Loop on an unexpected teardown error** (AP-20): a socket loop+ `continue`s on a non-`WebSocketDisconnect` error → spins on a dead socket.+ Defense: treat any read error as terminal — `break`.8. **Wedged un-cancellable native inference** (BUG-036): a shared- ctranslate2/faster-whisper model called concurrently hangs unrecoverably; every- later transcribe re-polls the dead engine. Defense: serialize with a+ ctranslate2/faster-whisper model called concurrently hangs unrecoverably;+ every later transcribe re-polls the dead engine. Defense: serialize with anon-blocking lock; self-heal by rebuilding a fresh model (AP-24).9. **Hallucinating-ASR wake precision/recall trap** (AP-27, BUG-037): the- `stt_match` wake transcribes with a bias prompt; the primed model INVENTS the- phrase on silence and GARBLES it on speech, so **"fires on silence" and "stops- working" share ONE root** — any transcript-content ghost filter that tightens- the wake also rejects real wakes. Signal: a "ghost fix" lands and the wake- stops triggering for a hard custom word (`Mythos`→`Mütos`), or vice-versa. <!-- i18n-allow: German STT-garble token under test -->+ `stt_match` wake transcribes with a bias prompt; the primed model INVENTS+ the phrase on silence and GARBLES it on speech, so **"fires on silence"+ and "stops working" share ONE root** — any transcript-content ghost filter+ that tightens the wake also rejects real wakes. Signal: a "ghost fix"+ lands and the wake stops triggering for a hard custom word+ (`Mythos`→`Mütos`), or vice-versa. <!-- i18n-allow: German STT-garble token under test -->Defense: gate silence on raw ENERGY (word-agnostic RMS at the match site),- NEVER on transcript content; keep the confirm permissive + skip it when loud;- the recall guard test must stay green. Truly-instant + zero-ghost custom wake- needs a neural KWS model, not transcription (AP-25).+ NEVER on transcript content; keep the confirm permissive + skip it when+ loud; the recall guard test must stay green. Truly-instant + zero-ghost+ custom wake needs a neural KWS model, not transcription (AP-25).---@@ -356,17 +473,17 @@ Detail in [`docs/BUGS.md`](docs/BUGS.md). Recognize the signal, apply the defens- **The working tree is frequently SHARED** — several parallel agent sessionsedit 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**. If the index/HEAD looks corrupted by a concurrent write, recover via- temp-index commit + `update-ref` CAS + safety branch (`git-rescue` on repo-wide- disorder).-- **App restart is `POST /api/settings/restart-app`**, not `Stop-Process` (Access- Denied under the tray `pythonw.exe`). Editable-install fixes still need this- restart to take effect.+ **hunk-isolated** (`git add -p` / pathspec-scoped). A large uncommitted diff+ is **normal**. If the index/HEAD looks corrupted by a concurrent write,+ recover via temp-index commit + `update-ref` CAS + safety branch+ (`git-rescue` on repo-wide disorder).+- **App restart is `POST /api/settings/restart-app`**, not `Stop-Process`+ (Access Denied under the tray `pythonw.exe`). Editable-install fixes still+ need this restart to take effect.- **New worktree:** run `pwsh scripts/preflight.ps1` before writing code; exitnon-zero → fix first (BUG-006/014).-- **Memory:** check `MEMORY.md` (`~/.claude/projects/.../memory/`) before larger- decisions — stable user preferences live there.+- **Memory:** check `MEMORY.md` (`~/.claude/projects/.../memory/`) before+ larger decisions — stable user preferences live there.- **Plan vs. code:** on conflict, the plan wins(`~/.claude/plans/also-er-muss-auch-lexical-pond.md`); code deviations get <!-- i18n-allow -->documented back in the plan.@@ -379,16 +496,16 @@ project level so every contributor and agent here follows the same workflow.)*- **Auto-commit after each completed logical step**, without being asked. BUTbecause the working tree is shared, stage only **your own** changed files byexplicit path or `git add -p`, hunk-isolated — **never** `git add -A` /- `git add .` (that sweeps another session's in-flight, possibly secret-bearing- work into your commit — the main concurrency hazard here).-- **Use meaningful Conventional-Commit messages** (`feat:`, `fix:`, `refactor:`,- `docs:`, `chore:`).+ `git add .` (that sweeps another session's in-flight, possibly+ secret-bearing work into your commit — the main concurrency hazard here).+- **Use meaningful Conventional-Commit messages** (`feat:`, `fix:`,+ `refactor:`, `docs:`, `chore:`).- **Never push to the remote automatically** — push only when the maintainerexplicitly says so (a public push still runs the §2 privacy gate).-- **Never commit secrets, `.env` files, keys, tokens, or credentials.** If any- appear untracked, STOP, flag them, and do not commit them.-- **Never `git add -A` / `git add .`** without first scanning the staged set for- secrets and for files belonging to another session.+- **Never commit secrets, `.env` files, keys, tokens, or credentials.** If+ any appear untracked, STOP, flag them, and do not commit them.+- **Never `git add -A` / `git add .`** without first scanning the staged set+ for secrets and for files belonging to another session.---@@ -430,9 +547,18 @@ pytest -m "not slow" # fast subset## 11. Pointers-- **Architecture + module catalog + product detail:** [`docs/architecture-overview.md`](docs/architecture-overview.md).-- **Doctrine:** [`CLOUD.md`](CLOUD.md) (cross-platform charter), [`docs/PHILOSOPHY.md`](docs/PHILOSOPHY.md).-- **Bug register:** [`docs/BUGS.md`](docs/BUGS.md). **Anti-drift:** [`docs/anti-drift-three-layer.md`](docs/anti-drift-three-layer.md). **Self-Mod:** [`docs/self_mod.md`](docs/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 the terminal / an agent / itself): `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`.+- **Architecture + module catalog + product detail:**+ [`docs/architecture-overview.md`](docs/architecture-overview.md).+- **Doctrine:** [`CLOUD.md`](CLOUD.md) (cross-platform charter),+ [`docs/PHILOSOPHY.md`](docs/PHILOSOPHY.md).+- **Bug register:** [`docs/BUGS.md`](docs/BUGS.md). **Anti-drift:**+ [`docs/anti-drift-three-layer.md`](docs/anti-drift-three-layer.md).+ **Self-Mod:** [`docs/self_mod.md`](docs/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 the terminal / an agent+ / itself): `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`.diff --git a/CLAUDE.md b/CLAUDE.mdindex 637e446f1e..d356f8a752 100644--- a/CLAUDE.md+++ b/CLAUDE.md@@ -1,45 +1,45 @@# CLAUDE.mdBinding rules for any coding agent in this repo — respect them on **every**-change. Architecture/product detail lives in+change. Architecture and product detail live in[`docs/architecture-overview.md`](docs/architecture-overview.md).---## 0. CLAUDE.md ≡ AGENTS.md (mirror rule — BINDING)-`CLAUDE.md` and `AGENTS.md` are **byte-identical twins** (`CLAUDE.md` is-canonical; `AGENTS.md` is the cross-tool standard name other agents read).-**Every edit to one is mirrored into the other automatically — never let them-drift.** Sync engine: `scripts/ci/sync_agents_md.py` (live `PostToolUse` hook +-`.githooks/pre-commit --stage` + a `--check` CI gate). After editing either,-run the sync (or copy one onto the other) before you commit.+`CLAUDE.md` and `AGENTS.md` are **byte-identical twins**: `CLAUDE.md` is+canonical, `AGENTS.md` is the cross-tool standard name other agents read.+Never let them drift. Sync engine: `scripts/ci/sync_agents_md.py` (live+`PostToolUse` hook + `.githooks/pre-commit --stage` + a `--check` CI gate).+After editing either file, run the sync (or copy one onto the other) before+you commit.---## 1. Language — English-only artifacts, fail-closed (BINDING, HIGHEST PRIORITY)-**Everything an agent commits is English — full stop, no exception outside the-closed list below.** Personal Jarvis is an international open-source project;-assume an arbitrary downloader anywhere on earth, so English is **always**-preferred and never weighed against any single locale. This is **English-only-for artifacts**, not "English-first, German-tolerated". Any "German project" /-"internationales deutsches Projekt" label is **dead**, overridden here. <!-- i18n-allow: names the dead German label being retired -->--**Fail-closed default.** Every line you write *or touch* — code, comments,-docstrings, log/exception/error messages, Markdown (READMEs, ADRs, plans,-`BUGS.md`, handoffs, design/forensic docs), `SKILL.md`, commit messages, PR-titles/bodies, test names + docstrings, CLI help, FastAPI route descriptions,-JSON-schema `description` fields, audit-log entries, telemetry names, UI strings-(i18n key + **English** source) — is English **unless it provably falls inside-the closed product-surface list below.** When in doubt, English. "It's only a-comment / test / internal doc / quick note" is **not** an exemption — those are-where German keeps leaking in. Don't invent a new German-allowed category; if+**Everything an agent commits is English — no exception outside the closed+list below.** Personal Jarvis is an international open-source project; assume+an arbitrary downloader anywhere on earth. This is English-only for artifacts,+not "English-first, German-tolerated". Any "German project" / "internationales+deutsches Projekt" label is dead, overridden here. <!-- i18n-allow: names the dead German label being retired -->++**Fail-closed default.** Every line you write *or touch* is English: code,+comments, docstrings, log/exception/error messages, Markdown (READMEs, ADRs,+plans, `BUGS.md`, handoffs, design/forensic docs), `SKILL.md`, commit messages,+PR titles/bodies, test names and docstrings, CLI help, FastAPI route+descriptions, JSON-schema `description` fields, audit-log entries, telemetry+names, UI strings (i18n key + **English** source) — unless it provably falls+inside the closed list below. When in doubt, English. "It's only a comment /+test / internal doc / quick note" is **not** an exemption — that is exactly+where German keeps leaking in. Never invent a new German-allowed category; ifyou think one exists, stop and ask rather than commit the German.**The ONLY German permitted — the multilingual *product surface* (CLOSED list):**+1. **Runtime voice/TTS + chat output** Jarvis speaks/writes back — governed by- the per-turn resolver in the Runtime-output subsection below.+ the per-turn resolver in the subsection below.2. **i18n / locale *source* files + the website's localized copy** (`*/i18n/*`,`*/locales/*`, `*.de.json`, `*.de.ts`, etc.) — German there *is* the product.3. **Speech-recognition *input vocabulary*** — the German tokens a classifier@@ -48,51 +48,53 @@ you think one exists, stop and ask rather than commit the German.4. **Tests / fixtures + forensic voice-bug deep-dives** that quote 1–3 as thecontent under test.-Materialized file-by-file in `scripts/ci/german-allowlist.txt`. **Anything-outside those four buckets must be English** — German elsewhere is a *defect*,-translate it.+Materialized file-by-file in `scripts/ci/german-allowlist.txt`. German anywhere+else is a **defect** — translate it.- **The allowlist is a curated, justified register, never a free pass.** Every- entry names which of the four reasons it serves. **"Whole-file scope, narrow- later" and "shared tree, do it later" are no longer acceptable.** Prefer an- inline `i18n-allow` on the one load-bearing German line over exempting a whole- file, so a future English line in that file is still checked.+ entry names which of the four reasons it serves. "Whole-file scope, narrow+ later" and "shared tree, do it later" are not acceptable. Prefer an inline+ `i18n-allow` on the one load-bearing German line over exempting a whole file,+ so a future English line in that file is still checked.- **Pre-existing German is *backlog*, not protected.** The old- "don't retro-translate / already-committed is exempt" carve-out is **removed**.- No mass-rewrite mandate (a shared tree makes a giant sweep risky), but when you- edit a file and pass non-product-surface German, **translate it on the way- through** — don't preserve, copy forward, or add more beside it.-- **The CI gate only sees what a PR diff ADDS** (`scripts/ci/check_no_new_german.py`)- — structurally blind to the backlog. So the agent is the first line of defense.-- **Chat/conversation language is each contributor's own choice**, set in their- personal global config (`~/.claude/CLAUDE.md` / `AGENTS.md`). The repo fixes- only the **artifacts** as English. Conversation = your choice; artifacts =- English, always.+ "don't retro-translate / already-committed is exempt" carve-out is removed.+ No mass-rewrite mandate (a shared tree makes a giant sweep risky), but when+ you edit a file and pass non-product-surface German, **translate it on the+ way through** — never preserve, copy forward, or add more beside it.+- **The CI gate only sees what a PR diff ADDS**+ (`scripts/ci/check_no_new_german.py`) — structurally blind to the backlog,+ so the agent is the first line of defense.+- **Chat/conversation language is each contributor's own choice**, set in+ their personal global config (`~/.claude/CLAUDE.md` / `AGENTS.md`). The repo+ fixes only the artifacts. Conversation = your choice; artifacts = English,+ always.### Runtime output language (voice + chat) — BINDING-Governs what Jarvis **speaks/writes back** (a multilingual product surface; does-NOT weaken the English-artifact rule). Supported languages are equal — `de`,-`en`, `es`, any future locale; never a German- or English-only bias.+Governs what Jarvis **speaks/writes back** (a multilingual product surface;+does NOT weaken the English-artifact rule). Supported languages are equal —+`de`, `en`, `es`, any future locale; never a German- or English-only bias.-1. **A turn's output language is decided once, by one resolver —+1. **A turn's output language is decided once, by one resolver** —`jarvis/core/turn_language.py::resolve_output_language` — and every output- layer consumes that decision.** Precedence: explicit `brain.reply_language`- pin → conversation stickiness (a thin one/two-word interjection stays in the- running `conversation_language` and must NOT flip it; only a substantive turn- switches) → detected input language → configured `DEFAULT_LOCALE`.+ layer consumes that decision. Precedence: explicit `brain.reply_language`+ pin → conversation stickiness (a thin one/two-word interjection stays in+ the running `conversation_language` and must NOT flip it; only a+ substantive turn switches) → detected input language → configured+ `DEFAULT_LOCALE`.2. **Applies to ALL user-facing output** — deep reply, ack preamble, spawn- announcements, every canned status/error/clarify/timeout/provider-down phrase,- every deterministic Computer-Use/local-action readback, AND the TTS- voice/BCP-47 pick. A mid-session flip between layers is a bug.-3. **No layer re-derives the language** — no `"de" if _looks_german() else "en"`- (drops `es`), no de/en-only phrase table, no per-layer hardcoded default, no- path that ignores the pin. New phrase tables carry **all** supported languages- and resolve their key through the one resolver.-4. **Honesty over guessing** — a layer that genuinely can't tell falls back to- `DEFAULT_LOCALE`. The durable single-language guarantee is `brain.reply_language`- (`auto` | `de` | `en` | `es`), editable from the desktop **Languages** view.- Guards: `tests/unit/core/test_turn_language.py`,+ announcements, every canned status/error/clarify/timeout/provider-down+ phrase, every deterministic Computer-Use/local-action readback, AND the+ TTS voice/BCP-47 pick. A mid-session flip between layers is a bug.+3. **No layer re-derives the language** — no `"de" if _looks_german() else+ "en"` (drops `es`), no de/en-only phrase table, no per-layer hardcoded+ default, no path that ignores the pin. New phrase tables carry **all**+ supported languages and resolve their key through the one resolver.+4. **Honesty over guessing** — a layer that genuinely can't tell falls back+ to `DEFAULT_LOCALE`. The durable single-language guarantee is+ `brain.reply_language` (`auto` | `de` | `en` | `es`), editable from 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`.@@ -103,101 +105,108 @@ NOT weaken the English-artifact rule). Supported languages are equal — `de`,**ONE project repo: the public flagship`https://github.com/PersonalJarvis/PersonalJarvis`** (PascalCase). EVERYmaintainer "commit / push / save to GitHub / sichere den Stand" targets THIS-repo. <!-- i18n-allow: quoted German maintainer trigger phrase --> The lowercase-`personal-jarvis` (remote `origin`) is a **silent local backup** only, never the-deliverable. Never ask "which repo".+repo. <!-- i18n-allow: quoted German maintainer trigger phrase --> The+lowercase `personal-jarvis` (remote `origin`) is a **silent local backup**+only, never the deliverable. Never ask "which repo".**Why the gate exists:** public history is world-readable forever. One leakedAPI key, real name, personal path (`C:\Users\<name>\...`), private email,internal project id, or Windows SID is permanent — deleting it later does NOTun-publish it (it survives in clones, forks, caches). So every push is rebuiltas a **depersonalized snapshot** through the gate below, in order,-**fail-closed** — any uncertainty at any step STOPS the push.+**fail-closed** — any uncertainty at any step STOPS the push:1. **Tracked-files-only export** — `.gitignore` is the first cut for free:`data/`, `.env`, `jarvis.toml`, the Vault, key material are never candidates.-2. **Distribution denylist** — strips tracked-but-non-public files: internal dev- docs, scratch/experiment scripts, signing keys, red-team notes.+2. **Distribution denylist** — strips tracked-but-non-public files: internal+ dev docs, scratch/experiment scripts, signing keys, red-team notes.3. **Deterministic PII scrub** — masks the maintainer's real name, personal- paths, machine/user identifiers, internal project ids across every staged file.-4. **Mandatory sub-agent privacy review** — reads the ENTIRE staged snapshot and- reports anything the regex scanners could miss. **Additive-only:** it can ADD- a blocking finding but never clear a deterministic one. One finding STOPS.+ paths, machine/user identifiers, internal project ids across every staged+ file.+4. **Mandatory sub-agent privacy review** — reads the ENTIRE staged snapshot+ and reports anything the regex scanners could miss. **Additive-only:** it+ can ADD a blocking finding but never clear a deterministic one. One finding+ STOPS.5. **Deterministic secret/PII scan** — final regex sweep tuned to realcredential shapes/lengths (catches a real key, not every hex string),fail-closed.-6. **Human review** — explicit maintainer go-ahead before any byte crosses the- network. No silent auto-publish.+6. **Human review** — explicit maintainer go-ahead before any byte crosses+ the network. No silent auto-publish.**Isolation:** the push runs from a **separate clean clone**, never your liveworking tree, so raw un-scrubbed state cannot leak through. Backstop: the-pre-push guard (`scripts/ci/guard_no_raw_public_push.py` + `privacy_pre_push.py`,-via `.githooks/pre-push`, `core.hooksPath=.githooks`) HARD-BLOCKS any raw push to-the public repo — it already caught a real Windows-SID leak (blocked, then purged-with filter-repo). Don't remove or weaken it. Engine: `scripts/ci/privacy_gate/`.--**Two volumes, same gate:** *Discreet (DEFAULT)* — "push", "sichere den Stand",-"update GitHub" → clean snapshot, **no bump / tag / release**. *Release (explicit-only)* — "Mach ein Release", "Publish release" → the gate **plus** a SemVer bump-+ git tag + CHANGELOG entry. <!-- i18n-allow: quoted German maintainer trigger phrases --> When ambiguous, default to discreet.--**Guardrails:** **Do not PUSH unless the maintainer asks** (local auto-commit is-fine, governed by §9). `save-to-github` and `github-version` MUST NOT run here —-they push raw state and bypass this gate. Doctrine: [`CLOUD.md`](CLOUD.md).+pre-push guard (`scripts/ci/guard_no_raw_public_push.py` ++`privacy_pre_push.py`, via `.githooks/pre-push`, `core.hooksPath=.githooks`)+HARD-BLOCKS any raw push to the public repo — it already caught a real+Windows-SID leak (blocked, then purged with filter-repo). Never remove or+weaken it. Engine: `scripts/ci/privacy_gate/`.++**Two volumes, same gate:** *Discreet (DEFAULT)* — "push", "sichere den+Stand", "update GitHub" → clean snapshot, **no bump / tag / release**.+*Release (explicit only)* — "Mach ein Release", "Publish release" → the gate+**plus** a SemVer bump + git tag + CHANGELOG entry. <!-- i18n-allow: quoted German maintainer trigger phrases -->+When ambiguous, default to discreet.++**Guardrails:** **Do not PUSH unless the maintainer asks** (local auto-commit+is fine, governed by §9). `save-to-github` and `github-version` MUST NOT run+here — they push raw state and bypass this gate. Doctrine:+[`CLOUD.md`](CLOUD.md).---## 3. Open-source universality — the maintainer's config is NEVER the baseline (BINDING)The recurring, expensive bug class: **building/testing a feature against the-maintainer's own machine, keys, providers, and OS — then shipping it broken for-everyone else.** One rule: **assume an arbitrary downloader, never the-maintainer.** It governs the whole product surface, and the **entire API-Keys /-credential / integration surface — not just brain providers:** STT, TTS, Vision,-Wake, **Telephony (Twilio), Channels (Telegram/Discord), 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 / empty / depleted / 429 / 402 /+maintainer's own machine, keys, providers, and OS — then shipping it broken+for everyone else.** One rule: **assume an arbitrary downloader, never the+maintainer.** It governs the whole product surface and the **entire API-keys /+credential / integration surface — not just brain providers:** STT, TTS,+Vision, Wake, Telephony (Twilio), Channels (Telegram/Discord), 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 / empty / depleted / 429 / 402 /unreachable one degrades or crosses to a **different family** with an honestmessage, never bricking a core path (router, ack/flash, STT, Jarvis-Agentworker, mission critic). Primary AND fallback in the SAME family = asingle-provider brick (AP-22). Gate on **capability**, never a providername/model id (AP-21).-- **work on EVERY OS, incl. a headless `python:3.11-slim` VPS** with no keyring,- D-Bus Secret Service, GPU, audio, or Windows APIs. Base `pip install` + boot- must succeed there. OS-specific code only behind (a) a runtime capability- check, (b) an extras group, (c) a graceful English-message no-op elsewhere.- Use `pathlib` + capability probes + UTF-8; never hardcode `C:\Users\...` or- assume cp1252. **Base install stays torch-/GPU-free + universal**, enforced by- `check_requirements_sync.py` (source ↔ `pyproject`) and- `check_lockfile_universal.py` (compiled `requirements.txt` keeps its- `--universal` marker, admits no `nvidia-*`/`torch`/CUDA/`faster-whisper` — those- live only in the opt-in `[local-voice]` extra); regenerate the lock only with+- **Work on EVERY OS, incl. a headless `python:3.11-slim` VPS** with no+ keyring, D-Bus Secret Service, GPU, audio, or Windows APIs. Base+ `pip install` + boot must succeed there. OS-specific code only behind (a) a+ runtime capability check, (b) an extras group, or (c) a graceful+ English-message no-op elsewhere. Use `pathlib` + capability probes + UTF-8;+ never hardcode `C:\Users\...` or assume cp1252. **Base install stays+ torch-/GPU-free and universal**, enforced by `check_requirements_sync.py`+ (source ↔ `pyproject`) and `check_lockfile_universal.py` (compiled+ `requirements.txt` keeps its `--universal` marker, admits no+ `nvidia-*`/`torch`/CUDA/`faster-whisper` — those live only in the opt-in+ `[local-voice]` extra). Regenerate the lock only with`uv pip compile --universal`, never plain `pip-compile`.-- **be recoverable IN-APP** — entering / switching / connecting a credential and- recovering from a dead one happens inside the app, never by hand-editing+- **Be recoverable IN-APP** — entering / switching / connecting a credential+ and recovering from a dead one happens inside the app, never by hand-editing`jarvis.toml`, exporting an ENV var, or spinning up a cloud instance.-- **store credentials portably** — OS keyring → ENV/.env → local-file fallback+- **Store credentials portably** — OS keyring → ENV/.env → local-file fallback(`config._ensure_keyring_backend`). A save/connect must never 500 on a hostwithout a Secret Service.-**Definition of done (NON-NEGOTIABLE).** A change touching config, credentials,-a provider/integration, or OS-specific code is NOT done until you verify (test or-honest manual trace) the THREE non-maintainer paths:-1. **Fresh install, ONE arbitrary key** — a downloader whose only credential is- for a DIFFERENT provider reaches a working path (chat + voice + Jarvis-Agent +- the touched feature), entirely in-app.+**Definition of done (NON-NEGOTIABLE).** A change touching config,+credentials, a provider/integration, or OS-specific code is NOT done until you+verify (test or honest manual trace) the THREE non-maintainer paths:++1. **Fresh install, ONE arbitrary key** — a downloader whose only credential+ is for a DIFFERENT provider reaches a working path (chat + voice ++ Jarvis-Agent + the touched feature), entirely in-app.2. **Headless Linux** — base `pip install` + boot + the feature work on`python:3.11-slim`; local-only parts degrade to a logged no-op.-3. **Cross-family fallback** — when the configured provider/integration is absent- or dead, the path crosses to whatever the user actually has, or degrades- honestly.+3. **Cross-family fallback** — when the configured provider/integration is+ absent or dead, the path crosses to whatever the user actually has, or+ degrades honestly.**"It works on my machine" is the *defect*.** The maintainer's RTX-5070-Ti /-Windows box with Gemini + OpenRouter keys is <0.1 % of the install base. When in-doubt, gate behind an extras group with a graceful no-op and lead the docs with-the VPS path. Doctrine: [`CLOUD.md`](CLOUD.md) ++Windows box with Gemini + OpenRouter keys is <0.1 % of the install base. When+in doubt, gate behind an extras group with a graceful no-op and lead the docs+with the VPS path. Doctrine: [`CLOUD.md`](CLOUD.md) +[`docs/PHILOSOPHY.md`](docs/PHILOSOPHY.md) (doctrine wins). See AP-21/22/23.---@@ -207,8 +216,8 @@ the VPS path. Doctrine: [`CLOUD.md`](CLOUD.md) +The internal agent/mission/harness system is named **Jarvis-Agents** (singular**Jarvis-Agent**) everywhere a human or LLM could read it — UI labels, docs,comments, new code identifiers, log/voice text. No other names. **Glossary:**-formerly "Subagents" / "Sub-Agent" / "sub_jarvis" / "SubJarvis" and "OpenClaw" /-"openclaw", renamed repo-wide 2026-06-30. Surviving old-name occurrences are+formerly "Subagents" / "Sub-Agent" / "sub_jarvis" / "SubJarvis" and "OpenClaw"+/ "openclaw", renamed repo-wide 2026-06-30. Surviving old-name occurrences areintentional: the external `openclaw` npm worker binary (it owns that name),read-time back-compat config aliases (new `[brain.worker]` /`[harness.jarvis_agent]` still accept old `[brain.sub_jarvis]` /@@ -218,60 +227,65 @@ read-time back-compat config aliases (new `[brain.worker]` /## 5. Architecture essentials (respect on every change)-Full model + module catalog: [`docs/architecture-overview.md`](docs/architecture-overview.md). Rules you cannot break:+Full model + module catalog:+[`docs/architecture-overview.md`](docs/architecture-overview.md). Rules you+cannot break:- **8-layer dependency rule:** higher layers reach lower ones **only viaprotocols** (`jarvis/core/protocols.py`); lateral communication **only** viatyped `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).+ `trace_id` + `timestamp_ns`. A broken subscriber is logged in+ `_safe_dispatch`, never propagated (AP-18).- **Plugins are structural:** under `jarvis/plugins/<group>/<name>.py`,- registered via `pyproject.toml` entry-points, and **must not import `jarvis.*`**- in the plugin module. After editing entry-points: `pip install -e . --no-deps`.- Groups: wakeword, stt, tts, brain, harness, tool, channel.+ registered via `pyproject.toml` entry-points, and **must not import+ `jarvis.*`** in the plugin module. After editing entry-points:+ `pip install -e . --no-deps`. Groups: wakeword, stt, tts, brain, harness,+ tool, channel.- **Streaming first:** all Brain/STT/TTS/Harness methods return`AsyncIterator[...]` (non-streaming yields one element).-- **Secrets** only via `jarvis.core.config.get_secret`: OS keyring → ENV → `.env`- → local-file fallback. Never put keys in code / `jarvis.toml` / commits /- `.claude/`. **Installer signing PRIVATE keys live ONLY in GitHub Actions- secrets — never in the repo, not even encrypted; only PUBLIC keys ship- (AP-29).** Voice/chat must never accept secrets (AP-2).+- **Secrets** only via `jarvis.core.config.get_secret`: OS keyring → ENV →+ `.env` → local-file fallback. Never put keys in code / `jarvis.toml` /+ commits / `.claude/`. **Installer signing PRIVATE keys live ONLY in GitHub+ Actions secrets — never in the repo, not even encrypted; only PUBLIC keys+ ship (AP-29).** Voice/chat must never accept secrets (AP-2).- **Brain is multi-provider** — never hardcode Anthropic/Claude (AP-6); gatefeatures on a **capability** (`supports_vision`, `supports_tools`,- `can_call_tools()`), never a provider name/model id (AP-21). Persona comes from- `jarvis/brain/persona_loader.py` (editable override → packaged+ `can_call_tools()`), never a provider name/model id (AP-21). Persona comes+ from `jarvis/brain/persona_loader.py` (editable override → packaged`JARVIS_PERSONA.md`); never hardcode it.- **Router discipline (ADR-0011):** the router-tier brain is a pure dispatcherover the `ROUTER_TOOLS` frozenset (`jarvis/brain/factory.py`). No spawn toolever enters a worker set (AP-5/AP-14). Extending `ROUTER_TOOLS` → amendADR-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.+ (`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). Self-mod- pipeline (Allowlist→Pre-Validate→Backup→replace→sync reload-test→Rollback→Audit)- is non-negotiable (AP-13/14).-- **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/` still read- as fallback) with kill-on-crash containment (Job Object on Windows;- process-group reaper on POSIX). `MAX_CRITIC_LOOPS = 3` is fixed.+ `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).+- **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/`+ still read as fallback) with kill-on-crash containment (Job Object on+ Windows; process-group reaper on POSIX). `MAX_CRITIC_LOOPS = 3` is fixed.- **Platform gotchas:** UTF-8 stdout (cp1252 default on Windows); everysubprocess 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.+ forbidden (BUG-014); no Windows Service (SYSTEM has no mic); UAC+ `asInvoker`, elevate per-action.---## 6. Safety / risk tiersFour tiers: `safe` / `monitor` / `ask` / `block`, priority **blacklist >-whitelist > tool default** (`jarvis/safety/risk_tier.py`). Whitelist downgrades-to `safe` — the anti-confirmation-fatigue contract. **Direct `Tool.execute()` is-a bug; only `ToolExecutor.execute()` is authorized (AP-3).** Generated skills-land as `state="draft"` and are never auto-activated (AP-15).+whitelist > tool default** (`jarvis/safety/risk_tier.py`). Whitelist+downgrades to `safe` — the anti-confirmation-fatigue contract. **Direct+`Tool.execute()` is a bug; only `ToolExecutor.execute()` is authorized+(AP-3).** Generated skills land as `state="draft"` and are never+auto-activated (AP-15).---@@ -300,55 +314,158 @@ land as `state="draft"` and are never auto-activated (AP-15).| AP-19 | Reuse a process-global progress counter in a stall/heartbeat watchdog without resetting it per unit of work | BUG-032: watchdog measures the idle gap *between* turns → spuriously aborts a fresh TTS answer before its first frame || AP-20 | `continue` (instead of `break`) a WS receive loop on a non-`WebSocketDisconnect` error | Unclean disconnect raises `RuntimeError` → loop re-reads a dead socket forever → log storm + self-restart. Catch `RuntimeError` and `break` || AP-21 | Pin a feature to a provider **name** or **model id** instead of a **capability** | Silently breaks for every other provider. Gate on `supports_vision` / `supports_tools` / `can_call_tools()`; if a flag is wrong/missing, fix/add the capability — don't pin the feature |-| AP-22 | Configure a tier (router/ack/STT/TTS/worker/critic/fallback) whose primary AND fallback resolve to the SAME provider family, or build a fallback chain from hardcoded provider NAMES | Single-provider brick: one missing key / 429 / 402 / outage kills the whole tier even with a healthy DIFFERENT provider present. Resolve every tier through one key-aware chain that skips the dead/keyless provider, crosses families, and degrades honestly only when NO family is reachable — recoverable in-app |-| AP-23 | Build or TEST a feature only against the maintainer's config / keys / provider / OS and claim it done | The whole API-Keys surface silently bricked for every other downloader + on a headless VPS (credentials couldn't be SAVED, ENV keys read as "not configured", channels/plugins/OAuth 500'd). Verify the three non-maintainer paths in §3 |-| AP-24 | Call a shared native inference engine (ctranslate2/faster-whisper, an ONNX/torch session) concurrently from two callers, OR "recover" a hung inference with only a timeout that re-polls the SAME wedged engine | `WhisperModel.transcribe` is NOT thread-safe: the wake poll loop + VAD probe sharing one provider hung it forever; a hung `to_thread` can't be cancelled, so a timeout only BOUNDS, never RECOVERS. Fix: a non-blocking per-instance inference lock (2nd call → skip) + a `recover()` that rebuilds a FRESH model after N failures (BUG-036) |-| AP-25 | Run the always-on wake/keyword Whisper on the **GPU** via CTranslate2/faster-whisper on the basis of CUDA *presence* alone, or hand-pin the upgrade to a hardware name | CUDA presence and CUDA *usability* diverge: on the maintainer's Blackwell GPU (RTX 5070 Ti / sm_120) CTranslate2 `model.transcribe` once **HUNG every inference** under the then-current runtime (8 s timeout → self-heal rebuilds the model → the cold rebuild hangs again → wake **permanently DEAF**), while `get_cuda_device_count()` was happily > 0; the same class hit `base`/`cpu` when ctranslate2's auto thread-pool deadlocked vs PyTorch's OpenMP in the shared process. Re-measured 2026-07-05 on the SAME GPU (ctranslate2 4.7.1 + torch 2.11-cu128): 40/40 turbo/cuda inferences under in-process torch-OpenMP load, zero hangs, p50 117 ms — the hang was **constellation-specific, not "Blackwell forever"**. Rule: gate the GPU wake upgrade on the automated 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, CUDA teardown can die after correct work — cached per ctranslate2 version in `data/wake_gpu_probe.json`), keep the probe OFF the boot path (only non-`fast_first` builds, i.e. the background hot-swap), keep a FIXED `cpu_threads` on the CPU floor, and keep the live backstop (a wedge on the swapped-in GPU model swaps back to the retained base/cpu fallback + `mark_wake_gpu_bad()`). `[stt].wake_high_accuracy=false` stays the hard opt-out. Truly instant+accurate custom-word wake still needs a trained neural KWS model (openWakeWord `custom_onnx`), NOT transcription. See `docs/local-wakeword/WAKE-RELIABILITY-DEEPDIVE.md` |-| AP-26 | Put a feature's init/import on the startup critical path (before `APP_INTERACTIVE` / `VOICE_USABLE`) — sync load in `_run_backend`, the `WebServer` ctor, `_start_speech_and_orb`, or a module-level heavy import | Boot creep: every feature "only adds a second" until boot takes 30+ s (TTU forensic: one wake change added a 114.7 s cascade). New subsystems hook into `_heavy_backend_bg`, a deferred registry scan, or a post-ready task; heavy imports stay lazy or use a `warmup_prefetch` daemon; routes answer 503/None while warming. **Enforced by the pre-push BOOT BUDGET gate** (`scripts/ci/check_boot_budget.py`: window ≤ 8 s, voice-usable + app-interactive ≤ 20 s). Doctrine: `docs/diagnostics/BOOT-TTU-NOTES.md` |-| AP-27 | Suppress `stt_match` wake ghosts by tightening TRANSCRIPT CONTENT — require the bias-echo confirm's unbiased pass to reproduce the wake word, raise phrase-matcher strictness on the confirm, or add any second content check that must contain the phrase | Kills recognition ENTIRELY: "fires on silence" flips to "never fires". A bias-primed local Whisper (`initial_prompt=<phrase>`, needed for proper-noun recall) HALLUCINATES the phrase on silence AND GARBLES it on speech (`'Mythos'`→`'Mütos'`/`'Hey, Mut!'`, `'Fable'`→`'Farbe'`); the unprimed base model can't spell a hard custom wake — so NO transcript-content rule separates ghost from wake without rejecting genuine wakes. The ONLY word-agnostic discriminator is raw audio ENERGY. Fix: suppress silence at the match site via the RMS gate (`RollingWhisperWake._match_min_rms`, ghost ≤ 0.0043 vs quiet-mic recall 0.009); keep the bias-echo confirm PERMISSIVE (heard any real speech → genuine, fail-open) and SKIP it on a loud window (`_ECHO_CONFIRM_SKIP_RMS`, latency). Guard: `tests/unit/speech/test_rolling_whisper_wake_silence_ghost.py::test_loud_wake_fires_even_when_unbiased_pass_garbles_the_hard_word` | <!-- i18n-allow: forensic quotes of the German STT-garble tokens under test -->-| AP-28 | Gate a pre-push / CI check on `isinstance` against the *installed* copy of a third-party lib that CI installs **unpinned** (newest), then trust "green on my machine" | Version-skew brick: the lib's next release changes internals and the gate CRASHES or false-fails in CI while green locally. Typer 0.26 vendored its own Click (`typer._click`), so `typer.main.get_command`'s root group + params stopped being `isinstance` of the *external* `click.Group`/`Argument`/`Option` → the CLI-drift gate `AssertionError`'d on every push though green on local Typer 0.21 (fix 621f837a). Discriminate by CAPABILITY, never concrete type (`.commands`, Click's stable `param_type_name`). **Before anything goes PUBLIC: CI must be GREEN and every red cause understood + fixed — reproduce against the SAME unpinned versions CI installs, not your local pins.** |-| AP-29 | Commit a signing PRIVATE key — or its passphrase, or a `*.key.enc` "encrypted at rest" copy — into the repo | The installer is signed on key-bound axes (Wave 2 Ed25519, Wave 4 ML-DSA-65). The former scheme stored encrypted private keys in-repo + a DEMO passphrase in plaintext docs; that passphrase leaked into 14 public snapshots (v0.1.0..v0.9.1), permanent + world-readable — so any key it wrapped is forgeable. Private keys now live ONLY in GitHub Actions secrets (base64 PKCS#8 PEM: `WAVE2_OFFLINE_KEY_B64` / `WAVE4_MLDSA65_KEY_B64`), local backup in the maintainer's password manager; the repo holds ONLY public keys (`install/keys/*.pub*`) + inlined verifier copies. 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):** a full PEM PRIVATE KEY block, a tracked `*.key`/`*.key.enc`, or a `WAVE2_CEREMONY_PASSPHRASE=<value>` line blocks it. Doctrine: `docs/supply-chain/wave2-key-ceremony.md`. |+| AP-22 | Configure a tier (router/ack/STT/TTS/worker/critic/fallback) whose primary AND fallback resolve to the SAME provider family, or build a fallback chain from hardcoded provider NAMES | Single-provider brick: one missing key / 429 / 402 / outage kills the whole tier even with a healthy DIFFERENT provider present. Resolve every tier through one key-aware chain that skips dead/keyless providers, crosses families, and degrades honestly only when NO family is reachable — recoverable in-app |+| AP-23 | Build or TEST a feature only against the maintainer's config / keys / provider / OS and claim it done | The whole API-keys surface silently bricked for every other downloader + on a headless VPS (credentials couldn't be SAVED, ENV keys read as "not configured", channels/plugins/OAuth 500'd). Verify the three non-maintainer paths in §3 |++The remaining anti-patterns need more context than a table cell allows:++### AP-24 — Never share a native inference engine between concurrent callers++Never call a shared native inference engine (ctranslate2/faster-whisper, an+ONNX/torch session) concurrently from two callers, and never "recover" a hung+inference with only a timeout that re-polls the SAME wedged engine.+`WhisperModel.transcribe` is NOT thread-safe: the wake poll loop + VAD probe+sharing one provider hung it forever, and a hung `to_thread` can't be+cancelled — a timeout only BOUNDS, never RECOVERS. Fix: a non-blocking+per-instance inference lock (second call → skip) + a `recover()` that rebuilds+a FRESH model after N failures (BUG-036).++### AP-25 — Never enable GPU wake on CUDA *presence* or a hardware name++Never run the always-on wake/keyword Whisper on the GPU via+CTranslate2/faster-whisper based on CUDA *presence* alone, and never hand-pin+the upgrade to a hardware name. CUDA presence and CUDA *usability* diverge: on+the maintainer's Blackwell GPU (RTX 5070 Ti / sm_120), CTranslate2+`model.transcribe` once HUNG every inference under the then-current runtime+(8 s timeout → self-heal rebuilds the model → the cold rebuild hangs again →+wake **permanently DEAF**) while `get_cuda_device_count()` was happily > 0;+the same class hit `base`/`cpu` when ctranslate2's auto thread-pool deadlocked+against PyTorch's OpenMP in the shared process. Re-measured 2026-07-05 on the+SAME GPU (ctranslate2 4.7.1 + torch 2.11-cu128): 40/40 turbo/cuda inferences+under in-process torch-OpenMP load, zero hangs, p50 117 ms — the hang was+**constellation-specific, not "Blackwell forever"**.++Rule: gate the GPU wake upgrade on the automated 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, CUDA teardown can die after correct work — cached per+ctranslate2 version in `data/wake_gpu_probe.json`). Keep the probe OFF the+boot path (only non-`fast_first` builds, i.e. the background hot-swap), keep a+FIXED `cpu_threads` on the CPU floor, and keep the live backstop (a wedge on+the swapped-in GPU model swaps back to the retained base/cpu fallback ++`mark_wake_gpu_bad()`). `[stt].wake_high_accuracy=false` stays the hard+opt-out. Truly instant + accurate custom-word wake still needs a trained+neural KWS model (openWakeWord `custom_onnx`), NOT transcription. See+`docs/local-wakeword/WAKE-RELIABILITY-DEEPDIVE.md`.++### AP-26 — Never put a feature's init/import on the startup critical path++Never put init/import work before `APP_INTERACTIVE` / `VOICE_USABLE` — no sync+load in `_run_backend`, the `WebServer` ctor, `_start_speech_and_orb`, or a+module-level heavy import. Boot creep: every feature "only adds a second"+until boot takes 30+ s (TTU forensic: one wake change added a 114.7 s+cascade). New subsystems hook into `_heavy_backend_bg`, a deferred registry+scan, or a post-ready task; heavy imports stay lazy or use a `warmup_prefetch`+daemon; routes answer 503/None while warming. **Enforced by the pre-push BOOT+BUDGET gate** (`scripts/ci/check_boot_budget.py`: window ≤ 8 s, voice-usable ++app-interactive ≤ 20 s). Doctrine: `docs/diagnostics/BOOT-TTU-NOTES.md`.++### AP-27 — Never suppress wake ghosts by tightening transcript content++Never suppress `stt_match` wake ghosts via TRANSCRIPT CONTENT — requiring the+bias-echo confirm's unbiased pass to reproduce the wake word, raising+phrase-matcher strictness on the confirm, or adding any second content check+that must contain the phrase. That kills recognition ENTIRELY: "fires on+silence" flips to "never fires". A bias-primed local Whisper+(`initial_prompt=<phrase>`, needed for proper-noun recall) HALLUCINATES the+phrase on silence AND GARBLES it on speech+(`'Mythos'`→`'Mütos'`/`'Hey, Mut!'`, `'Fable'`→`'Farbe'`); <!-- i18n-allow: forensic quotes of the German STT-garble tokens under test -->+the unprimed base model can't spell a hard+custom wake — so NO transcript-content rule separates ghost from wake without+rejecting genuine wakes. The ONLY word-agnostic discriminator is raw audio+ENERGY. Fix: suppress silence at the match site via the RMS gate+(`RollingWhisperWake._match_min_rms`, ghost ≤ 0.0043 vs quiet-mic recall+0.009); keep the bias-echo confirm PERMISSIVE (heard any real speech →+genuine, fail-open) and SKIP it on a loud window (`_ECHO_CONFIRM_SKIP_RMS`,+latency). Guard:+`tests/unit/speech/test_rolling_whisper_wake_silence_ghost.py::test_loud_wake_fires_even_when_unbiased_pass_garbles_the_hard_word`.++### AP-28 — Never gate CI checks on `isinstance` against an unpinned third-party lib++Never gate a pre-push / CI check on `isinstance` against the *installed* copy+of a third-party lib that CI installs **unpinned** (newest), then trust "green+on my machine". Version-skew brick: the lib's next release changes internals+and the gate CRASHES or false-fails in CI while green locally. Typer 0.26+vendored its own Click (`typer._click`), so `typer.main.get_command`'s root+group + params stopped being `isinstance` of the *external*+`click.Group`/`Argument`/`Option` → the CLI-drift gate `AssertionError`'d on+every push though green on local Typer 0.21 (fix 621f837a). Discriminate by+CAPABILITY, never concrete type (`.commands`, Click's stable+`param_type_name`). **Before anything goes PUBLIC: CI must be GREEN and every+red cause understood + fixed — reproduce against the SAME unpinned versions CI+installs, not your local pins.**++### AP-29 — Never commit a signing PRIVATE key (or its passphrase, or an encrypted copy)++Never commit a signing PRIVATE key — nor its passphrase, nor a `*.key.enc`+"encrypted at rest" copy. The installer is signed on key-bound axes (Wave 2+Ed25519, Wave 4 ML-DSA-65). The former scheme stored encrypted private keys+in-repo + a DEMO passphrase in plaintext docs; that passphrase leaked into 14+public snapshots (v0.1.0..v0.9.1), permanent + world-readable — so any key it+wrapped is forgeable. Private keys now live ONLY in GitHub Actions secrets+(base64 PKCS#8 PEM: `WAVE2_OFFLINE_KEY_B64` / `WAVE4_MLDSA65_KEY_B64`), local+backup in the maintainer's password manager; the repo holds ONLY public keys+(`install/keys/*.pub*`) + inlined verifier copies. 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):**+a full PEM PRIVATE KEY block, a tracked `*.key`/`*.key.enc`, or a+`WAVE2_CEREMONY_PASSPHRASE=<value>` line blocks it. Doctrine:+`docs/supply-chain/wave2-key-ceremony.md`.---## 8. Recurring bug classes (must internalize)-Detail in [`docs/BUGS.md`](docs/BUGS.md). Recognize the signal, apply the defense:+Detail in [`docs/BUGS.md`](docs/BUGS.md). Recognize the signal, apply the+defense:1. **Restore trap** (BUG-006/014/015): worktree + frontend build + RAM +- editable-install pinned to a deleted clone. Signal: fix "works in tests" but- behavior unchanged after restart. Defense: `pwsh scripts/preflight.ps1` +- `python -c "import jarvis; print(jarvis.__file__)"`.-2. **Multi-layer enum drift** (BUG-008): empty UI list while DB has rows, HTTP- 500, Pydantic `literal_error`. Defense: five-layer pattern + parity test.+ editable-install pinned to a deleted clone. Signal: fix "works in tests"+ but behavior unchanged after restart. Defense: `pwsh scripts/preflight.ps1`+ + `python -c "import jarvis; print(jarvis.__file__)"`.+2. **Multi-layer enum drift** (BUG-008): empty UI list while DB has rows,+ HTTP 500, Pydantic `literal_error`. Defense: five-layer pattern + parity+ test.3. **Config drift** (BUG-010): parallel sessions rewriting `jarvis.toml`,- silently rolling back provider switches. Defense: `scripts/drift-guard-daemon.ps1`- + ENV overrides + BOM-safe writer.-4. **Subprocess console flicker** (BUG-012): missing `NO_WINDOW_CREATIONFLAGS`.- Defense: import from `jarvis.core.process_utils`.+ silently rolling back provider switches. Defense:+ `scripts/drift-guard-daemon.ps1` + ENV overrides + BOM-safe writer.+4. **Subprocess console flicker** (BUG-012): missing+ `NO_WINDOW_CREATIONFLAGS`. Defense: import from+ `jarvis.core.process_utils`.5. **Audio host-API blocking-write trap** (BUG-014): WDM-KS auto-picked,- PortAudio crashes. Defense: `_FORBIDDEN_OUTPUT_HOSTAPIS` + shortest-unique-token- matching.+ PortAudio crashes. Defense: `_FORBIDDEN_OUTPUT_HOSTAPIS` ++ shortest-unique-token matching.6. **Watchdog stale cross-unit counter** (BUG-032): a stall watchdog reads a- process-global counter never reset per unit → fires between units. Defense:- reset at unit start; re-arm the "not started" guard per unit.-7. **Loop on an unexpected teardown error** (AP-20): a socket loop `continue`s on- a non-`WebSocketDisconnect` error → spins on a dead socket. Defense: treat any- read error as terminal — `break`.+ process-global counter never reset per unit → fires between units.+ Defense: reset at unit start; re-arm the "not started" guard per unit.+7. **Loop on an unexpected teardown error** (AP-20): a socket loop+ `continue`s on a non-`WebSocketDisconnect` error → spins on a dead socket.+ Defense: treat any read error as terminal — `break`.8. **Wedged un-cancellable native inference** (BUG-036): a shared- ctranslate2/faster-whisper model called concurrently hangs unrecoverably; every- later transcribe re-polls the dead engine. Defense: serialize with a+ ctranslate2/faster-whisper model called concurrently hangs unrecoverably;+ every later transcribe re-polls the dead engine. Defense: serialize with anon-blocking lock; self-heal by rebuilding a fresh model (AP-24).9. **Hallucinating-ASR wake precision/recall trap** (AP-27, BUG-037): the- `stt_match` wake transcribes with a bias prompt; the primed model INVENTS the- phrase on silence and GARBLES it on speech, so **"fires on silence" and "stops- working" share ONE root** — any transcript-content ghost filter that tightens- the wake also rejects real wakes. Signal: a "ghost fix" lands and the wake- stops triggering for a hard custom word (`Mythos`→`Mütos`), or vice-versa. <!-- i18n-allow: German STT-garble token under test -->+ `stt_match` wake transcribes with a bias prompt; the primed model INVENTS+ the phrase on silence and GARBLES it on speech, so **"fires on silence"+ and "stops working" share ONE root** — any transcript-content ghost filter+ that tightens the wake also rejects real wakes. Signal: a "ghost fix"+ lands and the wake stops triggering for a hard custom word+ (`Mythos`→`Mütos`), or vice-versa. <!-- i18n-allow: German STT-garble token under test -->Defense: gate silence on raw ENERGY (word-agnostic RMS at the match site),- NEVER on transcript content; keep the confirm permissive + skip it when loud;- the recall guard test must stay green. Truly-instant + zero-ghost custom wake- needs a neural KWS model, not transcription (AP-25).+ NEVER on transcript content; keep the confirm permissive + skip it when+ loud; the recall guard test must stay green. Truly-instant + zero-ghost+ custom wake needs a neural KWS model, not transcription (AP-25).---@@ -356,17 +473,17 @@ Detail in [`docs/BUGS.md`](docs/BUGS.md). Recognize the signal, apply the defens- **The working tree is frequently SHARED** — several parallel agent sessionsedit 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**. If the index/HEAD looks corrupted by a concurrent write, recover via- temp-index commit + `update-ref` CAS + safety branch (`git-rescue` on repo-wide- disorder).-- **App restart is `POST /api/settings/restart-app`**, not `Stop-Process` (Access- Denied under the tray `pythonw.exe`). Editable-install fixes still need this- restart to take effect.+ **hunk-isolated** (`git add -p` / pathspec-scoped). A large uncommitted diff+ is **normal**. If the index/HEAD looks corrupted by a concurrent write,+ recover via temp-index commit + `update-ref` CAS + safety branch+ (`git-rescue` on repo-wide disorder).+- **App restart is `POST /api/settings/restart-app`**, not `Stop-Process`+ (Access Denied under the tray `pythonw.exe`). Editable-install fixes still+ need this restart to take effect.- **New worktree:** run `pwsh scripts/preflight.ps1` before writing code; exitnon-zero → fix first (BUG-006/014).-- **Memory:** check `MEMORY.md` (`~/.claude/projects/.../memory/`) before larger- decisions — stable user preferences live there.+- **Memory:** check `MEMORY.md` (`~/.claude/projects/.../memory/`) before+ larger decisions — stable user preferences live there.- **Plan vs. code:** on conflict, the plan wins(`~/.claude/plans/also-er-muss-auch-lexical-pond.md`); code deviations get <!-- i18n-allow -->documented back in the plan.@@ -379,16 +496,16 @@ project level so every contributor and agent here follows the same workflow.)*- **Auto-commit after each completed logical step**, without being asked. BUTbecause the working tree is shared, stage only **your own** changed files byexplicit path or `git add -p`, hunk-isolated — **never** `git add -A` /- `git add .` (that sweeps another session's in-flight, possibly secret-bearing- work into your commit — the main concurrency hazard here).-- **Use meaningful Conventional-Commit messages** (`feat:`, `fix:`, `refactor:`,- `docs:`, `chore:`).+ `git add .` (that sweeps another session's in-flight, possibly+ secret-bearing work into your commit — the main concurrency hazard here).+- **Use meaningful Conventional-Commit messages** (`feat:`, `fix:`,+ `refactor:`, `docs:`, `chore:`).- **Never push to the remote automatically** — push only when the maintainerexplicitly says so (a public push still runs the §2 privacy gate).-- **Never commit secrets, `.env` files, keys, tokens, or credentials.** If any- appear untracked, STOP, flag them, and do not commit them.-- **Never `git add -A` / `git add .`** without first scanning the staged set for- secrets and for files belonging to another session.+- **Never commit secrets, `.env` files, keys, tokens, or credentials.** If+ any appear untracked, STOP, flag them, and do not commit them.+- **Never `git add -A` / `git add .`** without first scanning the staged set+ for secrets and for files belonging to another session.---@@ -430,9 +547,18 @@ pytest -m "not slow" # fast subset## 11. Pointers-- **Architecture + module catalog + product detail:** [`docs/architecture-overview.md`](docs/architecture-overview.md).-- **Doctrine:** [`CLOUD.md`](CLOUD.md) (cross-platform charter), [`docs/PHILOSOPHY.md`](docs/PHILOSOPHY.md).-- **Bug register:** [`docs/BUGS.md`](docs/BUGS.md). **Anti-drift:** [`docs/anti-drift-three-layer.md`](docs/anti-drift-three-layer.md). **Self-Mod:** [`docs/self_mod.md`](docs/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 the terminal / an agent / itself): `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`.+- **Architecture + module catalog + product detail:**+ [`docs/architecture-overview.md`](docs/architecture-overview.md).+- **Doctrine:** [`CLOUD.md`](CLOUD.md) (cross-platform charter),+ [`docs/PHILOSOPHY.md`](docs/PHILOSOPHY.md).+- **Bug register:** [`docs/BUGS.md`](docs/BUGS.md). **Anti-drift:**+ [`docs/anti-drift-three-layer.md`](docs/anti-drift-three-layer.md).+ **Self-Mod:** [`docs/self_mod.md`](docs/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 the terminal / an agent+ / itself): `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`.