opencode-swarm 7.125.5 → 7.126.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.
Files changed (36) hide show
  1. package/.opencode/skills/brainstorm/SKILL.md +19 -14
  2. package/.opencode/skills/execute/SKILL.md +5 -0
  3. package/.opencode/skills/phase-wrap/SKILL.md +2 -0
  4. package/.opencode/skills/plan/SKILL.md +22 -15
  5. package/.opencode/skills/specify/SKILL.md +18 -14
  6. package/.opencode/skills/swarm-pr-feedback/SKILL.md +1 -0
  7. package/dist/agents/architect.d.ts +9 -7
  8. package/dist/cli/{curation-policy-62w2pwfz.js → curation-policy-dptr1rfe.js} +2 -2
  9. package/dist/cli/{curator-mhhvx2pw.js → curator-23hynz78.js} +9 -9
  10. package/dist/cli/{curator-llm-factory-av2tcfy9.js → curator-llm-factory-r648jn8e.js} +9 -9
  11. package/dist/cli/{guardrail-explain-kqx2bczn.js → guardrail-explain-6atsd4vr.js} +10 -10
  12. package/dist/cli/{hive-promoter-6mhnhrbx.js → hive-promoter-bnkhzd46.js} +9 -9
  13. package/dist/cli/{index-s6hskqg6.js → index-0ff5cm9j.js} +85 -40
  14. package/dist/cli/{index-4b1e5m0d.js → index-16z6txq3.js} +1 -1
  15. package/dist/cli/{index-gbnpz7rh.js → index-2bnfwmk3.js} +1 -1
  16. package/dist/cli/{index-1012f47p.js → index-2yd75hms.js} +3 -3
  17. package/dist/cli/{index-0cdq55k0.js → index-68fpa7ff.js} +10 -10
  18. package/dist/cli/{index-74xejn4v.js → index-a1c9az5e.js} +117 -19
  19. package/dist/cli/{index-0f45t7xy.js → index-bcgfhxzv.js} +4 -4
  20. package/dist/cli/{index-e315gwc9.js → index-cdx337js.js} +1 -1
  21. package/dist/cli/{index-yq4s3q43.js → index-kwnsatzq.js} +2 -2
  22. package/dist/cli/{index-1htanqp1.js → index-mgrsx5hn.js} +1 -1
  23. package/dist/cli/{index-ccfkfrew.js → index-y4ry07h8.js} +1 -1
  24. package/dist/cli/{index-gd5w3ef8.js → index-yfzn5r9s.js} +3 -3
  25. package/dist/cli/index.js +9 -9
  26. package/dist/cli/{knowledge-escalator-h3hg7ek7.js → knowledge-escalator-4hc8w7sd.js} +3 -3
  27. package/dist/cli/{knowledge-events-jtr66wxz.js → knowledge-events-kyqjv1f8.js} +1 -1
  28. package/dist/cli/{knowledge-store-69ttjjjs.js → knowledge-store-06k0p1gs.js} +1 -1
  29. package/dist/cli/{knowledge-validator-yn06rh13.js → knowledge-validator-42xjmcmh.js} +4 -4
  30. package/dist/cli/{scan-cursor-r0w2p5gz.js → scan-cursor-gjcvpyta.js} +2 -2
  31. package/dist/cli/{skill-generator-a7xfyddq.js → skill-generator-t6j93mwt.js} +5 -5
  32. package/dist/commands/turbo-constants.d.ts +6 -0
  33. package/dist/config/constants.d.ts +1 -1
  34. package/dist/config/loader.d.ts +26 -0
  35. package/dist/index.js +30 -63
  36. package/package.json +2 -1
@@ -57,6 +57,7 @@ If `council.general.enabled` is true in the resolved opencode-swarm config AND a
57
57
  - **Important:** If research is ongoing, apply a fixed 5-minute protocol budget to `research_needed`. If research does not complete before the budget expires, automatically reclassify the item to `user_decision` with a note that research was incomplete, then surface it to the user. This prevents the clarification funnel from stalling while waiting for external research.
58
58
  - Cross-reference design sections by name where relevant context helps (but keep HOW out of the spec).
59
59
  - Delegate to `the active swarm's reviewer agent` for an independent review of the draft spec. Reviewer must flag: requirements that encode HOW, untestable requirements, missing edge cases, silent assumptions.
60
+ → REQUIRED: The reviewer Task dispatch MUST contain a literal `ACCEPTANCE:` line. This is a pre-plan spec review (no fr_refs yet), so resolve per ACCEPTANCE FIELD RESOLUTION in your system prompt using a one-line task-derived DONE restatement, e.g. "DONE = reviewer flags HOW-encoded requirements, untestable requirements, missing edge cases, and silent assumptions in the draft spec." A missing line is BLOCKED by ACCEPTANCE_FIELD_REQUIRED.
60
61
  - Apply reviewer feedback. If reviewer rejects, iterate once and re-review. After two rounds, surface remaining disagreements to the user.
61
62
  - Before writing `.swarm/spec.md`, apply the FR-002 non-shadowing check: if a non-native spec already exists, do not shadow it (see MODE: SPECIFY step 1b).
62
63
  - Write the final spec to `.swarm/spec.md`.
@@ -73,24 +74,28 @@ until PLAN; MODE: PLAN will choose safe parallelism automatically. Keep commit
73
74
  frequency at phase-level only.
74
75
  Now ask the user which QA gates to enable for this plan, how many parallel coders to use, the commit frequency, and auto_proceed -- do not select on their behalf. Present all four items together as one unified exchange.
75
76
 
77
+ <!-- BEGIN QA_GATE_BODY -->
78
+
76
79
  Present the eleven gates with their defaults (DEFAULT_QA_GATES), parallel coder count, commit frequency, and auto_proceed as a single user-facing section. Offer the user a one-shot choice: accept defaults, or customize. The eleven gates are:
