opencode-swarm 7.183.1 → 7.184.1

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 (123) hide show
  1. package/binaries/win32-arm64/swarm-sandbox-runner.exe +0 -0
  2. package/binaries/win32-x64/swarm-sandbox-runner.exe +0 -0
  3. package/dist/background/delegation-health.d.ts +1 -1
  4. package/dist/background/index.d.ts +1 -0
  5. package/dist/background/pr-event-delivery.d.ts +29 -14
  6. package/dist/background/pr-event-subscribers.d.ts +6 -5
  7. package/dist/background/pr-feedback-event-queue.d.ts +19 -2
  8. package/dist/background/pr-feedback-loop-runtime.d.ts +75 -0
  9. package/dist/background/pr-feedback-loop.d.ts +47 -12
  10. package/dist/cli/{coder-settlement-rserb0hm.js → coder-settlement-yvpewr52.js} +15 -12
  11. package/dist/cli/{config-doctor-r4fmzprn.js → config-doctor-qgwpvrbz.js} +7 -3
  12. package/dist/cli/{core-rzek3e2n.js → core-9qt388hq.js} +4 -4
  13. package/dist/cli/{curation-policy-g0jjwrg5.js → curation-policy-49f8jx48.js} +7 -6
  14. package/dist/cli/{curator-drift-a0r5krfx.js → curator-drift-wf0sm2te.js} +9 -9
  15. package/dist/cli/{curator-v84tfqcr.js → curator-ffz5pxgc.js} +40 -39
  16. package/dist/cli/curator-llm-factory-drs36v1q.js +75 -0
  17. package/dist/cli/{dispatch-p5zjg5e6.js → dispatch-cv89p2y1.js} +1 -1
  18. package/dist/cli/{evidence-summary-service-t4csk176.js → evidence-summary-service-8dfzjnxe.js} +21 -20
  19. package/dist/cli/{gate-evidence-3z04zprn.js → gate-evidence-aa5q30f4.js} +14 -7
  20. package/dist/cli/guardrail-explain-9g5y2gjm.js +76 -0
  21. package/dist/cli/{guardrail-log-cbzdh4qj.js → guardrail-log-0g51p94w.js} +8 -8
  22. package/dist/cli/{guardrail-reset-5e75rz44.js → guardrail-reset-dcbmt2wr.js} +40 -39
  23. package/dist/cli/{hive-promoter-f54nrhqn.js → hive-promoter-2g8nga0y.js} +40 -39
  24. package/dist/cli/{index-31e105jf.js → index-046psajf.js} +80 -2
  25. package/dist/cli/{index-rhw6m7s9.js → index-0874kghs.js} +9 -3
  26. package/dist/cli/{index-6h81yvyc.js → index-131ay7x1.js} +3 -3
  27. package/dist/cli/{index-raws06d3.js → index-2c91cxdv.js} +4 -4
  28. package/dist/cli/{index-9f930sy8.js → index-32vszgv0.js} +3 -3
  29. package/dist/cli/{index-0bpr8vag.js → index-3n5zsp31.js} +2 -2
  30. package/dist/cli/{index-b26hje53.js → index-3skvygca.js} +5 -5
  31. package/dist/cli/{index-w81jmdkt.js → index-456awy1p.js} +2 -2
  32. package/dist/cli/{index-hb1zqz50.js → index-475bkab8.js} +2 -2
  33. package/dist/cli/{index-80qhm8aq.js → index-49ptc9xx.js} +10 -4
  34. package/dist/cli/{index-bsjwchw7.js → index-57swfxyp.js} +8 -8
  35. package/dist/cli/{index-y5hhkx1n.js → index-5ppx86w1.js} +38 -18
  36. package/dist/cli/{index-jb7ywm4w.js → index-6b427dy8.js} +6 -6
  37. package/dist/cli/{index-3qy7v4k1.js → index-6cvdk98y.js} +2 -2
  38. package/dist/cli/{index-hsvsz3mj.js → index-6g664sy8.js} +1 -1
  39. package/dist/cli/{index-8me6m6ew.js → index-76abqm8d.js} +2 -2
  40. package/dist/cli/{index-z425p51d.js → index-7hvy33gc.js} +271 -80
  41. package/dist/cli/{index-4xr4gtwd.js → index-7p4ym4q3.js} +1 -1
  42. package/dist/cli/{index-j8ty457v.js → index-aghd9kcx.js} +2 -2
  43. package/dist/cli/{index-h01p5ygy.js → index-ar2gsn6b.js} +8 -8
  44. package/dist/cli/{index-ak1dd17g.js → index-dbshccrr.js} +3 -3
  45. package/dist/cli/{index-908k7jhw.js → index-depfky1j.js} +158 -27
  46. package/dist/cli/{index-5t08vc6m.js → index-earq3mda.js} +1 -1
  47. package/dist/cli/{index-6dm6ettv.js → index-ejb7ejhd.js} +1 -1
  48. package/dist/cli/{index-3rb5gs4w.js → index-f0nj3d8z.js} +1 -1
  49. package/dist/cli/{index-qjzbs971.js → index-gsgy1psq.js} +4 -4
  50. package/dist/cli/{index-jk05g11c.js → index-jc8pcf0r.js} +7 -7
  51. package/dist/cli/{index-mt0s67hg.js → index-jkxef52n.js} +2 -2
  52. package/dist/cli/{index-wpn7ftw1.js → index-jvk95e6y.js} +2 -2
  53. package/dist/cli/{index-5cve9g2b.js → index-k53a69vb.js} +6 -6
  54. package/dist/cli/{index-1xnse449.js → index-mc72pk74.js} +1 -1
  55. package/dist/cli/{index-w196wb3a.js → index-mz4zz59c.js} +42 -41
  56. package/dist/cli/{index-4hnk9npg.js → index-n107956q.js} +5 -5
  57. package/dist/cli/{index-gaykghrm.js → index-qczxr0wh.js} +12 -10
  58. package/dist/cli/{index-nazzb4em.js → index-s7bseqza.js} +3220 -1893
  59. package/dist/cli/{index-dg3f2sqq.js → index-t7hmqgjy.js} +90 -141
  60. package/dist/cli/{index-08x7gsnf.js → index-w9hxzcz4.js} +2 -2
  61. package/dist/cli/{index-bqphhrwf.js → index-wfdx7yw2.js} +39 -15
  62. package/dist/cli/{index-xtysafzj.js → index-wsb0wbw6.js} +40 -39
  63. package/dist/cli/{index-nmh0s6dg.js → index-wy3zpwjy.js} +1 -1
  64. package/dist/cli/{index-tt705bap.js → index-x1gyqgze.js} +7 -7
  65. package/dist/cli/index-xf69xty9.js +105 -0
  66. package/dist/cli/{index-ydefv5fn.js → index-ya32wfkp.js} +4 -2
  67. package/dist/cli/{index-1hnknn34.js → index-yk0r42nr.js} +4 -4
  68. package/dist/cli/{index-77650pyg.js → index-zzvxj02e.js} +3 -3
  69. package/dist/cli/index.js +41 -40
  70. package/dist/cli/{knowledge-escalator-cs7fjgy0.js → knowledge-escalator-pt21q3eh.js} +14 -13
  71. package/dist/cli/{knowledge-events-262c1jg2.js → knowledge-events-hp96b55k.js} +12 -11
  72. package/dist/cli/{knowledge-link-8kcms7pj.js → knowledge-link-ap2274vm.js} +6 -5
  73. package/dist/cli/{knowledge-store-yjrkfens.js → knowledge-store-rnw1e7zp.js} +7 -6
  74. package/dist/cli/{knowledge-validator-t98cvpt5.js → knowledge-validator-xy7r6eyx.js} +9 -8
  75. package/dist/cli/{mcp-wj6143vj.js → mcp-3nd85kww.js} +15 -1
  76. package/dist/cli/mcp.d.ts +1 -0
  77. package/dist/cli/{model-preflight-tz4ar9ys.js → model-preflight-xe0chjad.js} +40 -39
  78. package/dist/cli/{pending-delegations-vvbkqe24.js → pending-delegations-2pdngdzq.js} +13 -12
  79. package/dist/cli/{pr-subscriptions-maeppcws.js → pr-subscriptions-hxxwszyr.js} +13 -12
  80. package/dist/cli/{pr-workflow-gate-en54gabv.js → pr-workflow-gate-m37ynr6h.js} +40 -39
  81. package/dist/cli/{runner-618229m8.js → runner-yz3ysehf.js} +7 -6
  82. package/dist/cli/{scan-cursor-sxwh1ax8.js → scan-cursor-be9hbq1v.js} +8 -7
  83. package/dist/cli/{schema-fb8vm14k.js → schema-j17hv98z.js} +3 -1
  84. package/dist/cli/{scope-persistence-sc2zhr15.js → scope-persistence-rmt56rma.js} +16 -15
  85. package/dist/cli/{server-7ksq9wr7.js → server-wzrb59mh.js} +40 -39
  86. package/dist/cli/{skill-generator-ccmq47cm.js → skill-generator-vsfya55z.js} +16 -15
  87. package/dist/cli/{snapshot-coordination-init-h8eg88w2.js → snapshot-coordination-init-pc8ykvh8.js} +40 -39
  88. package/dist/cli/{speckit-checkoff-vkqn317p.js → speckit-checkoff-j407j8ew.js} +4 -4
  89. package/dist/cli/{telemetry-vqyy5nha.js → telemetry-39zmx4fp.js} +2 -2
  90. package/dist/cli/{workspace-snapshot-t22m6gbd.js → workspace-snapshot-0q1n1xq5.js} +4 -4
  91. package/dist/cli/{worktree-collision-ownership-8hr7aycc.js → worktree-collision-ownership-je4fb407.js} +14 -13
  92. package/dist/cli/{worktree-isolation-gwq3y9tf.js → worktree-isolation-27rt584e.js} +40 -39
  93. package/dist/commands/doctor.d.ts +5 -0
  94. package/dist/config/schema.d.ts +15 -0
  95. package/dist/context/role-filter.d.ts +2 -0
  96. package/dist/db/qa-gate-session-override.d.ts +12 -12
  97. package/dist/gate-evidence.d.ts +43 -1
  98. package/dist/hooks/final-context-accounting.d.ts +3 -2
  99. package/dist/hooks/guardrails/index.d.ts +13 -7
  100. package/dist/hooks/host-boundary.d.ts +10 -0
  101. package/dist/hooks/system-enhancer.d.ts +9 -2
  102. package/dist/hooks/system-guidance-carrier.d.ts +18 -0
  103. package/dist/index.js +520 -514
  104. package/dist/plan/ledger.d.ts +20 -4
  105. package/dist/plan/manager.d.ts +20 -2
  106. package/dist/services/config-doctor.d.ts +24 -0
  107. package/dist/services/injection-budget.d.ts +56 -8
  108. package/dist/session/hydration-ownership.d.ts +39 -12
  109. package/dist/session/snapshot-coordination-init.d.ts +11 -4
  110. package/dist/session/snapshot-reader.d.ts +9 -4
  111. package/dist/session/snapshot-writer.d.ts +2 -3
  112. package/dist/state.d.ts +35 -5
  113. package/dist/tools/phase-complete.d.ts +1 -0
  114. package/dist/tools/save-plan.d.ts +12 -0
  115. package/dist/tools/update-task-status.d.ts +1 -1
  116. package/dist/utils/project-boundary.d.ts +32 -1
  117. package/dist/workflow/coder-settlement.d.ts +8 -0
  118. package/dist/workflow/task-terminal.d.ts +2 -1
  119. package/dist/workflow/workflow-wal-schema.d.ts +2 -0
  120. package/opencode-swarm.schema.json +8 -0
  121. package/package.json +1 -1
  122. package/dist/cli/curator-llm-factory-xp4hgd8r.js +0 -74
  123. package/dist/cli/guardrail-explain-j2y5sj4d.js +0 -75
