@os-eco/overstory-cli 0.6.1
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/LICENSE +21 -0
- package/README.md +381 -0
- package/agents/builder.md +137 -0
- package/agents/coordinator.md +263 -0
- package/agents/lead.md +301 -0
- package/agents/merger.md +160 -0
- package/agents/monitor.md +214 -0
- package/agents/reviewer.md +140 -0
- package/agents/scout.md +119 -0
- package/agents/supervisor.md +423 -0
- package/package.json +47 -0
- package/src/agents/checkpoint.test.ts +88 -0
- package/src/agents/checkpoint.ts +101 -0
- package/src/agents/hooks-deployer.test.ts +2040 -0
- package/src/agents/hooks-deployer.ts +607 -0
- package/src/agents/identity.test.ts +603 -0
- package/src/agents/identity.ts +384 -0
- package/src/agents/lifecycle.test.ts +196 -0
- package/src/agents/lifecycle.ts +183 -0
- package/src/agents/manifest.test.ts +746 -0
- package/src/agents/manifest.ts +354 -0
- package/src/agents/overlay.test.ts +676 -0
- package/src/agents/overlay.ts +308 -0
- package/src/beads/client.test.ts +217 -0
- package/src/beads/client.ts +202 -0
- package/src/beads/molecules.test.ts +338 -0
- package/src/beads/molecules.ts +198 -0
- package/src/commands/agents.test.ts +322 -0
- package/src/commands/agents.ts +287 -0
- package/src/commands/clean.test.ts +670 -0
- package/src/commands/clean.ts +618 -0
- package/src/commands/completions.test.ts +342 -0
- package/src/commands/completions.ts +887 -0
- package/src/commands/coordinator.test.ts +1530 -0
- package/src/commands/coordinator.ts +733 -0
- package/src/commands/costs.test.ts +1119 -0
- package/src/commands/costs.ts +564 -0
- package/src/commands/dashboard.test.ts +308 -0
- package/src/commands/dashboard.ts +838 -0
- package/src/commands/doctor.test.ts +294 -0
- package/src/commands/doctor.ts +213 -0
- package/src/commands/errors.test.ts +647 -0
- package/src/commands/errors.ts +248 -0
- package/src/commands/feed.test.ts +578 -0
- package/src/commands/feed.ts +361 -0
- package/src/commands/group.test.ts +262 -0
- package/src/commands/group.ts +511 -0
- package/src/commands/hooks.test.ts +458 -0
- package/src/commands/hooks.ts +253 -0
- package/src/commands/init.test.ts +347 -0
- package/src/commands/init.ts +650 -0
- package/src/commands/inspect.test.ts +670 -0
- package/src/commands/inspect.ts +431 -0
- package/src/commands/log.test.ts +1454 -0
- package/src/commands/log.ts +724 -0
- package/src/commands/logs.test.ts +379 -0
- package/src/commands/logs.ts +546 -0
- package/src/commands/mail.test.ts +1270 -0
- package/src/commands/mail.ts +771 -0
- package/src/commands/merge.test.ts +670 -0
- package/src/commands/merge.ts +355 -0
- package/src/commands/metrics.test.ts +444 -0
- package/src/commands/metrics.ts +143 -0
- package/src/commands/monitor.test.ts +191 -0
- package/src/commands/monitor.ts +390 -0
- package/src/commands/nudge.test.ts +230 -0
- package/src/commands/nudge.ts +372 -0
- package/src/commands/prime.test.ts +470 -0
- package/src/commands/prime.ts +381 -0
- package/src/commands/replay.test.ts +741 -0
- package/src/commands/replay.ts +360 -0
- package/src/commands/run.test.ts +431 -0
- package/src/commands/run.ts +351 -0
- package/src/commands/sling.test.ts +657 -0
- package/src/commands/sling.ts +661 -0
- package/src/commands/spec.test.ts +203 -0
- package/src/commands/spec.ts +168 -0
- package/src/commands/status.test.ts +430 -0
- package/src/commands/status.ts +398 -0
- package/src/commands/stop.test.ts +420 -0
- package/src/commands/stop.ts +151 -0
- package/src/commands/supervisor.test.ts +187 -0
- package/src/commands/supervisor.ts +535 -0
- package/src/commands/trace.test.ts +745 -0
- package/src/commands/trace.ts +325 -0
- package/src/commands/watch.test.ts +145 -0
- package/src/commands/watch.ts +247 -0
- package/src/commands/worktree.test.ts +786 -0
- package/src/commands/worktree.ts +311 -0
- package/src/config.test.ts +822 -0
- package/src/config.ts +829 -0
- package/src/doctor/agents.test.ts +454 -0
- package/src/doctor/agents.ts +396 -0
- package/src/doctor/config-check.test.ts +190 -0
- package/src/doctor/config-check.ts +183 -0
- package/src/doctor/consistency.test.ts +651 -0
- package/src/doctor/consistency.ts +294 -0
- package/src/doctor/databases.test.ts +290 -0
- package/src/doctor/databases.ts +218 -0
- package/src/doctor/dependencies.test.ts +184 -0
- package/src/doctor/dependencies.ts +175 -0
- package/src/doctor/logs.test.ts +251 -0
- package/src/doctor/logs.ts +295 -0
- package/src/doctor/merge-queue.test.ts +216 -0
- package/src/doctor/merge-queue.ts +144 -0
- package/src/doctor/structure.test.ts +291 -0
- package/src/doctor/structure.ts +198 -0
- package/src/doctor/types.ts +37 -0
- package/src/doctor/version.test.ts +136 -0
- package/src/doctor/version.ts +129 -0
- package/src/e2e/init-sling-lifecycle.test.ts +277 -0
- package/src/errors.ts +217 -0
- package/src/events/store.test.ts +660 -0
- package/src/events/store.ts +369 -0
- package/src/events/tool-filter.test.ts +330 -0
- package/src/events/tool-filter.ts +126 -0
- package/src/index.ts +316 -0
- package/src/insights/analyzer.test.ts +466 -0
- package/src/insights/analyzer.ts +203 -0
- package/src/logging/color.test.ts +142 -0
- package/src/logging/color.ts +71 -0
- package/src/logging/logger.test.ts +813 -0
- package/src/logging/logger.ts +266 -0
- package/src/logging/reporter.test.ts +259 -0
- package/src/logging/reporter.ts +109 -0
- package/src/logging/sanitizer.test.ts +190 -0
- package/src/logging/sanitizer.ts +57 -0
- package/src/mail/broadcast.test.ts +203 -0
- package/src/mail/broadcast.ts +92 -0
- package/src/mail/client.test.ts +773 -0
- package/src/mail/client.ts +223 -0
- package/src/mail/store.test.ts +705 -0
- package/src/mail/store.ts +387 -0
- package/src/merge/queue.test.ts +359 -0
- package/src/merge/queue.ts +231 -0
- package/src/merge/resolver.test.ts +1345 -0
- package/src/merge/resolver.ts +645 -0
- package/src/metrics/store.test.ts +667 -0
- package/src/metrics/store.ts +445 -0
- package/src/metrics/summary.test.ts +398 -0
- package/src/metrics/summary.ts +178 -0
- package/src/metrics/transcript.test.ts +356 -0
- package/src/metrics/transcript.ts +175 -0
- package/src/mulch/client.test.ts +671 -0
- package/src/mulch/client.ts +332 -0
- package/src/sessions/compat.test.ts +280 -0
- package/src/sessions/compat.ts +104 -0
- package/src/sessions/store.test.ts +873 -0
- package/src/sessions/store.ts +494 -0
- package/src/test-helpers.test.ts +124 -0
- package/src/test-helpers.ts +126 -0
- package/src/tracker/beads.ts +56 -0
- package/src/tracker/factory.test.ts +80 -0
- package/src/tracker/factory.ts +64 -0
- package/src/tracker/seeds.ts +182 -0
- package/src/tracker/types.ts +52 -0
- package/src/types.ts +724 -0
- package/src/watchdog/daemon.test.ts +1975 -0
- package/src/watchdog/daemon.ts +671 -0
- package/src/watchdog/health.test.ts +431 -0
- package/src/watchdog/health.ts +264 -0
- package/src/watchdog/triage.test.ts +164 -0
- package/src/watchdog/triage.ts +179 -0
- package/src/worktree/manager.test.ts +439 -0
- package/src/worktree/manager.ts +198 -0
- package/src/worktree/tmux.test.ts +1009 -0
- package/src/worktree/tmux.ts +509 -0
- package/templates/CLAUDE.md.tmpl +89 -0
- package/templates/hooks.json.tmpl +105 -0
- package/templates/overlay.md.tmpl +81 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Jaymin West
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,381 @@
|
|
|
1
|
+
# Overstory
|
|
2
|
+
|
|
3
|
+
[](https://github.com/jayminwest/overstory/actions/workflows/ci.yml)
|
|
4
|
+
[](https://opensource.org/licenses/MIT)
|
|
5
|
+
[](https://bun.sh)
|
|
6
|
+
[](https://github.com/jayminwest/overstory/releases)
|
|
7
|
+
|
|
8
|
+
Project-agnostic swarm system for Claude Code agent orchestration. Overstory turns a single Claude Code session into a multi-agent team by spawning worker agents in git worktrees via tmux, coordinating them through a custom SQLite mail system, and merging their work back with tiered conflict resolution.
|
|
9
|
+
|
|
10
|
+
> **⚠️ Warning: Agent swarms are not a universal solution.** Do not deploy Overstory without understanding the risks of multi-agent orchestration — compounding error rates, cost amplification, debugging complexity, and merge conflicts are the normal case, not edge cases. Read [STEELMAN.md](STEELMAN.md) for a full risk analysis and the [Agentic Engineering Book](https://github.com/jayminwest/agentic-engineering-book) ([web version](https://jayminwest.com/agentic-engineering-book)) before using this tool in production.
|
|
11
|
+
|
|
12
|
+
## How It Works
|
|
13
|
+
|
|
14
|
+
CLAUDE.md + hooks + the `overstory` CLI turn your Claude Code session into a multi-agent orchestrator. A persistent coordinator agent manages task decomposition and dispatch, while a mechanical watchdog daemon monitors agent health in the background.
|
|
15
|
+
|
|
16
|
+
```
|
|
17
|
+
Coordinator (persistent orchestrator at project root)
|
|
18
|
+
--> Supervisor (per-project team lead, depth 1)
|
|
19
|
+
--> Workers: Scout, Builder, Reviewer, Merger (depth 2)
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
### Agent Types
|
|
23
|
+
|
|
24
|
+
| Agent | Role | Access |
|
|
25
|
+
|-------|------|--------|
|
|
26
|
+
| **Coordinator** | Persistent orchestrator — decomposes objectives, dispatches agents, tracks task groups | Read-only |
|
|
27
|
+
| **Supervisor** | Per-project team lead — manages worker lifecycle, handles nudge/escalation | Read-only |
|
|
28
|
+
| **Scout** | Read-only exploration and research | Read-only |
|
|
29
|
+
| **Builder** | Implementation and code changes | Read-write |
|
|
30
|
+
| **Reviewer** | Validation and code review | Read-only |
|
|
31
|
+
| **Lead** | Team coordination, can spawn sub-workers | Read-write |
|
|
32
|
+
| **Merger** | Branch merge specialist | Read-write |
|
|
33
|
+
| **Monitor** | Tier 2 continuous fleet patrol — ongoing health monitoring | Read-only |
|
|
34
|
+
|
|
35
|
+
### Key Architecture
|
|
36
|
+
|
|
37
|
+
- **Agent Definitions**: Two-layer system — base `.md` files define the HOW (workflow), per-task overlays define the WHAT (task scope). Base definition content is injected into spawned agent overlays automatically.
|
|
38
|
+
- **Messaging**: Custom SQLite mail system with typed protocol — 8 message types (`worker_done`, `merge_ready`, `dispatch`, `escalation`, etc.) for structured agent coordination, plus broadcast messaging with group addresses (`@all`, `@builders`, etc.)
|
|
39
|
+
- **Worktrees**: Each agent gets an isolated git worktree — no file conflicts between agents
|
|
40
|
+
- **Merge**: FIFO merge queue (SQLite-backed) with 4-tier conflict resolution
|
|
41
|
+
- **Watchdog**: Tiered health monitoring — Tier 0 mechanical daemon (tmux/pid liveness), Tier 1 AI-assisted failure triage, Tier 2 monitor agent for continuous fleet patrol
|
|
42
|
+
- **Tool Enforcement**: PreToolUse hooks mechanically block file modifications for non-implementation agents and dangerous git operations for all agents
|
|
43
|
+
- **Task Groups**: Batch coordination with auto-close when all member issues complete
|
|
44
|
+
- **Session Lifecycle**: Checkpoint save/restore for compaction survivability, handoff orchestration for crash recovery
|
|
45
|
+
- **Token Instrumentation**: Session metrics extracted from Claude Code transcript JSONL files
|
|
46
|
+
|
|
47
|
+
## Requirements
|
|
48
|
+
|
|
49
|
+
- [Bun](https://bun.sh) (v1.0+)
|
|
50
|
+
- [Claude Code](https://docs.anthropic.com/en/docs/claude-code)
|
|
51
|
+
- git
|
|
52
|
+
- tmux
|
|
53
|
+
|
|
54
|
+
## Installation
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
# Clone the repository
|
|
58
|
+
git clone https://github.com/jayminwest/overstory.git
|
|
59
|
+
cd overstory
|
|
60
|
+
|
|
61
|
+
# Install dev dependencies
|
|
62
|
+
bun install
|
|
63
|
+
|
|
64
|
+
# Link the CLI globally
|
|
65
|
+
bun link
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## Quick Start
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
# Initialize overstory in your project
|
|
72
|
+
cd your-project
|
|
73
|
+
overstory init
|
|
74
|
+
|
|
75
|
+
# Install hooks into .claude/settings.local.json
|
|
76
|
+
overstory hooks install
|
|
77
|
+
|
|
78
|
+
# Start a coordinator (persistent orchestrator)
|
|
79
|
+
overstory coordinator start
|
|
80
|
+
|
|
81
|
+
# Or spawn individual worker agents
|
|
82
|
+
overstory sling <task-id> --capability builder --name my-builder
|
|
83
|
+
|
|
84
|
+
# Check agent status
|
|
85
|
+
overstory status
|
|
86
|
+
|
|
87
|
+
# Live dashboard for monitoring the fleet
|
|
88
|
+
overstory dashboard
|
|
89
|
+
|
|
90
|
+
# Nudge a stalled agent
|
|
91
|
+
overstory nudge <agent-name>
|
|
92
|
+
|
|
93
|
+
# Check mail from agents
|
|
94
|
+
overstory mail check --inject
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
## CLI Reference
|
|
98
|
+
|
|
99
|
+
```
|
|
100
|
+
overstory agents discover Discover agents by capability/state/parent
|
|
101
|
+
--capability <type> Filter by capability type
|
|
102
|
+
--state <state> Filter by agent state
|
|
103
|
+
--parent <name> Filter by parent agent
|
|
104
|
+
--json JSON output
|
|
105
|
+
|
|
106
|
+
overstory init Initialize .overstory/ in current project
|
|
107
|
+
(deploys agent definitions automatically)
|
|
108
|
+
|
|
109
|
+
overstory coordinator start Start persistent coordinator agent
|
|
110
|
+
--attach / --no-attach TTY-aware tmux attach (default: auto)
|
|
111
|
+
--watchdog Auto-start watchdog daemon with coordinator
|
|
112
|
+
--monitor Auto-start Tier 2 monitor agent
|
|
113
|
+
overstory coordinator stop Stop coordinator
|
|
114
|
+
overstory coordinator status Show coordinator state
|
|
115
|
+
|
|
116
|
+
overstory supervisor start Start per-project supervisor agent
|
|
117
|
+
--attach / --no-attach TTY-aware tmux attach (default: auto)
|
|
118
|
+
overstory supervisor stop Stop supervisor
|
|
119
|
+
overstory supervisor status Show supervisor state
|
|
120
|
+
|
|
121
|
+
overstory sling <task-id> Spawn a worker agent
|
|
122
|
+
--capability <type> builder | scout | reviewer | lead | merger
|
|
123
|
+
| coordinator | supervisor | monitor
|
|
124
|
+
--name <name> Unique agent name
|
|
125
|
+
--spec <path> Path to task spec file
|
|
126
|
+
--files <f1,f2,...> Exclusive file scope
|
|
127
|
+
--parent <agent-name> Parent (for hierarchy tracking)
|
|
128
|
+
--depth <n> Current hierarchy depth
|
|
129
|
+
--skip-scout Skip scout phase (passed to lead overlay)
|
|
130
|
+
--json JSON output
|
|
131
|
+
|
|
132
|
+
overstory stop <agent-name> Terminate a running agent
|
|
133
|
+
--clean-worktree Remove the agent's worktree (best-effort)
|
|
134
|
+
--json JSON output
|
|
135
|
+
|
|
136
|
+
overstory prime Load context for orchestrator/agent
|
|
137
|
+
--agent <name> Per-agent priming
|
|
138
|
+
--compact Restore from checkpoint (compaction)
|
|
139
|
+
|
|
140
|
+
overstory status Show all active agents, worktrees, tracker state
|
|
141
|
+
--json JSON output
|
|
142
|
+
--verbose Show detailed agent info
|
|
143
|
+
--all Show all runs (default: current run only)
|
|
144
|
+
|
|
145
|
+
overstory dashboard Live TUI dashboard for agent monitoring
|
|
146
|
+
--interval <ms> Refresh interval (default: 2000)
|
|
147
|
+
--all Show all runs (default: current run only)
|
|
148
|
+
|
|
149
|
+
overstory hooks install Install orchestrator hooks to .claude/settings.local.json
|
|
150
|
+
--force Overwrite existing hooks
|
|
151
|
+
overstory hooks uninstall Remove orchestrator hooks
|
|
152
|
+
overstory hooks status Check if hooks are installed
|
|
153
|
+
|
|
154
|
+
overstory mail send Send a message
|
|
155
|
+
--to <agent> --subject <text> --body <text>
|
|
156
|
+
--to @all | @builders | @scouts ... Broadcast to group addresses
|
|
157
|
+
--type <status|question|result|error>
|
|
158
|
+
--priority <low|normal|high|urgent> (urgent/high auto-nudges recipient)
|
|
159
|
+
|
|
160
|
+
overstory mail check Check inbox (unread messages)
|
|
161
|
+
--agent <name> --inject --json
|
|
162
|
+
--debounce <ms> Skip if checked within window
|
|
163
|
+
|
|
164
|
+
overstory mail list List messages with filters
|
|
165
|
+
--from <name> --to <name> --unread
|
|
166
|
+
|
|
167
|
+
overstory mail read <id> Mark message as read
|
|
168
|
+
overstory mail reply <id> --body <text> Reply in same thread
|
|
169
|
+
|
|
170
|
+
overstory nudge <agent> [message] Send a text nudge to an agent
|
|
171
|
+
--from <name> Sender name (default: orchestrator)
|
|
172
|
+
--force Skip debounce check
|
|
173
|
+
--json JSON output
|
|
174
|
+
|
|
175
|
+
overstory group create <name> Create a task group for batch tracking
|
|
176
|
+
overstory group status <name> Show group progress
|
|
177
|
+
overstory group add <name> <issue-id> Add issue to group
|
|
178
|
+
overstory group list List all groups
|
|
179
|
+
|
|
180
|
+
overstory merge Merge agent branches into canonical
|
|
181
|
+
--branch <name> Specific branch
|
|
182
|
+
--all All completed branches
|
|
183
|
+
--into <branch> Target branch (default: session-branch.txt > canonicalBranch)
|
|
184
|
+
--dry-run Check for conflicts only
|
|
185
|
+
|
|
186
|
+
overstory worktree list List worktrees with status
|
|
187
|
+
overstory worktree clean Remove completed worktrees
|
|
188
|
+
--completed Only finished agents
|
|
189
|
+
--all Force remove all
|
|
190
|
+
--force Delete even if branches are unmerged
|
|
191
|
+
|
|
192
|
+
overstory monitor start Start Tier 2 monitor agent
|
|
193
|
+
overstory monitor stop Stop monitor agent
|
|
194
|
+
overstory monitor status Show monitor state
|
|
195
|
+
|
|
196
|
+
overstory log <event> Log a hook event
|
|
197
|
+
overstory watch Start watchdog daemon (Tier 0)
|
|
198
|
+
--interval <ms> Health check interval
|
|
199
|
+
--background Run as background process
|
|
200
|
+
overstory run list List orchestration runs
|
|
201
|
+
overstory run show <id> Show run details
|
|
202
|
+
overstory run complete <id> Mark a run complete
|
|
203
|
+
|
|
204
|
+
overstory trace View agent/bead timeline
|
|
205
|
+
--agent <name> Filter by agent
|
|
206
|
+
--run <id> Filter by run
|
|
207
|
+
|
|
208
|
+
overstory clean Clean up worktrees, sessions, artifacts
|
|
209
|
+
--completed Only finished agents
|
|
210
|
+
--all Force remove all
|
|
211
|
+
--run <id> Clean a specific run
|
|
212
|
+
|
|
213
|
+
overstory doctor Run health checks on overstory setup
|
|
214
|
+
--json JSON output
|
|
215
|
+
--category <name> Run a specific check category only
|
|
216
|
+
|
|
217
|
+
overstory inspect <agent> Deep per-agent inspection
|
|
218
|
+
--json JSON output
|
|
219
|
+
--follow Polling mode (refreshes periodically)
|
|
220
|
+
--interval <ms> Refresh interval for --follow
|
|
221
|
+
--no-tmux Skip tmux capture
|
|
222
|
+
--limit <n> Limit events shown
|
|
223
|
+
|
|
224
|
+
overstory spec write <bead-id> Write a task specification
|
|
225
|
+
--body <content> Spec content (or pipe via stdin)
|
|
226
|
+
|
|
227
|
+
overstory errors Aggregated error view across agents
|
|
228
|
+
--agent <name> Filter by agent
|
|
229
|
+
--run <id> Filter by run
|
|
230
|
+
--since <ts> --until <ts> Time range filter
|
|
231
|
+
--limit <n> --json
|
|
232
|
+
|
|
233
|
+
overstory replay Interleaved chronological replay
|
|
234
|
+
--run <id> Filter by run
|
|
235
|
+
--agent <name> Filter by agent(s)
|
|
236
|
+
--since <ts> --until <ts> Time range filter
|
|
237
|
+
--limit <n> --json
|
|
238
|
+
|
|
239
|
+
overstory feed [options] Unified real-time event stream across agents
|
|
240
|
+
--follow, -f Continuously poll for new events
|
|
241
|
+
--interval <ms> Polling interval (default: 2000)
|
|
242
|
+
--agent <name> --run <id> Filter by agent or run
|
|
243
|
+
--json JSON output
|
|
244
|
+
|
|
245
|
+
overstory logs [options] Query NDJSON logs across agents
|
|
246
|
+
--agent <name> Filter by agent
|
|
247
|
+
--level <level> Filter by log level (debug|info|warn|error)
|
|
248
|
+
--since <ts> --until <ts> Time range filter
|
|
249
|
+
--follow Tail logs in real time
|
|
250
|
+
--json JSON output
|
|
251
|
+
|
|
252
|
+
overstory costs Token/cost analysis and breakdown
|
|
253
|
+
--live Show real-time token usage for active agents
|
|
254
|
+
--self Show cost for current orchestrator session
|
|
255
|
+
--agent <name> Filter by agent
|
|
256
|
+
--run <id> Filter by run
|
|
257
|
+
--by-capability Group by capability type
|
|
258
|
+
--last <n> --json
|
|
259
|
+
|
|
260
|
+
overstory metrics Show session metrics
|
|
261
|
+
--last <n> Last N sessions
|
|
262
|
+
--json JSON output
|
|
263
|
+
|
|
264
|
+
Global Flags:
|
|
265
|
+
--quiet, -q Suppress non-error output
|
|
266
|
+
--completions <shell> Generate shell completions (bash, zsh, fish)
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
## Tech Stack
|
|
270
|
+
|
|
271
|
+
- **Runtime**: Bun (TypeScript directly, no build step)
|
|
272
|
+
- **Dependencies**: Zero runtime dependencies — only Bun built-in APIs
|
|
273
|
+
- **Database**: SQLite via `bun:sqlite` (WAL mode for concurrent access)
|
|
274
|
+
- **Linting**: Biome (formatter + linter)
|
|
275
|
+
- **Testing**: `bun test` (2087 tests across 75 files, colocated with source)
|
|
276
|
+
- **External CLIs**: `bd` (beads) or `sd` (seeds), `mulch`, `git`, `tmux` — invoked as subprocesses
|
|
277
|
+
|
|
278
|
+
## Development
|
|
279
|
+
|
|
280
|
+
```bash
|
|
281
|
+
# Run tests (2087 tests across 75 files)
|
|
282
|
+
bun test
|
|
283
|
+
|
|
284
|
+
# Run a single test
|
|
285
|
+
bun test src/config.test.ts
|
|
286
|
+
|
|
287
|
+
# Lint + format check
|
|
288
|
+
biome check .
|
|
289
|
+
|
|
290
|
+
# Type check
|
|
291
|
+
tsc --noEmit
|
|
292
|
+
|
|
293
|
+
# All quality gates
|
|
294
|
+
bun test && biome check . && tsc --noEmit
|
|
295
|
+
```
|
|
296
|
+
|
|
297
|
+
### Versioning
|
|
298
|
+
|
|
299
|
+
Version is maintained in two places that must stay in sync:
|
|
300
|
+
|
|
301
|
+
1. `package.json` — `"version"` field
|
|
302
|
+
2. `src/index.ts` — `VERSION` constant
|
|
303
|
+
|
|
304
|
+
Use the bump script to update both:
|
|
305
|
+
|
|
306
|
+
```bash
|
|
307
|
+
bun run version:bump <major|minor|patch>
|
|
308
|
+
```
|
|
309
|
+
|
|
310
|
+
Git tags are created automatically by GitHub Actions when a version bump is pushed to `main`.
|
|
311
|
+
|
|
312
|
+
## Project Structure
|
|
313
|
+
|
|
314
|
+
```
|
|
315
|
+
overstory/
|
|
316
|
+
src/
|
|
317
|
+
index.ts CLI entry point (command router)
|
|
318
|
+
types.ts Shared types and interfaces
|
|
319
|
+
config.ts Config loader + validation
|
|
320
|
+
errors.ts Custom error types
|
|
321
|
+
commands/ One file per CLI subcommand (30 commands)
|
|
322
|
+
agents.ts Agent discovery and querying
|
|
323
|
+
coordinator.ts Persistent orchestrator lifecycle
|
|
324
|
+
supervisor.ts Team lead management
|
|
325
|
+
dashboard.ts Live TUI dashboard (ANSI, zero deps)
|
|
326
|
+
hooks.ts Orchestrator hooks management
|
|
327
|
+
sling.ts Agent spawning
|
|
328
|
+
group.ts Task group batch tracking
|
|
329
|
+
nudge.ts Agent nudging
|
|
330
|
+
mail.ts Inter-agent messaging
|
|
331
|
+
monitor.ts Tier 2 monitor management
|
|
332
|
+
merge.ts Branch merging
|
|
333
|
+
status.ts Fleet status overview
|
|
334
|
+
prime.ts Context priming
|
|
335
|
+
init.ts Project initialization
|
|
336
|
+
worktree.ts Worktree management
|
|
337
|
+
watch.ts Watchdog daemon
|
|
338
|
+
log.ts Hook event logging
|
|
339
|
+
logs.ts NDJSON log query
|
|
340
|
+
feed.ts Unified real-time event stream
|
|
341
|
+
run.ts Orchestration run lifecycle
|
|
342
|
+
trace.ts Agent/bead timeline viewing
|
|
343
|
+
clean.ts Worktree/session cleanup
|
|
344
|
+
doctor.ts Health check runner (9 check modules)
|
|
345
|
+
inspect.ts Deep per-agent inspection
|
|
346
|
+
spec.ts Task spec management
|
|
347
|
+
errors.ts Aggregated error view
|
|
348
|
+
replay.ts Interleaved event replay
|
|
349
|
+
stop.ts Agent termination
|
|
350
|
+
costs.ts Token/cost analysis
|
|
351
|
+
metrics.ts Session metrics
|
|
352
|
+
completions.ts Shell completion generation (bash/zsh/fish)
|
|
353
|
+
agents/ Agent lifecycle management
|
|
354
|
+
manifest.ts Agent registry (load + query)
|
|
355
|
+
overlay.ts Dynamic CLAUDE.md overlay generator
|
|
356
|
+
identity.ts Persistent agent identity (CVs)
|
|
357
|
+
checkpoint.ts Session checkpoint save/restore
|
|
358
|
+
lifecycle.ts Handoff orchestration
|
|
359
|
+
hooks-deployer.ts Deploy hooks + tool enforcement
|
|
360
|
+
worktree/ Git worktree + tmux management
|
|
361
|
+
mail/ SQLite mail system (typed protocol, broadcast)
|
|
362
|
+
merge/ FIFO queue + conflict resolution
|
|
363
|
+
watchdog/ Tiered health monitoring (daemon, triage, health)
|
|
364
|
+
logging/ Multi-format logger + sanitizer + reporter + color control
|
|
365
|
+
metrics/ SQLite metrics + transcript parsing
|
|
366
|
+
doctor/ Health check modules (9 checks)
|
|
367
|
+
insights/ Session insight analyzer for auto-expertise
|
|
368
|
+
tracker/ Pluggable task tracker (beads + seeds backends)
|
|
369
|
+
mulch/ mulch CLI wrapper
|
|
370
|
+
e2e/ End-to-end lifecycle tests
|
|
371
|
+
agents/ Base agent definitions (.md, 8 roles)
|
|
372
|
+
templates/ Templates for overlays and hooks
|
|
373
|
+
```
|
|
374
|
+
|
|
375
|
+
## License
|
|
376
|
+
|
|
377
|
+
MIT
|
|
378
|
+
|
|
379
|
+
---
|
|
380
|
+
|
|
381
|
+
Inspired by: https://github.com/steveyegge/gastown/
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
## propulsion-principle
|
|
2
|
+
|
|
3
|
+
Read your assignment. Execute immediately. Do not ask for confirmation, do not propose a plan and wait for approval, do not summarize back what you were told. Start working within your first tool call.
|
|
4
|
+
|
|
5
|
+
## cost-awareness
|
|
6
|
+
|
|
7
|
+
Every mail message and every tool call costs tokens. Be concise in communications -- state what was done, what the outcome is, any caveats. Do not send multiple small status messages when one summary will do.
|
|
8
|
+
|
|
9
|
+
## failure-modes
|
|
10
|
+
|
|
11
|
+
These are named failures. If you catch yourself doing any of these, stop and correct immediately.
|
|
12
|
+
|
|
13
|
+
- **PATH_BOUNDARY_VIOLATION** -- Writing to any file outside your worktree directory. All writes must target files within your assigned worktree, never the canonical repo root.
|
|
14
|
+
- **FILE_SCOPE_VIOLATION** -- Editing or writing to a file not listed in your FILE_SCOPE. Read any file for context, but only modify scoped files.
|
|
15
|
+
- **CANONICAL_BRANCH_WRITE** -- Committing to or pushing to main/develop/canonical branch. You commit to your worktree branch only.
|
|
16
|
+
- **SILENT_FAILURE** -- Encountering an error (test failure, lint failure, blocked dependency) and not reporting it via mail. Every error must be communicated to your parent with `--type error`.
|
|
17
|
+
- **INCOMPLETE_CLOSE** -- Running `{{TRACKER_CLI}} close` without first passing quality gates (`bun test`, `bun run lint`, `bun run typecheck`) and sending a result mail to your parent.
|
|
18
|
+
- **MISSING_WORKER_DONE** -- Closing a bead issue without first sending `worker_done` mail to parent. The supervisor relies on this signal to verify branches and initiate the merge pipeline.
|
|
19
|
+
- **MISSING_MULCH_RECORD** -- Closing without recording mulch learnings. Every implementation session produces insights (conventions discovered, patterns applied, failures encountered). Skipping `mulch record` loses knowledge for future agents.
|
|
20
|
+
|
|
21
|
+
## overlay
|
|
22
|
+
|
|
23
|
+
Your task-specific context (task ID, file scope, spec path, branch name, parent agent) is in `.claude/CLAUDE.md` in your worktree. That file is generated by `overstory sling` and tells you WHAT to work on. This file tells you HOW to work.
|
|
24
|
+
|
|
25
|
+
## constraints
|
|
26
|
+
|
|
27
|
+
- **WORKTREE ISOLATION.** All file writes MUST target your worktree directory (specified in your overlay as the Worktree path). Never write to the canonical repo root. If your cwd is not your worktree, use absolute paths starting with your worktree path.
|
|
28
|
+
- **Only modify files in your FILE_SCOPE.** Your overlay lists exactly which files you own. Do not touch anything else.
|
|
29
|
+
- **Never push to the canonical branch** (main/develop). You commit to your worktree branch only. Merging is handled by the coordinator or a merger agent.
|
|
30
|
+
- **Never run `git push`** -- your branch lives in the local worktree. The merge process handles integration.
|
|
31
|
+
- **Never spawn sub-workers.** You are a leaf node. If you need something decomposed, ask your parent via mail.
|
|
32
|
+
- **Run quality gates before closing.** Do not report completion unless `bun test`, `bun run lint`, and `bun run typecheck` pass.
|
|
33
|
+
- If tests fail, fix them. If you cannot fix them, report the failure via mail with `--type error`.
|
|
34
|
+
|
|
35
|
+
## communication-protocol
|
|
36
|
+
|
|
37
|
+
- Send `status` messages for progress updates on long tasks.
|
|
38
|
+
- Send `question` messages when you need clarification from your parent:
|
|
39
|
+
```bash
|
|
40
|
+
overstory mail send --to <parent> --subject "Question: <topic>" \
|
|
41
|
+
--body "<your question>" --type question
|
|
42
|
+
```
|
|
43
|
+
- Send `error` messages when something is broken:
|
|
44
|
+
```bash
|
|
45
|
+
overstory mail send --to <parent> --subject "Error: <topic>" \
|
|
46
|
+
--body "<error details, stack traces, what you tried>" --type error --priority high
|
|
47
|
+
```
|
|
48
|
+
- Always close your {{TRACKER_NAME}} issue when done, even if the result is partial. Your `{{TRACKER_CLI}} close` reason should describe what was accomplished.
|
|
49
|
+
|
|
50
|
+
## completion-protocol
|
|
51
|
+
|
|
52
|
+
1. Run `bun test` -- all tests must pass.
|
|
53
|
+
2. Run `bun run lint` -- lint and formatting must be clean.
|
|
54
|
+
3. Run `bun run typecheck` -- no TypeScript errors.
|
|
55
|
+
4. Commit your scoped files to your worktree branch: `git add <files> && git commit -m "<summary>"`.
|
|
56
|
+
5. **Record mulch learnings** -- review your work for insights worth preserving (conventions discovered, patterns applied, failures encountered, decisions made) and record them with outcome data:
|
|
57
|
+
```bash
|
|
58
|
+
mulch record <domain> --type <convention|pattern|failure|decision> --description "..." \
|
|
59
|
+
--outcome-status success --outcome-agent $OVERSTORY_AGENT_NAME
|
|
60
|
+
```
|
|
61
|
+
This is a required gate, not optional. Every implementation session produces learnings. If you truly have nothing to record, note that explicitly in your result mail.
|
|
62
|
+
6. Send `worker_done` mail to your parent with structured payload:
|
|
63
|
+
```bash
|
|
64
|
+
overstory mail send --to <parent> --subject "Worker done: <task-id>" \
|
|
65
|
+
--body "Completed implementation for <task-id>. Quality gates passed." \
|
|
66
|
+
--type worker_done --agent $OVERSTORY_AGENT_NAME
|
|
67
|
+
```
|
|
68
|
+
7. Run `{{TRACKER_CLI}} close <task-id> --reason "<summary of implementation>"`.
|
|
69
|
+
8. Exit. Do NOT idle, wait for instructions, or continue working. Your task is complete.
|
|
70
|
+
|
|
71
|
+
## intro
|
|
72
|
+
|
|
73
|
+
# Builder Agent
|
|
74
|
+
|
|
75
|
+
You are a **builder agent** in the overstory swarm system. Your job is to implement changes according to a spec. You write code, run tests, and deliver working software.
|
|
76
|
+
|
|
77
|
+
## role
|
|
78
|
+
|
|
79
|
+
You are an implementation specialist. Given a spec and a set of files you own, you build the thing. You write clean, tested code that passes quality gates. You work within your file scope and commit to your worktree branch only.
|
|
80
|
+
|
|
81
|
+
## capabilities
|
|
82
|
+
|
|
83
|
+
### Tools Available
|
|
84
|
+
- **Read** -- read any file in the codebase
|
|
85
|
+
- **Write** -- create new files (within your FILE_SCOPE only)
|
|
86
|
+
- **Edit** -- modify existing files (within your FILE_SCOPE only)
|
|
87
|
+
- **Glob** -- find files by name pattern
|
|
88
|
+
- **Grep** -- search file contents with regex
|
|
89
|
+
- **Bash:**
|
|
90
|
+
- `git add`, `git commit`, `git diff`, `git log`, `git status`
|
|
91
|
+
- `bun test` (run tests)
|
|
92
|
+
- `bun run lint` (lint and format check via biome)
|
|
93
|
+
- `bun run biome check --write` (auto-fix lint/format issues)
|
|
94
|
+
- `bun run typecheck` (type checking via tsc)
|
|
95
|
+
- `{{TRACKER_CLI}} show`, `{{TRACKER_CLI}} close` ({{TRACKER_NAME}} task management)
|
|
96
|
+
- `mulch prime`, `mulch record`, `mulch query` (expertise)
|
|
97
|
+
- `overstory mail send`, `overstory mail check` (communication)
|
|
98
|
+
|
|
99
|
+
### Communication
|
|
100
|
+
- **Send mail:** `overstory mail send --to <recipient> --subject "<subject>" --body "<body>" --type <status|result|question|error>`
|
|
101
|
+
- **Check mail:** `overstory mail check`
|
|
102
|
+
- **Your agent name** is set via `$OVERSTORY_AGENT_NAME` (provided in your overlay)
|
|
103
|
+
|
|
104
|
+
### Expertise
|
|
105
|
+
- **Load context:** `mulch prime [domain]` to load domain expertise before implementing
|
|
106
|
+
- **Record patterns:** `mulch record <domain>` to capture useful patterns you discover
|
|
107
|
+
|
|
108
|
+
## workflow
|
|
109
|
+
|
|
110
|
+
1. **Read your overlay** at `.claude/CLAUDE.md` in your worktree. This contains your task ID, spec path, file scope, branch name, and agent name.
|
|
111
|
+
2. **Read the task spec** at the path specified in your overlay. Understand what needs to be built.
|
|
112
|
+
3. **Load expertise** via `mulch prime [domain]` for domains listed in your overlay. Apply existing patterns and conventions.
|
|
113
|
+
4. **Implement the changes:**
|
|
114
|
+
- Only modify files listed in your FILE_SCOPE (from the overlay).
|
|
115
|
+
- You may read any file for context, but only write to scoped files.
|
|
116
|
+
- Follow project conventions (check existing code for patterns).
|
|
117
|
+
- Write tests alongside implementation.
|
|
118
|
+
5. **Run quality gates:**
|
|
119
|
+
```bash
|
|
120
|
+
bun test # All tests must pass
|
|
121
|
+
bun run lint # Lint and format must be clean
|
|
122
|
+
bun run typecheck # No TypeScript errors
|
|
123
|
+
```
|
|
124
|
+
6. **Commit your work** to your worktree branch:
|
|
125
|
+
```bash
|
|
126
|
+
git add <your-scoped-files>
|
|
127
|
+
git commit -m "<concise description of what you built>"
|
|
128
|
+
```
|
|
129
|
+
7. **Report completion:**
|
|
130
|
+
```bash
|
|
131
|
+
{{TRACKER_CLI}} close <task-id> --reason "<summary of implementation>"
|
|
132
|
+
```
|
|
133
|
+
8. **Send result mail** if your parent or coordinator needs details:
|
|
134
|
+
```bash
|
|
135
|
+
overstory mail send --to <parent> --subject "Build complete: <topic>" \
|
|
136
|
+
--body "<what was built, tests passing, any notes>" --type result
|
|
137
|
+
```
|