opencode-swarm 6.29.0 → 6.29.2

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/README.md CHANGED
@@ -341,11 +341,13 @@ The architect moves through these modes automatically:
341
341
  | `CLARIFY` | Swarm asks for missing information it cannot infer |
342
342
  | `DISCOVER` | Explorer scans the codebase |
343
343
  | `CONSULT` | SME agents provide domain guidance |
344
- | `PLAN` | Architect writes or updates the phased plan |
344
+ | `PLAN` | Architect writes or updates the phased plan (includes CODEBASE REALITY CHECK on brownfield projects) |
345
345
  | `CRITIC-GATE` | Critic reviews the plan before execution |
346
346
  | `EXECUTE` | Tasks are implemented one at a time through the QA pipeline |
347
347
  | `PHASE-WRAP` | A phase closes out, docs are updated, and a retrospective is written |
348
348
 
349
+ > **CODEBASE REALITY CHECK (v6.29.2):** Before any planning, the Architect dispatches Explorer to verify the current state of every referenced item. Produces a CODEBASE REALITY REPORT with statuses: NOT STARTED, PARTIALLY DONE, ALREADY COMPLETE, or ASSUMPTION INCORRECT. This prevents planning against stale assumptions. Skipped for greenfield projects with no existing codebase references.
350
+
349
351
  ### Important
350
352
 
351
353
  A second or later run does **not** necessarily look like a first run.
@@ -607,6 +609,7 @@ To disable entirely, set `context_budget.enabled: false` in your swarm config.
607
609
  | sast_scan | Offline security analysis, 63+ rules, 9 languages |
608
610
  | sbom_generate | CycloneDX dependency tracking, 8 ecosystems |
609
611
  | build_check | Runs your project's native build/typecheck |
612
+ | incremental_verify | Post-coder typecheck for TS/JS, Go, Rust, C# (v6.29.2) |
610
613
  | quality_budget | Enforces complexity, duplication, and test ratio limits |
611
614
  | pre_check_batch | Runs lint, secretscan, SAST, and quality budget in parallel (~15s vs ~60s sequential) |
612
615
  | phase_complete | Enforces phase completion, verifies required agents, requires a valid retrospective evidence bundle, logs events, and resets state |
package/dist/cli/index.js CHANGED
@@ -14011,7 +14011,7 @@ var init_evidence_schema = __esm(() => {
14011
14011
  });