@@ -12,7 +12,7 @@ import {
12
12
  PluginConfigSchema,
13
13
  init_schema,
14
14
  stripKnownSwarmPrefix
15
- } from "./index-rhw6m7s9.js";
15
+ } from "./index-0874kghs.js";
16
16
  import {
17
17
  ALL_AGENT_NAMES,
18
18
  TOOL_NAME_SET,
@@ -75,6 +75,27 @@ var DEPRECATED_FIELDS = new Map([
75
75
  }
76
76
  ]
77
77
  ]);
78
+ var CURRENT_CONFIG_FORMAT_VERSION = 3;
79
+ var DEFAULT_FLIPS = [
80
+ {
81
+ field: "auto_review.enabled",
82
+ v7Default: "false (opt-in)",
83
+ v8Default: "release-gated true (advisory) \u2014 activates on the first 8.x release",
84
+ killSwitch: "auto_review.enabled: false",
85
+ preset: "conservative",
86
+ sinceVersion: 3,
87
+ evidence: "docs/defaults-governance.md"
88
+ },
89
+ {
90
+ field: "execution_profile.parallelization_enabled",
91
+ v7Default: "false (serial)",
92
+ v8Default: "true for new plans (since v7.132.0, gate-enforced serial fallback)",
93
+ killSwitch: "execution_profile.parallelization_enabled: false (per plan)",
94
+ preset: "conservative",
95
+ sinceVersion: 3,
96
+ evidence: "docs/defaults-governance.md"
97
+ }
98
+ ];
78
99
  function levenshteinDistance(a, b) {
79
100
  const al = a.length;
80
101
  const bl = b.length;
@@ -651,6 +672,20 @@ function validateConfigKey(path2, value) {
651
672
  }
652
673
  break;
653
674
  }
