opencode-swarm 7.139.4 → 7.139.6

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 (80) hide show
  1. package/.opencode/skills/brainstorm/SKILL.md +8 -101
  2. package/.opencode/skills/execute/SKILL.md +10 -9
  3. package/.opencode/skills/issue-ingest/SKILL.md +1 -1
  4. package/.opencode/skills/plan/SKILL.md +40 -97
  5. package/.opencode/skills/specify/SKILL.md +3 -89
  6. package/dist/agents/architect.d.ts +2 -3
  7. package/dist/cli/{config-doctor-whxr386t.js → config-doctor-7v9at76j.js} +3 -3
  8. package/dist/cli/{core-aj5g7an6.js → core-jtj9j6z5.js} +2 -2
  9. package/dist/cli/{curation-policy-anym2y3v.js → curation-policy-rbrx3kd2.js} +6 -6
  10. package/dist/cli/{curator-e8cvb55d.js → curator-bdc5hssa.js} +27 -27
  11. package/dist/cli/{curator-llm-factory-h9xbpgmw.js → curator-llm-factory-305cfcxz.js} +27 -27
  12. package/dist/cli/{evidence-summary-service-g82bsjqa.js → evidence-summary-service-nfdc1ht9.js} +9 -8
  13. package/dist/cli/{gate-evidence-72cgrvs2.js → gate-evidence-46qeyfc1.js} +4 -4
  14. package/dist/cli/{guardrail-explain-0be7msvq.js → guardrail-explain-w9rwgz4c.js} +28 -28
  15. package/dist/cli/{guardrail-log-9mm5443g.js → guardrail-log-4805jgj5.js} +4 -4
  16. package/dist/cli/{hive-promoter-nnzs5x1r.js → hive-promoter-jrd4pjb6.js} +27 -27
  17. package/dist/cli/{index-sd657fkp.js → index-1m1ksyqt.js} +1 -1
  18. package/dist/cli/{index-5azdnaty.js → index-1tw24kcp.js} +2 -2
  19. package/dist/cli/{index-pg84msyc.js → index-3fscvmfw.js} +3 -3
  20. package/dist/cli/{index-k41dn8me.js → index-68gh7p3t.js} +3 -3
  21. package/dist/cli/{index-e1k9vpqn.js → index-7qx874pn.js} +2 -2
  22. package/dist/cli/{index-jnfyxeap.js → index-8d2d7c6k.js} +4 -4
  23. package/dist/cli/{index-0e95eck5.js → index-a6v3kzyc.js} +5 -5
  24. package/dist/cli/{index-xmhhhjjw.js → index-adyxbmt5.js} +3 -3
  25. package/dist/cli/{index-xb1zq933.js → index-b6k9z88b.js} +1 -1
  26. package/dist/cli/{index-j77frjq8.js → index-b9rd29ge.js} +1 -1
  27. package/dist/cli/{index-6nzmp937.js → index-brh827g0.js} +442 -27
  28. package/dist/cli/{index-1kz6da87.js → index-d181x9zr.js} +2 -1
  29. package/dist/cli/{index-ejbcpbzp.js → index-ev72jrxc.js} +2 -2
  30. package/dist/cli/{index-s58vghgj.js → index-fjrt81db.js} +2 -2
  31. package/dist/cli/{index-6r522srn.js → index-h2waehqq.js} +1 -1
  32. package/dist/cli/{index-vyqd1hzm.js → index-h7ht03c4.js} +1529 -969
  33. package/dist/cli/{index-6z0a940s.js → index-hbnsmnb0.js} +2 -2
  34. package/dist/cli/{index-s0qc4gj6.js → index-hfvxhk4z.js} +1 -1
  35. package/dist/cli/{index-0xkjhgrf.js → index-jfjnn408.js} +1 -1
  36. package/dist/cli/{index-vfsqpcz6.js → index-k5z14rb1.js} +4 -4
  37. package/dist/cli/{index-6rxgb5r9.js → index-kbfsp07d.js} +16 -6
  38. package/dist/cli/{index-6vh6vrnk.js → index-m7xks4r4.js} +6 -6
  39. package/dist/cli/{index-5z2xps64.js → index-n0pja0qs.js} +2 -2
  40. package/dist/cli/{index-5s23pfsy.js → index-n3ppm2gt.js} +2 -2
  41. package/dist/cli/{index-4wjk296r.js → index-r4t92q32.js} +2 -2
  42. package/dist/cli/{index-33skgk1a.js → index-rs1f1bh0.js} +1 -1
  43. package/dist/cli/{index-rsrx77fg.js → index-ry0hgg3m.js} +3 -3
  44. package/dist/cli/{index-sa15nfgg.js → index-sfbwze80.js} +29 -29
  45. package/dist/cli/{index-gfmrw2f5.js → index-t94f72tb.js} +2 -2
  46. package/dist/cli/{index-9cdj4020.js → index-wv89xmbe.js} +2 -2
  47. package/dist/cli/{index-nrx08gcr.js → index-yyyk63kk.js} +2 -2
  48. package/dist/cli/index.js +27 -27
  49. package/dist/cli/{knowledge-escalator-a6z30y9p.js → knowledge-escalator-7z9vwqrk.js} +7 -7
  50. package/dist/cli/{knowledge-events-deq0ds8e.js → knowledge-events-vw2cdtnp.js} +5 -5
  51. package/dist/cli/{knowledge-link-bmbatt8s.js → knowledge-link-q46k9adx.js} +4 -4
  52. package/dist/cli/{knowledge-store-vdr19mnq.js → knowledge-store-ecv0qs7r.js} +5 -5
  53. package/dist/cli/{knowledge-validator-5hgacnrf.js → knowledge-validator-arppnzpb.js} +8 -8
  54. package/dist/cli/{pending-delegations-7ayryxbg.js → pending-delegations-qzrx38y9.js} +3 -3
  55. package/dist/cli/{pr-subscriptions-w5y08ebc.js → pr-subscriptions-5s59h4dd.js} +3 -3
  56. package/dist/cli/{runner-h7vmgkth.js → runner-y78d7ryb.js} +5 -5
  57. package/dist/cli/{scan-cursor-d6qcg9hr.js → scan-cursor-7740wg6r.js} +6 -6
  58. package/dist/cli/{schema-y1zekrag.js → schema-sajt4mcv.js} +2 -2
  59. package/dist/cli/{scope-persistence-tj6qway9.js → scope-persistence-dr1msqxw.js} +5 -5
  60. package/dist/cli/{skill-generator-bw8xhzzn.js → skill-generator-k8qz8ja5.js} +9 -9
  61. package/dist/cli/{telemetry-62cn5t24.js → telemetry-sc57xtb0.js} +1 -1
  62. package/dist/cli/{worktree-collision-ownership-hs5c2qzp.js → worktree-collision-ownership-7a8e6gr9.js} +3 -3
  63. package/dist/config/plan-schema.d.ts +2 -0
  64. package/dist/db/index.d.ts +1 -1
  65. package/dist/db/qa-gate-profile.d.ts +86 -2
  66. package/dist/db/task-checkpoint-receipt.d.ts +27 -0
  67. package/dist/index.js +394 -309
  68. package/dist/plan/manager.d.ts +4 -0
  69. package/dist/qa-gate/recovery.d.ts +6 -0
  70. package/dist/services/export-service.d.ts +2 -6
  71. package/dist/services/handoff-service.d.ts +2 -6
  72. package/dist/tools/checkpoint.d.ts +17 -7
  73. package/dist/tools/get-approved-plan.d.ts +8 -6
  74. package/dist/tools/get-qa-gate-profile.d.ts +7 -3
  75. package/dist/tools/phase-complete/gates/gate-helpers.d.ts +1 -0
  76. package/dist/tools/qa-gate-plan-identity.d.ts +28 -0
  77. package/dist/tools/save-plan.d.ts +3 -14
  78. package/dist/tools/set-qa-gates.d.ts +13 -8
  79. package/dist/tools/write-drift-evidence.d.ts +2 -0
  80. package/package.json +1 -1
