@katyella/legio 0.1.0 → 0.1.2
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/CHANGELOG.md +113 -389
- package/README.md +45 -466
- package/agents/builder.md +5 -15
- package/agents/cto.md +2 -2
- package/agents/gateway.md +23 -0
- package/agents/lead.md +6 -7
- package/agents/merger.md +5 -14
- package/agents/reviewer.md +6 -14
- package/agents/scout.md +3 -3
- package/package.json +1 -1
- package/src/agents/overlay.test.ts +9 -10
- package/src/agents/overlay.ts +35 -17
- package/src/commands/gateway.test.ts +60 -0
- package/src/commands/gateway.ts +6 -2
- package/src/commands/init.test.ts +157 -1
- package/src/commands/init.ts +86 -1
- package/src/commands/sling.ts +92 -38
- package/src/commands/worktree.ts +8 -3
- package/src/config.test.ts +3 -3
- package/src/config.ts +0 -1
- package/src/doctor/config-check.test.ts +68 -1
- package/src/doctor/config-check.ts +54 -0
- package/src/doctor/dependencies.ts +17 -4
- package/src/index.ts +1 -1
- package/src/server/routes.ts +1 -1
- package/templates/CLAUDE.md.tmpl +0 -89
package/CHANGELOG.md
CHANGED
|
@@ -7,416 +7,140 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
-
## [0.
|
|
10
|
+
## [0.1.2] - 2026-02-27
|
|
11
11
|
|
|
12
12
|
### Added
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
- `
|
|
16
|
-
|
|
17
|
-
#### Gateway & Chat System
|
|
18
|
-
- **Gateway chat integration** — `gateway-chat.js` component, gateway chat API persistence (POST/GET `/api/gateway/chat`), dashboard relay workflow
|
|
19
|
-
- **Coordinator relay architecture** — push architecture for coordinator→gateway→human chat relay
|
|
20
|
-
- **Chat persistence** — `CoordinatorChat` standalone component with persistent history, coordinator chat persistence API, `agents/:name/chat` routes, coordinator/chat migrated from `chat.db` to `mail.db` for unified messaging
|
|
21
|
-
- **Unified chat timeline** — single chronological timeline for coordinator chat via `GET /api/chat/unified/history`
|
|
22
|
-
- **Chat history polling** — history polling added to `chat.js` + e2e chat-flow tests
|
|
23
|
-
- **Agent conversations in ChatView** — sidebar and input for per-agent conversations in conversation mode
|
|
24
|
-
- **Server-side coordinator response capture** — via tmux polling (`captureCoordinatorResponse` fire-and-forget pattern)
|
|
25
|
-
- **TerminalPanel extraction** — standalone component extracted from `coordinator-chat.js` with diff-based streaming and loading indicator
|
|
26
|
-
|
|
27
|
-
#### Dashboard & Frontend
|
|
28
|
-
- **Ideas CRUD API** — replaced strategy routes with full ideas CRUD (`GET/POST /api/ideas`, `PUT/DELETE /api/ideas/:id`, `POST /api/ideas/:id/dispatch`)
|
|
29
|
-
- **MailFeed in dashboard** — replaced MergeQueue widget with MailFeed in sidebar; click-to-expand items, `audience=human` messages hidden, `Cache-Control: no-cache`
|
|
30
|
-
- **MailFeed type filter chips** — filter by message type in dashboard MailFeed
|
|
31
|
-
- **Hierarchical agent roster** — `buildAgentHierarchy()` returns depth-annotated list with lead emoji per depth level
|
|
32
|
-
- **Collapsible cost sections** — Cost by Agent and Detailed Breakdown sections in CostsView
|
|
33
|
-
- **TaskDetailView** — with Overview/Agents/Communication tabs
|
|
34
|
-
- **Clickable closed tasks** — closed tasks now navigate to TaskDetailView in Issues view
|
|
35
|
-
|
|
36
|
-
#### Provider & Model Configuration
|
|
37
|
-
- **Provider env var threading** — `collectProviderEnv()` helper, `ModelAlias`/`ModelRef`/`ProviderConfig` types, provider env vars threaded through all 4 agent spawn sites
|
|
38
|
-
|
|
39
|
-
#### Agent & Swarm Infrastructure
|
|
40
|
-
- **Root-user guard** — blocks all spawn/start commands when running as root
|
|
41
|
-
- **Unmerged branch safety** — `isBranchMerged()` check in `removeWorktree()` prevents accidental data loss
|
|
42
|
-
- **sendKeys improvements** — error differentiation, `capturePaneContent`, `waitForTuiReady`; replaced hardcoded 3s sleeps
|
|
43
|
-
- **Mulch domain inference** — `inferDomainsFromFiles()` integrated into `legio sling` for automatic expertise priming
|
|
44
|
-
- **Universal remote-block guard** — PreToolUse hook blocks all git push; mulch diff PostToolUse hook added to template
|
|
45
|
-
- **Transcript sync** — `extractAssistantText`/`parseTranscriptTexts` with line-offset watermark; syncs to `chat.db` on session-end
|
|
46
|
-
- **Run ID in metrics** — `run_id` column in `metrics.db` + `getSessionsByRun()` for per-run cost queries
|
|
47
|
-
- **Hook enforcement** — block AskUserQuestion, EnterPlanMode, EnterWorktree for all agents via PreToolUse hooks
|
|
48
|
-
|
|
49
|
-
#### Testing
|
|
50
|
-
- 2384 tests across 85 files
|
|
51
|
-
|
|
52
|
-
### Changed
|
|
53
|
-
- **Dashboard sidebar** — MailFeed replaced MergeQueue widget
|
|
54
|
-
- **Strategy routes → Ideas CRUD API** — `/api/strategy` endpoints replaced with `/api/ideas` CRUD
|
|
55
|
-
- **Chat architecture** — coordinator/chat migrated from `chat.db` to `mail.db` for unified messaging across all agent types
|
|
56
|
-
- **Sling dispatch ordering** — write dispatch mail to mail.db before tmux session creation to fix race condition
|
|
57
|
-
|
|
58
|
-
### Fixed
|
|
59
|
-
- **Server not stopping on `legio down`** — PID mismatch fix
|
|
60
|
-
- **Auto-scroll** — corrected `useEffect` dep array and used `requestAnimationFrame`
|
|
61
|
-
- **Transcript-sync polling and thinking timeout** — in coordinator-chat.js
|
|
62
|
-
- **Token stat card** — split Total Tokens into Input/Output and Cache columns
|
|
63
|
-
- **Bidirectional unified chat history** — query by `from='human'` and `to='human'` separately; + transcript-sync route
|
|
64
|
-
- **MODEL_PRICING** — updated pricing for Opus 4.5+/4.6 and Haiku 4.5
|
|
65
|
-
- **README inaccuracies** — corrected agent types table, views, API routes, deps, scripts
|
|
66
|
-
- **Bidirectional chat history** — fixed for both coordinator and `agents/:name/chat` endpoints
|
|
67
|
-
- **Daemon spawn env** — strip `__LEGIO_TSX_LOADED` from child env; hardened bin shim for node_modules
|
|
68
|
-
- **captureCoordinatorResponse removal** — removed polling approach along with `diffCaptureServer`
|
|
69
|
-
- **sendKeys** — split literal text and Enter into separate tmux `send-keys` calls
|
|
70
|
-
- **Terminal capture** — shows full pane capture when expanded but not in thinking state
|
|
71
|
-
- **SQLite UTC timestamps** — normalize by appending `Z` suffix in `mapHistoryMessage`
|
|
72
|
-
- **Chat target switching bugs** — stale target state fixed in coordinator-chat.js
|
|
73
|
-
- **Gateway premature completion** — added `gateway` to `PERSISTENT_CAPABILITIES` list
|
|
74
|
-
- **Agent start hanging via API** — prevent gateway/coordinator/supervisor start from hanging on API routes
|
|
75
|
-
- **Metrics time-filtering** — removed erroneous `OR completed_at IS NULL` predicate
|
|
76
|
-
- **Zombie reconciliation** — removed `updateLastActivity` from coordinator and gateway to stop false-positive zombie resets
|
|
77
|
-
- **Cache tokens** — included in CostsView total tokens stat card
|
|
78
|
-
- **Zombie recovery** — `getByRunIncludeOrphans()` added to `SessionStore` for cross-run session lookup
|
|
79
|
-
- **Gateway-chat.js enter lag** — move setInput(empty) and setThinking(true) before await postJson to eliminate input clearing lag
|
|
80
|
-
- **Gateway-chat.js history flickering** — prevent full re-render on unchanged history by comparing message arrays before setState
|
|
81
|
-
|
|
82
|
-
### Removed
|
|
83
|
-
- **Planning tab** — removed PlanningView from dashboard and deleted strategy.js
|
|
84
|
-
- **Orphaned frontend views** — deleted 6 unused views (command.js, coordinator-chat.js, gateway.js, raw-chat.js, terminal.js, events.js redirects), removed #command/#gateway hash redirects, dropped dead state fields
|
|
85
|
-
- **chat.db stack** — removed ChatStore, chat.db creation, and chat-related routes; simplified sessions/compat.ts
|
|
86
|
-
|
|
87
|
-
## [0.5.4] - 2026-02-17
|
|
88
|
-
|
|
89
|
-
### Added
|
|
90
|
-
|
|
91
|
-
#### Reviewer Coverage Enforcement
|
|
92
|
-
- Reviewer-coverage doctor check in `legio doctor` — warns when leads spawn builders without corresponding reviewers, reports partial coverage ratios per lead
|
|
93
|
-
- `merge_ready` reviewer validation in `legio mail send` — advisory warning when sending `merge_ready` without reviewer sessions for the sender's builders
|
|
94
|
-
|
|
95
|
-
#### Scout-First Workflow Enforcement
|
|
96
|
-
- Scout-before-builder warning in `legio sling` — warns when a lead spawns a builder without having spawned any scouts first
|
|
97
|
-
- `parentHasScouts()` helper exported from sling for testability
|
|
98
|
-
|
|
99
|
-
#### Run Auto-Completion
|
|
100
|
-
- `legio coordinator stop` now auto-completes the active run (reads `current-run.txt`, marks run completed, cleans up)
|
|
101
|
-
- `legio log session-end` auto-completes the run when the coordinator exits (handles tmux window close without explicit stop)
|
|
102
|
-
|
|
103
|
-
#### Gitignore Wildcard+Whitelist Model
|
|
104
|
-
- `.legio/.gitignore` flipped from explicit blocklist to wildcard `*` + whitelist pattern — ignore everything, whitelist only tracked files (`config.yaml`, `agent-manifest.json`, `hooks.json`, `groups.json`, `agent-defs/`)
|
|
105
|
-
- `legio prime` auto-heals `.legio/.gitignore` on each session start — ensures existing projects get the updated gitignore
|
|
106
|
-
- `LEGIO_GITIGNORE` constant and `writeLegioGitignore()` exported from init.ts for reuse
|
|
107
|
-
|
|
108
|
-
#### Testing
|
|
109
|
-
- Test suite grew from 1812 to 1848 tests across 73 files (4726 expect() calls)
|
|
110
|
-
|
|
111
|
-
### Changed
|
|
112
|
-
- Lead agent definition (`agents/lead.md`) — scouts made mandatory (not optional), Phase 3 review made MANDATORY with stronger language, added `SCOUT_SKIP` failure mode, expanded cost awareness section explaining why scouts and reviewers are investments not overhead
|
|
113
|
-
- `legio init` .gitignore now always overwrites (supports `--force` reinit and auto-healing)
|
|
114
|
-
|
|
115
|
-
### Fixed
|
|
116
|
-
- Hooks template (`templates/hooks.json.tmpl`) — removed fragile `read -r INPUT; echo "$INPUT" |` stdin relay pattern; `legio log` now reads stdin directly via `--stdin` flag
|
|
117
|
-
- `readStdinJson()` in log command — reads all stdin chunks for large payloads instead of only the first line
|
|
118
|
-
- Doctor gitignore structure check updated for wildcard+whitelist model
|
|
119
|
-
|
|
120
|
-
## [0.5.3] - 2026-02-17
|
|
121
|
-
|
|
122
|
-
### Added
|
|
123
|
-
|
|
124
|
-
#### Configurable Agent Models
|
|
125
|
-
- `models:` section in `config.yaml` — override the default model (`sonnet`, `opus`, `haiku`) for any agent role (coordinator, supervisor, monitor, etc.)
|
|
126
|
-
- `resolveModel()` helper in agent manifest — resolution chain: config override > manifest default > fallback
|
|
127
|
-
- Supervisor and monitor entries added to `agent-manifest.json` with model and capability metadata
|
|
128
|
-
- `legio init` now seeds the default `models:` section in generated `config.yaml`
|
|
129
|
-
|
|
130
|
-
#### Testing
|
|
131
|
-
- Test suite grew from 1805 to 1812 tests across 73 files (4638 expect() calls)
|
|
132
|
-
|
|
133
|
-
## [0.5.2] - 2026-02-17
|
|
134
|
-
|
|
135
|
-
### Added
|
|
136
|
-
|
|
137
|
-
#### New Flags
|
|
138
|
-
- `--into <branch>` flag for `legio merge` — target a specific branch instead of always merging to canonicalBranch
|
|
139
|
-
|
|
140
|
-
#### Session Branch Tracking
|
|
141
|
-
- `legio prime` now records the orchestrator's starting branch to `.legio/session-branch.txt` at session start
|
|
142
|
-
- `legio merge` reads `session-branch.txt` as the default merge target when `--into` is not specified — resolution chain: `--into` flag > `session-branch.txt` > config `canonicalBranch`
|
|
143
|
-
|
|
144
|
-
#### Testing
|
|
145
|
-
- Test suite grew from 1793 to 1805 tests across 73 files (4615 expect() calls)
|
|
146
|
-
|
|
147
|
-
### Changed
|
|
148
|
-
- Git push blocking for agents now blocks ALL `git push` commands (previously only blocked push to canonical branches) — agents should use `legio merge` instead
|
|
149
|
-
- Init-deployed hooks now include a PreToolUse Bash guard that blocks `git push` for the orchestrator's project
|
|
150
|
-
|
|
151
|
-
### Fixed
|
|
152
|
-
- Test cwd pollution in agents test afterEach — restored cwd to prevent cross-file pollution
|
|
153
|
-
|
|
154
|
-
## [0.5.1] - 2026-02-16
|
|
155
|
-
|
|
156
|
-
### Added
|
|
157
|
-
|
|
158
|
-
#### New CLI Commands
|
|
159
|
-
- `legio agents discover` — discover and query agents by capability, state, file scope, and parent with `--capability`, `--state`, `--parent` filters and `--json` output
|
|
160
|
-
|
|
161
|
-
#### New Subsystems
|
|
162
|
-
- Session insight analyzer (`src/insights/analyzer.ts`) — analyzes EventStore data from completed sessions to extract structured patterns about tool usage, file edits, and errors for automatic mulch expertise recording
|
|
163
|
-
- Conflict history intelligence in merge resolver — tracks past conflict resolution patterns per file to skip historically-failing tiers and enrich AI resolution prompts with successful strategies
|
|
164
|
-
|
|
165
|
-
#### Agent Improvements
|
|
166
|
-
- INSIGHT recording protocol for agent definitions — read-only agents (scout, reviewer) use INSIGHT prefix for structured expertise observations; parent agents (lead, supervisor) record insights to mulch automatically
|
|
167
|
-
|
|
168
|
-
#### Testing
|
|
169
|
-
- Test suite grew from 1749 to 1793 tests across 73 files (4587 expect() calls)
|
|
13
|
+
- Gateway first-run experience — beacon includes `FIRST_RUN` flag on first session, triggering self-introduction, `legio doctor` health check, and project onboarding
|
|
14
|
+
- Language-agnostic quality gates detection in `legio init` — auto-detects test/lint/typecheck commands for Node.js, Rust, Python, Go, Elm, Maven, Gradle, Ruby, and Elixir
|
|
15
|
+
- `quality-gates-configured` doctor check — warns when quality gates are missing or contain placeholder commands
|
|
16
|
+
- Install hints in `legio doctor` for missing dependencies (beads, mulch)
|
|
170
17
|
|
|
171
18
|
### Changed
|
|
172
|
-
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
- Coordinator tests now always inject fake monitor/watchdog for proper isolation
|
|
176
|
-
|
|
177
|
-
## [0.5.0] - 2026-02-16
|
|
178
|
-
|
|
179
|
-
### Added
|
|
180
|
-
|
|
181
|
-
#### New CLI Commands
|
|
182
|
-
- `legio feed` — unified real-time event stream across all agents with `--follow` mode for continuous polling, agent/run filtering, and JSON output
|
|
183
|
-
- `legio logs` — query NDJSON log files across agents with level filtering (`--level`), time range queries (`--since`/`--until`), and `--follow` tail mode
|
|
184
|
-
- `legio costs --live` — real-time token usage display for active agents
|
|
185
|
-
|
|
186
|
-
#### New Flags
|
|
187
|
-
- `--monitor` flag for `coordinator start/stop/status` — manage the Tier 2 monitor agent alongside the coordinator
|
|
188
|
-
|
|
189
|
-
#### Agent Improvements
|
|
190
|
-
- Mulch recording as required completion gate for all agent types — agents must record learnings before session close
|
|
191
|
-
- Mulch learn extraction added to Stop hooks for orchestrator and all agents
|
|
192
|
-
- Scout-spawning made default in lead.md Phase 1 with parallel support
|
|
193
|
-
- Reviewer spawning made mandatory in lead.md
|
|
194
|
-
|
|
195
|
-
#### Infrastructure
|
|
196
|
-
- Real-time token tracking infrastructure (`src/metrics/store.ts`, `src/commands/costs.ts`) — live session cost monitoring via transcript JSONL parsing
|
|
197
|
-
|
|
198
|
-
#### Testing
|
|
199
|
-
- Test suite grew from 1673 to 1749 tests across 71 files (4460 expect() calls)
|
|
19
|
+
- Agent definitions are fully language-agnostic — no hardcoded tool references (bun, npm, etc.)
|
|
20
|
+
- Default quality gates no longer include `typecheck` (language-specific, detected per-project instead)
|
|
21
|
+
- Gateway agent definition (`agents/gateway.md`) includes new "First Run" workflow section
|
|
200
22
|
|
|
201
23
|
### Fixed
|
|
202
|
-
-
|
|
24
|
+
- Removed project-specific tool references from agent definitions
|
|
25
|
+
- Corrected beads URL to `steveyegge/beads` in doctor output
|
|
26
|
+
- Fixed npm publish workflow — removed duplicate step from auto-tag, use OIDC in publish.yml
|
|
203
27
|
|
|
204
|
-
## [0.
|
|
205
|
-
|
|
206
|
-
### Added
|
|
207
|
-
|
|
208
|
-
#### New CLI Commands & Flags
|
|
209
|
-
- `legio --completions <shell>` — shell completion generation for bash, zsh, and fish
|
|
210
|
-
- `--quiet` / `-q` global flag — suppress non-error output across all commands
|
|
211
|
-
- `legio mail send --to @all` — broadcast messaging with group addresses (`@all`, `@builders`, `@scouts`, `@reviewers`, `@leads`, `@mergers`, etc.)
|
|
212
|
-
|
|
213
|
-
#### Output Control
|
|
214
|
-
- Central `NO_COLOR` convention support (`src/logging/color.ts`) — respects `NO_COLOR`, `FORCE_COLOR`, and `TERM=dumb` environment variables per https://no-color.org
|
|
215
|
-
- All ANSI color output now goes through centralized color module instead of inline escape codes
|
|
216
|
-
|
|
217
|
-
#### Infrastructure
|
|
218
|
-
- Merge queue migrated from JSON file to SQLite (`merge-queue.db`) for durability and concurrent access
|
|
219
|
-
|
|
220
|
-
#### Testing
|
|
221
|
-
- Test suite grew from 1612 to 1673 tests across 69 files (4267 expect() calls)
|
|
222
|
-
|
|
223
|
-
### Fixed
|
|
224
|
-
- Freeze duration counter for completed/zombie agents in status and dashboard displays
|
|
225
|
-
|
|
226
|
-
## [0.4.0] - 2026-02-15
|
|
227
|
-
|
|
228
|
-
### Added
|
|
229
|
-
|
|
230
|
-
#### New CLI Commands
|
|
231
|
-
- `legio doctor` — comprehensive health check system with 9 check modules (dependencies, config, structure, databases, consistency, agents, merge-queue, version, logs) and formatted output with pass/warn/fail status
|
|
232
|
-
- `legio inspect <agent>` — deep per-agent inspection aggregating session data, metrics, events, and live tmux capture with `--follow` polling mode
|
|
233
|
-
|
|
234
|
-
#### New Flags
|
|
235
|
-
- `--watchdog` flag for `coordinator start` — auto-starts the watchdog daemon alongside the coordinator
|
|
236
|
-
- `--debounce <ms>` flag for `mail check` — prevents excessive mail checking by skipping if called within the debounce window
|
|
237
|
-
- PostToolUse hook entry for debounced mail checking
|
|
238
|
-
|
|
239
|
-
#### Observability Improvements
|
|
240
|
-
- Automated failure recording in watchdog via mulch — records failure patterns for future reference
|
|
241
|
-
- Mulch learn extraction in `log session-end` — captures session insights automatically
|
|
242
|
-
- Mulch health checks in `legio clean` — validates mulch installation and domain health during cleanup
|
|
243
|
-
|
|
244
|
-
#### Testing
|
|
245
|
-
- Test suite grew from 1435 to 1612 tests across 66 files (3958 expect() calls)
|
|
246
|
-
|
|
247
|
-
### Fixed
|
|
248
|
-
|
|
249
|
-
- Wire doctor command into CLI router and update command groups
|
|
250
|
-
|
|
251
|
-
## [0.3.0] - 2026-02-13
|
|
252
|
-
|
|
253
|
-
### Added
|
|
254
|
-
|
|
255
|
-
#### New CLI Commands
|
|
256
|
-
- `legio run` command — orchestration run lifecycle management (`list`, `show`, `complete` subcommands) with RunStore backed by sessions.db
|
|
257
|
-
- `legio trace` command — agent/bead timeline viewing for debugging and post-mortem observability
|
|
258
|
-
- `legio clean` command — cleanup worktrees, sessions, and artifacts with auto-cleanup on agent teardown
|
|
259
|
-
|
|
260
|
-
#### Observability & Persistence
|
|
261
|
-
- Run tracking via `run_id` integrated into sling and clean commands
|
|
262
|
-
- `RunStore` in sessions.db for durable run state
|
|
263
|
-
- `SessionStore` (SQLite) — migrated from sessions.json for concurrent access and crash safety
|
|
264
|
-
- Phase 2 CLI query commands and Phase 3 event persistence for the observability pipeline
|
|
265
|
-
|
|
266
|
-
#### Agent Improvements
|
|
267
|
-
- Project-scoped tmux naming (`legio-{projectName}-{agentName}`) to prevent cross-project session collisions
|
|
268
|
-
- `ENV_GUARD` on all hooks — prevents hooks from firing outside legio-managed worktrees
|
|
269
|
-
- Mulch-informed lead decomposition — leader agents use mulch expertise when breaking down tasks
|
|
270
|
-
- Mulch conflict pattern recording — merge resolver records conflict patterns to mulch for future reference
|
|
271
|
-
|
|
272
|
-
#### MulchClient Expansion
|
|
273
|
-
- New commands and flags for the mulch CLI wrapper
|
|
274
|
-
- `--json` parsing support with corrected types and flag spread
|
|
275
|
-
|
|
276
|
-
#### Community & Documentation
|
|
277
|
-
- `STEELMAN.md` — comprehensive risk analysis for agent swarm deployments
|
|
278
|
-
- Community files: CONTRIBUTING.md, CODE_OF_CONDUCT.md, SECURITY.md
|
|
279
|
-
- Package metadata (keywords, repository, homepage) for npm/GitHub presence
|
|
280
|
-
|
|
281
|
-
#### Testing
|
|
282
|
-
- Test suite grew from 912 to 1435 tests across 55 files (3416 expect() calls)
|
|
283
|
-
|
|
284
|
-
### Fixed
|
|
285
|
-
|
|
286
|
-
- Fix `isCanonicalRoot` guard blocking all worktree overlays when dogfooding legio on itself
|
|
287
|
-
- Fix auto-nudge tmux corruption and deploy coordinator hooks correctly
|
|
288
|
-
- Fix 4 P1 issues: orchestrator nudge routing, bash guard bypass, hook capture isolation, overlay guard
|
|
289
|
-
- Fix 4 P1/P2 issues: ENV_GUARD enforcement, persistent agent state, project-scoped tmux kills, auto-nudge coordinator
|
|
290
|
-
- Strengthen agent orchestration with additional P1 bug fixes
|
|
28
|
+
## [0.1.1] - 2026-02-26
|
|
291
29
|
|
|
292
30
|
### Changed
|
|
293
|
-
|
|
294
|
-
- CLI
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
### Added
|
|
299
|
-
|
|
300
|
-
#### Coordinator & Supervisor Agents
|
|
301
|
-
- `legio coordinator` command — persistent orchestrator that runs at project root, decomposes objectives into subtasks, dispatches agents via sling, and tracks batches via task groups
|
|
302
|
-
- `start` / `stop` / `status` subcommands
|
|
303
|
-
- `--attach` / `--no-attach` with TTY-aware auto-detection for tmux sessions
|
|
304
|
-
- Scout-delegated spec generation for complex tasks
|
|
305
|
-
- Supervisor agent definition — per-project team lead (depth 1) that receives dispatch mail from coordinator, decomposes into worker-sized subtasks, manages worker lifecycle, and escalates unresolvable issues
|
|
306
|
-
- 7 base agent types (added coordinator + supervisor to existing scout, builder, reviewer, lead, merger)
|
|
307
|
-
|
|
308
|
-
#### Task Groups & Session Lifecycle
|
|
309
|
-
- `legio group` command — batch coordination (`create` / `status` / `add` / `remove` / `list`) with auto-close when all member beads issues complete, mail notification to coordinator on auto-close
|
|
310
|
-
- Session checkpoint save/restore for compaction survivability (`prime --compact` restores from checkpoint)
|
|
311
|
-
- Handoff orchestration (initiate/resume/complete) for crash recovery
|
|
312
|
-
|
|
313
|
-
#### Typed Mail Protocol
|
|
314
|
-
- 8 protocol message types: `worker_done`, `merge_ready`, `merged`, `merge_failed`, `escalation`, `health_check`, `dispatch`, `assign`
|
|
315
|
-
- Type-safe `sendProtocol<T>()` and `parsePayload<T>()` for structured agent coordination
|
|
316
|
-
- JSON payload column with schema migration handling 3 upgrade paths
|
|
317
|
-
|
|
318
|
-
#### Agent Nudging
|
|
319
|
-
- `legio nudge` command with retry (3x), debounce (500ms), and `--force` to skip debounce
|
|
320
|
-
- Auto-nudge on urgent/high priority mail send
|
|
321
|
-
|
|
322
|
-
#### Structural Tool Enforcement
|
|
323
|
-
- PreToolUse hooks mechanically block file-modifying tools (Write/Edit/NotebookEdit) for non-implementation agents (scout, reviewer, coordinator, supervisor)
|
|
324
|
-
- PreToolUse Bash guards block dangerous git operations (`push`, `reset --hard`, `clean -f`, etc.) for all agents
|
|
325
|
-
- Whitelist git add/commit for coordinator/supervisor capabilities while keeping git push blocked
|
|
326
|
-
- Block Claude Code native team/task tools (Task, TeamCreate, etc.) for all legio agents — enforces legio sling delegation
|
|
327
|
-
|
|
328
|
-
#### Watchdog Improvements
|
|
329
|
-
- ZFC principle: tmux liveness as primary signal, pid check as secondary, sessions.json as tertiary
|
|
330
|
-
- Descendant tree walking for process cleanup — `getPanePid()`, `getDescendantPids()`, `killProcessTree()` with SIGTERM → grace → SIGKILL
|
|
331
|
-
- Re-check zombies on every tick, handle investigate action
|
|
332
|
-
- Stalled state added to zombie reconciliation
|
|
333
|
-
|
|
334
|
-
#### Worker Self-Propulsion (Phase 3)
|
|
335
|
-
- Builder agents send `worker_done` mail on task completion
|
|
336
|
-
- Overlay quality gates include worker_done signal step
|
|
337
|
-
- Prime activation context injection for bound tasks
|
|
338
|
-
- `MISSING_WORKER_DONE` failure mode in builder definition
|
|
339
|
-
|
|
340
|
-
#### Interactive Agent Mode
|
|
341
|
-
- Switch sling from headless (`claude -p`) to interactive mode with tmux sendKeys beacon — hooks now fire, enabling mail, metrics, logs, and lastActivity updates
|
|
342
|
-
- Structured `buildBeacon()` with identity context and startup protocol
|
|
343
|
-
- Fix beacon sendKeys multiline bug (increase initial sleep, follow-up Enter after 500ms)
|
|
344
|
-
|
|
345
|
-
#### CLI Improvements
|
|
346
|
-
- `--verbose` flag for `legio status`
|
|
347
|
-
- `--json` flag for `legio sling`
|
|
348
|
-
- `--background` flag for `legio watch`
|
|
349
|
-
- Help text for unknown subcommands
|
|
350
|
-
- `SUPPORTED_CAPABILITIES` constant and `Capability` type
|
|
351
|
-
|
|
352
|
-
#### Init & Deployment
|
|
353
|
-
- `legio init` now deploys agent definitions (copies `agents/*.md` to `.legio/agent-defs/`) via `import.meta.dir` resolution
|
|
354
|
-
- E2E lifecycle test validates full init → config → manifest → overlay pipeline on throwaway external projects
|
|
355
|
-
|
|
356
|
-
#### Testing Improvements
|
|
357
|
-
- Colocated tests with source files (moved from `__tests__/` to `src/`)
|
|
358
|
-
- Shared test harness: `createTempGitRepo()`, `cleanupTempDir()`, `commitFile()` in `src/test-helpers.ts`
|
|
359
|
-
- Replaced `Bun.spawn` mocks with real implementations in 3 test files
|
|
360
|
-
- Optimized test harness: 38.1s → 11.7s (-69%)
|
|
361
|
-
- Comprehensive metrics command test coverage
|
|
362
|
-
- E2E init-sling lifecycle test
|
|
363
|
-
- Test suite grew from initial release to 515 tests across 24 files (1286 expect() calls)
|
|
31
|
+
- Rewrote README to be product-focused (~130 lines, down from ~557)
|
|
32
|
+
- Moved CLI reference, REST API table, and architecture details to `docs/`
|
|
33
|
+
- Added costs, tasks, and updated inspect screenshots
|
|
34
|
+
- Simplified token cost warning
|
|
35
|
+
- Moved Overstory credit to footer
|
|
364
36
|
|
|
365
37
|
### Fixed
|
|
38
|
+
- Corrected GitHub URL in generated `config.yaml` comment
|
|
39
|
+
- Added Write/Edit scope and `worktree clean --all` constraints to lead agent definition
|
|
366
40
|
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
- `.gitignore` patterns for `.legio/` artifacts
|
|
376
|
-
- Mail, merge, and worktree subsystem edge cases
|
|
377
|
-
|
|
378
|
-
### Changed
|
|
41
|
+
### Removed
|
|
42
|
+
- `STEELMAN.md` (risk analysis document)
|
|
43
|
+
- `ARCHITECTURE.md` (superseded by `docs/architecture.md`)
|
|
44
|
+
- `AGENTS.md` (superseded by `CLAUDE.md`)
|
|
45
|
+
- `bun.lock` (project uses npm)
|
|
46
|
+
- `templates/CLAUDE.md.tmpl` (dead template, not loaded by any code)
|
|
47
|
+
- `specs/web-ui.md` (historical spec, served its purpose)
|
|
48
|
+
- Gateway chat screenshot (removed from README)
|
|
379
49
|
|
|
380
|
-
|
|
381
|
-
- Agent quality gates updated across all base definitions
|
|
382
|
-
- Test file paths updated from `__tests__/` convention to colocated `src/**/*.test.ts`
|
|
50
|
+
## [0.1.0] - 2026-02-25
|
|
383
51
|
|
|
384
|
-
|
|
52
|
+
Initial public release on npm as [`@katyella/legio`](https://www.npmjs.com/package/@katyella/legio).
|
|
385
53
|
|
|
386
54
|
### Added
|
|
387
55
|
|
|
388
|
-
|
|
389
|
-
-
|
|
56
|
+
#### Core CLI
|
|
57
|
+
- CLI entry point with command router (`legio <command>`) — 34 commands
|
|
58
|
+
- `legio init` — initialize `.legio/` in a target project (deploys agent definitions, seeds config)
|
|
59
|
+
- `legio up` / `legio down` — bootstrap/shutdown full stack (init + server + coordinator)
|
|
390
60
|
- `legio sling` — spawn worker agents in git worktrees via tmux
|
|
391
|
-
- `legio prime` — load context for orchestrator or agent sessions
|
|
61
|
+
- `legio prime` — load context for orchestrator or agent sessions (with `--compact` for compaction recovery)
|
|
392
62
|
- `legio status` — show active agents, worktrees, and project state
|
|
393
|
-
- `legio
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
-
|
|
397
|
-
- `legio watch` — watchdog daemon with health monitoring and AI-assisted triage
|
|
398
|
-
- `legio metrics` — session metrics storage and reporting
|
|
399
|
-
- Agent manifest system with 5 base agent types (scout, builder, reviewer, lead, merger)
|
|
63
|
+
- `legio stop` — graceful shutdown sorting active sessions deepest-first
|
|
64
|
+
|
|
65
|
+
#### Agent System
|
|
66
|
+
- 10 base agent types: coordinator, supervisor, lead, gateway, scout, builder, reviewer, merger, monitor, CTO
|
|
400
67
|
- Two-layer agent definition: base `.md` files (HOW) + dynamic overlays (WHAT)
|
|
401
68
|
- Persistent agent identity and CV system
|
|
402
|
-
-
|
|
403
|
-
-
|
|
404
|
-
-
|
|
69
|
+
- Agent discovery via `legio agents discover` with capability/state/parent filters
|
|
70
|
+
- Configurable models per agent role via `config.yaml`
|
|
71
|
+
- Structural tool enforcement — PreToolUse hooks mechanically block file modifications for read-only agents and dangerous git operations for all agents
|
|
72
|
+
- Block Claude Code native team/task tools for all agents (enforces legio sling delegation)
|
|
73
|
+
- Root-user guard blocks all spawn/start commands
|
|
74
|
+
- Mulch domain inference for automatic expertise priming at spawn time
|
|
75
|
+
|
|
76
|
+
#### Coordination
|
|
77
|
+
- `legio coordinator` — persistent orchestrator with `start`/`stop`/`status`, auto-starts watchdog/monitor
|
|
78
|
+
- `legio supervisor` — per-project team lead management
|
|
79
|
+
- `legio gateway` — planning companion and human interface agent
|
|
80
|
+
- `legio monitor` — Tier 2 continuous fleet patrol
|
|
81
|
+
- Task groups via `legio group` — batch coordination with auto-close on completion
|
|
82
|
+
- Session checkpoint save/restore for compaction survivability
|
|
83
|
+
- Handoff orchestration for crash recovery
|
|
84
|
+
- Run lifecycle management via `legio run`
|
|
85
|
+
|
|
86
|
+
#### Messaging
|
|
87
|
+
- `legio mail` — SQLite-based inter-agent messaging (send/check/list/read/reply/purge)
|
|
88
|
+
- 8 typed protocol messages: `worker_done`, `merge_ready`, `merged`, `merge_failed`, `escalation`, `health_check`, `dispatch`, `assign`
|
|
89
|
+
- Broadcast messaging with group addresses (`@all`, `@builders`, `@scouts`, etc.)
|
|
90
|
+
- `legio nudge` — tmux text nudge with retry, debounce, and auto-nudge on urgent mail
|
|
91
|
+
- JSON payload column for structured agent coordination
|
|
92
|
+
|
|
93
|
+
#### Merge Pipeline
|
|
94
|
+
- `legio merge` — merge agent branches with 4-tier conflict resolution
|
|
95
|
+
- FIFO merge queue backed by SQLite
|
|
96
|
+
- `--into` flag and `session-branch.txt` for flexible merge targets
|
|
97
|
+
- Unmerged branch safety check in worktree removal
|
|
98
|
+
- Conflict history intelligence for informed resolution strategies
|
|
99
|
+
|
|
100
|
+
#### Observability
|
|
101
|
+
- `legio dashboard` — live TUI dashboard for agent monitoring
|
|
102
|
+
- `legio inspect` — deep per-agent inspection with `--follow` polling
|
|
103
|
+
- `legio trace` — agent/bead timeline viewing
|
|
104
|
+
- `legio feed` — unified real-time event stream with `--follow` mode
|
|
105
|
+
- `legio errors` — aggregated error view across agents
|
|
106
|
+
- `legio replay` — interleaved chronological replay
|
|
107
|
+
- `legio logs` — NDJSON log query with level/time filtering and `--follow` tail
|
|
108
|
+
- `legio costs` — token/cost analysis with `--live` real-time display
|
|
109
|
+
- `legio metrics` — session metrics reporting
|
|
110
|
+
- `legio doctor` — health check system with 9 check modules
|
|
111
|
+
|
|
112
|
+
#### Web UI
|
|
113
|
+
- Browser-based dashboard with real-time WebSocket updates
|
|
114
|
+
- Views: Dashboard, Costs, Tasks, Chat, Setup, Gateway Chat, Inspect, Task Detail
|
|
115
|
+
- REST API with 30+ endpoints for full programmatic access
|
|
116
|
+
- Ideas CRUD API for planning workflow
|
|
117
|
+
- Gateway chat and coordinator chat with persistent history
|
|
118
|
+
- Preact + HTM + Tailwind CSS frontend (zero build step)
|
|
119
|
+
|
|
120
|
+
#### Infrastructure
|
|
121
|
+
- `legio hooks install` — orchestrator hooks management
|
|
122
|
+
- `legio worktree` — git worktree lifecycle (list/clean)
|
|
123
|
+
- `legio watch` — watchdog daemon (Tier 0 mechanical monitoring, Tier 1 AI triage)
|
|
124
|
+
- `legio clean` — worktree/session/artifact cleanup
|
|
125
|
+
- `legio log` — hook event logging (NDJSON + human-readable)
|
|
126
|
+
- `legio server` — web UI server with daemon mode
|
|
127
|
+
- Shell completions for bash, zsh, and fish
|
|
128
|
+
- `--quiet` / `-q` global flag and `NO_COLOR` convention support
|
|
405
129
|
- Multi-format logging with secret redaction
|
|
406
|
-
- SQLite metrics storage for session analytics
|
|
407
|
-
- Full test suite using `npm test`
|
|
408
|
-
- Biome configuration for formatting and linting
|
|
409
|
-
- TypeScript strict mode with `noUncheckedIndexedAccess`
|
|
410
130
|
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
131
|
+
#### Integrations
|
|
132
|
+
- beads (`bd`) CLI wrapper for issue tracking
|
|
133
|
+
- mulch CLI wrapper for structured expertise management
|
|
134
|
+
- Provider env var threading for model configuration
|
|
135
|
+
|
|
136
|
+
#### Testing
|
|
137
|
+
- 2384 tests across 85 files
|
|
138
|
+
- Colocated tests with source files
|
|
139
|
+
- Real implementations over mocks (temp git repos, SQLite `:memory:`, real filesystem)
|
|
140
|
+
- E2E lifecycle tests via Playwright
|
|
141
|
+
- Vitest test runner with forks pool for CI compatibility
|
|
142
|
+
|
|
143
|
+
[Unreleased]: https://github.com/katyella/legio/compare/v0.1.2...HEAD
|
|
144
|
+
[0.1.2]: https://github.com/katyella/legio/compare/v0.1.1...v0.1.2
|
|
145
|
+
[0.1.1]: https://github.com/katyella/legio/compare/v0.1.0...v0.1.1
|
|
422
146
|
[0.1.0]: https://github.com/katyella/legio/releases/tag/v0.1.0
|