77
- - reviewer (default: ON) -- code review of coder output
78
- - test_engineer (default: ON) -- test verification of coder output
79
- - sme_enabled (default: ON) -- SME consultation during planning/clarification
80
- - critic_pre_plan (default: ON) -- critic review before plan finalization
81
- - sast_enabled (default: ON) -- static security scanning
82
- - council_mode (default: OFF) -- replaces per-task Stage B (reviewer + test_engineer) with the full 5-member council (critic, reviewer, sme, test_engineer, explorer). Requires council.enabled: true in config. (recommended for high-impact architecture, public APIs, schema/data mutation, security-sensitive code)
83
- - hallucination_guard (default: OFF) -- when enabled, mandatory per-phase API/signature/claim/citation verification via critic_hallucination_verifier at PHASE-WRAP; phase_complete will REJECT phase completion unless .swarm/evidence/{phase}/hallucination-guard.json exists with an APPROVED verdict (recommended for claim-heavy or research-heavy work)
84
- - mutation_test (default: OFF) -- when enabled, runs mutation testing on source files touched this phase via generate_mutants + mutation_test + write_mutation_evidence at PHASE-WRAP; FAIL verdict blocks phase_complete; WARN is non-blocking (recommended for projects with coverage gaps or safety-critical code)
85
- - phase_council (default: OFF) -- full 5-member council reviews all work in a phase holistically at phase_complete time. Requires council.enabled: true in config. (recommended for multi-task phases with cross-cutting concerns or high-risk integration)
86
- - drift_check (default: ON) -- when enabled, mandatory per-phase drift verification via critic_drift_verifier at PHASE-WRAP; compares implemented changes against spec.md intent; hard-blocks phase_complete when spec.md exists and drift evidence is missing or REJECTED; advisory-only when no spec.md exists (recommended for all projects with a specification)
87
- - final_council (default: OFF) -- when enabled, after all phases complete the architect dispatches the full 5-member council (critic, reviewer, sme, test_engineer, explorer) -- NOT the General Council -- at project scope, collects `CouncilMemberVerdict` objects, and calls `write_final_council_evidence`. This does not require `council.general.enabled`.
80
+ - reviewer (default: ON) - code review of coder output
81
+ - test_engineer (default: ON) - test verification of coder output
82
+ - sme_enabled (default: ON) - SME consultation during planning/clarification
83
+ - critic_pre_plan (default: ON) - critic review before plan finalization
84
+ - sast_enabled (default: ON) - static security scanning
85
+ - council_mode (default: OFF) - replaces per-task Stage B (reviewer + test_engineer) with the full 5-member council (critic, reviewer, sme, test_engineer, explorer). Requires council.enabled: true in config.
86
+ - hallucination_guard (default: OFF) - when enabled, mandatory per-phase API/signature/claim/citation verification at PHASE-WRAP; phase_complete will REJECT phase completion unless .swarm/evidence/{phase}/hallucination-guard.json exists with an APPROVED verdict.
87
+ - mutation_test (default: OFF) - when enabled, runs mutation testing on source files touched this phase via generate_mutants + mutation_test + write_mutation_evidence at PHASE-WRAP; FAIL verdict blocks phase_complete; WARN is non-blocking.
88
+ - phase_council (default: OFF) - full 5-member council reviews all work in a phase holistically at phase_complete time. Requires council.enabled: true in config.
89
+ - drift_check (default: ON) - mandatory per-phase drift verification via critic_drift_verifier at PHASE-WRAP; hard-blocks phase_complete when spec.md exists and drift evidence is missing or REJECTED; advisory-only when no spec.md exists.
90
+ - final_council (default: OFF) - when enabled, after all phases complete the architect dispatches the full 5-member council (critic, reviewer, sme, test_engineer, explorer) - NOT the General Council - at project scope, collects `CouncilMemberVerdict` objects, and calls `write_final_council_evidence`. This does not require `council.general.enabled`.
88
91
 
89
92
  Additionally, present these three sub-items as part of the same exchange:
90
- - Parallel coders (default: 1, range: 1-6) -- how many coders should run in parallel. Parallel coders each run in an isolated git worktree (separate working dir + branch) and merge back automatically, so they never overwrite each other's files -- safe and faster, but only for tasks whose file scopes do NOT overlap. The per-task file scopes that determine a safe parallel count are not known until the plan is finalized, so default to 1 (serial) here; the precise recommendation is made at plan time once the tasks and their scopes exist.
93
+ - Parallel coders (default: 1, range: 1-6) - how many coders should run in parallel. Parallel coders each run in an isolated git worktree (separate working dir + branch) and merge back automatically, so they never overwrite each other's files - safe and faster, but only for tasks whose declared file scopes do NOT overlap. The per-task file scopes that determine a safe parallel count are not known until the plan is finalized, so default to 1 (serial) here; the precise recommendation is made at plan time once the tasks and their scopes exist.
91
94
  > COMMON MISCONCEPTION: worktree isolation is baseline for standard parallel coders, governed by the parallel execution profile plus top-level `worktree.policy`. It is not provided by Lean Turbo or Epic. Do not recommend Lean Turbo or Epic to obtain worktree isolation; recommend them only for what they add beyond baseline (Lean Turbo: lane planning, file locks, phase reviewer, integrated diff; Epic: co-change awareness and auto-decide). Worktrees also do not make overlapping scopes safe: dependency readiness, file-disjoint scopes, and merge-back ownership are still required.
92
- - Commit frequency (default: phase-level only) -- optional per-task checkpoint commit after each task completion.
93
- - auto_proceed (boolean, default: false) -- when true, auto-advance to the next phase without asking "Ready for Phase N+1?"; runtime toggle via /swarm auto-proceed on|off.
95
+ - Commit frequency (default: phase-level only) - optional per-task checkpoint commit after each task completion.
96
+ - auto_proceed (boolean, default: false) - when true, auto-advance to the next phase without asking "Ready for Phase N+1?"; runtime toggle via /swarm auto-proceed on|off.
97
+
98
+ <!-- END QA_GATE_BODY -->
94
99
 
95
100
  The user answers all four items (gates, parallel coders, commit frequency, auto_proceed) in one exchange. Wait for the user's response.
96
101
 
@@ -38,6 +38,7 @@ TASK: Fix [gate name] failure
38
38
  FILE: [affected file(s)]
39
39
  INPUT: [exact error output from the gate]
40
40
  CONSTRAINT: Fix ONLY the reported issue, do not modify other code
41
+ ACCEPTANCE: [resolve per ACCEPTANCE FIELD RESOLUTION in your system prompt — REQUIRED on every coder/reviewer dispatch; a missing line is blocked by ACCEPTANCE_FIELD_REQUIRED. Copy the SAME ACCEPTANCE text used on the original coder dispatch for this task.]
41
42
  ✓ After coder returns, re-run the failed gate from the step that failed