@@ -133,6 +133,7 @@ export declare function loadPlan(directory: string, cache?: Map<string, Promise<
133
133
  */
134
134
  export declare function savePlanWithAutoAcknowledgedRemovals(directory: string, plan: Plan, source: string, reason: string, options?: {
135
135
  preserveCompletedStatuses?: boolean;
136
+ planLockAlreadyHeld?: boolean;
136
137
  }): Promise<{
137
138
  removedCount: number;
138
139
  }>;
@@ -143,6 +144,8 @@ export declare function savePlanWithAutoAcknowledgedRemovals(directory: string,
143
144
  export declare function savePlan(directory: string, plan: Plan, options?: {
144
145
  preserveCompletedStatuses?: boolean;
145
146
  acknowledged_removals?: AcknowledgedRemovals;
147
+ /** True only when the caller already owns the canonical plan.json lock. */
148
+ planLockAlreadyHeld?: boolean;
146
149
  }): Promise<void>;
147
150
  /**
148
151
  * Rebuild plan from ledger events.
@@ -201,6 +204,7 @@ export declare function isTaskSettled(directory: string, taskId: string): Promis
201
204
  */
202
205
  export declare function updateTaskStatus(directory: string, taskId: string, status: TaskStatus, options?: {
203
206
  force?: boolean;
207
+ planLockAlreadyHeld?: boolean;
204
208
  }): Promise<Plan>;
205
209
  /**
206
210
  * Generate deterministic markdown view from plan object.
@@ -0,0 +1,6 @@
1
+ export interface QaGateRecoveryIdentity {
2
+ swarm: string;
3
+ title: string;
4
+ }
5
+ export declare function formatLegacyQaBindingOnlyCall(identity: QaGateRecoveryIdentity): string;
6
+ export declare function formatLegacyQaBindingRecovery(identity: QaGateRecoveryIdentity, retryAction: string): string;
@@ -1,3 +1,4 @@
1
+ import type { ExecutionProfile } from '../config/plan-schema';
1
2
  /**
2
3
  * Structured export data.
3
4
  */
@@ -7,12 +8,7 @@ export interface ExportData {
7
8
  plan: unknown;
8
9
  context: string | null;
9
10
  /** The plan's execution_profile, if set. Consumers must honour locked profiles. */
10
- execution_profile?: {
11
- parallelization_enabled: boolean;
12
- max_concurrent_tasks: number;
13
- council_parallel: boolean;
14
- locked: boolean;
15
- } | null;
11
+ execution_profile?: ExecutionProfile | null;
16
12
  }
17
13
  /**
18
14
  * Get export data from the swarm directory.
@@ -4,6 +4,7 @@
4
4
  * Provides structured handoff data for agent transitions between swarm sessions.
5
5
  * Reads from .swarm files to gather current state for context-efficient handoffs.
6
6
  */
7
+ import type { ExecutionProfile } from '../config/plan-schema';
7
8
  import { loadPlanJsonOnly } from '../plan/manager';
8
9
  /**
9
10
  * Escape HTML special characters to prevent XSS attacks
@@ -76,12 +77,7 @@ export interface HandoffData {
76
77
  /** Delegation state */
77
78
  delegationState: DelegationState | null;
78
79
  /** Locked execution_profile for this plan, if set. Resuming sessions must honour it. */
79
- execution_profile?: {
80
- parallelization_enabled: boolean;
81
- max_concurrent_tasks: number;
82
- council_parallel: boolean;
83
- locked: boolean;
84
- } | null;
80
+ execution_profile?: ExecutionProfile | null;
85
81
  }
86
82
  /**
87
83
  * Extract current phase and task from plan
@@ -1,13 +1,23 @@
1
1
  import type { ToolDefinition } from '@opencode-ai/plugin/tool';
2
- /**
3
- * Record a checkpoint without staging or committing changes.
4
- * Writes only to .swarm/checkpoints.json with the current HEAD SHA.
5
- * Used by spiral detection to avoid silently committing mid-flight user work.
6
- */
7
- export declare function saveCheckpointRecord(label: string, directory: string): {
2
+ import { tryAcquireLock } from '../parallel/file-locks.js';
3
+ import { loadPlan } from '../plan/manager.js';
4
+ export declare const _internals: {
5
+ tryAcquireLock: typeof tryAcquireLock;
6
+ loadPlan: typeof loadPlan;
7
+ gitExec: typeof gitExec;
8
+ sleep: (ms: number) => Promise<void>;
9
+ findCommitByExactSubject: typeof findCommitByExactSubject;
10
+ stageAllExcludingSwarm: typeof stageAllExcludingSwarm;
11
+ afterTaskEligibilityRead?: (directory: string, taskId: string) => Promise<void>;
12
+ };
13
+ declare function stageAllExcludingSwarm(directory: string): void;
14
+ declare function gitExec(args: string[], cwd: string): string;
15
+ declare function findCommitByExactSubject(directory: string, subject: string): string | null;
16
+ export declare function saveCheckpointRecord(label: string, directory: string): Promise<{
8
17
  success: boolean;
9
18
  sha?: string;
10
19
  error?: string;
11
20
  warning?: string;
12
- };
21
+ }>;
13
22
  export declare const checkpoint: ToolDefinition;
23
+ export {};
@@ -15,6 +15,7 @@
15
15
  * @see https://github.com/zaxbysauce/opencode-swarm/issues/449
16
16
  */
17
17
  import type { tool } from '@opencode-ai/plugin';
18
+ import type { ExecutionProfile } from '../config/plan-schema';
18
19
  interface GetApprovedPlanResult {
19
20
  success: boolean;
20
21
  reason?: string;
@@ -26,6 +27,12 @@ interface GetApprovedPlanResult {
26
27
  * or null when no profile exists for this plan. Used by the critic to
27
28
  * detect silent gate mutations post-approval. */
28
29
  qa_profile_hash?: string | null;
30
+ /** Exact-binding status of the current QA gate profile identity lookup. */
31
+ qa_profile_status?: 'bound' | 'missing' | 'unbound_legacy';
32
+ /** Present when the profile lookup is unsafe even though the read can continue. */
33
+ qa_profile_error?: string;
34
+ /** Remediation guidance for unsafe QA profile identity states. */
35
+ qa_profile_recovery_guidance?: string;
29
36
  }
30
37
  interface ApprovedPlanPayload {
31
38
  plan: unknown;
@@ -34,12 +41,7 @@ interface ApprovedPlanPayload {
34
41
  snapshot_timestamp: string;
35
42
  payload_hash: string;
36
43
  /** The execution_profile from the approved snapshot, if any. */
37
- execution_profile?: {
38
- parallelization_enabled: boolean;
39
- max_concurrent_tasks: number;
40
- council_parallel: boolean;
41
- locked: boolean;
42
- } | null;
44
+ execution_profile?: ExecutionProfile | null;
43
45
  }
44
46
  interface CurrentPlanPayload {
45
47
  plan: unknown;
@@ -1,16 +1,20 @@
1
1
  /**
2
- * Tool to retrieve the QA gate profile for the current plan.
2
+ * Tool to retrieve a QA gate profile for the current or future plan.
3
3
  *
4
- * Read-only: derives plan_id from plan.json, then looks up the profile in the
4
+ * Read-only: uses plan.json identity when available or an explicit exact
5
+ * swarm/title pair before plan creation, then looks up the profile in the
5
6
  * per-project DB. Returns the spec-level profile gates, lock state, and profile
6
7
  * hash. Callers layering session overrides should combine with
7
8
  * `getEffectiveGates` themselves — this tool intentionally returns the
8
9
  * persisted/locked spec-level view.
9
10
  */
10
11
  import type { tool } from '@opencode-ai/plugin';
12
+ import { type QaGatePlanIdentityArgs } from './qa-gate-plan-identity.js';
13
+ export type GetQaGateProfileArgs = QaGatePlanIdentityArgs;
11
14
  interface GetQaGateProfileResult {
12
15
  success: boolean;
13
16
  reason?: string;
17
+ message?: string;
14
18
  plan_id?: string;
15
19
  profile?: {
16
20
  plan_id: string;
@@ -22,6 +26,6 @@ interface GetQaGateProfileResult {
22
26
  profile_hash: string;
23
27
  };
24
28
  }
25
- export declare function executeGetQaGateProfile(_args: Record<string, unknown>, directory: string): Promise<GetQaGateProfileResult>;
29
+ export declare function executeGetQaGateProfile(args: GetQaGateProfileArgs, directory: string): Promise<GetQaGateProfileResult>;
26
30
  export declare const get_qa_gate_profile: ReturnType<typeof tool>;
27
31
  export {};
@@ -25,6 +25,7 @@ export interface GatePreambleResult {
25
25
  planId?: string;
26
26
  planHash?: string;
27
27
  effectiveGates?: QaGates;
28
+ identityBound?: boolean;
28
29
  }
29
30
  /**
30
31
  * Load the plan, derive its identity, look up the QA-gate profile, resolve
@@ -0,0 +1,28 @@
1
+ export interface QaGatePlanIdentityArgs {
2
+ swarm_id?: string;
3
+ plan_title?: string;
4
+ confirm_identity_change?: boolean;
5
+ }
6
+ interface PlanIdentity {
7
+ swarm: string;
8
+ title: string;
9
+ }
10
+ export type QaGatePlanIdentityResolution = {
11
+ success: true;
12
+ planId: string;
13
+ identity: PlanIdentity;
14
+ } | {
15
+ success: false;
16
+ reason: string;
17
+ message: string;
18
+ };
19
+ /**
20
+ * Resolve the QA profile identity before or after plan.json exists.
21
+ *
22
+ * Explicit identity is all-or-nothing. Values are checked for non-whitespace
23
+ * content but are otherwise preserved exactly when deriving the plan id. When
24
+ * a plan already exists, a different exact swarm/title pair requires the same
25
+ * explicit replacement confirmation used by save_plan.
26
+ */
27
+ export declare function resolveQaGatePlanIdentity(plan: PlanIdentity | null, args: QaGatePlanIdentityArgs): QaGatePlanIdentityResolution;
28
+ export {};
@@ -3,6 +3,7 @@
3
3
  * Allows the Architect agent to save structured plans to .swarm/plan.json and .swarm/plan.md.
4
4
  */
5
5
  import type { ToolDefinition } from '@opencode-ai/plugin/tool';
6
+ import { type ExecutionProfile } from '../config/plan-schema';
6
7
  import { takeSnapshotWithRetry } from '../plan/ledger';
7
8
  /** Test seam for the snapshot retry helper (FR-004). */
8
9
  export declare const _test_exports: {
@@ -80,13 +81,7 @@ export interface SavePlanArgs {
80
81
  * save_plan calls that try to change it will be rejected (fail-closed).
81
82
  * Omit to leave the current profile unchanged.
82
83
  */
83
- execution_profile?: {
84
- parallelization_enabled?: boolean;
85
- max_concurrent_tasks?: number;
86
- council_parallel?: boolean;
87
- locked?: boolean;
88
- auto_proceed?: boolean;
89
- };
84
+ execution_profile?: Partial<ExecutionProfile>;
90
85
  }
91
86
  /**
92
87
  * Result from executing save_plan
@@ -102,13 +97,7 @@ export interface SavePlanResult {
102
97
  recovery_guidance?: string;
103
98
  requirement_coverage?: RequirementCoverageResult;
104
99
  /** The resolved execution_profile that was persisted, if any. */
105
- execution_profile?: {
106
- parallelization_enabled: boolean;
107
- max_concurrent_tasks: number;
108
- council_parallel: boolean;
109
- locked: boolean;
110
- auto_proceed?: boolean;
111
- };
100
+ execution_profile?: ExecutionProfile;
112
101
  }
113
102
  interface RequirementCoverageEntry {
114
103
  id: string;
@@ -1,16 +1,17 @@
1
1
  /**
2
- * Tool to configure the QA gate profile for the current plan.
2
+ * Tool to configure a QA gate profile for the current or future plan.
3
3
  *
4
- * Architect-only: invoked during the QA GATE SELECTION phase of brainstorm
5
- * mode (or equivalent). The initial selection may override defaults; after a
6
- * profile exists, updates are ratchet-tighter and cannot disable enabled gates.
7
- * Rejects all writes once the profile is locked.
4
+ * Architect-only: invoked during PLAN's QA GATE SELECTION phase. The initial
5
+ * profile reflects explicit true/false choices; later writes are ratchet-tighter
6
+ * and cannot disable enabled gates. Rejects all writes once locked.
8
7
  *
9
- * Creates the profile with defaults plus the initial selection if missing,
10
- * then always applies the requested partial update through the normal ratchet.
8
+ * Creates the profile atomically from defaults plus the initial selection if
9
+ * missing, then applies the ordinary ratchet semantics.
11
10
  */
12
11
  import type { tool } from '@opencode-ai/plugin';
13
- export interface SetQaGatesArgs {
12
+ import { setGatesForIdentity } from '../db/qa-gate-profile.js';
13
+ import { type QaGatePlanIdentityArgs } from './qa-gate-plan-identity.js';
14
+ export interface SetQaGatesArgs extends QaGatePlanIdentityArgs {
14
15
  reviewer?: boolean;
15
16
  test_engineer?: boolean;
16
17
  council_mode?: boolean;
@@ -23,6 +24,7 @@ export interface SetQaGatesArgs {
23
24
  drift_check?: boolean;
24
25
  final_council?: boolean;
25
26
  project_type?: string;
27
+ adopt_legacy_binding_only?: boolean;
26
28
  }
27
29
  interface SetQaGatesResult {
28
30
  success: boolean;
@@ -37,6 +39,9 @@ interface SetQaGatesResult {
37
39
  profile_hash: string;
38
40
  };
39
41
  }
42
+ export declare const _internals: {
43
+ setGatesForIdentity: typeof setGatesForIdentity;
44
+ };
40
45
  export declare function executeSetQaGates(args: SetQaGatesArgs, directory: string): Promise<SetQaGatesResult>;
41
46
  export declare const set_qa_gates: ReturnType<typeof tool>;
42
47
  export {};
@@ -4,6 +4,7 @@
4
4
  * a gate-contract formatted evidence file.
5
5
  */
6
6
  import type { ToolDefinition } from '@opencode-ai/plugin/tool';
7
+ import { lockProfileForIdentity } from '../db/qa-gate-profile.js';
7
8
  import { isAcceptedVerdict2, normalizeVerdict2 } from '../evidence/normalize-verdict';
8
9
  /**
9
10
  * Arguments for the write_drift_evidence tool
@@ -39,6 +40,7 @@ export declare const _internals: {
39
40
  normalizeVerdict2: typeof normalizeVerdict2;
40
41
  VERDICT_SET_2: readonly string[];
41
42
  isAcceptedVerdict2: typeof isAcceptedVerdict2;
43
+ lockProfileForIdentity: typeof lockProfileForIdentity;
42
44
  };
43
45
  /**
44
46
  * Tool definition for write_drift_evidence
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-swarm",
3
- "version": "7.139.4",
3
+ "version": "7.139.6",
4
4
  "description": "Architect-centric agentic swarm plugin for OpenCode - hub-and-spoke orchestration with SME consultation, code generation, and QA review",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",