How it works
Two processes, a mozaik event bus, bounded contexts, and an anti-corruption layer in front of every model — the architecture behind a run.
baro is two processes. A Rust TUI host owns the run lifecycle — launch,
detach, the run registry, the resume guard, the write guard on prd.json —
and spawns a TypeScript orchestrator over a versioned JSONL protocol.
Everything you see (baro watch, the TUI, the cloud dashboard) is a reader of
that stream.

The bus is the language
Inside the orchestrator, bounded contexts talk through the
mozaik event bus. Every context
connects as a mozaik Participant; every message is a frozen
SemanticEvent with one typed contract per context. Nothing calls across a
context directly — the board, the conductor, the scouts, the architect, the
planner, and the critic are all peers on the same bus.
The whole of @mozaik-ai/core enters through one anti-corruption port
(runtime/mozaik.ts), so a mozaik runtime upgrade lands as a single adapter
swap rather than a tree-wide migration.
The contexts
| Context | Owns |
|---|---|
| Goal | the Architect: goal contract, invariants, obligations, remediation |
| Planning | domain (no I/O), application, per-backend adapters — the progressive planner that admits story fragments as the run learns |
| Execution | the collective board: offers, leases, waves, recovery, runtime replanning |
| Acceptance | the Critic and its evidence capture, the altitude probe |
| Verification | the gate registry, the declared-tests translator, no-shell command execution |
| Integration | isolated git worktrees, sealed lineage, merges, write surfaces |
| Market | the story factory: offers, admission, worker routing |
| Contract | shared normalization and the authority denylist |
A collective, not a coordinator
Most agent harnesses run hub-and-spoke: one coordinator model spawns workers, each works alone, and everything flows back through the coordinator's context window. baro's story agents are peers. They observe the events that concern them, exchange peer notes, and negotiate: a story blocked on a sibling's work suspends cooperatively and resumes when the dependency merges. Coordination is a protocol on the bus, not one model's memory.
A live plan
The plan is not prose — it's a DAG the run negotiates with. The progressive planner admits fragments as understanding grows; runtime replanning adds, removes, and rewires stories mid-run; a failed gate can spawn its own remediation story; and an agent can dispute a premise the Architect got wrong. Every plan change is a typed event on the stream with its reason attached.
Models are behind a boundary
No context knows which vendor produced its tokens. Phases request capabilities from lane adapters — Claude CLI, Codex CLI, a mozaik-native OpenAI-compatible runner, opencode, pi — and the same gates, critic, and merge machinery run identically on every backend. See LLM providers for routing, and Verification & gates for what stands in front of every merge regardless of backend.
LLM providers
Claude Code, Codex CLI, native OpenAI (or any OpenAI-compatible endpoint), a hybrid preset, and per-story tier routing. Same DAG, same orchestration — the transport is your choice.
Verification & gates
What stands between an agent's diff and your branch — the contract, the gates, the evidence critic, and the rules they all obey.