opencode-swarm 7.178.0 → 7.179.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.
Files changed (117) hide show
  1. package/.opencode/skills/deep-dive/SKILL.md +1 -1
  2. package/.opencode/skills/running-tests/SKILL.md +30 -24
  3. package/.opencode/skills/swarm-plan/SKILL.md +1 -1
  4. package/binaries/win32-arm64/swarm-sandbox-runner.exe +0 -0
  5. package/binaries/win32-x64/swarm-sandbox-runner.exe +0 -0
  6. package/dist/agents/critic.d.ts +6 -6
  7. package/dist/agents/explorer.d.ts +1 -1
  8. package/dist/cli/{coder-settlement-d2bfb25j.js → coder-settlement-7pt3a0y0.js} +12 -12
  9. package/dist/cli/{config-doctor-905x2s1c.js → config-doctor-82w4bp4b.js} +3 -3
  10. package/dist/cli/{core-k7wfx1wx.js → core-9rqzs794.js} +4 -4
  11. package/dist/cli/{curation-policy-n4hd2wsa.js → curation-policy-c7mdsf7m.js} +5 -5
  12. package/dist/cli/{curator-drift-smqmej5v.js → curator-drift-d93pwt8h.js} +5 -5
  13. package/dist/cli/curator-llm-factory-cbm1ny30.js +72 -0
  14. package/dist/cli/{curator-wyadq69k.js → curator-m8act07j.js} +40 -40
  15. package/dist/cli/{dispatch-9yqqqfr6.js → dispatch-3rwdxpp2.js} +1 -1
  16. package/dist/cli/{evidence-summary-service-r3wcprfk.js → evidence-summary-service-a99bgje1.js} +17 -17
  17. package/dist/cli/{explorer-2cv64zfj.js → explorer-z0cf5cz0.js} +1 -1
  18. package/dist/cli/{gate-evidence-tq9rb2aj.js → gate-evidence-yssmxba5.js} +7 -7
  19. package/dist/cli/guardrail-explain-ffwmhf7s.js +73 -0
  20. package/dist/cli/{guardrail-log-m6twga6x.js → guardrail-log-j2wtq7p2.js} +8 -8
  21. package/dist/cli/{guardrail-reset-86esv8cr.js → guardrail-reset-07byr7nr.js} +40 -40
  22. package/dist/cli/{hive-promoter-s87hkb40.js → hive-promoter-ewrz7vh1.js} +40 -40
  23. package/dist/cli/{index-ke3m026z.js → index-09wm3963.js} +14 -7
  24. package/dist/cli/{index-vfc7d22n.js → index-0bc8jdnv.js} +2 -2
  25. package/dist/cli/{index-ffqy30e5.js → index-0h3cr7pn.js} +1 -1
  26. package/dist/cli/{index-fyfbpz4f.js → index-1c1dbwze.js} +1 -0
  27. package/dist/cli/{index-zex7644g.js → index-1rwyfvq2.js} +2 -2
  28. package/dist/cli/{index-18hjycr1.js → index-1sz02k85.js} +30 -2
  29. package/dist/cli/{index-pm7c6f66.js → index-2b0ktpbf.js} +2 -2
  30. package/dist/cli/{index-yj1kr0ft.js → index-34bwqcea.js} +1 -1
  31. package/dist/cli/{index-wkde35ej.js → index-3hne91yd.js} +8 -8
  32. package/dist/cli/{index-2b1whj28.js → index-3pzwsesm.js} +2 -2
  33. package/dist/cli/{index-y74n1sy8.js → index-6r92fw88.js} +7 -7
  34. package/dist/cli/{index-p27az2hc.js → index-6tnkvqr9.js} +4 -4
  35. package/dist/cli/{index-qs8eth8h.js → index-7zmbtxw1.js} +4 -4
  36. package/dist/cli/{index-azy3tw6c.js → index-80q47hpw.js} +2 -2
  37. package/dist/cli/{index-zsm8h8y1.js → index-8815e95e.js} +4 -4
  38. package/dist/cli/{index-gg44hytk.js → index-9p1pqykb.js} +33 -8
  39. package/dist/cli/{index-w4yjy3vp.js → index-a11ztzs5.js} +19 -2
  40. package/dist/cli/{index-sqngtwyq.js → index-amf88k1e.js} +1 -1
  41. package/dist/cli/{index-y6a2bkp1.js → index-cvg402ha.js} +2 -2
  42. package/dist/cli/{index-heg4em8j.js → index-d66zb40k.js} +3499 -2832
  43. package/dist/cli/{index-swxaa0zs.js → index-etmwjgre.js} +40 -40
  44. package/dist/cli/{index-j3rkh9mp.js → index-f2v90gfc.js} +2 -2
  45. package/dist/cli/{index-mpcp6rmj.js → index-g6nyk713.js} +1 -1
  46. package/dist/cli/{index-bfz1jvcn.js → index-h4nh6s8b.js} +1 -1
  47. package/dist/cli/{index-j1v54ahd.js → index-h59vsbch.js} +2 -2
  48. package/dist/cli/{index-29begjkp.js → index-hwcra3y9.js} +8 -8
  49. package/dist/cli/{index-2vhkwy6v.js → index-kanxpgf8.js} +3 -3
  50. package/dist/cli/{index-kfk403mc.js → index-kmhnkn6t.js} +4 -4
  51. package/dist/cli/{index-2mdk6nt9.js → index-ndwbb3xm.js} +7 -7
  52. package/dist/cli/{index-zsp9de3k.js → index-ne9zamcs.js} +7 -7
  53. package/dist/cli/{index-tnjmn0dn.js → index-nzekzzs2.js} +4 -4
  54. package/dist/cli/{index-q9vb5e7n.js → index-pskba939.js} +1 -1
  55. package/dist/cli/{index-qk29b7s4.js → index-pxtye2ng.js} +42 -42
  56. package/dist/cli/{index-wfbh1bx8.js → index-qt0793qm.js} +7 -7
  57. package/dist/cli/{index-at0ygwwp.js → index-qxk5qkfh.js} +5 -5
  58. package/dist/cli/{index-zmb8fjp5.js → index-s4bkey0q.js} +1 -1
  59. package/dist/cli/{index-rp0jk48x.js → index-sv4y1cma.js} +7 -7
  60. package/dist/cli/{index-2bmhe2jn.js → index-tmy46dtd.js} +4 -4
  61. package/dist/cli/{index-wbkxbgk8.js → index-twtez316.js} +2 -2
  62. package/dist/cli/{index-m2n1rhgv.js → index-w872yykk.js} +1 -1
  63. package/dist/cli/{index-jzxeymr0.js → index-wvpsm8ja.js} +93 -227
  64. package/dist/cli/{index-d5dexrv1.js → index-yagqxt2p.js} +4 -4
  65. package/dist/cli/{index-yeh78c1g.js → index-yfpswnjt.js} +2 -2
  66. package/dist/cli/{index-hnvmj9wx.js → index-zgvzbz48.js} +14 -4
  67. package/dist/cli/index.js +41 -41
  68. package/dist/cli/{knowledge-escalator-rgz471df.js → knowledge-escalator-yx97q9c1.js} +13 -13
  69. package/dist/cli/{knowledge-events-4mq0ypx9.js → knowledge-events-p269fyvv.js} +11 -11
  70. package/dist/cli/{knowledge-link-npk50523.js → knowledge-link-gfz47ves.js} +4 -4
  71. package/dist/cli/{knowledge-store-gft25s5t.js → knowledge-store-36zemyqa.js} +5 -5
  72. package/dist/cli/{knowledge-validator-ejqacbx4.js → knowledge-validator-rd20yq41.js} +7 -7
  73. package/dist/cli/{mcp-emaeeq4s.js → mcp-sg9zrkz2.js} +1 -1
  74. package/dist/cli/{model-preflight-kh9dwts2.js → model-preflight-61xgqwcs.js} +1 -1
  75. package/dist/cli/{pending-delegations-4bhkcykk.js → pending-delegations-8p2gf4kt.js} +12 -12
  76. package/dist/cli/{pr-subscriptions-h1n6dbds.js → pr-subscriptions-4dj9r71h.js} +12 -12
  77. package/dist/cli/{pr-workflow-gate-wn6v5za8.js → pr-workflow-gate-8dgz5z1h.js} +42 -40
  78. package/dist/cli/{runner-ffy5ahhz.js → runner-16b691ba.js} +5 -5
  79. package/dist/cli/{scan-cursor-e63t0g5b.js → scan-cursor-nx0jv9ya.js} +6 -6
  80. package/dist/cli/{schema-4k4hr33y.js → schema-q6gsrxwz.js} +2 -2
  81. package/dist/cli/{scope-persistence-qcw3rtxq.js → scope-persistence-1k4xsyh7.js} +20 -16
  82. package/dist/cli/{server-58s1wwap.js → server-shhxq34t.js} +47 -45
  83. package/dist/cli/{skill-generator-fhj13jmq.js → skill-generator-6j7tq2tb.js} +15 -15
  84. package/dist/cli/{snapshot-coordination-init-5fawrj35.js → snapshot-coordination-init-h8n8w1cm.js} +40 -40
  85. package/dist/cli/{telemetry-ca8dmn26.js → telemetry-qxav5cdk.js} +1 -1
  86. package/dist/cli/{workspace-snapshot-v5qyjxg0.js → workspace-snapshot-rfnn80dg.js} +3 -3
  87. package/dist/cli/{worktree-collision-ownership-hjk0jx19.js → worktree-collision-ownership-97jzh4ra.js} +13 -13
  88. package/dist/cli/{worktree-isolation-aj20bs6q.js → worktree-isolation-g4w74ccb.js} +40 -40
  89. package/dist/commands/registry.d.ts +3 -3
  90. package/dist/config/plan-schema.d.ts +23 -0
  91. package/dist/db/coordination-store.d.ts +10 -0
  92. package/dist/evidence/phase-participation.d.ts +3 -2
  93. package/dist/hooks/delegation-gate.d.ts +1 -1
  94. package/dist/hooks/extractors.d.ts +5 -1
  95. package/dist/hooks/pr-workflow-gate.d.ts +15 -6
  96. package/dist/index.js +535 -520
  97. package/dist/memory/index.d.ts +1 -0
  98. package/dist/memory/memory-family-migration.d.ts +35 -3
  99. package/dist/mutation/engine.d.ts +6 -0
  100. package/dist/mutation/equivalence.d.ts +12 -1
  101. package/dist/plan/ledger.d.ts +14 -0
  102. package/dist/plan/manager.d.ts +0 -2
  103. package/dist/plan/parallel-verdict.d.ts +28 -14
  104. package/dist/pr-review/circuit.d.ts +3 -3
  105. package/dist/pr-review/legacy-transcript-adapter.d.ts +7 -10
  106. package/dist/pr-review/persistence.d.ts +36 -0
  107. package/dist/retention/sweep.d.ts +4 -0
  108. package/dist/scope/scope-persistence.d.ts +41 -0
  109. package/dist/tools/mutation-test.d.ts +6 -0
  110. package/dist/tools/plan-conflict-check.d.ts +7 -6
  111. package/dist/tools/prepare-pr-workflow-checkout.d.ts +19 -0
  112. package/dist/tools/repo-map-action-dispositions.d.ts +23 -0
  113. package/dist/tools/test-runner.d.ts +17 -2
  114. package/package.json +1 -1
  115. package/dist/cli/curator-llm-factory-qhhxev17.js +0 -72
  116. package/dist/cli/guardrail-explain-kvgejh24.js +0 -73
  117. package/dist/pr-review/guardrails.d.ts +0 -67