42
43
  ✓ Print "Coder attempt [N/configured QA retry limit] on task [X.Y]"
43
44
 
@@ -56,6 +57,7 @@ All other gates: failure → return to coder. No self-fixes. No workarounds.
56
57
  → Subsequent `pre_check_batch` calls with `phase: <N>` will automatically diff against this baseline — only NEW findings (not in baseline) drive the fail verdict.
57
58
  -> PREFLIGHT CHECKLIST: Before first coder delegation, answer "SAST baseline captured before first coder delegation? yes/no/disabled/error". If the answer is no, do not delegate to coder; run 5b-BASE first. If disabled or error, record the exact tool result.
58
59
  5b. the active swarm's coder agent - Implement (if designer scaffold produced, include it as INPUT).
60
+ → REQUIRED: The coder Task dispatch MUST contain a literal `ACCEPTANCE:` line — resolve per ACCEPTANCE FIELD RESOLUTION in your system prompt (verbatim FR/SC text when fr_refs is non-empty, otherwise a one-line task-derived DONE restatement). A missing line is BLOCKED by ACCEPTANCE_FIELD_REQUIRED before the coder runs. Do NOT confuse the plan-task `acceptance` field with this per-dispatch header — both are required.
59
61
  → If this dispatch fails with `PLAN_CRITIC_GATE_VIOLATION`: the plan has no current critic-approved snapshot (commonly a plan approved before this mechanical gate existed). Do NOT retry the coder dispatch as-is — re-run MODE: CRITIC-GATE to get a fresh critic `APPROVED` verdict, then retry this step.
60
62
  5b-bis. **CODER OUTPUT VERIFICATION**: After the coder reports completion, do NOT accept the self-report alone. Run `diff` (step 5c) and inspect at least one of the modified files yourself to confirm the change exists. The coder may report DONE without having produced any diff. A 30-second read of the changed file(s) catches this failure mode. This is NOT a separate explorer dispatch — the existing `diff` tool at step 5c is the verification mechanism; the key discipline is checking that `diff` returns actual changes before proceeding, rather than forwarding the coder's self-report to the next gate.
61
63
  5c. Run `diff` tool. If `hasContractChanges` → the active swarm's explorer agent integration analysis. If COMPATIBILITY SIGNALS=INCOMPATIBLE or MIGRATION_SURFACE=yes → coder retry. If COMPATIBILITY SIGNALS=COMPATIBLE and MIGRATION_SURFACE=no → proceed.
@@ -105,6 +107,7 @@ Treating pre_check_batch as a substitute for the active swarm's reviewer agent i
105
107
  After Stage A (pre_check_batch) passes:
106
108
  1. Ensure `declare_council_criteria` was called for this task (prerequisite).
107
109
  2. Dispatch all 5 council members (critic, reviewer, sme, test_engineer, explorer) in PARALLEL with task-scoped context.
110
+ → REQUIRED: Any council member whose agent role is `coder` or `reviewer` MUST receive a Task prompt containing a literal `ACCEPTANCE:` line — resolve per ACCEPTANCE FIELD RESOLUTION in your system prompt (same text as the coder delegation for this task). In the standard 5-member council only the reviewer member is gated (ACCEPTANCE_FIELD_REQUIRED); the wording covers coder too in case a future council profile includes one.
108
111
  3. Collect all 5 verdict objects. Do NOT fabricate or substitute verdicts.
109
112
  4. Call `submit_council_verdicts` with the collected verdicts.
110
113
  5. Act on the verdict: APPROVE → task passes. CONCERNS with `success: false` + `reason: 'blocking_concerns_unresolved'` → HIGH/CRITICAL findings are blocking, no evidence written, return to coder with requiredFixes and re-council after fixes. CONCERNS with `success: true` → only MEDIUM/LOW advisory findings, task passes. REJECT → return to coder with requiredFixes.
@@ -114,8 +117,10 @@ Treating pre_check_batch as a substitute for the active swarm's reviewer agent i
114
117
  For set-dispatch reviewer/test_engineer verdict rows that must be attributed to plan tasks, read `file:.swarm/bundled-skills/gate-attribution/SKILL.md`. Before re-dispatching a coder for a task that already has a lane (any prior dispatch status), read `file:.swarm/bundled-skills/worktree-retry-cleanup/SKILL.md`.
115
118
 
116
119
  5j. the active swarm's reviewer agent - General review. REJECTED before the configured QA retry limit → coder retry. REJECTED at the configured QA retry limit → escalate.
120
+ → REQUIRED: The reviewer Task dispatch MUST contain a literal `ACCEPTANCE:` line — same text as the coder delegation for this task. Resolve per ACCEPTANCE FIELD RESOLUTION in your system prompt. A missing line is BLOCKED by ACCEPTANCE_FIELD_REQUIRED.
117
121
  → REQUIRED: Print "reviewer: [APPROVED | REJECTED — reason]"
118
122
  5k. Security gate: if change matches TIER 3 criteria OR content contains SECURITY_KEYWORDS OR secretscan has ANY findings OR sast_scan has ANY findings at or above threshold → MUST delegate the active swarm's reviewer agent security-only review. REJECTED before the configured QA retry limit → coder retry. REJECTED at the configured QA retry limit → escalate to user.
123
+ → REQUIRED: The security-reviewer Task dispatch MUST contain a literal `ACCEPTANCE:` line — same text as the coder delegation for this task (the security review is still a reviewer dispatch; the gate does not exempt security-only reviews). Resolve per ACCEPTANCE FIELD RESOLUTION in your system prompt. A missing line is BLOCKED by ACCEPTANCE_FIELD_REQUIRED.
119
124
  → REQUIRED: Print "security-reviewer: [TRIGGERED | NOT TRIGGERED — reason]"
120
125
  → If TRIGGERED: Print "security-reviewer: [APPROVED | REJECTED — reason]"
121
126
  5l. the active swarm's test_engineer agent - Verification tests. FAIL → coder retry from 5g.
@@ -135,6 +135,7 @@ There is no project where code ships without review, tests, and required documen
135
135
  If `phase_council` is enabled:
