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
chore: auto-save WIP via Claude stop-hook safety net (2026-07-02 09:21)
Ruben Lütke803862536510
diff --git a/jarvis/cu/engine.py b/jarvis/cu/engine.pyindex 20d2d394b2..16dd5f0d31 100644--- a/jarvis/cu/engine.py+++ b/jarvis/cu/engine.py@@ -370,7 +370,9 @@ async def run_cu_loop(output_language = (getattr(task, "env", None) or {}).get(_OUTPUT_LANGUAGE_ENV_KEY,) or None- trace_id = None # per-dispatch trace ids come from the ToolExecutor path+ from uuid import uuid4 # noqa: PLC0415++ trace_id = uuid4() # correlates every tool dispatch of this missionbus = getattr(ctx, "bus", None)profiler = _Profiler(bus)ledger = ActionLedger()diff --git a/marketing/launch/good-first-issues.md b/marketing/launch/good-first-issues.mdnew file mode 100644index 0000000000..3b253fb42c--- /dev/null+++ b/marketing/launch/good-first-issues.md@@ -0,0 +1,63 @@+# "good first issue" candidates++Ten candidates for the launch. Each is small, self-contained, does not require+understanding the whole architecture, and has an existing pattern to copy.+Before creating them on GitHub, give each a quick sanity check against current+`main` (file paths are indicative). Label: `good first issue`, plus the+suggested area label.++---++1. **Add a new STT provider behind the contract suite** (`area:speech`)+ The STT interface is a small streaming plugin (see+ `jarvis/plugins/stt/groq_api.py` as the reference). Pick a provider with a+ free tier (e.g., Deepgram), implement the plugin + entry-point, and make+ `pytest tests/contract/` pass. Great intro to the plugin system.++2. **Add a French locale** (`area:i18n`)+ The UI ships `en`/`de`/`es` locale JSONs under+ `jarvis/ui/web/frontend/src/i18n/locales/`. Add `fr.json` (translate from+ `en.json`), register it, and extend the runtime phrase tables so canned+ voice phrases resolve for `fr` too. The existing language parity tests show+ exactly what completeness means.++3. **Write a VPS deployment guide** (`area:docs`)+ A step-by-step `docs/` guide for a headless deploy on a generic Ubuntu VPS:+ install, `.env` key setup, `jarvis serve`, a systemd unit, and connecting+ the browser voice bridge. Everything needed already works — it just isn't+ written down as one walkthrough.++4. **Example tool plugin: weather via Open-Meteo** (`area:plugins`)+ A small reference `jarvis.tool` plugin calling the keyless Open-Meteo API,+ with a fake-based unit test. Doubles as living documentation for "how do I+ write a tool" — the most common contributor question.++5. **`jarvis --check` machine-readable output** (`area:cli`)+ The preflight check prints human text today. Add a `--json` flag emitting a+ stable schema (component, status, hint) so scripts and installers can gate+ on it. Small, well-bounded CLI change.++6. **Honor `prefers-reduced-motion` in the web UI** (`area:frontend`, `area:a11y`)+ The desktop/browser UI animates generously (orb, transitions, pulsing+ dots). Respect the OS-level reduced-motion setting via the standard media+ query and tone animations down to fades.++7. **Keyboard-shortcuts help overlay** (`area:frontend`)+ A `?`-triggered overlay listing the app's shortcuts. The frontend is+ React + Tailwind; the shortcut list already exists in code and just needs a+ presentation surface.++8. **Board stats CSV export** (`area:frontend`)+ The Board view aggregates activity stats. Add an "Export CSV" button that+ serializes the current aggregates client-side — no backend change needed.++9. **Wake-word sample recorder polish** (`area:speech`)+ The custom wake-word flow benefits from ~15 clean user recordings. Improve+ the recording helper UX: live level meter, clipping warning, and a summary+ of captured samples. Pure quality-of-life, no ML knowledge required.++10. **Installer smoke test in CI** (`area:install`)+ A GitHub Actions job that runs `install/install.sh --headless --no-launch+ --no-wizard` on a clean Ubuntu runner and asserts the venv boots and+ `jarvis --check` passes. Catches "works on the maintainer's machine"+ installer regressions — the project's most-feared bug class.diff --git a/marketing/launch/hero-one-liners.md b/marketing/launch/hero-one-liners.mdnew file mode 100644index 0000000000..28af17aad1--- /dev/null+++ b/marketing/launch/hero-one-liners.md@@ -0,0 +1,46 @@+# README hero one-liner — proposals++The current hero line ("A voice-driven meta-orchestrator that turns one spoken+request into a fleet of self-checking AI agents.") describes the architecture,+not the benefit — insider vocabulary ("meta-orchestrator", "fleet",+"self-checking") that means nothing to someone who just landed on the repo.+These three candidates lead with the promise instead. English is the README+language; a German translation is included for each so the same line can be+reused in German-language posts.++---++## Variant 1 — the plain promise (Recommended)++> **Talk to your computer — and watch it do the work: an open-source,+> privacy-first voice agent with full command of your PC.**++*German:* „Sprich mit deinem Computer — und sieh zu, wie er die Arbeit macht:+ein quelloffener, privacy-first Sprachagent mit vollem Zugriff auf deinen PC."++**Why recommended:** it tells a complete stranger in one breath what happens+(you talk, the machine acts), what it is (open source, privacy-first), and the+scale of it (full command of your PC) — no term requires prior knowledge, and+it mirrors exactly what the demo video shows. Variant 3 is punchier but leans+on the film's slogan, which is cryptic without the video context.++## Variant 2 — the butler frame++> **Your computer, on voice command: an open-source AI butler that answers,+> acts, and ships real work — private by design.**++*German:* „Dein Computer aufs Wort: ein quelloffener KI-Butler, der antwortet,+handelt und echte Arbeit abliefert — privat by design."++## Variant 3 — the slogan++> **You talk. It ships. The privacy-first voice butler for your PC — open+> source, provider-agnostic, built in Germany.**++*German:* „Du sprichst. Es liefert. Der Privacy-first-Sprachbutler für deinen+PC — Open Source, anbieterunabhängig, gebaut in Deutschland."++---++**Status:** Variant 1 is already applied to `README.md`. Swapping to another+variant is a one-line edit of the `<b>…</b>` hero line.diff --git a/marketing/launch/reddit-r-localllama.md b/marketing/launch/reddit-r-localllama.mdnew file mode 100644index 0000000000..32b5ff2803--- /dev/null+++ b/marketing/launch/reddit-r-localllama.md@@ -0,0 +1,57 @@+# r/LocalLLaMA draft++> **Status: DRAFT — do not post without maintainer review.**+> r/LocalLLaMA cares about local inference above all — this draft is upfront+> that the brain is API-based, because pretending otherwise would get torn+> apart in the first comment. Flair: "Resources".++---++**Title:**++Personal Jarvis – open-source voice agent with local wake word + local Whisper STT (MIT). The brain is API-based — honest breakdown inside++**Body:**++I built an open-source voice assistant that actually operates your computer —+you speak, it delegates the work to coding agents / MCP tools / a computer-use+loop, a critic reviews the result, and it talks back. Before you ask the one+question this sub always (rightly) asks, here is the honest local/cloud split:++**Runs locally:**++- Wake word: openWakeWord (ONNX, CPU) — including custom trained wake phrases,+ so you're not stuck with someone else's brand name in your living room.+- STT: faster-whisper as an opt-in extra (`--with-voice-local`, ~1.5 GB) —+ no audio has to leave your machine. Important lesson from months of debugging:+ keep the always-on wake model on CPU with pinned threads; shared GPU+ inference engines (ctranslate2) can wedge unrecoverably when two callers hit+ them concurrently. The bug register in the repo documents this in detail.+- Everything stateful: conversations, the Obsidian-compatible knowledge wiki,+ contacts, config — plain local files. No telemetry.++**Cloud (by deliberate choice):**++- The brain tier. It's a plugin interface (Gemini / Claude / OpenAI /+ OpenRouter / CLI-subscription logins), and there used to be an Ollama+ provider — it was removed, because a voice loop needs a sub-second ack model+ plus a router plus workers plus a critic running concurrently, and the+ latency/quality budget didn't work out on consumer hardware at the time.+- TTS is cloud today.++If you want to prove the local-brain case wrong, the plugin contract is small+(`AsyncIterator` streaming interface + a contract test suite) and a solid PR+would absolutely be considered — the interface never assumes a specific+provider by design.++Architecture in one line: lean router-brain → dispatches to agent harnesses+(Claude Code / Codex CLI / MCP / computer-use) → each mission isolated in its+own git worktree → critic loop (max 3 rounds) → signed controller decides what+gets spoken. Base install is torch-free and runs headless on a €5 VPS with the+browser as mic/speaker.++Repo: https://github.com/PersonalJarvis/PersonalJarvis (MIT)++Happy to go deep on the wake-word war stories — custom KWS training, AGC+amplifying breathing noise into false wakes, and why "just transcribe+everything" is a trap for custom wake phrases.diff --git a/marketing/launch/reddit-r-selfhosted.md b/marketing/launch/reddit-r-selfhosted.mdnew file mode 100644index 0000000000..14f290f59b--- /dev/null+++ b/marketing/launch/reddit-r-selfhosted.md@@ -0,0 +1,55 @@+# r/selfhosted draft++> **Status: DRAFT — do not post without maintainer review.**+> r/selfhosted cares about: runs on my box, no phone-home, easy deploy,+> resource footprint, and "what's the catch". Answer those directly.++---++**Title:**++Personal Jarvis – a self-hosted voice assistant that runs your machine: headless on a small VPS, browser as mic/speaker, MIT++**Body:**++I've open-sourced the assistant I run at home: a voice agent that doesn't just+answer questions but actually does work — dispatches coding agents, drives the+browser/desktop, writes into a local knowledge wiki, and reports back by voice.++The parts this sub usually asks about first:++**Self-hosting story**++- `jarvis serve` runs fully headless: FastAPI + WebSocket + a browser UI. Your+ browser provides microphone and speakers, so a screenless VPS can still hold+ a voice conversation. Tested against a bare `python:3.11-slim` — no GPU, no+ audio stack, no OS keyring required (falls back to ENV/.env or a local file).+- Base install is deliberately torch-free and platform-universal; local+ STT/wake models are an opt-in extra (~1.5 GB) if you want audio to never+ leave the box.+- One-line installer (venv-based — no Docker required; read it before running,+ it's short), or pipx, or a manual clone. Windows/macOS/Linux desktop mode+ exists too if you want the tray + overlay experience.++**Privacy / phone-home**++- No telemetry, no analytics, no account. Outbound traffic goes only to the+ providers you configure (LLM APIs, and STT only if you choose cloud STT).+- Keys live in the OS credential manager (or ENV/.env on servers), never in+ config files or the repo.+- The instruction boundary is structural: content the agent *reads* (web+ pages, mails, documents) is data, never commands — that's the prompt-+ injection defense, documented in SECURITY.md.++**The catch (being honest)**++- The LLM "brain" is bring-your-own-key cloud API (or a flat-rate CLI+ subscription like Claude Max / ChatGPT login for the heavy agents) — there+ is no local-LLM brain today. Wake word + STT can be fully local.+- TTS is cloud. And computer-use is the least mature path.+- It's a young project; expect rough edges and a fast-moving main branch.++Resource footprint on my smallest box: a €5/month VPS runs the headless+server comfortably — the heavy lifting happens at the API providers.++Repo: https://github.com/PersonalJarvis/PersonalJarvis (MIT)diff --git a/marketing/launch/show-hn.md b/marketing/launch/show-hn.mdnew file mode 100644index 0000000000..922d168e75--- /dev/null+++ b/marketing/launch/show-hn.md@@ -0,0 +1,73 @@+# Show HN draft++> **Status: DRAFT — do not post without maintainer review.**+> Post from the maintainer's HN account. Best window: Tue–Thu, ~14:00–16:00 UTC.+> HN culture notes: no marketing language, answer every technical question in+> the first two hours, be upfront about limitations.++---++**Title:**++Show HN: Personal Jarvis – open-source voice agent that runs your computer++**URL:** https://github.com/PersonalJarvis/PersonalJarvis++**Text:**++Hi HN — I've spent the last months building the assistant I always wanted:+you say something, and your computer actually does it.++The core is a small, fast "router brain" whose only job is to listen and+delegate. Small talk gets answered directly; real work gets dispatched to+agent harnesses (Claude Code, Codex CLI, MCP servers, or a raw computer-use+loop) that run as background missions. Each mission runs in an isolated git+worktree, a critic model reviews the result (up to three correction rounds),+and a controller decides what is spoken back to you. A sub-second ack model+keeps the conversation flowing while the heavy work happens behind the scenes.++Some design decisions that might interest this crowd:++- Provider-agnostic by architecture, not as an afterthought. The brain is a+ plugin (Gemini, Claude, OpenAI, OpenRouter, or CLI-subscription logins like+ Claude Max / ChatGPT), and every tier has a key-aware fallback chain that+ crosses provider families — one dead key or 429 never bricks the assistant.+- The heavy agents can run on a flat-rate subscription you already pay for+ (Claude CLI / Codex CLI login) instead of a metered API key.+- Speech is hybrid: wake word and STT can run fully locally (openWakeWord ++ faster-whisper as an opt-in extra), so no audio has to leave the machine;+ cloud STT (Groq Whisper) is the low-latency default if you opt in.+- Security is structural: everything observed through tools (web pages,+ emails, screenshots) is data, never instructions; every tool call goes+ through a four-tier risk policy (safe/monitor/ask/block); generated skills+ land as drafts and are never auto-activated.+- It runs headless on a cheap VPS — the browser provides mic and speakers via+ WebSocket — or as a full desktop app (Windows/macOS/Linux) with a tray, an+ overlay, and global-hotkey wake. The base install is torch- and GPU-free.++Honest limitations: the brain itself is cloud-API-based today (local LLMs+were dropped deliberately — voice latency budgets made pure-API chains the+pragmatic call, wake/STT stay local); TTS is cloud; and computer-use is the+least polished path. The repo history is depersonalized, so it reads cleaner+than the real, messier development was.++MIT-licensed. I'd genuinely value feedback on the architecture — especially+the router/worker/critic split and the prompt-injection boundary.++---++**Prepared answers for likely questions:**++- *"Why not a local LLM?"* — Tried it; a voice conversation needs sub-second+ acks and fast first tokens, and the orchestration (router + ack + worker ++ critic) needs several concurrent models. The plugin interface is there; a+ well-done local-brain PR would be welcome.+- *"How is this different from Siri/Alexa?"* — Those answer questions and set+ timers. This one opens a terminal, edits code, files PRs, browses, calls+ people — and shows its work in an auditable mission log.+- *"Prompt injection?"* — Only chat/voice can issue instructions. Tool output+ is data by contract; embedded instructions get surfaced, not executed. Plus+ risk tiers and a whitelist/blacklist with blacklist precedence. See SECURITY.md.+- *"What data leaves my machine?"* — Whatever you configure: audio only to the+ STT provider you chose (or none, if local STT), text to your brain provider.+ No telemetry, no analytics.diff --git a/marketing/launch/x-thread.md b/marketing/launch/x-thread.mdnew file mode 100644index 0000000000..ce875349df--- /dev/null+++ b/marketing/launch/x-thread.md@@ -0,0 +1,52 @@+# X launch thread draft (@PersonalJarvis)++> **Status: DRAFT — do not post without maintainer review.**+> Attach the demo video to tweet 1 — upload the MP4 natively (X re-encodes;+> for best quality render the 4K master from the promo project:+> `npx remotion render src/index.ts PersonalJarvisReadme out/readme-hero-4k.mp4 --scale 2 --crf 16`).+> House rule: no emojis in post text. Post the tweets as one thread.++---++**Tweet 1 — hook + video**++Everyone wants a Jarvis. So I built one — and open-sourced it.++You talk. Your computer does the work: it delegates to coding agents, reviews+their output, opens the pull request, and tells you when it's done.++MIT. Private by design. Runs on a 5 euro server.++github.com/PersonalJarvis/PersonalJarvis++[ATTACH: demo video]++**Tweet 2 — how it works**++Under the hood it's not one giant prompt. A lean router-brain listens and+delegates: small talk gets answered instantly, real work becomes a background+mission — an isolated worker does it, a critic reviews it (up to 3 rounds),+and only approved results are spoken back.++**Tweet 3 — provider freedom**++No vendor lock-in, structurally. The brain is a plugin: Gemini, Claude,+OpenAI, OpenRouter — or run the heavy agents on the flat-rate subscription you+already pay (Claude CLI / Codex CLI login). A dead key or a 429 never bricks+it: every tier falls back across provider families.++**Tweet 4 — privacy**++Wake word and speech recognition can run fully local — your audio never has+to leave the machine. No telemetry, no account, no cloud middleman: your+conversations, memory wiki, and keys stay in local files and your OS keychain.++**Tweet 5 — CTA**++It runs headless on a cheap VPS (your browser is the microphone) or as a full+desktop app on Windows, macOS, and Linux.++Star it, break it, file issues — contributions welcome, good first issues are+labeled:++github.com/PersonalJarvis/PersonalJarvisdiff --git a/tests/missions/test_budget.py b/tests/missions/test_budget.pyindex 1a2b83ea03..dbb530b4ee 100644--- a/tests/missions/test_budget.py+++ b/tests/missions/test_budget.py@@ -174,7 +174,7 @@ async def test_record_raises_at_per_mission_limit() -> None:async def test_record_raises_at_daily_limit() -> None:bt = BudgetTracker(per_mission_usd=100.0, daily_usd=10.0)await bt.record("m1", 5.0)- with pytest.raises(BudgetExceeded, match="Daily Budget"):+ with pytest.raises(BudgetExceeded, match="Daily budget"):await bt.record("m2", 6.0)@@ -191,7 +191,7 @@ async def test_assert_under_limit_blocks_after_exceeded() -> None:bt = BudgetTracker(per_mission_usd=5.0)with pytest.raises(BudgetExceeded):await bt.record("m1", 5.0)- with pytest.raises(BudgetExceeded, match="Pre-Spawn-Check"):+ with pytest.raises(BudgetExceeded, match="pre-spawn check"):bt.assert_under_limit("m1")diff --git a/tests/review/test_dispatch_tool.py b/tests/review/test_dispatch_tool.pyindex 01be672660..40c7ea108c 100644--- a/tests/review/test_dispatch_tool.py+++ b/tests/review/test_dispatch_tool.py@@ -131,9 +131,9 @@ def test_tool_description_contains_selective_activation_hint() -> None:(Plan §AD-6) — the smalltalk negative hint must be present."""tool = DispatchWithReviewTool()desc = tool.description.lower()- assert "user-irreversibel" in desc or "user_irreversibel" in desc # i18n-allow: matches the German tool description under test- assert "smalltalk" in desc- assert "konversation" in desc # i18n-allow: matches the German tool description under test+ assert "user-irreversible" in desc+ assert "small talk" in desc+ assert "conversation" in desc# ----------------------------------------------------------------------@@ -206,7 +206,7 @@ def test_execute_rejects_short_task(tmp_path: Path) -> None:tool.execute({"task": "short"}, _make_ctx()))assert result.success is False- assert result.error and "20 zeichen" in result.error.lower() # i18n-allow: matches the German tool error message under test+ assert result.error and "at least 20 characters" in result.error.lower()def test_execute_rejects_unknown_rubric_id(tmp_path: Path) -> None:diff --git a/tests/unit/awareness/test_awareness_snapshot_tool.py b/tests/unit/awareness/test_awareness_snapshot_tool.pyindex c23773ddb7..b295e1b07d 100644--- a/tests/unit/awareness/test_awareness_snapshot_tool.py+++ b/tests/unit/awareness/test_awareness_snapshot_tool.py@@ -50,7 +50,7 @@ def test_schema_is_empty() -> None:def test_description_mentions_state_first_use() -> None:"""Plan §5 description: 'USE this BEFORE asking the user for context'."""tool = AwarenessSnapshotTool(manager=AwarenessManager(AwarenessConfig.default()))- assert "BEVOR" in tool.description or "vor" in tool.description.lower()+ assert "BEFORE" in tool.description# --- Verhalten --------------------------------------------------------------diff --git a/tests/unit/brain/test_ack_generator.py b/tests/unit/brain/test_ack_generator.pyindex 54e8b4bec3..374c3ddf9f 100644--- a/tests/unit/brain/test_ack_generator.py+++ b/tests/unit/brain/test_ack_generator.py@@ -240,12 +240,18 @@ class TestLanguageHandling:ack = generate_ack("run_shell", {}, language=hint)assert ack == "One moment."- @pytest.mark.parametrize("hint", ["de", "DE", "de-DE", "german", "deutsch", "fr", "es", ""])+ @pytest.mark.parametrize("hint", ["de", "DE", "de-DE", "german", "deutsch", "fr", ""])def test_non_english_hints_default_to_de(self, hint: str) -> None:# Project default is German; unrecognized hints fall to de.ack = generate_ack("run_shell", {}, language=hint)assert ack == "Moment."+ def test_spanish_hint_resolves_to_es(self) -> None:+ # es is a first-class supported output language (runtime output+ # language doctrine) — it must not fall back to the German default.+ ack = generate_ack("run_shell", {}, language="es")+ assert ack == "Vale, un momento."+def test_none_language_defaults_to_de(self) -> None:ack = generate_ack("run_shell", {}, language=None) # type: ignore[arg-type]assert ack == "Moment."diff --git a/tests/unit/brain/test_provider_multimodal.py b/tests/unit/brain/test_provider_multimodal.pyindex 351bae99ec..55051de799 100644--- a/tests/unit/brain/test_provider_multimodal.py+++ b/tests/unit/brain/test_provider_multimodal.py@@ -105,6 +105,6 @@ def test_openai_vision_unsupported_drops_images(sample_block, caplog):user_msg = next(m for m in out if m["role"] == "user")# Content is now a plain-text string (images dropped)assert user_msg["content"] == "question"- assert any("Vision-Support" in rec.message for rec in caplog.records), (+ assert any("vision support" in rec.message.lower() for rec in caplog.records), (f"expected a WARN log, got {[r.message for r in caplog.records]}")diff --git a/tests/unit/brain/test_search_web_freshness_doctrine.py b/tests/unit/brain/test_search_web_freshness_doctrine.pyindex ec91ced882..936c2855c4 100644--- a/tests/unit/brain/test_search_web_freshness_doctrine.py+++ b/tests/unit/brain/test_search_web_freshness_doctrine.py@@ -35,7 +35,7 @@ def test_search_web_description_reserved_for_fresh_facts() -> None:"""desc = SearchWebTool.description.lower()# The fresh / volatile doctrine must be present.- assert "aktuell" in desc, (+ assert "fresh" in desc, ("search_web description must restrict the tool to current/fresh facts")# The evergreen carve-out must be present so the model answers generaldiff --git a/tests/unit/brain/test_tool_use_loop.py b/tests/unit/brain/test_tool_use_loop.pyindex 1f2d4d22a6..e7f39f5255 100644--- a/tests/unit/brain/test_tool_use_loop.py+++ b/tests/unit/brain/test_tool_use_loop.py@@ -120,7 +120,7 @@ async def test_how_to_question_blocks_side_effect_tool() -> None:assert "Windows-Taste" in result.textassert len(brain.requests) == 2tool_message = brain.requests[1].messages[-1].content- assert "How-to" in str(tool_message)+ assert "how-to" in str(tool_message).lower()class _GmailTool:diff --git a/tests/unit/channels/test_manager.py b/tests/unit/channels/test_manager.pyindex 4b7fbb49a3..6e632b4e46 100644--- a/tests/unit/channels/test_manager.py+++ b/tests/unit/channels/test_manager.py@@ -140,7 +140,7 @@ def test_discovery_failed_load_isolated(monkeypatch: pytest.MonkeyPatch) -> Nonedef test_get_unknown_channel_raises_keyerror(monkeypatch: pytest.MonkeyPatch) -> None:_patch_entry_points(monkeypatch, [])mgr = ChannelManager(ChannelContext(bus=EventBus()))- with pytest.raises(KeyError, match="not.+verfuegbar|nicht verfuegbar"): # i18n-allow: matches the real (German) exception message string+ with pytest.raises(KeyError, match="not available"):mgr.get("nonexistent")diff --git a/tests/unit/clis/test_spec.py b/tests/unit/clis/test_spec.pyindex 019fce8ab6..5ea387f99b 100644--- a/tests/unit/clis/test_spec.py+++ b/tests/unit/clis/test_spec.py@@ -50,7 +50,7 @@ def test_install_requires_at_least_one_method() -> None:payload = _minimal_payload(install={})with pytest.raises(ValidationError) as exc:CliSpecModel.model_validate(payload)- assert "Install-Methode" in str(exc.value)+ assert "at least one install method" in str(exc.value).lower()def test_install_manual_url_alone_is_valid() -> None:diff --git a/tests/unit/clis/test_tool.py b/tests/unit/clis/test_tool.pyindex 4515ee8791..3157e5b8ce 100644--- a/tests/unit/clis/test_tool.py+++ b/tests/unit/clis/test_tool.py@@ -96,7 +96,7 @@ async def test_binary_guard_rejects_other_binary(tmp_path: Path) -> None:tool, _ = _make_tool(tmp_path)result = await tool.execute({"command": "rm -rf /"}, _ctx())assert result.success is False- assert "beginnen" in (result.error or "")+ assert "must start with" in (result.error or "")@pytest.mark.asynciodiff --git a/tests/unit/cu/test_conventions_ledger_verify.py b/tests/unit/cu/test_conventions_ledger_verify.pynew file mode 100644index 0000000000..c024fd0bda--- /dev/null+++ b/tests/unit/cu/test_conventions_ledger_verify.py@@ -0,0 +1,236 @@+"""Unit tests for CU v2 conventions (coordinate space + action grammar),+the idempotency ledger, and the pure verification helpers."""+from __future__ import annotations++from types import SimpleNamespace++import pytest++from jarvis.cu import conventions as conv+from jarvis.cu.ledger import ActionLedger, action_key+from jarvis.cu.verify import (+ clickable_labels,+ crop_raw,+ element_is_focused,+ field_values_hint,+ human_handoff_reason,+ regions_equal,+ typed_text_landed,+)+++# ---------------------------------------------------------------------------+# Coordinate convention resolution+# ---------------------------------------------------------------------------++def test_config_override_wins():+ assert conv.resolve_convention(+ "gemini", None, config_override="image_pixels",+ ) == "image_pixels"+++def test_brain_capability_beats_family_default():+ brain = SimpleNamespace(coordinate_convention="image_pixels")+ assert conv.resolve_convention("gemini", brain) == "image_pixels"+++def test_family_defaults():+ assert conv.resolve_convention("gemini", None) == "normalized_1000"+ assert conv.resolve_convention("claude-api", None) == "image_pixels"+ assert conv.resolve_convention("openai", None) == "image_pixels"+ assert conv.resolve_convention("some-new-provider", None) == "normalized_1000"+++def test_prompt_block_mentions_the_right_space():+ norm = conv.coordinate_prompt_block("normalized_1000", 1366, 768)+ assert "0-1000" in norm and "1366" not in norm+ pix = conv.coordinate_prompt_block("image_pixels", 1366, 768)+ assert "1366x768" in pix and "0-1000" not in pix+++# ---------------------------------------------------------------------------+# Action grammar+# ---------------------------------------------------------------------------++def test_parse_single_click():+ raw = '{"action": "click", "x": 512, "y": 300, "target": "Send button"}'+ actions = conv.parse_actions(raw)+ assert actions == [{+ "action": "click", "x": 512.0, "y": 300.0,+ "button": "left", "double": False, "target": "Send button",+ }]+++def test_parse_batch_with_fences_and_prose():+ raw = (+ "Here is my plan:\n```json\n"+ '[{"action":"click","x":10,"y":20},'+ '{"action":"type","text":"hello"},'+ '{"action":"key","keys":["enter"]}]\n```'+ )+ actions = conv.parse_actions(raw)+ assert [a["action"] for a in actions] == ["click", "type", "key"]+++def test_terminal_action_truncates_batch():+ raw = (+ '[{"action":"done","reason":"visible"},'+ '{"action":"click","x":1,"y":2}]'+ )+ actions = conv.parse_actions(raw)+ assert len(actions) == 1 and actions[0]["action"] == "done"+++def test_numeric_strings_are_tolerated():+ actions = conv.parse_actions('{"action":"click","x":"512","y":"300.5"}')+ assert actions[0]["x"] == 512.0 and actions[0]["y"] == 300.5+++def test_wait_is_capped():+ actions = conv.parse_actions('{"action":"wait","ms":3600000}')+ assert actions[0]["ms"] == conv.MAX_WAIT_MS+++def test_batch_is_capped():+ raw = "[" + ",".join(+ '{"action":"key","keys":["tab"]}' for _ in range(12)+ ) + "]"+ assert len(conv.parse_actions(raw)) == conv.MAX_BATCH++[email protected]("bad", [+ "", "no json here", '{"action":"launch_missiles"}',+ '{"action":"click","x":"abc","y":2}',+ '{"action":"type","text":""}',+ '{"action":"key","keys":[]}',+ '{"action":"scroll","direction":"diagonal"}',+])+def test_invalid_replies_raise(bad):+ with pytest.raises(conv.ActionParseError):+ conv.parse_actions(bad)+++# ---------------------------------------------------------------------------+# Idempotency ledger+# ---------------------------------------------------------------------------++def test_click_duplicate_within_tolerance_same_frame():+ ledger = ActionLedger()+ a = {"action": "click", "button": "left", "double": False}+ ledger.record(a, "sha1", resolved_xy=(100, 100))+ assert ledger.is_duplicate(a, "sha1", resolved_xy=(108, 95))+ # Different frame -> the same click is legitimate again.+ assert not ledger.is_duplicate(a, "sha2", resolved_xy=(100, 100))+ # Far-away click on the same frame is a different target.+ assert not ledger.is_duplicate(a, "sha1", resolved_xy=(300, 100))+++def test_type_duplicate_is_text_normalized():+ ledger = ActionLedger()+ ledger.record({"action": "type", "text": "Hello World"}, "sha1")+ assert ledger.is_duplicate({"action": "type", "text": " hello world "}, "sha1")+ assert not ledger.is_duplicate({"action": "type", "text": "hello world"}, "sha2")+ assert not ledger.is_duplicate({"action": "type", "text": "goodbye"}, "sha1")+++def test_open_app_and_key_dedupe_on_same_frame_only():+ ledger = ActionLedger()+ ledger.record({"action": "open_app", "name": "Spotify"}, "sha1")+ assert ledger.is_duplicate({"action": "open_app", "name": "spotify"}, "sha1")+ assert not ledger.is_duplicate({"action": "open_app", "name": "spotify"}, "sha2")+ ledger.record({"action": "key", "keys": ["Enter"]}, "sha1")+ assert ledger.is_duplicate({"action": "key", "keys": ["enter"]}, "sha1")+++def test_wait_done_fail_are_exempt():+ ledger = ActionLedger()+ for kind in ("wait", "done", "fail"):+ assert action_key({"action": kind}) is None+ ledger.record({"action": kind}, "sha1")+ assert not ledger.is_duplicate({"action": kind}, "sha1")+++# ---------------------------------------------------------------------------+# Pure verification helpers+# ---------------------------------------------------------------------------++def _node(**kw):+ defaults = dict(role="Edit", name="", value="", focused=False,+ enabled=True, is_password=False)+ defaults.update(kw)+ return SimpleNamespace(**defaults)+++def test_typed_text_landed_tristate():+ nodes = (_node(value="https://example.com"),)+ assert typed_text_landed(nodes, "example.com") is True+ assert typed_text_landed(nodes, "other.org") is False+ assert typed_text_landed((), "example.com") is None # nothing editable+ assert typed_text_landed(nodes, "ab") is None # too short+++def test_element_is_focused_positive_only():+ nodes = (_node(role="Button", name="Save", focused=True),)+ assert element_is_focused(nodes, "Save") is True+ assert element_is_focused(nodes, "Cancel") is None # never False+++def test_field_values_hint_lists_filled_fields_only():+ nodes = (+ _node(name="Address", value="https://example.com"),+ _node(name="Empty", value=""),+ _node(role="Button", name="Go", value="x"),+ )+ hint = field_values_hint(nodes)+ assert "Address" in hint and "example.com" in hint+ assert "Empty" not in hint and "Go" not in hint+ assert field_values_hint(()) == ""+++def test_human_handoff_reasons():+ assert human_handoff_reason((_node(role="Text", name="Complete the reCAPTCHA"),)) == "captcha challenge"+ assert human_handoff_reason((_node(role="Text", name="Enter the verification code"),)) == "two-factor / one-time code"+ assert human_handoff_reason((_node(role="Edit", name="Password"),)) == "login / password entry"+ assert human_handoff_reason((_node(role="Edit", name="", is_password=True),)) == "login / password entry"+ # A "Change password" BUTTON alone must not trip the handoff.+ assert human_handoff_reason((_node(role="Button", name="Change password"),)) is None+ assert human_handoff_reason(()) is None+++def test_clickable_labels_filters_roles_and_dedupes():+ nodes = (+ _node(role="Button", name="OK"),+ _node(role="Button", name="OK"),+ _node(role="Slider", name="Volume"),+ _node(role="Button", name="", enabled=True),+ _node(role="MenuItem", name="File"),+ _node(role="Button", name="Disabled", enabled=False),+ )+ assert clickable_labels(nodes) == ["OK", "File"]+++def test_regions_equal_tristate():+ a = ((4, 4), b"\x01" * 48)+ b = ((4, 4), b"\x01" * 48)+ c = ((4, 4), b"\x02" * 48)+ assert regions_equal(a, b) is True+ assert regions_equal(a, c) is False+ assert regions_equal(None, b) is None+ assert regions_equal(a, None) is None+++def test_crop_raw_scales_points_to_grab_pixels():+ pytest.importorskip("PIL", reason="pillow required")+ # Retina-style: rect is 100x50 points, grab is 200x100 pixels.+ rgb = bytearray(200 * 100 * 3)+ # Paint a white pixel at grab position (100, 50) = point (50, 25).+ idx = (50 * 200 + 100) * 3+ rgb[idx:idx + 3] = b"\xff\xff\xff"+ raw = ((200, 100), bytes(rgb))+ crop = crop_raw(raw, (0, 0, 100, 50), 50, 25, radius=2)+ assert crop is not None+ (w, h), data = crop+ assert w >= 4 and h >= 4 # radius scaled 2x -> >= 4px square+ assert b"\xff\xff\xff" in data # the white pixel is inside the crop+ # A point outside the rect -> None.+ assert crop_raw(raw, (0, 0, 100, 50), 999, 999, radius=2) is Nonediff --git a/tests/unit/docs/test_schema.py b/tests/unit/docs/test_schema.pyindex e6736ee88d..ab6f4c2f47 100644--- a/tests/unit/docs/test_schema.py+++ b/tests/unit/docs/test_schema.py@@ -20,7 +20,7 @@ def test_frontmatter_minimal_valid() -> None:assert fm.slug == "hello-world"assert fm.diataxis == DocDiataxis.UNCLASSIFIEDassert fm.status == DocStatus.DRAFT- assert fm.owner == "harald"+ assert fm.owner == "maintainers"assert fm.phase == "-"assert fm.tags == []diff --git a/tests/unit/friends/test_registry.py b/tests/unit/friends/test_registry.pyindex 4010ca7abe..f3136acfaa 100644--- a/tests/unit/friends/test_registry.py+++ b/tests/unit/friends/test_registry.py@@ -37,7 +37,7 @@ async def test_open_close_idempotent() -> None:@pytest.mark.asyncioasync def test_require_conn_raises_before_open() -> None:reg = FriendRegistry(":memory:")- with pytest.raises(FriendRegistryError, match="nicht geoeffnet"): # i18n-allow: matches the real (German) exception message string+ with pytest.raises(FriendRegistryError, match="not opened"):await reg.list_friends()