@@ -3,7 +3,7 @@ import {
3
3
  EvaluationRunV1Schema,
4
4
  GateAuditResultV1Schema,
5
5
  getProtectedEvaluationRunIds
6
- } from "./index-mpcp6rmj.js";
6
+ } from "./index-g6nyk713.js";
7
7
  import {
8
8
  readEffectiveSpecSync
9
9
  } from "./index-n1tcj1q7.js";
@@ -23,13 +23,13 @@ import {
23
23
  readTaskEvidence,
24
24
  readTaskEvidenceRaw,
25
25
  sanitizeTaskId
26
- } from "./index-kfk403mc.js";
26
+ } from "./index-kmhnkn6t.js";
27
27
  import {
28
28
  estimateCharsForTokens,
29
29
  estimateTokens,
30
30
  readSwarmFileAsync,
31
31
  validateSwarmPath
32
- } from "./index-zmb8fjp5.js";
32
+ } from "./index-s4bkey0q.js";
33
33
  import {
34
34
  bunHash,
35
35
  bunWrite,
@@ -58,10 +58,10 @@ import {
58
58
  replayFromLedgerWithStatus,
59
59
  takeSnapshotEvent,
60
60
  takeSnapshotWithRetry
61
- } from "./index-ke3m026z.js";
61
+ } from "./index-09wm3963.js";
62
62
  import {
63
63
  appendCoreEventSync
64
- } from "./index-j1v54ahd.js";
64
+ } from "./index-h59vsbch.js";
65
65
  import {
66
66
  derivePlanId,
67
67
  derivePlanIdentityHash,
@@ -69,32 +69,34 @@ import {
69
69
  importCoordinationOnce,
70
70
  listCoordinationStates,
71
71
  transitionCoordinationState
72
- } from "./index-w4yjy3vp.js";
72
+ } from "./index-a11ztzs5.js";
73
73
  import {
74
74
  DURABILITY_CLASSES,
75
75
  getProjectDb,
76
76
  projectDbExists,
77
77
  withDurabilityClass
78
- } from "./index-tnjmn0dn.js";
78
+ } from "./index-nzekzzs2.js";
79
79
  import {
80
80
  assertProjectRoot,
81
81
  tryAcquireLock,
82
82
  withEvidenceLock
83
- } from "./index-j3rkh9mp.js";
83
+ } from "./index-f2v90gfc.js";
84
84
  import {
85
85
  emit
86
- } from "./index-wfbh1bx8.js";
86
+ } from "./index-qt0793qm.js";
87
87
  import {
88
88
  atomicWriteSwarmFileSync,
89
89
  invalidateCachedArtifact,
90
90
  readCachedParsedFile
91
- } from "./index-zsp9de3k.js";
91
+ } from "./index-ne9zamcs.js";
92
92
  import {
93
93
  canonicalRootKeyFresh
94
94
  } from "./index-1xnse449.js";