136
136
  1. Build a PHASE DOSSIER from all completed tasks in this phase, their evidence artifacts, changed-file summaries, and any drift/hallucination/mutation evidence.
137
137
  2. Dispatch the full 5-member council (`the active swarm's critic agent`, `the active swarm's reviewer agent`, `the active swarm's sme agent`, `the active swarm's test_engineer agent`, and `the active swarm's explorer agent`) in PARALLEL with phase-scoped context. Each member reviews the entire phase's work holistically and returns a `CouncilMemberVerdict` JSON object.
138
+ → REQUIRED: The reviewer council member Task dispatch MUST contain a literal `ACCEPTANCE:` line — resolve per ACCEPTANCE FIELD RESOLUTION in your system prompt (phase-scoped: concatenate the verbatim FR/SC text for every task in this phase when fr_refs is non-empty, otherwise a one-line phase-derived DONE restatement). A missing line is BLOCKED by ACCEPTANCE_FIELD_REQUIRED. The other four members are not gated by this rule.
138
139
  3. Collect all 5 verdict objects. Do NOT fabricate or substitute verdicts.
139
140
  4. Act on the verdict: APPROVE → proceed. CONCERNS with `success: false` + `reason: 'blocking_concerns_unresolved'` → HIGH/CRITICAL findings are blocking, no evidence written, must resolve requiredFixes and re-council. CONCERNS with `success: true` → only MEDIUM/LOW advisory findings, phase may proceed per `phaseConcernsAllowComplete` flag. REJECT → surface required fixes to the user before proceeding.
140
141
  5. YOU (the architect) call the `submit_phase_council_verdicts` tool with the phase number and the collected council verdicts to persist the phase-council evidence. The council members do NOT write files — they are read-only. Only the `submit_phase_council_verdicts` tool writes `.swarm/evidence/{phase}/phase-council.json` (with plan binding, member verdicts, and quorum metadata). Do this BEFORE calling `phase_complete`.
@@ -144,6 +145,7 @@ There is no project where code ships without review, tests, and required documen
144
145
  If enabled AND this is the LAST phase in the plan (all other phases have status 'complete' and no more phases remain):
145
146
  1. Build a PROJECT DOSSIER from the completed plan, all phase summaries, changed-file summaries, and all relevant evidence artifacts. This is the full 5-member council (NOT the General Council) running a completed-project review.
146
147
  2. Dispatch the full 5-member council (`the active swarm's critic agent`, `the active swarm's reviewer agent`, `the active swarm's sme agent`, `the active swarm's test_engineer agent`, and `the active swarm's explorer agent`) in PARALLEL with project-scoped context. Each member must review the entire completed body of work and return a `CouncilMemberVerdict` JSON object using `agent`, `verdict` (APPROVE|CONCERNS|REJECT), `confidence`, `findings[]`, `criteriaAssessed[]`, `criteriaUnmet[]`, and `durationMs`.
148
+ → REQUIRED: The reviewer council member Task dispatch MUST contain a literal `ACCEPTANCE:` line — resolve per ACCEPTANCE FIELD RESOLUTION in your system prompt (project-scoped: concatenate the verbatim FR/SC text across all phases, otherwise a one-line project-derived DONE restatement). A missing line is BLOCKED by ACCEPTANCE_FIELD_REQUIRED. The other four members are not gated by this rule.
147
149
  3. Collect the five returned verdict objects. Do NOT fabricate, infer, or substitute verdicts. If a member does not return valid JSON, re-dispatch that member.
148
150
  4. Call `write_final_council_evidence` with `phase`, `projectSummary`, `roundNumber`, and the collected `verdicts` array. This writes `.swarm/evidence/final-council.json` with plan binding, member verdicts, and quorum metadata.