675
+ case "preset": {
676
+ if (value !== "default" && value !== "conservative") {
677
+ findings.push({
678
+ id: "type-mismatch",
679
+ title: `Config field "${path2}" has wrong type`,
680
+ description: `Expected "default" or "conservative", got ${JSON.stringify(value)}`,
681
+ severity: "error",
682
+ path: path2,
683
+ currentValue: value,
684
+ autoFixable: false
685
+ });
686
+ }
687
+ break;
688
+ }
654
689
  case "guardrails.enabled": {
655
690
  if (value === false) {
656
691
  findings.push({
@@ -1480,6 +1515,22 @@ function runConfigDoctor(config, directory) {
1480
1515
  });
1481
1516
  }
1482
1517
  }
1518
+ for (const flip of DEFAULT_FLIPS) {
1519
+ if (configVersion < flip.sinceVersion) {
1520
+ findings.push({
1521
+ id: "defaults-flip",
1522
+ title: `v8 default change pending for "${flip.field}"`,
1523
+ description: `Default flips from ${flip.v7Default} to ${flip.v8Default}. ` + `Kill switch: set ${flip.killSwitch}. ` + `Restore all v7 defaults with preset: "${flip.preset}". ` + `Evidence and rollback: ${flip.evidence} (#2504).`,
1524
+ severity: "info",
1525
+ path: flip.field,
1526
+ currentValue: "v7 default",
1527
+ autoFixable: false
1528
+ });
1529
+ }
1530
+ }
1531
+ summary.info = findings.filter((f) => f.severity === "info").length;
1532
+ summary.warn = findings.filter((f) => f.severity === "warn").length;
1533
+ summary.error = findings.filter((f) => f.severity === "error").length;
1483
1534
  return {
1484
1535
  findings,
1485
1536
  summary,
@@ -1763,6 +1814,33 @@ async function runConfigDoctorWithFixes(directory, config, autoFix = false, opti
1763
1814
  backupPath = writeBackupArtifact(directory, backup);
1764
1815
  }
1765
1816
  const { appliedFixes, updatedConfigPath } = applySafeAutoFixes(directory, result, options);
1817
+ const hasDefaultsFlipFindings = result.findings.some((finding) => finding.id === "defaults-flip");
1818
+ if (options.applyLossy === true && (appliedFixes.length > 0 || hasDefaultsFlipFindings)) {
1819
+ try {
1820
+ const {
1821
+ userConfigPath: stampUserPath,
1822
+ projectConfigPath: stampProjectPath
1823
+ } = getConfigPaths(directory);
1824
+ const stampPath = fs.existsSync(stampProjectPath) ? stampProjectPath : fs.existsSync(stampUserPath) ? stampUserPath : null;
1825
+ if (stampPath) {
1826
+ const stampContent = fs.readFileSync(stampPath, "utf-8");
1827
+ const sanitizedStampContent = stampContent.charCodeAt(0) === 65279 ? stampContent.slice(1) : stampContent;
1828
+ const stampConfig = JSON.parse(sanitizedStampContent);
1829
+ const currentVersion = stampConfig.config_format_version;
1830
+ const shouldStamp = typeof currentVersion !== "number" || !Number.isInteger(currentVersion) || currentVersion < 0 || currentVersion < CURRENT_CONFIG_FORMAT_VERSION;
1831
+ if (shouldStamp) {
1832
+ stampConfig.config_format_version = CURRENT_CONFIG_FORMAT_VERSION;
1833
+ const stampDir = path.dirname(stampPath);
1834
+ if (!fs.existsSync(stampDir)) {
1835
+ fs.mkdirSync(stampDir, { recursive: true });
1836
+ }
1837
+ atomicWriteFileSync(stampPath, JSON.stringify(stampConfig, null, 2));
1838
+ }
1839
+ }
1840
+ } catch (stampError) {
1841
+ log(`[ConfigDoctor] acknowledgment stamp failed (non-fatal): ${stampError instanceof Error ? stampError.message : String(stampError)}`);
1842
+ }
1843
+ }
1766
1844
  if (appliedFixes.length > 0) {
1767
1845
  const freshConfig = readConfigFromFile(directory);
1768
1846
  if (freshConfig) {
@@ -1887,4 +1965,4 @@ function removeStraySwarmDir(projectRoot, strayPath) {
1887
1965
  }
1888
1966
  }
1889
1967
 
1890
- export { LEAN_TURBO_GATE_PRODUCERS, collectLeanTurboGateSatisfiabilityFindings, getConfigPaths, createConfigBackup, writeBackupArtifact, restoreFromBackup, runConfigDoctor, applySafeAutoFixes, readDoctorArtifact, writeDoctorArtifact, shouldRunOnStartup, runConfigDoctorWithFixes, detectStraySwarmDirs, removeStraySwarmDir };
1968
+ export { CURRENT_CONFIG_FORMAT_VERSION, DEFAULT_FLIPS, LEAN_TURBO_GATE_PRODUCERS, collectLeanTurboGateSatisfiabilityFindings, getConfigPaths, createConfigBackup, writeBackupArtifact, restoreFromBackup, runConfigDoctor, applySafeAutoFixes, readDoctorArtifact, writeDoctorArtifact, shouldRunOnStartup, runConfigDoctorWithFixes, detectStraySwarmDirs, removeStraySwarmDir };
@@ -21,7 +21,7 @@ var package_default;
21
21
  var init_package = __esm(() => {
22
22
  package_default = {
23
23
  name: "opencode-swarm",
24
- version: "7.183.1",
24
+ version: "7.184.1",
25
25
  description: "Architect-centric agentic swarm plugin for OpenCode - hub-and-spoke orchestration with SME consultation, code generation, and QA review",
26
26
  main: "dist/index.js",
27
27
  types: "dist/index.d.ts",
@@ -289,6 +289,8 @@ function hasApprovedAutoReviewBurnIn(decision) {
289
289
  return Boolean(decision?.approved === true && decision.artifact_path === AUTO_REVIEW_V8_BURN_IN_DECISION.artifact_path && decision.artifact_sha256 === AUTO_REVIEW_V8_BURN_IN_DECISION.artifact_sha256);
290
290
  }
291
291
  function autoReviewEnabledByRelease(context = {}) {
292
+ if (context.preset === "conservative")
293
+ return false;
292
294
  const version = context.packageVersion ?? package_default.version;
293
295
  const major = Number.parseInt(version.split(".")[0] ?? "", 10);
294
296
  return Number.isInteger(major) && major >= 8 && hasApprovedAutoReviewBurnIn(context.burnInDecision ?? AUTO_REVIEW_V8_BURN_IN_DECISION);
@@ -380,7 +382,7 @@ function resolveExternalSkillsConfig(input) {
380
382
  };
381
383
  return merged;
382
384
  }
383
- var _internals, SEPARATORS, CANONICAL_ROLES_LONGEST_FIRST, CANONICAL_ROLES_SET, AgentReasoningConfigSchema, AgentThinkingConfigSchema, FALLBACK_MODELS_MAX = 3, AgentOverrideConfigSchema, SwarmConfigSchema, ModelPricingConfigSchema, PricingConfigSchema, HooksConfigSchema, ScoringWeightsSchema, DecisionDecaySchema, TokenRatiosSchema, ScoringConfigSchema, ContextBudgetConfigSchema, EvidenceConfigSchema, GateFeatureSchema, PlaceholderScanConfigSchema, QualityBudgetConfigSchema, GATE_SECTION_SCHEMAS, GateConfigSchema, GATE_CONFIG_KNOWN_SECTION_KEYS, GATE_CONFIG_READERS, PipelineConfigSchema, PhaseCompleteConfigSchema, SummaryConfigSchema, RetentionConfigSchema, ReviewPassesConfigSchema, AUTO_REVIEW_V8_BURN_IN_DECISION, AutoReviewFinalConfigSchema, AutoReviewConfigObjectSchema, AutoReviewConfigSchema, AdversarialDetectionConfigSchema, AdversarialTestingConfigSchemaBase, AdversarialTestingConfigSchema, IntegrationAnalysisConfigSchema, DocsConfigSchema, DesignDocsConfigSchema, GitConfigSchema, UIReviewConfigSchema, CompactionAdvisoryConfigSchema, LintConfigSchema, SecretscanConfigSchema, GuardrailsProfileSchema, DEFAULT_AGENT_PROFILES, DEFAULT_ARCHITECT_PROFILE, GuardrailsConfigSchema, WatchdogConfigSchema, SelfReviewConfigSchema, ToolFilterConfigSchema, PlanCursorConfigSchema, ContextMapConfigSchema, RepoGraphConfigSchema, INVALID_CHECKPOINT_PROTO_FIELD = "__swarm_invalid_checkpoint_proto__", FORBIDDEN_CHECKPOINT_CONFIG_KEYS, CheckpointConfigSchema, ApplyPatchConfigSchema, AutomationModeSchema, AutomationCapabilitiesSchema, AutomationConfigSchemaBase, AutomationConfigSchema, KnowledgeConfigSchema, LearningConfigSchema, ConsensusConfigSchema, OtlpExportConfigSchema, ObservabilityConfigSchema, MemoryConfigSchema, CuratorConfigSchema, ArchitecturalSupervisionConfigSchema, KnowledgeApplicationConfigSchema, SkillPropagationAudienceSchema, SkillPropagationConfigSchema, HarnessRelativePathSchema, HarnessEvolutionConfigSchema, DEFAULT_HARNESS_EVOLUTION_CONFIG, HarnessOptConfigSchema, DEFAULT_HARNESS_OPT_CONFIG, SkillImproverConfigSchema, SkillsConfigSchema, SkillOptConfigSchema, DEFAULT_SKILL_OPT_CONFIG, SpecWriterConfigSchema, SlopDetectorConfigSchema, IncrementalVerifyConfigSchema, CompactionConfigSchema, PrmConfigSchema, AgentAuthorityRuleSchema, AuthorityConfigSchema, GeneralCouncilMemberConfigSchema, GeneralCouncilConfigSchema, CouncilConfigSchema, PrMonitorConfigSchema, PrFeedbackLoopConfigSchema, ParallelizationConfigSchema, WorktreeIsolationConfigSchema, LeanTurboConfigSchema, EpicConfigSchema, StandardTurboConfigSchema, LeanTurboStrategyConfigSchema, TurboConfigSchema, ExternalSkillCandidateSourceTypeSchema, ExternalSkillCandidateEvaluationVerdictSchema, DiscoverySourceSchema, ExternalSkillCandidateSchema, ExternalSkillsConfigSchema, DEFAULT_EXTERNAL_SKILLS_CONFIG, DEFAULT_SKILLS_CONFIG, DEFAULT_PR_REVIEW_RESILIENCE_CONFIG, PrReviewResilienceConfigSchema, ReviewRoutingConfigSchema, DEFAULT_REVIEW_ROUTING_CONFIG, LaneLivenessWatchdogConfigSchema, DispatchProtectionConfigSchema, DashboardConfigSchema, DEFAULT_PR_REVIEW_LEGACY_TRANSCRIPT_COMPATIBILITY = false, PluginConfigSchema;
385
+ var _internals, SEPARATORS, CANONICAL_ROLES_LONGEST_FIRST, CANONICAL_ROLES_SET, AgentReasoningConfigSchema, AgentThinkingConfigSchema, FALLBACK_MODELS_MAX = 3, AgentOverrideConfigSchema, SwarmConfigSchema, ModelPricingConfigSchema, PricingConfigSchema, HooksConfigSchema, ScoringWeightsSchema, DecisionDecaySchema, TokenRatiosSchema, ScoringConfigSchema, ContextBudgetConfigSchema, EvidenceConfigSchema, GateFeatureSchema, PlaceholderScanConfigSchema, QualityBudgetConfigSchema, GATE_SECTION_SCHEMAS, GateConfigSchema, GATE_CONFIG_KNOWN_SECTION_KEYS, GATE_CONFIG_READERS, PipelineConfigSchema, PhaseCompleteConfigSchema, SummaryConfigSchema, RetentionConfigSchema, ReviewPassesConfigSchema, AUTO_REVIEW_V8_BURN_IN_DECISION, CONSERVATIVE_PRESET_BASE, AutoReviewFinalConfigSchema, AutoReviewConfigObjectSchema, AutoReviewConfigSchema, AdversarialDetectionConfigSchema, AdversarialTestingConfigSchemaBase, AdversarialTestingConfigSchema, IntegrationAnalysisConfigSchema, DocsConfigSchema, DesignDocsConfigSchema, GitConfigSchema, UIReviewConfigSchema, CompactionAdvisoryConfigSchema, LintConfigSchema, SecretscanConfigSchema, GuardrailsProfileSchema, DEFAULT_AGENT_PROFILES, DEFAULT_ARCHITECT_PROFILE, GuardrailsConfigSchema, WatchdogConfigSchema, SelfReviewConfigSchema, ToolFilterConfigSchema, PlanCursorConfigSchema, ContextMapConfigSchema, RepoGraphConfigSchema, INVALID_CHECKPOINT_PROTO_FIELD = "__swarm_invalid_checkpoint_proto__", FORBIDDEN_CHECKPOINT_CONFIG_KEYS, CheckpointConfigSchema, ApplyPatchConfigSchema, AutomationModeSchema, AutomationCapabilitiesSchema, AutomationConfigSchemaBase, AutomationConfigSchema, KnowledgeConfigSchema, LearningConfigSchema, ConsensusConfigSchema, OtlpExportConfigSchema, ObservabilityConfigSchema, MemoryConfigSchema, CuratorConfigSchema, ArchitecturalSupervisionConfigSchema, KnowledgeApplicationConfigSchema, SkillPropagationAudienceSchema, SkillPropagationConfigSchema, HarnessRelativePathSchema, HarnessEvolutionConfigSchema, DEFAULT_HARNESS_EVOLUTION_CONFIG, HarnessOptConfigSchema, DEFAULT_HARNESS_OPT_CONFIG, SkillImproverConfigSchema, SkillsConfigSchema, SkillOptConfigSchema, DEFAULT_SKILL_OPT_CONFIG, SpecWriterConfigSchema, SlopDetectorConfigSchema, IncrementalVerifyConfigSchema, CompactionConfigSchema, PrmConfigSchema, AgentAuthorityRuleSchema, AuthorityConfigSchema, GeneralCouncilMemberConfigSchema, GeneralCouncilConfigSchema, CouncilConfigSchema, PrMonitorConfigSchema, PrFeedbackLoopConfigSchema, ParallelizationConfigSchema, WorktreeIsolationConfigSchema, LeanTurboConfigSchema, EpicConfigSchema, StandardTurboConfigSchema, LeanTurboStrategyConfigSchema, TurboConfigSchema, ExternalSkillCandidateSourceTypeSchema, ExternalSkillCandidateEvaluationVerdictSchema, DiscoverySourceSchema, ExternalSkillCandidateSchema, ExternalSkillsConfigSchema, DEFAULT_EXTERNAL_SKILLS_CONFIG, DEFAULT_SKILLS_CONFIG, DEFAULT_PR_REVIEW_RESILIENCE_CONFIG, PrReviewResilienceConfigSchema, ReviewRoutingConfigSchema, DEFAULT_REVIEW_ROUTING_CONFIG, LaneLivenessWatchdogConfigSchema, DispatchProtectionConfigSchema, DashboardConfigSchema, DEFAULT_PR_REVIEW_LEGACY_TRANSCRIPT_COMPATIBILITY = false, PluginConfigSchema;
384
386
  var init_schema = __esm(() => {
385
387
  init_zod();
386
388
  init_package();
@@ -600,6 +602,9 @@ var init_schema = __esm(() => {
600
602
  artifact_path: "docs/benchmarks/auto-review-v8-cost-baseline.json",
601
603
  artifact_sha256: "b4e981d4d87e3de80f6d7dd4ae782b08159d385019c4d8b0d300c0443f1984ce"
602
604
  };
605
+ CONSERVATIVE_PRESET_BASE = {
606
+ auto_review: { enabled: false }
607
+ };
603
608
  AutoReviewFinalConfigSchema = exports_external.object({
604
609
  on_phase_complete: exports_external.boolean().default(true),
605
610
  on_plan_complete: exports_external.boolean().default(true),
@@ -1768,6 +1773,7 @@ var init_schema = __esm(() => {
1768
1773
  PluginConfigSchema = exports_external.object({
1769
1774
  $schema: exports_external.string().optional().catch(undefined).describe("JSON Schema URL for editor validation/autocomplete of this file (issue #1663). Ignored at runtime; malformed values are ignored too."),
1770
1775
  config_format_version: exports_external.number().int().min(0).default(1).describe("Config format version for the migration table. Increment when fields are deprecated. Distinct from knowledge.schema_version."),
1776
+ preset: exports_external.enum(["default", "conservative"]).optional().describe('Defaults profile: "default" applies the governed v8 defaults; "conservative" restores the pre-flip (v7) defaults for every flipped surface (#2504).'),
1771
1777
  agents: exports_external.record(exports_external.string(), AgentOverrideConfigSchema).optional().describe('Per-agent overrides keyed by agent name for the default swarm (e.g. "architect", "coder"). Multi-swarm setups configure agents under swarms.<id>.agents instead.'),
1772
1778
  default_agent: exports_external.string().optional().transform((v) => {
1773
1779
  if (v === undefined)
@@ -2031,4 +2037,4 @@ var init_schema = __esm(() => {
2031
2037
  });
2032
2038
  });
2033
2039
 
2034
- export { init_package, package_default, DEFAULT_MODEL_CONTEXT_TOKENS, isUsableConfiguredWindow, isUsableContextWindow, resolveContextWindow, init_context_window, _internals, isKnownCanonicalRole, getCanonicalAgentRole, resolveGeneratedAgentRole, stripKnownSwarmPrefix, AgentReasoningConfigSchema, AgentThinkingConfigSchema, FALLBACK_MODELS_MAX, AgentOverrideConfigSchema, SwarmConfigSchema, ModelPricingConfigSchema, PricingConfigSchema, HooksConfigSchema, ScoringWeightsSchema, DecisionDecaySchema, TokenRatiosSchema, ScoringConfigSchema, ContextBudgetConfigSchema, EvidenceConfigSchema, GateFeatureSchema, PlaceholderScanConfigSchema, QualityBudgetConfigSchema, GATE_SECTION_SCHEMAS, GateConfigSchema, GATE_CONFIG_KNOWN_SECTION_KEYS, GATE_CONFIG_READERS, PipelineConfigSchema, PhaseCompleteConfigSchema, SummaryConfigSchema, RetentionConfigSchema, ReviewPassesConfigSchema, AUTO_REVIEW_V8_BURN_IN_DECISION, AutoReviewConfigSchema, resolveAutoReviewConfig, AdversarialDetectionConfigSchema, AdversarialTestingConfigSchema, IntegrationAnalysisConfigSchema, DocsConfigSchema, DesignDocsConfigSchema, GitConfigSchema, UIReviewConfigSchema, CompactionAdvisoryConfigSchema, LintConfigSchema, SecretscanConfigSchema, GuardrailsProfileSchema, DEFAULT_AGENT_PROFILES, DEFAULT_ARCHITECT_PROFILE, GuardrailsConfigSchema, WatchdogConfigSchema, SelfReviewConfigSchema, resolveGuardrailsConfig, ToolFilterConfigSchema, PlanCursorConfigSchema, ContextMapConfigSchema, RepoGraphConfigSchema, CheckpointConfigSchema, ApplyPatchConfigSchema, AutomationModeSchema, AutomationCapabilitiesSchema, AutomationConfigSchema, KnowledgeConfigSchema, LearningConfigSchema, ConsensusConfigSchema, OtlpExportConfigSchema, ObservabilityConfigSchema, MemoryConfigSchema, CuratorConfigSchema, ArchitecturalSupervisionConfigSchema, KnowledgeApplicationConfigSchema, SkillPropagationConfigSchema, HarnessEvolutionConfigSchema, DEFAULT_HARNESS_EVOLUTION_CONFIG, HarnessOptConfigSchema, DEFAULT_HARNESS_OPT_CONFIG, SkillImproverConfigSchema, SkillsConfigSchema, SkillOptConfigSchema, DEFAULT_SKILL_OPT_CONFIG, SpecWriterConfigSchema, SlopDetectorConfigSchema, IncrementalVerifyConfigSchema, CompactionConfigSchema, PrmConfigSchema, AgentAuthorityRuleSchema, AuthorityConfigSchema, GeneralCouncilConfigSchema, CouncilConfigSchema, PrMonitorConfigSchema, PrFeedbackLoopConfigSchema, ParallelizationConfigSchema, WorktreeIsolationConfigSchema, LeanTurboConfigSchema, EpicConfigSchema, StandardTurboConfigSchema, LeanTurboStrategyConfigSchema, TurboConfigSchema, ExternalSkillCandidateSourceTypeSchema, ExternalSkillCandidateEvaluationVerdictSchema, DiscoverySourceSchema, ExternalSkillCandidateSchema, ExternalSkillsConfigSchema, DEFAULT_EXTERNAL_SKILLS_CONFIG, DEFAULT_SKILLS_CONFIG, resolveExternalSkillsConfig, DEFAULT_PR_REVIEW_RESILIENCE_CONFIG, PrReviewResilienceConfigSchema, ReviewRoutingConfigSchema, DEFAULT_REVIEW_ROUTING_CONFIG, LaneLivenessWatchdogConfigSchema, DispatchProtectionConfigSchema, DashboardConfigSchema, DEFAULT_PR_REVIEW_LEGACY_TRANSCRIPT_COMPATIBILITY, PluginConfigSchema, init_schema };
2040
+ export { init_package, package_default, DEFAULT_MODEL_CONTEXT_TOKENS, isUsableConfiguredWindow, isUsableContextWindow, resolveContextWindow, init_context_window, _internals, isKnownCanonicalRole, getCanonicalAgentRole, resolveGeneratedAgentRole, stripKnownSwarmPrefix, AgentReasoningConfigSchema, AgentThinkingConfigSchema, FALLBACK_MODELS_MAX, AgentOverrideConfigSchema, SwarmConfigSchema, ModelPricingConfigSchema, PricingConfigSchema, HooksConfigSchema, ScoringWeightsSchema, DecisionDecaySchema, TokenRatiosSchema, ScoringConfigSchema, ContextBudgetConfigSchema, EvidenceConfigSchema, GateFeatureSchema, PlaceholderScanConfigSchema, QualityBudgetConfigSchema, GATE_SECTION_SCHEMAS, GateConfigSchema, GATE_CONFIG_KNOWN_SECTION_KEYS, GATE_CONFIG_READERS, PipelineConfigSchema, PhaseCompleteConfigSchema, SummaryConfigSchema, RetentionConfigSchema, ReviewPassesConfigSchema, AUTO_REVIEW_V8_BURN_IN_DECISION, CONSERVATIVE_PRESET_BASE, AutoReviewConfigSchema, resolveAutoReviewConfig, AdversarialDetectionConfigSchema, AdversarialTestingConfigSchema, IntegrationAnalysisConfigSchema, DocsConfigSchema, DesignDocsConfigSchema, GitConfigSchema, UIReviewConfigSchema, CompactionAdvisoryConfigSchema, LintConfigSchema, SecretscanConfigSchema, GuardrailsProfileSchema, DEFAULT_AGENT_PROFILES, DEFAULT_ARCHITECT_PROFILE, GuardrailsConfigSchema, WatchdogConfigSchema, SelfReviewConfigSchema, resolveGuardrailsConfig, ToolFilterConfigSchema, PlanCursorConfigSchema, ContextMapConfigSchema, RepoGraphConfigSchema, CheckpointConfigSchema, ApplyPatchConfigSchema, AutomationModeSchema, AutomationCapabilitiesSchema, AutomationConfigSchema, KnowledgeConfigSchema, LearningConfigSchema, ConsensusConfigSchema, OtlpExportConfigSchema, ObservabilityConfigSchema, MemoryConfigSchema, CuratorConfigSchema, ArchitecturalSupervisionConfigSchema, KnowledgeApplicationConfigSchema, SkillPropagationConfigSchema, HarnessEvolutionConfigSchema, DEFAULT_HARNESS_EVOLUTION_CONFIG, HarnessOptConfigSchema, DEFAULT_HARNESS_OPT_CONFIG, SkillImproverConfigSchema, SkillsConfigSchema, SkillOptConfigSchema, DEFAULT_SKILL_OPT_CONFIG, SpecWriterConfigSchema, SlopDetectorConfigSchema, IncrementalVerifyConfigSchema, CompactionConfigSchema, PrmConfigSchema, AgentAuthorityRuleSchema, AuthorityConfigSchema, GeneralCouncilConfigSchema, CouncilConfigSchema, PrMonitorConfigSchema, PrFeedbackLoopConfigSchema, ParallelizationConfigSchema, WorktreeIsolationConfigSchema, LeanTurboConfigSchema, EpicConfigSchema, StandardTurboConfigSchema, LeanTurboStrategyConfigSchema, TurboConfigSchema, ExternalSkillCandidateSourceTypeSchema, ExternalSkillCandidateEvaluationVerdictSchema, DiscoverySourceSchema, ExternalSkillCandidateSchema, ExternalSkillsConfigSchema, DEFAULT_EXTERNAL_SKILLS_CONFIG, DEFAULT_SKILLS_CONFIG, resolveExternalSkillsConfig, DEFAULT_PR_REVIEW_RESILIENCE_CONFIG, PrReviewResilienceConfigSchema, ReviewRoutingConfigSchema, DEFAULT_REVIEW_ROUTING_CONFIG, LaneLivenessWatchdogConfigSchema, DispatchProtectionConfigSchema, DashboardConfigSchema, DEFAULT_PR_REVIEW_LEGACY_TRANSCRIPT_COMPATIBILITY, PluginConfigSchema, init_schema };
@@ -1,17 +1,17 @@
1
1
  // @bun
2
2
  import {
3
3
  validateSwarmPath
4
- } from "./index-nmh0s6dg.js";
4
+ } from "./index-wy3zpwjy.js";
5
5
  import {
6
6
  bunSpawn
7
7
  } from "./index-2s7dvzff.js";
8
8
  import {
9
9
  canonicalRootKey,
10
10
  sameProjectRoot
11
- } from "./index-1xnse449.js";
11
+ } from "./index-mc72pk74.js";
12
12
  import {
13
13
  atomicWriteSwarmFile
14
- } from "./index-5cve9g2b.js";
14
+ } from "./index-k53a69vb.js";
15
15
  import {
16
16
  init_git_executable,
17
17
  resolveGitExecutable
@@ -1,16 +1,16 @@
1
1
  // @bun
2
2
  import {
3
3
  validateSwarmPath
4
- } from "./index-nmh0s6dg.js";
4
+ } from "./index-wy3zpwjy.js";
5
5
  import {
6
6
  bunSpawn
7
7
  } from "./index-2s7dvzff.js";
8
8
  import {
9
9
  canonicalRootKeyFresh
10
- } from "./index-1xnse449.js";
10
+ } from "./index-mc72pk74.js";
11
11
  import {
12
12
  atomicWriteSwarmFileSync
13
- } from "./index-5cve9g2b.js";
13
+ } from "./index-k53a69vb.js";
14
14
  import {
15
15
  advisoryWarn,
16
16
  init_git_executable,
@@ -242,7 +242,7 @@ var _internals2 = {
242
242
  symlinkSync: fs2.symlinkSync
243
243
  },
244
244
  writeScopeToDisk: async (directory, taskId, files) => {
245
- const { writeScopeToDisk: realWrite } = await import("./scope-persistence-sc2zhr15.js");
245
+ const { writeScopeToDisk: realWrite } = await import("./scope-persistence-rmt56rma.js");
246
246
  return realWrite(directory, taskId, files);
247
247
  },
248
248
  writeLaneProfileToDisk: async (_worktreePath, _laneIndex, _envOverrides) => {
@@ -1,14 +1,14 @@
1
1
  // @bun
2
2
  import {
3
3
  observeStoreHealth
4
- } from "./index-77650pyg.js";
4
+ } from "./index-zzvxj02e.js";
5
5
  import {
6
6
  telemetry
7
- } from "./index-tt705bap.js";
7
+ } from "./index-x1gyqgze.js";
8
8
  import {
9
9
  init_schema,
10
10
  stripKnownSwarmPrefix
11
- } from "./index-rhw6m7s9.js";
11
+ } from "./index-0874kghs.js";
12
12
  import {
13
13
  init_constants
14
14
  } from "./index-wzec3c4g.js";
@@ -1,10 +1,10 @@
1
1
  // @bun
2
2
  import {
3
3
  validateSwarmPath
4
- } from "./index-nmh0s6dg.js";
4
+ } from "./index-wy3zpwjy.js";
5
5
  import {
6
6
  atomicWriteSwarmFileSync
7
- } from "./index-5cve9g2b.js";
7
+ } from "./index-k53a69vb.js";
8
8
 
9
9
  // src/hooks/delegation-gate/worktree-provisioning-owner.ts
10
10
  import { createHash } from "crypto";
@@ -3,7 +3,7 @@ import {
3
3
  queryHistoricalOutcomes,
4
4
  readKnowledgeEvents,
5
5
  recordKnowledgeEvent
6
- } from "./index-gaykghrm.js";
6
+ } from "./index-qczxr0wh.js";
7
7
  import {
8
8
  jaccardBigram,
9
9
  readKnowledge,
@@ -11,7 +11,7 @@ import {
11
11
  resolveSwarmKnowledgePath,
12
12
  transactKnowledge,
13
13
  wordBigrams
14
- } from "./index-jk05g11c.js";
14
+ } from "./index-jc8pcf0r.js";
15
15
  import {
16
16
  init_knowledge_types,
17
17
  isActiveStatus
@@ -224,11 +224,11 @@ async function maybeQuarantineOnContradiction(directory, entryId, threshold, win
224
224
  alreadyInactive: true
225
225
  };
226
226
  }
227
- const { quarantineEntry } = await import("./knowledge-validator-t98cvpt5.js");
227
+ const { quarantineEntry } = await import("./knowledge-validator-xy7r6eyx.js");
228
228
  let policyConfig;
229
229
  try {
230
- const { KnowledgeConfigSchema } = await import("./schema-fb8vm14k.js");
231
- const { loadPluginConfigWithMeta } = await import("./index-ak1dd17g.js");
230
+ const { KnowledgeConfigSchema } = await import("./schema-j17hv98z.js");
231
+ const { loadPluginConfigWithMeta } = await import("./index-dbshccrr.js");
232
232
  const { config: loadedConfig } = loadPluginConfigWithMeta(directory);
233
233
  policyConfig = KnowledgeConfigSchema.parse(loadedConfig.knowledge ?? {});
234
234
  } catch {
@@ -2,13 +2,13 @@
2
2
  import {
3
3
  derivePlanId,
4
4
  derivePlanIdentityHash
5
- } from "./index-3rb5gs4w.js";
5
+ } from "./index-f0nj3d8z.js";
6
6
  import {
7
7
  DURABILITY_CLASSES,
8
8
  getProjectDb,
9
9
  projectDbExists,
10
10
  withImmediateTransaction
11
- } from "./index-08x7gsnf.js";
11
+ } from "./index-w9hxzcz4.js";
12
12
  import {
13
13
  init_logger,
14
14
  warn
@@ -1,10 +1,10 @@
1
1
  // @bun
2
2
  import {
3
3
  atomicWriteFile
4
- } from "./index-dg3f2sqq.js";
4
+ } from "./index-xf69xty9.js";
5
5
  import {
6
6
  canonicalRootKeyFresh
7
- } from "./index-1xnse449.js";
7
+ } from "./index-mc72pk74.js";
8
8
  import {
9
9
  init_logger,
10
10
  warn
@@ -6,13 +6,14 @@ import {
6
6
  init_warning_buffer
7
7
  } from "./index-zxdawwc7.js";
8
8
  import {
9
+ CONSERVATIVE_PRESET_BASE,
9
10
  ExternalSkillsConfigSchema,
10
11
  GATE_CONFIG_KNOWN_SECTION_KEYS,
11
12
  GateConfigSchema,
12
13
  PluginConfigSchema,
13
14
  init_schema,
14
15
  resolveExternalSkillsConfig
15
- } from "./index-rhw6m7s9.js";
16
+ } from "./index-0874kghs.js";
16
17
  import {
17
18
  DangerousMergeKeyError,
18
19
  MAX_MERGE_DEPTH,
@@ -315,7 +316,7 @@ function migratePresetsConfig(raw) {
315
316
  return migrated;
316
317
  }
317
318
  }
318
- const dormantLegacyKeys = ["preset", "presets", "swarm_mode"].filter((key) => (key in raw));
319
+ const dormantLegacyKeys = ["preset", "presets", "swarm_mode"].filter((key) => (key in raw) && (key !== "preset" || raw.preset !== "default" && raw.preset !== "conservative"));
319
320
  if (dormantLegacyKeys.length > 0 && raw.agents) {
320
321
  const cleaned = { ...raw };
321
322
  for (const key of dormantLegacyKeys) {
@@ -514,6 +515,9 @@ function buildConfigWithMeta(rawUserConfig, rawProjectConfig, loadedFromFile, co
514
515
  mergedRaw = { ...mergedRaw, full_auto: { ...fa, locked: true } };
515
516
  }
516
517
  mergedRaw = migratePresetsConfig(mergedRaw);
518
+ if (mergedRaw.preset === "conservative") {
519
+ mergedRaw = deepMerge(CONSERVATIVE_PRESET_BASE, mergedRaw);
520
+ }
517
521
  const {
518
522
  result: sanitized,
519
523
  strippedKeys: gatesStripped,
@@ -574,7 +578,9 @@ function buildConfigWithMeta(rawUserConfig, rawProjectConfig, loadedFromFile, co
574
578
  strippedKeys: userGatesStripped,
575
579
  rawGates: userRawGates
576
580
  } = sanitizeSectionConfigs(rawUserConfig);
577
- const userParseResult = PluginConfigSchema.safeParse(userSanitized);
581
+ const userPresetMigrated = migratePresetsConfig(userSanitized);
582
+ const userPresetReady = userPresetMigrated.preset === "conservative" ? deepMerge(CONSERVATIVE_PRESET_BASE, userPresetMigrated) : userPresetMigrated;
583
+ const userParseResult = PluginConfigSchema.safeParse(userPresetReady);
578
584
  if (userParseResult.success) {
579
585
  advisoryWarn("[opencode-swarm] Project config ignored due to validation errors. Using user config.");
580
586
  return {
@@ -587,7 +593,7 @@ function buildConfigWithMeta(rawUserConfig, rawProjectConfig, loadedFromFile, co
587
593
  rawGates: userRawGates
588
594
  };
589
595
  }
590
- const userStripped = stripUnrecognizedKeys(userSanitized, userParseResult.error);
596
+ const userStripped = stripUnrecognizedKeys(userPresetReady, userParseResult.error);
591
597
  if (userStripped.removed.length > 0) {
592
598
  const userRecovered = PluginConfigSchema.safeParse(userStripped.cleaned);
593
599
  if (userRecovered.success) {
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  import {
3
3
  validateSwarmPath
4
- } from "./index-nmh0s6dg.js";
4
+ } from "./index-wy3zpwjy.js";
5
5
  import {
6
6
  bunWrite
7
7
  } from "./index-2s7dvzff.js";
@@ -18,25 +18,25 @@ import {
18
18
  releaseCoordinationLease,
19
19
  transitionCoordinationState,
20
20
  withCoordinationTransaction
21
- } from "./index-3rb5gs4w.js";
21
+ } from "./index-f0nj3d8z.js";
22
22
  import {
23
23
  getProjectDb,
24
24
  projectDbExists
25
- } from "./index-08x7gsnf.js";
25
+ } from "./index-w9hxzcz4.js";
26
26
  import {
27
27
  observeDelegationLedgerPressure
28
- } from "./index-77650pyg.js";
28
+ } from "./index-zzvxj02e.js";
29
29
  import {
30
30
  EvidenceLockTimeoutError,
31
31
  withEvidenceLock
32
- } from "./index-dg3f2sqq.js";
32
+ } from "./index-xf69xty9.js";
33
33
  import {
34
34
  telemetry
35
- } from "./index-tt705bap.js";
35
+ } from "./index-x1gyqgze.js";
36
36
  import {
37
37
  canonicalRootKeyFresh,
38
38
  sameProjectRoot
39
- } from "./index-1xnse449.js";
39
+ } from "./index-mc72pk74.js";
40
40
  import {
41
41
  exports_external,
42
42
  init_zod
@@ -4669,7 +4669,7 @@ async function reconcileLegacyCoderSettlements(directory, maxRecords, onReconcil
4669
4669
  const candidates = readDelegations(directory).filter((record) => record.normalizedAgent === "coder" && Boolean(record.legacyCoderSettlementTransfer) && Boolean(record.terminalResult)).slice(0, maxRecords);
4670
4670
  if (candidates.length === 0)
4671
4671
  return 0;
4672
- const { transferCoderSettlementToBackground } = await import("./coder-settlement-rserb0hm.js");
4672
+ const { transferCoderSettlementToBackground } = await import("./coder-settlement-yvpewr52.js");
4673
4673
  let transferred = 0;
4674
4674
  for (const record of candidates) {
4675
4675
  try {
@@ -2,10 +2,10 @@
2
2
  import {
3
3
  captureWorkspaceSnapshotAsync,
4
4
  changedFilesSinceSnapshotAsync
5
- } from "./index-6h81yvyc.js";
5
+ } from "./index-131ay7x1.js";
6
6
  import {
7
7
  removeWorktreeProvisioningOwner
8
- } from "./index-0bpr8vag.js";
8
+ } from "./index-3n5zsp31.js";
9
9
  import {
10
10
  SOURCE_WORKTREE_GONE_STAGE,
11
11
  ensureTaskGateRequirementsReceiptForSettledTransition,
@@ -14,16 +14,16 @@ import {
14
14
  reconcileLandedMerge,
15
15
  withTaskEvidenceTransaction,
16
16
  writeWorkflowWalFile
17
- } from "./index-908k7jhw.js";
17
+ } from "./index-depfky1j.js";
18
18
  import {
19
19
  validateSwarmPath
20
- } from "./index-nmh0s6dg.js";
20
+ } from "./index-wy3zpwjy.js";
21
21
  import {
22
22
  appendCoreEventSync
23
- } from "./index-wpn7ftw1.js";
23
+ } from "./index-jvk95e6y.js";
24
24
  import {
25
25
  canonicalRootKeyFresh
26
- } from "./index-1xnse449.js";
26
+ } from "./index-mc72pk74.js";
27
27
  import {
28
28
  tryAcquireLock
29
29
  } from "./index-ejhxgyvm.js";
@@ -150,6 +150,9 @@ function baselineAttributionDoomed(baseline) {
150
150
  return true;
151
151
  return Array.isArray(baseline.changedFiles) && baseline.changedFiles.length > 0;
152
152
  }
153
+ function hasUnattributedEmptyScopeMutation(declaredFiles, rawObservedFiles) {
154
+ return Array.isArray(declaredFiles) && declaredFiles.length === 0 && Array.isArray(rawObservedFiles) && rawObservedFiles.length > 0;
155
+ }
153
156
  function doomedReason(baseline) {
154
157
  if (baseline.gitHead === null)
155
158
  return "launch workspace has no git baseline (not a git repository, or git unavailable at dispatch)";
@@ -170,6 +173,9 @@ async function scopedObservedFiles(directory, context) {
170
173
  const observed = await changedFilesSinceSnapshotAsync(directory, baseline);
171
174
  if (!observed || !context.declaredFiles)
172
175
  return null;
176
+ if (hasUnattributedEmptyScopeMutation(context.declaredFiles, observed)) {
177
+ return observed;
178
+ }
173
179
  return observed.filter((filePath) => isPathWithinDeclaredScope(filePath, context.declaredFiles ?? [], directory));
174
180
  }
175
181
  function settlementTransitionEvent(wal) {
@@ -185,6 +191,10 @@ function settlementTransitionEvent(wal) {
185
191
  } : {
186
192
  type: "dispatch_no_mutation",
187
193
  agentType: "coder",
194
+ context: {
195
+ declaredFiles: wal.context.declaredFiles,
196
+ settlementTransitionId: wal.transitionId
197
+ },
188
198
  expectedGeneration: wal.expectedGeneration,
189
199
  transitionId: wal.transitionId
190
200
  };
@@ -204,7 +214,7 @@ async function commitPrepared(directory, wal, options) {
204
214
  }
205
215
  const transitionEvent = settlementTransitionEvent(lockedWal);
206
216
  const snapshot = getTaskWorkflowSnapshot(transaction.read());
207
- const evidenceAlreadySettled = lockedWal.accepted === true ? snapshot.authoritative && snapshot.state === (lockedWal.settlementFailed === true ? "rework_required" : "coder_delegated") && snapshot.generation === lockedWal.expectedGeneration + 1 && snapshot.lastOutcome === (lockedWal.settlementFailed === true ? "accepted_mutation_failed" : "accepted_mutation") && snapshot.lastTransitionId === lockedWal.transitionId : snapshot.generation === lockedWal.expectedGeneration && snapshot.lastOutcome === "dispatch_no_mutation" && snapshot.lastTransitionId === lockedWal.transitionId;
217
+ const evidenceAlreadySettled = lockedWal.accepted === true ? snapshot.authoritative && snapshot.state === (lockedWal.settlementFailed === true ? "rework_required" : "coder_delegated") && snapshot.generation === lockedWal.expectedGeneration + 1 && snapshot.lastOutcome === (lockedWal.settlementFailed === true ? "accepted_mutation_failed" : "accepted_mutation") && snapshot.lastTransitionId === lockedWal.transitionId : snapshot.authoritative && snapshot.generation === lockedWal.expectedGeneration && (lockedWal.context.declaredFiles?.length === 0 ? snapshot.noMutationSettlement?.transitionId === lockedWal.transitionId : snapshot.lastOutcome === "dispatch_no_mutation" && snapshot.lastTransitionId === lockedWal.transitionId);
208
218
  if (evidenceAlreadySettled) {
209
219
  const evidence2 = transaction.read();
210
220
  if (lockedWal.accepted === true) {
@@ -228,7 +238,7 @@ async function commitPrepared(directory, wal, options) {
228
238
  alreadyApplied: true
229
239
  };
230
240
  }
231
- if (lockedWal.state !== "PREPARED") {
241
+ if (lockedWal.state !== "PREPARED" && !(lockedWal.state === "COMMITTED" && lockedWal.accepted !== true && snapshot.state === "idle")) {
232
242
  throw new Error("CODER_SETTLEMENT_NOT_PREPARED");
233
243
  }
234
244
  const evidence = await transaction.transition(transitionEvent);
@@ -321,8 +331,11 @@ async function settleCoderDispatch(options) {
321
331
  if (wal.transitionId !== options.transitionId) {
322
332
  throw new Error("CODER_SETTLEMENT_WAL_REPLACED");
323
333
  }
334
+ const unattributedEmptyScopeMutation = hasUnattributedEmptyScopeMutation(wal.context.declaredFiles, options.observedFiles);
335
+ const accepted = options.accepted || unattributedEmptyScopeMutation;
336
+ const settlementFailed = options.settlementFailed === true || unattributedEmptyScopeMutation;
324
337
  if (wal.state === "COMMITTED") {
325
- if (wal.accepted !== options.accepted || wal.testEngineerExempt !== options.testEngineerExempt || wal.settlementFailed !== (options.settlementFailed === true)) {
338
+ if (wal.accepted !== accepted || wal.testEngineerExempt !== options.testEngineerExempt || wal.settlementFailed !== settlementFailed) {
326
339
  throw new Error("CODER_SETTLEMENT_IDEMPOTENCY_CONFLICT");
327
340
  }
328
341
  return commitPrepared(options.directory, wal, {
@@ -332,15 +345,15 @@ async function settleCoderDispatch(options) {
332
345
  if (wal.state === "ABORTED") {
333
346
  throw new Error("CODER_SETTLEMENT_IDEMPOTENCY_CONFLICT");
334
347
  }
335
- if (wal.state === "PREPARED" && (wal.accepted !== options.accepted || wal.testEngineerExempt !== options.testEngineerExempt || wal.settlementFailed !== (options.settlementFailed === true))) {
348
+ if (wal.state === "PREPARED" && (wal.accepted !== accepted || wal.testEngineerExempt !== options.testEngineerExempt || wal.settlementFailed !== settlementFailed)) {
336
349
  throw new Error("CODER_SETTLEMENT_IDEMPOTENCY_CONFLICT");
337
350
  }
338
351
  const prepared = {
339
352
  ...wal,
340
353
  state: "PREPARED",
341
- accepted: options.accepted,
354
+ accepted,
342
355
  testEngineerExempt: options.testEngineerExempt,
343
- settlementFailed: options.settlementFailed === true
356
+ settlementFailed
344
357
  };
345
358
  if (wal.state !== "PREPARED")
346
359
  await writeWal(filePath, prepared);
@@ -499,7 +512,7 @@ async function cleanupRecoveredWorktree(directory, descriptor, options) {
499
512
  awaitingMergeByCallID,
500
513
  cleanupStandardWorktreeForCallId,
501
514
  standardWorktreeByCallID
502
- } = await import("./worktree-isolation-gwq3y9tf.js");
515
+ } = await import("./worktree-isolation-27rt584e.js");
503
516
  standardWorktreeByCallID.delete(descriptor.callID);
504
517
  if (hasResidue)
505
518
  awaitingMergeByCallID.set(descriptor.callID, {
@@ -595,6 +608,9 @@ async function recoverCoderSettlement(directory, taskId) {
595
608
  if (observed2 === null) {
596
609
  throw new Error(`CODER_SETTLEMENT_RECOVERY_UNCERTAIN: transition ${wal.transitionId} for isolated task ${taskId} could not attribute worktree changes to the declared scope (${filePath}, state ${wal.state}). Run /swarm recover ${taskId} (or /swarm reset-session), then retry; do not remove the WAL by hand.`);
597
610
  }
611
+ const unattributedEmptyScopeMutation2 = hasUnattributedEmptyScopeMutation(wal.context.declaredFiles, observed2);
612
+ const accepted = observed2.length > 0 || unattributedEmptyScopeMutation2;
613
+ const settlementFailed = wal.settlementFailed === true || unattributedEmptyScopeMutation2;
598
614
  if (wal.mergeProvenance) {
599
615
  const landed = await reconcileLandedMerge(directory, wal.mergeProvenance);
600
616
  if (landed.landed) {
@@ -603,7 +619,8 @@ async function recoverCoderSettlement(directory, taskId) {
603
619
  ...wal,
604
620
  state: "PREPARED",
605
621
  observedFiles: observed2,
606
- accepted: observed2.length > 0,
622
+ accepted,
623
+ settlementFailed,
607
624
  testEngineerExempt: isMarkdownOnlyTaskChange(wal.context.declaredFiles, observed2)
608
625
  };
609
626
  await writeWal(filePath, wal);
@@ -631,7 +648,7 @@ async function recoverCoderSettlement(directory, taskId) {
631
648
  awaitingMergeByCallID,
632
649
  finishStandardWorktreeDispatch,
633
650
  standardWorktreeByCallID
634
- } = await import("./worktree-isolation-gwq3y9tf.js");
651
+ } = await import("./worktree-isolation-27rt584e.js");
635
652
  const descriptor = wal.worktree;
636
653
  const reconstructedDispatch = {
637
654
  callID: descriptor.callID,
@@ -676,7 +693,8 @@ async function recoverCoderSettlement(directory, taskId) {
676
693
  wal = {
677
694
  ...wal,
678
695
  state: "PREPARED",
679
- accepted: observed2.length > 0,
696
+ accepted,
697
+ settlementFailed,
680
698
  testEngineerExempt: isMarkdownOnlyTaskChange(wal.context.declaredFiles, observed2)
681
699
  };
682
700
  await writeWal(filePath, wal);
@@ -705,6 +723,7 @@ async function recoverCoderSettlement(directory, taskId) {
705
723
  return recovered;
706
724
  }
707
725
  const rawObserved = await changedFilesSinceSnapshotAsync(directory, wal.context.baseline);
726
+ const unattributedEmptyScopeMutation = hasUnattributedEmptyScopeMutation(wal.context.declaredFiles, rawObserved);
708
727
  let observed;
709
728
  if (rawObserved === null) {
710
729
  if (baselineAttributionDoomed(wal.context.baseline)) {
@@ -717,7 +736,7 @@ async function recoverCoderSettlement(directory, taskId) {
717
736
  } else if (wal.context.declaredFiles === null) {
718
737
  observed = [];
719
738
  } else {
720
- observed = rawObserved.filter((filePath2) => isPathWithinDeclaredScope(filePath2, wal.context.declaredFiles ?? [], directory));
739
+ observed = unattributedEmptyScopeMutation ? rawObserved : rawObserved.filter((filePath2) => isPathWithinDeclaredScope(filePath2, wal.context.declaredFiles ?? [], directory));
721
740
  }
722
741
  if (observed === null) {
723
742
  throw new Error(`CODER_SETTLEMENT_RECOVERY_UNCERTAIN: transition ${wal.transitionId} for task ${taskId} workspace changes could not be attributed to the declared scope (${filePath}, state ${wal.state}). Run /swarm recover ${taskId} (or /swarm reset-session), then retry; do not remove the WAL by hand.`);
@@ -726,6 +745,7 @@ async function recoverCoderSettlement(directory, taskId) {
726
745
  ...wal,
727
746
  state: "PREPARED",
728
747
  accepted: observed.length > 0,
748
+ settlementFailed: wal.settlementFailed === true || unattributedEmptyScopeMutation,
729
749
  testEngineerExempt: isMarkdownOnlyTaskChange(wal.context.declaredFiles, observed)
730
750
  };
731
751
  await writeWal(filePath, wal);
@@ -912,4 +932,4 @@ var _internals = {
912
932
  recoverCoderSettlement
913
933
  };
914
934
 
915
- export { beginCoderSettlement, settleCoderDispatch, abortCoderSettlement, transferCoderSettlementToBackground, abortCoderSettlementIfDoomed, recordCoderMergeProvenance, completeCoderSettlementCleanup, recoverCoderSettlement, releaseCoderDispatchOwnership, assertNoUnsettledCoderDispatch, listCoderSettlementWalStates, recoverStaleCoderSettlements, _internals };
935
+ export { hasUnattributedEmptyScopeMutation, beginCoderSettlement, settleCoderDispatch, abortCoderSettlement, transferCoderSettlementToBackground, abortCoderSettlementIfDoomed, recordCoderMergeProvenance, completeCoderSettlementCleanup, recoverCoderSettlement, releaseCoderDispatchOwnership, assertNoUnsettledCoderDispatch, listCoderSettlementWalStates, recoverStaleCoderSettlements, _internals };