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.

feat(society): chat-run assignments, starter team and the voice front door

rubenluetke10-beep5f0486b74282
diff --git a/docs/adr/0011-router-pure-dispatcher.md b/docs/adr/0011-router-pure-dispatcher.md
index 38e89f1982..d381426860 100644
--- a/docs/adr/0011-router-pure-dispatcher.md
+++ b/docs/adr/0011-router-pure-dispatcher.md
@@ -1294,3 +1294,33 @@ the feature.
- `tests/unit/brain/test_routing.py` (the set no longer names the tool)
- `tests/missions/test_worker_capability_parity.py` (the worker grant)
+
+## Amendment 2026-09-02 — Agent society voice tools
+
+`delegate-to-agent` (risk `monitor`) and `society-status` (risk `safe`) join
+`ROUTER_TOOLS`. They are the voice front door of the agent society
+(`docs/agent-society/MASTERPLAN.md` §3.2): "Jarvis, let Scout research that"
+becomes ONE typed `ASSIGN` envelope on the society board, acknowledged inside
+the 5-second voice budget; "what is Scout doing?" is answered from the roster
+and the last board events without a model call.
+
+### Pure-Dispatcher spirit is preserved
+
+- Neither tool spawns. `delegate-to-agent` appends an envelope; the society
+ scheduler (`jarvis/society/scheduler.py`, trusted Python) applies the kill
+ switch, the tier wall, delegation depth, budgets and caps and only then
+ starts work under the target agent's identity. A refusal is a typed `VETO`
+ the tool reads back as a spoken reason.
+- Both stay out of every worker set (AP-5/AP-14): they are loaded through the
+ `ROUTER_TOOLS` filter only and the society's own capability catalog lists
+ them under `NEVER_GRANTED`.
+- The runtime is reached through a lazy resolver (AD-OC1), so the tools are
+ registered at brain build time and answer an honest "not ready" until the
+ server has built the society.
+
+### Regression guards
+
+- `tests/unit/brain/test_routing.py` (both names in `ROUTER_TOOLS`)
+- `tests/unit/plugins/tool/test_delegate_to_agent.py` (ack, unknown agent,
+ veto read-back, status answers, not-ready path)
+- `tests/unit/society/test_scheduler.py` (the wall the tool relies on)
diff --git a/docs/agent-society/MASTERPLAN.md b/docs/agent-society/MASTERPLAN.md
index 50d06c25e9..b828196221 100644
--- a/docs/agent-society/MASTERPLAN.md
+++ b/docs/agent-society/MASTERPLAN.md
@@ -7,9 +7,14 @@ Progress (2026-09-01/02): **M1 done** — `jarvis/society/` substrate, `/api/soc
headless contract test. **M2 backend done** — the `society` chat surface with per-agent hands
and briefing, canonical chat binding, `society_message_agent` / `society_wiki_note`, the
approvals queue, `[agent:*]` routines. **M2 frontend open** — the section (sidebar | stage |
-roster rail), the model card (Specs | 3D | Chat) on `components/society/data.ts`, seed
-proposals. **M3 world** is the maintainer's parallel track. M4 (rooms live under the scheduler,
-curator, `delegate-to-agent` voice tool) not started.
+roster rail), the model card (Specs | 3D | Chat) on `components/society/data.ts`. **Also done
+(2026-09-02):** an ASSIGN runs by default as a turn in the agent's canonical chat (per-agent
+model, tools and briefing apply in full; the turn's end is a RESULT on the board; the mission
+stack stays available via `payload.runner = "mission"`), the starter team Scout + Archivist is
+seeded once per install, seed proposals come from connected capabilities
+(`GET /api/society/seeds`), and the voice front door exists: router tools `delegate-to-agent`
+and `society-status` (ADR-0011 amendment). **M3 world** is the maintainer's parallel track.
+Open in M4: rooms live under the scheduler, the curator.
The research behind every claim here lives in [`research/`](research/):
[Branch A — product & UI](research/branch-a-product-ui.md) (Hermes Agent, Grok Bot, 3D stack,
diff --git a/jarvis/brain/factory.py b/jarvis/brain/factory.py
index 32d8c6c0db..91151eea92 100644
--- a/jarvis/brain/factory.py
+++ b/jarvis/brain/factory.py
@@ -106,6 +106,16 @@ ROUTER_TOOLS = frozenset({
# call without confirmation. See ADR on awareness routing for the
# placement rationale.
"awareness-recall",
+ # Agent society (2026-09-02): the voice front door of the user's named
+ # agents. ``delegate-to-agent`` appends ONE ASSIGN envelope to the
+ # society board and acknowledges inside the voice budget; the society
+ # scheduler (trusted Python) decides whether work starts - the tool
+ # itself never spawns (risk monitor, like spawn-worker; never in a
+ # worker set, AP-5/AP-14). ``society-status`` reads the roster and the
+ # last events - no model call, risk safe. See ADR-0011 amendment
+ # "Agent society voice tools".
+ "delegate-to-agent",
+ "society-status",
# Skills-Brain-Integration: Brain-callable executor for installed user
# skills. D9-recursion-protection is structural — SkillRunner is constructed
# without a tool_registry that would re-expose run-skill recursively.
@@ -473,6 +483,11 @@ def _load_tools_for_tier(
kontrollierer_resolver=_resolve_kontrollierer,
announcer=build_spawn_announcer(config),
)
+ elif ep.name in ("delegate-to-agent", "society-status"):
+ # Agent society (2026-09-02): same lazy-resolver pattern as
+ # spawn-worker - the society runtime is built by the server
+ # on first use, after the brain exists.
+ inst = cls(runtime_resolver=_resolve_society_runtime)
elif ep.name == "computer-use":
# Wave 1: wraps the harness-dispatch plumbing with a fixed
# computer-use harness identity (see computer_use_tool.py).
@@ -695,6 +710,31 @@ def _build_contact_store() -> Any:
return None
+_SOCIETY_FACTORY_REF: list[Any] = []
+
+
+def set_society_factory(factory: Any) -> None:
+ """Register the server's society-runtime factory (see server.py)."""
+ _SOCIETY_FACTORY_REF[:] = [factory]
+
+
+def _resolve_society_runtime() -> Any:
+ """Resolve the agent-society runtime for the voice tools (AD-OC1).
+
+ The runtime the server already built wins; otherwise the registered
+ factory builds it on this first use. ``None`` means the server has not
+ registered a factory yet - the tools answer with an honest 'not ready'.
+ """
+ from jarvis.society.runtime import current_runtime
+
+ runtime = current_runtime()
+ if runtime is not None:
+ return runtime
+ if not _SOCIETY_FACTORY_REF:
+ return None
+ return _SOCIETY_FACTORY_REF[0]()
+
+
def _resolve_mission_manager() -> Any:
"""Resolve the MissionManager for the ``spawn_worker`` tool.
diff --git a/jarvis/plugins/tool/delegate_to_agent.py b/jarvis/plugins/tool/delegate_to_agent.py
new file mode 100644
index 0000000000..efbb4c16d7
--- /dev/null
+++ b/jarvis/plugins/tool/delegate_to_agent.py
@@ -0,0 +1,238 @@
+"""Router-tier society tools: ``delegate-to-agent`` and ``society-status``.
+
+The voice front door of the agent society (MASTERPLAN §3.2, agent-definition
+§4.1). Both tools answer inside the 5-second voice budget:
+
+* ``delegate-to-agent`` appends ONE ``ASSIGN`` envelope to the society board
+ on behalf of Jarvis (the lead) and returns a spoken acknowledgement at
+ once. The scheduler — trusted Python — decides whether and how the target
+ starts working; the tool never spawns anything itself and never waits for
+ completion. Completions re-enter voice through the existing announcement
+ path. Risk ``monitor``: a dispatch like ``spawn-worker``, never in a worker
+ set (AP-5/AP-14).
+* ``society-status`` reads the roster and the last events — no model call,
+ no spend — and answers "what is Scout doing?" (risk ``safe``).
+
+Both reach the runtime through a lazy resolver (AD-OC1): the society is
+built on first use by the server, after the brain exists.
+"""
+
+from __future__ import annotations
+
+import logging
+from collections.abc import Callable
+from typing import Any, Final
+
+from jarvis.core.protocols import ExecutionContext, ToolResult
+
+log = logging.getLogger(__name__)
+
+RuntimeResolver = Callable[[], Any | None]
+
+_ACK: Final[dict[str, str]] = {
+ "de": "{name} ist dran, ich sage Bescheid.", # i18n-allow: spoken ack
+ "en": "{name} is on it, I will let you know.",
+ "es": "{name} se encarga, te aviso.",
+}
+_NO_AGENT: Final[dict[str, str]] = {
+ "de": "Ich kenne keinen Agenten namens {target}.", # i18n-allow: spoken reply
+ "en": "I do not know an agent called {target}.",
+ "es": "No conozco ningún agente llamado {target}.",
+}
+_REFUSED: Final[dict[str, str]] = {
+ "de": "{name} kann das gerade nicht übernehmen: {reason}.", # i18n-allow: spoken reply
+ "en": "{name} cannot take that right now: {reason}.",
+ "es": "{name} no puede encargarse ahora: {reason}.",
+}
+_NOT_READY: Final[dict[str, str]] = {
+ "de": "Die Agenten sind noch nicht bereit.", # i18n-allow: spoken reply
+ "en": "The agents are not ready yet.",
+ "es": "Los agentes aún no están listos.",
+}
+_STATUS_IDLE: Final[dict[str, str]] = {
+ "de": "{name} hat gerade nichts zu tun.", # i18n-allow: spoken reply
+ "en": "{name} has nothing to do right now.",
+ "es": "{name} no tiene nada que hacer ahora.",
+}
+_STATUS_WORKING: Final[dict[str, str]] = {
+ "de": "{name} arbeitet gerade: {text}", # i18n-allow: spoken reply
+ "en": "{name} is working on: {text}",
+ "es": "{name} está trabajando en: {text}",
+}
+_STATUS_LAST: Final[dict[str, str]] = {
+ "de": "{name}: zuletzt {kind}, {text}", # i18n-allow: spoken reply
+ "en": "{name}: last {kind}, {text}",
+ "es": "{name}: último {kind}, {text}",
+}
+_ROSTER: Final[dict[str, str]] = {
+ "de": "Aktive Agenten: {names}.", # i18n-allow: spoken reply
+ "en": "Active agents: {names}.",
+ "es": "Agentes activos: {names}.",
+}
+
+
+def _lang(args: dict[str, Any], ctx: Any) -> str:
+ """The turn's output language: ``ctx.config["output_language"]`` as the
+ tool-use loop stamps it (decided once per turn by ``turn_language.py``),
+ else a ``turn_language`` argument, else the ambient answer language. This
+ layer never re-derives a language from the utterance (CLAUDE.md §1)."""
+ config = getattr(ctx, "config", None) or {}
+ value = (
+ str(
+ (config.get("output_language") if isinstance(config, dict) else "")
+ or args.get("turn_language")
+ or ""
+ )
+ .strip()
+ .lower()
+ )
+ if not value:
+ try:
+ from jarvis.voice.action_phrases import resolve_ambient_language
+
+ value = resolve_ambient_language()
+ except Exception: # noqa: BLE001 — a spoken fallback beats a crash on the voice path
+ value = "en"
+ return value if value in _ACK else "en"
+
+
+class DelegateToAgentTool:
+ """Hand a task to a named society agent; acknowledge at once."""
+
+ name: str = "delegate_to_agent"
+ risk_tier: str = "monitor"
+ description: str = (
+ "Hand a task to one of the user's named agents (their agent society): 'let Scout "
+ "research X', 'Mailbox, answer the invoice mail'. Use when the user names an agent "
+ "or asks for the team. The agent works in the background; you acknowledge now. "
+ "Never for tasks the user wants done right here in this turn."
+ )
+ schema: dict[str, Any] = {
+ "type": "object",
+ "properties": {
+ "agent": {"type": "string", "description": "The agent's name as the user said it."},
+ "task": {"type": "string", "description": "The task, in full, in the user's words."},
+ },
+ "required": ["agent", "task"],
+ }
+ is_action_tool: bool = True
+
+ def __init__(self, *, runtime_resolver: RuntimeResolver) -> None:
+ self._resolve = runtime_resolver
+
+ async def execute(self, args: dict[str, Any], ctx: ExecutionContext) -> ToolResult:
+ lang = _lang(args, ctx)
+ target_key = str(args.get("agent") or "").strip()
+ task = str(args.get("task") or "").strip()
+ if not target_key or not task:
+ return ToolResult(
+ success=False, output=_NOT_READY[lang], error="agent and task required"
+ )
+ runtime = await self._runtime()
+ if runtime is None:
+ return ToolResult(success=False, output=_NOT_READY[lang], error="society unavailable")
+ target = await runtime.roster.resolve(target_key)
+ if target is None:
+ return ToolResult(
+ success=False,
+ output=_NO_AGENT[lang].format(target=target_key),
+ error="target_unknown",
+ )
+ from jarvis.society.events import MsgType
+
+ env = await runtime.say(
+ from_agent=runtime.lead_id,
+ to_agent=target.agent_id,
+ text=task,
+ trace_id=f"voice:{ctx.trace_id.hex[:12]}",
+ msg_type=MsgType.ASSIGN,
+ payload={"text": task, "lang": lang},
+ )
+ # The scheduler answered synchronously on the same trace: a CLAIM
+ # means the agent took it, a VETO says why not — say so, no waiting.
+ outcome = None
+ for event in await runtime.store.events_for_trace(env.trace_id):
+ if event.seq and env.seq and event.seq > env.seq:
+ outcome = event
+ break
+ if outcome is not None and outcome.msg_type is MsgType.VETO:
+ reason = str(outcome.payload.get("text") or outcome.payload.get("reason") or "")
+ return ToolResult(
+ success=False,
+ output=_REFUSED[lang].format(name=target.name, reason=reason),
+ error=str(outcome.payload.get("reason") or "vetoed"),
+ )
+ return ToolResult(
+ success=True,
+ output=_ACK[lang].format(name=target.name),
+ artifacts=(f"agent:{target.agent_id}",),
+ )
+
+ async def _runtime(self) -> Any | None:
+ try:
+ runtime = self._resolve()
+ except Exception: # noqa: BLE001 — a missing society is a spoken "not ready"
+ log.warning("delegate_to_agent: society runtime resolver failed", exc_info=True)
+ return None
+ if runtime is None:
+ return None
+ await runtime.ensure_started()
+ return runtime
+
+
+class SocietyStatusTool:
+ """What an agent (or the whole team) is doing — read-only, no model call."""
+
+ name: str = "society_status"
+ risk_tier: str = "safe"
+ description: str = (
+ "Answer 'what is <agent> doing?', 'is Scout done?', 'who is on the team?' from the "
+ "agent society's board. Read-only. Pass the agent's name, or nothing for the team."
+ )
+ schema: dict[str, Any] = {
+ "type": "object",
+ "properties": {
+ "agent": {"type": "string", "description": "An agent's name; omit for the team."},
+ },
+ }
+
+ def __init__(self, *, runtime_resolver: RuntimeResolver) -> None:
+ self._resolve = runtime_resolver
+
+ async def execute(self, args: dict[str, Any], ctx: ExecutionContext) -> ToolResult:
+ lang = _lang(args, ctx)
+ try:
+ runtime = self._resolve()
+ except Exception: # noqa: BLE001 — see DelegateToAgentTool._runtime
+ runtime = None
+ if runtime is None:
+ return ToolResult(success=False, output=_NOT_READY[lang], error="society unavailable")
+ await runtime.ensure_started()
+ target_key = str(args.get("agent") or "").strip()
+ if not target_key:
+ agents = await runtime.roster.list()
+ names = ", ".join(a.name for a in agents if a.agent_id != runtime.lead_id) or "—"
+ return ToolResult(success=True, output=_ROSTER[lang].format(names=names))
+ target = await runtime.roster.resolve(target_key)
+ if target is None:
+ return ToolResult(
+ success=False,
+ output=_NO_AGENT[lang].format(target=target_key),
+ error="target_unknown",
+ )
+ if runtime.scheduler.active_runs(target.agent_id) > 0:
+ events = await runtime.store.events_for_agent(target.agent_id, limit=5)
+ text = next((e.text for e in reversed(events) if e.text), "")
+ return ToolResult(
+ success=True, output=_STATUS_WORKING[lang].format(name=target.name, text=text)
+ )
+ events = await runtime.store.events_for_agent(target.agent_id, limit=1)
+ if not events:
+ return ToolResult(success=True, output=_STATUS_IDLE[lang].format(name=target.name))
+ last = events[-1]
+ return ToolResult(
+ success=True,
+ output=_STATUS_LAST[lang].format(
+ name=target.name, kind=str(last.msg_type).lower(), text=last.text[:200]
+ ),
+ )
diff --git a/jarvis/society/chat_binding.py b/jarvis/society/chat_binding.py
index 007e739335..ff39fb4588 100644
--- a/jarvis/society/chat_binding.py
+++ b/jarvis/society/chat_binding.py
@@ -28,7 +28,14 @@ from .scheduler import DeliverHook
log = logging.getLogger(__name__)
-__all__ = ["SURFACE", "ensure_session", "frame_incoming", "make_deliver_hook", "pair_for"]
+__all__ = [
+ "SURFACE",
+ "ensure_session",
+ "frame_assignment",
+ "frame_incoming",
+ "make_deliver_hook",
+ "pair_for",
+]
SURFACE: Final[str] = "society"
@@ -113,6 +120,21 @@ def frame_incoming(env: SocietyEnvelope, sender_name: str) -> str:
return "\n".join(lines)
+def frame_assignment(env: SocietyEnvelope) -> str:
+ """An ASSIGN as the receiving agent's chat turn — with the handoff ask."""
+ sender = env.from_agent if env.from_agent != "user" else "the user"
+ task = env.text or str(env.payload.get("task") or "")
+ lines = [f"[assignment from {sender}]", task.strip()]
+ refs = env.payload.get("refs")
+ if isinstance(refs, list) and refs:
+ lines.append("Refs: " + ", ".join(str(r) for r in refs))
+ lines.append(
+ "When you are done, end with a handoff: what is done, where the output is, "
+ "what evidence you used, what remains open, who should own the next step."
+ )
+ return "\n".join(lines)
+
+
def make_deliver_hook(
get_service: Callable[[], Any | None],
get_cfg: Callable[[], Any],
diff --git a/jarvis/society/runtime.py b/jarvis/society/runtime.py
index f7ee6368b2..0ff87b3341 100644
--- a/jarvis/society/runtime.py
+++ b/jarvis/society/runtime.py
@@ -6,17 +6,18 @@ Built on the first REST call (``app.state.society_factory``), never at boot
be constructed in a test with fakes and in the server with the live
mission manager, budget tracker, brain tool registry and skill registry.
-Dispatch (M1): an ``ASSIGN`` becomes a mission through the existing
-``MissionManager.dispatch`` — the worker runs under the agent's identity by
-prompt framing (name, title, standing instructions), and the ownership map
-lets the bridge attribute every mission event back to the agent. Per-agent
-model and tool grants ride the canonical chat (M2); missions inherit the
-global worker configuration until the worker runtime learns a per-agent
-override.
+Dispatch: an ``ASSIGN`` becomes, by default, one turn in the target's
+canonical chat — Jarvis' brain runner with the roster row's provider, model,
+tools and briefing, so per-agent customization applies in full; the turn's
+end is written back as a RESULT on the board. ``payload.runner == "mission"``
+(or no chat service at all) routes to the mission stack instead: worktree
+isolation for heavy coding work, the agent's identity carried by the prompt,
+the ownership map letting the bridge attribute every mission event back.
"""
from __future__ import annotations
+import asyncio
import logging
from collections.abc import Callable, Iterable, Mapping
from pathlib import Path
@@ -30,6 +31,7 @@ from .focus import derive_approval_rules, derive_focus
from .rooms import Rooms
from .roster import LEAD_AGENT_ID, AgentRecord, Roster
from .scheduler import DeliverHook, SocietyScheduler
+from .seeds import seed_first_run
from .store import SocietyStore
log = logging.getLogger(__name__)
@@ -76,6 +78,9 @@ class SocietyRuntime:
brain_tools: Callable[[], Mapping[str, Any] | None] | None = None,
skills: Callable[[], Iterable[Any] | None] | None = None,
deliver: DeliverHook | None = None,
+ chat_service: Callable[[], Any | None] | None = None,
+ cfg: Callable[[], Any] | None = None,
+ seed_starter_team: bool = True,
) -> None:
self._data_dir = Path(data_dir)
self._get_manager = mission_manager or (lambda: None)
@@ -84,6 +89,10 @@ class SocietyRuntime:
self._get_tools = brain_tools or (lambda: None)
self._get_skills = skills or (lambda: None)
self._deliver = deliver
+ self._get_chat = chat_service or (lambda: None)
+ self._get_cfg = cfg or (lambda: None)
+ self._seed_starter_team = seed_starter_team
+ self._watchers: set[asyncio.Task[None]] = set()
self.store = SocietyStore(self._data_dir / _DB_NAME)
self.roster = Roster(self.store)
self.rooms = Rooms(self.store)
@@ -116,12 +125,19 @@ class SocietyRuntime:
if bus is not None:
self.bridge.attach(bus)
await self.seed_lead()
+ if self._seed_starter_team:
+ created = await seed_first_run(self.roster, self.store)
+ if created:
+ log.info("society: starter team seeded: %s", ", ".join(created))
self._started = True
set_current_runtime(self)
log.info("society runtime started (%s)", self.store.path)
return self
async def close(self) -> None:
+ for task in list(self._watchers):
+ task.cancel()
+ self._watchers.clear()
self.scheduler.detach()
self.bridge.detach()
await self.store.close()
@@ -174,6 +190,105 @@ class SocietyRuntime:
return self._owners.get(mission_id)
async def _dispatch(self, target: AgentRecord, env: SocietyEnvelope) -> str:
+ """Start work under ``target``'s identity.
+
+ Default runner is the agent's canonical chat: one turn on Jarvis' brain
+ runner with the roster row's provider, model, tools and briefing, so
+ per-agent customization applies in full. ``payload.runner == "mission"``
+ routes to the mission stack instead (worktree isolation for heavy
+ coding work; the worker then inherits the global worker configuration
+ and only the prompt carries the agent's identity).
+ """
+ runner = str(env.payload.get("runner") or "")
+ if not runner:
+ runner = "chat" if self._get_chat() is not None else "mission"
+ if runner == "mission":
+ return await self._dispatch_mission(target, env)
+ return await self._dispatch_chat(target, env)
+
+ async def _dispatch_chat(self, target: AgentRecord, env: SocietyEnvelope) -> str:
+ svc = self._get_chat()
+ if svc is None:
+ raise RuntimeError("agent chat service unavailable: the society cannot start work")
+ from .chat_binding import ensure_session, frame_assignment
+
+ session = ensure_session(svc, self._get_cfg(), target)
+ if svc.is_running(session.session_id):
+ raise RuntimeError(f"target busy: {target.name} is running a turn")
+ queue = svc.subscribe(session.session_id)
+ try:
+ turn_id = await svc.send(session.session_id, frame_assignment(env))
+ except Exception:
+ svc.unsubscribe(session.session_id, queue)
+ raise
+ run_id = f"turn:{turn_id}"
+ watcher = asyncio.create_task(
+ self._watch_turn(svc, session.session_id, queue, turn_id, run_id, target, env)
+ )
+ self._watchers.add(watcher)
+ watcher.add_done_callback(self._watchers.discard)
+ return run_id
+
+ async def _watch_turn(
+ self,
+ svc: Any,
+ session_id: str,
+ queue: Any,
+ turn_id: str,
+ run_id: str,
+ target: AgentRecord,
+ env: SocietyEnvelope,
+ ) -> None:
+ """Turn the chat turn's end into a RESULT on the board and free the slot."""
+ final_text = ""
+ status = "done"
+ error = ""
+ try:
+ while True:
+ event = await queue.get()
+ kind = event.get("kind")
+ payload = event.get("payload") or {}
+ if payload.get("turn_id") not in (None, turn_id):
+ continue
+ if kind == "assistant_text":
+ final_text = str(payload.get("text") or final_text)
+ elif kind == "error":
+ status, error = "blocked", str(payload.get("message") or "error")
+ elif kind == "turn_finished":
+ if payload.get("status") not in (None, "ok", "done", "completed"):
+ status = "blocked"
+ error = str(payload.get("error") or payload.get("status") or "")
+ break
+ except asyncio.CancelledError:
+ return
+ finally:
+ svc.unsubscribe(session_id, queue)
+ self.scheduler.note_run_ended(run_id)
+ summary = (final_text or error or "turn finished").strip()
+ try:
+ await self.store.append_and_publish(
+ SocietyEnvelope(
+ msg_type=MsgType.RESULT,
+ from_agent=target.agent_id,
+ to_agent=env.from_agent if env.from_agent != "user" else None,
+ trace_id=env.trace_id,
+ parent_event_id=env.event_id,
+ payload={
+ "run_id": run_id,
+ "status": status,
+ "done": summary[:2000],
+ "output": [f"chat:{session_id}"],
+ "evidence": [],
+ "open": [] if status == "done" else [error[:500] or "turn failed"],
+ "next_owner": None,
+ "text": summary[:500],
+ },
+ )
+ )
+ except Exception: # noqa: BLE001 - the slot is free either way; the loss is one RESULT row
+ log.warning("society: RESULT for %s could not be written", run_id, exc_info=True)
+
+ async def _dispatch_mission(self, target: AgentRecord, env: SocietyEnvelope) -> str:
manager = self._get_manager()
if manager is None:
raise RuntimeError("mission manager unavailable: the society cannot start work")
diff --git a/jarvis/society/seeds.py b/jarvis/society/seeds.py
new file mode 100644
index 0000000000..51004e6c27
--- /dev/null
+++ b/jarvis/society/seeds.py
@@ -0,0 +1,157 @@
+"""Starter agents (agent-definition §6, maintainer decision 2026-09-02).
+
+Two things happen here:
+
+* ``STARTER_TEAM`` — the first-run seed: one coordinator (``Scout``, an
+ orchestrator that researches and delegates) and one specialist
+ (``Archivist``, who curates the wiki). Created once per install, guarded by
+ a meta flag, adoptable by name like any other agent, archivable by the
+ user like any other agent. An empty island reads as broken; two teammates
+ read as a team.
+* ``propose_seeds`` — Grok's onboarding idea done local-first: teammates
+ proposed from CONNECTED capabilities. A mail agent is proposed only when a
+ mail plugin is connected, a repo agent only with ``gh``, and so on. Pure
+ function over the catalog; the UI shows the proposals, the person picks.
+"""
+
+from __future__ import annotations
+
+from typing import Any, Final
+
+from .capabilities import CapabilityRow
+from .events import Tier
+from .focus import derive_approval_rules, derive_focus
+from .roster import Roster
+
+__all__ = ["STARTER_TEAM", "propose_seeds", "seed_first_run"]
+
+_SEEDED_KEY: Final[str] = "seeded_starter_team"
+
+STARTER_TEAM: Final[tuple[dict[str, Any], ...]] = (
+ {
+ "name": "Scout",
+ "title": "Research coordinator",
+ "tier": Tier.ORCHESTRATOR,
+ "description": (
+ "You research on the web and in the wiki, break bigger requests into small "
+ "tasks and hand them to the right teammate. You keep the user in the loop with "
+ "short handoffs: what is done, where it is, what is open."
+ ),
+ "permission_ceiling": "monitor",
+ "daily_budget_usd": 3.0,
+ },
+ {
+ "name": "Archivist",
+ "title": "Knowledge curator",
+ "tier": Tier.SPECIALIST,
+ "description": (
+ "You keep the shared wiki tidy: you turn results from teammates into short, "
+ "well-titled notes in your folder, link related pages and answer questions "
+ "from what the wiki already knows. You never invent facts."
+ ),
+ "permission_ceiling": "safe",
+ "daily_budget_usd": 1.0,
+ },
+)
+
+#: capability id → a proposed teammate. Order = display order.
+_PROPOSALS: Final[tuple[tuple[str, dict[str, Any]], ...]] = (
+ (
+ "plugin:gmail",
+ {
+ "name": "Mailbox",
+ "title": "Mail assistant",
+ "description": (
+ "You read, sort and summarize my mail and draft replies. "
+ "External mail is sent only after approval."
+ ),
+ },
+ ),
+ (
+ "plugin:google-calendar",
+ {
+ "name": "Planner",
+ "title": "Calendar assistant",
+ "description": (
+ "You keep my calendar: find free slots, prepare meetings, remind me of what "
+ "is coming. Changes to events only after approval."
+ ),
+ },
+ ),
+ (
+ "cli:gh",
+ {
+ "name": "Repo",
+ "title": "Repository assistant",
+ "description": (
+ "You watch my GitHub repositories: summarize pull requests and issues, "
+ "draft replies and changelogs. Merging or closing only after approval."
+ ),
+ },
+ ),
+ (
+ "plugin:spotify",
+ {
+ "name": "DJ",
+ "title": "Music assistant",
+ "description": "You manage my Spotify playlists and pick music for the moment.",
+ },
+ ),
+ (
+ "plugin:home-assistant",
+ {
+ "name": "Home",
+ "title": "Smart-home assistant",
+ "description": (
+ "You control my smart home through Home Assistant: lights, climate, scenes. "
+ "Locks and alarms only after approval."
+ ),
+ },
+ ),
+)
+
+
+def propose_seeds(
+ catalog: list[CapabilityRow], existing_names: set[str] | None = None
+) -> list[dict[str, Any]]:
+ """Teammates worth creating on THIS box: one per connected capability."""
+ connected = {row.id for row in catalog if row.connected}
+ taken = {n.lower() for n in (existing_names or set())}
+ out: list[dict[str, Any]] = []
+ for cap_id, proposal in _PROPOSALS:
+ if cap_id not in connected or proposal["name"].lower() in taken:
+ continue
+ focus = derive_focus(proposal["title"], proposal["description"], catalog)
+ if cap_id not in focus:
+ focus = [cap_id, *focus]
+ out.append(
+ {
+ **proposal,
+ "tier": str(Tier.SPECIALIST),
+ "focus": focus,
+ "approval_rules": derive_approval_rules(proposal["description"], focus),
+ "reason": cap_id,
+ }
+ )
+ return out
+
+
+async def seed_first_run(roster: Roster, store: Any) -> list[str]:
+ """Create the starter team once. Returns the ids created (empty later)."""
+ if await store.get_meta(_SEEDED_KEY, "0") == "1":
+ return []
+ created: list[str] = []
+ for spec in STARTER_TEAM:
+ skip = ("name", "title", "description", "tier")
+ fields = {k: v for k, v in spec.items() if k not in skip}
+ record, was_created = await roster.create(
+ name=spec["name"],
+ title=spec["title"],
+ description=spec["description"],
+ tier=spec["tier"],
+ **fields,
+ )
+ if was_created:
+ created.append(record.agent_id)
+ await store.set_meta(_SEEDED_KEY, "1")
+ return created
diff --git a/jarvis/ui/web/server.py b/jarvis/ui/web/server.py
index 5341102e7c..2904c06bb3 100644
--- a/jarvis/ui/web/server.py
+++ b/jarvis/ui/web/server.py
@@ -567,6 +567,11 @@ class WebServer:
# the boot path (AP-26).
app.state.society = None
app.state.society_factory = self._build_society_runtime
+ # The router-tier voice tools reach the same runtime through the
+ # brain factory's lazy resolver (AD-OC1).
+ from jarvis.brain.factory import set_society_factory
+
+ set_society_factory(self._build_society_runtime)
app.include_router(society_router)
app.include_router(drop_router)
# Default: no recorder wired up — _init_session_stack() in start()
@@ -3564,6 +3569,8 @@ class WebServer:
brain_tools=_tools,
skills=_skills,
deliver=deliver,
+ chat_service=lambda: _service_from_state(state),
+ cfg=lambda: self.cfg,
)
def _build_agent_chat_service(self) -> Any:
diff --git a/jarvis/ui/web/society_routes.py b/jarvis/ui/web/society_routes.py
index f15222e6d3..03b72aa6c9 100644
--- a/jarvis/ui/web/society_routes.py
+++ b/jarvis/ui/web/society_routes.py
@@ -333,6 +333,49 @@ async def agent_inbox(agent_id: str, request: Request, after_seq: int = 0) -> di
return {"events": [e.model_dump() for e in events]}
+# ------------------------------------------------------------------- seeds
+
+
+async def list_seed_proposals(request: Request) -> dict[str, Any]:
+ """Teammates worth creating on this box — one per connected capability."""
+ from jarvis.society.seeds import propose_seeds
+
+ rt = await _runtime(request)
+ taken = {a.name for a in await rt.roster.list(include_archived=True)}
+ proposals = propose_seeds(rt.catalog(), taken)
+ return {"proposals": proposals, "total": len(proposals)}
+
+
+class ApplySeedsBody(BaseModel):
+ names: list[str] = Field(default_factory=list)
+
+
[email protected]("/seeds/apply")
+async def apply_seed_proposals(body: ApplySeedsBody, request: Request) -> dict[str, Any]:
+ """Create the picked proposals (all of them when ``names`` is empty)."""
+ from jarvis.society.seeds import propose_seeds
+
+ rt = await _runtime(request)
+ taken = {a.name for a in await rt.roster.list(include_archived=True)}
+ wanted = {n.lower() for n in body.names}
+ created = []
+ for proposal in propose_seeds(rt.catalog(), taken):
+ if wanted and proposal["name"].lower() not in wanted:
+ continue
+ fields = {k: v for k, v in proposal.items() if k in ("focus", "approval_rules")}
+ agent, was_created = await rt.roster.create(
+ name=proposal["name"],
+ title=proposal["title"],
+ description=proposal["description"],
+ tier=proposal["tier"],
+ **fields,
+ )
+ if was_created:
+ created.append(agent.to_dict())
+ return {"agents": created, "total": len(created)}
+
+
# ----------------------------------------------------------------- catalog
diff --git a/pyproject.toml b/pyproject.toml
index cf0f4e68fc..5d8aa3999f 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -746,6 +746,11 @@ app-command = "jarvis.plugins.tool.app_command:AppCommandTool"
awareness-snapshot = "jarvis.plugins.tool.awareness_snapshot:AwarenessSnapshotTool"
# Phase A3 — Awareness-Layer L3 (BM25 search across recent episodes).
awareness-recall = "jarvis.plugins.tool.awareness_recall:AwarenessRecallTool"
+# Agent society voice tools (2026-09-02): ONE typed ASSIGN to a named agent
+# with an immediate spoken ack, and a read-only status answer. Router-tier
+# only (ADR-0011 amendment); never in a worker set (AP-5/AP-14).
+delegate-to-agent = "jarvis.plugins.tool.delegate_to_agent:DelegateToAgentTool"
+society-status = "jarvis.plugins.tool.delegate_to_agent:SocietyStatusTool"
# Skills-Brain-Integration — Brain-callable executor for installed user skills.
run-skill = "jarvis.plugins.tool.run_skill:RunSkillTool"
# Phase B5 — long-term wiki recall (router-tier, read-only).
diff --git a/tests/contract/test_society_substrate.py b/tests/contract/test_society_substrate.py
index e64e89a9a0..3b3fc2f98d 100644
--- a/tests/contract/test_society_substrate.py
+++ b/tests/contract/test_society_substrate.py
@@ -21,7 +21,7 @@ class FakeManager:
def test_two_agents_exchange_typed_messages_headless(tmp_path: Path) -> None:
manager = FakeManager()
- runtime = SocietyRuntime(tmp_path, mission_manager=lambda: manager)
+ runtime = SocietyRuntime(tmp_path, seed_starter_team=False, mission_manager=lambda: manager)
app = FastAPI()
app.include_router(router)
app.state.society_factory = lambda: runtime
diff --git a/tests/unit/brain/test_routing.py b/tests/unit/brain/test_routing.py
index 50599be4ac..58a9c9648a 100644
--- a/tests/unit/brain/test_routing.py
+++ b/tests/unit/brain/test_routing.py
@@ -1993,6 +1993,14 @@ def test_router_tools_is_pure_dispatcher_set() -> None:
# jarvis/brain/artifact_gate.py), because the mandate is that an
# artifact is asked for, never volunteered.
"create-artifact",
+ # Agent society voice tools (2026-09-02): ONE typed ASSIGN to a
+ # named agent with an immediate ack (monitor) and a read-only
+ # status answer (safe). The society scheduler, not the tool,
+ # decides whether work starts - never a spawn, never in a
+ # worker set (AP-5/AP-14). See ADR-0011 amendment
+ # "Agent society voice tools".
+ "delegate-to-agent",
+ "society-status",
}
)
assert ROUTER_TOOLS == expected, (
@@ -2006,6 +2014,16 @@ def test_router_tools_is_pure_dispatcher_set() -> None:
)
+def test_society_voice_tools_in_router_tools() -> None:
+ """``delegate-to-agent`` and ``society-status`` must live in ROUTER_TOOLS
+ (2026-09-02): the router reaches the agent society only through these
+ two names. Neither spawns - the society scheduler owns dispatch."""
+ from jarvis.brain.factory import ROUTER_TOOLS
+
+ assert "delegate-to-agent" in ROUTER_TOOLS
+ assert "society-status" in ROUTER_TOOLS
+
+
def test_search_web_in_router_tools() -> None:
"""``search-web`` must live in ROUTER_TOOLS (2026-06-10 user mandate).
diff --git a/tests/unit/plugins/tool/test_delegate_to_agent.py b/tests/unit/plugins/tool/test_delegate_to_agent.py
new file mode 100644
index 0000000000..b72985af00
--- /dev/null
+++ b/tests/unit/plugins/tool/test_delegate_to_agent.py
@@ -0,0 +1,139 @@
+"""The society voice tools: ack at once, veto read-back, status without a model."""
+
+from __future__ import annotations
+
+from pathlib import Path
+from types import SimpleNamespace
+from uuid import uuid4
+
+import pytest
+
+from jarvis.plugins.tool.delegate_to_agent import DelegateToAgentTool, SocietyStatusTool
+from jarvis.society.events import MsgType
+from jarvis.society.runtime import SocietyRuntime
+
+
+class FakeChat:
+ """Enough of AgentChatService for a dispatch: the turn never ends here."""
+
+ def __init__(self, db: Path) -> None:
+ from jarvis.agent_chat.store import AgentChatStore
+
+ self.store = AgentChatStore(db)
+ self.sent: list[tuple[str, str]] = []
+
+ def is_running(self, session_id: str) -> bool:
+ return False
+
+ def subscribe(self, session_id: str):
+ import asyncio
+
+ return asyncio.Queue()
+
+ def unsubscribe(self, session_id: str, q) -> None:
+ pass
+
+ async def send(self, session_id: str, text: str, attachments=None) -> str:
+ self.sent.append((session_id, text))
+ return "turn-1"
+
+
+def _ctx(utterance: str = "lass Scout das machen") -> SimpleNamespace:
+ return SimpleNamespace(trace_id=uuid4(), user_utterance=utterance, config={}, memory_read=None)
+
+
+async def runtime(tmp_path: Path):
+ chat = FakeChat(tmp_path / "agent_chat.db")
+ cfg = SimpleNamespace(memory=SimpleNamespace(data_dir=str(tmp_path / "data")))
+ rt = SocietyRuntime(tmp_path, chat_service=lambda: chat, cfg=lambda: cfg)
+ await rt.ensure_started()
+ await rt.roster.update("scout", {"provider": "openai", "model": "gpt-5.2"})
+ await rt.roster.update("archivist", {"provider": "openai", "model": "gpt-5.2"})
+ try:
+ yield rt, chat
+ finally:
+ await rt.close()
+
+
+async def test_delegate_acks_and_assigns(runtime):
+ rt, chat = runtime
+ tool = DelegateToAgentTool(runtime_resolver=lambda: rt)
+ res = await tool.execute(
+ {"agent": "Scout", "task": "Find the best VPS.", "turn_language": "de"}, _ctx()
+ )
+ assert res.success, res.error
+ assert res.output == "Scout ist dran, ich sage Bescheid." # i18n-allow: spoken ack
+ assert res.artifacts == ("agent:scout",)
+ # The assignment went through the scheduler into Scout's canonical chat.
+ assert chat.sent and chat.sent[0][0] == "society:scout"
+ assert "Find the best VPS." in chat.sent[0][1]
+ events = await rt.store.events_since(0)
+ assert [e.msg_type for e in events][-2:] == [MsgType.ASSIGN, MsgType.CLAIM]
+ assert events[-2].from_agent == "jarvis"
+
+
+async def test_delegate_speaks_english_when_the_turn_is_english(runtime):
+ rt, _ = runtime
+ tool = DelegateToAgentTool(runtime_resolver=lambda: rt)
+ res = await tool.execute(
+ {"agent": "scout", "task": "Find it.", "turn_language": "en"}, _ctx("let scout find it")
+ )
+ assert res.output == "Scout is on it, I will let you know."
+
+
+async def test_delegate_unknown_agent(runtime):
+ rt, _ = runtime
+ tool = DelegateToAgentTool(runtime_resolver=lambda: rt)
+ res = await tool.execute(
+ {"agent": "Nobody", "task": "x", "turn_language": "en"}, _ctx("let nobody do x")
+ )
+ assert res.success is False and res.error == "target_unknown"
+ assert "Nobody" in res.output
+
+
+async def test_delegate_reads_the_veto_back(runtime):
+ rt, _ = runtime
+ await rt.store.set_kill_switch(True)
+ tool = DelegateToAgentTool(runtime_resolver=lambda: rt)
+ res = await tool.execute(
+ {"agent": "scout", "task": "x", "turn_language": "en"}, _ctx("let scout do x")
+ )
+ assert res.success is False and res.error == "kill_switch"
+ assert res.output.startswith("Scout cannot take that right now")
+
+
+async def test_not_ready_paths():
+ tool = DelegateToAgentTool(runtime_resolver=lambda: None)
+ res = await tool.execute(
+ {"agent": "scout", "task": "x", "turn_language": "en"}, _ctx("let scout do x")
+ )
+ assert res.success is False and res.output == "The agents are not ready yet."
+ empty = await tool.execute({"agent": "", "task": ""}, _ctx("x"))
+ assert empty.success is False
+
+ def _boom():
+ raise RuntimeError("no app")
+
+ status = SocietyStatusTool(runtime_resolver=_boom)
+ res = await status.execute({}, _ctx("who is on the team"))
+ assert res.success is False
+
+
+async def test_status_answers_from_the_board(runtime):
+ rt, _ = runtime
+ status = SocietyStatusTool(runtime_resolver=lambda: rt)
+ team = await status.execute({"turn_language": "en"}, _ctx("who is on the team"))
+ assert team.output == "Active agents: Scout, Archivist."
+ idle = await status.execute(
+ {"agent": "archivist", "turn_language": "en"}, _ctx("what is archivist doing")
+ )
+ assert idle.output == "Archivist has nothing to do right now."
+ delegate = DelegateToAgentTool(runtime_resolver=lambda: rt)
+ await delegate.execute({"agent": "scout", "task": "Find the best VPS."}, _ctx("let scout"))
+ working = await status.execute(
+ {"agent": "Scout", "turn_language": "en"}, _ctx("what is scout doing")
+ )
+ assert working.output.startswith("Scout is working on:")
+ unknown = await status.execute({"agent": "ghost"}, _ctx("what is ghost doing"))
+ assert unknown.success is False
diff --git a/tests/unit/society/test_agent_tools.py b/tests/unit/society/test_agent_tools.py
index 3746fc3d34..59c83df013 100644
--- a/tests/unit/society/test_agent_tools.py
+++ b/tests/unit/society/test_agent_tools.py
@@ -16,7 +16,7 @@ from jarvis.society.runtime import SocietyRuntime
@pytest.fixture
async def rt(tmp_path: Path):
- runtime = SocietyRuntime(tmp_path)
+ runtime = SocietyRuntime(tmp_path, seed_starter_team=False)
await runtime.ensure_started()
await runtime.roster.create(name="Scout")
await runtime.roster.create(name="Archivist")
diff --git a/tests/unit/society/test_chat_binding.py b/tests/unit/society/test_chat_binding.py
index 15f742e6fc..5d7bcf7a43 100644
--- a/tests/unit/society/test_chat_binding.py
+++ b/tests/unit/society/test_chat_binding.py
@@ -32,7 +32,7 @@ class FakeService:
@pytest.fixture
async def world(tmp_path: Path):
- runtime = SocietyRuntime(tmp_path)
+ runtime = SocietyRuntime(tmp_path, seed_starter_team=False)
await runtime.ensure_started()
svc = FakeService(AgentChatStore(tmp_path / "agent_chat.db"))
cfg = SimpleNamespace(memory=SimpleNamespace(data_dir=str(tmp_path / "data")))
@@ -170,3 +170,85 @@ def test_unfiltered_session_list_hides_society_sessions(tmp_path: Path):
assert [s["surface"] for s in everything] == ["agent"]
only = c.get("/api/agent-chat/sessions", params={"surface": "society"}).json()["sessions"]
assert [s["session_id"] for s in only] == ["society:x"]
+
+
+class FakeTurnService(FakeService):
+ """A service whose turns end: the watcher must write a RESULT and free the slot."""
+
+ def __init__(self, store: AgentChatStore) -> None:
+ super().__init__(store)
+ self.queues: dict[str, list] = {}
+
+ def subscribe(self, session_id: str):
+ import asyncio
+
+ q = asyncio.Queue()
+ self.queues.setdefault(session_id, []).append(q)
+ return q
+
+ def unsubscribe(self, session_id: str, q) -> None:
+ self.queues.get(session_id, []).remove(q)
+
+ async def send(self, session_id: str, text: str, attachments=None) -> str:
+ self.sent.append((session_id, text))
+ return "turn-1"
+
+ async def finish(self, session_id: str, text: str, *, status: str = "ok") -> None:
+ for q in list(self.queues.get(session_id, [])):
+ q.put_nowait({"kind": "assistant_text", "payload": {"turn_id": "turn-1", "text": text}})
+ q.put_nowait(
+ {"kind": "turn_finished", "payload": {"turn_id": "turn-1", "status": status}}
+ )
+
+
+async def test_assign_runs_in_the_canonical_chat_and_ends_as_a_result(tmp_path: Path):
+ import asyncio
+
+ svc = FakeTurnService(AgentChatStore(tmp_path / "agent_chat.db"))
+ cfg = SimpleNamespace(memory=SimpleNamespace(data_dir=str(tmp_path / "data")))
+ rt = SocietyRuntime(
+ tmp_path, seed_starter_team=False, chat_service=lambda: svc, cfg=lambda: cfg
+ )
+ await rt.ensure_started()
+ try:
+ await rt.roster.create(name="Scout", provider="openai", model="gpt-5.2")
+ env = await rt.say(
+ from_agent="user", to_agent="scout", text="Find the best VPS.", msg_type=MsgType.ASSIGN
+ )
+ # The assignment became a framed chat turn on Scout's own session.
+ assert svc.sent[0][0] == "society:scout"
+ assert svc.sent[0][1].startswith("[assignment from the user]\nFind the best VPS.")
+ assert "handoff" in svc.sent[0][1]
+ assert rt.scheduler.running == {"turn:turn-1": "scout"}
+ await svc.finish("society:scout", "Hetzner CX22 wins. Done.")
+ await asyncio.sleep(0.05)
+ assert rt.scheduler.running == {}
+ thread = await rt.store.events_for_trace(env.trace_id)
+ assert [e.msg_type for e in thread] == [MsgType.ASSIGN, MsgType.CLAIM, MsgType.RESULT]
+ result = thread[-1]
+ assert result.from_agent == "scout" and result.payload["status"] == "done"
+ assert result.payload["done"] == "Hetzner CX22 wins. Done."
+ assert result.payload["output"] == ["chat:society:scout"]
+ finally:
+ await rt.close()
+
+
+async def test_failed_turn_becomes_a_blocked_result(tmp_path: Path):
+ import asyncio
+
+ svc = FakeTurnService(AgentChatStore(tmp_path / "agent_chat.db"))
+ cfg = SimpleNamespace(memory=SimpleNamespace(data_dir=str(tmp_path / "data")))
+ rt = SocietyRuntime(
+ tmp_path, seed_starter_team=False, chat_service=lambda: svc, cfg=lambda: cfg
+ )
+ await rt.ensure_started()
+ try:
+ await rt.roster.create(name="Scout", provider="openai")
+ env = await rt.say(from_agent="user", to_agent="scout", text="x", msg_type=MsgType.ASSIGN)
+ await svc.finish("society:scout", "", status="error")
+ await asyncio.sleep(0.05)
+ result = (await rt.store.events_for_trace(env.trace_id))[-1]
+ assert result.msg_type is MsgType.RESULT and result.payload["status"] == "blocked"
+ assert result.payload["open"]
+ finally:
+ await rt.close()
diff --git a/tests/unit/society/test_seeds.py b/tests/unit/society/test_seeds.py
new file mode 100644
index 0000000000..6e1f1818c0
--- /dev/null
+++ b/tests/unit/society/test_seeds.py
@@ -0,0 +1,74 @@
+"""Starter team once per install; proposals only for connected capabilities."""
+
+from __future__ import annotations
+
+from pathlib import Path
+from types import SimpleNamespace
+
+from jarvis.society.capabilities import build_catalog
+from jarvis.society.roster import Roster
+from jarvis.society.runtime import SocietyRuntime
+from jarvis.society.seeds import STARTER_TEAM, propose_seeds, seed_first_run
+from jarvis.society.store import SocietyStore
+
+
+def _tool(name: str, desc: str = "x.") -> SimpleNamespace:
+ return SimpleNamespace(name=name, description=desc, risk_tier="monitor", schema={})
+
+
+async def test_starter_team_is_seeded_once(tmp_path: Path):
+ store = SocietyStore(tmp_path / "society.db")
+ await store.open()
+ roster = Roster(store)
+ created = await seed_first_run(roster, store)
+ assert created == ["scout", "archivist"]
+ scout = await roster.get("scout")
+ assert scout is not None and scout.may_assign and scout.tier == "orchestrator"
+ archivist = await roster.get("archivist")
+ assert archivist is not None and str(archivist.permission_ceiling) == "safe"
+ # The user archives Archivist; a restart must not bring it back.
+ await roster.archive("archivist")
+ assert await seed_first_run(roster, store) == []
+ assert [a.agent_id for a in await roster.list()] == ["scout"]
+ await store.close()
+
+
+async def test_runtime_seeds_lead_and_team_by_default(tmp_path: Path):
+ runtime = SocietyRuntime(tmp_path)
+ await runtime.ensure_started()
+ try:
+ ids = [a.agent_id for a in await runtime.roster.list()]
+ assert ids == ["jarvis", "scout", "archivist"]
+ finally:
+ await runtime.close()
+ quiet = SocietyRuntime(tmp_path / "quiet", seed_starter_team=False)
+ await quiet.ensure_started()
+ try:
+ assert [a.agent_id for a in await quiet.roster.list()] == ["jarvis"]
+ finally:
+ await quiet.close()
+
+
+def test_proposals_follow_connected_capabilities():
+ catalog = build_catalog(
+ {
+ "gmail": _tool("gmail", "Read and send mail."),
+ "cli_gh": _tool("cli_gh", "GitHub."),
+ "spotify": _tool("spotify", "Music."),
+ },
+ connected=lambda name, kind: name != "spotify",
+ )
+ proposals = propose_seeds(catalog)
+ assert [p["name"] for p in proposals] == ["Mailbox", "Repo"]
+ mailbox = proposals[0]
+ assert mailbox["focus"][0] == "plugin:gmail"
+ assert mailbox["approval_rules"]["require_approval"] == ["plugin:gmail:send"]
+ assert mailbox["tier"] == "specialist" and mailbox["reason"] == "plugin:gmail"
+ # Already created names are not proposed again.
+ assert [p["name"] for p in propose_seeds(catalog, {"mailbox"})] == ["Repo"]
+ assert propose_seeds([]) == []
+
+
+def test_starter_team_shape():
+ assert [s["name"] for s in STARTER_TEAM] == ["Scout", "Archivist"]
+ assert all(s["description"] for s in STARTER_TEAM)
diff --git a/tests/unit/society/test_surface.py b/tests/unit/society/test_surface.py
index 279ba1c59f..f167ed420a 100644
--- a/tests/unit/society/test_surface.py
+++ b/tests/unit/society/test_surface.py
@@ -36,7 +36,7 @@ TOOLS = {
@pytest.fixture
async def rt(tmp_path: Path):
- runtime = SocietyRuntime(tmp_path, brain_tools=lambda: TOOLS)
+ runtime = SocietyRuntime(tmp_path, seed_starter_team=False, brain_tools=lambda: TOOLS)
await runtime.ensure_started()
try:
yield runtime
diff --git a/tests/unit/ui/web/test_society_routes.py b/tests/unit/ui/web/test_society_routes.py
index 36db9c6feb..6efc24a62c 100644
--- a/tests/unit/ui/web/test_society_routes.py
+++ b/tests/unit/ui/web/test_society_routes.py
@@ -43,6 +43,7 @@ def client(tmp_path: Path):
manager = FakeManager()
runtime = SocietyRuntime(
tmp_path,
+ seed_starter_team=False,
mission_manager=lambda: manager,
mission_bus=lambda: manager.bus,
brain_tools=lambda: TOOLS,