149
151
  ⚠️ **GOTCHA**: `write_final_council_evidence` normalizes a CONCERNS verdict based on whether there are required fixes. CONCERNS with `requiredFixes > 0` → the tool writes NO evidence file (early-return `blocking_concerns_unresolved`) and `phase_complete` then blocks on the MISSING `final-council.json`. CONCERNS with zero required fixes → the tool writes a `concerns` verdict which is NON-blocking (advisory warning only). So: you MUST address required fixes from a CONCERNS verdict and re-council, or you will block on a missing evidence file. (Note: the **phase-level** council's `phaseConcernsAllowComplete` flag makes CONCERNS advisory at phase scope; the final council does not have that flag.)
@@ -228,22 +228,28 @@ After `save_plan` succeeds, read `.swarm/context.md`:
228
228
  - If a `## Pending Parallelization Config` section also exists: parse the values and call `save_plan` again with `execution_profile` set to `{ parallelization_enabled: <parsed>, max_concurrent_tasks: <parsed>, council_parallel: false, locked: true }`. Then remove the section from context.md. If the plan already had `execution_profile.locked: true`, skip this step — the profile is already locked and immutable.
229
229
  - If a `## Task Completion Commit Policy` section exists: preserve it in `.swarm/context.md` (do NOT remove). This section is execution-time guidance for optional per-task checkpoint commits after `update_task_status(status="completed")`.
230
230
  - If no pending section exists, ask the user inline now. Present the eleven gates with their defaults (DEFAULT_QA_GATES), parallel coder count, commit frequency, and auto_proceed as a single user-facing section. Offer the user a one-shot choice: accept defaults, or customize. The eleven gates are:
231
- - reviewer (default: ON) - code review of coder output
232
- - test_engineer (default: ON) - test verification of coder output
233
- - sme_enabled (default: ON) - SME consultation during planning/clarification
234
- - critic_pre_plan (default: ON) - critic review before plan finalization
235
- - sast_enabled (default: ON) - static security scanning
236
- - council_mode (default: OFF) - replaces per-task Stage B (reviewer + test_engineer) with the full 5-member council (critic, reviewer, sme, test_engineer, explorer). Requires council.enabled: true in config.
237
- - hallucination_guard (default: OFF) - mandatory per-phase API/signature/claim/citation verification at PHASE-WRAP
238
- - mutation_test (default: OFF) - mutation testing on source files touched this phase at PHASE-WRAP
239
- - phase_council (default: OFF) - full 5-member council reviews all work in a phase holistically at phase_complete time. Requires council.enabled: true in config.
240
- - drift_check (default: ON) - mandatory per-phase drift verification at PHASE-WRAP
241
- - final_council (default: OFF) - when enabled, after all phases complete the architect dispatches the full 5-member council (critic, reviewer, sme, test_engineer, explorer) -- NOT the General Council -- at project scope, collects `CouncilMemberVerdict` objects, and calls `write_final_council_evidence`. This does not require `council.general.enabled`.
242
- Additionally, present these three sub-items as part of the same exchange:
243
- - Parallel coders (default: 1, range: 1-6) - how many coders should run in parallel. Parallel coders each run in an isolated git worktree (separate working dir + branch) and merge back automatically, so they never overwrite each other's files - safe and faster, but only for tasks whose declared file scopes do NOT overlap. Inspect the plan and recommend a count equal to the number of dependency-ready, file-disjoint task groups (clamped 1-6); recommend 1 (serial) when scopes overlap or are unknown. State your recommendation and reasoning when you ask.
231
+ <!-- BEGIN QA_GATE_BODY -->
232
+
233
+ Present the eleven gates with their defaults (DEFAULT_QA_GATES), parallel coder count, commit frequency, and auto_proceed as a single user-facing section. Offer the user a one-shot choice: accept defaults, or customize. The eleven gates are:
234
+ - reviewer (default: ON) - code review of coder output
235
+ - test_engineer (default: ON) - test verification of coder output
236
+ - sme_enabled (default: ON) - SME consultation during planning/clarification
237
+ - critic_pre_plan (default: ON) - critic review before plan finalization
238
+ - sast_enabled (default: ON) - static security scanning
239
+ - council_mode (default: OFF) - replaces per-task Stage B (reviewer + test_engineer) with the full 5-member council (critic, reviewer, sme, test_engineer, explorer). Requires council.enabled: true in config.
240
+ - hallucination_guard (default: OFF) - when enabled, mandatory per-phase API/signature/claim/citation verification at PHASE-WRAP; phase_complete will REJECT phase completion unless .swarm/evidence/{phase}/hallucination-guard.json exists with an APPROVED verdict.
241
+ - mutation_test (default: OFF) - when enabled, runs mutation testing on source files touched this phase via generate_mutants + mutation_test + write_mutation_evidence at PHASE-WRAP; FAIL verdict blocks phase_complete; WARN is non-blocking.
242
+ - phase_council (default: OFF) - full 5-member council reviews all work in a phase holistically at phase_complete time. Requires council.enabled: true in config.
243
+ - drift_check (default: ON) - mandatory per-phase drift verification via critic_drift_verifier at PHASE-WRAP; hard-blocks phase_complete when spec.md exists and drift evidence is missing or REJECTED; advisory-only when no spec.md exists.
244
+ - final_council (default: OFF) - when enabled, after all phases complete the architect dispatches the full 5-member council (critic, reviewer, sme, test_engineer, explorer) - NOT the General Council - at project scope, collects `CouncilMemberVerdict` objects, and calls `write_final_council_evidence`. This does not require `council.general.enabled`.
245
+
246
+ Additionally, present these three sub-items as part of the same exchange:
247
+ - Parallel coders (default: 1, range: 1-6) - how many coders should run in parallel. Parallel coders each run in an isolated git worktree (separate working dir + branch) and merge back automatically, so they never overwrite each other's files - safe and faster, but only for tasks whose declared file scopes do NOT overlap. The per-task file scopes that determine a safe parallel count are not known until the plan is finalized, so default to 1 (serial) here; the precise recommendation is made at plan time once the tasks and their scopes exist.
244
248
  > COMMON MISCONCEPTION: worktree isolation is baseline for standard parallel coders, governed by the parallel execution profile plus top-level `worktree.policy`. It is not provided by Lean Turbo or Epic. Do not recommend Lean Turbo or Epic to obtain worktree isolation; recommend them only for what they add beyond baseline (Lean Turbo: lane planning, file locks, phase reviewer, integrated diff; Epic: co-change awareness and auto-decide). Worktrees also do not make overlapping scopes safe: dependency readiness, file-disjoint scopes, and merge-back ownership are still required.
245
- - Commit frequency (default: phase-level only) - optional per-task checkpoint commit after each task completion.
246
- - auto_proceed (boolean, default: false) - when true, auto-advance to the next phase without asking "Ready for Phase N+1?"; runtime toggle via /swarm auto-proceed on|off.
249
+ - Commit frequency (default: phase-level only) - optional per-task checkpoint commit after each task completion.
250
+ - auto_proceed (boolean, default: false) - when true, auto-advance to the next phase without asking "Ready for Phase N+1?"; runtime toggle via /swarm auto-proceed on|off.
251
+
252
+ <!-- END QA_GATE_BODY -->
247
253
  The user answers all four (gates, parallel coders, commit frequency, auto_proceed) in one exchange. Wait for the user's response.
248
254
  If the user says parallel coders > 1, write a `## Pending Parallelization Config` section to `.swarm/context.md` alongside the gate selection:
249
255
  ```
@@ -283,6 +289,7 @@ TASK: Write the implementation plan to .swarm/plan.md
283
289
  OUTPUT: .swarm/plan.md
284
290
  INPUT: [provide the complete plan content below]
285
291
  CONSTRAINT: Write EXACTLY the content provided. Do not modify, summarize, or interpret.
292
+ ACCEPTANCE: DONE = .swarm/plan.md contains the verbatim plan content provided in INPUT, byte-for-byte, with no modification, summarization, or interpretation. (This fallback has no fr_refs — per ACCEPTANCE FIELD RESOLUTION in your system prompt, use this one-line task-derived DONE restatement. A missing or empty ACCEPTANCE line is BLOCKED by ACCEPTANCE_FIELD_REQUIRED before the coder runs.)
286
293
 
287
294
  TASK GRANULARITY RULES:
288
295
  - SMALL task: 1 file, 1 logical concern. Delegate as-is.
@@ -53,24 +53,28 @@ Activates when: user asks to "specify", "define requirements", "write a spec", o
53
53
  5b. **QA GATE SELECTION, PARALLEL CODERS, COMMIT FREQUENCY, AND AUTO_PROCEED (dialogue only).**
54
54
  Ask the user which QA gates to enable for this plan, how many parallel coders to use, the commit frequency, and auto_proceed -- do not select on their behalf. Present all four items together as one unified exchange. Exception: when SPECIFY is running inside MODE: LOOP with `autonomy=auto`, write the balanced-speed default `## Pending QA Gate Selection` instead (reviewer, test_engineer, sme_enabled, critic_pre_plan, sast_enabled, drift_check ON; council_mode, hallucination_guard, mutation_test, phase_council, final_council OFF), keep phase-level commits, and let MODE: PLAN choose safe parallelism after task scopes exist.
55
55
 
56
+ <!-- BEGIN QA_GATE_BODY -->
57
+
56
58
  Present the eleven gates with their defaults (DEFAULT_QA_GATES), parallel coder count, commit frequency, and auto_proceed as a single user-facing section. Offer the user a one-shot choice: accept defaults, or customize. The eleven gates are:
57
- - reviewer (default: ON) -- code review of coder output
58
- - test_engineer (default: ON) -- test verification of coder output
59
- - sme_enabled (default: ON) -- SME consultation during planning/clarification
60
- - critic_pre_plan (default: ON) -- critic review before plan finalization
61
- - sast_enabled (default: ON) -- static security scanning
62
- - council_mode (default: OFF) -- replaces per-task Stage B (reviewer + test_engineer) with the full 5-member council (critic, reviewer, sme, test_engineer, explorer). Requires council.enabled: true in config. (recommended for high-impact architecture, public APIs, schema/data mutation, security-sensitive code)
63
- - hallucination_guard (default: OFF) -- when enabled, mandatory per-phase API/signature/claim/citation verification via critic_hallucination_verifier at PHASE-WRAP; phase_complete will REJECT phase completion unless .swarm/evidence/{phase}/hallucination-guard.json exists with an APPROVED verdict (recommended for claim-heavy or research-heavy work)
64
- - mutation_test (default: OFF) -- when enabled, runs mutation testing on source files touched this phase via generate_mutants + mutation_test + write_mutation_evidence at PHASE-WRAP; FAIL verdict blocks phase_complete; WARN is non-blocking (recommended for projects with coverage gaps or safety-critical code)
65
- - phase_council (default: OFF) -- full 5-member council reviews all work in a phase holistically at phase_complete time. Requires council.enabled: true in config. (recommended for multi-task phases with cross-cutting concerns or high-risk integration)
66
- - drift_check (default: ON) -- when enabled, mandatory per-phase drift verification via critic_drift_verifier at PHASE-WRAP; compares implemented changes against spec.md intent; hard-blocks phase_complete when spec.md exists and drift evidence is missing or REJECTED; advisory-only when no spec.md exists (recommended for all projects with a specification)
67
- - final_council (default: OFF) -- when enabled, after all phases complete the architect dispatches the full 5-member council (critic, reviewer, sme, test_engineer, explorer) -- NOT the General Council -- at project scope, collects `CouncilMemberVerdict` objects, and calls `write_final_council_evidence`. This does not require `council.general.enabled`.
59
+ - reviewer (default: ON) - code review of coder output
60
+ - test_engineer (default: ON) - test verification of coder output
61
+ - sme_enabled (default: ON) - SME consultation during planning/clarification
62
+ - critic_pre_plan (default: ON) - critic review before plan finalization
63
+ - sast_enabled (default: ON) - static security scanning
64
+ - council_mode (default: OFF) - replaces per-task Stage B (reviewer + test_engineer) with the full 5-member council (critic, reviewer, sme, test_engineer, explorer). Requires council.enabled: true in config.
65
+ - hallucination_guard (default: OFF) - when enabled, mandatory per-phase API/signature/claim/citation verification at PHASE-WRAP; phase_complete will REJECT phase completion unless .swarm/evidence/{phase}/hallucination-guard.json exists with an APPROVED verdict.
66
+ - mutation_test (default: OFF) - when enabled, runs mutation testing on source files touched this phase via generate_mutants + mutation_test + write_mutation_evidence at PHASE-WRAP; FAIL verdict blocks phase_complete; WARN is non-blocking.
67
+ - phase_council (default: OFF) - full 5-member council reviews all work in a phase holistically at phase_complete time. Requires council.enabled: true in config.
68
+ - drift_check (default: ON) - mandatory per-phase drift verification via critic_drift_verifier at PHASE-WRAP; hard-blocks phase_complete when spec.md exists and drift evidence is missing or REJECTED; advisory-only when no spec.md exists.
69
+ - final_council (default: OFF) - when enabled, after all phases complete the architect dispatches the full 5-member council (critic, reviewer, sme, test_engineer, explorer) - NOT the General Council - at project scope, collects `CouncilMemberVerdict` objects, and calls `write_final_council_evidence`. This does not require `council.general.enabled`.
68
70
 
69
71
  Additionally, present these three sub-items as part of the same exchange:
70
- - Parallel coders (default: 1, range: 1-6) -- how many coders should run in parallel. Parallel coders each run in an isolated git worktree (separate working dir + branch) and merge back automatically, so they never overwrite each other's files -- safe and faster, but only for tasks whose file scopes do NOT overlap. The per-task file scopes that determine a safe parallel count are not known until the plan is finalized, so default to 1 (serial) here; the precise recommendation is made at plan time once the tasks and their scopes exist.
72
+ - Parallel coders (default: 1, range: 1-6) - how many coders should run in parallel. Parallel coders each run in an isolated git worktree (separate working dir + branch) and merge back automatically, so they never overwrite each other's files - safe and faster, but only for tasks whose declared file scopes do NOT overlap. The per-task file scopes that determine a safe parallel count are not known until the plan is finalized, so default to 1 (serial) here; the precise recommendation is made at plan time once the tasks and their scopes exist.
71
73
  > COMMON MISCONCEPTION: worktree isolation is baseline for standard parallel coders, governed by the parallel execution profile plus top-level `worktree.policy`. It is not provided by Lean Turbo or Epic. Do not recommend Lean Turbo or Epic to obtain worktree isolation; recommend them only for what they add beyond baseline (Lean Turbo: lane planning, file locks, phase reviewer, integrated diff; Epic: co-change awareness and auto-decide). Worktrees also do not make overlapping scopes safe: dependency readiness, file-disjoint scopes, and merge-back ownership are still required.
72
- - Commit frequency (default: phase-level only) -- optional per-task checkpoint commit after each task completion.
73
- - auto_proceed (boolean, default: false) -- when true, auto-advance to the next phase without asking "Ready for Phase N+1?"; runtime toggle via /swarm auto-proceed on|off.
74
+ - Commit frequency (default: phase-level only) - optional per-task checkpoint commit after each task completion.
75
+ - auto_proceed (boolean, default: false) - when true, auto-advance to the next phase without asking "Ready for Phase N+1?"; runtime toggle via /swarm auto-proceed on|off.
76
+
77
+ <!-- END QA_GATE_BODY -->
74
78
 
75
79
  The user answers all four (gates, parallel coders, commit frequency, auto_proceed) in one exchange. Wait for the user's response.
76
80
 
@@ -214,6 +214,7 @@ available scope controller merely to reduce ceremony.
214
214
  **When to use `declare_scope` (preferred):** any feedback round that touches 2+ files, OR any feedback round where the file scope is not 100% obvious from the prompt. Before delegating, save a minimal plan via `save_plan` with a single phase containing the feedback-closure tasks, then call `declare_scope` per task with the exact file list.
215
215
 
216
216
  **Carve-out for direct Task delegation:** 1-file, single-function changes where the file path appears verbatim in the coder's prompt may use direct `Task(subagent_type="<coder>", ...)` delegation without `declare_scope`, where `<coder>` is the active swarm's coder agent (e.g. `coder`, or `paid_coder` when the swarm id is `paid`). This is a narrow exception; the orchestrator is responsible for verifying the scope is unambiguous.
217
+ → REQUIRED: even under this carve-out, the direct Task dispatch MUST contain a literal `ACCEPTANCE:` line — resolve per ACCEPTANCE FIELD RESOLUTION in your system prompt (one-line task-derived DONE restatement for the feedback fix, since feedback-closure runs typically have no fr_refs). A missing line is BLOCKED by ACCEPTANCE_FIELD_REQUIRED.
217
218
 
218
219
  **Anti-pattern:** do not use `Task` delegation for multi-file feedback fixes just to skip `save_plan` — the loss of scope discipline is not worth the saved ceremony.
219
220
 
@@ -61,14 +61,16 @@ export declare function buildArchitectureSupervisionWorkflow(arch?: Architecture
61
61
  */
62
62
  export declare function buildCouncilWorkflow(council?: CouncilWorkflowConfig): string;
63
63
  /**
64
- * Build the user-facing QA gate selection dialogue, used by MODE: SPECIFY
65
- * (step 5b), MODE: BRAINSTORM (Phase 6), and MODE: PLAN (post-`save_plan`
66
- * inline path). The dialogue is dialogue-only persistence happens during
67
- * MODE: PLAN after `save_plan` creates `plan.json`.
64
+ * TEST-ONLY ORACLE: This function is no longer wired into the architect prompt
65
+ * (the {{QA_GATE_DIALOGUE_*}} placeholder substitution was removed in #1690,
66
+ * task 3.1). It is retained here because three test files import it directly:
67
+ * - src/__tests__/qa-gate-hardening.test.ts:17
68
+ * - tests/unit/agents/architect-hallucination-gate.test.ts:3
69
+ * - tests/unit/skills/plan-protocol.test.ts:8
68
70
  *
69
- * The lead-in sentence varies per mode, but the body (ten gates with
70
- * defaults, one-shot accept-or-customize prompt) is shared so SPECIFY,
71
- * BRAINSTORM, and PLAN inline paths stay in lockstep.
71
+ * Future work (task 3.2) will create `references/qa-gate-gates-body.md` and
72
+ * migrate those tests to assert against the canonical body. Once migrated,
73
+ * this helper may be deleted.
72
74
  */
73
75
  export declare function buildQaGateSelectionDialogue(modeLabel: 'BRAINSTORM' | 'SPECIFY' | 'PLAN'): string;
74
76
  export declare function createArchitectAgent(model: string, customPrompt?: string, customAppendPrompt?: string, adversarialTesting?: AdversarialTestingConfig, council?: CouncilWorkflowConfig, uiReview?: UIReviewConfig, memoryEnabled?: boolean, architecturalSupervision?: ArchitectureSupervisionWorkflowConfig, designDocsEnabled?: boolean, externalSkillsEnabled?: boolean, turboEnabled?: boolean, skillsEnabled?: boolean): AgentDefinition;
@@ -4,9 +4,9 @@ import {
4
4
  authorizeCuration,
5
5
  buildConfigFingerprintInput,
6
6
  readCohortConfigFingerprint
7
- } from "./index-1htanqp1.js";
7
+ } from "./index-mgrsx5hn.js";
8
8
  import"./index-rtry5xyf.js";
9
- import"./index-gbnpz7rh.js";
9
+ import"./index-2bnfwmk3.js";
10
10
  import"./index-ae75rja9.js";
11
11
  import"./index-q27bajqb.js";
12
12
  import"./index-zgwm4ryv.js";
@@ -14,28 +14,28 @@ import {
14
14
  runCuratorInit,
15
15
  runCuratorPhase,
16
16
  writeCuratorSummary
17
- } from "./index-s6hskqg6.js";
17
+ } from "./index-0ff5cm9j.js";
18
18
  import"./index-dezgmvtw.js";
