baro-ai 0.18.1 → 0.21.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -124,21 +124,98 @@ Options:
124
124
  --resume Resume from existing prd.json (also runs dry-run plans)
125
125
  --skip-context Skip CLAUDE.md auto-generation
126
126
  --cwd <path> Working directory (default: current)
127
+ --no-critic Disable live Critic (default: on). The Critic
128
+ reviews each agent turn against acceptance
129
+ criteria via `claude --model haiku` and injects
130
+ corrective feedback when the turn doesn't pass.
131
+ --critic-model <name> Model for the Critic (default: haiku)
132
+ --no-librarian Disable cross-agent runtime memory (default: on)
133
+ --no-sentry Disable file-touch conflict detector (default: on)
134
+ --no-surgeon Disable Surgeon (default: on). The Surgeon
135
+ observes terminal story failures and proposes
136
+ replans (split / prereq / rewire) so failed
137
+ work gets done in a different shape rather
138
+ than dropped.
139
+ --no-surgeon-llm Use deterministic Surgeon (skip-only) instead
140
+ of the LLM-driven replanner. The LLM Surgeon
141
+ is on by default; it costs an Opus call per
142
+ terminal failure but produces richer replans.
143
+ --surgeon-model <name> Model for the Surgeon LLM (default: opus)
127
144
  -h, --help Print help
128
145
  ```
129
146
 
147
+ ### Phase 2/3/4 observers (Mozaik bus)
148
+
149
+ baro 0.19+ runs every story through a TypeScript Mozaik orchestrator.
150
+ Stories on the same DAG level run truly in parallel and observers can
151
+ react to one another's bus events:
152
+
153
+ - **Librarian** (default ON) — when one agent reads a file or runs grep,
154
+ later agents in the run see the digest in their prompt and skip the
155
+ redundant exploration. Measurable token savings on multi-story runs.
156
+ - **Sentry** (default ON) — flags overlapping Edit/Write tool calls
157
+ across concurrent stories.
158
+ - **Critic** (default ON) — Haiku evaluator reviews each agent turn
159
+ against acceptance criteria; on a fail verdict, an inline corrective
160
+ message lands as the agent's next turn so it self-corrects before
161
+ commit. Disable with `--no-critic`.
162
+ - **Surgeon** (default ON, with LLM) — when a story fails its retry
163
+ budget, the Surgeon asks Opus for a richer replan and emits a
164
+ ReplanItem the Conductor applies at the next level boundary. The LLM
165
+ is biased toward keeping the work done — it prefers splitting a too-
166
+ large story into smaller pieces, inserting a prerequisite, or
167
+ rewiring dependencies, over dropping outright. A run is reported as
168
+ successful only when every original story passes; if the Surgeon
169
+ drops a story without replacement, the run terminates with a clear
170
+ "did not complete the goal" verdict instead of a green tick. Disable
171
+ the LLM with `--no-surgeon-llm` to fall back to deterministic
172
+ skip-only behavior, or `--no-surgeon` to remove adaptive replans
173
+ entirely.
174
+
130
175
  ## Requirements
131
176
 
132
177
  - [Claude CLI](https://docs.anthropic.com/en/docs/claude-cli) installed and authenticated
133
178
  - macOS (arm64/x64), Linux (x64/arm64), or Windows (x64)
134
- - Node.js 18+ (only if using `--planner openai`)
179
+ - **Node.js 20+** (orchestrator runtime)
135
180
  - `gh` CLI (optional, for automatic PR creation)
136
181
 
137
182
  > **Windows note:** Windows 10+ is required. For best TUI experience, use [Windows Terminal](https://aka.ms/terminal) or another modern terminal emulator.
138
183
 
139
184
  ## Architecture
140
185
 
141
- Rust binary distributed via npm. TUI built with ratatui, async execution with tokio, one Claude CLI process per story.
186
+ Rust binary distributed via npm. TUI built with ratatui, async execution
187
+ with tokio. Each `baro` invocation spawns the bundled TypeScript
188
+ [Mozaik](https://github.com/jigjoy-ai/mozaik) orchestrator as a
189
+ subprocess; the orchestrator owns story execution and emits typed
190
+ events into a shared `AgenticEnvironment` bus. Each story is one
191
+ `claude` CLI subprocess (auth inherits from your Claude CLI session —
192
+ no API key needed).
193
+
194
+ The orchestrator is itself a Mozaik agentic environment: there is no
195
+ imperative `run()` method, no top-level `Promise.all` loop. The
196
+ **Conductor** is a state machine that reacts to typed bus events
197
+ (`RunStartRequest` → `LevelComputeRequest` → `StorySpawnRequest` →
198
+ `StoryResult` → `LevelCompleted` → …). Spawning a story, evaluating a
199
+ turn, and replanning the DAG are all reactions, not steps in a loop.
200
+
201
+ Ten participants share that bus:
202
+
203
+ | Participant | Role |
204
+ | --------------- | ----------------------------------------------------------------- |
205
+ | `Conductor` | Orchestration state machine — drives the run by reacting |
206
+ | `StoryFactory` | Spawns Story Agents on each `StorySpawnRequest` |
207
+ | `StoryAgent` | Runs one story via Claude CLI, with retries and timeout |
208
+ | `Librarian` | Cross-agent memory — indexes outputs of exploration tools |
209
+ | `Sentry` | Flags overlapping file writes across concurrent stories |
210
+ | `Critic` | Per-turn acceptance-criteria evaluator (opt-in: `--with-critic`) |
211
+ | `Surgeon` | Emits DAG replans when a story fails terminally (opt-in: `--with-surgeon`) |
212
+ | `Operator` | Bridges external user commands (TUI, web UI) into bus events |
213
+ | `Auditor` | JSONL log of every event on the bus |
214
+ | `Cartographer` | Translates bus events into UI frames for the Rust TUI |
215
+
216
+ The bus is open. New participants — CI deployers, Slack notifiers,
217
+ external ticket triggers — are subscribers and emitters with no changes
218
+ to the orchestrator.
142
219
 
143
220
  ## License
144
221