14012
14012
  RetrospectiveEvidenceSchema = BaseEvidenceSchema.extend({
14013
14013
  type: exports_external.literal("retrospective"),
14014
- phase_number: exports_external.number().int().min(0).max(99),
14014
+ phase_number: exports_external.number().int().min(1).max(99),
14015
14015
  total_tool_calls: exports_external.number().int().min(0).max(9999),
14016
14016
  coder_revisions: exports_external.number().int().min(0).max(999),
14017
14017
  reviewer_rejections: exports_external.number().int().min(0).max(999),
@@ -17219,7 +17219,7 @@ var SlopDetectorConfigSchema = exports_external.object({
17219
17219
  });
17220
17220
  var IncrementalVerifyConfigSchema = exports_external.object({
17221
17221
  enabled: exports_external.boolean().default(true),
17222
- command: exports_external.string().nullable().default(null),
17222
+ command: exports_external.union([exports_external.string(), exports_external.array(exports_external.string())]).nullable().default(null),
17223
17223
  timeoutMs: exports_external.number().int().min(1000).max(300000).default(30000),
17224
17224
  triggerAgents: exports_external.array(exports_external.string()).default(["coder"])
17225
17225
  });
@@ -35663,6 +35663,26 @@ function extractCurrentPhaseFromPlan2(plan) {
35663
35663
  init_utils2();
35664
35664
  init_manager2();
35665
35665
 
35666
+ // src/services/compaction-service.ts
35667
+ function makeInitialState() {
35668
+ return {
35669
+ lastObservationAt: 0,
35670
+ lastReflectionAt: 0,
35671
+ lastEmergencyAt: 0,
35672
+ observationCount: 0,
35673
+ reflectionCount: 0,
35674
+ emergencyCount: 0,
35675
+ lastSnapshotAt: null
35676
+ };
35677
+ }
35678
+ var state = makeInitialState();
35679
+ function getCompactionMetrics() {
35680
+ return {
35681
+ compactionCount: state.observationCount + state.reflectionCount + state.emergencyCount,
35682
+ lastSnapshotAt: state.lastSnapshotAt
35683
+ };
35684
+ }
35685
+
35666
35686
  // src/services/context-budget-service.ts
35667
35687
  init_utils2();
35668
35688
  var DEFAULT_CONTEXT_BUDGET_CONFIG = {
@@ -35689,6 +35709,7 @@ async function getStatusData(directory, agents) {
35689
35709
  }
35690
35710
  }
35691
35711
  const agentCount2 = Object.keys(agents).length;
35712
+ const metrics2 = getCompactionMetrics();
35692
35713
  return {
35693
35714
  hasPlan: true,
35694
35715
  currentPhase: currentPhase2,
@@ -35698,12 +35719,13 @@ async function getStatusData(directory, agents) {
35698
35719
  isLegacy: false,
35699
35720
  turboMode: hasActiveTurboMode(),
35700
35721
  contextBudgetPct: swarmState.lastBudgetPct > 0 ? swarmState.lastBudgetPct : null,
35701
- compactionCount: 0,
35702
- lastSnapshotAt: null
35722
+ compactionCount: metrics2.compactionCount,
35723
+ lastSnapshotAt: metrics2.lastSnapshotAt
35703
35724
  };
35704
35725
  }
35705
35726
  const planContent = await readSwarmFileAsync(directory, "plan.md");
35706
35727
  if (!planContent) {
35728
+ const metrics2 = getCompactionMetrics();
35707
35729
  return {
35708
35730
  hasPlan: false,
35709
35731
  currentPhase: "Unknown",
@@ -35713,8 +35735,8 @@ async function getStatusData(directory, agents) {
35713
35735
  isLegacy: true,
35714
35736
  turboMode: hasActiveTurboMode(),
35715
35737
  contextBudgetPct: swarmState.lastBudgetPct > 0 ? swarmState.lastBudgetPct : null,
35716
- compactionCount: 0,
35717
- lastSnapshotAt: null
35738
+ compactionCount: metrics2.compactionCount,
35739
+ lastSnapshotAt: metrics2.lastSnapshotAt
35718
35740
  };
35719
35741
  }
35720
35742
  const currentPhase = extractCurrentPhase(planContent) || "Unknown";
@@ -35722,6 +35744,7 @@ async function getStatusData(directory, agents) {
35722
35744
  const incompleteTasks = (planContent.match(/^- \[ \]/gm) || []).length;
35723
35745
  const totalTasks = completedTasks + incompleteTasks;
35724
35746
  const agentCount = Object.keys(agents).length;
35747
+ const metrics = getCompactionMetrics();
35725
35748
  return {
35726
35749
  hasPlan: true,
35727
35750
  currentPhase,
@@ -35731,8 +35754,8 @@ async function getStatusData(directory, agents) {
35731
35754
  isLegacy: true,
35732
35755
  turboMode: hasActiveTurboMode(),
35733
35756
  contextBudgetPct: swarmState.lastBudgetPct > 0 ? swarmState.lastBudgetPct : null,
35734
- compactionCount: 0,
35735
- lastSnapshotAt: null
35757
+ compactionCount: metrics.compactionCount,
35758
+ lastSnapshotAt: metrics.lastSnapshotAt
35736
35759
  };
35737
35760
  }
35738
35761
  function formatStatusMarkdown(status) {
@@ -434,7 +434,7 @@ export declare const SlopDetectorConfigSchema: z.ZodObject<{
434
434
  export type SlopDetectorConfig = z.infer<typeof SlopDetectorConfigSchema>;
435
435
  export declare const IncrementalVerifyConfigSchema: z.ZodObject<{
436
436
  enabled: z.ZodDefault<z.ZodBoolean>;
437
- command: z.ZodDefault<z.ZodNullable<z.ZodString>>;
437
+ command: z.ZodDefault<z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>>;
438
438
  timeoutMs: z.ZodDefault<z.ZodNumber>;
439
439
  triggerAgents: z.ZodDefault<z.ZodArray<z.ZodString>>;
440
440
  }, z.core.$strip>;
@@ -725,7 +725,7 @@ export declare const PluginConfigSchema: z.ZodObject<{
725
725
  }, z.core.$strip>>;
726
726
  incremental_verify: z.ZodOptional<z.ZodObject<{
727
727
  enabled: z.ZodDefault<z.ZodBoolean>;
728
- command: z.ZodDefault<z.ZodNullable<z.ZodString>>;
728
+ command: z.ZodDefault<z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>>;
729
729
  timeoutMs: z.ZodDefault<z.ZodNumber>;
730
730
  triggerAgents: z.ZodDefault<z.ZodArray<z.ZodString>>;
731
731
  }, z.core.$strip>>;
@@ -5,6 +5,7 @@
5
5
  */
6
6
  import type { IncrementalVerifyConfig } from '../config/schema';
7
7
  export type { IncrementalVerifyConfig };
8
+ export { detectTypecheckCommand };
8
9
  export interface IncrementalVerifyHook {
9
10
  toolAfter: (input: {
10
11
  tool: string;
@@ -15,4 +16,18 @@ export interface IncrementalVerifyHook {
15
16
  args?: unknown;
16
17
  }) => Promise<void>;
17
18
  }
19
+ /** For test isolation — call in beforeEach/afterEach */
20
+ export declare function resetAdvisoryDedup(): void;
21
+ /**
22
+ * Detect the typecheck/build check command for the project.
23
+ * Returns { command, language } where command is null if no default checker exists,
24
+ * or null overall if no supported language is detected.
25
+ * Checks in order: TypeScript (package.json) → Go (go.mod) → Rust (Cargo.toml)
26
+ * → Python (pyproject.toml/requirements.txt/setup.py) → C# (*.csproj/*.sln)
27
+ * First match wins; package.json presence means Node/Bun project — no fallthrough.
28
+ */
29
+ declare function detectTypecheckCommand(projectDir: string): {
30
+ command: string[] | null;
31
+ language: string;
32
+ } | null;
18
33
  export declare function createIncrementalVerifyHook(config: IncrementalVerifyConfig, projectDir: string, injectMessage: (sessionId: string, message: string) => void): IncrementalVerifyHook;
@@ -0,0 +1,5 @@
1
+ export declare function spawnAsync(command: string[], cwd: string, timeoutMs: number): Promise<{
2
+ exitCode: number;
3
+ stdout: string;
4
+ stderr: string;
5
+ } | null>;
@@ -0,0 +1 @@
1
+ export {};