Skip to content

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

docs: align every public capability claim with the code that backs it

Ruben Lütke1aa14e0bac73
diff --git a/README.md b/README.md
index 56f09d7441..55610e5958 100644
--- a/README.md
+++ b/README.md
@@ -21,8 +21,9 @@
---
Not a classical voice assistant: a fast **Router-Brain** listens, decides, and *delegates* —
-heavy work goes to interchangeable agent harnesses (Claude Code, Codex CLI, MCP,
-computer-use) that run isolated, get reviewed by a critic, and report back in your language.
+heavy work goes to interchangeable coding-agent workers (Claude Code, Codex CLI, Gemini CLI,
+or an in-process worker on whatever API key you have) that run isolated, get reviewed by a
+critic, and report back in your language.
**Provider-agnostic** (Gemini, Claude, OpenAI, OpenRouter — one setting), **self-modifying**,
and it runs everywhere — headless server to full voice desktop.
@@ -33,10 +34,19 @@ and it runs everywhere — headless server to full voice desktop.
| *"Research vector databases."* | An isolated agent digs in; the finished report lands as a download in **Outputs**. |
| *"Call the clinic and book the next open appointment."* | A real outbound phone call goes out through the optional Twilio line. |
| *"Remember: Alex prefers Signal over email."* | Written to the Knowledge Wiki — still known in every future session. |
-| *"When the download finishes, ping me on Telegram."* | A when-then trigger arms itself and messages you the moment it fires. |
+| *"Switch the voice over to Cartesia."* | The speech provider changes live and reads the change back to you, old → new. |
| *"Open the browser and pull up the weather."* | Jarvis takes mouse and keyboard and does it on your screen. |
-Every one of these works today, out of the box.
+Every one of these runs on shipped code — none is a roadmap item. Two carry a setup cost
+that is not "out of the box": the **phone call** needs the optional `[telephony]` extra plus
+your own Twilio account, a number, and a publicly reachable HTTPS URL for the webhooks;
+**computer use** needs a desktop install with a screen, not the headless one.
+
+**When-then triggers** are a real feature too, but they are *not* voice-armed: you create
+them in the **Tasks** view or with `jarvis tasks create`, not by saying "when X, do Y".
+They fire on a clock, an interval, or one of Jarvis's own internal events (a mission
+finishing, a message being sent) — not on arbitrary things happening elsewhere on your PC —
+and what they can do is *speak*, *run one tool*, *dispatch a harness*, or *run an agent turn*.
## See it in action
@@ -54,10 +64,10 @@ Every one of these works today, out of the box.
| | |
|---|---|
-| **Never blocks** | A sub-second Ack-Brain replies while the deep brain still thinks. |
-| **Meta-orchestrator** | A lean Router dispatches to specialized harnesses, not one giant prompt. |
+| **Never blocks** | The moment the Router picks an action you hear a grounded one-liner about *that* action — not a guess, and not silence. |
+| **Meta-orchestrator** | A lean Router dispatches to specialized tools and workers, not one giant prompt. |
| **Self-healing** | Missions run in isolated worktrees; a critic reviews before you hear it. |
-| **Provider-agnostic** | Gemini, Claude, OpenAI, OpenRouter — switch by voice, smart fallback. |
+| **Provider-agnostic** | Gemini, Claude, OpenAI, OpenRouter — one setting, smart cross-family fallback. Voice and speech providers switch by voice; the **brain** provider is yours alone, changeable only in the app or the CLI. |
| **Your plan or key** | Run agents on a subscription login or a pay-per-token key. |
| **Self-modifying** | Rewrites its own settings through a reversible, audited pipeline. |
| **Lasting memory** | A Knowledge Wiki + awareness build a model of you across sessions. |
@@ -81,8 +91,8 @@ plugins be swapped freely.
```
L7 UI/UX Desktop app (FastAPI + React + pywebview), tray, Orb overlay
-L6 Orchestrator State machine, Router, BrainManager, Mission-Manager, Controller
-L5 Harness adapter Claude Code, Codex, Open Interpreter, MCP, raw computer-use
+L6 Orchestrator State machine, Router, BrainManager, Mission-Manager + workers, Controller
+L5 Harness adapter python-script, computer-use (coding agents are L6 mission workers)
L4 Brain Gemini · Claude · OpenAI · Grok · OpenRouter + sub-second Ack-Brain
L3 Intent / Risk Classifier, four-tier risk policy, approval, rate-limit tracking
L2 Speech Wake → VAD → STT → TTS (cloud or local, your choice)
@@ -229,12 +239,16 @@ Jarvis reads and writes. Tell it something once and every future session knows.
It's plain files on your disk — read it, edit it, sync it, own it.
**Computer use.** Jarvis takes the mouse and keyboard when you ask: open apps,
-click, type, navigate — with an on-screen action border so you always see when
-it's driving.
+click, type, navigate — with an on-screen action border so you see when it's
+driving. The border is drawn by a small Qt sidecar from the `[desktop]` extra;
+where that is absent (base or headless install, aarch64 Linux) it degrades to a
+logged no-op and the control itself still works.
**Channels & telephony.** Desktop window, browser, Telegram, and Discord all
-reach the same brain and share the same memory. Optional Twilio integration
-makes real outbound phone calls.
+reach the same brain and share the same memory. Real outbound phone calls are
+possible but not out of the box: they need the optional `[telephony]` extra, your
+own Twilio account and number, and a publicly reachable HTTPS URL Twilio can call
+back for the voice webhook and the media socket.
**Safety tiers.** Every action is classified **safe / monitor / ask / block**
before it runs — destructive things ask first, whitelisted routines stop nagging
@@ -242,8 +256,10 @@ you, and the blacklist always outranks the whitelist.
**Self-modification.** It can change its own settings by voice — through a
guarded pipeline (validate → backup → apply → verify → roll back on failure)
-with a full audit trail. Generated skills always land as *drafts* for your
-review; nothing self-activates.
+with a full audit trail. Deliberately out of its own reach: secrets and keys,
+the safety tiers, the review gates, and the **active brain provider**, which
+only you can change from the app or the CLI. Generated skills always land as
+*drafts* for your review; nothing self-activates.
**Realtime voice.** Optional speech-to-speech mode (OpenAI Realtime, Gemini
Live) for sub-second conversational latency — with automatic fallback to the
@@ -280,7 +296,7 @@ phrase = "" # YOUR word — nothing is preset for you
engine = "auto" # resolves the best engine for your phrase
[stt]
-provider = "groq-api" # or openai-api, openrouter-stt, deepgram-…
+provider = "groq-api" # or openai-api, openrouter-stt, gemini-api, faster-whisper (local)
[tts]
provider = "gemini-flash-tts"
@@ -310,7 +326,7 @@ one line in `pyproject.toml`, reinstall — no fork, no core edits.
| `jarvis.stt` / `jarvis.tts` | Speech recognition / synthesis backends |
| `jarvis.wakeword` | Wake-word engines |
| `jarvis.realtime` | Speech-to-speech providers |
-| `jarvis.harness` | Agent harnesses missions delegate to |
+| `jarvis.harness` | Harness adapters the router and when-then tasks dispatch to |
| `jarvis.tool` | Actions the router can call directly |
| `jarvis.channel` | New surfaces — chat platforms, transports |
@@ -328,7 +344,6 @@ chat whole.
PersonalJarvis/
├── jarvis/ # The application — every core package (brain, speech, missions, memory, UI server…)
├── ui/ # Orb overlay for the desktop; loaded by jarvis at runtime
-├── OS-Level/ # Edge-glow overlay process — action border, mascot, cursor trail
├── board-backend/ # Standalone federation service (verifies signed Board aggregates)
├── conductor/ # YAML-first agentic-workflow canvas, mounted inside the app
├── wiki/ # Seed knowledge vault (Obsidian-compatible), created on first run
diff --git a/docs/LLM-CONTEXT.md b/docs/LLM-CONTEXT.md
index 7b76943bbf..bd655580be 100644
--- a/docs/LLM-CONTEXT.md
+++ b/docs/LLM-CONTEXT.md
@@ -9,7 +9,7 @@
> **Looking for the human-facing overview?** See [`../README.md`](../README.md).
> **Binding source-of-truth:** [`../CLAUDE.md`](../CLAUDE.md) + the docs linked at the bottom.
-**Personal Jarvis** is a voice-driven **Supervisor-Agent meta-orchestrator** — not a classical voice assistant. The core pattern is a fast **Router-Brain** that dispatches work to interchangeable harnesses (Jarvis-Agents subprocess, Codex CLI, Open Interpreter, MCP servers, raw computer-use loops). The voice layer is just the I/O surface; the soul is the dispatcher discipline that keeps the Router-Brain lean and delegates heavy reasoning to specialized Jarvis-Agents under critic-loop + worktree-isolation guard rails. The project is **provider-agnostic by mandate** — the user has no Anthropic API account (Claude Max OAuth is used only inside workers) — and **self-modifying** via an atomic config-writer with a 10-step validate-backup-tempfile-replace-rollback-audit pipeline.
+**Personal Jarvis** is a voice-driven **Supervisor-Agent meta-orchestrator** — not a classical voice assistant. The core pattern is a fast **Router-Brain** that dispatches work to interchangeable executors: router-tier tools, a computer-use harness, and — for heavy work — isolated mission workers (`ClaudeDirectWorker`, `CodexDirectWorker`, `GoogleCliWorker`, in-process `ApiAgentWorker`). NB: only two `jarvis.harness` entry points are registered, `python-script` and `screenshot` (`pyproject.toml`); `open_interpreter.py` is a stub that returns `exit_code=1` and `mcp_remote.py` is unregistered — `tests/contract/test_harness_protocol.py` asserts both are unavailable. MCP reaches the brain as *tools* via the `mcp-tools` loader, not as a harness. The voice layer is just the I/O surface; the soul is the dispatcher discipline that keeps the Router-Brain lean and delegates heavy reasoning to specialized Jarvis-Agents under critic-loop + worktree-isolation guard rails. The project is **provider-agnostic by mandate** — the user has no Anthropic API account (Claude Max OAuth is used only inside workers) — and **self-modifying** via an atomic config-writer with a 10-step validate-backup-tempfile-replace-rollback-audit pipeline.
> ### Cloud-First — Read This Before The Install Section
> **Target runtime is any €5 / month VPS or low-spec laptop** with a modern browser. **The maintainer's RTX 5070 Ti / Windows 11 Pro workstation is not a requirement** — it represents fewer than 0.1 % of the install base this project is being designed for. All Brain / STT / TTS / Vision / Wake providers default to cloud APIs; no GPU, no local models, no Windows APIs, no microphone are required in the base install. Windows-desktop features (tray app, Orb overlay, global hotkey wake, local Whisper, Silero-VAD-in-process, Computer-Use harness, PowerShell drift-guard daemon) are **opt-in `[desktop]` extras**, not requirements. **Binding doctrine: [`docs/PHILOSOPHY.md`](docs/PHILOSOPHY.md)**. On conflict between this README and `PHILOSOPHY.md`, the doctrine wins.
@@ -556,9 +556,9 @@ Line length 100. Target `py311`. One per-file `E501` exception (`jarvis/awarenes
- **Claude-API** plugin exists but **user has NO Anthropic API account** (AP-6). Workers use Claude Sonnet via Claude Max OAuth through the `claude-cli` backend (`@anthropic-ai/claude-code`), auto-installed by wizard via npm.
- **OpenRouter** universal gateway, **OpenAI** GPT, **Codex** API-key mode.
-**STT** (6 plugins): `faster-whisper` (local, GPU), `openai-api`, `groq-api`, `deepgram`, `deepgram-flux` (Phase L.3 streaming), `deepgram-nova3`. **Google Cloud STT** wired 2026-05-15 — `chirp_2` @ `europe-west4`, ~680ms warm latency. SA-key under `~/.config/jarvis/`.
+**STT** — 4 registered `jarvis.stt` entry points (`pyproject.toml`): `groq-api`, `openrouter-stt`, `openai-api`, `gemini-api`. Plus the key-free local `faster-whisper`, which is NOT an entry point: it is the hard-wired universal fallback built by `_build_local_fallback` (`jarvis/plugins/stt/__init__.py:316`) and selectable as `provider = "faster-whisper"`. The `deepgram*` names were REMOVED (`jarvis/plugins/stt/__init__.py:52`) so the cross-family resolver can never cross to a non-existent provider; no Google Cloud STT plugin exists.
-**TTS** (8 plugins): `elevenlabs`, `elevenlabs-flash`, `gemini-flash-tts`, `google-neural2`, `openai-tts`, `piper-local`, `grok-voice` (default; 5 voices, `leo`=Jarvis-Butler), `cartesia-sonic3`.
+**TTS** — 6 registered `jarvis.tts` entry points (`pyproject.toml`): `inworld`, `elevenlabs`, `gemini-flash-tts`, `grok-voice` (5 voices, `leo`), `cartesia`, `openrouter-tts`. The names `elevenlabs-flash`, `google-neural2`, `openai-tts` and `piper-local` are NOT registered and have no plugin module.
**Wake** (2): `porcupine` (Picovoice access key), `openwakeword` (local, threshold tuned to 0.10 — BUG-009 lesson).
diff --git a/jarvis.toml.example b/jarvis.toml.example
index 7ecbae6703..57c2fdb893 100644
--- a/jarvis.toml.example
+++ b/jarvis.toml.example
@@ -44,7 +44,7 @@ sensitivity = 0.5 # 0.5..1 (values below 0.5 are lifted — the wake
# ── Speech-to-Text ──
[stt]
-provider = "groq-api" # groq-api | openai-api | openrouter-stt | deepgram-flux | deepgram-nova3
+provider = "groq-api" # groq-api | openai-api | openrouter-stt | gemini-api | faster-whisper (local)
device = "cpu" # cpu | cuda — keep "cpu" unless you have a local GPU
language = "auto" # "de" | "en" | "auto"
bias_prompt = "" # optional comma-separated vocab to stabilize proper nouns
diff --git a/scripts/_e2e_jarvis_agent_verify.py b/scripts/_e2e_jarvis_agent_verify.py
deleted file mode 100644
index 35480463ec..0000000000
--- a/scripts/_e2e_jarvis_agent_verify.py
+++ /dev/null
@@ -1,200 +0,0 @@
-"""Headless E2E verification of the xai/sonnet fix.
-
-Spawns the SubJarvisWorker directly (no Mission-Manager / Kontrollierer
-layer in between) with a tiny prompt, then inspects:
-
- - the worker yielded ClaudeSystemInit + ClaudeResult
- - the model arg in the spawned argv is NOT "xai/sonnet" (the bug)
- - the spawned argv carries "xai/grok-4.3" (the config chain)
- - the workspace contains the file the prompt asked for
- - stderr.log contains no FailoverError
-
-Two missions are run with different goals to match the goal spec.
-"""
-from __future__ import annotations
-
-import asyncio
-import json
-import os
-import shutil
-import sys
-import time
-import uuid
-from pathlib import Path
-from typing import Any
-
-# Project on sys.path
-PROJECT = Path(__file__).parent.parent
-sys.path.insert(0, str(PROJECT))
-
-from jarvis.missions.isolation.job_object import AlwaysOpenJobObject
-from jarvis.missions.workers.subjarvis_worker import SubJarvisWorker
-
-
-def _build_env() -> dict[str, str]:
- """Minimal env: XAI_API_KEY for grok + system tools."""
- from jarvis.core.config import get_secret
-
- grok = get_secret("grok_api_key", env_fallback="GROK_API_KEY")
- env = {
- # tools the openclaw CLI needs to spawn (path lookups, etc.)
- "PATH": os.environ.get("PATH", ""),
- "SYSTEMROOT": os.environ.get("SYSTEMROOT", "C:\\Windows"),
- "USERPROFILE": os.environ.get("USERPROFILE", ""),
- "APPDATA": os.environ.get("APPDATA", ""),
- "LOCALAPPDATA": os.environ.get("LOCALAPPDATA", ""),
- "TEMP": os.environ.get("TEMP", ""),
- "TMP": os.environ.get("TMP", ""),
- "HOMEDRIVE": os.environ.get("HOMEDRIVE", "C:"),
- "HOMEPATH": os.environ.get("HOMEPATH", "\\Users\\Administrator"),
- }
- if grok:
- env["XAI_API_KEY"] = grok
- env["GROK_API_KEY"] = grok
- return env
-
-
-async def _run_one_mission(
- label: str,
- prompt: str,
- artefact_check,
-) -> dict[str, Any]:
- mission_dir = PROJECT.parent / "sub-agents-outputs" / f"e2e_verify_{label}_{uuid.uuid4().hex[:8]}"
- workspace = mission_dir / "workspace"
- logs = mission_dir / "logs"
- workspace.mkdir(parents=True, exist_ok=True)
- logs.mkdir(parents=True, exist_ok=True)
-
- env = _build_env()
- env["OPENCLAW_STATE_DIR"] = str(mission_dir / "openclaw_state")
-
- worker = SubJarvisWorker()
- started = time.time()
- events = []
-
- # NOTE: We pass model="sonnet" on purpose — that's the exact
- # Decomposer-default value that produced the bug. The fix must filter
- # it out and use [brain.sub_jarvis] from jarvis.toml (= grok-4.3) instead.
- try:
- async for ev in worker.spawn(
- prompt,
- worktree=workspace,
- env=env,
- job=AlwaysOpenJobObject(),
- worker_id=f"e2e-{label}",
- log_dir=logs,
- model="sonnet", # the trapdoor — must be filtered
- timeout_s=300.0,
- ):
- events.append(type(ev).__name__)
- except Exception as exc: # noqa: BLE001
- return {
- "label": label,
- "ok": False,
- "reason": f"worker spawn raised: {exc!r}",
- "duration_s": time.time() - started,
- "events": events,
- "mission_dir": str(mission_dir),
- }
-
- duration_s = time.time() - started
-
- # Inspect logs
- stderr_path = logs / "stderr.log"
- stream_path = logs / "stream.jsonl"
- stderr_txt = stderr_path.read_text(encoding="utf-8", errors="replace") if stderr_path.exists() else ""
- stream_txt = stream_path.read_text(encoding="utf-8", errors="replace") if stream_path.exists() else ""
-
- bad_failover = "FailoverError" in stderr_txt or "xai/sonnet" in stderr_txt
- artefact_ok, artefact_detail = artefact_check(workspace)
-
- return {
- "label": label,
- "events": events,
- "duration_s": round(duration_s, 1),
- "stderr_clean": not bad_failover,
- "stderr_snippet": stderr_txt[:500] if stderr_txt else "",
- "stream_has_init_and_result": (
- "ClaudeSystemInit" in events and "ClaudeResult" in events
- ),
- "artefact_ok": artefact_ok,
- "artefact_detail": artefact_detail,
- "mission_dir": str(mission_dir),
- }
-
-
-def _check_hello_py(workspace: Path) -> tuple[bool, str]:
- """Mission 1: hello.py must exist and print 'hello world'."""
- f = workspace / "hello.py"
- if not f.exists():
- return False, f"missing {f}"
- content = f.read_text(encoding="utf-8")
- if "hello world" not in content.lower():
- return False, f"content does not contain 'hello world': {content[:200]!r}"
- if "print" not in content:
- return False, f"no print() call: {content[:200]!r}"
- return True, f"hello.py {f.stat().st_size} bytes, contains print + hello world"
-
-
-def _check_result_txt(workspace: Path) -> tuple[bool, str]:
- """Mission 2: result.txt with at least 1 non-empty line."""
- f = workspace / "result.txt"
- if not f.exists():
- return False, f"missing {f}"
- lines = [ln for ln in f.read_text(encoding="utf-8").splitlines() if ln.strip()]
- if not lines:
- return False, "result.txt empty"
- return True, f"result.txt {len(lines)} non-empty lines"
-
-
-async def main() -> int:
- print("=" * 60)
- print("E2E verification of xai/sonnet fix (Phase 3)")
- print("=" * 60)
-
- # NOTE: Goal text used `print('hello world')` with literal newlines in
- # the prompt. On Windows the openclaw.cmd shim re-tokenises argv via
- # cmd.exe, which (a) treats apostrophes as metachars and (b) chops the
- # --message argument on embedded newlines. Either trap silently
- # collapses --model so the CLI falls back to its first listed
- # provider (openai/gpt-5.5) and aborts with auth-failed — exact same
- # pattern as the GeminiWorker cmd-wrapper trap fixed 2026-05-13.
- # Single-line prompt with double quotes round-trips cleanly. The
- # actual file content check (must contain "hello world" + "print")
- # is unchanged.
- r1 = await _run_one_mission(
- "hello",
- 'Create a file named hello.py with this exact content (no extra text): print("hello world"). Then exit. Do not write any other file.',
- _check_hello_py,
- )
- print(json.dumps(r1, indent=2))
-
- r2 = await _run_one_mission(
- "result",
- "Create a file named result.txt in the current directory with two lines: line one says 'A', line two says 'B'. Then exit.",
- _check_result_txt,
- )
- print(json.dumps(r2, indent=2))
-
- print("\nSUMMARY")
- print("-" * 60)
- all_ok = True
- for r in (r1, r2):
- verdict = "PASS" if (
- r.get("stderr_clean")
- and r.get("stream_has_init_and_result")
- and r.get("artefact_ok")
- and r.get("duration_s", 9999) < 180
- ) else "FAIL"
- if verdict == "FAIL":
- all_ok = False
- print(f" [{r['label']:7s}] {verdict} "
- f"duration={r.get('duration_s','?')}s "
- f"stderr_clean={r.get('stderr_clean')} "
- f"artefact={r.get('artefact_ok')} ({r.get('artefact_detail','')})")
-
- return 0 if all_ok else 1
-
-
-if __name__ == "__main__":
- sys.exit(asyncio.run(main()))
diff --git a/scripts/_e2e_subjarvis_verify.py b/scripts/_e2e_subjarvis_verify.py
deleted file mode 100644
index 35480463ec..0000000000
--- a/scripts/_e2e_subjarvis_verify.py
+++ /dev/null
@@ -1,200 +0,0 @@
-"""Headless E2E verification of the xai/sonnet fix.
-
-Spawns the SubJarvisWorker directly (no Mission-Manager / Kontrollierer
-layer in between) with a tiny prompt, then inspects:
-
- - the worker yielded ClaudeSystemInit + ClaudeResult
- - the model arg in the spawned argv is NOT "xai/sonnet" (the bug)
- - the spawned argv carries "xai/grok-4.3" (the config chain)
- - the workspace contains the file the prompt asked for
- - stderr.log contains no FailoverError
-
-Two missions are run with different goals to match the goal spec.
-"""
-from __future__ import annotations
-
-import asyncio
-import json
-import os
-import shutil
-import sys
-import time
-import uuid
-from pathlib import Path
-from typing import Any
-
-# Project on sys.path
-PROJECT = Path(__file__).parent.parent
-sys.path.insert(0, str(PROJECT))
-
-from jarvis.missions.isolation.job_object import AlwaysOpenJobObject
-from jarvis.missions.workers.subjarvis_worker import SubJarvisWorker
-
-
-def _build_env() -> dict[str, str]:
- """Minimal env: XAI_API_KEY for grok + system tools."""
- from jarvis.core.config import get_secret
-
- grok = get_secret("grok_api_key", env_fallback="GROK_API_KEY")
- env = {
- # tools the openclaw CLI needs to spawn (path lookups, etc.)
- "PATH": os.environ.get("PATH", ""),
- "SYSTEMROOT": os.environ.get("SYSTEMROOT", "C:\\Windows"),
- "USERPROFILE": os.environ.get("USERPROFILE", ""),
- "APPDATA": os.environ.get("APPDATA", ""),
- "LOCALAPPDATA": os.environ.get("LOCALAPPDATA", ""),
- "TEMP": os.environ.get("TEMP", ""),
- "TMP": os.environ.get("TMP", ""),
- "HOMEDRIVE": os.environ.get("HOMEDRIVE", "C:"),
- "HOMEPATH": os.environ.get("HOMEPATH", "\\Users\\Administrator"),
- }
- if grok:
- env["XAI_API_KEY"] = grok
- env["GROK_API_KEY"] = grok
- return env
-
-
-async def _run_one_mission(
- label: str,
- prompt: str,
- artefact_check,
-) -> dict[str, Any]:
- mission_dir = PROJECT.parent / "sub-agents-outputs" / f"e2e_verify_{label}_{uuid.uuid4().hex[:8]}"
- workspace = mission_dir / "workspace"
- logs = mission_dir / "logs"
- workspace.mkdir(parents=True, exist_ok=True)
- logs.mkdir(parents=True, exist_ok=True)
-
- env = _build_env()
- env["OPENCLAW_STATE_DIR"] = str(mission_dir / "openclaw_state")
-
- worker = SubJarvisWorker()
- started = time.time()
- events = []
-
- # NOTE: We pass model="sonnet" on purpose — that's the exact
- # Decomposer-default value that produced the bug. The fix must filter
- # it out and use [brain.sub_jarvis] from jarvis.toml (= grok-4.3) instead.
- try:
- async for ev in worker.spawn(
- prompt,
- worktree=workspace,
- env=env,
- job=AlwaysOpenJobObject(),
- worker_id=f"e2e-{label}",
- log_dir=logs,
- model="sonnet", # the trapdoor — must be filtered
- timeout_s=300.0,
- ):
- events.append(type(ev).__name__)
- except Exception as exc: # noqa: BLE001
- return {
- "label": label,
- "ok": False,
- "reason": f"worker spawn raised: {exc!r}",
- "duration_s": time.time() - started,
- "events": events,
- "mission_dir": str(mission_dir),
- }
-
- duration_s = time.time() - started
-
- # Inspect logs
- stderr_path = logs / "stderr.log"
- stream_path = logs / "stream.jsonl"
- stderr_txt = stderr_path.read_text(encoding="utf-8", errors="replace") if stderr_path.exists() else ""
- stream_txt = stream_path.read_text(encoding="utf-8", errors="replace") if stream_path.exists() else ""
-
- bad_failover = "FailoverError" in stderr_txt or "xai/sonnet" in stderr_txt
- artefact_ok, artefact_detail = artefact_check(workspace)
-
- return {
- "label": label,
- "events": events,
- "duration_s": round(duration_s, 1),
- "stderr_clean": not bad_failover,
- "stderr_snippet": stderr_txt[:500] if stderr_txt else "",
- "stream_has_init_and_result": (
- "ClaudeSystemInit" in events and "ClaudeResult" in events
- ),
- "artefact_ok": artefact_ok,
- "artefact_detail": artefact_detail,
- "mission_dir": str(mission_dir),
- }
-
-
-def _check_hello_py(workspace: Path) -> tuple[bool, str]:
- """Mission 1: hello.py must exist and print 'hello world'."""
- f = workspace / "hello.py"
- if not f.exists():
- return False, f"missing {f}"
- content = f.read_text(encoding="utf-8")
- if "hello world" not in content.lower():
- return False, f"content does not contain 'hello world': {content[:200]!r}"
- if "print" not in content:
- return False, f"no print() call: {content[:200]!r}"
- return True, f"hello.py {f.stat().st_size} bytes, contains print + hello world"
-
-
-def _check_result_txt(workspace: Path) -> tuple[bool, str]:
- """Mission 2: result.txt with at least 1 non-empty line."""
- f = workspace / "result.txt"
- if not f.exists():
- return False, f"missing {f}"
- lines = [ln for ln in f.read_text(encoding="utf-8").splitlines() if ln.strip()]
- if not lines:
- return False, "result.txt empty"
- return True, f"result.txt {len(lines)} non-empty lines"
-
-
-async def main() -> int:
- print("=" * 60)
- print("E2E verification of xai/sonnet fix (Phase 3)")
- print("=" * 60)
-
- # NOTE: Goal text used `print('hello world')` with literal newlines in
- # the prompt. On Windows the openclaw.cmd shim re-tokenises argv via
- # cmd.exe, which (a) treats apostrophes as metachars and (b) chops the
- # --message argument on embedded newlines. Either trap silently
- # collapses --model so the CLI falls back to its first listed
- # provider (openai/gpt-5.5) and aborts with auth-failed — exact same
- # pattern as the GeminiWorker cmd-wrapper trap fixed 2026-05-13.
- # Single-line prompt with double quotes round-trips cleanly. The
- # actual file content check (must contain "hello world" + "print")
- # is unchanged.
- r1 = await _run_one_mission(
- "hello",
- 'Create a file named hello.py with this exact content (no extra text): print("hello world"). Then exit. Do not write any other file.',
- _check_hello_py,
- )
- print(json.dumps(r1, indent=2))
-
- r2 = await _run_one_mission(
- "result",
- "Create a file named result.txt in the current directory with two lines: line one says 'A', line two says 'B'. Then exit.",
- _check_result_txt,
- )
- print(json.dumps(r2, indent=2))
-
- print("\nSUMMARY")
- print("-" * 60)
- all_ok = True
- for r in (r1, r2):
- verdict = "PASS" if (
- r.get("stderr_clean")
- and r.get("stream_has_init_and_result")
- and r.get("artefact_ok")
- and r.get("duration_s", 9999) < 180
- ) else "FAIL"
- if verdict == "FAIL":
- all_ok = False
- print(f" [{r['label']:7s}] {verdict} "
- f"duration={r.get('duration_s','?')}s "
- f"stderr_clean={r.get('stderr_clean')} "
- f"artefact={r.get('artefact_ok')} ({r.get('artefact_detail','')})")
-
- return 0 if all_ok else 1
-
-
-if __name__ == "__main__":
- sys.exit(asyncio.run(main()))
diff --git a/scripts/_final_validate_1_dispatch.py b/scripts/_final_validate_1_dispatch.py
deleted file mode 100644
index 23eabc4fc3..0000000000
--- a/scripts/_final_validate_1_dispatch.py
+++ /dev/null
@@ -1,251 +0,0 @@
-"""Final-Validation Probe 1/5 — Dispatch Path.
-
-Read-only verification of the Jarvis-Agent worker dispatch pipeline.
-Does NOT mutate production code. Prints PASS/FAIL per assertion.
-
-Stages validated:
- 1. Whisper-FP filter — 21+ sentinel strings drop to False
- 2. Force-spawn heuristic — 6 action verbs (strict-mode-aware) and
- 4 smalltalk prompts behave correctly
- 3. Worker factory routing — claude-api -> ClaudeDirectWorker;
- other providers -> SubJarvisWorker
-"""
-from __future__ import annotations
-
-import logging
-import sys
-import types
-from pathlib import Path
-from unittest.mock import MagicMock
-
-# Silence noisy module-import warnings — they don't affect probe logic.
-logging.basicConfig(level=logging.CRITICAL)
-
-ROOT = Path(__file__).resolve().parent.parent
-sys.path.insert(0, str(ROOT))
-
-# ---- Stage 1+2: Whisper-FP filter + force-spawn heuristic ----
-
-import jarvis.brain.manager as _mgr_mod # noqa: E402
-# manager.py:999 references a bare ``logger`` symbol inside an info()
-# call on the seed-filter branch. The module otherwise binds ``log``.
-# Inject the alias so the probe doesn't NameError when a seed is hit
-# (production code reaches the same line through normal logging setup).
-if not hasattr(_mgr_mod, "logger"):
- _mgr_mod.logger = _mgr_mod.log
-from jarvis.brain.manager import ( # noqa: E402
- BrainManager,
- _WHISPER_FALSE_POSITIVE_SEEDS,
-)
-from jarvis.core.config import JarvisConfig # noqa: E402
-
-
-def make_manager_with_spawn_tool(primary: str = "claude-api") -> BrainManager:
- """Build a BrainManager stub with `spawn_openclaw` in _tools."""
- cfg = JarvisConfig()
- # Force primary into the cascade-allowed set (manager.py:1025).
- cfg.brain.primary = primary
- mgr = BrainManager.__new__(BrainManager)
- mgr._config = cfg
- mgr._tools = {"spawn_openclaw": MagicMock(name="spawn_openclaw_tool")}
- mgr._tool_executor = MagicMock(name="tool_executor")
- mgr._routing_patterns = None
- mgr._force_spawn_pattern = None
- return mgr
-
-
-def probe_stage_1_whisper_seeds() -> tuple[int, int, list[tuple[str, bool]]]:
- mgr = make_manager_with_spawn_tool()
- results: list[tuple[str, bool]] = []
- for seed in sorted(_WHISPER_FALSE_POSITIVE_SEEDS):
- out = mgr._should_force_openclaw(seed)
- results.append((seed, out is False))
- passed = sum(1 for _, ok in results if ok)
- return passed, len(results), results
-
-
-def probe_stage_2_action_verbs() -> list[tuple[str, bool, bool]]:
- """Returns rows of (prompt, observed_result, would-spawn-expected).
-
- Strict-mode is the default — only "spawn" is an explicit trigger.
- Other action-verb prompts ("Lies", "Erstelle", ...) return False in
- strict mode and would require permissive mode to spawn.
- """
- mgr = make_manager_with_spawn_tool()
- prompts = [
- "Lies docs/BUGS.md zusammen",
- "Erstelle Datei test.md mit Hello",
- "Analysiere die letzte Mission",
- "Schreib mir eine Zusammenfassung",
- "Mach einen Screenshot vom Code", # i18n-allow: simulated German user utterance under test (force-spawn router probe)
- "Spawn einen Jarvis-Agenten",
- ]
- rows: list[tuple[str, bool, bool]] = []
- for p in prompts:
- out = mgr._should_force_openclaw(p)
- rows.append((p, out, out is True))
- return rows
-
-
-def probe_stage_2_smalltalk() -> list[tuple[str, bool]]:
- mgr = make_manager_with_spawn_tool()
- prompts = ["Hallo", "Wie geht's", "Danke", "Was ist Hauptstadt von Frankreich"] # i18n-allow: simulated German user utterances under test (smalltalk/knowledge router probe)
- rows: list[tuple[str, bool]] = []
- for p in prompts:
- out = mgr._should_force_openclaw(p)
- rows.append((p, out is False))
- return rows
-
-
-def probe_stage_2_permissive_mode() -> list[tuple[str, bool]]:
- """Sanity check: in permissive mode action verbs DO match."""
- mgr = make_manager_with_spawn_tool()
- mgr._config.brain.routing.force_spawn_mode = "permissive"
- prompts = [
- "Lies docs/BUGS.md zusammen",
- "Erstelle Datei test.md mit Hello",
- "Analysiere die letzte Mission",
- "Schreib mir eine Zusammenfassung",
- "Mach einen Screenshot vom Code", # i18n-allow: simulated German user utterance under test (permissive-mode router probe)
- ]
- rows: list[tuple[str, bool]] = []
- for p in prompts:
- out = mgr._should_force_openclaw(p)
- rows.append((p, out is True))
- return rows
-
-
-# ---- Stage 3: worker_factory routing ----
-
-def probe_stage_3_worker_factory() -> dict[str, str]:
- """Reproduce the _worker_factory closure logic by importing the two
- worker classes and exercising the same branch."""
- from jarvis.missions.workers.claude_direct_worker import ClaudeDirectWorker
- from jarvis.missions.workers.subjarvis_worker import SubJarvisWorker
- from jarvis.missions.workers.gemini_worker import GeminiWorker
-
- results: dict[str, str] = {}
-
- def _factory(sub_jarvis_provider: str | None, step_model: str = ""):
- # Mirror the logic in jarvis/missions/init.py:236-266
- if sub_jarvis_provider == "claude-api":
- return ClaudeDirectWorker()
- if sub_jarvis_provider:
- return SubJarvisWorker()
- sm = (step_model or "").lower()
- if sm.startswith("gemini"):
- return GeminiWorker()
- return SubJarvisWorker()
-
- for provider in ("claude-api", "gemini", "grok", "openai", "openrouter", None):
- w = _factory(provider)
- results[str(provider)] = type(w).__name__
- return results
-
-
-# ---- Drift check ----
-
-def probe_drift() -> tuple[str | None, str | None]:
- import json
- import tomllib
-
- toml_provider: str | None = None
- try:
- with open(ROOT / "jarvis.toml", "rb") as f:
- doc = tomllib.load(f)
- toml_provider = (
- doc.get("brain", {}).get("sub_jarvis", {}).get("provider")
- )
- except Exception as exc: # noqa: BLE001
- toml_provider = f"<error: {exc}>"
-
- soll_provider: str | None = None # i18n-allow: identifier name, mirrors the config-soll.json filename; not translatable prose
- try:
- with open(ROOT / "scripts" / "config-soll.json", encoding="utf-8") as f: # i18n-allow: filename identifier, not translatable prose
- doc = json.load(f)
- soll_provider = doc.get("brain.sub_jarvis", {}).get("provider") # i18n-allow: identifier name, not translatable prose
- except Exception as exc: # noqa: BLE001
- soll_provider = f"<error: {exc}>" # i18n-allow: identifier name, not translatable prose
-
- return toml_provider, soll_provider # i18n-allow: identifier name, not translatable prose
-
-
-# ---- main ----
-
-def main() -> int:
- fails: list[str] = []
-
- print("=== Stage 1: Whisper-FP seeds ===")
- p1, n1, r1 = probe_stage_1_whisper_seeds()
- print(f" {p1}/{n1} seeds correctly filtered (force_spawn -> False)")
- for seed, ok in r1:
- if not ok:
- fails.append(f"seed {seed!r} did NOT filter to False")
- print(f" FAIL {seed!r}")
- if p1 == n1:
- print(" PASS (all seeds drop)")
-
- print("\n=== Stage 2a: action-verb prompts (strict mode default) ===")
- rows = probe_stage_2_action_verbs()
- for prompt, observed, want_spawn in rows:
- # Expectation: only "Spawn einen Jarvis-Agenten" returns True in strict.
- is_spawn_phrase = "spawn" in prompt.lower() or "jarvis-agent" in prompt.lower()
- expected = is_spawn_phrase
- ok = observed is expected
- print(f" {'PASS' if ok else 'FAIL'} {prompt!r} -> {observed} (expected={expected})")
- if not ok:
- fails.append(f"action-verb {prompt!r} expected {expected}, got {observed}")
-
- print("\n=== Stage 2b: smalltalk allowlist ===")
- sr = probe_stage_2_smalltalk()
- for prompt, ok in sr:
- print(f" {'PASS' if ok else 'FAIL'} {prompt!r} -> spawn=False")
- if not ok:
- fails.append(f"smalltalk {prompt!r} did not return False")
-
- print("\n=== Stage 2c: permissive-mode sanity (action verbs DO spawn) ===")
- pr = probe_stage_2_permissive_mode()
- for prompt, ok in pr:
- print(f" {'PASS' if ok else 'FAIL'} {prompt!r} -> spawn=True (permissive)")
- if not ok:
- fails.append(f"permissive {prompt!r} did not return True")
-
- print("\n=== Stage 3: worker_factory routing ===")
- wr = probe_stage_3_worker_factory()
- expectations = {
- "claude-api": "ClaudeDirectWorker",
- "gemini": "SubJarvisWorker",
- "grok": "SubJarvisWorker",
- "openai": "SubJarvisWorker",
- "openrouter": "SubJarvisWorker",
- "None": "SubJarvisWorker",
- }
- for prov, got in wr.items():
- want = expectations.get(prov, "?")
- ok = got == want
- print(f" {'PASS' if ok else 'FAIL'} provider={prov} -> {got} (want={want})")
- if not ok:
- fails.append(f"worker_factory({prov}) -> {got}, want {want}")
-
- print("\n=== Drift: jarvis.toml vs scripts/config-soll.json ===") # i18n-allow: filename identifier, not translatable prose
- toml_p, soll_p = probe_drift() # i18n-allow: identifier name, not translatable prose
- print(f" jarvis.toml [brain.sub_jarvis].provider = {toml_p!r}")
- print(f" config-soll.json brain.sub_jarvis.provider = {soll_p!r}") # i18n-allow: filename identifier, not translatable prose
- if toml_p == soll_p == "claude-api": # i18n-allow: identifier name, not translatable prose
- print(" PASS (both = claude-api)")
- else:
- fails.append(f"drift: toml={toml_p}, soll={soll_p}") # i18n-allow: identifier name, not translatable prose
- print(" FAIL drift detected")
-
- print("\n=== SUMMARY ===")
- if not fails:
- print("ALL PROBES PASS")
- return 0
- print(f"{len(fails)} failures:")
- for f in fails:
- print(f" - {f}")
- return 1
-
-
-if __name__ == "__main__":
- sys.exit(main())
diff --git a/scripts/_final_validate_3_critic.py b/scripts/_final_validate_3_critic.py
deleted file mode 100644
index a9585e3135..0000000000
--- a/scripts/_final_validate_3_critic.py
+++ /dev/null
@@ -1,59 +0,0 @@
-"""Final-Validation Agent 3: live probe of the EPERM-defuse seed.
-
-Calls ``build_worker_env(run_dir=<tmp>)`` and asserts:
-- ``<run_dir>/openclaw_state/plugin-skills/browser-automation/`` exists
-- a ``SKILL.md`` marker file lives inside and has non-zero size
-- a second call leaves the marker mtime untouched (idempotent)
-
-Run:
- python scripts/_final_validate_3_critic.py
-"""
-from __future__ import annotations
-
-import sys
-import tempfile
-from pathlib import Path
-
-# Make project import path work when invoked from anywhere.
-ROOT = Path(__file__).resolve().parent.parent
-sys.path.insert(0, str(ROOT))
-
-from jarvis.missions.isolation.env import build_worker_env # noqa: E402
-
-
-def main() -> int:
- with tempfile.TemporaryDirectory(prefix="final-validate-3-") as td:
- run_dir = Path(td) / "missions" / "probe"
- env = build_worker_env(run_dir=run_dir)
- state_dir = Path(env["OPENCLAW_STATE_DIR"])
- target = state_dir / "plugin-skills" / "browser-automation"
- marker = target / "SKILL.md"
-
- print(f"[probe] OPENCLAW_STATE_DIR = {state_dir}")
- print(f"[probe] browser-automation dir exists = {target.is_dir()}")
- print(f"[probe] SKILL.md exists = {marker.is_file()}")
- if marker.is_file():
- print(f"[probe] SKILL.md size = {marker.stat().st_size} bytes")
- first_mtime = marker.stat().st_mtime_ns
- else:
- print("[probe] FAIL: SKILL.md missing")
- return 2
-
- # Second call must not blow up nor re-write the marker.
- build_worker_env(run_dir=run_dir)
- second_mtime = marker.stat().st_mtime_ns
-
- print(f"[probe] idempotent (mtime equal) = {first_mtime == second_mtime}")
-
- ok = (
- target.is_dir()
- and marker.is_file()
- and marker.stat().st_size > 0
- and first_mtime == second_mtime
- )
- print(f"[probe] VERDICT = {'PASS' if ok else 'FAIL'}")
- return 0 if ok else 1
-
-
-if __name__ == "__main__":
- raise SystemExit(main())
diff --git a/scripts/spike_openclaw_grok.py b/scripts/spike_openclaw_grok.py
deleted file mode 100644
index 80c12bbd41..0000000000
--- a/scripts/spike_openclaw_grok.py
+++ /dev/null
@@ -1,107 +0,0 @@
-"""Throwaway spike — does `openclaw agent --model xai/grok-<m>` write a file?
-
-De-risks Wave B2 of the sub-agent reliability rebuild: re-enabling the OpenClaw
-worker so a *selected* non-claude/non-codex provider (grok/openai/openrouter)
-actually runs as a file-writing agent instead of silently falling back to Claude.
-
-Reuses the surviving machinery (provider_chain + provider_map). Exit 0 if the
-file was written; non-zero (or SKIP) otherwise. Prints the verdict.
-"""
-from __future__ import annotations
-
-import asyncio
-import os
-import sys
-import tempfile
-import uuid
-from pathlib import Path
-
-if sys.stdout.encoding != "utf-8":
- sys.stdout.reconfigure(encoding="utf-8") # type: ignore[attr-defined]
-sys.path.insert(0, str(Path(__file__).resolve().parent.parent))
-
-from jarvis.core.config import get_secret, load_config # noqa: E402
-from jarvis.missions.isolation.env import build_worker_env # noqa: E402
-from jarvis.missions.workers.process_utils import ( # noqa: E402
- worker_creationflags as _win32_creationflags,
-)
-from jarvis.missions.workers.provider_chain import ( # noqa: E402
- _build_openclaw_cmd,
- _resolve_worker_argv_prefix,
-)
-from jarvis.missions.worker_runtime.provider_map import ( # noqa: E402
- to_provider_slug,
-)
-
-PROMPT = (
- "Create a new text file named spike_ok.txt in the current working directory "
- "whose entire contents are exactly the single line: GROK-OK\n"
- "Do nothing else."
-)
-
-
-async def main() -> int:
- key = get_secret("grok_api_key", env_fallback="GROK_API_KEY") or get_secret(
- "xai_api_key", env_fallback="XAI_API_KEY"
- )
- if not key:
- print("[SKIP] no grok/xai key configured")
- return 0
-
- cfg = load_config()
- providers = getattr(cfg.brain, "providers", {}) or {}
- pcfg = providers.get("grok")
- model = (getattr(pcfg, "deep_model", None) or getattr(pcfg, "model", None)
- or "grok-4.3")
- slug = to_provider_slug("grok") # -> "xai"
-
- with tempfile.TemporaryDirectory(prefix="oc-spike-") as tmp:
- mission_dir = Path(tmp)
- worktree = mission_dir / "wt"
- worktree.mkdir()
-
- # The REAL worker env: seeds the plugin-skills location (avoids the
- # EPERM symlink crash on non-admin Windows), sets MISSION_STATE_DIR,
- # injects XAI_API_KEY/GROK_API_KEY. This is what the live workers use.
- env = build_worker_env(run_dir=mission_dir, xai_api_key=key)
-
- cmd = _build_openclaw_cmd(
- PROMPT,
- binary=_resolve_worker_argv_prefix(),
- session_id=str(uuid.uuid4()),
- openclaw_slug=slug,
- model=str(model),
- timeout_s=120,
- )
- print(f"[..] spawning: openclaw agent --model {slug}/{model} (cwd={worktree})")
- flags = _win32_creationflags() if sys.platform == "win32" else 0
- try:
- proc = await asyncio.create_subprocess_exec(
- *cmd, cwd=str(worktree), env=env,
- stdout=asyncio.subprocess.PIPE, stderr=asyncio.subprocess.PIPE,
- creationflags=flags,
- )
- out, err = await asyncio.wait_for(proc.communicate(), timeout=180.0)
- except FileNotFoundError as exc:
- print(f"[SKIP] openclaw binary not found: {exc}")
- return 0
- except asyncio.TimeoutError:
- print("[FAIL] openclaw spike timed out (180s)")
- return 1
-
- wrote = (worktree / "spike_ok.txt").exists()
- content = ""
- if wrote:
- content = (worktree / "spike_ok.txt").read_text(encoding="utf-8", errors="replace").strip()
- print(f"[..] exit={proc.returncode} file_written={wrote} content={content!r}")
- print(f"[..] stdout[:400]={out.decode('utf-8','replace')[:400]!r}")
- print(f"[..] stderr[:400]={err.decode('utf-8','replace')[:400]!r}")
- if wrote:
- print("[OK] OpenClaw grok spike WROTE a file — B2 path is viable.")
- return 0
- print("[FAIL] OpenClaw grok spike did NOT write a file.")
- return 1
-
-
-if __name__ == "__main__":
- sys.exit(asyncio.run(main()))