19
19
  import"./index-jt7hnr7q.js";
20
20
  import"./index-kk1scggc.js";
21
21
  import"./index-4905hd2m.js";
22
22
  import"./index-134d35c1.js";
23
23
  import"./index-6n2jpz7x.js";
24
- import"./index-gd5w3ef8.js";
25
- import"./index-0f45t7xy.js";
26
- import"./index-e315gwc9.js";
24
+ import"./index-yfzn5r9s.js";
25
+ import"./index-bcgfhxzv.js";
26
+ import"./index-cdx337js.js";
27
27
  import"./index-vxv732ex.js";
28
28
  import"./index-c8s9a3zh.js";
29
29
  import"./index-9ss2m4rs.js";
30
30
  import"./index-23zsx7dm.js";
31
- import"./index-yq4s3q43.js";
32
- import"./index-1htanqp1.js";
31
+ import"./index-kwnsatzq.js";
32
+ import"./index-mgrsx5hn.js";
33
33
  import"./index-rtry5xyf.js";
34
- import"./index-1012f47p.js";
35
- import"./index-gbnpz7rh.js";
34
+ import"./index-2yd75hms.js";
35
+ import"./index-2bnfwmk3.js";
36
36
  import"./index-ae75rja9.js";
37
37
  import"./index-q27bajqb.js";
