opencode-swarm 7.5.3 → 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.5.3",
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",
@@ -16331,6 +16338,7 @@ var init_constants = __esm(() => {
16331
16338
  "imports",
16332
16339
  "retrieve_summary",
16333
16340
  "schema_drift",
16341
+ "search",
16334
16342
  "symbols",
16335
16343
  "knowledge_recall"
16336
16344
  ],
@@ -16416,6 +16424,7 @@ var init_constants = __esm(() => {
16416
16424
  "imports",
16417
16425
  "retrieve_summary",
16418
16426
  "schema_drift",
16427
+ "search",
16419
16428
  "symbols",
16420
16429
  "todo_extract",
16421
16430
  "knowledge_recall"
@@ -16423,6 +16432,7 @@ var init_constants = __esm(() => {
16423
16432
  designer: [
16424
16433
  "extract_code_blocks",
16425
16434
  "retrieve_summary",
16435
+ "search",
16426
16436
  "symbols",
16427
16437
  "knowledge_recall"
16428
16438
  ],
@@ -17099,12 +17109,7 @@ var init_schema = __esm(() => {
17099
17109
  maxConcurrentTasks: exports_external.number().int().min(1).max(64).default(1),
17100
17110
  evidenceLockTimeoutMs: exports_external.number().int().min(1000).max(300000).default(60000),
17101
17111
  max_coders: exports_external.number().int().min(1).max(16).default(3),
17102
- max_reviewers: exports_external.number().int().min(1).max(16).default(2),
17103
- stageB: exports_external.object({
17104
- parallel: exports_external.object({
17105
- enabled: exports_external.boolean().default(false)
17106
- }).default({ enabled: false })
17107
- }).default({ parallel: { enabled: false } })
17112
+ max_reviewers: exports_external.number().int().min(1).max(16).default(2)
17108
17113
  });
17109
17114
  PluginConfigSchema = exports_external.object({
17110
17115
  agents: exports_external.record(exports_external.string(), AgentOverrideConfigSchema).optional(),
@@ -19867,7 +19872,8 @@ var init_qa_gate_profile = __esm(() => {
19867
19872
  sast_enabled: true,
19868
19873
  mutation_test: false,
19869
19874
  council_general_review: false,
19870
- drift_check: true
19875
+ drift_check: true,
19876
+ final_council: false
19871
19877
  };
19872
19878
  });
19873
19879
  // node_modules/quick-lru/index.js
@@ -20517,6 +20523,7 @@ var init_delegation_gate = __esm(() => {
20517
20523
  init_state();
20518
20524
  init_telemetry();
20519
20525
  init_logger();
20526
+ init_task_id();
20520
20527
  init_guardrails();
20521
20528
  init_normalize_tool_name();
20522
20529
  init_utils2();
@@ -20586,6 +20593,7 @@ var init_state = __esm(() => {
20586
20593
  init_delegation_gate();
20587
20594
  init_manager();
20588
20595
  init_telemetry();
20596
+ init_logger();
20589
20597
  _councilDisagreementWarned = new Set;
20590
20598
  _toolAggregates = new Map;
20591
20599
  defaultRunContext = new AgentRunContext("default", _toolAggregates);
@@ -46097,9 +46105,6 @@ var init_promote = __esm(() => {
46097
46105
  });
46098
46106
 
46099
46107
  // src/commands/qa-gates.ts
46100
- function derivePlanId(plan) {
46101
- return `${plan.swarm}-${plan.title}`.replace(/[^a-zA-Z0-9-_]/g, "_");
46102
- }
46103
46108
  function isGateName(name) {
46104
46109
  return ALL_GATE_NAMES.includes(name);
46105
46110
  }
@@ -46225,7 +46230,8 @@ var init_qa_gates = __esm(() => {
46225
46230
  "sast_enabled",
46226
46231
  "mutation_test",
46227
46232
  "council_general_review",
46228
- "drift_check"
46233
+ "drift_check",
46234
+ "final_council"
46229
46235
  ];
46230
46236
  });
46231
46237
 
@@ -47231,7 +47237,7 @@ async function handleRollbackCommand(directory, args) {
47231
47237
  if (fs20.existsSync(planJsonPath)) {
47232
47238
  const planRaw = fs20.readFileSync(planJsonPath, "utf-8");
47233
47239
  const plan = PlanSchema.parse(JSON.parse(planRaw));
47234
- const planId = `${plan.swarm}-${plan.title}`.replace(/[^a-zA-Z0-9-_]/g, "_");
47240
+ const planId = derivePlanId(plan);
47235
47241
  const planHash = computePlanHash(plan);
47236
47242
  await initLedger(directory, planId, planHash, plan);
47237
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.