95
95
  import {
96
- PlanSchema
97
- } from "./index-18hjycr1.js";
96
+ PlanSchema,
97
+ normalizeCurrentPhaseInPlace,
98
+ resolveActivePhaseId
99
+ } from "./index-1sz02k85.js";
98
100
  import {
99
101
  GIT_BINARY_ENV_VAR,
100
102
  describeGitResolution,
@@ -116,6 +118,9 @@ import {
116
118
  init_logger,
117
119
  warn
118
120
  } from "./index-zgwm4ryv.js";
121
+ import {
122
+ __require
123
+ } from "./index-a76rekgs.js";
119
124
 
120
125
  // src/plan/manager.ts
121
126
  import {
@@ -128,7 +133,7 @@ import {
128
133
  writeFileSync
129
134
  } from "fs";
130
135
  import * as fsPromises from "fs/promises";
131
- import * as path4 from "path";
136
+ import * as path3 from "path";
132
137
 
133
138
  // src/db/task-checkpoint-receipt.ts
134
139
  import { createHash } from "crypto";
@@ -1545,156 +1550,10 @@ var _internals3 = {
1545
1550
  }
1546
1551
  };
1547
1552
 
1548
- // src/turbo/lean/conflicts.ts
1549
- import * as fs3 from "fs";
1550
- import * as path3 from "path";
1551
-
1552
- // src/utils/path.ts
1553
- function normalizePath(p) {
1554
- if (!p)
1555
- return "";
1556
- let result = p.replace(/\\/g, "/").replace(/\/+/g, "/").replace(/^\.\//, "").replace(/(?:^|\/)\.\//g, "/");
1557
- result = result.replace(/\/$/, "");
1558
- result = result.replace(/\/\.$/, "");
1559
- if (process.platform === "win32")
1560
- result = result.toLowerCase();
1561
- if (!result) {
1562
- const norm = p.replace(/\\/g, "/");
1563
- if (norm === "." || norm === "./")
1564
- return ".";
1565
- return "";
1566
- }
1567
- return result;
1568
- }
1569
-
1570
- // src/turbo/lean/conflicts.ts
1571
- var DEFAULT_GLOBAL_FILES = [
1572
- "package.json",
1573
- "package-lock.json",
1574
- "bun.lock",
1575
- "bun.lockb",
1576
- "pnpm-lock.yaml",
1577
- "yarn.lock",
1578
- "Cargo.lock",
1579
- "Gemfile.lock",
1580
- "composer.lock",
1581
- "poetry.lock",
1582
- "go.mod",
1583
- "go.sum",
1584
- "tsconfig.json",
1585
- "bunfig.toml",
1586
- "CHANGELOG.md",
1587
- ".release-please-manifest.json",
1588
- "src/index.ts",
1589
- "src/tools/index.ts",
1590
- "src/agents/index.ts",
1591
- "src/config/index.ts",
1592
- "src/hooks/index.ts",
1593
- "turbo.json",
1594
- "nx.json",
1595
- "packageManager",
1596
- ".npmrc",
1597
- ".nvmrc",
1598
- ".node-version"
1599
- ];
1600
- var DEFAULT_PROTECTED_PATTERNS = [
1601
- "guardrail",
1602
- "delegation",
1603
- "authority",
1604
- "permission",
1605
- "crypto",
1606
- "secret",
1607
- "security",
1608
- "auth",
1609
- "/auth/",
1610
- "/auth.",
1611
- "auth.",
1612
- ".env",
1613
- "credentials",
1614
- "secrets",
1615
- "private",
1616
- "/security/",
1617
- "/security.",
1618
- "/protect/",
1619
- "/protect."
1620
- ];
1621
- var BARREL_FILE_PATTERNS = [
1622
- /\/index\.ts$/,
1623
- /\/index\.tsx$/,
1624
- /\/index\.js$/,
1625
- /\/index\.mjs$/,
1626
- /\/exports\.ts$/,
1627
- /\/types\.ts$/
1628
- ];
1629
- function pathsConflict(path1, path22) {
1630
- if (process.platform === "win32") {
1631
- path1 = path1.toLowerCase();
1632
- path22 = path22.toLowerCase();
1633
- }
1634
- if (path1 === path22) {
1635
- return true;
1636
- }
1637
- const [shorter, longer] = path1.length <= path22.length ? [path1, path22] : [path22, path1];
1638
- if (longer.startsWith(`${shorter}/`)) {
1639
- return true;
1640
- }
1641
- return false;
1642
- }
1643
- function isGlobalFile(normalizedPath) {
1644
- if (DEFAULT_GLOBAL_FILES.some((gf) => normalizedPath.endsWith(gf))) {
1645
- return true;
1646
- }
1647
- for (const pattern of BARREL_FILE_PATTERNS) {
1648
- if (pattern.test(normalizedPath)) {
1649
- return true;
1650
- }
1651
- }
1652
- return false;
1653
- }
1654
- function isProtectedPath(normalizedPath) {
1655
- const lowerPath = normalizedPath.toLowerCase();
1656
- for (const pattern of DEFAULT_PROTECTED_PATTERNS) {
1657
- if (lowerPath.includes(pattern.toLowerCase())) {
1658
- if (pattern === "auth" || pattern === "/auth/") {
1659
- if (lowerPath === "auth" || lowerPath.endsWith("/auth") || lowerPath.includes("/auth/")) {
1660
- return true;
1661
- }
1662
- } else if (pattern === "auth.") {
1663
- const idx = lowerPath.indexOf("auth.");
1664
- if (idx !== -1) {
1665
- const before = idx === 0 || lowerPath[idx - 1] === "/";
1666
- if (before) {
1667
- return true;
1668
- }
1669
- }
1670
- } else {
1671
- return true;
1672
- }
1673
- }
1674
- }
1675
- return false;
1676
- }
1677
- function readTaskScopes(directory, taskId) {
1678
- const scopePath = path3.join(directory, ".swarm", "scopes", `scope-${taskId}.json`);
1679
- try {
1680
- if (!fs3.existsSync(scopePath)) {
1681
- return null;
1682
- }
1683
- const raw = fs3.readFileSync(scopePath, "utf-8");
1684
- const parsed = JSON.parse(raw);
1685
- if (!parsed || !Array.isArray(parsed.files)) {
1686
- return null;
1687
- }
1688
- return parsed.files;
1689
- } catch {
1690
- return null;
1691
- }
1692
- }
1693
-
1694
1553
  // src/utils/spec-hash.ts
1695
1554
  import { createHash as createHash4 } from "crypto";
1696
1555
  import * as fsSync2 from "fs";
1697
- import { join as join3 } from "path";
1556
+ import { join as join2 } from "path";
1698
1557
  async function computeSpecHash(directory) {
1699
1558
  const spec = _internals4.readEffectiveSpecSync(directory);
1700
1559
  if (!spec)
@@ -1723,7 +1582,7 @@ async function isSpecStale(directory, plan) {
1723
1582
  return { stale: false };
1724
1583
  }
1725
1584
  function isObligationPreserving(directory) {
1726
- const snapshotPath = join3(directory, ".swarm", "spec-snapshot.md");
1585
+ const snapshotPath = join2(directory, ".swarm", "spec-snapshot.md");
1727
1586
  try {
1728
1587
  let recordedContent;
1729
1588
  try {
@@ -1769,7 +1628,7 @@ var _internals4 = {
1769
1628
  readEffectiveSpecSync
1770
1629
  };
1771
1630
  function computeSpecDiff(directory) {
1772
- const snapshotPath = join3(directory, ".swarm", "spec-snapshot.md");
1631
+ const snapshotPath = join2(directory, ".swarm", "spec-snapshot.md");
1773
1632
  let recordedContent;
1774
1633
  try {
1775
1634
  const snapshotSize = fsSync2.statSync(snapshotPath).size;
@@ -1888,7 +1747,6 @@ var _internals5 = {
1888
1747
  regeneratePlanMarkdown,
1889
1748
  isGitRepo,
1890
1749
  isEpicModeActiveForProject,
1891
- readTaskScopes,
1892
1750
  commitTaskCompletion,
1893
1751
  getWorktreeMergeFailure,
1894
1752
  recordTaskAttempt
@@ -2042,7 +1900,7 @@ async function surfaceLedgerStaleIfPersisted(directory, plan) {
2042
1900
  return plan;
2043
1901
  }
2044
1902
  async function parsePlanJsonCached(directory) {
2045
- const planJsonPath = path4.resolve(directory, ".swarm", "plan.json");
1903
+ const planJsonPath = path3.resolve(directory, ".swarm", "plan.json");
2046
1904
  return readCachedParsedFile(planJsonPath, PLAN_JSON_CACHE_NAMESPACE, () => _internals5.readPlanJsonUtf8(directory), (planJsonContent) => {
2047
1905
  if (planJsonContent.includes("\x00")) {
2048
1906
  throw new Error("Plan rejected: .swarm/plan.json contains null bytes");
@@ -2110,13 +1968,13 @@ async function isPlanMdInSync(directory, plan, cache) {
2110
1968
  }
2111
1969
  async function regeneratePlanMarkdown(directory, plan) {
2112
1970
  assertProjectRoot(directory);
2113
- const swarmDir = path4.resolve(directory, ".swarm");
1971
+ const swarmDir = path3.resolve(directory, ".swarm");
2114
1972
  const contentHash = computePlanContentHash(plan);
2115
1973
  const markdown = derivePlanMarkdown(plan);
2116
1974
  const markdownWithHash = `<!-- PLAN_HASH: ${contentHash} -->
2117
1975
  ${markdown}`;
2118
- const mdPath = path4.join(swarmDir, "plan.md");
2119
- const mdTempPath = path4.join(swarmDir, `plan.md.tmp.${Date.now()}.${Math.floor(Math.random() * 1e9)}`);
1976
+ const mdPath = path3.join(swarmDir, "plan.md");
1977
+ const mdTempPath = path3.join(swarmDir, `plan.md.tmp.${Date.now()}.${Math.floor(Math.random() * 1e9)}`);
2120
1978
  try {
2121
1979
  await bunWrite(mdTempPath, markdownWithHash);
2122
1980
  renameSync2(mdTempPath, mdPath);
@@ -2229,7 +2087,7 @@ async function loadPlan(directory, cache) {
2229
2087
  try {
2230
2088
  assertProjectRoot(directory);
2231
2089
  const diffInfo = computeSpecDiff(directory);
2232
- const specStalenessPath = path4.join(directory, ".swarm", "spec-staleness.json");
2090
+ const specStalenessPath = path3.join(directory, ".swarm", "spec-staleness.json");
2233
2091
  await fsPromises.writeFile(specStalenessPath, JSON.stringify({
2234
2092
  type: "spec_stale_detected",
2235
2093
  timestamp: new Date().toISOString(),
@@ -2553,6 +2411,7 @@ async function savePlan(directory, plan, options) {
2553
2411
  } catch {}
2554
2412
  }
2555
2413
  derivePhaseStatusesInPlace(validated);
2414
+ normalizeCurrentPhaseInPlace(validated);
2556
2415
  const currentPlan = await _internals5.loadPlanJsonOnly(directory);
2557
2416
  const planId = derivePlanId(validated);
2558
2417
  const planHashForInit = computePlanLedgerHash(validated);
@@ -2750,9 +2609,9 @@ async function savePlan(directory, plan, options) {
2750
2609
  source: "savePlan_manager"
2751
2610
  });
2752
2611
  }
2753
- const swarmDir = path4.resolve(directory, ".swarm");
2754
- const planPath = path4.join(swarmDir, "plan.json");
2755
- const tempPath = path4.join(swarmDir, `plan.json.tmp.${Date.now()}.${Math.floor(Math.random() * 1e9)}`);
2612
+ const swarmDir = path3.resolve(directory, ".swarm");
2613
+ const planPath = path3.join(swarmDir, "plan.json");
2614
+ const tempPath = path3.join(swarmDir, `plan.json.tmp.${Date.now()}.${Math.floor(Math.random() * 1e9)}`);
2756
2615
  try {
2757
2616
  await bunWrite(tempPath, JSON.stringify(projectedPlan, null, 2));
2758
2617
  options?.preCommitCheck?.();
@@ -2765,7 +2624,7 @@ async function savePlan(directory, plan, options) {
2765
2624
  invalidateCachedArtifact(planPath);
2766
2625
  await _internals5.verifyWrittenPlanJson(directory, projectedPlan);
2767
2626
  try {
2768
- const markerPath = path4.join(swarmDir, ".plan-write-marker");
2627
+ const markerPath = path3.join(swarmDir, ".plan-write-marker");
2769
2628
  const inProgressMarker = JSON.stringify({
2770
2629
  source: "plan_manager",
2771
2630
  timestamp: new Date().toISOString(),
@@ -2781,8 +2640,8 @@ async function savePlan(directory, plan, options) {
2781
2640
  const markdown = derivePlanMarkdown(projectedPlan);
2782
2641
  const markdownWithHash = `<!-- PLAN_HASH: ${contentHash} -->
2783
2642
  ${markdown}`;
2784
- const mdPath = path4.join(swarmDir, "plan.md");
2785
- const mdTempPath = path4.join(swarmDir, `plan.md.tmp.${Date.now()}.${Math.floor(Math.random() * 1e9)}`);
2643
+ const mdPath = path3.join(swarmDir, "plan.md");
2644
+ const mdTempPath = path3.join(swarmDir, `plan.md.tmp.${Date.now()}.${Math.floor(Math.random() * 1e9)}`);
2786
2645
  try {
2787
2646
  await bunWrite(mdTempPath, markdownWithHash);
2788
2647
  renameSync2(mdTempPath, mdPath);
@@ -2805,7 +2664,7 @@ ${markdown}`;
2805
2664
  } catch {}
2806
2665
  }
2807
2666
  try {
2808
- const markerPath = path4.join(swarmDir, ".plan-write-marker");
2667
+ const markerPath = path3.join(swarmDir, ".plan-write-marker");
2809
2668
  const tasksCount = projectedPlan.phases.reduce((sum, phase) => sum + phase.tasks.length, 0);
2810
2669
  const marker = JSON.stringify({
2811
2670
  source: "plan_manager",
@@ -2861,11 +2720,11 @@ async function rebuildPlan(directory, plan, options) {
2861
2720
  const targetPlan = plan ?? await replayFromLedger(directory);
2862
2721
  if (!targetPlan)
2863
2722
  return null;
2864
- const swarmDir = path4.join(directory, ".swarm");
2865
- const planPath = path4.join(swarmDir, "plan.json");
2866
- const mdPath = path4.join(swarmDir, "plan.md");
2723
+ const swarmDir = path3.join(directory, ".swarm");
2724
+ const planPath = path3.join(swarmDir, "plan.json");
2725
+ const mdPath = path3.join(swarmDir, "plan.md");
2867
2726
  mkdirSync2(swarmDir, { recursive: true });
2868
- const tempPlanPath = path4.join(swarmDir, `plan.json.rebuild.${Date.now()}.${Math.floor(Math.random() * 1e9)}`);
2727
+ const tempPlanPath = path3.join(swarmDir, `plan.json.rebuild.${Date.now()}.${Math.floor(Math.random() * 1e9)}`);
2869
2728
  {
2870
2729
  const fd = openSync(tempPlanPath, "w");
2871
2730
  try {
@@ -2878,7 +2737,7 @@ async function rebuildPlan(directory, plan, options) {
2878
2737
  renameSync2(tempPlanPath, planPath);
2879
2738
  invalidateCachedArtifact(planPath);
2880
2739
  try {
2881
- const markerPath = path4.join(swarmDir, ".plan-write-marker");
2740
+ const markerPath = path3.join(swarmDir, ".plan-write-marker");
2882
2741
  const inProgressMarker = JSON.stringify({
2883
2742
  source: "plan_manager",
2884
2743
  timestamp: new Date().toISOString(),
@@ -2893,13 +2752,13 @@ async function rebuildPlan(directory, plan, options) {
2893
2752
  const markdown = derivePlanMarkdown(targetPlan);
2894
2753
  const markdownWithHash = `<!-- PLAN_HASH: ${contentHash} -->
2895
2754
  ${markdown}`;
2896
- const tempMdPath = path4.join(swarmDir, `plan.md.rebuild.${Date.now()}.${Math.floor(Math.random() * 1e9)}`);
2755
+ const tempMdPath = path3.join(swarmDir, `plan.md.rebuild.${Date.now()}.${Math.floor(Math.random() * 1e9)}`);
2897
2756
  await bunWrite(tempMdPath, markdownWithHash);
2898
2757
  renameSync2(tempMdPath, mdPath);
2899
2758
  invalidateCachedArtifact(mdPath);
2900
2759
  } finally {
2901
2760
  try {
2902
- const markerPath = path4.join(swarmDir, ".plan-write-marker");
2761
+ const markerPath = path3.join(swarmDir, ".plan-write-marker");
2903
2762
  const tasksCount = targetPlan.phases.reduce((sum, phase) => sum + phase.tasks.length, 0);
2904
2763
  const marker = JSON.stringify({
2905
2764
  source: "plan_manager",
@@ -2931,6 +2790,7 @@ async function closePlanTerminalState(directory, plan, options) {
2931
2790
  assertProjectRoot(directory);
2932
2791
  const planId = derivePlanId(plan);
2933
2792
  const validated = PlanSchema.parse(plan);
2793
+ normalizeCurrentPhaseInPlace(validated);
2934
2794
  const hashAfter = computePlanLedgerHash(validated);
2935
2795
  for (const taskId of options.closedTaskIds) {
2936
2796
  let taskPhaseId;
@@ -2963,14 +2823,14 @@ async function closePlanTerminalState(directory, plan, options) {
2963
2823
  planHashAfter: hashAfter,
2964
2824
  source: "close_terminal"
2965
2825
  });
2966
- const swarmDir = path4.join(directory, ".swarm");
2967
- const planPath = path4.join(swarmDir, "plan.json");
2968
- const tempPlanPath = path4.join(swarmDir, `plan.json.close.${Date.now()}.${Math.floor(Math.random() * 1e9)}`);
2826
+ const swarmDir = path3.join(directory, ".swarm");
2827
+ const planPath = path3.join(swarmDir, "plan.json");
2828
+ const tempPlanPath = path3.join(swarmDir, `plan.json.close.${Date.now()}.${Math.floor(Math.random() * 1e9)}`);
2969
2829
  await bunWrite(tempPlanPath, JSON.stringify(validated, null, 2));
2970
2830
  renameSync2(tempPlanPath, planPath);
2971
2831
  invalidateCachedArtifact(planPath);
2972
2832
  try {
2973
- const markerPath = path4.join(swarmDir, ".plan-write-marker");
2833
+ const markerPath = path3.join(swarmDir, ".plan-write-marker");
2974
2834
  const inProgressMarker = JSON.stringify({
2975
2835
  source: "plan_manager_close",
2976
2836
  timestamp: new Date().toISOString(),
@@ -2981,18 +2841,18 @@ async function closePlanTerminalState(directory, plan, options) {
2981
2841
  await bunWrite(markerPath, inProgressMarker);
2982
2842
  } catch {}
2983
2843
  try {
2984
- const mdPath = path4.join(swarmDir, "plan.md");
2844
+ const mdPath = path3.join(swarmDir, "plan.md");
2985
2845
  const contentHash = computePlanContentHash(validated);
2986
2846
  const markdown = derivePlanMarkdown(validated);
2987
2847
  const markdownWithHash = `<!-- PLAN_HASH: ${contentHash} -->
2988
2848
  ${markdown}`;
2989
- const mdTempPath = path4.join(swarmDir, `plan.md.close.${Date.now()}.${Math.floor(Math.random() * 1e9)}`);
2849
+ const mdTempPath = path3.join(swarmDir, `plan.md.close.${Date.now()}.${Math.floor(Math.random() * 1e9)}`);
2990
2850
  await bunWrite(mdTempPath, markdownWithHash);
2991
2851
  renameSync2(mdTempPath, mdPath);
2992
2852
  invalidateCachedArtifact(mdPath);
2993
2853
  } finally {
2994
2854
  try {
2995
- const markerPath = path4.join(swarmDir, ".plan-write-marker");
2855
+ const markerPath = path3.join(swarmDir, ".plan-write-marker");
2996
2856
  const tasksCount = validated.phases.reduce((sum, phase) => sum + phase.tasks.length, 0);
2997
2857
  const marker = JSON.stringify({
2998
2858
  source: "plan_manager_close",
@@ -3090,7 +2950,12 @@ async function updateTaskStatus(directory, taskId, status, options) {
3090
2950
  break;
3091
2951
  }
3092
2952
  }
3093
- const canonicalScope = _internals5.readTaskScopes(directory, taskId);
2953
+ const { readDeclaredScopeFilesFromBindings } = await import("./scope-persistence-1k4xsyh7.js");
2954
+ const canonicalScope = readDeclaredScopeFilesFromBindings({
2955
+ directory,
2956
+ taskId,
2957
+ plan: updatedPlan
2958
+ });
3094
2959
  await _internals5.commitTaskCompletion(directory, taskId, taskDescription, canonicalScope ?? undefined);
3095
2960
  } catch (commitErr) {
3096
2961
  criticalWarn(`[plan/manager] Rule 2 auto-commit for ${taskId} threw (non-fatal): ${commitErr instanceof Error ? commitErr.message : String(commitErr)}`);
@@ -3116,8 +2981,9 @@ function derivePlanMarkdown(plan) {
3116
2981
  closed: "CLOSED"
3117
2982
  };
3118
2983
  const now = new Date().toISOString();
3119
- const currentPhase = plan.current_phase ?? 1;
3120
- const phaseStatus = statusMap[plan.phases[currentPhase - 1]?.status] || "PENDING";
2984
+ const currentPhase = resolveActivePhaseId(plan);
2985
+ const currentPhaseObject = plan.phases.find((phase) => phase.id === currentPhase);
2986
+ const phaseStatus = statusMap[currentPhaseObject?.status ?? "pending"] || "PENDING";
3121
2987
  let markdown = `# ${plan.title}
3122
2988
  Swarm: ${plan.swarm}
3123
2989
  Phase: ${currentPhase} [${phaseStatus}] | Updated: ${now}
@@ -3174,7 +3040,7 @@ Phase: ${currentPhase} [${phaseStatus}] | Updated: ${now}
3174
3040
  const sortedFiles = [...task.files_touched].sort();
3175
3041
  suffix += ` (files_touched: ${JSON.stringify(sortedFiles)})`;
3176
3042
  }
3177
- if (phase.id === plan.current_phase && task.status === "in_progress" && !currentTaskMarked) {
3043
+ if (phase.id === currentPhase && task.status === "in_progress" && !currentTaskMarked) {
3178
3044
  suffix += " \u2190 CURRENT";
3179
3045
  currentTaskMarked = true;
3180
3046
  }
@@ -3411,12 +3277,12 @@ import {
3411
3277
  rmSync,
3412
3278
  statSync as statSync2
3413
3279
  } from "fs";
3414
- import * as fs6 from "fs/promises";
3415
- import * as path6 from "path";
3280
+ import * as fs5 from "fs/promises";
3281
+ import * as path5 from "path";
3416
3282
 
3417
3283
  // src/evaluation/retention.ts
3418
- import * as fs4 from "fs/promises";
3419
- import * as path5 from "path";
3284
+ import * as fs3 from "fs/promises";
3285
+ import * as path4 from "path";
3420
3286
  function artifactKey(artifact) {
3421
3287
  return `${artifact.namespace}/${artifact.id}`;
3422
3288
  }
@@ -3424,10 +3290,10 @@ function validId(value) {
3424
3290
  return /^[A-Za-z0-9][A-Za-z0-9._-]{0,159}$/.test(value);
3425
3291
  }
3426
3292
  async function evaluationRunCandidates(directory) {
3427
- const root = path5.join(directory, ".swarm", "evolution", "runs");
3293
+ const root = path4.join(directory, ".swarm", "evolution", "runs");
3428
3294
  let entries = [];
3429
3295
  try {
3430
- entries = await fs4.readdir(root, { withFileTypes: true });
3296
+ entries = await fs3.readdir(root, { withFileTypes: true });
3431
3297
  } catch (error2) {
3432
3298
  if (error2.code === "ENOENT") {
3433
3299
  return { candidates: [], corrupt: [] };
@@ -3443,9 +3309,9 @@ async function evaluationRunCandidates(directory) {
3443
3309
  if (!validId(id))
3444
3310
  continue;
3445
3311
  const artifact = { namespace: "evaluation-run", id };
3446
- const target = path5.join(root, entry.name);
3312
+ const target = path4.join(root, entry.name);
3447
3313
  try {
3448
- const run = EvaluationRunV1Schema.parse(JSON.parse(await fs4.readFile(target, "utf8")));
3314
+ const run = EvaluationRunV1Schema.parse(JSON.parse(await fs3.readFile(target, "utf8")));
3449
3315
  if (run.runId !== id)
3450
3316
  throw new Error("run id/path mismatch");
3451
3317
  candidates.push({
@@ -3461,10 +3327,10 @@ async function evaluationRunCandidates(directory) {
3461
3327
  return { candidates, corrupt };
3462
3328
  }
3463
3329
  async function gateAuditCandidates(directory) {
3464
- const root = path5.join(directory, ".swarm", "evidence", "gate-audit");
3330
+ const root = path4.join(directory, ".swarm", "evidence", "gate-audit");
3465
3331
  let entries = [];
3466
3332
  try {
3467
- entries = await fs4.readdir(root, { withFileTypes: true });
3333
+ entries = await fs3.readdir(root, { withFileTypes: true });
3468
3334
  } catch (error2) {
3469
3335
  if (error2.code === "ENOENT") {
3470
3336
  return { candidates: [], corrupt: [] };
@@ -3477,9 +3343,9 @@ async function gateAuditCandidates(directory) {
3477
3343
  if (!entry.isDirectory() || !validId(entry.name))
3478
3344
  continue;
3479
3345
  const artifact = { namespace: "gate-audit", id: entry.name };
3480
- const target = path5.join(root, entry.name);
3346
+ const target = path4.join(root, entry.name);
3481
3347
  try {
3482
- const result = GateAuditResultV1Schema.parse(JSON.parse(await fs4.readFile(path5.join(target, "results.json"), "utf8")));
3348
+ const result = GateAuditResultV1Schema.parse(JSON.parse(await fs3.readFile(path4.join(target, "results.json"), "utf8")));
3483
3349
  if (result.runId !== entry.name)
3484
3350
  throw new Error("run id/path mismatch");
3485
3351
  candidates.push({
@@ -3510,10 +3376,10 @@ async function protectedArtifacts(directory) {
3510
3376
  }
3511
3377
  async function removeCandidate(candidate) {
3512
3378
  if (candidate.kind === "directory") {
3513
- await fs4.rm(candidate.target, { recursive: true, force: true });
3379
+ await fs3.rm(candidate.target, { recursive: true, force: true });
3514
3380
  return;
3515
3381
  }
3516
- await fs4.unlink(candidate.target);
3382
+ await fs3.unlink(candidate.target);
3517
3383
  }
3518
3384
  var _retentionInternals = {
3519
3385
  protectedArtifacts,
@@ -3521,7 +3387,7 @@ var _retentionInternals = {
3521
3387
  };
3522
3388
  async function archiveEvaluationArtifacts(args) {
3523
3389
  assertProjectRoot(args.directory);
3524
- return withEvidenceLock(args.directory, path5.join("evolution", "retention-index"), "evaluation-retention", "archive", async () => {
3390
+ return withEvidenceLock(args.directory, path4.join("evolution", "retention-index"), "evaluation-retention", "archive", async () => {
3525
3391
  const inventory = await retentionCandidates(args.directory);
3526
3392
  let protectedKeys = await _retentionInternals.protectedArtifacts(args.directory);
3527
3393
  const protectedRefs = inventory.candidates.filter((candidate) => protectedKeys.has(artifactKey(candidate.artifact))).map((candidate) => candidate.artifact);
@@ -3570,7 +3436,7 @@ async function archiveEvaluationArtifacts(args) {
3570
3436
  }
3571
3437
 
3572
3438
  // src/evidence/documents-retention.ts
3573
- import * as fs5 from "fs";
3439
+ import * as fs4 from "fs";
3574
3440
  import * as fsp from "fs/promises";
3575
3441
  import * as readline from "readline";
3576
3442
  var EVIDENCE_CACHE_FILE = "evidence-cache/documents.jsonl";
@@ -3580,11 +3446,11 @@ var RENAME_BACKOFF_MS = 10;
3580
3446
  var RENAME_RETRY_CODES = new Set(["EPERM", "EBUSY", "ENOTEMPTY", "EACCES"]);
3581
3447
  var _internals6 = {
3582
3448
  stat: (p) => fsp.stat(p),
3583
- createReadStream: (p, options) => fs5.createReadStream(p, options),
3584
- openSync: (p, flags) => fs5.openSync(p, flags),
3585
- writeSync: (fd, data, position) => fs5.writeSync(fd, data, position),
3586
- fsyncSync: (fd) => fs5.fsyncSync(fd),
3587
- closeSync: (fd) => fs5.closeSync(fd),
3449
+ createReadStream: (p, options) => fs4.createReadStream(p, options),
3450
+ openSync: (p, flags) => fs4.openSync(p, flags),
3451
+ writeSync: (fd, data, position) => fs4.writeSync(fd, data, position),
3452
+ fsyncSync: (fd) => fs4.fsyncSync(fd),
3453
+ closeSync: (fd) => fs4.closeSync(fd),
3588
3454
  renameWithRetry: atomicRenameWithRetry,
3589
3455
  unlink: (p) => fsp.unlink(p)
3590
3456
  };
@@ -3839,13 +3705,13 @@ async function saveEvidence(directory, taskId, evidence, abortSignal) {
3839
3705
  abortSignal?.throwIfAborted();
3840
3706
  _internals7.validateProjectRoot(directory);
3841
3707
  const sanitizedTaskId = sanitizeTaskId2(taskId);
3842
- const relativePath = path6.join("evidence", sanitizedTaskId, "evidence.json");
3708
+ const relativePath = path5.join("evidence", sanitizedTaskId, "evidence.json");
3843
3709
  validateSwarmPath(directory, relativePath);
3844
3710
  _internals7.validateEvidence(evidence);
3845
3711
  return withEvidenceLock(directory, relativePath, "evidence-manager", sanitizedTaskId, async () => {
3846
3712
  abortSignal?.throwIfAborted();
3847
3713
  const evidencePath = validateSwarmPath(directory, relativePath);
3848
- const evidenceDir = path6.dirname(evidencePath);
3714
+ const evidenceDir = path5.dirname(evidencePath);
3849
3715
  let bundle;
3850
3716
  const existingContent = await readSwarmFileAsync(directory, relativePath);
3851
3717
  abortSignal?.throwIfAborted();
@@ -3889,7 +3755,7 @@ async function saveEvidence(directory, taskId, evidence, abortSignal) {
3889
3755
  throw new Error(`Evidence bundle size (${bundleJson.length} bytes) exceeds maximum (${EVIDENCE_MAX_JSON_BYTES} bytes)`);
3890
3756
  }
3891
3757
  mkdirSync3(evidenceDir, { recursive: true });
3892
- const tempPath = path6.join(evidenceDir, `evidence.json.tmp.${Date.now()}.${process.pid}`);
3758
+ const tempPath = path5.join(evidenceDir, `evidence.json.tmp.${Date.now()}.${process.pid}`);
3893
3759
  try {
3894
3760
  await bunWrite(tempPath, bundleJson);
3895
3761
  abortSignal?.throwIfAborted();
@@ -3935,7 +3801,7 @@ function wrapFlatRetrospective(flatEntry, taskId) {
3935
3801
  }
3936
3802
  async function loadEvidence(directory, taskId, options) {
3937
3803
  const sanitizedTaskId = sanitizeTaskId2(taskId);
3938
- const relativePath = path6.join("evidence", sanitizedTaskId, "evidence.json");
3804
+ const relativePath = path5.join("evidence", sanitizedTaskId, "evidence.json");
3939
3805
  if (relativePath.length > 4096) {
3940
3806
  return { status: "not_found" };
3941
3807
  }
@@ -3960,12 +3826,12 @@ async function loadEvidence(directory, taskId, options) {
3960
3826
  try {
3961
3827
  validateProjectRoot(directory);
3962
3828
  await withEvidenceLock(directory, relativePath, "evidence-loader", sanitizedTaskId, async () => {
3963
- const evidenceDir = path6.dirname(evidencePath);
3829
+ const evidenceDir = path5.dirname(evidencePath);
3964
3830
  const bundleJson = JSON.stringify(validated);
3965
- const tempPath = path6.join(evidenceDir, `evidence.json.tmp.${Date.now()}.${process.pid}`);
3831
+ const tempPath = path5.join(evidenceDir, `evidence.json.tmp.${Date.now()}.${process.pid}`);
3966
3832
  try {
3967
3833
  await bunWrite(tempPath, bundleJson);
3968
- await fs6.rename(tempPath, evidencePath);
3834
+ await fs5.rename(tempPath, evidencePath);
3969
3835
  invalidateCachedArtifact(evidencePath);
3970
3836
  } catch (writeError) {
3971
3837
  try {
@@ -4008,7 +3874,7 @@ async function listEvidenceTaskIds(directory) {
4008
3874
  }
4009
3875
  const taskIds = [];
4010
3876
  for (const entry of entries) {
4011
- const entryPath = path6.join(evidenceBasePath, entry);
3877
+ const entryPath = path5.join(evidenceBasePath, entry);
4012
3878
  try {
4013
3879
  const stats = statSync2(entryPath);
4014
3880
  if (!stats.isDirectory()) {
@@ -4031,7 +3897,7 @@ async function deleteEvidence(directory, taskId) {
4031
3897
  } catch {
4032
3898
  return false;
4033
3899
  }
4034
- const relativePath = path6.join("evidence", sanitizedTaskId);
3900
+ const relativePath = path5.join("evidence", sanitizedTaskId);
4035
3901
  const evidenceDir = validateSwarmPath(directory, relativePath);
4036
3902
  try {
4037
3903
  statSync2(evidenceDir);
@@ -4047,10 +3913,10 @@ async function deleteEvidence(directory, taskId) {
4047
3913
  }
4048
3914
  }
4049
3915
  async function checkRequirementCoverage(phase, directory) {
4050
- const relativePath = path6.join("evidence", `req-coverage-phase-${phase}.json`);
4051
- const absolutePath = path6.resolve(directory, ".swarm", relativePath);
3916
+ const relativePath = path5.join("evidence", `req-coverage-phase-${phase}.json`);
3917
+ const absolutePath = path5.resolve(directory, ".swarm", relativePath);
4052
3918
  try {
4053
- await fs6.access(absolutePath);
3919
+ await fs5.access(absolutePath);
4054
3920
  return { exists: true, path: absolutePath };
4055
3921
  } catch {
4056
3922
  return { exists: false, path: absolutePath };
@@ -4276,4 +4142,4 @@ function mergeDurableGateEntriesFromEvidence(taskId, entries, evidence) {
4276
4142
  return merged;
4277
4143
  }
4278
4144
 
4279
- export { normalizePath, buildTaskCompletionDescriptor, ensureTaskCheckpointReceipt, updateTaskCheckpointReceipt, MAX_TRANSIENT_RETRIES, isTransientSpawnError, transientBackoff, readLaneEnvFileFromDiskSync, getGitRepositoryStatus, isGitRepo, getDefaultBaseBranch, detectDefaultRemoteBranch, resetToRemoteBranch, resetToMainAfterMerge, isStateUnreadable, loadEpicSessionState, isEpicModeActive, enableEpicMode, disableEpicMode, pathsConflict, isGlobalFile, isProtectedPath, readTaskScopes, loadPlanJsonOnly, loadPlan, withPlanLifecycleLock, savePlan, closePlanTerminalState, updateTaskStatus, derivePlanMarkdown, isValidEvidenceType, isSecretscanEvidence, sanitizeTaskId2 as sanitizeTaskId, validateProjectRoot, saveEvidence, loadEvidence, listEvidenceTaskIds, checkRequirementCoverage, archiveEvidence, _internals7 as _internals, readDurableGateEvidence, getDurableGateEvidenceStatus, getDurableGateEvidenceStatusForTask, mergeDurableGateEntriesFromEvidence };
4145
+ export { buildTaskCompletionDescriptor, ensureTaskCheckpointReceipt, updateTaskCheckpointReceipt, MAX_TRANSIENT_RETRIES, isTransientSpawnError, transientBackoff, readLaneEnvFileFromDiskSync, getGitRepositoryStatus, isGitRepo, getDefaultBaseBranch, detectDefaultRemoteBranch, resetToRemoteBranch, resetToMainAfterMerge, isStateUnreadable, loadEpicSessionState, isEpicModeActive, enableEpicMode, disableEpicMode, loadPlanJsonOnly, loadPlan, withPlanLifecycleLock, savePlan, closePlanTerminalState, updateTaskStatus, derivePlanMarkdown, isValidEvidenceType, isSecretscanEvidence, sanitizeTaskId2 as sanitizeTaskId, validateProjectRoot, saveEvidence, loadEvidence, listEvidenceTaskIds, checkRequirementCoverage, archiveEvidence, _internals7 as _internals, readDurableGateEvidence, getDurableGateEvidenceStatus, getDurableGateEvidenceStatusForTask, mergeDurableGateEntriesFromEvidence };