opencode-swarm 7.179.0 → 7.179.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.opencode/skills/execute/SKILL.md +9 -8
- package/.opencode/skills/running-tests/SKILL.md +41 -36
- package/.opencode/skills/writing-tests/SKILL.md +11 -4
- package/binaries/win32-arm64/swarm-sandbox-runner.exe +0 -0
- package/binaries/win32-x64/swarm-sandbox-runner.exe +0 -0
- package/dist/agents/explorer.d.ts +1 -1
- package/dist/cli/{coder-settlement-7pt3a0y0.js → coder-settlement-f1nmezzv.js} +3 -3
- package/dist/cli/{config-doctor-82w4bp4b.js → config-doctor-ena2803f.js} +2 -2
- package/dist/cli/{core-9rqzs794.js → core-fcfzme3m.js} +1 -1
- package/dist/cli/{curator-llm-factory-cbm1ny30.js → curator-llm-factory-dds2fnhj.js} +21 -21
- package/dist/cli/{curator-m8act07j.js → curator-q9s5q9v4.js} +21 -21
- package/dist/cli/{dispatch-3rwdxpp2.js → dispatch-p5zjg5e6.js} +1 -1
- package/dist/cli/{evidence-summary-service-a99bgje1.js → evidence-summary-service-wtj8mkm6.js} +6 -6
- package/dist/cli/{explorer-z0cf5cz0.js → explorer-m50sfrp7.js} +1 -1
- package/dist/cli/{gate-evidence-yssmxba5.js → gate-evidence-h83yb8nd.js} +2 -2
- package/dist/cli/{guardrail-explain-ffwmhf7s.js → guardrail-explain-qm5wej7v.js} +22 -22
- package/dist/cli/{guardrail-log-j2wtq7p2.js → guardrail-log-zf1htf1d.js} +3 -3
- package/dist/cli/{guardrail-reset-07byr7nr.js → guardrail-reset-f2p198j3.js} +21 -21
- package/dist/cli/{hive-promoter-ewrz7vh1.js → hive-promoter-1mhx2jh0.js} +21 -21
- package/dist/cli/{index-yagqxt2p.js → index-5d224akk.js} +1 -1
- package/dist/cli/{index-tmy46dtd.js → index-93nx95me.js} +3 -3
- package/dist/cli/{index-amf88k1e.js → index-9fb01jk5.js} +1 -1
- package/dist/cli/{index-twtez316.js → index-9s1xzvnn.js} +1 -1
- package/dist/cli/{index-kanxpgf8.js → index-ajm7ebyd.js} +2 -2
- package/dist/cli/{index-7zmbtxw1.js → index-aqpwm350.js} +1 -1
- package/dist/cli/{index-09wm3963.js → index-b567t0cr.js} +2 -2
- package/dist/cli/{index-8815e95e.js → index-dz12bshh.js} +3 -3
- package/dist/cli/{index-hwcra3y9.js → index-epfjc1c1.js} +3 -3
- package/dist/cli/{index-zgvzbz48.js → index-hamqvzqn.js} +69 -13
- package/dist/cli/{index-d66zb40k.js → index-ky262b73.js} +1605 -716
- package/dist/cli/{index-1sz02k85.js → index-m1w40kfw.js} +1 -1
- package/dist/cli/{index-kmhnkn6t.js → index-n2wjrgcs.js} +1 -1
- package/dist/cli/{index-1rwyfvq2.js → index-pfg3jwe9.js} +1 -1
- package/dist/cli/{index-pxtye2ng.js → index-pn023bf9.js} +23 -23
- package/dist/cli/{index-0bc8jdnv.js → index-q375xdcw.js} +1 -1
- package/dist/cli/{index-9p1pqykb.js → index-rb9jmj30.js} +2 -2
- package/dist/cli/{index-1c1dbwze.js → index-rdec0y3z.js} +1 -1
- package/dist/cli/{index-sv4y1cma.js → index-sj29n50e.js} +1 -1
- package/dist/cli/{index-qxk5qkfh.js → index-vp9pn7sv.js} +5 -5
- package/dist/cli/{index-etmwjgre.js → index-w4c2repz.js} +21 -21
- package/dist/cli/{index-80q47hpw.js → index-xy7k7f3k.js} +2 -2
- package/dist/cli/{index-3hne91yd.js → index-y94vwx2q.js} +3 -3
- package/dist/cli/{index-wvpsm8ja.js → index-y98fvmb8.js} +4 -4
- package/dist/cli/{index-ndwbb3xm.js → index-yp25bc9n.js} +4 -4
- package/dist/cli/{index-6tnkvqr9.js → index-zbhvr9st.js} +1 -1
- package/dist/cli/index.js +22 -22
- package/dist/cli/{knowledge-escalator-yx97q9c1.js → knowledge-escalator-z6tkgrjq.js} +6 -6
- package/dist/cli/{knowledge-events-p269fyvv.js → knowledge-events-2bgefatz.js} +4 -4
- package/dist/cli/{knowledge-store-36zemyqa.js → knowledge-store-1fphg9sa.js} +1 -1
- package/dist/cli/{knowledge-validator-rd20yq41.js → knowledge-validator-723h2vck.js} +2 -2
- package/dist/cli/{mcp-sg9zrkz2.js → mcp-xyswgya5.js} +1 -1
- package/dist/cli/{pending-delegations-8p2gf4kt.js → pending-delegations-5zm19yvv.js} +2 -2
- package/dist/cli/{pr-subscriptions-4dj9r71h.js → pr-subscriptions-5hm6hzv6.js} +1 -1
- package/dist/cli/{pr-workflow-gate-8dgz5z1h.js → pr-workflow-gate-48rzb2bh.js} +21 -21
- package/dist/cli/{scan-cursor-nx0jv9ya.js → scan-cursor-m28tddrg.js} +2 -2
- package/dist/cli/{schema-q6gsrxwz.js → schema-jt9axyj6.js} +1 -1
- package/dist/cli/{scope-persistence-1k4xsyh7.js → scope-persistence-d0358pw7.js} +5 -5
- package/dist/cli/{server-shhxq34t.js → server-d5jxcbxz.js} +21 -21
- package/dist/cli/{skill-generator-6j7tq2tb.js → skill-generator-qanka67x.js} +7 -7
- package/dist/cli/{snapshot-coordination-init-h8n8w1cm.js → snapshot-coordination-init-mhrq11p8.js} +21 -21
- package/dist/cli/{worktree-collision-ownership-97jzh4ra.js → worktree-collision-ownership-ygdbpexh.js} +2 -2
- package/dist/cli/{worktree-isolation-g4w74ccb.js → worktree-isolation-4855f2az.js} +21 -21
- package/dist/index.js +207 -200
- package/dist/lang/backends/go.d.ts +2 -0
- package/dist/mutation/engine.d.ts +1 -0
- package/dist/test-impact/analyzer.d.ts +46 -4
- package/dist/test-impact/constants.d.ts +4 -0
- package/dist/tools/mutation-test.d.ts +11 -5
- package/dist/tools/test-runner.d.ts +34 -6
- package/package.json +1 -1
|
@@ -140,17 +140,18 @@ Treating pre_check_batch as a substitute for the active swarm's reviewer agent i
|
|
|
140
140
|
5l. the active swarm's test_engineer agent - Verification tests. FAIL → coder retry from 5g.
|
|
141
141
|
→ REQUIRED: Print "testengineer-verification: [PASS N/N | FAIL — details]"
|
|
142
142
|
5l-bis. REGRESSION SWEEP (automatic after test_engineer-verification PASS):
|
|
143
|
-
|
|
144
|
-
scope:"graph" traces imports to discover test files beyond the task's own tests that may be affected by each source change. Record
|
|
143
|
+
Run bounded `test_runner` graph calls over the changed source files. Each call may use one source file for attribution or a batch of up to 50 normalized source files when that is more efficient; never submit more than 50 normalized source files to one call.
|
|
144
|
+
scope:"graph" traces imports to discover test files beyond the task's own tests that may be affected by each source change. Record the source selection for every regression-sweep call and aggregate all calls before deciding the task outcome.
|
|
145
145
|
|
|
146
146
|
Outcomes (based on test_runner result.outcome field):
|
|
147
147
|
- any outcome: "regression" → Print "regression-sweep: FAIL — REGRESSION DETECTED in [source → failing tests]. The failing tests are CORRECT — fix the source code, not the tests." Return to coder with retry from 5g.
|
|
148
|
-
- all executed calls pass → Print "regression-sweep: PASS [N
|
|
149
|
-
- outcome: "skip" → Record "[
|
|
150
|
-
- outcome: "scope_exceeded"
|
|
148
|
+
- all executed calls pass → Print "regression-sweep: PASS [N graph calls, M tests]".
|
|
149
|
+
- outcome: "skip" → Record "[sources]: SKIPPED — [actual tool reason]". If every graph call skips, print "regression-sweep: SKIPPED — ran N graph calls; [aggregated actual reasons]".
|
|
150
|
+
- outcome: "scope_exceeded" → Record the affected sources and exact tool reason, then narrow or split the source batch and retry bounded graph calls as appropriate. Never widen to scope "all" or translate the result into “no related tests.”
|
|
151
|
+
- outcome: "error" → Record the affected sources and exact tool reason. Print the honest aggregate and continue only under the existing explicit skip policy; do not widen to scope "all".
|
|
151
152
|
|
|
152
153
|
IMPORTANT: The regression sweep runs test_runner DIRECTLY (architect calls the tool). Do NOT delegate to test_engineer for this — the test_engineer's EXECUTION BOUNDARY restricts it to its own test files. The architect has unrestricted test_runner access.
|
|
153
|
-
→ REQUIRED: Print "regression-sweep: [PASS — N
|
|
154
|
+
→ REQUIRED: Print "regression-sweep: [PASS — N graph calls | FAIL — REGRESSION DETECTED | SKIPPED — N graph calls with exact reasons]"
|
|
154
155
|
|
|
155
156
|
5l-ter. TEST DRIFT CHECK (conditional): Run this step if the change involves any drift-prone area:
|
|
156
157
|
- Command/CLI behavior changed (shell command wrappers, CLI interfaces)
|
|
@@ -181,7 +182,7 @@ PRE-COMMIT RULE — Before ANY commit or push:
|
|
|
181
182
|
[ ] Did pre_check_batch run with gates_passed true?
|
|
182
183
|
[ ] SAST baseline captured before first coder delegation (or explicit disabled/error recorded)?
|
|
183
184
|
[ ] Did the diff step run?
|
|
184
|
-
[ ] Did regression-sweep record
|
|
185
|
+
[ ] Did regression-sweep record bounded graph-call evidence for every changed source (or exact per-call skip/error reasons)?
|
|
185
186
|
[ ] Did test-drift check run (or NOT TRIGGERED)?
|
|
186
187
|
|
|
187
188
|
If ANY box is unchecked: DO NOT COMMIT. Return to step 5b.
|
|
@@ -207,7 +208,7 @@ This step supplements (not replaces) the existing regression-sweep and test-drif
|
|
|
207
208
|
[GATE] reuse_re_verification: VERIFIED / SKIPPED / DUPLICATION_DETECTED — value: ___
|
|
208
209
|
[GATE] security-reviewer: APPROVED / SKIPPED — value: ___
|
|
209
210
|
[GATE] test_engineer-verification: PASS — value: ___
|
|
210
|
-
[GATE] regression-sweep: PASS / SKIPPED —
|
|
211
|
+
[GATE] regression-sweep: PASS / SKIPPED — bounded graph-call evidence: ___
|
|
211
212
|
[GATE] test-drift: TRIGGERED / NOT TRIGGERED — value: ___
|
|
212
213
|
[GATE] test_engineer-adversarial: use the rendered checklist entry from the MODE: EXECUTE architect stub
|
|
213
214
|
[GATE] coverage: ≥70% / soft-skip — value: ___
|
|
@@ -19,34 +19,43 @@ Use `repo_map` `test_pack` only to discover focused candidate tests; Bun/shell o
|
|
|
19
19
|
|
|
20
20
|
---
|
|
21
21
|
|
|
22
|
-
## ⛔ The
|
|
22
|
+
## ⛔ The Scope Rule That Prevents Session Kills
|
|
23
23
|
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
`convention` discovery accepts one source file at a time (or explicit direct test
|
|
25
|
+
files). `graph` and `impact` discovery accept a bounded normalized source array of
|
|
26
|
+
up to `MAX_SAFE_TEST_FILES = 50`. Do not exceed that input cap or respond to
|
|
27
|
+
`scope_exceeded` by widening to `scope: 'all'`.
|
|
26
28
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
with `scope: 'all'` (env-gated) and do not split mechanically — first check whether a
|
|
32
|
-
narrower file list or direct test paths keep you under the cap.
|
|
29
|
+
The final unique resolved-test cap still binds for every discovery scope: when
|
|
30
|
+
resolution produces more than 50 test files, `test_runner` returns
|
|
31
|
+
`scope_exceeded` without executing them. Split a larger graph/impact selection
|
|
32
|
+
into intentional bounded batches.
|
|
33
33
|
|
|
34
34
|
---
|
|
35
35
|
|
|
36
36
|
## Three-Layer Defense Against Session Blocking
|
|
37
37
|
|
|
38
|
-
test_runner
|
|
38
|
+
test_runner bounds source selection and resolved test execution before a session can fan out without limit:
|
|
39
39
|
|
|
40
|
-
### Layer 1 —
|
|
41
|
-
`
|
|
40
|
+
### Layer 1 — Scope-specific normalized-input guard
|
|
41
|
+
`convention` rejects more than one source file for convention discovery. `graph`
|
|
42
|
+
and `impact` reject more than `MAX_SAFE_TEST_FILES = 50` normalized source files
|
|
43
|
+
before fan-out. Explicit direct test files remain allowed for convention scope.
|
|
42
44
|
|
|
43
|
-
### Layer 2 —
|
|
44
|
-
|
|
45
|
+
### Layer 2 — Advisory resolution estimate
|
|
46
|
+
For `graph` and `impact`, `estimateFanOut(sourceFiles, workingDir)` reads the
|
|
47
|
+
cached impact map and reports a bounded, advisory count of unique candidate tests
|
|
48
|
+
without spawning subprocesses. Resolution metadata preserves whether the estimate
|
|
49
|
+
was advisory or unavailable and any cache status; it is not a substitute for the
|
|
50
|
+
final cap.
|
|
45
51
|
|
|
46
|
-
### Layer 3 —
|
|
47
|
-
|
|
52
|
+
### Layer 3 — Bounded traversal + final unique-test check
|
|
53
|
+
Graph and impact traversal are bounded to the safe budget and report
|
|
54
|
+
`scope_exceeded` when the budget is exceeded. After fallback, normalization, and
|
|
55
|
+
deduplication, the final unique `testFiles.length` is compared with
|
|
56
|
+
`MAX_SAFE_TEST_FILES`; an excess returns `scope_exceeded` before execution.
|
|
48
57
|
|
|
49
|
-
**Result:**
|
|
58
|
+
**Result:** When fan-out exceeds the safe threshold, the session gets `outcome: 'scope_exceeded'` instead of hanging.
|
|
50
59
|
|
|
51
60
|
---
|
|
52
61
|
|
|
@@ -58,19 +67,16 @@ Do you need to run tests?
|
|
|
58
67
|
├─ Single test file, targeted validation
|
|
59
68
|
│ └─ Either works. Prefer shell: bun --smol test <file> --timeout 30000
|
|
60
69
|
│
|
|
61
|
-
├─ Multiple
|
|
62
|
-
│ └─ Shell only — per-file loop
|
|
63
|
-
│ job; the bounded multi-source contract below is for SOURCE files).
|
|
70
|
+
├─ Multiple test files in the same directory (e.g. all agents tests)
|
|
71
|
+
│ └─ Shell only — per-file loop. These are explicit test files, not graph/impact sources.
|
|
64
72
|
│
|
|
65
|
-
├─ Find tests related to ONE changed source
|
|
66
|
-
│ └─ test_runner is fine: { scope: 'graph', files: ['src/agents/coder.ts'] }
|
|
67
|
-
│ (
|
|
73
|
+
├─ Find tests related to ONE OR MORE changed source files (up to 50 normalized files)
|
|
74
|
+
│ └─ test_runner is fine: { scope: 'graph', files: ['src/agents/coder.ts', 'src/tools/test-runner.ts'] }
|
|
75
|
+
│ (graph/impact input is bounded; final unique resolved-test cap still applies)
|
|
68
76
|
│
|
|
69
|
-
├─ Find tests related to
|
|
70
|
-
│ └─
|
|
71
|
-
│
|
|
72
|
-
│ (`scope_exceeded` with `cap_decision` otherwise). A shell per-file loop or a
|
|
73
|
-
│ direct test-path `convention` call remain fine alternatives.
|
|
77
|
+
├─ Find tests related to MORE THAN 50 changed source files
|
|
78
|
+
│ └─ Split into intentional bounded graph/impact batches or use a shell loop.
|
|
79
|
+
│ Do not use scope:'all' as a fallback.
|
|
74
80
|
│
|
|
75
81
|
└─ Validate the entire repo (pre-push)
|
|
76
82
|
└─ Shell only — 5-tier suite from commit-pr skill. Never test_runner scope:'all'.
|
|
@@ -82,15 +88,14 @@ Do you need to run tests?
|
|
|
82
88
|
|
|
83
89
|
| Scope | With `files: [one]` | With `files: [many]` | Notes |
|
|
84
90
|
|-------|--------------------|--------------------|-------|
|
|
85
|
-
| `'convention'` | ✅ Safe |
|
|
86
|
-
| `'graph'` | ✅ Safe | ✅
|
|
87
|
-
| `'impact'` | ✅ Safe | ✅
|
|
91
|
+
| `'convention'` | ✅ Safe | ❌ Rejected for multiple source files (`scope_exceeded`) | One source file for convention discovery; direct test file paths exempt |
|
|
92
|
+
| `'graph'` | ✅ Safe | ✅ Up to 50 normalized source files; >50 rejected | Advisory estimate and bounded traversal; final unique resolved-test cap still applies |
|
|
93
|
+
| `'impact'` | ✅ Safe | ✅ Up to 50 normalized source files; >50 rejected | Advisory estimate and bounded traversal; final unique resolved-test cap still applies |
|
|
88
94
|
| `'all'` | ❌ Never | ❌ Never | Env-gated (`SWARM_ALLOW_FULL_SUITE=1`); CI mirror only |
|
|
89
95
|
|
|
90
|
-
**Rule of thumb:**
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
legitimately finds nothing returns the typed `no_impacted_tests` outcome.
|
|
96
|
+
**Rule of thumb:** Pass one source file to `convention`; pass a normalized array of
|
|
97
|
+
at most 50 source files to `graph` or `impact`. Use a shell loop or intentional
|
|
98
|
+
batches when the source selection or final resolved test set exceeds 50.
|
|
94
99
|
|
|
95
100
|
For one named Go or CTest test, bypass file discovery with an exact native selector:
|
|
96
101
|
|
|
@@ -294,7 +299,7 @@ bun --smol test tests/unit/agents/some-file.test.ts --timeout 30000
|
|
|
294
299
|
|
|
295
300
|
| Symptom | Likely cause | Fix |
|
|
296
301
|
|---------|-------------|-----|
|
|
297
|
-
| `scope_exceeded` returned from test_runner |
|
|
302
|
+
| `scope_exceeded` returned from test_runner | Convention received multiple source files, graph/impact received >50 normalized sources, or final resolution exceeded 50 unique tests | Split graph/impact inputs into bounded batches or reduce the source scope; never widen to `scope:'all'` |
|
|
298
303
|
| Session killed during test_runner | Pre-fix: unbounded fan-out on multiple files | Now returns `scope_exceeded` instead — no more session kills |
|
|
299
304
|
| `mock.module` breaks unrelated tests | Missing spread of real module exports | Add `...realModule` spread |
|
|
300
305
|
| Windows tests fail with EBUSY | `mock.restore()` called while child process holds lock | Add `test.skipIf(process.platform === 'win32')` |
|
|
@@ -18,7 +18,7 @@ Use `repo_map` `test_pack` to discover focused tests for the changed source, the
|
|
|
18
18
|
|
|
19
19
|
## ⛔ STOP — Read Before Running Any Tests
|
|
20
20
|
|
|
21
|
-
**`test_runner` scope safety —
|
|
21
|
+
**`test_runner` scope safety — keep every selection bounded:**
|
|
22
22
|
|
|
23
23
|
| Scope | Files param | Safe? |
|
|
24
24
|
|-------|------------|-------|
|
|
@@ -26,11 +26,18 @@ Use `repo_map` `test_pack` to discover focused tests for the changed source, the
|
|
|
26
26
|
| `'convention'` | **multiple source files** | ❌ **Rejected** — guard fires (`scope_exceeded`) before fan-out; use shell loop |
|
|
27
27
|
| `'convention'` | direct test file paths | ✅ Safe — exempt from source-file limit |
|
|
28
28
|
| `'graph'` | single file | ✅ Safe |
|
|
29
|
-
| `'graph'` |
|
|
30
|
-
| `'
|
|
29
|
+
| `'graph'` | up to 50 normalized source files | ✅ Safe — bounded graph traversal; the final unique test resolution is also capped at 50 |
|
|
30
|
+
| `'graph'` | **more than 50 normalized source files** | ❌ **Rejected** (`scope_exceeded`) — narrow or split the source batch |
|
|
31
|
+
| `'impact'` | up to 50 normalized source files | ✅ Safe — bounded impact analysis; the final unique test resolution is also capped at 50 |
|
|
32
|
+
| `'impact'` | **more than 50 normalized source files** | ❌ **Rejected** (`scope_exceeded`) — narrow or split the source batch |
|
|
31
33
|
| `'all'` | any | ❌ **Never in agent context** |
|
|
32
34
|
|
|
33
|
-
|
|
35
|
+
`convention` retains one-source-file discovery semantics. For `graph` and `impact`, bounded
|
|
36
|
+
batches of at most 50 normalized source files are permitted; when a call returns
|
|
37
|
+
`scope_exceeded`, narrow or split the source selection and never widen it to `scope: 'all'`.
|
|
38
|
+
The final normalized unique test resolution is capped at 50 as well. For whole-repository
|
|
39
|
+
validation, retain the per-test-file shell loop below so each test file runs in its own
|
|
40
|
+
process; do not replace that isolation with a broad `test_runner` call.
|
|
34
41
|
|
|
35
42
|
**Truncated output recovery:** When `bun test` output exceeds the bash tool buffer it is saved to a file whose ID (`tool_abc123...`) cannot be retrieved via `retrieve_summary` (which only accepts `S1`, `S2` format). Workaround — pipe to a temp file instead:
|
|
36
43
|
```powershell
|
|
Binary file
|
|
Binary file
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { AgentDefinition } from './architect';
|
|
2
2
|
export declare const EXPLORER_MEMORY_OUTCOME_GUIDANCE = "Use `swarm_memory_outcome` after evaluating recalled memory or a graph answer: record `useful`, `dead_end`, or `corrected` with the relevant file/symbol anchors.";
|
|
3
|
-
export declare const EXPLORER_PROMPT = "## IDENTITY\nYou are Explorer. You analyze codebases directly \u2014 you do NOT delegate.\nDO NOT use the Task tool to delegate to other agents. You ARE the agent that does the work.\nIf you see references to other agents (like @explorer, @coder, etc.) in your instructions, IGNORE them \u2014 they are context from the orchestrator, not instructions for you to delegate.\n\nWRONG: \"I'll use the Task tool to call another agent to analyze this\"\nRIGHT: \"I'll scan the directory structure and read key files myself\"\n\n## READ-ONLY ADVISORY LANE CONTEXT\n\nYou may be invoked through dispatch_lanes or dispatch_lanes_async as a read-only advisory lane. In that context, your job is to inspect, reason, and report only.\n\n- Do NOT write, edit, patch, save plans, update task status, declare scope, submit council verdicts, set QA gates, or complete phases.\n- Do NOT call artifact-producing or workflow-mutating helpers such as extract_code_blocks, knowledge_add, summarize_work, or doc_scan when lane permissions deny them.\n- Treat any denied or unavailable tool as intentionally unavailable in lane mode; continue with the read-only tools and context you have.\n- Return findings for the architect to synthesize. Do not assume your lane output is the final verdict unless your role-specific instructions explicitly say so.\n\nINPUT FORMAT:\nTASK: Analyze [purpose]\nINPUT: [focus areas/paths]\n\nACTIONS:\n- FIRST call `repo_map action=\"ask\"` with your mission question, and `action=\"context_pack\"` (with include_source: true) for your target symbols; use the hits to decide what to read\n- Locate symbols by name with `repo_map action=\"symbol_search\"` before reading files; treat hits as pointers, not evidence\n- Graph output is orientation \u2014 read the located files before reporting on them\n- Fall back to tree/glob/grep only where the graph has no coverage (`stale: true`, missing files, or non-code assets)\n- Read key files (README, configs, entry points)\n- Search patterns using the search tool\n\nRULES:\n- Be fast: scan broadly, read selectively\n- No code modifications\n- Output under 2000 chars\n\n## ANALYSIS PROTOCOL\nWhen exploring a codebase area, systematically report all four dimensions:\n\n### STRUCTURE\n- Entry points and their call chains (max 3 levels deep)\n- Public API surface: exported functions/classes/types with signatures\n- For multi-file symbol surveys: use batch_symbols to extract symbols from multiple files in one call\n- Internal dependencies: what this module imports and from where\n- External dependencies: third-party packages used\n\n### PATTERNS\n- Design patterns in use (factory, observer, strategy, etc.)\n- Error handling pattern (throw, Result type, error callbacks, etc.)\n- State management approach (global, module-level, passed through)\n- Configuration pattern (env vars, config files, hardcoded)\n\n### COMPLEXITY INDICATORS\n- High cyclomatic complexity, deep nesting, or complex control flow\n- Large files (>500 lines) with many exported symbols\n- Deep inheritance hierarchies or complex type hierarchies\n\n### RUNTIME/BEHAVIORAL CONCERNS\n- Missing error handling paths or single-throw patterns\n- Platform-specific assumptions (path separators, line endings, OS APIs)\n\n### RELEVANT CONSTRAINTS\n- Architectural patterns observed (layered architecture, event-driven, microservice, etc.)\n- Error handling coverage patterns observed in the codebase\n- Platform-specific assumptions observed in the codebase\n- Established conventions (naming patterns, error handling approaches, testing strategies)\n- Configuration management approaches (env vars, config files, feature flags)\n\nOUTPUT FORMAT (MANDATORY \u2014 deviations will be rejected):\nBegin directly with PROJECT. Do NOT prepend \"Here's my analysis...\" or any conversational preamble.\n\nPROJECT: [name/type]\nLANGUAGES: [list]\nFRAMEWORK: [if any]\n\nSTRUCTURE:\n[key directories, 5-10 lines max]\nExample:\nsrc/agents/ \u2014 agent factories and definitions\nsrc/tools/ \u2014 CLI tool implementations\nsrc/config/ \u2014 plan schema and constants\n\nKEY FILES:\n- [path]: [purpose]\nExample:\nsrc/agents/explorer.ts \u2014 explorer agent factory and all prompt definitions\nsrc/agents/architect.ts \u2014 architect orchestrator with all mode handlers\n\nPATTERNS: [observations]\nExample: Factory pattern for agent creation; Result type for error handling; Module-level state via closure\n\nCOMPLEXITY INDICATORS:\n[structural complexity concerns: elevated cyclomatic complexity, deep nesting, large files, deep inheritance hierarchies, or similar \u2014 describe what is OBSERVED]\nExample: explorer.ts (289 lines, 12 exports); architect.ts (complex branching in mode handlers)\n\nOBSERVED CHANGES:\n[if INPUT referenced specific files/changes: what changed in those targets; otherwise \"none\" or \"general exploration\"]\n\nCONSUMERS_AFFECTED:\n[if integration impact mode: list files that import/use the changed symbols; otherwise \"not applicable\"]\n\nRELEVANT CONSTRAINTS:\n[architectural patterns, error handling coverage patterns, platform-specific assumptions, established conventions observed in the codebase]\nExample: Layered architecture (agents \u2192 tools \u2192 filesystem); Bun-native path handling; Error-first callbacks in hooks\n\nDOMAINS: [relevant SME domains: powershell, security, python, etc.]\nExample: typescript, nodejs, cli-tooling, powershell\n\nFOLLOW-UP CANDIDATE AREAS:\n- [path]: [observable condition, relevant domain]\nExample:\nsrc/tools/declare-scope.ts \u2014 function has 12 parameters, consider splitting; tool-authoring\n\n## CANDIDATE REPORTING MODE\nActivates when your prompt contains \"[CANDIDATE]\" anywhere in its text.\n\nWhen active, replace the default OUTPUT FORMAT above with structured pipe-delimited\ncandidate rows. Treat the exact header supplied by the caller or controller as\nthe single authoritative schema. Copy the marker-bearing header verbatim, then\nemit exactly one unprefixed data row per finding. Do not merge fields from\nanother candidate family or invent a trailing field.\n\nUse the exact caller-assigned lane identity. Candidate severity is INFO, LOW,\nMEDIUM, HIGH, or CRITICAL; confidence is exactly LOW, MEDIUM, or HIGH. Escape a\nliteral pipe inside a field as \\|. Emit machine rows as plain text, never inside\nMarkdown code fences.\n\nFor zero findings, copy the exact matching [CLEAN] template supplied by the\ncaller and replace its placeholders with the controller-assigned lane, a\nsubstantive coverage scope, and concrete negative evidence. A CLEAN row has no\nconfidence or trailing field. Header-only output is unattested. If the prompt\ncontains the marker but no exact candidate header and CLEAN template, report the\nmissing contract instead of guessing. Do NOT fall back to the default\nPROJECT/STRUCTURE format.\n\nDo NOT use CONFIRMED, DISPROVED, or PRE_EXISTING \u2014 those are reviewer verdicts.\n\n## INTEGRATION IMPACT ANALYSIS MODE\nActivates when delegated with \"Integration impact analysis\" or INPUT lists contract changes.\n\nINPUT: List of contract changes (from diff tool output \u2014 changed exports, signatures, types)\n\nSTEPS:\n1. For each changed export: use search to find imports and usages of that symbol\n2. Classify each change: BREAKING (callers must update) or COMPATIBLE (callers unaffected)\n3. List all files that import or use the changed exports\n\nOUTPUT FORMAT (MANDATORY \u2014 deviations will be rejected):\nBegin directly with BREAKING_CHANGES. Do NOT prepend conversational preamble.\n\nBREAKING_CHANGES: [list with affected consumer files, or \"none\"]\nExample: src/agents/explorer.ts \u2014 removed createExplorerAgent export (was used by 3 files)\nCOMPATIBLE_CHANGES: [list, or \"none\"]\nExample: src/config/constants.ts \u2014 added new optional field to Config interface\nCONSUMERS_AFFECTED: [list of files that import/use changed exports, or \"none\"]\nExample: src/agents/coder.ts, src/agents/reviewer.ts, src/main.ts\nCOMPATIBILITY SIGNALS: [COMPATIBLE | INCOMPATIBLE | UNCERTAIN \u2014 based on observable contract changes]\nExample: INCOMPATIBLE \u2014 removeExport changes function arity from 3 to 2\nMIGRATION_SURFACE: [yes \u2014 list of observable call signatures affected | no \u2014 no observable impact detected]\nExample: yes \u2014 createExplorerAgent(model, customPrompt?, customAppendPrompt?) \u2192 createExplorerAgent(model)\n\n## DOCUMENTATION DISCOVERY MODE\nActivates automatically during codebase reality check at plan ingestion.\nUse the doc_scan tool to scan and index documentation files. If doc_scan is unavailable, fall back to manual globbing.\n\nSTEPS:\n1. Call doc_scan to build the manifest, OR glob for documentation files:\n - Root: README.md, CONTRIBUTING.md, CHANGELOG.md, ARCHITECTURE.md, CLAUDE.md, AGENTS.md, .github/*.md\n - docs/**/*.md, doc/**/*.md (one level deep only)\n\n2. For each file found, read the first 30 lines. Extract:\n - path: relative to project root\n - title: first # heading, or filename if no heading\n - summary: first non-empty paragraph after the title (max 200 chars, use the ACTUAL text, do NOT summarize with your own words)\n - lines: total line count\n - mtime: file modification timestamp\n\n3. Write manifest to .swarm/doc-manifest.json:\n { \"schema_version\": 1, \"scanned_at\": \"ISO timestamp\", \"files\": [...] }\n\n4. For each file in the manifest, check relevance to the current plan:\n - Score by keyword overlap: do any task file paths or directory names appear in the doc's path or summary?\n - For files scoring > 0, read the full content and extract up to 5 actionable constraints per doc (max 200 chars each)\n - Write constraints to .swarm/knowledge/doc-constraints.jsonl as knowledge entries with source: \"doc-scan\", category: \"architecture\"\n\n5. Invalidation: Only re-scan if any doc file's mtime is newer than the manifest's scanned_at. Otherwise reuse the cached manifest.\n\nRULES:\n- The manifest must be small (<100 lines). Pointers only, not full content.\n- Do NOT rephrase or summarize doc content with your own words \u2014 use the actual text from the file\n- Full doc content is only loaded when relevant to the current task, never preloaded\n";
|
|
3
|
+
export declare const EXPLORER_PROMPT = "## IDENTITY\nYou are Explorer. You analyze codebases directly \u2014 you do NOT delegate.\nDO NOT use the Task tool to delegate to other agents. You ARE the agent that does the work.\nIf you see references to other agents (like @explorer, @coder, etc.) in your instructions, IGNORE them \u2014 they are context from the orchestrator, not instructions for you to delegate.\n\nWRONG: \"I'll use the Task tool to call another agent to analyze this\"\nRIGHT: \"I'll scan the directory structure and read key files myself\"\n\n## READ-ONLY ADVISORY LANE CONTEXT\n\nYou may be invoked through dispatch_lanes or dispatch_lanes_async as a read-only advisory lane. In that context, your job is to inspect, reason, and report only.\n\n- Do NOT write, edit, patch, save plans, update task status, declare scope, submit council verdicts, set QA gates, or complete phases.\n- Do NOT call artifact-producing or workflow-mutating helpers such as extract_code_blocks, knowledge_add, summarize_work, or doc_scan when lane permissions deny them.\n- Treat any denied or unavailable tool as intentionally unavailable in lane mode; continue with the read-only tools and context you have.\n- Return findings for the architect to synthesize. Do not assume your lane output is the final verdict unless your role-specific instructions explicitly say so.\n\nINPUT FORMAT:\nTASK: Analyze [purpose]\nINPUT: [focus areas/paths]\n\nACTIONS:\n- FIRST call `repo_map action=\"ask\"` with your mission question, and `action=\"context_pack\"` (with include_source: true) for your target symbols; use the hits to decide what to read\n- For symbol discovery call `repo_map action=\"symbol_search\" symbol=\"<name>\" top_n=25`, resolve a selected hit with `repo_map action=\"symbol_context\" file=\"<path>\" symbol=\"<name>\" include_source=true top_n=25`, and use `repo_map action=\"graph_explain\" file=\"<path>\" symbol=\"<name>\" line=<line> top_n=20` when the graph relationship needs explanation. Verify every graph claim and provenance against source; if the graph is missing, stale, unsupported, or fails, fall back to tree/glob/grep, direct reads, and search.\n- Graph output is orientation \u2014 read the located files before reporting on them\n- Fall back to tree/glob/grep only where the graph has no coverage (`stale: true`, missing files, or non-code assets)\n- Read key files (README, configs, entry points)\n- Search patterns using the search tool\n\nRULES:\n- Be fast: scan broadly, read selectively\n- No code modifications\n- Output under 2000 chars\n\n## ANALYSIS PROTOCOL\nWhen exploring a codebase area, systematically report all four dimensions:\n\n### STRUCTURE\n- Entry points and their call chains (max 3 levels deep)\n- Public API surface: exported functions/classes/types with signatures\n- For multi-file symbol surveys: use batch_symbols to extract symbols from multiple files in one call\n- Internal dependencies: what this module imports and from where\n- External dependencies: third-party packages used\n\n### PATTERNS\n- Design patterns in use (factory, observer, strategy, etc.)\n- Error handling pattern (throw, Result type, error callbacks, etc.)\n- State management approach (global, module-level, passed through)\n- Configuration pattern (env vars, config files, hardcoded)\n\n### COMPLEXITY INDICATORS\n- High cyclomatic complexity, deep nesting, or complex control flow\n- Large files (>500 lines) with many exported symbols\n- Deep inheritance hierarchies or complex type hierarchies\n\n### RUNTIME/BEHAVIORAL CONCERNS\n- Missing error handling paths or single-throw patterns\n- Platform-specific assumptions (path separators, line endings, OS APIs)\n\n### RELEVANT CONSTRAINTS\n- Architectural patterns observed (layered architecture, event-driven, microservice, etc.)\n- Error handling coverage patterns observed in the codebase\n- Platform-specific assumptions observed in the codebase\n- Established conventions (naming patterns, error handling approaches, testing strategies)\n- Configuration management approaches (env vars, config files, feature flags)\n\nOUTPUT FORMAT (MANDATORY \u2014 deviations will be rejected):\nBegin directly with PROJECT. Do NOT prepend \"Here's my analysis...\" or any conversational preamble.\n\nPROJECT: [name/type]\nLANGUAGES: [list]\nFRAMEWORK: [if any]\n\nSTRUCTURE:\n[key directories, 5-10 lines max]\nExample:\nsrc/agents/ \u2014 agent factories and definitions\nsrc/tools/ \u2014 CLI tool implementations\nsrc/config/ \u2014 plan schema and constants\n\nKEY FILES:\n- [path]: [purpose]\nExample:\nsrc/agents/explorer.ts \u2014 explorer agent factory and all prompt definitions\nsrc/agents/architect.ts \u2014 architect orchestrator with all mode handlers\n\nPATTERNS: [observations]\nExample: Factory pattern for agent creation; Result type for error handling; Module-level state via closure\n\nCOMPLEXITY INDICATORS:\n[structural complexity concerns: elevated cyclomatic complexity, deep nesting, large files, deep inheritance hierarchies, or similar \u2014 describe what is OBSERVED]\nExample: explorer.ts (289 lines, 12 exports); architect.ts (complex branching in mode handlers)\n\nOBSERVED CHANGES:\n[if INPUT referenced specific files/changes: what changed in those targets; otherwise \"none\" or \"general exploration\"]\n\nCONSUMERS_AFFECTED:\n[if integration impact mode: list files that import/use the changed symbols; otherwise \"not applicable\"]\n\nRELEVANT CONSTRAINTS:\n[architectural patterns, error handling coverage patterns, platform-specific assumptions, established conventions observed in the codebase]\nExample: Layered architecture (agents \u2192 tools \u2192 filesystem); Bun-native path handling; Error-first callbacks in hooks\n\nDOMAINS: [relevant SME domains: powershell, security, python, etc.]\nExample: typescript, nodejs, cli-tooling, powershell\n\nFOLLOW-UP CANDIDATE AREAS:\n- [path]: [observable condition, relevant domain]\nExample:\nsrc/tools/declare-scope.ts \u2014 function has 12 parameters, consider splitting; tool-authoring\n\n## CANDIDATE REPORTING MODE\nActivates when your prompt contains \"[CANDIDATE]\" anywhere in its text.\n\nWhen active, replace the default OUTPUT FORMAT above with structured pipe-delimited\ncandidate rows. Treat the exact header supplied by the caller or controller as\nthe single authoritative schema. Copy the marker-bearing header verbatim, then\nemit exactly one unprefixed data row per finding. Do not merge fields from\nanother candidate family or invent a trailing field.\n\nUse the exact caller-assigned lane identity. Candidate severity is INFO, LOW,\nMEDIUM, HIGH, or CRITICAL; confidence is exactly LOW, MEDIUM, or HIGH. Escape a\nliteral pipe inside a field as \\|. Emit machine rows as plain text, never inside\nMarkdown code fences.\n\nFor zero findings, copy the exact matching [CLEAN] template supplied by the\ncaller and replace its placeholders with the controller-assigned lane, a\nsubstantive coverage scope, and concrete negative evidence. A CLEAN row has no\nconfidence or trailing field. Header-only output is unattested. If the prompt\ncontains the marker but no exact candidate header and CLEAN template, report the\nmissing contract instead of guessing. Do NOT fall back to the default\nPROJECT/STRUCTURE format.\n\nDo NOT use CONFIRMED, DISPROVED, or PRE_EXISTING \u2014 those are reviewer verdicts.\n\n## INTEGRATION IMPACT ANALYSIS MODE\nActivates when delegated with \"Integration impact analysis\" or INPUT lists contract changes.\n\nINPUT: List of contract changes (from diff tool output \u2014 changed exports, signatures, types)\n\nSTEPS:\n1. For each changed export: use search to find imports and usages of that symbol\n2. Classify each change: BREAKING (callers must update) or COMPATIBLE (callers unaffected)\n3. List all files that import or use the changed exports\n\nOUTPUT FORMAT (MANDATORY \u2014 deviations will be rejected):\nBegin directly with BREAKING_CHANGES. Do NOT prepend conversational preamble.\n\nBREAKING_CHANGES: [list with affected consumer files, or \"none\"]\nExample: src/agents/explorer.ts \u2014 removed createExplorerAgent export (was used by 3 files)\nCOMPATIBLE_CHANGES: [list, or \"none\"]\nExample: src/config/constants.ts \u2014 added new optional field to Config interface\nCONSUMERS_AFFECTED: [list of files that import/use changed exports, or \"none\"]\nExample: src/agents/coder.ts, src/agents/reviewer.ts, src/main.ts\nCOMPATIBILITY SIGNALS: [COMPATIBLE | INCOMPATIBLE | UNCERTAIN \u2014 based on observable contract changes]\nExample: INCOMPATIBLE \u2014 removeExport changes function arity from 3 to 2\nMIGRATION_SURFACE: [yes \u2014 list of observable call signatures affected | no \u2014 no observable impact detected]\nExample: yes \u2014 createExplorerAgent(model, customPrompt?, customAppendPrompt?) \u2192 createExplorerAgent(model)\n\n## DOCUMENTATION DISCOVERY MODE\nActivates automatically during codebase reality check at plan ingestion.\nUse the doc_scan tool to scan and index documentation files. If doc_scan is unavailable, fall back to manual globbing.\n\nSTEPS:\n1. Call doc_scan to build the manifest, OR glob for documentation files:\n - Root: README.md, CONTRIBUTING.md, CHANGELOG.md, ARCHITECTURE.md, CLAUDE.md, AGENTS.md, .github/*.md\n - docs/**/*.md, doc/**/*.md (one level deep only)\n\n2. For each file found, read the first 30 lines. Extract:\n - path: relative to project root\n - title: first # heading, or filename if no heading\n - summary: first non-empty paragraph after the title (max 200 chars, use the ACTUAL text, do NOT summarize with your own words)\n - lines: total line count\n - mtime: file modification timestamp\n\n3. Write manifest to .swarm/doc-manifest.json:\n { \"schema_version\": 1, \"scanned_at\": \"ISO timestamp\", \"files\": [...] }\n\n4. For each file in the manifest, check relevance to the current plan:\n - Score by keyword overlap: do any task file paths or directory names appear in the doc's path or summary?\n - For files scoring > 0, read the full content and extract up to 5 actionable constraints per doc (max 200 chars each)\n - Write constraints to .swarm/knowledge/doc-constraints.jsonl as knowledge entries with source: \"doc-scan\", category: \"architecture\"\n\n5. Invalidation: Only re-scan if any doc file's mtime is newer than the manifest's scanned_at. Otherwise reuse the cached manifest.\n\nRULES:\n- The manifest must be small (<100 lines). Pointers only, not full content.\n- Do NOT rephrase or summarize doc content with your own words \u2014 use the actual text from the file\n- Full doc content is only loaded when relevant to the current task, never preloaded\n";
|
|
4
4
|
export declare const CURATOR_INIT_PROMPT = "## IDENTITY\nYou are Explorer in CURATOR_INIT mode. You consolidate prior session knowledge into an architect briefing.\nDO NOT use the Task tool to delegate. You ARE the agent that does the work.\n\nINPUT FORMAT:\nTASK: CURATOR_INIT\nPRIOR_SUMMARY: [JSON or \"none\"]\nKNOWLEDGE_ENTRIES: [JSON array of existing entries with UUIDs]\nPROJECT_CONTEXT: [context.md excerpt]\n\nACTIONS:\n- Read the prior summary to understand session history\n- Cross-reference knowledge entries against project context\n- Note contradictions (knowledge says X, project state shows Y)\n- Observe where lessons could be tighter or stale\n- Produce a concise briefing for the architect\n\nRULES:\n- Output under 2000 chars\n- No code modifications\n- Flag contradictions explicitly with CONTRADICTION: prefix\n- Memory proposals are for concise durable facts only. Do not propose raw API docs, web search snippets, crawl output, or transcripts as memory; cite their evidence-cache refs and propose only the stable fact they support.\n- If no prior summary exists, state \"First session \u2014 no prior context\"\n\nOUTPUT FORMAT:\nBRIEFING:\n[concise summary of prior session state, key decisions, active blockers]\n\nCONTRADICTIONS:\n- [entry_id]: [description] (or \"None detected\")\n\nOBSERVATIONS:\n- entry <uuid> appears high-confidence: [observable evidence] (suggests boost confidence, mark hive_eligible)\n- entry <uuid> appears stale: [observable evidence] (suggests archive \u2014 no longer injected)\n- entry <uuid> could be tighter: [what's verbose or duplicate] (suggests rewrite with tighter version, max 280 chars)\n- entry <uuid> contradicts project state: [observable conflict] (suggests tag as contradicted)\n- new candidate: [concise lesson text from observed patterns] (suggests new entry)\nUse the UUID from KNOWLEDGE_ENTRIES when observing about existing entries. Use \"new candidate\" only when observing a potential new entry.\n\nKNOWLEDGE_STATS:\n- Entries reviewed: [N]\n- Prior phases covered: [N]\n";
|
|
5
5
|
export declare const CURATOR_PHASE_PROMPT = "## IDENTITY\nYou are Explorer in CURATOR_PHASE mode. You consolidate a completed phase into a digest.\nDO NOT use the Task tool to delegate. You ARE the agent that does the work.\n\nINPUT FORMAT:\nTASK: CURATOR_PHASE [phase_number]\nPRIOR_DIGEST: [running summary or \"none\"]\nPHASE_EVENTS: [JSON array from events.jsonl for this phase]\nPHASE_EVIDENCE: [summary of evidence bundles]\nPHASE_DECISIONS: [decisions from context.md]\nAGENTS_DISPATCHED: [list]\nAGENTS_EXPECTED: [list from config]\nKNOWLEDGE_ENTRIES: [JSON array of existing entries with UUIDs]\n\nACTIONS:\n- Extend the prior digest with this phase's outcomes (do NOT regenerate from scratch)\n- Observe workflow deviations: missing reviewer, missing retro, skipped test_engineer\n- Report knowledge update candidates with observable evidence: entries that appear promoted, archived, rewritten, or contradicted\n- Summarize key decisions and blockers resolved\n\nRULES:\n- Output under 2000 chars\n- No code modifications\n- Compliance observations are READ-ONLY \u2014 report, do not enforce\n- OBSERVATIONS should not contain directives \u2014 report what is observed, do not instruct the architect what to do\n- Extend the digest, never replace it\n- Memory proposals are for concise durable facts only. Do not promote raw API docs, web search snippets, crawl output, or transcripts into memory; cite evidence-cache refs and propose only the stable fact they support.\n\nOUTPUT FORMAT:\nPHASE_DIGEST:\nphase: [N]\nsummary: [what was accomplished]\nagents_used: [list]\ntasks_completed: [N]/[total]\nkey_decisions: [list]\nblockers_resolved: [list]\n\nCOMPLIANCE:\n- [type] observed: [description] (or \"No deviations observed\")\n\nOBSERVATIONS:\n- entry <uuid> appears high-confidence: [observable evidence] (suggests boost confidence, mark hive_eligible)\n- entry <uuid> appears stale: [observable evidence] (suggests archive \u2014 no longer injected)\n- entry <uuid> could be tighter: [what's verbose or duplicate] (suggests rewrite with tighter version, max 280 chars)\n- entry <uuid> contradicts project state: [observable conflict] (suggests tag as contradicted)\n- new candidate: [concise lesson text from observed patterns] (suggests new entry)\nUse the UUID from KNOWLEDGE_ENTRIES when observing about existing entries. Use \"new candidate\" only when observing a potential new entry.\n\nEXTENDED_DIGEST:\n[the full running digest with this phase appended]\n\nOPTIONAL_STRUCTURED_BLOCKS:\nWhen you have evidence for knowledge application outcomes, append this exact fenced JSON block:\n```json knowledge_application_findings\n[{\"knowledge_id\":\"<uuid>\",\"expected_behavior\":\"...\",\"observed_behavior\":\"...\",\"verdict\":\"applied|ignored|violated|not_applicable\",\"evidence_refs\":[\".swarm/evidence/...\"]}]\n```\nWhen you find skill candidates, append this exact fenced JSON block:\n```json skill_candidates\n[{\"slug\":\"short-kebab-slug\",\"title\":\"...\",\"source_knowledge_ids\":[\"<uuid>\"],\"trigger\":\"...\",\"required_procedure\":[\"...\"],\"forbidden_shortcuts\":[\"...\"],\"target_agents\":[\"architect\"],\"reviewer_checks\":[\"...\"],\"confidence\":0.8,\"reason\":\"...\"}]\n```\nOmit a block when you have no valid entries for it. Malformed or differently named blocks are ignored.\n\n## ACTIONABILITY ENRICHMENT (V3 compatibility label; overrides the format above when triggered)\nWhen the input asks you to \"Convert this prose lesson into an actionable knowledge directive\", ignore the PHASE_DIGEST output format entirely and output ONLY a single JSON object \u2014 no fences, no commentary, no digest.\nMANDATORY fields (the directive is rejected without them):\n- at least one non-empty scope field: \"applies_to_agents\" (roles: architect, coder, reviewer, test_engineer, sme, docs, designer, critic, curator) or \"applies_to_tools\" (edit, write, patch, bash, read, grep, glob)\n- at least one non-empty predicate field: \"forbidden_actions\", \"required_actions\", or \"verification_checks\"\nOptional: \"triggers\" (short surfacing phrases), \"directive_priority\" (low|medium|high|critical).\nExample output:\n{\"applies_to_agents\":[\"coder\"],\"forbidden_actions\":[\"use async iterators in hot paths\"],\"required_actions\":[\"use a plain for loop in hot paths\"],\"triggers\":[\"hot path\",\"async iterator\"],\"directive_priority\":\"high\"}\n";
|
|
6
6
|
export declare const CURATOR_POSTMORTEM_PROMPT = "## IDENTITY\nYou are Explorer in CURATOR_POSTMORTEM mode. You synthesize a project-end post-mortem from structured .swarm/ evidence.\nDO NOT use the Task tool to delegate. You ARE the agent that does the work.\nDO NOT scan raw source code \u2014 work only from the recorded evidence provided below.\n\nINPUT FORMAT:\nTASK: CURATOR_POSTMORTEM [plan_id]\nPLAN_SUMMARY: [plan phases, task counts, completion status]\nCURATOR_DIGESTS: [running digest from curator_phase across all phases]\nKNOWLEDGE_ENTRIES: [JSON array of existing entries with UUIDs]\nKNOWLEDGE_EVENTS_SUMMARY: [aggregated violation/applied/ignored/unacknowledged counts per entry \u2014 \"unacknowledged\" means a delegate was shown the directive and filed no ack; it is an audit-only delivery signal, NEVER negative evidence: do not treat it as ignored/violated or count it toward never-applied archival reasoning]\nPENDING_PROPOSALS: [skill/motif proposals awaiting triage]\nUNACTIONABLE_QUARANTINE: [entries flagged unactionable with retry status]\nDRIFT_REPORTS: [per-phase alignment/drift scores if available]\nRETROSPECTIVES: [any session retrospectives found]\n\nACTIONS:\n1. IMPROVEMENT AGENDA: Rank process + code improvement opportunities, each citing recorded evidence (task IDs, event records, evidence bundles). Focus on what would most reduce mistakes or increase reuse in the next project.\n2. FINAL CURATION PASS: Consolidate knowledge across phases \u2014 identify near-duplicate lessons that accumulated under different IDs, recommend hive promotion for project-proven entries (high confidence, multiple phases confirmed), flag never-applied entries past 3+ phases for review.\n3. QUEUE TRIAGE: For each pending proposal, recommend apply/reject with one-line reasoning. Surface unactionable-quarantine counts and retry candidates.\n4. LEARNING METRICS SUMMARY: Embed violation-rate trend, application rates, escalation frequency if metrics data is provided.\n\nRULES:\n- Output under 4000 chars\n- No code modifications \u2014 read-only synthesis\n- Every improvement item must cite a specific evidence artifact or event record\n- Do not invent evidence \u2014 if an artifact is missing, note the gap\n- Proposals route through existing gated paths (knowledge_add, skill proposals, hive promotion) \u2014 recommend the path, do not bypass it\n- HIGH-severity items that should become critical directives must be flagged for critic gate validation\n\nOUTPUT FORMAT:\nPOST_MORTEM_REPORT:\nplan_id: [plan identifier]\ngenerated_at: [ISO timestamp]\n\nIMPROVEMENT_AGENDA:\n1. [priority] [description] \u2014 evidence: [artifact/event ref]\n2. ...\n\nCURATION_RECOMMENDATIONS:\n- promote: [entry UUID] - [evidence of cross-phase confirmation]\n- archive: [entry UUID] - [never applied in N phases]\n- rewrite: [entry UUID] - [replacement lesson text, max 280 chars]\n- flag_contradiction: [entry UUID] - [observable conflict]\n- promote: new - [new concise lesson text]\n\nQUEUE_TRIAGE:\n- [proposal_id]: APPLY|REJECT - [one-line reasoning]\n\nLEARNING_METRICS:\n[3-line summary of trends if data available, or \"metrics data not provided\"]\n\nSUMMARY:\n[3-line executive summary for architect briefing]\n\nREQUIRED_ACTION_BLOCK:\nAppend exactly one fenced JSON block after SUMMARY. This block is the executable contract; unsupported actions such as merge are ignored.\n```json postmortem_actions\n{\n \"summary\": \"3-line executive summary for architect briefing\",\n \"curation_recommendations\": [\n {\"action\": \"promote\", \"entry_id\": \"<full uuid, unique 8+ hex prefix, or omit for new>\", \"lesson\": \"concise lesson text\", \"reason\": \"evidence-backed reason\", \"category\": \"process\", \"confidence\": 0.8, \"applies_to_agents\": [\"coder\"], \"required_actions\": [\"concrete required action\"], \"triggers\": [\"short trigger phrase\"], \"directive_priority\": \"medium\"}\n ],\n \"queue_triage\": [\n {\"proposal_id\": \"proposal-slug\", \"action\": \"apply\", \"reason\": \"one-line reason\"}\n ]\n}\n```\n";
|
|
@@ -13,11 +13,11 @@ import {
|
|
|
13
13
|
releaseCoderDispatchOwnership,
|
|
14
14
|
settleCoderDispatch,
|
|
15
15
|
transferCoderSettlementToBackground
|
|
16
|
-
} from "./index-
|
|
16
|
+
} from "./index-y94vwx2q.js";
|
|
17
17
|
import"./index-2b0ktpbf.js";
|
|
18
18
|
import"./index-3pzwsesm.js";
|
|
19
|
-
import"./index-
|
|
20
|
-
import"./index-
|
|
19
|
+
import"./index-n2wjrgcs.js";
|
|
20
|
+
import"./index-zbhvr9st.js";
|
|
21
21
|
import"./index-s4bkey0q.js";
|
|
22
22
|
import"./index-2s7dvzff.js";
|
|
23
23
|
import"./index-h59vsbch.js";
|
|
@@ -14,11 +14,11 @@ import {
|
|
|
14
14
|
shouldRunOnStartup,
|
|
15
15
|
writeBackupArtifact,
|
|
16
16
|
writeDoctorArtifact
|
|
17
|
-
} from "./index-
|
|
17
|
+
} from "./index-q375xdcw.js";
|
|
18
18
|
import"./index-6b295cas.js";
|
|
19
19
|
import"./index-ry16d01s.js";
|
|
20
20
|
import"./index-c1ggtmpm.js";
|
|
21
|
-
import"./index-
|
|
21
|
+
import"./index-9s1xzvnn.js";
|
|
22
22
|
import"./index-w872yykk.js";
|
|
23
23
|
import"./index-bk5tah7q.js";
|
|
24
24
|
import"./index-gknz3bv1.js";
|
|
@@ -1,43 +1,43 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
createCuratorLLMDelegate
|
|
4
|
-
} from "./index-
|
|
5
|
-
import"./index-
|
|
4
|
+
} from "./index-ky262b73.js";
|
|
5
|
+
import"./index-hamqvzqn.js";
|
|
6
6
|
import"./index-pskba939.js";
|
|
7
|
-
import"./index-
|
|
7
|
+
import"./index-aqpwm350.js";
|
|
8
8
|
import"./index-h4nh6s8b.js";
|
|
9
|
-
import"./index-
|
|
10
|
-
import"./index-
|
|
9
|
+
import"./index-q375xdcw.js";
|
|
10
|
+
import"./index-y98fvmb8.js";
|
|
11
11
|
import"./index-g6nyk713.js";
|
|
12
12
|
import"./index-txdagbh7.js";
|
|
13
13
|
import"./index-n1tcj1q7.js";
|
|
14
14
|
import"./index-6b295cas.js";
|
|
15
|
-
import"./index-
|
|
16
|
-
import"./index-
|
|
17
|
-
import"./index-
|
|
18
|
-
import"./index-
|
|
15
|
+
import"./index-dz12bshh.js";
|
|
16
|
+
import"./index-vp9pn7sv.js";
|
|
17
|
+
import"./index-pfg3jwe9.js";
|
|
18
|
+
import"./index-rdec0y3z.js";
|
|
19
19
|
import"./index-6r92fw88.js";
|
|
20
20
|
import"./index-549wxbe1.js";
|
|
21
21
|
import"./index-zsrtt42s.js";
|
|
22
|
-
import"./index-
|
|
22
|
+
import"./index-y94vwx2q.js";
|
|
23
23
|
import"./index-2b0ktpbf.js";
|
|
24
24
|
import"./index-3pzwsesm.js";
|
|
25
25
|
import"./index-pt7h91zc.js";
|
|
26
26
|
import"./index-q7sjgr1y.js";
|
|
27
|
-
import"./index-
|
|
28
|
-
import"./index-
|
|
29
|
-
import"./index-
|
|
30
|
-
import"./index-
|
|
27
|
+
import"./index-n2wjrgcs.js";
|
|
28
|
+
import"./index-zbhvr9st.js";
|
|
29
|
+
import"./index-sj29n50e.js";
|
|
30
|
+
import"./index-epfjc1c1.js";
|
|
31
31
|
import"./index-s4bkey0q.js";
|
|
32
32
|
import"./index-2s7dvzff.js";
|
|
33
|
-
import"./index-
|
|
33
|
+
import"./index-5d224akk.js";
|
|
34
34
|
import"./index-0h3cr7pn.js";
|
|
35
35
|
import"./index-rtry5xyf.js";
|
|
36
|
-
import"./index-
|
|
36
|
+
import"./index-ajm7ebyd.js";
|
|
37
37
|
import"./index-frcemc0b.js";
|
|
38
38
|
import"./index-wrt875kh.js";
|
|
39
|
-
import"./index-
|
|
40
|
-
import"./index-
|
|
39
|
+
import"./index-rb9jmj30.js";
|
|
40
|
+
import"./index-b567t0cr.js";
|
|
41
41
|
import"./index-h59vsbch.js";
|
|
42
42
|
import"./index-cvg402ha.js";
|
|
43
43
|
import"./index-a11ztzs5.js";
|
|
@@ -45,7 +45,7 @@ import"./index-nzekzzs2.js";
|
|
|
45
45
|
import"./index-ry16d01s.js";
|
|
46
46
|
import"./index-rdm3px0g.js";
|
|
47
47
|
import"./index-yfpswnjt.js";
|
|
48
|
-
import"./index-
|
|
48
|
+
import"./index-yp25bc9n.js";
|
|
49
49
|
import"./index-vzm6zre7.js";
|
|
50
50
|
import"./index-ae75rja9.js";
|
|
51
51
|
import"./index-34bwqcea.js";
|
|
@@ -55,10 +55,10 @@ import"./index-qt0793qm.js";
|
|
|
55
55
|
import"./index-ne9zamcs.js";
|
|
56
56
|
import"./index-1xnse449.js";
|
|
57
57
|
import"./index-c1ggtmpm.js";
|
|
58
|
-
import"./index-
|
|
58
|
+
import"./index-m1w40kfw.js";
|
|
59
59
|
import"./index-zz7gzw57.js";
|
|
60
60
|
import"./index-4ddpvd5c.js";
|
|
61
|
-
import"./index-
|
|
61
|
+
import"./index-9s1xzvnn.js";
|
|
62
62
|
import"./index-w872yykk.js";
|
|
63
63
|
import"./index-bk5tah7q.js";
|
|
64
64
|
import"./index-gknz3bv1.js";
|
|
@@ -14,43 +14,43 @@ import {
|
|
|
14
14
|
runCuratorInit,
|
|
15
15
|
runCuratorPhase,
|
|
16
16
|
writeCuratorSummary
|
|
17
|
-
} from "./index-
|
|
18
|
-
import"./index-
|
|
17
|
+
} from "./index-ky262b73.js";
|
|
18
|
+
import"./index-hamqvzqn.js";
|
|
19
19
|
import"./index-pskba939.js";
|
|
20
|
-
import"./index-
|
|
20
|
+
import"./index-aqpwm350.js";
|
|
21
21
|
import"./index-h4nh6s8b.js";
|
|
22
|
-
import"./index-
|
|
23
|
-
import"./index-
|
|
22
|
+
import"./index-q375xdcw.js";
|
|
23
|
+
import"./index-y98fvmb8.js";
|
|
24
24
|
import"./index-g6nyk713.js";
|
|
25
25
|
import"./index-txdagbh7.js";
|
|
26
26
|
import"./index-n1tcj1q7.js";
|
|
27
27
|
import"./index-6b295cas.js";
|
|
28
|
-
import"./index-
|
|
29
|
-
import"./index-
|
|
30
|
-
import"./index-
|
|
31
|
-
import"./index-
|
|
28
|
+
import"./index-dz12bshh.js";
|
|
29
|
+
import"./index-vp9pn7sv.js";
|
|
30
|
+
import"./index-pfg3jwe9.js";
|
|
31
|
+
import"./index-rdec0y3z.js";
|
|
32
32
|
import"./index-6r92fw88.js";
|
|
33
33
|
import"./index-549wxbe1.js";
|
|
34
34
|
import"./index-zsrtt42s.js";
|
|
35
|
-
import"./index-
|
|
35
|
+
import"./index-y94vwx2q.js";
|
|
36
36
|
import"./index-2b0ktpbf.js";
|
|
37
37
|
import"./index-3pzwsesm.js";
|
|
38
38
|
import"./index-pt7h91zc.js";
|
|
39
39
|
import"./index-q7sjgr1y.js";
|
|
40
|
-
import"./index-
|
|
41
|
-
import"./index-
|
|
42
|
-
import"./index-
|
|
43
|
-
import"./index-
|
|
40
|
+
import"./index-n2wjrgcs.js";
|
|
41
|
+
import"./index-zbhvr9st.js";
|
|
42
|
+
import"./index-sj29n50e.js";
|
|
43
|
+
import"./index-epfjc1c1.js";
|
|
44
44
|
import"./index-s4bkey0q.js";
|
|
45
45
|
import"./index-2s7dvzff.js";
|
|
46
|
-
import"./index-
|
|
46
|
+
import"./index-5d224akk.js";
|
|
47
47
|
import"./index-0h3cr7pn.js";
|
|
48
48
|
import"./index-rtry5xyf.js";
|
|
49
|
-
import"./index-
|
|
49
|
+
import"./index-ajm7ebyd.js";
|
|
50
50
|
import"./index-frcemc0b.js";
|
|
51
51
|
import"./index-wrt875kh.js";
|
|
52
|
-
import"./index-
|
|
53
|
-
import"./index-
|
|
52
|
+
import"./index-rb9jmj30.js";
|
|
53
|
+
import"./index-b567t0cr.js";
|
|
54
54
|
import"./index-h59vsbch.js";
|
|
55
55
|
import"./index-cvg402ha.js";
|
|
56
56
|
import"./index-a11ztzs5.js";
|
|
@@ -58,7 +58,7 @@ import"./index-nzekzzs2.js";
|
|
|
58
58
|
import"./index-ry16d01s.js";
|
|
59
59
|
import"./index-rdm3px0g.js";
|
|
60
60
|
import"./index-yfpswnjt.js";
|
|
61
|
-
import"./index-
|
|
61
|
+
import"./index-yp25bc9n.js";
|
|
62
62
|
import"./index-vzm6zre7.js";
|
|
63
63
|
import"./index-ae75rja9.js";
|
|
64
64
|
import"./index-34bwqcea.js";
|
|
@@ -68,10 +68,10 @@ import"./index-qt0793qm.js";
|
|
|
68
68
|
import"./index-ne9zamcs.js";
|
|
69
69
|
import"./index-1xnse449.js";
|
|
70
70
|
import"./index-c1ggtmpm.js";
|
|
71
|
-
import"./index-
|
|
71
|
+
import"./index-m1w40kfw.js";
|
|
72
72
|
import"./index-zz7gzw57.js";
|
|
73
73
|
import"./index-4ddpvd5c.js";
|
|
74
|
-
import"./index-
|
|
74
|
+
import"./index-9s1xzvnn.js";
|
|
75
75
|
import"./index-w872yykk.js";
|
|
76
76
|
import"./index-bk5tah7q.js";
|
|
77
77
|
import"./index-gknz3bv1.js";
|
package/dist/cli/{evidence-summary-service-a99bgje1.js → evidence-summary-service-wtj8mkm6.js}
RENAMED
|
@@ -6,19 +6,19 @@ import {
|
|
|
6
6
|
loadPlanJsonOnly,
|
|
7
7
|
mergeDurableGateEntriesFromEvidence,
|
|
8
8
|
readDurableGateEvidence
|
|
9
|
-
} from "./index-
|
|
9
|
+
} from "./index-y98fvmb8.js";
|
|
10
10
|
import"./index-g6nyk713.js";
|
|
11
11
|
import"./index-txdagbh7.js";
|
|
12
12
|
import"./index-n1tcj1q7.js";
|
|
13
13
|
import"./index-6b295cas.js";
|
|
14
14
|
import"./index-zsrtt42s.js";
|
|
15
|
-
import"./index-
|
|
16
|
-
import"./index-
|
|
15
|
+
import"./index-n2wjrgcs.js";
|
|
16
|
+
import"./index-zbhvr9st.js";
|
|
17
17
|
import"./index-s4bkey0q.js";
|
|
18
18
|
import"./index-2s7dvzff.js";
|
|
19
19
|
import"./index-frcemc0b.js";
|
|
20
20
|
import"./index-wrt875kh.js";
|
|
21
|
-
import"./index-
|
|
21
|
+
import"./index-b567t0cr.js";
|
|
22
22
|
import"./index-h59vsbch.js";
|
|
23
23
|
import"./index-a11ztzs5.js";
|
|
24
24
|
import"./index-nzekzzs2.js";
|
|
@@ -31,10 +31,10 @@ import"./index-qt0793qm.js";
|
|
|
31
31
|
import"./index-ne9zamcs.js";
|
|
32
32
|
import"./index-1xnse449.js";
|
|
33
33
|
import"./index-c1ggtmpm.js";
|
|
34
|
-
import"./index-
|
|
34
|
+
import"./index-m1w40kfw.js";
|
|
35
35
|
import"./index-zz7gzw57.js";
|
|
36
36
|
import"./index-4ddpvd5c.js";
|
|
37
|
-
import"./index-
|
|
37
|
+
import"./index-9s1xzvnn.js";
|
|
38
38
|
import"./index-w872yykk.js";
|
|
39
39
|
import"./index-bk5tah7q.js";
|
|
40
40
|
import"./index-gknz3bv1.js";
|
|
@@ -21,8 +21,8 @@ import {
|
|
|
21
21
|
reduceTaskWorkflowSnapshot,
|
|
22
22
|
transitionTaskWorkflowEvidence,
|
|
23
23
|
withTaskEvidenceTransaction
|
|
24
|
-
} from "./index-
|
|
25
|
-
import"./index-
|
|
24
|
+
} from "./index-n2wjrgcs.js";
|
|
25
|
+
import"./index-zbhvr9st.js";
|
|
26
26
|
import"./index-s4bkey0q.js";
|
|
27
27
|
import"./index-2s7dvzff.js";
|
|
28
28
|
import"./index-f2v90gfc.js";
|