38
- import"./index-74xejn4v.js";
38
+ import"./index-a1c9az5e.js";
39
39
  import"./index-k5jrywpr.js";
40
40
  import"./index-n832052r.js";
41
41
  import"./index-r1gdkn2d.js";
@@ -1,28 +1,28 @@
1
1
  // @bun
2
2
  import {
3
3
  createCuratorLLMDelegate
4
- } from "./index-s6hskqg6.js";
4
+ } from "./index-0ff5cm9j.js";
5
5
  import"./index-dezgmvtw.js";
6
6
  import"./index-jt7hnr7q.js";
7
7
  import"./index-kk1scggc.js";
8
8
  import"./index-4905hd2m.js";
9
9
  import"./index-134d35c1.js";
10
10
  import"./index-6n2jpz7x.js";
11
- import"./index-gd5w3ef8.js";
12
- import"./index-0f45t7xy.js";
13
- import"./index-e315gwc9.js";
11
+ import"./index-yfzn5r9s.js";
12
+ import"./index-bcgfhxzv.js";
13
+ import"./index-cdx337js.js";
14
14
  import"./index-vxv732ex.js";
15
15
  import"./index-c8s9a3zh.js";
16
16
  import"./index-9ss2m4rs.js";
17
17
  import"./index-23zsx7dm.js";
