opencode-swarm 6.47.2 β 6.49.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +153 -31
- package/dist/cli/index.js +2811 -2560
- package/dist/commands/doctor.d.ts +5 -0
- package/dist/commands/registry.d.ts +4 -0
- package/dist/index.js +2056 -836
- package/dist/lang/framework-detector.d.ts +74 -0
- package/dist/lang/profiles.d.ts +1 -0
- package/dist/services/tool-doctor.d.ts +20 -0
- package/dist/services/tool-doctor.test.d.ts +1 -0
- package/dist/tools/index.d.ts +7 -4
- package/dist/tools/placeholder-scan.d.ts +2 -0
- package/dist/tools/quality-budget.d.ts +2 -0
- package/dist/tools/syntax-check.d.ts +2 -0
- package/dist/tools/test-runner.d.ts +4 -0
- package/dist/tools/update-task-status.d.ts +5 -0
- package/dist/tools/verify-six-tools-registration.test.d.ts +9 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -30,7 +30,7 @@ Most AI coding tools let one model write code and ask that same model whether th
|
|
|
30
30
|
- π **Gated pipeline** β code never ships without reviewer + test engineer approval (bypassed in turbo mode)
|
|
31
31
|
- π **Phase completion gates** β completion-verify and drift verifier gates enforced before phase completion (bypassed in turbo mode)
|
|
32
32
|
- π **Resumable sessions** β all state saved to `.swarm/`; pick up any project any day
|
|
33
|
-
- π **
|
|
33
|
+
- π **12 languages** β TypeScript, Python, Go, Rust, Java, Kotlin, C#, C/C++, Swift, Dart, Ruby, PHP
|
|
34
34
|
- π‘οΈ **Built-in security** β SAST, secrets scanning, dependency audit per task
|
|
35
35
|
- π **Free tier** β works with OpenCode Zen's free model roster
|
|
36
36
|
- βοΈ **Fully configurable** β override any agent's model, disable agents, tune guardrails
|
|
@@ -69,16 +69,26 @@ All project state lives in `.swarm/`:
|
|
|
69
69
|
|
|
70
70
|
```text
|
|
71
71
|
.swarm/
|
|
72
|
-
βββ plan.md
|
|
73
|
-
βββ plan.json
|
|
74
|
-
βββ
|
|
75
|
-
βββ
|
|
76
|
-
βββ
|
|
77
|
-
βββ
|
|
78
|
-
βββ
|
|
79
|
-
|
|
72
|
+
βββ plan.md # Projected plan (generated from ledger)
|
|
73
|
+
βββ plan.json # Projected plan data (generated from ledger)
|
|
74
|
+
βββ plan-ledger.jsonl # Durable append-only ledger β authoritative source of truth (v6.44)
|
|
75
|
+
βββ SWARM_PLAN.md # Export checkpoint artifact written on save_plan / phase_complete / close
|
|
76
|
+
βββ SWARM_PLAN.json # Export checkpoint artifact (importable via importCheckpoint)
|
|
77
|
+
βββ context.md # Technical decisions and SME guidance
|
|
78
|
+
βββ spec.md # Feature specification (written by /swarm specify)
|
|
79
|
+
βββ close-summary.md # Written by /swarm close with project summary
|
|
80
|
+
βββ close-lessons.md # Optional: explicit session lessons for /swarm close to curate
|
|
81
|
+
βββ doc-manifest.json # Documentation index built by doc_scan tool
|
|
82
|
+
βββ events.jsonl # Event stream for diagnostics
|
|
83
|
+
βββ evidence/ # Review/test evidence bundles per task
|
|
84
|
+
βββ telemetry.jsonl # Session observability events (JSONL)
|
|
85
|
+
βββ curator-summary.json # Curator system state
|
|
86
|
+
βββ curator-briefing.md # Curator init briefing injected at session start
|
|
87
|
+
βββ drift-report-phase-N.json # Plan-vs-reality drift reports (Curator)
|
|
80
88
|
```
|
|
81
89
|
|
|
90
|
+
> **Plan durability (v6.44):** `plan-ledger.jsonl` is the authoritative source of truth for plan state. `plan.json` and `plan.md` are projections derived from the ledger β if they are missing or stale, `loadPlan()` auto-rebuilds them from the ledger. `SWARM_PLAN.md` / `SWARM_PLAN.json` are export-only checkpoint artifacts written automatically β use `SWARM_PLAN.json` to restore if both `plan.json` and the ledger are lost.
|
|
91
|
+
|
|
82
92
|
Swarm is resumable by design. If `.swarm/` already exists, the architect goes straight into **RESUME** β **EXECUTE** instead of repeating discovery.
|
|
83
93
|
|
|
84
94
|
---
|
|
@@ -312,6 +322,7 @@ When a task requires multiple coder attempts (e.g., reviewer rejections), Swarm
|
|
|
312
322
|
| `/swarm diagnose` | Health check for swarm state, including config parsing, grammar files, checkpoint manifest, events stream integrity, and steering directive staleness |
|
|
313
323
|
| `/swarm evidence 2.1` | Show review/test results for a specific task |
|
|
314
324
|
| `/swarm history` | What's been completed so far |
|
|
325
|
+
| `/swarm close [--prune-branches]` | Idempotent session close-out: writes retrospectives, curates lessons (reads `.swarm/close-lessons.md` if present), archives evidence, resets `context.md`, cleans config-backup files, optionally prunes merged branches |
|
|
315
326
|
| `/swarm reset --confirm` | Start over (clears all swarm state) |
|
|
316
327
|
|
|
317
328
|
---
|
|
@@ -336,9 +347,9 @@ Agent roles (see [Agent Categories](#agent-categories) for classification refere
|
|
|
336
347
|
| `architect` | Coordinates the workflow, writes plans, enforces gates | Always |
|
|
337
348
|
| `explorer` | Scans the codebase and gathers context | Before planning, after phase wrap |
|
|
338
349
|
| `sme` | Provides domain guidance | During planning / consultation |
|
|
339
|
-
| `critic` | Reviews the plan before execution | Before coding starts |
|
|
340
|
-
| `critic_sounding_board` | Pre-escalation pushback before user
|
|
341
|
-
| `critic_drift_verifier` | Phase
|
|
350
|
+
| `critic` | Reviews the plan before execution and blocks coding until approved | Before coding starts (CRITIC-GATE mode) |
|
|
351
|
+
| `critic_sounding_board` | Pre-escalation pushback β the architect consults this before contacting the user; returns UNNECESSARY / REPHRASE / APPROVED / RESOLVE | When architect hits an impasse |
|
|
352
|
+
| `critic_drift_verifier` | **Phase-close drift detector**: verifies that the completed implementation still matches the original plan spec. Returns APPROVED or NEEDS_REVISION. When NEEDS_REVISION is returned, the phase is **blocked** β the architect must address deviations before calling `phase_complete`. After receiving the verdict, the architect calls `write_drift_evidence` to record the gate result. Bypassed in turbo mode. | Before `phase_complete` (PHASE-WRAP mode) |
|
|
342
353
|
| `coder` | Implements one task at a time | During execution |
|
|
343
354
|
| `reviewer` | Reviews correctness and security | After each task |
|
|
344
355
|
| `test_engineer` | Writes and runs tests | After each task |
|
|
@@ -405,6 +416,9 @@ MODE: EXECUTE (per task)
|
|
|
405
416
|
βββ 5j. @test_engineer (verification tests + coverage β₯70%)
|
|
406
417
|
βββ 5k. @test_engineer (adversarial tests)
|
|
407
418
|
βββ 5l. architect regression sweep (scope:"graph" to find cross-task test regressions)
|
|
419
|
+
βββ 5l-ter. test drift detection (conditional β fires when changes involve command behaviour,
|
|
420
|
+
β parsing/routing logic, user-visible output, public contracts, assertion-heavy areas,
|
|
421
|
+
β or helper lifecycle changes; validates tests still align with current behaviour)
|
|
408
422
|
βββ 5m. β Pre-commit checklist (all 4 items required, no override)
|
|
409
423
|
βββ 5n. Task marked complete, evidence written
|
|
410
424
|
```
|
|
@@ -419,12 +433,12 @@ The architect moves through these modes automatically:
|
|
|
419
433
|
|---|---|
|
|
420
434
|
| `RESUME` | Existing `.swarm/` state was found, so Swarm continues where it left off |
|
|
421
435
|
| `CLARIFY` | Swarm asks for missing information it cannot infer |
|
|
422
|
-
| `DISCOVER` | Explorer scans the codebase |
|
|
436
|
+
| `DISCOVER` | Explorer scans the codebase; co-change dark matter analysis runs automatically to detect hidden file couplings (v6.41) |
|
|
423
437
|
| `CONSULT` | SME agents provide domain guidance |
|
|
424
438
|
| `PLAN` | Architect writes or updates the phased plan (includes CODEBASE REALITY CHECK on brownfield projects) |
|
|
425
439
|
| `CRITIC-GATE` | Critic reviews the plan before execution |
|
|
426
440
|
| `EXECUTE` | Tasks are implemented one at a time through the QA pipeline |
|
|
427
|
-
| `PHASE-WRAP` | A phase closes out, docs
|
|
441
|
+
| `PHASE-WRAP` | A phase closes out, including: explorer rescan, docs update, `context.md` update, `write_retro`, evidence check, `sbom_generate`, **`@critic_drift_verifier` delegation** (drift check β blocking gate), `write_drift_evidence` call with verdict, mandatory gate evidence verification (`completion-verify.json` + `drift-verifier.json` both required), then `phase_complete` |
|
|
428
442
|
|
|
429
443
|
> **CODEBASE REALITY CHECK (v6.29.2):** Before any planning, the Architect dispatches Explorer to verify the current state of every referenced item. Produces a CODEBASE REALITY REPORT with statuses: NOT STARTED, PARTIALLY DONE, ALREADY COMPLETE, or ASSUMPTION INCORRECT. This prevents planning against stale assumptions. Skipped for greenfield projects with no existing codebase references.
|
|
430
444
|
|
|
@@ -491,6 +505,8 @@ Every completed task writes structured evidence to `.swarm/evidence/`:
|
|
|
491
505
|
| diff | Files changed, additions/deletions |
|
|
492
506
|
| retrospective | Phase metrics, lessons learned, error taxonomy classification (injected into next phase) |
|
|
493
507
|
| secretscan | Secret scan results: findings count, files scanned, skipped files (v6.33) |
|
|
508
|
+
| completion-verify | Deterministic gate: verifies plan task identifiers exist in source files (written automatically by `completion-verify` tool; required before `phase_complete`) |
|
|
509
|
+
| drift-verifier | Phase-close drift gate: `critic_drift_verifier` verdict (APPROVED/NEEDS_REVISION) and summary (written by architect via `write_drift_evidence`; required before `phase_complete`) |
|
|
494
510
|
|
|
495
511
|
### telemetry.jsonl: Session Observability
|
|
496
512
|
|
|
@@ -832,7 +848,7 @@ To disable entirely, set `context_budget.enabled: false` in your swarm config.
|
|
|
832
848
|
|
|
833
849
|
| Tool | What It Does |
|
|
834
850
|
|------|-------------|
|
|
835
|
-
| syntax_check | Tree-sitter validation across
|
|
851
|
+
| syntax_check | Tree-sitter validation across 12 languages |
|
|
836
852
|
| placeholder_scan | Catches TODOs, FIXMEs, stubs, placeholder text |
|
|
837
853
|
| sast_scan | Offline security analysis, 63+ rules, 9 languages |
|
|
838
854
|
| sbom_generate | CycloneDX dependency tracking, 8 ecosystems |
|
|
@@ -840,7 +856,7 @@ To disable entirely, set `context_budget.enabled: false` in your swarm config.
|
|
|
840
856
|
| incremental_verify | Post-coder typecheck for TS/JS, Go, Rust, C# (v6.29.2) |
|
|
841
857
|
| quality_budget | Enforces complexity, duplication, and test ratio limits |
|
|
842
858
|
| pre_check_batch | Runs lint, secretscan, SAST, and quality budget in parallel (~15s vs ~60s sequential) |
|
|
843
|
-
| phase_complete | Enforces phase completion, verifies required agents, requires a valid retrospective evidence bundle, logs events, and resets state |
|
|
859
|
+
| phase_complete | Enforces phase completion, verifies required agents, requires a valid retrospective evidence bundle, logs events, and resets state; appends to `events.jsonl` with file locking |
|
|
844
860
|
|
|
845
861
|
|
|
846
862
|
All tools run locally. No Docker, no network calls, no external APIs.
|
|
@@ -866,6 +882,61 @@ Optional enhancement: Semgrep (if on PATH).
|
|
|
866
882
|
|
|
867
883
|
</details>
|
|
868
884
|
|
|
885
|
+
<details>
|
|
886
|
+
<summary><strong>File Locking for Concurrent Write Safety</strong></summary>
|
|
887
|
+
|
|
888
|
+
Swarm uses file locking to protect shared state files from concurrent write corruption. The locking strategy differs by file: `plan.json` uses hard locking (write blocked on contention), while `events.jsonl` uses advisory locking (write proceeds with a warning on contention).
|
|
889
|
+
|
|
890
|
+
### Locking Implementation
|
|
891
|
+
|
|
892
|
+
- **Library**: `proper-lockfile` with `retries: 0` (fail-fast β no polling retries)
|
|
893
|
+
- **Scope**: Each tool acquires an exclusive lock on the target file before writing
|
|
894
|
+
- **Agents**: Lock is tagged with the current agent name and task context for diagnostics
|
|
895
|
+
|
|
896
|
+
### Protected Files
|
|
897
|
+
|
|
898
|
+
| File | Tool | Lock Key |
|
|
899
|
+
|------|------|----------|
|
|
900
|
+
| `.swarm/plan.json` | `update_task_status` | `plan.json` |
|
|
901
|
+
| `.swarm/events.jsonl` | `phase_complete` | `events.jsonl` |
|
|
902
|
+
|
|
903
|
+
### Lock Semantics
|
|
904
|
+
|
|
905
|
+
The two protected tools use different strategies:
|
|
906
|
+
|
|
907
|
+
**`update_task_status` β Hard lock on `plan.json`**
|
|
908
|
+
|
|
909
|
+
When two calls contend for `plan.json`:
|
|
910
|
+
1. **Exactly one call wins** β only the first to acquire the lock proceeds
|
|
911
|
+
2. **Winner writes** β the lock holder writes to the file, then releases the lock
|
|
912
|
+
3. **Losers receive `success: false`** β with `recovery_guidance: "retry"` and an error message identifying the lock holder
|
|
913
|
+
|
|
914
|
+
```json
|
|
915
|
+
{
|
|
916
|
+
"success": false,
|
|
917
|
+
"message": "Task status write blocked: plan.json is locked by architect (task: update-task-status-1.1-1234567890)",
|
|
918
|
+
"errors": ["Concurrent plan write detected β retry after the current write completes"],
|
|
919
|
+
"recovery_guidance": "Wait a moment and retry update_task_status. The lock will expire automatically if the holding agent fails."
|
|
920
|
+
}
|
|
921
|
+
```
|
|
922
|
+
|
|
923
|
+
**What the caller should do**: Retry `update_task_status` after a short delay.
|
|
924
|
+
|
|
925
|
+
**`phase_complete` β Advisory lock on `events.jsonl`**
|
|
926
|
+
|
|
927
|
+
When two calls contend for `events.jsonl`:
|
|
928
|
+
1. **Lock is attempted** β if acquired, write is serialized
|
|
929
|
+
2. **If lock unavailable** β a warning is added to the result and the write proceeds anyway
|
|
930
|
+
3. **Both callers return `success: true`** β duplicate concurrent appends are possible but `events.jsonl` is an append-only log and duplicate phase entries do not corrupt state
|
|
931
|
+
|
|
932
|
+
This asymmetry is intentional: `plan.json` stores mutable structured JSON where concurrent overwrites produce malformed files; `events.jsonl` is an append-only log where a duplicate entry is a recoverable nuisance.
|
|
933
|
+
|
|
934
|
+
### Lock Recovery
|
|
935
|
+
|
|
936
|
+
If a lock-holding agent crashes or hangs, the lock file will eventually expire (handled by `proper-lockfile` stale-lock cleanup). On the next retry, the call will succeed. Swarm does not auto-retry on lock contention β the architect receives the error and decides when to retry.
|
|
937
|
+
|
|
938
|
+
</details>
|
|
939
|
+
|
|
869
940
|
<details>
|
|
870
941
|
<summary id="configuration-reference"><strong>Full Configuration Reference</strong></summary>
|
|
871
942
|
|
|
@@ -1064,12 +1135,26 @@ Control how tool outputs are summarized for LLM context.
|
|
|
1064
1135
|
| `/swarm benchmark` | Performance benchmarks |
|
|
1065
1136
|
| `/swarm retrieve [id]` | Retrieve auto-summarized tool outputs (supports offset/limit pagination) |
|
|
1066
1137
|
| `/swarm reset --confirm` | Clear swarm state files |
|
|
1138
|
+
| `/swarm reset-session` | Clear session state files in `.swarm/session/` (preserves plan and context) |
|
|
1067
1139
|
| `/swarm preflight` | Run phase preflight checks |
|
|
1068
1140
|
| `/swarm config doctor [--fix]` | Config validation with optional auto-fix |
|
|
1141
|
+
| `/swarm doctor tools` | Tool registration coherence and binary readiness check |
|
|
1069
1142
|
| `/swarm sync-plan` | Force plan.md regeneration from plan.json |
|
|
1070
1143
|
| `/swarm specify [description]` | Generate or import a feature specification |
|
|
1071
1144
|
| `/swarm clarify [topic]` | Clarify and refine an existing feature specification |
|
|
1072
1145
|
| `/swarm analyze` | Analyze spec.md vs plan.md for requirement coverage gaps |
|
|
1146
|
+
| `/swarm close [--prune-branches]` | Idempotent session close-out: retrospectives, lesson curation, evidence archive, context.md reset, config-backup cleanup, optional branch pruning |
|
|
1147
|
+
| `/swarm write-retro` | Write a phase retrospective manually |
|
|
1148
|
+
| `/swarm handoff` | Generate a handoff summary for context-budget-critical sessions |
|
|
1149
|
+
| `/swarm simulate` | Simulate plan execution without writing code |
|
|
1150
|
+
| `/swarm promote` | Promote swarm-scoped knowledge to hive (global) knowledge |
|
|
1151
|
+
| `/swarm evidence summary` | Generate a summary across all evidence bundles with completion ratio and blockers |
|
|
1152
|
+
| `/swarm knowledge` | List knowledge entries |
|
|
1153
|
+
| `/swarm knowledge migrate` | Migrate knowledge entries to the current format |
|
|
1154
|
+
| `/swarm knowledge quarantine [id]` | Move a knowledge entry to quarantine |
|
|
1155
|
+
| `/swarm knowledge restore [id]` | Restore a quarantined knowledge entry |
|
|
1156
|
+
| `/swarm turbo` | Enable turbo mode for the current session (bypasses QA gates) |
|
|
1157
|
+
| `/swarm checkpoint` | Save a git checkpoint for the current state |
|
|
1073
1158
|
|
|
1074
1159
|
</details>
|
|
1075
1160
|
|
|
@@ -1083,11 +1168,11 @@ Swarm limits which tools each agent can access based on their role. This prevent
|
|
|
1083
1168
|
|
|
1084
1169
|
| Agent | Tools | Count | Rationale |
|
|
1085
1170
|
|-------|-------|:---:|-----------|
|
|
1086
|
-
| **architect** | All
|
|
1087
|
-
| **reviewer** | diff, imports, lint, pkg_audit, pre_check_batch, secretscan, symbols, complexity_hotspots, retrieve_summary, extract_code_blocks, test_runner |
|
|
1088
|
-
| **coder** | diff, imports, lint, symbols, extract_code_blocks, retrieve_summary |
|
|
1089
|
-
| **test_engineer** | test_runner, diff, symbols, extract_code_blocks, retrieve_summary, imports, complexity_hotspots, pkg_audit |
|
|
1090
|
-
| **explorer** | complexity_hotspots, detect_domains, extract_code_blocks, gitingest, imports, retrieve_summary, schema_drift, symbols, todo_extract |
|
|
1171
|
+
| **architect** | All registered tools | β | Orchestrator needs full visibility |
|
|
1172
|
+
| **reviewer** | diff, imports, lint, pkg_audit, pre_check_batch, secretscan, symbols, complexity_hotspots, retrieve_summary, extract_code_blocks, test_runner, suggest_patch, batch_symbols | 13 | Security-focused QA |
|
|
1173
|
+
| **coder** | diff, imports, lint, symbols, extract_code_blocks, retrieve_summary, search | 7 | Write-focused, minimal read tools |
|
|
1174
|
+
| **test_engineer** | test_runner, diff, symbols, extract_code_blocks, retrieve_summary, imports, complexity_hotspots, pkg_audit, search | 9 | Testing and verification |
|
|
1175
|
+
| **explorer** | complexity_hotspots, detect_domains, extract_code_blocks, gitingest, imports, retrieve_summary, schema_drift, symbols, todo_extract, search, batch_symbols | 11 | Discovery and analysis |
|
|
1091
1176
|
| **sme** | complexity_hotspots, detect_domains, extract_code_blocks, imports, retrieve_summary, schema_drift, symbols | 7 | Domain expertise research |
|
|
1092
1177
|
| **critic** | complexity_hotspots, detect_domains, imports, retrieve_summary, symbols | 5 | Plan review, minimal toolset |
|
|
1093
1178
|
| **docs** | detect_domains, doc_extract, doc_scan, extract_code_blocks, gitingest, imports, retrieve_summary, schema_drift, symbols, todo_extract | 10 | Documentation synthesis and discovery |
|
|
@@ -1147,8 +1232,10 @@ The following tools can be assigned to agents via overrides:
|
|
|
1147
1232
|
|
|
1148
1233
|
| Tool | Purpose |
|
|
1149
1234
|
|------|---------|
|
|
1235
|
+
| `batch_symbols` | Extract exported symbols from multiple files in a single call; per-file error isolation; 75β98% call reduction vs sequential (v6.45); registered for architect, explorer, reviewer |
|
|
1150
1236
|
| `checkpoint` | Save/restore git checkpoints |
|
|
1151
1237
|
| `check_gate_status` | Read-only query of task gate status |
|
|
1238
|
+
| `co_change_analyzer` | Scan git history for files that co-change frequently; generates dark matter architecture knowledge entries during DISCOVER mode (v6.41); architect-only |
|
|
1152
1239
|
| `complexity_hotspots` | Identify high-risk code areas |
|
|
1153
1240
|
| `declare_scope` | Pre-declare the file scope for the next coder delegation (architect-only); violations trigger warnings |
|
|
1154
1241
|
| `detect_domains` | Detect SME domains from text |
|
|
@@ -1160,18 +1247,21 @@ The following tools can be assigned to agents via overrides:
|
|
|
1160
1247
|
| `gitingest` | Ingest external repositories |
|
|
1161
1248
|
| `imports` | Analyze import relationships |
|
|
1162
1249
|
| `lint` | Run project linters |
|
|
1163
|
-
| `phase_complete` | Enforces phase completion, verifies required agents, logs events, resets state |
|
|
1250
|
+
| `phase_complete` | Enforces phase completion, verifies required agents, logs events, resets state; appends to `events.jsonl` with file locking |
|
|
1164
1251
|
| `pkg_audit` | Security audit of dependencies |
|
|
1165
1252
|
| `pre_check_batch` | Parallel pre-checks (lint, secrets, SAST, quality) |
|
|
1166
1253
|
| `retrieve_summary` | Retrieve summarized tool outputs |
|
|
1254
|
+
| `save_plan` | Persist plan to `.swarm/plan.json`, `plan.md`, and ledger; also writes `SWARM_PLAN.md` / `SWARM_PLAN.json` checkpoint artifacts; requires explicit `working_directory` parameter |
|
|
1167
1255
|
| `schema_drift` | Detect OpenAPI/schema drift |
|
|
1256
|
+
| `search` | Workspace-scoped ripgrep-style structured text search; literal and regex modes, glob filtering, result limits (v6.45); registered for architect, coder, reviewer, explorer, test_engineer |
|
|
1168
1257
|
| `secretscan` | Scan for secrets in code |
|
|
1258
|
+
| `suggest_patch` | Generate contextual diff hunks without modifying files; read-only patch suggestions for reviewerβcoder handoff (v6.45); registered for reviewer and architect |
|
|
1169
1259
|
| `symbols` | Extract exported symbols |
|
|
1170
1260
|
| `test_runner` | Run project tests |
|
|
1171
|
-
| `update_task_status` | Mark plan tasks as pending/in_progress/completed/blocked; track phase progress |
|
|
1261
|
+
| `update_task_status` | Mark plan tasks as pending/in_progress/completed/blocked; track phase progress; acquires lock on `plan.json` before writing |
|
|
1172
1262
|
| `todo_extract` | Extract TODO/FIXME comments |
|
|
1173
1263
|
| `write_retro` | Document phase retrospectives via the phase_complete workflow; capture lessons learned |
|
|
1174
|
-
| `write_drift_evidence` | Write drift verification evidence after critic_drift_verifier completes |
|
|
1264
|
+
| `write_drift_evidence` | Write drift verification evidence after critic_drift_verifier completes; architect calls this after receiving the verifierβs verdict β the critic does not write files directly |
|
|
1175
1265
|
|
|
1176
1266
|
---
|
|
1177
1267
|
|
|
@@ -1180,8 +1270,34 @@ The following tools can be assigned to agents via overrides:
|
|
|
1180
1270
|
|
|
1181
1271
|
> For the complete version history, see [CHANGELOG.md](CHANGELOG.md) or [docs/releases/](docs/releases/).
|
|
1182
1272
|
|
|
1183
|
-
### v6.
|
|
1273
|
+
### v6.47.0 β `/swarm close` Full Session Close-Out
|
|
1274
|
+
|
|
1275
|
+
- **`/swarm close` expanded**: Now performs complete close-out: resets `context.md`, deletes stale `config-backup-*.json` files, supports plan-free sessions (PR reviews, investigations), and accepts `--prune-branches` to delete local branches whose remote tracking ref is `gone` (merged/deleted upstream).
|
|
1276
|
+
- **Lesson injection**: If `.swarm/close-lessons.md` exists when `/swarm close` runs, the architectβs explicit lessons are curated into the knowledge base before the file is deleted.
|
|
1277
|
+
|
|
1278
|
+
### v6.45.0 β New Search, Patch, and Batch Tools
|
|
1184
1279
|
|
|
1280
|
+
- **`search` tool**: Workspace-scoped ripgrep-style structured search with literal/regex modes and glob filtering. Registered for architect, coder, reviewer, explorer, test_engineer.
|
|
1281
|
+
- **`suggest_patch` tool**: Reviewer-safe context-anchored patch suggestion. Generates diff hunks without writing files. Registered for reviewer and architect.
|
|
1282
|
+
- **`batch_symbols` tool**: Batched symbol extraction from multiple files in one call; per-file error isolation; 75β98% call reduction vs sequential single-file calls. Registered for architect, explorer, reviewer.
|
|
1283
|
+
- **Step 5l-ter**: Test drift detection step added to the EXECUTE pipeline. Fires conditionally when changes involve command behaviour, parsing/routing logic, user-visible output, public contracts, assertion-heavy areas, or helper lifecycle changes.
|
|
1284
|
+
|
|
1285
|
+
### v6.44.0 β Durable Plan Ledger
|
|
1286
|
+
|
|
1287
|
+
- **`plan-ledger.jsonl`**: Append-only JSONL ledger is now the authoritative source of truth for plan state. `plan.json` and `plan.md` are projections derived from the ledger. `loadPlan()` auto-rebuilds projections from the ledger on hash mismatch.
|
|
1288
|
+
- **Checkpoint artifacts**: `writeCheckpoint()` writes `SWARM_PLAN.md` and `SWARM_PLAN.json` at the project root on every `save_plan`, `phase_complete`, and `/swarm close`. Use `SWARM_PLAN.json` to restore after data loss.
|
|
1289
|
+
- **Auto-generated tool lists**: Architect prompt `YOUR TOOLS` and `Available Tools` sections are now generated from `AGENT_TOOL_MAP.architect` β no more hand-maintained lists that drift.
|
|
1290
|
+
- See [docs/plan-durability.md](docs/plan-durability.md) for migration notes.
|
|
1291
|
+
|
|
1292
|
+
### v6.42.0 β Curator LLM Delegation Wired
|
|
1293
|
+
|
|
1294
|
+
- **Curator now performs real LLM analysis**: Previously the LLM delegation was scaffolded but never connected β every call fell through to data-only mode. All three call sites now invoke the Explorer agent with curator-specific system prompts.
|
|
1295
|
+
- **`curator.enabled` now defaults to `true`**: The curator falls back gracefully to data-only mode when no SDK client is available (e.g., in unit tests). If you relied on the previous `false` default, set `"curator": { "enabled": false }` explicitly.
|
|
1296
|
+
|
|
1297
|
+
### v6.41.0 β Dark Matter Detection + `/swarm close` + Drift Evidence Tool
|
|
1298
|
+
|
|
1299
|
+
- **Dark matter detection pipeline**: During DISCOVER mode, automatically scans git history for files that frequently co-change. Results are stored as `architecture` knowledge entries and the architect is guided to consider co-change partners when declaring scope. Silently skips repos with fewer than 20 commits or no git history.
|
|
1300
|
+
- **`/swarm close` command**: New idempotent close command. Writes retrospectives for in-progress phases, curates session lessons via the knowledge pipeline, archives evidence, marks phases/tasks as `closed`, writes `.swarm/close-summary.md`, and cleans state.
|
|
1185
1301
|
- **`write_drift_evidence` tool**: New architect tool for persisting drift verification evidence after critic_drift_verifier delegation
|
|
1186
1302
|
- Accepts phase number, verdict (APPROVED/NEEDS_REVISION), and summary
|
|
1187
1303
|
- Normalizes verdict automatically (APPROVED β approved, NEEDS_REVISION β rejected)
|
|
@@ -1235,7 +1351,7 @@ The following tools can be assigned to agents via overrides:
|
|
|
1235
1351
|
|
|
1236
1352
|
This release adds the optional Curator system for phase-level intelligence and fixes session snapshot persistence for task workflow states.
|
|
1237
1353
|
|
|
1238
|
-
- **Curator system**:
|
|
1354
|
+
- **Curator system**: Background analysis system (`curator.enabled = false` by default in v6.22; **changed to `true` in v6.42**). After each phase, collects events, checks compliance, and writes drift reports to `.swarm/drift-report-phase-N.json`. Three integration points: init on first phase, phase analysis after each phase, and drift injection into architect context at phase start.
|
|
1239
1355
|
- **Drift reports**: `runCriticDriftCheck` compares planned vs. actual decisions and writes structured drift reports with alignment scores (`ALIGNED` / `MINOR_DRIFT` / `MAJOR_DRIFT` / `OFF_SPEC`). Latest drift summary is prepended to the architect's knowledge context each phase.
|
|
1240
1356
|
- **Issue #81 fix β taskWorkflowStates persistence**: Session snapshots now correctly serialize and restore the per-task state machine. Invalid state values are filtered to `idle` on deserialization. `reconcileTaskStatesFromPlan` seeds task states from `plan.json` on snapshot load (completed β `tests_run`, in-progress β `coder_delegated`).
|
|
1241
1357
|
|
|
@@ -1367,7 +1483,7 @@ bun test
|
|
|
1367
1483
|
|
|
1368
1484
|
## Supported Languages
|
|
1369
1485
|
|
|
1370
|
-
OpenCode Swarm v6.
|
|
1486
|
+
OpenCode Swarm v6.46+ ships with language profiles for 12 languages across three quality tiers. All tools use graceful degradation β if a binary is not on PATH, the tool skips with a soft warning rather than a hard failure.
|
|
1371
1487
|
|
|
1372
1488
|
| Language | Tier | Syntax | Build | Test | Lint | Audit | SAST |
|
|
1373
1489
|
|---|:---:|:---:|:---:|:---:|:---:|:---:|:---:|
|
|
@@ -1382,6 +1498,9 @@ OpenCode Swarm v6.16+ ships with language profiles for 11 languages across three
|
|
|
1382
1498
|
| Swift | 2 | β
| β
swift build | β
swift test | β
swiftlint | β | πΆ Semgrep exp. |
|
|
1383
1499
|
| Dart / Flutter | 3 | β
| β
dart pub | β
dart test | β
dart analyze | β
dart pub outdated | β |
|
|
1384
1500
|
| Ruby | 3 | β
| β | β
RSpec / minitest | β
RuboCop | β
bundle-audit | πΆ Semgrep exp. |
|
|
1501
|
+
| PHP / Laravel | 3 | β
| β
Composer install | β
PHPUnit / Pest / artisan test | β
Pint / PHP-CS-Fixer | β
composer audit | β
10+ native rules |
|
|
1502
|
+
|
|
1503
|
+
> **PHP + Laravel baseline**: PHP v6.49+ ships with deterministic Laravel project detection (multi-signal: `artisan` file, `laravel/framework` dependency, `config/app.php`). When detected, commands are automatically overridden to `php artisan test`, Pint formatting, and PHPStan static analysis. Laravel-specific SAST rules cover SQL injection via raw queries, mass-assignment vulnerabilities, and destructive migrations without rollback. `.blade.php` files are included in all scanning pipelines.
|
|
1385
1504
|
|
|
1386
1505
|
**Tier definitions:**
|
|
1387
1506
|
- **Tier 1** β Full pipeline: all tools integrated and tested end-to-end.
|
|
@@ -1394,9 +1513,11 @@ OpenCode Swarm v6.16+ ships with language profiles for 11 languages across three
|
|
|
1394
1513
|
|
|
1395
1514
|
## Curator
|
|
1396
1515
|
|
|
1397
|
-
The Curator is
|
|
1516
|
+
The Curator is a background analysis system that runs after each phase. It is **enabled by default** as of v6.42 (`curator.enabled = true`) and never blocks execution β all Curator operations are wrapped in try/catch. It falls back gracefully to data-only mode when no SDK client is available.
|
|
1398
1517
|
|
|
1399
|
-
|
|
1518
|
+
Since v6.42, the Curator performs real LLM analysis by delegating to the Explorer agent with curator-specific prompts. Before v6.42, the LLM delegation was scaffolded but never wired.
|
|
1519
|
+
|
|
1520
|
+
To disable, set `"curator": { "enabled": false }` in your config. When enabled, it writes `.swarm/curator-summary.json`, `.swarm/curator-briefing.md`, and `.swarm/drift-report-phase-N.json` files.
|
|
1400
1521
|
|
|
1401
1522
|
### What the Curator Does
|
|
1402
1523
|
|
|
@@ -1414,7 +1535,7 @@ Add a `curator` block to `.opencode/opencode-swarm.json`:
|
|
|
1414
1535
|
```json
|
|
1415
1536
|
{
|
|
1416
1537
|
"curator": {
|
|
1417
|
-
"enabled":
|
|
1538
|
+
"enabled": true,
|
|
1418
1539
|
"init_enabled": true,
|
|
1419
1540
|
"phase_enabled": true,
|
|
1420
1541
|
"max_summary_tokens": 2000,
|
|
@@ -1428,7 +1549,7 @@ Add a `curator` block to `.opencode/opencode-swarm.json`:
|
|
|
1428
1549
|
|
|
1429
1550
|
| Field | Default | Description |
|
|
1430
1551
|
|-------|---------|-------------|
|
|
1431
|
-
| `enabled` | `
|
|
1552
|
+
| `enabled` | `true` | Master switch. Set to `false` to disable the Curator pipeline. |
|
|
1432
1553
|
| `init_enabled` | `true` | Initialize curator summary on first phase (requires `enabled: true`). |
|
|
1433
1554
|
| `phase_enabled` | `true` | Run phase analysis and knowledge updates after each phase. |
|
|
1434
1555
|
| `max_summary_tokens` | `2000` | Maximum token budget for curator knowledge summaries. |
|
|
@@ -1477,6 +1598,7 @@ Run `/swarm reset --confirm`.
|
|
|
1477
1598
|
- [Getting Started](docs/getting-started.md)
|
|
1478
1599
|
- [Architecture Deep Dive](docs/architecture.md)
|
|
1479
1600
|
- [Design Rationale](docs/design-rationale.md)
|
|
1601
|
+
- [Plan Durability & Ledger](docs/plan-durability.md)
|
|
1480
1602
|
- [Installation Guide](docs/installation.md)
|
|
1481
1603
|
- [Linux + Docker Desktop Install Guide](docs/installation-linux-docker.md)
|
|
1482
1604
|
- [LLM Operator Installation Guide](docs/installation-llm-operator.md)
|