opencode-swarm 7.6.0 → 7.7.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.
@@ -2,7 +2,7 @@
2
2
  * QA gate hardening tests.
3
3
  *
4
4
  * Covers the additions from the QA gate hardening rollout:
5
- * 1. council_general_review as the 9th QA gate (default OFF, ratchet-tighter, persistence)
5
+ * 1. council_general_review as the 9th and final_council as the 11th QA gate (default OFF, ratchet-tighter, persistence)
6
6
  * 2. Behavioral guidance markup is rendered into the architect prompt for SPECIFY,
7
7
  * BRAINSTORM, and PLAN inline gate-selection paths.
8
8
  * 3. save_plan blocks with QA_GATE_SELECTION_REQUIRED when context.md has no
package/dist/cli/index.js CHANGED
@@ -34,7 +34,7 @@ var package_default;
34
34
  var init_package = __esm(() => {
35
35
  package_default = {
36
36
  name: "opencode-swarm",
37
- version: "7.6.0",
37
+ version: "7.7.0",
38
38
  description: "Architect-centric agentic swarm plugin for OpenCode - hub-and-spoke orchestration with SME consultation, code generation, and QA review",
39
39
  main: "dist/index.js",
40
40
  types: "dist/index.d.ts",
@@ -14589,6 +14589,11 @@ var init_spec_hash = __esm(() => {
14589
14589
  };
14590
14590
  });
14591
14591
 
14592
+ // src/plan/utils.ts
14593
+ function derivePlanId(plan) {
14594
+ return `${plan.swarm}-${plan.title}`.replace(/[^a-zA-Z0-9-_]/g, "_");
14595
+ }
14596
+
14592
14597
  // src/plan/ledger.ts
14593
14598
  import * as crypto2 from "crypto";
14594
14599
  import * as fs from "fs";
@@ -14777,7 +14782,7 @@ async function takeSnapshotEvent(directory, plan, options) {
14777
14782
  if (options?.approvalMetadata) {
14778
14783
  snapshotPayload.approval = options.approvalMetadata;
14779
14784
  }
14780
- const planId = `${plan.swarm}-${plan.title}`.replace(/[^a-zA-Z0-9-_]/g, "_");
14785
+ const planId = derivePlanId(plan);
14781
14786
  return appendLedgerEvent(directory, {
14782
14787
  event_type: "snapshot",
14783
14788
  source: options?.source ?? "takeSnapshotEvent",
@@ -14972,7 +14977,7 @@ async function loadLastApprovedPlan(directory, expectedPlanId) {
14972
14977
  continue;
14973
14978
  }
14974
14979
  if (expectedPlanId !== undefined) {
14975
- const payloadPlanId = `${payload.plan.swarm}-${payload.plan.title}`.replace(/[^a-zA-Z0-9-_]/g, "_");
14980
+ const payloadPlanId = derivePlanId(payload.plan);
14976
14981
  if (payloadPlanId !== expectedPlanId) {
14977
14982
  continue;
14978
14983
  }
@@ -15173,7 +15178,7 @@ async function loadPlan(directory) {
15173
15178
  if (!startupLedgerCheckedWorkspaces.has(resolvedWorkspace)) {
15174
15179
  startupLedgerCheckedWorkspaces.add(resolvedWorkspace);
15175
15180
  if (ledgerHash !== "" && planHash !== ledgerHash) {
15176
- const currentPlanId = `${validated.swarm}-${validated.title}`.replace(/[^a-zA-Z0-9-_]/g, "_");
15181
+ const currentPlanId = derivePlanId(validated);
15177
15182
  const ledgerEvents = await readLedgerEvents(directory);
15178
15183
  const firstEvent = ledgerEvents.length > 0 ? ledgerEvents[0] : null;
15179
15184
  if (firstEvent && firstEvent.plan_id !== currentPlanId) {
@@ -15256,7 +15261,7 @@ async function loadPlan(directory) {
15256
15261
  try {
15257
15262
  const rawParsed = JSON.parse(planJsonContent);
15258
15263
  if (typeof rawParsed?.swarm === "string" && typeof rawParsed?.title === "string") {
15259
- rawPlanId = `${rawParsed.swarm}-${rawParsed.title}`.replace(/[^a-zA-Z0-9-_]/g, "_");
15264
+ rawPlanId = derivePlanId(rawParsed);
15260
15265
  }
15261
15266
  } catch {}
15262
15267
  if (await ledgerExists(directory)) {
@@ -15382,7 +15387,7 @@ async function savePlan(directory, plan, options) {
15382
15387
  }
15383
15388
  }
15384
15389
  const currentPlan = await _internals3.loadPlanJsonOnly(directory);
15385
- const planId = `${validated.swarm}-${validated.title}`.replace(/[^a-zA-Z0-9-_]/g, "_");
15390
+ const planId = derivePlanId(validated);
15386
15391
  const planHashForInit = computePlanHash(validated);
15387
15392
  if (!await ledgerExists(directory)) {
15388
15393
  try {
@@ -15483,7 +15488,7 @@ async function savePlan(directory, plan, options) {
15483
15488
  const oldTask = oldTaskMap.get(task.id);
15484
15489
  if (oldTask && oldTask.status !== task.status) {
15485
15490
  const eventInput = {
15486
- plan_id: `${validated.swarm}-${validated.title}`.replace(/[^a-zA-Z0-9-_]/g, "_"),
15491
+ plan_id: derivePlanId(validated),
15487
15492
  event_type: "task_status_changed",
15488
15493
  task_id: task.id,
15489
15494
  phase_id: phase.id,
@@ -16040,7 +16045,8 @@ var init_tool_names = __esm(() => {
16040
16045
  "get_qa_gate_profile",
16041
16046
  "set_qa_gates",
16042
16047
  "web_search",
16043
- "convene_general_council"
16048
+ "convene_general_council",
16049
+ "write_final_council_evidence"
16044
16050
  ];
16045
16051
  TOOL_NAME_SET = new Set(TOOL_NAMES);
16046
16052
  });
@@ -16277,7 +16283,8 @@ var init_constants = __esm(() => {
16277
16283
  "get_qa_gate_profile",
16278
16284
  "set_qa_gates",
16279
16285
  "convene_general_council",
16280
- "web_search"
16286
+ "web_search",
16287
+ "write_final_council_evidence"
16281
16288
  ],
16282
16289
  explorer: [
16283
16290
  "complexity_hotspots",
@@ -17102,12 +17109,7 @@ var init_schema = __esm(() => {
17102
17109
  maxConcurrentTasks: exports_external.number().int().min(1).max(64).default(1),
17103
17110
  evidenceLockTimeoutMs: exports_external.number().int().min(1000).max(300000).default(60000),
17104
17111
  max_coders: exports_external.number().int().min(1).max(16).default(3),
17105
- max_reviewers: exports_external.number().int().min(1).max(16).default(2),
17106
- stageB: exports_external.object({
17107
- parallel: exports_external.object({
17108
- enabled: exports_external.boolean().default(false)
17109
- }).default({ enabled: false })
17110
- }).default({ parallel: { enabled: false } })
17112
+ max_reviewers: exports_external.number().int().min(1).max(16).default(2)
17111
17113
  });
17112
17114
  PluginConfigSchema = exports_external.object({
17113
17115
  agents: exports_external.record(exports_external.string(), AgentOverrideConfigSchema).optional(),
@@ -19870,7 +19872,8 @@ var init_qa_gate_profile = __esm(() => {
19870
19872
  sast_enabled: true,
19871
19873
  mutation_test: false,
19872
19874
  council_general_review: false,
19873
- drift_check: true
19875
+ drift_check: true,
19876
+ final_council: false
19874
19877
  };
19875
19878
  });
19876
19879
  // node_modules/quick-lru/index.js
@@ -20520,6 +20523,7 @@ var init_delegation_gate = __esm(() => {
20520
20523
  init_state();
20521
20524
  init_telemetry();
20522
20525
  init_logger();
20526
+ init_task_id();
20523
20527
  init_guardrails();
20524
20528
  init_normalize_tool_name();
20525
20529
  init_utils2();
@@ -46101,9 +46105,6 @@ var init_promote = __esm(() => {
46101
46105
  });
46102
46106
 
46103
46107
  // src/commands/qa-gates.ts
46104
- function derivePlanId(plan) {
46105
- return `${plan.swarm}-${plan.title}`.replace(/[^a-zA-Z0-9-_]/g, "_");
46106
- }
46107
46108
  function isGateName(name) {
46108
46109
  return ALL_GATE_NAMES.includes(name);
46109
46110
  }
@@ -46229,7 +46230,8 @@ var init_qa_gates = __esm(() => {
46229
46230
  "sast_enabled",
46230
46231
  "mutation_test",
46231
46232
  "council_general_review",
46232
- "drift_check"
46233
+ "drift_check",
46234
+ "final_council"
46233
46235
  ];
46234
46236
  });
46235
46237
 
@@ -47235,7 +47237,7 @@ async function handleRollbackCommand(directory, args) {
47235
47237
  if (fs20.existsSync(planJsonPath)) {
47236
47238
  const planRaw = fs20.readFileSync(planJsonPath, "utf-8");
47237
47239
  const plan = PlanSchema.parse(JSON.parse(planRaw));
47238
- const planId = `${plan.swarm}-${plan.title}`.replace(/[^a-zA-Z0-9-_]/g, "_");
47240
+ const planId = derivePlanId(plan);
47239
47241
  const planHash = computePlanHash(plan);
47240
47242
  await initLedger(directory, planId, planHash, plan);
47241
47243
  await appendLedgerEvent(directory, {
@@ -638,11 +638,6 @@ export declare const ParallelizationConfigSchema: z.ZodObject<{
638
638
  evidenceLockTimeoutMs: z.ZodDefault<z.ZodNumber>;
639
639
  max_coders: z.ZodDefault<z.ZodNumber>;
640
640
  max_reviewers: z.ZodDefault<z.ZodNumber>;
641
- stageB: z.ZodDefault<z.ZodObject<{
642
- parallel: z.ZodDefault<z.ZodObject<{
643
- enabled: z.ZodDefault<z.ZodBoolean>;
644
- }, z.core.$strip>>;
645
- }, z.core.$strip>>;
646
641
  }, z.core.$strip>;
647
642
  export type ParallelizationConfig = z.infer<typeof ParallelizationConfigSchema>;
648
643
  export declare const PluginConfigSchema: z.ZodObject<{
@@ -1065,11 +1060,6 @@ export declare const PluginConfigSchema: z.ZodObject<{
1065
1060
  evidenceLockTimeoutMs: z.ZodDefault<z.ZodNumber>;
1066
1061
  max_coders: z.ZodDefault<z.ZodNumber>;
1067
1062
  max_reviewers: z.ZodDefault<z.ZodNumber>;
1068
- stageB: z.ZodDefault<z.ZodObject<{
1069
- parallel: z.ZodDefault<z.ZodObject<{
1070
- enabled: z.ZodDefault<z.ZodBoolean>;
1071
- }, z.core.$strip>>;
1072
- }, z.core.$strip>>;
1073
1063
  }, z.core.$strip>>;
1074
1064
  turbo_mode: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
1075
1065
  quiet: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
@@ -20,7 +20,7 @@ export declare const _internals: {
20
20
  computeProfileHash: typeof computeProfileHash;
21
21
  };
22
22
  /**
23
- * QA gate flags. All ten gates are tracked explicitly.
23
+ * QA gate flags. All eleven gates are tracked explicitly.
24
24
  */
25
25
  export interface QaGates {
26
26
  reviewer: boolean;
@@ -33,6 +33,7 @@ export interface QaGates {
33
33
  mutation_test: boolean;
34
34
  council_general_review: boolean;
35
35
  drift_check: boolean;
36
+ final_council: boolean;
36
37
  }
37
38
  /**
38
39
  * Default QA gate configuration for newly-created profiles.