18
- import"./index-yq4s3q43.js";
19
- import"./index-1htanqp1.js";
18
+ import"./index-kwnsatzq.js";
19
+ import"./index-mgrsx5hn.js";
20
20
  import"./index-rtry5xyf.js";
21
- import"./index-1012f47p.js";
22
- import"./index-gbnpz7rh.js";
21
+ import"./index-2yd75hms.js";
22
+ import"./index-2bnfwmk3.js";
23
23
  import"./index-ae75rja9.js";
24
24
  import"./index-q27bajqb.js";
25
- import"./index-74xejn4v.js";
25
+ import"./index-a1c9az5e.js";
26
26
  import"./index-k5jrywpr.js";
27
27
  import"./index-n832052r.js";
28
28
  import"./index-r1gdkn2d.js";
@@ -1,29 +1,29 @@
1
1
  // @bun
2
2
  import {
3
3
  handleGuardrailExplain
4
- } from "./index-ccfkfrew.js";
5
- import"./index-s6hskqg6.js";
4
+ } from "./index-y4ry07h8.js";
5
+ import"./index-0ff5cm9j.js";
6
6
  import"./index-dezgmvtw.js";
7
7
  import"./index-jt7hnr7q.js";
8
8
  import"./index-kk1scggc.js";
9
9
  import"./index-4905hd2m.js";
10
10
  import"./index-134d35c1.js";
11
11
  import"./index-6n2jpz7x.js";
12
- import"./index-gd5w3ef8.js";
13
- import"./index-0f45t7xy.js";
14
- import"./index-e315gwc9.js";
12
+ import"./index-yfzn5r9s.js";
13
+ import"./index-bcgfhxzv.js";
14
+ import"./index-cdx337js.js";
15
15
  import"./index-vxv732ex.js";
16
16
  import"./index-c8s9a3zh.js";
17
17
  import"./index-9ss2m4rs.js";
18
18
  import"./index-23zsx7dm.js";
19
- import"./index-yq4s3q43.js";
20
- import"./index-1htanqp1.js";
19
+ import"./index-kwnsatzq.js";
20
+ import"./index-mgrsx5hn.js";
21
21
  import"./index-rtry5xyf.js";
22
- import"./index-1012f47p.js";
23
- import"./index-gbnpz7rh.js";
22
+ import"./index-2yd75hms.js";
23
+ import"./index-2bnfwmk3.js";
24
24
  import"./index-ae75rja9.js";
25
25
  import"./index-q27bajqb.js";
26
- import"./index-74xejn4v.js";
26
+ import"./index-a1c9az5e.js";
27
27
  import"./index-k5jrywpr.js";
28
28
  import"./index-n832052r.js";
29
29
  import"./index-r1gdkn2d.js";
@@ -7,30 +7,30 @@ import {
7
7
  isHiveEligible,
8
8
  promoteFromSwarm,
9
9
  promoteToHive
10
- } from "./index-s6hskqg6.js";
10
+ } from "./index-0ff5cm9j.js";
11
11
  import"./index-dezgmvtw.js";
12
12
  import"./index-jt7hnr7q.js";
13
13
  import"./index-kk1scggc.js";
14
14
  import"./index-4905hd2m.js";
15
15
  import"./index-134d35c1.js";
16
16
  import"./index-6n2jpz7x.js";
17
- import"./index-gd5w3ef8.js";
18
- import"./index-0f45t7xy.js";
19
- import"./index-e315gwc9.js";
17
+ import"./index-yfzn5r9s.js";
18
+ import"./index-bcgfhxzv.js";
19
+ import"./index-cdx337js.js";
20
20
  import"./index-vxv732ex.js";
21
21
  import"./index-c8s9a3zh.js";
22
22
  import"./index-9ss2m4rs.js";
23
23
  import"./index-23zsx7dm.js";
24
- import"./index-yq4s3q43.js";
25
- import"./index-1htanqp1.js";
24
+ import"./index-kwnsatzq.js";
25
+ import"./index-mgrsx5hn.js";
26
26
  import"./index-rtry5xyf.js";
27
27
  import {
28
28
  resolveHiveKnowledgePath
29
- } from "./index-1012f47p.js";
30
- import"./index-gbnpz7rh.js";
29
+ } from "./index-2yd75hms.js";
30
+ import"./index-2bnfwmk3.js";
31
31
  import"./index-ae75rja9.js";
32
32
  import"./index-q27bajqb.js";
33
- import"./index-74xejn4v.js";
33
+ import"./index-a1c9az5e.js";
34
34
  import"./index-k5jrywpr.js";
35
35
  import"./index-n832052r.js";
36
36
  import"./index-r1gdkn2d.js";