@katyella/legio 0.1.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/CHANGELOG.md +422 -0
- package/LICENSE +21 -0
- package/README.md +555 -0
- package/agents/builder.md +141 -0
- package/agents/coordinator.md +351 -0
- package/agents/cto.md +196 -0
- package/agents/gateway.md +276 -0
- package/agents/lead.md +281 -0
- package/agents/merger.md +156 -0
- package/agents/monitor.md +212 -0
- package/agents/reviewer.md +142 -0
- package/agents/scout.md +131 -0
- package/agents/supervisor.md +416 -0
- package/bin/legio.mjs +38 -0
- package/package.json +77 -0
- package/src/agents/checkpoint.test.ts +88 -0
- package/src/agents/checkpoint.ts +102 -0
- package/src/agents/hooks-deployer.test.ts +1820 -0
- package/src/agents/hooks-deployer.ts +574 -0
- package/src/agents/identity.test.ts +614 -0
- package/src/agents/identity.ts +385 -0
- package/src/agents/lifecycle.test.ts +202 -0
- package/src/agents/lifecycle.ts +184 -0
- package/src/agents/manifest.test.ts +558 -0
- package/src/agents/manifest.ts +297 -0
- package/src/agents/overlay.test.ts +592 -0
- package/src/agents/overlay.ts +316 -0
- package/src/beads/client.test.ts +210 -0
- package/src/beads/client.ts +227 -0
- package/src/beads/molecules.test.ts +320 -0
- package/src/beads/molecules.ts +209 -0
- package/src/commands/agents.test.ts +325 -0
- package/src/commands/agents.ts +286 -0
- package/src/commands/clean.test.ts +730 -0
- package/src/commands/clean.ts +653 -0
- package/src/commands/completions.test.ts +346 -0
- package/src/commands/completions.ts +950 -0
- package/src/commands/coordinator.test.ts +1524 -0
- package/src/commands/coordinator.ts +880 -0
- package/src/commands/costs.test.ts +1015 -0
- package/src/commands/costs.ts +473 -0
- package/src/commands/dashboard.test.ts +94 -0
- package/src/commands/dashboard.ts +607 -0
- package/src/commands/doctor.test.ts +295 -0
- package/src/commands/doctor.ts +213 -0
- package/src/commands/down.test.ts +308 -0
- package/src/commands/down.ts +124 -0
- package/src/commands/errors.test.ts +648 -0
- package/src/commands/errors.ts +255 -0
- package/src/commands/feed.test.ts +579 -0
- package/src/commands/feed.ts +368 -0
- package/src/commands/gateway.test.ts +698 -0
- package/src/commands/gateway.ts +419 -0
- package/src/commands/group.test.ts +262 -0
- package/src/commands/group.ts +539 -0
- package/src/commands/hooks.test.ts +292 -0
- package/src/commands/hooks.ts +210 -0
- package/src/commands/init.test.ts +211 -0
- package/src/commands/init.ts +622 -0
- package/src/commands/inspect.test.ts +670 -0
- package/src/commands/inspect.ts +455 -0
- package/src/commands/log.test.ts +1556 -0
- package/src/commands/log.ts +752 -0
- package/src/commands/logs.test.ts +379 -0
- package/src/commands/logs.ts +544 -0
- package/src/commands/mail.test.ts +1726 -0
- package/src/commands/mail.ts +926 -0
- package/src/commands/merge.test.ts +676 -0
- package/src/commands/merge.ts +374 -0
- package/src/commands/metrics.test.ts +444 -0
- package/src/commands/metrics.ts +150 -0
- package/src/commands/monitor.test.ts +151 -0
- package/src/commands/monitor.ts +394 -0
- package/src/commands/nudge.test.ts +230 -0
- package/src/commands/nudge.ts +373 -0
- package/src/commands/prime.test.ts +467 -0
- package/src/commands/prime.ts +386 -0
- package/src/commands/replay.test.ts +742 -0
- package/src/commands/replay.ts +367 -0
- package/src/commands/run.test.ts +443 -0
- package/src/commands/run.ts +365 -0
- package/src/commands/server.test.ts +626 -0
- package/src/commands/server.ts +298 -0
- package/src/commands/sling.test.ts +810 -0
- package/src/commands/sling.ts +700 -0
- package/src/commands/spec.test.ts +206 -0
- package/src/commands/spec.ts +171 -0
- package/src/commands/status.test.ts +276 -0
- package/src/commands/status.ts +339 -0
- package/src/commands/stop.test.ts +357 -0
- package/src/commands/stop.ts +119 -0
- package/src/commands/supervisor.test.ts +186 -0
- package/src/commands/supervisor.ts +544 -0
- package/src/commands/trace.test.ts +746 -0
- package/src/commands/trace.ts +332 -0
- package/src/commands/up.test.ts +597 -0
- package/src/commands/up.ts +275 -0
- package/src/commands/watch.test.ts +152 -0
- package/src/commands/watch.ts +238 -0
- package/src/commands/worktree.test.ts +648 -0
- package/src/commands/worktree.ts +266 -0
- package/src/config.test.ts +496 -0
- package/src/config.ts +616 -0
- package/src/doctor/agents.test.ts +448 -0
- package/src/doctor/agents.ts +396 -0
- package/src/doctor/config-check.test.ts +184 -0
- package/src/doctor/config-check.ts +185 -0
- package/src/doctor/consistency.test.ts +645 -0
- package/src/doctor/consistency.ts +294 -0
- package/src/doctor/databases.test.ts +284 -0
- package/src/doctor/databases.ts +211 -0
- package/src/doctor/dependencies.test.ts +150 -0
- package/src/doctor/dependencies.ts +179 -0
- package/src/doctor/logs.test.ts +244 -0
- package/src/doctor/logs.ts +295 -0
- package/src/doctor/merge-queue.test.ts +210 -0
- package/src/doctor/merge-queue.ts +144 -0
- package/src/doctor/structure.test.ts +285 -0
- package/src/doctor/structure.ts +195 -0
- package/src/doctor/types.ts +37 -0
- package/src/doctor/version.test.ts +130 -0
- package/src/doctor/version.ts +131 -0
- package/src/e2e/chat-flow.test.ts +346 -0
- package/src/e2e/init-sling-lifecycle.test.ts +288 -0
- package/src/errors.test.ts +21 -0
- package/src/errors.ts +246 -0
- package/src/events/store.test.ts +660 -0
- package/src/events/store.ts +344 -0
- package/src/events/tool-filter.test.ts +330 -0
- package/src/events/tool-filter.ts +126 -0
- package/src/global-setup.ts +14 -0
- package/src/index.ts +339 -0
- package/src/insights/analyzer.test.ts +466 -0
- package/src/insights/analyzer.ts +203 -0
- package/src/logging/color.test.ts +118 -0
- package/src/logging/color.ts +71 -0
- package/src/logging/logger.test.ts +812 -0
- package/src/logging/logger.ts +266 -0
- package/src/logging/reporter.test.ts +258 -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 +873 -0
- package/src/mail/client.ts +236 -0
- package/src/mail/store.test.ts +815 -0
- package/src/mail/store.ts +402 -0
- package/src/merge/queue.test.ts +449 -0
- package/src/merge/queue.ts +262 -0
- package/src/merge/resolver.test.ts +1453 -0
- package/src/merge/resolver.ts +759 -0
- package/src/metrics/store.test.ts +1167 -0
- package/src/metrics/store.ts +511 -0
- package/src/metrics/summary.test.ts +397 -0
- package/src/metrics/summary.ts +178 -0
- package/src/metrics/transcript.test.ts +643 -0
- package/src/metrics/transcript.ts +351 -0
- package/src/mulch/client.test.ts +547 -0
- package/src/mulch/client.ts +416 -0
- package/src/server/audit-store.test.ts +384 -0
- package/src/server/audit-store.ts +257 -0
- package/src/server/headless.test.ts +180 -0
- package/src/server/headless.ts +151 -0
- package/src/server/index.test.ts +241 -0
- package/src/server/index.ts +317 -0
- package/src/server/public/app.js +187 -0
- package/src/server/public/apple-touch-icon.png +0 -0
- package/src/server/public/components/agent-badge.js +37 -0
- package/src/server/public/components/data-table.js +114 -0
- package/src/server/public/components/gateway-chat.js +256 -0
- package/src/server/public/components/issue-card.js +96 -0
- package/src/server/public/components/layout.js +88 -0
- package/src/server/public/components/message-bubble.js +120 -0
- package/src/server/public/components/stat-card.js +26 -0
- package/src/server/public/components/terminal-panel.js +140 -0
- package/src/server/public/favicon-16.png +0 -0
- package/src/server/public/favicon-32.png +0 -0
- package/src/server/public/favicon.ico +0 -0
- package/src/server/public/favicon.png +0 -0
- package/src/server/public/index.html +64 -0
- package/src/server/public/lib/api.js +35 -0
- package/src/server/public/lib/markdown.js +8 -0
- package/src/server/public/lib/preact-setup.js +8 -0
- package/src/server/public/lib/state.js +99 -0
- package/src/server/public/lib/utils.js +309 -0
- package/src/server/public/lib/ws.js +79 -0
- package/src/server/public/views/chat.js +983 -0
- package/src/server/public/views/costs.js +692 -0
- package/src/server/public/views/dashboard.js +781 -0
- package/src/server/public/views/gateway-chat.js +622 -0
- package/src/server/public/views/inspect.js +399 -0
- package/src/server/public/views/issues.js +470 -0
- package/src/server/public/views/setup.js +94 -0
- package/src/server/public/views/task-detail.js +422 -0
- package/src/server/routes.test.ts +3816 -0
- package/src/server/routes.ts +1964 -0
- package/src/server/websocket.test.ts +288 -0
- package/src/server/websocket.ts +196 -0
- package/src/sessions/compat.test.ts +109 -0
- package/src/sessions/compat.ts +17 -0
- package/src/sessions/store.test.ts +969 -0
- package/src/sessions/store.ts +480 -0
- package/src/test-helpers.test.ts +97 -0
- package/src/test-helpers.ts +143 -0
- package/src/types.ts +708 -0
- package/src/watchdog/daemon.test.ts +1233 -0
- package/src/watchdog/daemon.ts +533 -0
- package/src/watchdog/health.test.ts +371 -0
- package/src/watchdog/health.ts +248 -0
- package/src/watchdog/triage.test.ts +162 -0
- package/src/watchdog/triage.ts +193 -0
- package/src/worktree/manager.test.ts +444 -0
- package/src/worktree/manager.ts +224 -0
- package/src/worktree/tmux.test.ts +1238 -0
- package/src/worktree/tmux.ts +644 -0
- package/templates/CLAUDE.md.tmpl +89 -0
- package/templates/hooks.json.tmpl +132 -0
- package/templates/overlay.md.tmpl +79 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,422 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [Unreleased]
|
|
9
|
+
|
|
10
|
+
## [0.5.5] - 2026-02-25
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
#### legio stop Command
|
|
15
|
+
- `legio stop` — graceful shutdown with DI pattern (`StopDeps._tmux`) matching coordinator.ts, sorts active sessions deepest-first before killing to ensure leaf workers terminate before parents
|
|
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)
|
|
170
|
+
|
|
171
|
+
### Changed
|
|
172
|
+
- `session-end` hook now calls `mulch record` directly instead of sending `mulch_learn` mail messages — removes mail indirection for expertise recording
|
|
173
|
+
|
|
174
|
+
### Fixed
|
|
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)
|
|
200
|
+
|
|
201
|
+
### Fixed
|
|
202
|
+
- Duplicate `feed` entry in CLI command router and help text
|
|
203
|
+
|
|
204
|
+
## [0.4.1] - 2026-02-16
|
|
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
|
|
291
|
+
|
|
292
|
+
### Changed
|
|
293
|
+
|
|
294
|
+
- CLI commands grew from 17 to 20 (added run, trace, clean)
|
|
295
|
+
|
|
296
|
+
## [0.2.0] - 2026-02-13
|
|
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)
|
|
364
|
+
|
|
365
|
+
### Fixed
|
|
366
|
+
|
|
367
|
+
- **60+ bugs** resolved across 8 dedicated fix sessions, covering P1 criticals through P4 backlog items:
|
|
368
|
+
- Hooks enforcement: tool guard sed patterns now handle optional space after JSON colons
|
|
369
|
+
- Status display: filter completed sessions from active agent count
|
|
370
|
+
- Session lifecycle: move session recording before beacon send to fix booting → working race condition
|
|
371
|
+
- Stagger delay (`staggerDelayMs`) now actually enforced between agent spawns
|
|
372
|
+
- Hardcoded `main` branch replaced with dynamic branch detection in worktree/manager and merge/resolver
|
|
373
|
+
- Sling headless mode fixes for E2E validation
|
|
374
|
+
- Input validation, environment variable handling, init improvements, cleanup lifecycle
|
|
375
|
+
- `.gitignore` patterns for `.legio/` artifacts
|
|
376
|
+
- Mail, merge, and worktree subsystem edge cases
|
|
377
|
+
|
|
378
|
+
### Changed
|
|
379
|
+
|
|
380
|
+
- Agent propulsion principle: failure modes, cost awareness, and completion protocol added to all agent definitions
|
|
381
|
+
- Agent quality gates updated across all base definitions
|
|
382
|
+
- Test file paths updated from `__tests__/` convention to colocated `src/**/*.test.ts`
|
|
383
|
+
|
|
384
|
+
## [0.1.0] - 2026-02-12
|
|
385
|
+
|
|
386
|
+
### Added
|
|
387
|
+
|
|
388
|
+
- CLI entry point with command router (`legio <command>`)
|
|
389
|
+
- `legio init` — initialize `.legio/` in a target project
|
|
390
|
+
- `legio sling` — spawn worker agents in git worktrees via tmux
|
|
391
|
+
- `legio prime` — load context for orchestrator or agent sessions
|
|
392
|
+
- `legio status` — show active agents, worktrees, and project state
|
|
393
|
+
- `legio mail` — SQLite-based inter-agent messaging (send/check/list/read/reply)
|
|
394
|
+
- `legio merge` — merge agent branches with 4-tier conflict resolution
|
|
395
|
+
- `legio worktree` — manage git worktrees (list/clean)
|
|
396
|
+
- `legio log` — hook event logging (NDJSON + human-readable)
|
|
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)
|
|
400
|
+
- Two-layer agent definition: base `.md` files (HOW) + dynamic overlays (WHAT)
|
|
401
|
+
- Persistent agent identity and CV system
|
|
402
|
+
- Hooks deployer for automatic worktree configuration
|
|
403
|
+
- beads (`bd`) CLI wrapper for issue tracking integration
|
|
404
|
+
- mulch CLI wrapper for structured expertise management
|
|
405
|
+
- 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
|
+
|
|
411
|
+
[Unreleased]: https://github.com/katyella/legio/compare/v0.5.5...HEAD
|
|
412
|
+
[0.5.5]: https://github.com/katyella/legio/compare/v0.5.4...v0.5.5
|
|
413
|
+
[0.5.4]: https://github.com/katyella/legio/compare/v0.5.3...v0.5.4
|
|
414
|
+
[0.5.3]: https://github.com/katyella/legio/compare/v0.5.2...v0.5.3
|
|
415
|
+
[0.5.2]: https://github.com/katyella/legio/compare/v0.5.1...v0.5.2
|
|
416
|
+
[0.5.1]: https://github.com/katyella/legio/compare/v0.5.0...v0.5.1
|
|
417
|
+
[0.5.0]: https://github.com/katyella/legio/compare/v0.4.1...v0.5.0
|
|
418
|
+
[0.4.1]: https://github.com/katyella/legio/compare/v0.4.0...v0.4.1
|
|
419
|
+
[0.4.0]: https://github.com/katyella/legio/compare/v0.3.0...v0.4.0
|
|
420
|
+
[0.3.0]: https://github.com/katyella/legio/compare/v0.2.0...v0.3.0
|
|
421
|
+
[0.2.0]: https://github.com/katyella/legio/compare/v0.1.0...v0.2.0
|
|
422
|
+
[0.1.0]: https://github.com/katyella/legio/releases/tag/v0.1.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.
|