opencode-swarm 7.59.1 → 7.61.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.
@@ -369,7 +369,7 @@ export declare const COMMAND_REGISTRY: {
369
369
  readonly handler: (ctx: CommandContext) => Promise<string>;
370
370
  readonly description: "View or modify QA gate profile for the current plan [enable|override <gate>...]";
371
371
  readonly args: "[show|enable|override] <gate>...";
372
- readonly details: "show: display spec-level, session-override, and effective QA gates for the current plan. enable: persist gate(s) into the locked-once profile (architect; rejected after critic approval lock). override: session-only ratchet-tighter enable. Valid gates: reviewer, test_engineer, council_mode, sme_enabled, critic_pre_plan, hallucination_guard, sast_enabled, mutation_test, council_general_review, drift_check.";
372
+ readonly details: "show: display spec-level, session-override, and effective QA gates for the current plan. enable: persist gate(s) into the locked-once profile (architect; rejected after critic approval lock). override: session-only ratchet-tighter enable. Valid gates: reviewer, test_engineer, council_mode, sme_enabled, critic_pre_plan, hallucination_guard, sast_enabled, mutation_test, phase_council, drift_check, final_council.";
373
373
  readonly category: "config";
374
374
  };
375
375
  readonly promote: {
@@ -26,7 +26,7 @@ export declare const DEFAULT_AGENT_CONFIGS: Record<string, {
26
26
  }>;
27
27
  export declare function isQAAgent(name: string): name is QAAgentName;
28
28
  export declare function isSubagent(name: string): boolean;
29
- import type { LeanTurboConfig, ScoringConfig } from './schema';
29
+ import type { LeanTurboConfig, ScoringConfig, WorktreeIsolationConfig } from './schema';
30
30
  export declare const DEFAULT_SCORING_CONFIG: ScoringConfig;
31
31
  /**
32
32
  * Resolve scoring configuration by deep-merging user config with defaults.
@@ -81,4 +81,5 @@ export declare const FULL_AUTO_BANNER = "## \u26A1 FULL-AUTO MODE ACTIVE\n\nYou
81
81
  * Zod schema in schema.ts).
82
82
  */
83
83
  export declare const DEFAULT_LEAN_TURBO_CONFIG: LeanTurboConfig;
84
+ export declare const DEFAULT_WORKTREE_ISOLATION_CONFIG: WorktreeIsolationConfig;
84
85
  export declare const LEAN_TURBO_BANNER = "## \uD83D\uDEE4\uFE0F LEAN TURBO ACTIVE\n\nLane-based parallel execution is enabled for this phase.\n\nBehavioral changes:\n- Tasks are partitioned into parallel lanes based on file-scope conflicts. Tasks in the same lane run sequentially; tasks in different lanes run concurrently (up to max_parallel_coders).\n- **Lane dispatch overrides the one-agent-per-message rule**: for lean lane dispatch only, you may send multiple Task tool calls concurrently (one per lane).\n- **Lane tasks skip per-task Stage B** (reviewer + test_engineer). Quality is enforced at phase-end via phase reviewer and critic gates instead.\n- **Degraded tasks** (global files, protected paths, high-risk patterns) and **serialized tasks** (lock-conflicted) run through standard serial workflow with full Stage B gates.\n- **Phase reviewer and critic are REQUIRED** before phase_complete when lean turbo is active \u2014 they serve as the holistic quality gate for all lane work.\n- **Full-Auto composition**: if Full-Auto is also active, lane dispatch is subject to Full-Auto delegation policy and phase approval.\n- Use the lean_turbo_run_phase tool to execute a phase with parallel lanes\n\nDo NOT skip phase reviewer/critic when configured. Degraded and serialized tasks MUST still go through full Stage B.\n";
@@ -18,7 +18,7 @@ export declare const _internals: {
18
18
  };
19
19
  export type { MigrationStatus, Phase, PhaseStatus, Plan, Task, TaskSize, TaskStatus, } from './plan-schema';
20
20
  export { MigrationStatusSchema, PhaseSchema, PhaseStatusSchema, PlanSchema, TaskSchema, TaskSizeSchema, TaskStatusSchema, } from './plan-schema';
21
- export type { AgentOverrideConfig, AutomationCapabilities, AutomationConfig, AutomationMode, LeanTurboConfig, MemoryConfig, PhaseCompleteConfig, PipelineConfig, PluginConfig, SkillPropagationConfig, SwarmConfig, TurboConfig, } from './schema';
22
- export { AgentOverrideConfigSchema, AutomationCapabilitiesSchema, AutomationConfigSchema, AutomationModeSchema, LeanTurboConfigSchema, MemoryConfigSchema, PhaseCompleteConfigSchema, PipelineConfigSchema, PluginConfigSchema, SkillPropagationConfigSchema, SwarmConfigSchema, TurboConfigSchema, } from './schema';
21
+ export type { AgentOverrideConfig, AutomationCapabilities, AutomationConfig, AutomationMode, LeanTurboConfig, MemoryConfig, PhaseCompleteConfig, PipelineConfig, PluginConfig, SkillPropagationConfig, SwarmConfig, TurboConfig, WorktreeIsolationConfig, } from './schema';
22
+ export { AgentOverrideConfigSchema, AutomationCapabilitiesSchema, AutomationConfigSchema, AutomationModeSchema, LeanTurboConfigSchema, MemoryConfigSchema, PhaseCompleteConfigSchema, PipelineConfigSchema, PluginConfigSchema, SkillPropagationConfigSchema, SwarmConfigSchema, TurboConfigSchema, WorktreeIsolationConfigSchema, } from './schema';
23
23
  export type { DeltaSpec, Obligation, SpecDelta, SpecRequirement, SpecScenario, SpecSection, SwarmSpec, } from './spec-schema';
24
24
  export { DeltaSpecSchema, ObligationSchema, SpecDeltaSchema, SpecRequirementSchema, SpecScenarioSchema, SpecSectionSchema, SwarmSpecSchema, validateSpecContent, } from './spec-schema';
@@ -822,6 +822,25 @@ export declare const ParallelizationConfigSchema: z.ZodObject<{
822
822
  max_reviewers: z.ZodDefault<z.ZodNumber>;
823
823
  }, z.core.$strip>;
824
824
  export type ParallelizationConfig = z.infer<typeof ParallelizationConfigSchema>;
825
+ export declare const WorktreeIsolationConfigSchema: z.ZodObject<{
826
+ policy: z.ZodDefault<z.ZodEnum<{
827
+ disabled: "disabled";
828
+ auto: "auto";
829
+ required: "required";
830
+ }>>;
831
+ merge_strategy: z.ZodDefault<z.ZodEnum<{
832
+ merge: "merge";
833
+ rebase: "rebase";
834
+ "cherry-pick": "cherry-pick";
835
+ }>>;
836
+ worktree_dir: z.ZodOptional<z.ZodString>;
837
+ deps_strategy: z.ZodDefault<z.ZodEnum<{
838
+ link: "link";
839
+ skip: "skip";
840
+ copy: "copy";
841
+ }>>;
842
+ }, z.core.$strip>;
843
+ export type WorktreeIsolationConfig = z.infer<typeof WorktreeIsolationConfigSchema>;
825
844
  export declare const LeanTurboConfigSchema: z.ZodObject<{
826
845
  max_parallel_coders: z.ZodDefault<z.ZodNumber>;
827
846
  require_declared_scope: z.ZodDefault<z.ZodBoolean>;
@@ -1481,6 +1500,24 @@ export declare const PluginConfigSchema: z.ZodObject<{
1481
1500
  max_coders: z.ZodDefault<z.ZodNumber>;
1482
1501
  max_reviewers: z.ZodDefault<z.ZodNumber>;
1483
1502
  }, z.core.$strip>>;
1503
+ worktree: z.ZodOptional<z.ZodObject<{
1504
+ policy: z.ZodDefault<z.ZodEnum<{
1505
+ disabled: "disabled";
1506
+ auto: "auto";
1507
+ required: "required";
1508
+ }>>;
1509
+ merge_strategy: z.ZodDefault<z.ZodEnum<{
1510
+ merge: "merge";
1511
+ rebase: "rebase";
1512
+ "cherry-pick": "cherry-pick";
1513
+ }>>;
1514
+ worktree_dir: z.ZodOptional<z.ZodString>;
1515
+ deps_strategy: z.ZodDefault<z.ZodEnum<{
1516
+ link: "link";
1517
+ skip: "skip";
1518
+ copy: "copy";
1519
+ }>>;
1520
+ }, z.core.$strip>>;
1484
1521
  turbo: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
1485
1522
  strategy: z.ZodLiteral<"standard">;
1486
1523
  lean: z.ZodOptional<z.ZodObject<{
@@ -5,7 +5,7 @@
5
5
  * No business logic, no I/O. Only types, interfaces, and defaults.
6
6
  */
7
7
  export type CouncilVerdict = 'APPROVE' | 'CONCERNS' | 'REJECT';
8
- export type CouncilFindingSeverity = 'HIGH' | 'MEDIUM' | 'LOW';
8
+ export type CouncilFindingSeverity = 'CRITICAL' | 'HIGH' | 'MEDIUM' | 'LOW';
9
9
  export type CouncilFindingCategory = 'logic' | 'edge_case' | 'error_handling' | 'spec_compliance' | 'security' | 'maintainability' | 'naming' | 'domain' | 'test_gap' | 'test_quality' | 'mutation_gap' | 'adversarial_gap' | 'slop_pattern' | 'hallucinated_api' | 'lazy_abstraction' | 'cargo_cult' | 'spec_drift' | 'other';
10
10
  export type CouncilAgent = 'critic' | 'reviewer' | 'sme' | 'test_engineer' | 'explorer';
11
11
  export interface CouncilFinding {
@@ -52,6 +52,8 @@ export interface CouncilSynthesis {
52
52
  allCriteriaMet: boolean;
53
53
  /** Distinct council members that produced verdicts (deduplicated count). */
54
54
  quorumSize: number;
55
+ /** Count of HIGH/CRITICAL findings from CONCERNS members promoted to requiredFixes */
56
+ blockingConcernsCount: number;
55
57
  /** true when called with an empty verdicts array — the APPROVE is vacuous */
56
58
  emptyVerdictsWarning?: boolean;
57
59
  }
@@ -84,6 +86,8 @@ export interface PhaseCouncilSynthesis {
84
86
  allCriteriaMet: boolean;
85
87
  /** Distinct council members that produced verdicts */
86
88
  quorumSize: number;
89
+ /** Count of HIGH/CRITICAL findings from CONCERNS members promoted to requiredFixes */
90
+ blockingConcernsCount: number;
87
91
  /** Path where evidence was written, e.g. .swarm/evidence/1/phase-council.json */
88
92
  evidencePath: string;
89
93
  /** Summary of the phase being reviewed */
@@ -116,6 +120,8 @@ export interface FinalCouncilSynthesis {
116
120
  allCriteriaMet: boolean;
117
121
  /** Distinct council members that produced verdicts */
118
122
  quorumSize: number;
123
+ /** Count of HIGH/CRITICAL findings from CONCERNS members promoted to requiredFixes */
124
+ blockingConcernsCount: number;
119
125
  /** Path where evidence was written */
120
126
  evidencePath: '.swarm/evidence/final-council.json';
121
127
  /** Summary of the completed project being reviewed */
@@ -154,7 +160,7 @@ export interface CouncilConfig {
154
160
  * options: critic_oversight agent, HTTP webhook, or configurable handler.
155
161
  */
156
162
  escalateOnMaxRounds?: string;
157
- /** Default true — CONCERNS verdict at phase-level council does NOT block completion (advisory). Set false to make CONCERNS block like REJECT. */
163
+ /** Default true — CONCERNS verdict with only MEDIUM/LOW findings does NOT block completion (advisory). Set false to make all CONCERNS block like REJECT. Note: HIGH/CRITICAL findings from CONCERNS members are always promoted to requiredFixes and block at the tool level regardless of this setting. */
158
164
  phaseConcernsAllowComplete: boolean;
159
165
  }
160
166
  export declare const COUNCIL_DEFAULTS: CouncilConfig;
@@ -31,7 +31,7 @@ export interface QaGates {
31
31
  hallucination_guard: boolean;
32
32
  sast_enabled: boolean;
33
33
  mutation_test: boolean;
34
- council_general_review: boolean;
34
+ phase_council: boolean;
35
35
  drift_check: boolean;
36
36
  final_council: boolean;
37
37
  }
@@ -100,7 +100,7 @@ export declare function computeProfileHash(profile: QaGateProfile): string;
100
100
  * machine; blocks coder→next-coder advancement until reviewer + test_engineer
101
101
  * delegations observed).
102
102
  * - council_mode — src/state.ts isCouncilGateActive + src/hooks/delegation-gate.ts
103
- * (Stage B replaced by submit_council_verdicts verdict).
103
+ * (replaces per-task Stage B with full 5-member council via submit_council_verdicts).
104
104
  * - sme_enabled — consumed during MODE: BRAINSTORM/SPECIFY architect dialogue.
105
105
  * - critic_pre_plan — consumed by MODE: PLAN critic delegation before save_plan.
106
106
  * - sast_enabled — consumed inside pre_check_batch tool.
@@ -108,11 +108,14 @@ export declare function computeProfileHash(profile: QaGateProfile): string;
108
108
  * until .swarm/evidence/{phase}/hallucination-guard.json has APPROVED verdict).
109
109
  * - mutation_test — src/tools/phase-complete.ts Gate 4 (blocks phase_complete
110
110
  * until .swarm/evidence/{phase}/mutation-gate.json has pass verdict; warn does not block)
111
- * - council_general_review — src/agents/architect.ts SPECIFY-COUNCIL-REVIEW
112
- * (fires when gate is true; runs convene_general_council on draft spec before
113
- * critic-gate to fold multi-model deliberation into the spec).
111
+ * - phase_council — src/tools/phase-complete/gates/phase-council-gate.ts Gate 5
112
+ * (blocks phase_complete until .swarm/evidence/{phase}/phase-council.json has
113
+ * approved verdict from 5-member holistic phase review).
114
114
  * - drift_check — src/tools/phase-complete.ts Gate 2 (blocks phase_complete when
115
115
  * drift-verifier.json missing or rejected)
116
+ * - final_council — src/tools/write-final-council-evidence.ts (blocks project
117
+ * completion until .swarm/evidence/final-council.json has approved verdict
118
+ * from 5-member project-scope review).
116
119
  *
117
120
  * Session overrides are intentionally ephemeral — they live only in
118
121
  * in-memory `AgentSessionState.qaGateSessionOverrides` and are NOT
@@ -5,8 +5,10 @@
5
5
  * Uses experimental.chat.messages.transform to provide non-blocking guidance.
6
6
  */
7
7
  import type { PluginConfig } from '../config';
8
+ import { loadPlanJsonOnly } from '../plan/manager';
8
9
  import type { AgentSessionState } from '../state';
9
10
  import type { DelegationEnvelope, EnvelopeValidationResult } from '../types/delegation.js';
11
+ import { attemptMergeBackFromDirty, postMergeCleanup, provisionWorktree, removeWorktree } from '../worktree';
10
12
  /**
11
13
  * v6.33.1 CRIT-1: Fallback map for declared coder scope by taskId.
12
14
  * When messagesTransform sets declaredCoderScope on the architect session,
@@ -78,6 +80,7 @@ interface MessageWithParts {
78
80
  info: MessageInfo;
79
81
  parts: MessagePart[];
80
82
  }
83
+ export declare function resetStandardWorktreeIsolationState(): void;
81
84
  declare function resolveDelegatedPlanTaskId(args: Record<string, unknown>, knownPlanTaskIds?: ReadonlySet<string>): string | null;
82
85
  declare function buildParallelExecutionGuidance(directory: string | undefined, sessionID: string, session: AgentSessionState): Promise<string | null>;
83
86
  /**
@@ -100,6 +103,12 @@ export declare const _internals: {
100
103
  resolveEvidenceTaskId: typeof resolveEvidenceTaskId;
101
104
  resolveDelegatedPlanTaskId: typeof resolveDelegatedPlanTaskId;
102
105
  buildParallelExecutionGuidance: typeof buildParallelExecutionGuidance;
106
+ loadPlanJsonOnly: typeof loadPlanJsonOnly;
107
+ provisionWorktree: typeof provisionWorktree;
108
+ removeWorktree: typeof removeWorktree;
109
+ attemptMergeBackFromDirty: typeof attemptMergeBackFromDirty;
110
+ postMergeCleanup: typeof postMergeCleanup;
111
+ resetStandardWorktreeIsolationState: typeof resetStandardWorktreeIsolationState;
103
112
  };
104
113
  /**
105
114
  * Creates the experimental.chat.messages.transform hook for delegation gating.