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
feat(missions): widen the worker knowledge grant to voice-brain parity (ADR-0030)
Ruben Lütke2f76c1ec3755
diff --git a/docs/adr/0012-awareness-recall-router-tier.md b/docs/adr/0012-awareness-recall-router-tier.mdindex 3ed30af7a9..8e6fc965e0 100644--- a/docs/adr/0012-awareness-recall-router-tier.md+++ b/docs/adr/0012-awareness-recall-router-tier.md@@ -96,3 +96,15 @@ not block it.- `jarvis/plugins/tool/awareness_recall.py` (tool implementation).- `jarvis/memory/recall.py:357` (`search_episodes` with `since_ns`).- `tests/unit/awareness/test_awareness_recall_tool.py` (tier placement assertions).++## Amendment (2026-07-25, ADR-0030)++The "router tier, not a worker tier" placement is superseded FOR BROKERED+ACCESS: mission workers now receive `awareness-recall` through the ADR-0025+mission-scoped broker grant, gated on `[awareness].enabled`+(`jarvis/missions/workers/capabilities.py::restricted_worker_knowledge_tools`).+The original rationale is preserved — the tool still executes in the+supervisor process on the supervisor's recall store; no worker-side tool+loading, MCP replication, or in-process worker tier was added. This is+exactly the "Reopen if/when Jarvis-Agent workers need recall directly" path+this ADR anticipated. See ADR-0030 for the full worker knowledge surface.diff --git a/docs/adr/0025-mission-scoped-worker-tool-broker.md b/docs/adr/0025-mission-scoped-worker-tool-broker.mdindex 805a038df2..4e6e9a1332 100644--- a/docs/adr/0025-mission-scoped-worker-tool-broker.md+++ b/docs/adr/0025-mission-scoped-worker-tool-broker.md@@ -112,3 +112,16 @@ calls.- Keep the credential-free mission test covering grant selection, approvalresume, completion certification, and revocation.- Preserve the explicit recursive-tool and secret/config deny guards.++## Amendment (2026-07-25, ADR-0030 + ADR-0031)++Grant composition widened (mechanism unchanged): the native knowledge surface+is now dynamic — the wiki triple plus gate-driven additions+(`awareness-recall` behind `[awareness].enabled`, `search_web`,+`contact-lookup`, and `ultrawiki-search` once its service gate goes live) —+see ADR-0030. Ask-tier calls inside a grant can be pre-authorized per mission+via `[phase6.safety].auto_approve_tool_families` — the gate is answered on+the bus, never bypassed — see ADR-0031. The deny guards, the credential+boundary, and the completion certificate are unchanged; observed refusals+(denied/timed-out/errored calls) no longer abort the iteration, only+integrity failures do (`WorkerToolExecutionSummary.integrity_compromised`).diff --git a/docs/adr/0030-worker-knowledge-surface-parity.md b/docs/adr/0030-worker-knowledge-surface-parity.mdnew file mode 100644index 0000000000..8003d8fa26--- /dev/null+++ b/docs/adr/0030-worker-knowledge-surface-parity.md@@ -0,0 +1,95 @@+---+title: "ADR-0030: Worker Knowledge-Surface Parity"+slug: adr-0030-worker-knowledge-surface-parity+diataxis: adr+status: active+owner: project-maintainers+last_reviewed: 2026-07-25+phase: 6+audience: developer+---++# ADR-0030 — Worker Knowledge-Surface Parity++**Status:** Accepted (2026-07-25)+**Phase:** 6 — Self-Healing Jarvis-Agents Orchestrator+**Reference:** ADR-0025 (broker mechanism), ADR-0012 (superseded placement+note), ADR-0031 (pre-authorization); AP-5, AP-14, AP-21++## Context++Maintainer directive 2026-07-25: mission workers should reach the knowledge+surface the voice brain has — "connected to all our wiki systems and the+complex knowledge base, with everything you normally have via voice." The+classic wiki quartet (`wiki-list`, `wiki-recall`, `wiki-page-read`,+`wiki-ingest`) was already brokered (ADR-0025). Everything else was+router-only: session/episode memory (`awareness-recall`), web search+(`search_web`), contact resolution (`contact-lookup`), and the new UltraWiki+semantic store had no tool surface at all.++The "router tier only, never in a worker set" placement notes on+`awareness-recall` (ADR-0012) and `contact-lookup` predate the broker: they+were written when workers could not reach in-process tools at all. The broker+removed that premise — the tool object, the store, and the credentials stay+in the supervisor; a worker only sends a named request that still runs+through `ToolExecutor`. ADR-0012 explicitly invites this reopening ("Reopen+if/when Jarvis-Agent workers need recall directly").++## Decision++`restricted_worker_knowledge_tools()`+(`jarvis/missions/workers/capabilities.py`) becomes dynamic and gate-driven;+the static wiki triple stays exported for read-compat. Per tool:++| Tool | Decision | Gate |+|---|---|---|+| `wiki-list` / `wiki-recall` / `wiki-page-read` | granted (unchanged) | none |+| `wiki-ingest` | granted via `worker_allowed` app command (unchanged) | live registry |+| `awareness-recall` | **granted** | `[awareness].enabled`, fail closed |+| `search_web` | **granted** | none (keyless, safe-tier) |+| `contact-lookup` | **granted** | none (degrades to a clean "contacts unavailable" error) |+| `ultrawiki-search` | **planned** | gate ships fail-closed OFF; flips when the router tool + `UltraWikiService` exist (`cfg.ultrawiki.enabled` ∧ live service) |+| `awareness-snapshot` | **excluded** | live-desktop read: near-zero value in an isolated worktree, pure privacy leakage of current screen activity into external CLI transcripts |+| `contact-upsert` | **excluded (deferred)** | unattended write to the contact store; least privilege — not part of a knowledge surface |++Rules the decision preserves:++* **Phantom-tool honesty.** A gate failing closed means the name never enters+ the grant, so a worker never sees a tool whose every call can only error.+ The gateway-catalog intersection in `_BrokerScope._descriptors()` remains+ the structural backstop for tools that never loaded.+* **Execution stays in the supervisor** (ADR-0025): worker → broker →+ `BrainSupervisorToolGateway` → `ToolExecutor`. No credential, store handle,+ or `Tool` object crosses the process boundary.+* **No spawn/recursive/desktop/host-shell tool enters any worker set**+ (AP-5/AP-14; broker denylist unchanged).+* **The worker prompt names the surface** (`SUPERVISOR_BOUNDARY_DIRECTIVE`)+ and pins the honesty clause: a tool absent from the tool list is not+ available for this mission.++## Consequences++* Workers can answer "continue what I was doing this morning"-class tasks+ (session memory), research with the same keyless web search the router+ has, and resolve contact details for drafting tasks.+* Privacy: episode summaries and contact PII now flow into external worker+ CLI transcripts and mission logs. Accepted by explicit maintainer mandate+ ("everything you normally have via voice"); bounded by the read-only+ choice (`awareness-snapshot` and `contact-upsert` stay out).+* Token cost: up to four additional tool schemas per worker grant (~0.5–1k+ tokens) — bounded because knowledge grants stay flat.+* ADR-0012's "not in any worker tier" note and `contact_lookup.py`'s+ placement rule are superseded FOR BROKERED ACCESS ONLY; direct in-worker+ loading remains forbidden.++## Alternatives considered++* **Grant `awareness-snapshot` too** — rejected: value decays within seconds+ of spawn; a worktree worker acting on the live-desktop state would blur the+ isolation story ADR-0025 depends on.+* **Let workers call the wiki via the `jarvis` control CLI** — rejected:+ ADR-0025 already names the CLI adapters as a forbidden surface; the broker+ is the single sanctioned path.+* **Relevance-gate the knowledge tools like MCP servers** — rejected for+ now: the wiki tools ship ungated today and the new additions are cheap;+ revisit if grant schemas measurably bloat worker context.diff --git a/jarvis/missions/kontrollierer/worker_prompt.py b/jarvis/missions/kontrollierer/worker_prompt.pyindex b971889adf..3acea3e15a 100644--- a/jarvis/missions/kontrollierer/worker_prompt.py+++ b/jarvis/missions/kontrollierer/worker_prompt.py@@ -78,9 +78,16 @@ SUPERVISOR_BOUNDARY_DIRECTIVE: Final[str] = ("use the worker's own sandboxed shell and file tools inside the assigned ""worktree. Never invoke jarvis, jarvisctl, or jctl to control the running ""app; never operate the live desktop or Computer Use; never read control "- "credentials; and never change live configuration. For Wiki work, use only "- "the supervisor-granted wiki-list, wiki-recall, wiki-page-read, and "- "wiki-ingest tools."+ "credentials; and never change live configuration. For knowledge and "+ "research work, use only the supervisor-granted Jarvis tools that appear "+ "in your tool list: the wiki tools (wiki-list, wiki-recall, "+ "wiki-page-read, wiki-ingest), the semantic knowledge base "+ "(ultrawiki-search), session memory (awareness-recall), web search "+ "(search_web), and contact lookup (contact-lookup). A tool absent from "+ "your tool list is not available for this mission - do not call it. A "+ "denied or failed supervisor tool call is a normal, recoverable event: "+ "adapt your approach, use an alternative, or deliver the remainder of "+ "the task and state the limitation in your summary.")diff --git a/jarvis/missions/workers/capabilities.py b/jarvis/missions/workers/capabilities.pyindex 792435b57b..6633409ee4 100644--- a/jarvis/missions/workers/capabilities.py+++ b/jarvis/missions/workers/capabilities.py@@ -195,9 +195,61 @@ def restricted_worker_app_commands() -> tuple[str, ...]:return ()+# Always-granted additions beyond the wiki base (ADR-0030): the voice brain's+# read-only research reach. ``search_web`` is keyless and safe-tier;+# ``contact-lookup`` degrades to a clean "contacts unavailable" error exactly+# as the router sees it. NB the underscore in ``search_web`` — the broker+# matches ``Tool.name``, not the entry-point name.+_UNCONDITIONAL_EXTRA_KNOWLEDGE_TOOLS: tuple[str, ...] = (+ "search_web",+ "contact-lookup",+)+++def _awareness_recall_available() -> bool:+ """Session memory follows the awareness master switch — fail closed.++ Granting ``awareness-recall`` while ``[awareness].enabled = false`` would+ hand the worker a phantom tool whose every call errors (the honesty+ failure ``search_status`` was written to avoid).+ """+ try:+ from jarvis.core.config import load_config # noqa: PLC0415 — lazy, boot-safe++ return bool(load_config().awareness.enabled)+ except Exception: # noqa: BLE001 - config drift must not break missions+ return False+++def _ultrawiki_worker_tool_available() -> bool:+ """Gate for the ``ultrawiki-search`` grant — deliberately OFF for now.++ Flips live once the ``ultrawiki-search`` router tool ships: the honest+ condition is ``cfg.ultrawiki.enabled`` AND a running ``UltraWikiService``+ on the web app state. Until then this returns False so the name never+ enters a grant (phantom-tool rule, ADR-0030).+ """+ return False++def restricted_worker_knowledge_tools() -> tuple[str, ...]:- """Return the read-only native Wiki surface granted to Jarvis-Agents."""- return RESTRICTED_WORKER_KNOWLEDGE_TOOLS+ """Read-only knowledge surface granted to Jarvis-Agents (ADR-0030).++ Dynamic, gate-driven: the wiki triple is unconditional; session memory+ (``awareness-recall``) follows the awareness master switch; ``search_web``+ and ``contact-lookup`` mirror the voice brain's read-only reach;+ ``ultrawiki-search`` joins once its gate goes live. Execution always+ stays in the supervisor via the ADR-0025 broker — a worker never holds+ the tool object — and every gate fails closed so a disabled subsystem+ never yields a phantom tool.+ """+ tools: list[str] = list(RESTRICTED_WORKER_KNOWLEDGE_TOOLS)+ if _awareness_recall_available():+ tools.append("awareness-recall")+ tools.extend(_UNCONDITIONAL_EXTRA_KNOWLEDGE_TOOLS)+ if _ultrawiki_worker_tool_available():+ tools.append("ultrawiki-search")+ return tuple(tools)def worker_app_command_allowed(command_id: str) -> bool:diff --git a/jarvis/plugins/tool/contact_lookup.py b/jarvis/plugins/tool/contact_lookup.pyindex 2556e3a998..dd94bc80b8 100644--- a/jarvis/plugins/tool/contact_lookup.py+++ b/jarvis/plugins/tool/contact_lookup.py@@ -21,9 +21,11 @@ merged (or when the store fails to build) — the tool then degrades to a cleanPlacement rule---------------Router-tier only. Never include in any worker tool-set — a ``contact-lookup`` is-a direct safe-gated read, never a spawn (AP-5/AP-14). Risk tier ``safe``: a pure-read with no side effect, so the brain calls it without a confirmation nag.+Router-tier direct call; mission workers reach it ONLY through the ADR-0025+broker grant (ADR-0030 widened the worker knowledge surface) — the tool object+and the ContactStore stay in the supervisor, and the call still runs through+``ToolExecutor``. Never a spawn (AP-5/AP-14). Risk tier ``safe``: a pure read+with no side effect, so the brain calls it without a confirmation nag.Privacy-------diff --git a/tests/missions/kontrollierer/test_worker_prompt.py b/tests/missions/kontrollierer/test_worker_prompt.pyindex 9109f78eff..001fb132e2 100644--- a/tests/missions/kontrollierer/test_worker_prompt.py+++ b/tests/missions/kontrollierer/test_worker_prompt.py@@ -105,6 +105,20 @@ def test_supervisor_boundary_excludes_live_control_surfaces() -> None:assert "wiki-ingest" in text+def test_supervisor_boundary_names_the_knowledge_surface() -> None:+ """The directive is the one prompt chokepoint — a granted tool the model+ was never told about is dead weight (ADR-0030)."""+ text = SUPERVISOR_BOUNDARY_DIRECTIVE.lower()+ for name in ("ultrawiki-search", "awareness-recall", "search_web", "contact-lookup"):+ assert name in text+ # Honesty clause: gated-off tools are simply absent from the tool list,+ # and the model must not guess-call them (a blind call dirties the+ # ADR-0025 completion certificate).+ assert "absent from your tool list" in text+ # Refusals stay recoverable (W3 soft-fail contract).+ assert "recoverable" in text++def test_compose_places_supervisor_boundary_before_the_step() -> None:step = "Research this topic and update the Wiki."out = compose_worker_prompt("", step)diff --git a/tests/missions/test_worker_capability_parity.py b/tests/missions/test_worker_capability_parity.pyindex 3612e749d5..7d6bf088ab 100644--- a/tests/missions/test_worker_capability_parity.py+++ b/tests/missions/test_worker_capability_parity.py@@ -103,20 +103,72 @@ def test_config_command_is_rejected_from_worker_inventory() -> None:WorkerCapabilityInventory.build(app_commands=("brain-switch",))-def test_worker_knowledge_surface_is_wiki_only() -> None:+def test_worker_knowledge_surface_baseline(monkeypatch: pytest.MonkeyPatch) -> None:+ """All gates off → the wiki triple plus the always-on research pair+ (ADR-0030). Control surfaces and the excluded tools stay out."""+ from jarvis.missions.workers import capabilities++ monkeypatch.setattr(capabilities, "_awareness_recall_available", lambda: False)+ monkeypatch.setattr(capabilities, "_ultrawiki_worker_tool_available", lambda: False)tools = set(restricted_worker_knowledge_tools())- assert tools == {"wiki-list", "wiki-recall", "wiki-page-read"}+ assert tools == {+ "wiki-list",+ "wiki-recall",+ "wiki-page-read",+ "search_web",+ "contact-lookup",+ }assert "computer_use" not in toolsassert "run_shell" not in tools+ # Deliberate ADR-0030 exclusions: live-desktop read, unattended write.+ assert "awareness-snapshot" not in tools+ assert "contact-upsert" not in toolsassert not any(name.startswith("cli_") for name in tools)+def test_awareness_gate_adds_session_memory(monkeypatch: pytest.MonkeyPatch) -> None:+ from jarvis.missions.workers import capabilities++ monkeypatch.setattr(capabilities, "_awareness_recall_available", lambda: True)+ monkeypatch.setattr(capabilities, "_ultrawiki_worker_tool_available", lambda: False)++ assert "awareness-recall" in restricted_worker_knowledge_tools()+++def test_ultrawiki_gate_ships_fail_closed(monkeypatch: pytest.MonkeyPatch) -> None:+ """The ultrawiki-search grant stays OFF until the router tool + service+ exist — a phantom tool must never enter a grant (ADR-0030)."""+ from jarvis.missions.workers import capabilities++ assert capabilities._ultrawiki_worker_tool_available() is False+ assert "ultrawiki-search" not in restricted_worker_knowledge_tools()++ monkeypatch.setattr(capabilities, "_ultrawiki_worker_tool_available", lambda: True)+ assert "ultrawiki-search" in restricted_worker_knowledge_tools()+++def test_every_granted_knowledge_tool_passes_the_broker_denylist(+ monkeypatch: pytest.MonkeyPatch,+) -> None:+ from jarvis.missions.workers import capabilities+ from jarvis.missions.workers.worker_tool_broker import worker_tool_name_allowed++ monkeypatch.setattr(capabilities, "_awareness_recall_available", lambda: True)+ monkeypatch.setattr(capabilities, "_ultrawiki_worker_tool_available", lambda: True)++ for name in restricted_worker_knowledge_tools():+ assert worker_tool_name_allowed(name), name++def test_mission_inventory_combines_wiki_reads_with_relevant_connectors(monkeypatch: pytest.MonkeyPatch,) -> None:from jarvis.missions import init as missions_init+ from jarvis.missions.workers import capabilities+ monkeypatch.setattr(capabilities, "_awareness_recall_available", lambda: False)+ monkeypatch.setattr(capabilities, "_ultrawiki_worker_tool_available", lambda: False)monkeypatch.setattr(missions_init,"_assemble_worker_mcp_servers",@@ -136,6 +188,8 @@ def test_mission_inventory_combines_wiki_reads_with_relevant_connectors("wiki-list","wiki-recall","wiki-page-read",+ "search_web",+ "contact-lookup","gmail",}