baro-ai 0.39.0 → 0.40.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 +106 -171
- package/dist/cli.mjs +25 -43
- package/dist/cli.mjs.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,215 +1,150 @@
|
|
|
1
1
|
# baro
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
Give it a goal, it breaks it into stories, builds a dependency DAG, and runs them in parallel — each story gets its own AI agent.
|
|
3
|
+
> Type a goal in your repo. Walk away. Come back to a pull request.
|
|
6
4
|
|
|
7
5
|
  
|
|
8
6
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
> 📊 **Recent post:** [How baro generated 808 NestJS Jest tests autonomously in 71 minutes](https://jigjoy.ai/blog/baro-808-nestjs-jest-tests) — one prompt, 33-story DAG, two sessions because of the Anthropic usage cap, 83.5% branch coverage, zero filed bug issues.
|
|
14
|
-
|
|
15
|
-
## What's new in 0.39
|
|
7
|
+
```bash
|
|
8
|
+
npm install -g baro-ai
|
|
9
|
+
```
|
|
16
10
|
|
|
17
|
-
|
|
11
|
+

|
|
12
|
+
|
|
13
|
+
<sub>baro TUI at the end of an [actual run](https://jigjoy.ai/blog/baro-808-nestjs-jest-tests) — one prompt → 33-story DAG → 32 files modified → PR opened. The summary panel shows wall time (33:23), parallel speedup (2.2×), token usage, and the PR URL.</sub>
|
|
14
|
+
|
|
15
|
+
## Parallel coding agents, no central coordinator
|
|
16
|
+
|
|
17
|
+
Most multi-agent setups have one orchestrator function in the middle that drives N agents. The orchestrator becomes the bottleneck the moment you push past a handful of concurrent agents — and adding a new behaviour means editing its control flow.
|
|
18
|
+
|
|
19
|
+
baro doesn't have that shape. Every part of the run is an independent **participant** on a shared event bus ([Mozaik](https://github.com/jigjoy-ai/mozaik)). N parallel story agents are N independent subprocesses, each emitting and consuming typed events. There is no central `run()` to bottleneck on, and adding a new behaviour is a new participant — not an orchestrator rewrite.
|
|
20
|
+
|
|
21
|
+
```mermaid
|
|
22
|
+
flowchart LR
|
|
23
|
+
subgraph A["Typical multi-agent orchestrator"]
|
|
24
|
+
direction TB
|
|
25
|
+
C{{Coordinator}}
|
|
26
|
+
C --> A1[Agent 1]
|
|
27
|
+
C --> A2[Agent 2]
|
|
28
|
+
C --> A3[Agent N]
|
|
29
|
+
end
|
|
30
|
+
subgraph B["baro on Mozaik"]
|
|
31
|
+
direction TB
|
|
32
|
+
Bus[(shared event bus)]
|
|
33
|
+
P1[Conductor] -.-> Bus
|
|
34
|
+
P2[Story Agent 1] -.-> Bus
|
|
35
|
+
P3[Story Agent N] -.-> Bus
|
|
36
|
+
P4[Critic / Surgeon / ...] -.-> Bus
|
|
37
|
+
end
|
|
38
|
+
```
|
|
18
39
|
|
|
19
|
-
|
|
40
|
+
That's the architectural lever. Everything else baro does — Architect, Planner, Critic, Surgeon, Librarian — is a participant on that bus. They don't call each other; they react to events.
|
|
20
41
|
|
|
21
|
-
|
|
22
|
-
- **Architect phase**: an upstream agent that fixes cross-cutting design decisions (column names, file paths, API shapes, library choices) **before** any Story Agent starts, so 30 parallel agents don't each invent their own. See [baro vs Claude Code post](https://jigjoy.ai/blog/baro-vs-claude-code) for the architecture.
|
|
23
|
-
- **`--quick`** — skip Architect, force 1-story plan, silence Critic + Surgeon. For trivial goals (`baro --quick "fix the typo on line 42"`) where the design-doc + multi-agent ceremony is overhead.
|
|
24
|
-
- **Per-phase model overrides**: `--architect-model`, `--planner-model`, `--story-model`, `--critic-model`, `--surgeon-model` — pin any individual role to a specific model without forcing the rest with the global `--model`.
|
|
25
|
-
- **Branch per run**: every fresh run creates a new suffixed `baro/<slug>-<id>` branch, never falls back to checkout. Side-by-side runs from sibling clones can't collide on `git push`.
|
|
26
|
-
- **`baro --doctor`** — pre-flight self-check that verifies the `claude` CLI is on PATH and authenticated, the audit dir is writable, and `gh` exists. First thing to run when a baro run fails before any agents start.
|
|
27
|
-
- **Repo moved** to [jigjoy-ai/baro](https://github.com/jigjoy-ai/baro). npm package name unchanged (`baro-ai`).
|
|
28
|
-
- **gpt-5.5 defaults** + UTF-8 panic fix + Ghostty/kitty-keyboard Enter handling + Execute-screen 0/N resume fix (0.38.x).
|
|
42
|
+
## What a run looks like
|
|
29
43
|
|
|
30
|
-
|
|
44
|
+
```bash
|
|
45
|
+
cd your-repo
|
|
46
|
+
baro "Add JWT authentication with role-based access control"
|
|
47
|
+
```
|
|
31
48
|
|
|
32
49
|
```
|
|
33
|
-
|
|
50
|
+
→ Architect (45s) — design decisions pinned for every story
|
|
51
|
+
→ Planner (38s) — 7 stories in 3 levels
|
|
52
|
+
→ Executing — 4 parallel Claude Code agents on baro/jwt-auth branch
|
|
53
|
+
→ Critic — per-turn acceptance evaluation, self-corrects on fail
|
|
54
|
+
→ Finalizer — PR #142 opened ✓
|
|
34
55
|
```
|
|
35
56
|
|
|
36
|
-
|
|
57
|
+
```mermaid
|
|
58
|
+
flowchart LR
|
|
59
|
+
Goal([your goal]) --> A[Architect<br/><sub>~45s — emits<br/>DecisionDocument</sub>]
|
|
60
|
+
A --> P[Planner<br/><sub>~60s — emits DAG</sub>]
|
|
61
|
+
P --> S1[Story 1]
|
|
62
|
+
P --> S2[Story 2]
|
|
63
|
+
P --> S3[Story 3]
|
|
64
|
+
S1 --> S4[Story 4]
|
|
65
|
+
S2 --> S4
|
|
66
|
+
S3 --> S5[Story 5]
|
|
67
|
+
S4 --> F[Finalizer<br/><sub>opens PR</sub>]
|
|
68
|
+
S5 --> F
|
|
69
|
+
F --> PR([Pull Request])
|
|
70
|
+
```
|
|
37
71
|
|
|
38
|
-
|
|
72
|
+
Every story is one **Claude Code subprocess** (or one Mozaik-native OpenAI session) — auth inherits from your existing setup, no API key plumbing.
|
|
39
73
|
|
|
40
|
-
|
|
41
|
-
# Interactive — opens the welcome screen
|
|
42
|
-
baro
|
|
74
|
+
## Recent real run
|
|
43
75
|
|
|
44
|
-
|
|
45
|
-
baro "Add authentication with JWT and role-based access control"
|
|
76
|
+
[**How baro generated 808 NestJS Jest tests autonomously in 71 minutes**](https://jigjoy.ai/blog/baro-808-nestjs-jest-tests) — one prompt, 33-story DAG, two sessions because of the Anthropic 3am usage cap, 64 test suites, 83.5% branch coverage, +13,606 lines of test code, zero phantom bug issues filed.
|
|
46
77
|
|
|
47
|
-
|
|
48
|
-
OPENAI_API_KEY=sk-... baro --llm openai "Refactor the database layer"
|
|
78
|
+
## What each participant does
|
|
49
79
|
|
|
50
|
-
|
|
51
|
-
|
|
80
|
+
| Participant | Role |
|
|
81
|
+
|---|---|
|
|
82
|
+
| **Architect** | One Opus call before planning — emits a `DecisionDocument` that pins every cross-cutting design decision (file paths, schemas, API shapes, library choices) so 30 parallel agents don't each invent their own |
|
|
83
|
+
| **Planner** | Decomposes the goal into a story DAG, with the DecisionDocument already pinned |
|
|
84
|
+
| **Conductor** | State machine that drives the run by reacting to bus events |
|
|
85
|
+
| **StoryAgent** | One Claude Code subprocess per story; multi-turn loop until story completes |
|
|
86
|
+
| **Critic** | Per-turn evaluator (Haiku). On fail verdict, injects corrective feedback as the agent's next turn |
|
|
87
|
+
| **Sentry** | Flags overlapping Edit/Write tool calls across concurrent stories |
|
|
88
|
+
| **Librarian** | Indexes one agent's Read/Grep findings so siblings don't redo the exploration |
|
|
89
|
+
| **Surgeon** | On terminal failure, asks Opus for a richer replan (split / prereq / rewire) |
|
|
90
|
+
| **Finalizer** | Runs build verification, opens the GitHub PR with stories table + stats |
|
|
52
91
|
|
|
53
|
-
|
|
54
|
-
baro --timeout 300 "Add unit tests"
|
|
92
|
+
Bus is open. CI deployers, Slack notifiers, ticket triggers — all new participants, no orchestrator changes. Architecture deep-dive: [I tested Claude Code's new /goal feature against my parallel agent setup](https://jigjoy.ai/blog/baro-vs-claude-code).
|
|
55
93
|
|
|
56
|
-
|
|
57
|
-
baro --model opus "Complex architecture redesign"
|
|
94
|
+
## Try it
|
|
58
95
|
|
|
59
|
-
|
|
60
|
-
|
|
96
|
+
```bash
|
|
97
|
+
npm install -g baro-ai
|
|
61
98
|
|
|
62
|
-
#
|
|
63
|
-
baro
|
|
99
|
+
# Full run (default — Architect + Planner + parallel Story Agents)
|
|
100
|
+
baro "Migrate the hardcoded category data to a backend dictionary"
|
|
64
101
|
|
|
65
|
-
#
|
|
66
|
-
baro --
|
|
102
|
+
# Trivial goal — skip Architect + Critic + Surgeon, single story
|
|
103
|
+
baro --quick "fix the typo on line 42 of README.md"
|
|
67
104
|
|
|
68
|
-
#
|
|
69
|
-
baro --
|
|
105
|
+
# Route every phase through GPT-5.5 instead of Claude
|
|
106
|
+
OPENAI_API_KEY=sk-... baro --llm openai "Refactor the database layer"
|
|
70
107
|
|
|
71
|
-
#
|
|
72
|
-
|
|
73
|
-
baro --share-architect-cache "Add comprehensive test coverage"
|
|
108
|
+
# Limit parallelism (Anthropic plan tiers cap concurrency)
|
|
109
|
+
baro --parallel 3 "Add unit tests for the auth module"
|
|
74
110
|
|
|
75
|
-
#
|
|
76
|
-
baro --
|
|
111
|
+
# Dry-run first, execute later
|
|
112
|
+
baro --dry-run "Add WebSocket support"
|
|
113
|
+
baro --resume
|
|
77
114
|
|
|
78
|
-
# Self-diagnostic
|
|
115
|
+
# Self-diagnostic
|
|
79
116
|
baro --doctor
|
|
80
117
|
```
|
|
81
118
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
1. **Architect** (Opus by default, or gpt-5.5 with `--llm openai`) — reads the codebase and writes a `DecisionDocument`: the file paths, names, schemas, API shapes, and library choices every story will use.
|
|
85
|
-
2. **Planner** — decomposes the goal into a dependency DAG of stories, with the DecisionDocument pinned.
|
|
86
|
-
3. **Review** — you accept the plan, or press `r` to refine it with feedback.
|
|
87
|
-
4. **Execute** — stories run in parallel on a fresh `baro/<slug>-<id>` branch. Each story is one Claude Code subprocess (or one Mozaik-native OpenAI session).
|
|
88
|
-
5. **Critic** (per-turn) — Haiku evaluator scores each agent turn against its acceptance criteria. On a fail verdict, an inline corrective lands as the agent's next turn so it self-corrects before the next tool call.
|
|
89
|
-
6. **Sentry + Librarian** (run-wide) — Sentry flags overlapping Edit/Write tool calls; Librarian indexes one agent's Read/Grep so the next agent doesn't redo the exploration.
|
|
90
|
-
7. **Surgeon** (on terminal failure) — asks Opus for a richer replan (split / prereq / rewire) instead of dropping a failed story outright.
|
|
91
|
-
8. **Finalize** — runs the project's build verification and opens a GitHub PR with stories table, stats, time saved, and a summary of every story's commits.
|
|
92
|
-
|
|
93
|
-
## Config file
|
|
94
|
-
|
|
95
|
-
Create a `.barorc` in your project root to set defaults:
|
|
96
|
-
|
|
97
|
-
```json
|
|
98
|
-
{
|
|
99
|
-
"model": "routed",
|
|
100
|
-
"parallel": 3,
|
|
101
|
-
"timeout": 600,
|
|
102
|
-
"skipContext": false,
|
|
103
|
-
"planner": "claude"
|
|
104
|
-
}
|
|
105
|
-
```
|
|
106
|
-
|
|
107
|
-
All fields are optional. CLI flags override `.barorc`, and interactive changes on the welcome screen override both.
|
|
108
|
-
|
|
109
|
-
| Field | Values | Default |
|
|
110
|
-
|-------|--------|---------|
|
|
111
|
-
| `model` | `"routed"`, `"opus"`, `"sonnet"`, `"haiku"` | `"routed"` |
|
|
112
|
-
| `parallel` | `0` (unlimited) or any number | `0` |
|
|
113
|
-
| `timeout` | seconds per story | `600` |
|
|
114
|
-
| `skipContext` | `true` / `false` | `false` |
|
|
115
|
-
| `planner` | `"claude"`, `"openai"` | `"claude"` |
|
|
116
|
-
| `dryRun` | `true` / `false` | `false` |
|
|
117
|
-
|
|
118
|
-
## Options
|
|
119
|
-
|
|
120
|
-
```
|
|
121
|
-
baro [goal] [options]
|
|
122
|
-
|
|
123
|
-
Arguments:
|
|
124
|
-
goal Project goal (opens welcome screen if omitted)
|
|
125
|
-
|
|
126
|
-
Provider:
|
|
127
|
-
--llm <name> Provider for every phase: claude (default) or openai.
|
|
128
|
-
openai routes through Mozaik's native OpenAI runner
|
|
129
|
-
(gpt-5.x); requires OPENAI_API_KEY.
|
|
130
|
-
|
|
131
|
-
Model selection:
|
|
132
|
-
--model <name> Override ALL phases: opus, sonnet, haiku
|
|
133
|
-
--no-model-routing Equivalent to --model opus
|
|
134
|
-
--architect-model <name> Pin only the Architect phase
|
|
135
|
-
--planner-model <name> Pin only the Planner phase
|
|
136
|
-
--story-model <name> Pin every Story Agent in the run
|
|
137
|
-
--critic-model <name> Model for the Critic (default: haiku)
|
|
138
|
-
--surgeon-model <name> Model for the Surgeon LLM (default: opus)
|
|
139
|
-
|
|
140
|
-
Run shape:
|
|
141
|
-
--parallel <N> Max concurrent stories per level (0 = unlimited)
|
|
142
|
-
--timeout <seconds> Per-story timeout (default: 600)
|
|
143
|
-
--intra-level-delay <secs> Stagger story spawns within a level so Librarian
|
|
144
|
-
can broadcast first agent's findings (default: 10)
|
|
145
|
-
--quick Trivial-goal fast path — skip Architect, force
|
|
146
|
-
1-story plan, disable Critic + Surgeon
|
|
147
|
-
--dry-run Generate plan only, save to prd.json
|
|
148
|
-
--resume Resume from existing prd.json
|
|
149
|
-
--share-architect-cache EXPERIMENTAL — route DecisionDocument through
|
|
150
|
-
Claude Code's --append-system-prompt so stories
|
|
151
|
-
2..N read it from the prompt cache
|
|
152
|
-
--skip-context Skip CLAUDE.md auto-generation
|
|
153
|
-
--cwd <path> Working directory (default: current)
|
|
154
|
-
|
|
155
|
-
Observers:
|
|
156
|
-
--no-critic Disable live Critic (default: ON)
|
|
157
|
-
--no-librarian Disable cross-agent runtime memory (default: ON)
|
|
158
|
-
--no-sentry Disable file-touch conflict detector (default: ON)
|
|
159
|
-
--no-surgeon Disable Surgeon (default: ON)
|
|
160
|
-
--no-surgeon-llm Use deterministic Surgeon (skip-only) instead
|
|
161
|
-
of the LLM-driven replanner
|
|
162
|
-
|
|
163
|
-
Diagnostics:
|
|
164
|
-
--doctor Run self-diagnostic and exit
|
|
165
|
-
-h, --help Print help
|
|
166
|
-
```
|
|
167
|
-
|
|
168
|
-
### The participants (Mozaik bus)
|
|
119
|
+
Full options + `.barorc` config + per-phase model overrides: [**docs.baro.rs**](https://docs.baro.rs).
|
|
169
120
|
|
|
170
|
-
|
|
121
|
+
## How it compares
|
|
171
122
|
|
|
172
|
-
|
|
|
173
|
-
|
|
174
|
-
|
|
|
175
|
-
|
|
|
176
|
-
|
|
|
177
|
-
|
|
|
178
|
-
|
|
|
179
|
-
|
|
|
180
|
-
|
|
|
181
|
-
| `Critic` | Per-turn acceptance-criteria evaluator (default ON, `--no-critic` to disable) |
|
|
182
|
-
| `Surgeon` | Emits DAG replans when a story fails terminally (default ON, `--no-surgeon` to disable) |
|
|
183
|
-
| `Finalizer` | Runs build verification, opens the GitHub PR with stories table + stats |
|
|
184
|
-
| `Operator` | Bridges external user commands (TUI, web UI) into bus events |
|
|
185
|
-
| `Auditor` | JSONL log of every event on the bus (written to `~/.baro/runs/`) |
|
|
186
|
-
| `Cartographer` | Translates bus events into UI frames for the Rust TUI |
|
|
123
|
+
| | Single Claude Code session | DIY `Promise.all` of subprocesses | baro |
|
|
124
|
+
|---|---|---|---|
|
|
125
|
+
| **Plans the work** | you | you | Planner agent |
|
|
126
|
+
| **Pins design decisions** | implicit, drifts | n/a | Architect agent (`DecisionDocument`) |
|
|
127
|
+
| **Parallel agents** | no — one session | yes, you coordinate | yes, on Mozaik bus |
|
|
128
|
+
| **Mid-flight peer awareness** | n/a | implement yourself | Librarian broadcasts |
|
|
129
|
+
| **Replan on failure** | manual | manual | Surgeon agent |
|
|
130
|
+
| **Opens the PR** | manual | manual | Finalizer |
|
|
131
|
+
| **Adding a new behaviour** | new prompt | refactor orchestrator | new bus participant |
|
|
187
132
|
|
|
188
|
-
|
|
133
|
+
For a deeper side-by-side on a real refactor, see [baro vs Claude Code `/goal`](https://jigjoy.ai/blog/baro-vs-claude-code).
|
|
189
134
|
|
|
190
135
|
## Requirements
|
|
191
136
|
|
|
192
|
-
- [Claude CLI](https://docs.anthropic.com/en/docs/claude-cli)
|
|
193
|
-
-
|
|
194
|
-
-
|
|
137
|
+
- [Claude CLI](https://docs.anthropic.com/en/docs/claude-cli) authenticated (for `--llm claude`, the default) **or** `OPENAI_API_KEY` set (for `--llm openai`)
|
|
138
|
+
- Node.js 20+
|
|
139
|
+
- macOS (arm64/x64), Linux (x64/arm64), Windows (x64)
|
|
195
140
|
- `gh` CLI (optional, for automatic PR creation)
|
|
196
141
|
|
|
197
|
-
> **Windows note:** Windows 10+ is required. For best TUI experience, use [Windows Terminal](https://aka.ms/terminal) or another modern terminal emulator.
|
|
198
|
-
|
|
199
|
-
## Architecture
|
|
200
|
-
|
|
201
|
-
Rust binary distributed via npm. TUI built with ratatui, async execution with tokio. Each `baro` invocation spawns the bundled TypeScript [Mozaik](https://github.com/jigjoy-ai/mozaik) orchestrator as a subprocess; the orchestrator owns story execution and emits typed events into a shared `AgenticEnvironment` bus.
|
|
202
|
-
|
|
203
142
|
## Status & feedback
|
|
204
143
|
|
|
205
|
-
baro is a work in progress.
|
|
144
|
+
baro is a work in progress. If a run explodes, the audit log at `~/.baro/runs/<run-id>.jsonl` is the fastest way to get it fixed — open an [issue](https://github.com/jigjoy-ai/baro/issues) with that file attached.
|
|
206
145
|
|
|
207
|
-
|
|
146
|
+
Ideas, use cases, bug reports — Discord: [**discord.gg/dvxY9J2kWX**](https://discord.gg/dvxY9J2kWX) · Twitter: [**@lotus_sbc**](https://twitter.com/lotus_sbc)
|
|
208
147
|
|
|
209
148
|
## License
|
|
210
149
|
|
|
211
|
-
MIT
|
|
212
|
-
|
|
213
|
-
---
|
|
214
|
-
|
|
215
|
-
Made by [Lotus](https://github.com/Lotus015) from [JigJoy](https://jigjoy.ai) team
|
|
150
|
+
MIT — [JigJoy](https://jigjoy.ai/) team
|
package/dist/cli.mjs
CHANGED
|
@@ -8324,14 +8324,13 @@ var LevelCompletedItem = class extends BusEvent {
|
|
|
8324
8324
|
}
|
|
8325
8325
|
};
|
|
8326
8326
|
var StorySpawnRequestItem = class extends BusEvent {
|
|
8327
|
-
constructor(storyId, prompt, model, retries, timeoutSecs
|
|
8327
|
+
constructor(storyId, prompt, model, retries, timeoutSecs) {
|
|
8328
8328
|
super();
|
|
8329
8329
|
this.storyId = storyId;
|
|
8330
8330
|
this.prompt = prompt;
|
|
8331
8331
|
this.model = model;
|
|
8332
8332
|
this.retries = retries;
|
|
8333
8333
|
this.timeoutSecs = timeoutSecs;
|
|
8334
|
-
this.appendSystemPrompt = appendSystemPrompt;
|
|
8335
8334
|
}
|
|
8336
8335
|
type = "story_spawn_request";
|
|
8337
8336
|
toJSON() {
|
|
@@ -8341,8 +8340,7 @@ var StorySpawnRequestItem = class extends BusEvent {
|
|
|
8341
8340
|
promptLen: this.prompt.length,
|
|
8342
8341
|
model: this.model,
|
|
8343
8342
|
retries: this.retries,
|
|
8344
|
-
timeoutSecs: this.timeoutSecs
|
|
8345
|
-
appendSystemPromptLen: this.appendSystemPrompt?.length ?? 0
|
|
8343
|
+
timeoutSecs: this.timeoutSecs
|
|
8346
8344
|
};
|
|
8347
8345
|
}
|
|
8348
8346
|
};
|
|
@@ -8866,9 +8864,6 @@ var ClaudeCliParticipant = class _ClaudeCliParticipant extends BaroParticipant {
|
|
|
8866
8864
|
if (this.options.resumeSessionId) {
|
|
8867
8865
|
args.push("--resume", this.options.resumeSessionId);
|
|
8868
8866
|
}
|
|
8869
|
-
if (this.options.appendSystemPrompt && this.options.appendSystemPrompt.length > 0) {
|
|
8870
|
-
args.push("--append-system-prompt", this.options.appendSystemPrompt);
|
|
8871
|
-
}
|
|
8872
8867
|
if (this.options.extraArgs && this.options.extraArgs.length > 0) {
|
|
8873
8868
|
args.push(...this.options.extraArgs);
|
|
8874
8869
|
}
|
|
@@ -9127,8 +9122,7 @@ var StoryAgent = class extends BaroParticipant {
|
|
|
9127
9122
|
this.transition("running", `attempt ${attempt}`);
|
|
9128
9123
|
const claude = new ClaudeCliParticipant(this.spec.id, {
|
|
9129
9124
|
cwd: this.spec.cwd,
|
|
9130
|
-
model: this.spec.model
|
|
9131
|
-
appendSystemPrompt: this.spec.appendSystemPrompt
|
|
9125
|
+
model: this.spec.model
|
|
9132
9126
|
});
|
|
9133
9127
|
this.currentClaude = claude;
|
|
9134
9128
|
claude.join(this.envRef);
|
|
@@ -9488,9 +9482,7 @@ var Conductor = class extends BaroParticipant {
|
|
|
9488
9482
|
}
|
|
9489
9483
|
async requestStorySpawn(story) {
|
|
9490
9484
|
const model = this.opts.overrideModel ?? story.model ?? this.opts.defaultModel;
|
|
9491
|
-
|
|
9492
|
-
let prompt = resolved.userPrompt;
|
|
9493
|
-
const appendSystemPrompt = resolved.appendSystemPrompt;
|
|
9485
|
+
let prompt = this.resolvePrompt(story);
|
|
9494
9486
|
if (this.opts.onBeforeStoryLaunch) {
|
|
9495
9487
|
try {
|
|
9496
9488
|
const extra = await this.opts.onBeforeStoryLaunch(story.id, story);
|
|
@@ -9515,8 +9507,7 @@ ${prompt}`;
|
|
|
9515
9507
|
prompt,
|
|
9516
9508
|
model,
|
|
9517
9509
|
story.retries,
|
|
9518
|
-
this.opts.timeoutSecs
|
|
9519
|
-
appendSystemPrompt
|
|
9510
|
+
this.opts.timeoutSecs
|
|
9520
9511
|
)
|
|
9521
9512
|
);
|
|
9522
9513
|
}
|
|
@@ -9626,26 +9617,24 @@ ${prompt}`;
|
|
|
9626
9617
|
prompt = buildDefaultStoryPrompt(story);
|
|
9627
9618
|
}
|
|
9628
9619
|
const doc = this.prd?.decisionDocument;
|
|
9629
|
-
if (
|
|
9630
|
-
|
|
9631
|
-
|
|
9632
|
-
|
|
9633
|
-
|
|
9634
|
-
|
|
9635
|
-
|
|
9636
|
-
|
|
9637
|
-
|
|
9638
|
-
|
|
9639
|
-
|
|
9640
|
-
|
|
9641
|
-
|
|
9642
|
-
|
|
9643
|
-
|
|
9644
|
-
|
|
9645
|
-
|
|
9646
|
-
|
|
9647
|
-
const header = [...headerLines, trimmedDoc, "", "---", ""].join("\n");
|
|
9648
|
-
return { userPrompt: header + prompt };
|
|
9620
|
+
if (doc && doc.trim().length > 0) {
|
|
9621
|
+
const header = [
|
|
9622
|
+
"## Design spec (authoritative \u2014 already decided)",
|
|
9623
|
+
"",
|
|
9624
|
+
"The Architect made these decisions before any story started.",
|
|
9625
|
+
"Treat them as fixed: use these exact file paths, names,",
|
|
9626
|
+
"schemas, API shapes, and dependency choices. Do NOT",
|
|
9627
|
+
"improvise alternatives \u2014 your siblings are working from",
|
|
9628
|
+
"the same spec and divergence breaks the build.",
|
|
9629
|
+
"",
|
|
9630
|
+
doc.trim(),
|
|
9631
|
+
"",
|
|
9632
|
+
"---",
|
|
9633
|
+
""
|
|
9634
|
+
].join("\n");
|
|
9635
|
+
prompt = header + prompt;
|
|
9636
|
+
}
|
|
9637
|
+
return prompt;
|
|
9649
9638
|
}
|
|
9650
9639
|
emit(event) {
|
|
9651
9640
|
this.envRef?.deliverBusEvent(this, event);
|
|
@@ -11695,8 +11684,7 @@ var StoryFactory = class extends BaroParticipant {
|
|
|
11695
11684
|
cwd: this.opts.cwd,
|
|
11696
11685
|
model: claudeModel,
|
|
11697
11686
|
retries: req.retries,
|
|
11698
|
-
timeoutSecs: req.timeoutSecs
|
|
11699
|
-
appendSystemPrompt: req.appendSystemPrompt
|
|
11687
|
+
timeoutSecs: req.timeoutSecs
|
|
11700
11688
|
});
|
|
11701
11689
|
agent.join(this.envRef);
|
|
11702
11690
|
this.active.set(req.storyId, agent);
|
|
@@ -12126,7 +12114,6 @@ async function orchestrate(config) {
|
|
|
12126
12114
|
overrideModel: config.overrideModel ?? void 0,
|
|
12127
12115
|
defaultModel: config.defaultModel ?? "opus",
|
|
12128
12116
|
intraLevelDelaySecs: config.intraLevelDelaySecs,
|
|
12129
|
-
shareArchitectCache: config.shareArchitectCache ?? false,
|
|
12130
12117
|
onRunStart: useGit ? async (prd) => {
|
|
12131
12118
|
baseSha = await getHeadSha(config.cwd);
|
|
12132
12119
|
if (prd.branchName) {
|
|
@@ -12414,7 +12401,6 @@ function parseArgs(argv) {
|
|
|
12414
12401
|
withSurgeon: false,
|
|
12415
12402
|
surgeonUseLlm: false,
|
|
12416
12403
|
llm: "claude",
|
|
12417
|
-
shareArchitectCache: false,
|
|
12418
12404
|
help: false
|
|
12419
12405
|
};
|
|
12420
12406
|
for (let i = 0; i < argv.length; i++) {
|
|
@@ -12488,9 +12474,6 @@ function parseArgs(argv) {
|
|
|
12488
12474
|
args.llm = v;
|
|
12489
12475
|
break;
|
|
12490
12476
|
}
|
|
12491
|
-
case "--share-architect-cache":
|
|
12492
|
-
args.shareArchitectCache = true;
|
|
12493
|
-
break;
|
|
12494
12477
|
default:
|
|
12495
12478
|
process.stderr.write(`[cli] unknown flag: ${a}
|
|
12496
12479
|
`);
|
|
@@ -12570,8 +12553,7 @@ async function main() {
|
|
|
12570
12553
|
surgeonModel: args.surgeonModel,
|
|
12571
12554
|
intraLevelDelaySecs: args.intraLevelDelaySecs,
|
|
12572
12555
|
llm: args.llm,
|
|
12573
|
-
storyModel: args.storyModel
|
|
12574
|
-
shareArchitectCache: args.shareArchitectCache
|
|
12556
|
+
storyModel: args.storyModel
|
|
12575
12557
|
};
|
|
12576
12558
|
if (args.llm === "openai" && !process.env.OPENAI_API_KEY) {
|
|
12577
12559
|
process.stderr.write(
|