opencode-swarm 7.179.0 → 7.180.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 (118) hide show
  1. package/.opencode/skills/execute/SKILL.md +9 -8
  2. package/.opencode/skills/running-tests/SKILL.md +41 -36
  3. package/.opencode/skills/writing-tests/SKILL.md +11 -4
  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/explorer.d.ts +1 -1
  7. package/dist/background/pr-event-subscribers.d.ts +2 -0
  8. package/dist/background/pr-feedback-event-queue.d.ts +7 -0
  9. package/dist/background/pr-feedback-loop.d.ts +162 -0
  10. package/dist/cli/{coder-settlement-7pt3a0y0.js → coder-settlement-34z9xgnx.js} +13 -13
  11. package/dist/cli/{config-doctor-82w4bp4b.js → config-doctor-tkfrwztz.js} +2 -2
  12. package/dist/cli/{core-9rqzs794.js → core-z9ybzpvr.js} +4 -5
  13. package/dist/cli/{curation-policy-c7mdsf7m.js → curation-policy-gwzmjmt7.js} +6 -5
  14. package/dist/cli/{curator-drift-d93pwt8h.js → curator-drift-3bbn011w.js} +22 -12
  15. package/dist/cli/curator-llm-factory-e162g7xp.js +74 -0
  16. package/dist/cli/{curator-m8act07j.js → curator-zv4qs07j.js} +46 -44
  17. package/dist/cli/{dispatch-3rwdxpp2.js → dispatch-p5zjg5e6.js} +1 -1
  18. package/dist/cli/{evidence-summary-service-a99bgje1.js → evidence-summary-service-wrfth5tr.js} +22 -20
  19. package/dist/cli/{explorer-z0cf5cz0.js → explorer-m50sfrp7.js} +1 -1
  20. package/dist/cli/{gate-evidence-yssmxba5.js → gate-evidence-adqbxnm7.js} +8 -8
  21. package/dist/cli/guardrail-explain-dn96802k.js +75 -0
  22. package/dist/cli/{guardrail-log-j2wtq7p2.js → guardrail-log-rcza6v3y.js} +6 -6
  23. package/dist/cli/{guardrail-reset-07byr7nr.js → guardrail-reset-fjn42e0n.js} +46 -44
  24. package/dist/cli/hive-promoter-hgqqn7qw.js +89 -0
  25. package/dist/cli/{index-7zmbtxw1.js → index-06crt1ej.js} +2 -2
  26. package/dist/cli/{index-wrt875kh.js → index-0725jpp7.js} +1 -1
  27. package/dist/cli/{index-f2v90gfc.js → index-0v1rtanv.js} +24 -165
  28. package/dist/cli/{index-0bc8jdnv.js → index-1hzqyx13.js} +9 -1
  29. package/dist/cli/{index-80q47hpw.js → index-1p8fk9jb.js} +2 -2
  30. package/dist/cli/{index-1rwyfvq2.js → index-2h0qng38.js} +3 -3
  31. package/dist/cli/{index-amf88k1e.js → index-3jap3516.js} +1 -1
  32. package/dist/cli/{index-8815e95e.js → index-5gmn0a3j.js} +8 -8
  33. package/dist/cli/{index-yagqxt2p.js → index-5m378633.js} +4 -4
  34. package/dist/cli/{index-0h3cr7pn.js → index-5yc5n4ae.js} +1 -1
  35. package/dist/cli/{index-pxtye2ng.js → index-7pj0x345.js} +50 -48
  36. package/dist/cli/{index-etmwjgre.js → index-7w6dnpvc.js} +46 -44
  37. package/dist/cli/{index-6tnkvqr9.js → index-8b1f2t5q.js} +8 -10
  38. package/dist/cli/{index-cvg402ha.js → index-91dhg3wr.js} +2 -2
  39. package/dist/cli/{index-3pzwsesm.js → index-92m05mew.js} +2 -2
  40. package/dist/cli/{index-6r92fw88.js → index-93vk5s7v.js} +8 -8
  41. package/dist/cli/{index-ne9zamcs.js → index-989v83pb.js} +1 -1
  42. package/dist/cli/{index-g6nyk713.js → index-aspxz5r5.js} +1 -1
  43. package/dist/cli/index-b9z9gvx0.js +339 -0
  44. package/dist/cli/{index-2b0ktpbf.js → index-bdpgfep1.js} +5 -5
  45. package/dist/cli/{index-nzekzzs2.js → index-bv4b8tpa.js} +5 -5
  46. package/dist/cli/{index-n1tcj1q7.js → index-bx70zs8d.js} +187 -47
  47. package/dist/cli/{index-kmhnkn6t.js → index-caj76d0f.js} +6 -8
  48. package/dist/cli/{index-549wxbe1.js → index-cjapb4hy.js} +1 -1
  49. package/dist/cli/{index-3hne91yd.js → index-cxgr6ad5.js} +13 -15
  50. package/dist/cli/{index-kanxpgf8.js → index-dcttq1mn.js} +2 -2
  51. package/dist/cli/{index-twtez316.js → index-defq2crz.js} +13 -3
  52. package/dist/cli/{index-d66zb40k.js → index-dnbqmay5.js} +3054 -1454
  53. package/dist/cli/index-ejhxgyvm.js +147 -0
  54. package/dist/cli/{index-hwcra3y9.js → index-ekgc71m1.js} +10 -10
  55. package/dist/cli/{index-s4bkey0q.js → index-gc6h1fmf.js} +4 -4
  56. package/dist/cli/index-gx2vp8gx.js +100 -0
  57. package/dist/cli/{index-zgvzbz48.js → index-hamqvzqn.js} +69 -13
  58. package/dist/cli/{index-h59vsbch.js → index-htrb9ec3.js} +1 -1
  59. package/dist/cli/{index-yfpswnjt.js → index-jmrsfhwq.js} +3 -3
  60. package/dist/cli/{index-9p1pqykb.js → index-jrfv2am8.js} +7 -7
  61. package/dist/cli/{index-pskba939.js → index-jscqefqm.js} +1 -1
  62. package/dist/cli/{index-wvpsm8ja.js → index-kp654qcw.js} +32 -17
  63. package/dist/cli/{index-tmy46dtd.js → index-mhrn7hbb.js} +8 -7
  64. package/dist/cli/{index-h4nh6s8b.js → index-nhxykfyy.js} +1 -1
  65. package/dist/cli/{index-ndwbb3xm.js → index-pnt98k7z.js} +7 -7
  66. package/dist/cli/{index-1c1dbwze.js → index-rdec0y3z.js} +1 -1
  67. package/dist/cli/{index-qxk5qkfh.js → index-ret97f1t.js} +5 -5
  68. package/dist/cli/{index-sv4y1cma.js → index-v1sc1gxv.js} +6 -6
  69. package/dist/cli/{index-a11ztzs5.js → index-vmthakz0.js} +1 -1
  70. package/dist/cli/{index-09wm3963.js → index-x6kjbjya.js} +9 -7
  71. package/dist/cli/{index-1sz02k85.js → index-zptq8mp1.js} +4 -103
  72. package/dist/cli/{index-34bwqcea.js → index-zvxy0mev.js} +1 -1
  73. package/dist/cli/{index-zz7gzw57.js → index-zxdawwc7.js} +88 -4
  74. package/dist/cli/index.js +47 -45
  75. package/dist/cli/{knowledge-escalator-yx97q9c1.js → knowledge-escalator-x8vcmb6k.js} +16 -15
  76. package/dist/cli/{knowledge-events-p269fyvv.js → knowledge-events-naf9kyyc.js} +14 -13
  77. package/dist/cli/{knowledge-link-gfz47ves.js → knowledge-link-g0q25hqv.js} +5 -4
  78. package/dist/cli/{knowledge-store-36zemyqa.js → knowledge-store-dnv0ph42.js} +6 -5
  79. package/dist/cli/{knowledge-validator-rd20yq41.js → knowledge-validator-a1rfzkmv.js} +8 -7
  80. package/dist/cli/{mcp-sg9zrkz2.js → mcp-hnb0m05a.js} +1 -1
  81. package/dist/cli/{pending-delegations-8p2gf4kt.js → pending-delegations-05p6cmbh.js} +13 -12
  82. package/dist/cli/{pr-subscriptions-4dj9r71h.js → pr-subscriptions-a2djfzyx.js} +13 -12
  83. package/dist/cli/{pr-workflow-gate-8dgz5z1h.js → pr-workflow-gate-wkmx8nr6.js} +48 -44
  84. package/dist/cli/{runner-16b691ba.js → runner-hkbds12j.js} +6 -5
  85. package/dist/cli/{scan-cursor-nx0jv9ya.js → scan-cursor-4khfn5pm.js} +8 -8
  86. package/dist/cli/{schema-q6gsrxwz.js → schema-a5zb02h8.js} +3 -1
  87. package/dist/cli/{scope-persistence-1k4xsyh7.js → scope-persistence-nsw324ce.js} +18 -17
  88. package/dist/cli/{server-shhxq34t.js → server-exj4wt8j.js} +54 -52
  89. package/dist/cli/{skill-generator-6j7tq2tb.js → skill-generator-r2cdtx7b.js} +18 -17
  90. package/dist/cli/{snapshot-coordination-init-h8n8w1cm.js → snapshot-coordination-init-sad6q0a2.js} +46 -44
  91. package/dist/cli/speckit-checkoff-46g9sqak.js +31 -0
  92. package/dist/cli/{workspace-snapshot-rfnn80dg.js → workspace-snapshot-4m2ex1ey.js} +4 -5
  93. package/dist/cli/{worktree-collision-ownership-97jzh4ra.js → worktree-collision-ownership-4znkfq1t.js} +16 -16
  94. package/dist/cli/{worktree-isolation-g4w74ccb.js → worktree-isolation-mv9ee00v.js} +46 -44
  95. package/dist/commands/pr-feedback-loop.d.ts +1 -0
  96. package/dist/commands/registry.d.ts +10 -2
  97. package/dist/config/schema.d.ts +27 -0
  98. package/dist/hooks/delegation-tracker.d.ts +6 -1
  99. package/dist/hooks/pr-workflow-gate.d.ts +1 -1
  100. package/dist/index.js +639 -606
  101. package/dist/lang/backends/go.d.ts +2 -0
  102. package/dist/mutation/engine.d.ts +1 -0
  103. package/dist/sdd/effective-spec.d.ts +35 -22
  104. package/dist/sdd/speckit-checkoff.d.ts +113 -0
  105. package/dist/session/hydration-ownership.d.ts +83 -0
  106. package/dist/session/snapshot-coordination-init.d.ts +2 -1
  107. package/dist/session/snapshot-reader.d.ts +25 -7
  108. package/dist/state.d.ts +32 -2
  109. package/dist/test-impact/analyzer.d.ts +46 -4
  110. package/dist/test-impact/constants.d.ts +4 -0
  111. package/dist/tools/mutation-test.d.ts +11 -5
  112. package/dist/tools/test-runner.d.ts +34 -6
  113. package/opencode-swarm.schema.json +40 -0
  114. package/package.json +1 -1
  115. package/dist/cli/curator-llm-factory-cbm1ny30.js +0 -72
  116. package/dist/cli/guardrail-explain-ffwmhf7s.js +0 -73
  117. package/dist/cli/hive-promoter-ewrz7vh1.js +0 -87
  118. package/dist/cli/index-4ddpvd5c.js +0 -94
@@ -0,0 +1,147 @@
1
+ // @bun
2
+ import {
3
+ require_proper_lockfile
4
+ } from "./index-7g4c7s5r.js";
5
+ import {
6
+ __toESM
7
+ } from "./index-a76rekgs.js";
8
+
9
+ // src/parallel/file-locks.ts
10
+ var import_proper_lockfile = __toESM(require_proper_lockfile(), 1);
11
+ import * as crypto from "crypto";
12
+ import * as fs from "fs";
13
+ import * as path from "path";
14
+ var LOCKS_DIR = ".swarm/locks";
15
+ var LOCK_TIMEOUT_MS = 5 * 60 * 1000;
16
+ var _internals = {
17
+ tryAcquireLock,
18
+ writeFile: fs.promises.writeFile
19
+ };
20
+ function getLockFilePath(directory, filePath) {
21
+ const normalized = path.resolve(directory, filePath);
22
+ const baseDir = path.resolve(directory) + path.sep;
23
+ const pathOk = process.platform === "win32" ? normalized.toLowerCase().startsWith(baseDir.toLowerCase()) : normalized.startsWith(baseDir);
24
+ if (!pathOk) {
25
+ throw new Error("Invalid file path: path traversal not allowed");
26
+ }
27
+ const pathForHash = process.platform === "win32" ? normalized.toLowerCase() : normalized;
28
+ const hash = crypto.createHash("sha256").update(pathForHash).digest("hex");
29
+ const lockPath = path.join(directory, LOCKS_DIR, `${hash}.lock`);
30
+ const legacyPaths = [pathForHash];
31
+ if (process.platform === "win32" && normalized !== pathForHash) {
32
+ legacyPaths.push(normalized);
33
+ }
34
+ for (const legacyPath of legacyPaths) {
35
+ const oldHash = Buffer.from(legacyPath).toString("base64").replace(/[/+=]/g, "_");
36
+ const oldLockPath = path.join(directory, LOCKS_DIR, `${oldHash}.lock`);
37
+ if (fs.existsSync(oldLockPath)) {
38
+ return oldLockPath;
39
+ }
40
+ }
41
+ return lockPath;
42
+ }
43
+ function getMetaPath(lockPath) {
44
+ return `${lockPath.replace(/\.lock$/, "")}.meta`;
45
+ }
46
+ function readMetaFile(metaPath) {
47
+ try {
48
+ const content = fs.readFileSync(metaPath, "utf-8");
49
+ return JSON.parse(content);
50
+ } catch {
51
+ return null;
52
+ }
53
+ }
54
+ async function tryAcquireLock(directory, filePath, agent, taskId) {
55
+ const lockPath = getLockFilePath(directory, filePath);
56
+ const locksDir = path.dirname(lockPath);
57
+ if (!fs.existsSync(locksDir)) {
58
+ fs.mkdirSync(locksDir, { recursive: true });
59
+ }
60
+ if (!fs.existsSync(lockPath)) {
61
+ fs.writeFileSync(lockPath, "", "utf-8");
62
+ }
63
+ let release;
64
+ try {
65
+ release = await import_proper_lockfile.default.lock(lockPath, {
66
+ stale: LOCK_TIMEOUT_MS,
67
+ retries: {
68
+ retries: 5,
69
+ minTimeout: 10,
70
+ maxTimeout: 500,
71
+ factor: 2
72
+ },
73
+ realpath: false
74
+ });
75
+ } catch (err) {
76
+ const code = err.code;
77
+ if (code === "ELOCKED" || code === "EEXIST") {
78
+ return { acquired: false };
79
+ }
80
+ throw err;
81
+ }
82
+ const lock = {
83
+ filePath,
84
+ agent,
85
+ taskId,
86
+ timestamp: new Date().toISOString(),
87
+ expiresAt: Date.now() + LOCK_TIMEOUT_MS,
88
+ _release: release
89
+ };
90
+ return { acquired: true, lock };
91
+ }
92
+ function listActiveLocks(directory) {
93
+ const locksDir = path.join(directory, LOCKS_DIR);
94
+ const locks = [];
95
+ if (!fs.existsSync(locksDir)) {
96
+ return locks;
97
+ }
98
+ const files = fs.readdirSync(locksDir);
99
+ const now = Date.now();
100
+ for (const file of files) {
101
+ if (!file.endsWith(".lock"))
102
+ continue;
103
+ const lockPath = path.join(locksDir, file);
104
+ try {
105
+ const stat = fs.statSync(lockPath);
106
+ if (stat.isFile()) {
107
+ const plLockDir = `${lockPath}.lock`;
108
+ if (fs.existsSync(plLockDir)) {
109
+ const metaPath = getMetaPath(lockPath);
110
+ const meta = readMetaFile(metaPath);
111
+ if (meta) {
112
+ if (meta.expiresAt < now) {
113
+ continue;
114
+ }
115
+ locks.push({
116
+ filePath: meta.originalPath,
117
+ agent: meta.agent,
118
+ taskId: meta.taskId,
119
+ timestamp: meta.acquiredAt,
120
+ expiresAt: meta.expiresAt,
121
+ laneId: meta.laneId
122
+ });
123
+ } else {
124
+ let acquiredAt = Date.now();
125
+ try {
126
+ acquiredAt = fs.statSync(plLockDir).mtimeMs;
127
+ } catch {}
128
+ const expiresAt = acquiredAt + LOCK_TIMEOUT_MS;
129
+ if (expiresAt < now) {
130
+ continue;
131
+ }
132
+ locks.push({
133
+ filePath: lockPath,
134
+ agent: "unknown",
135
+ taskId: "unknown",
136
+ timestamp: new Date(acquiredAt).toISOString(),
137
+ expiresAt
138
+ });
139
+ }
140
+ }
141
+ }
142
+ } catch {}
143
+ }
144
+ return locks;
145
+ }
146
+
147
+ export { tryAcquireLock, listActiveLocks };
@@ -1,36 +1,36 @@
1
1
  // @bun
2
2
  import {
3
3
  validateSwarmPath
4
- } from "./index-s4bkey0q.js";
4
+ } from "./index-gc6h1fmf.js";
5
5
  import {
6
6
  observeReceiptTransition
7
- } from "./index-yfpswnjt.js";
7
+ } from "./index-jmrsfhwq.js";
8
8
  import {
9
9
  resolveHiveEventsPath
10
10
  } from "./index-ae75rja9.js";
11
11
  import {
12
12
  resolveKnowledgeStoreDir
13
- } from "./index-34bwqcea.js";
13
+ } from "./index-zvxy0mev.js";
14
14
  import {
15
15
  assertProjectRoot,
16
16
  atomicWriteFile
17
- } from "./index-f2v90gfc.js";
18
- import {
19
- require_proper_lockfile
20
- } from "./index-7g4c7s5r.js";
17
+ } from "./index-0v1rtanv.js";
21
18
  import {
22
19
  emit
23
20
  } from "./index-qt0793qm.js";
24
21
  import {
25
22
  canonicalRootKey
26
23
  } from "./index-1xnse449.js";
24
+ import {
25
+ require_proper_lockfile
26
+ } from "./index-7g4c7s5r.js";
27
27
  import {
28
28
  loadPluginConfigWithMeta
29
- } from "./index-1sz02k85.js";
29
+ } from "./index-zptq8mp1.js";
30
30
  import {
31
31
  KnowledgeConfigSchema,
32
32
  init_schema
33
- } from "./index-twtez316.js";
33
+ } from "./index-defq2crz.js";
34
34
  import {
35
35
  init_logger,
36
36
  warn
@@ -2813,7 +2813,7 @@ async function applyKnowledgeVerdictFeedback(directory, options) {
2813
2813
  }
2814
2814
  let bumps = 0;
2815
2815
  if (deltas.length > 0) {
2816
- const { bumpKnowledgeConfidenceBatch } = await import("./knowledge-store-36zemyqa.js");
2816
+ const { bumpKnowledgeConfidenceBatch } = await import("./knowledge-store-dnv0ph42.js");
2817
2817
  bumps = await bumpKnowledgeConfidenceBatch(directory, deltas, options?.floorOptions);
2818
2818
  }
2819
2819
  return {
@@ -2,15 +2,15 @@
2
2
  import {
3
3
  bunFile
4
4
  } from "./index-2s7dvzff.js";
5
+ import {
6
+ SwarmError
7
+ } from "./index-c1ggtmpm.js";
5
8
  import {
6
9
  RECENT_WRITE_WINDOW_MS,
7
10
  readCachedTextFile,
8
11
  wasObservedToExist,
9
12
  wasRecentlyWrittenByThisProcess
10
- } from "./index-ne9zamcs.js";
11
- import {
12
- SwarmError
13
- } from "./index-c1ggtmpm.js";
13
+ } from "./index-989v83pb.js";
14
14
  import {
15
15
  warn
16
16
  } from "./index-zgwm4ryv.js";
@@ -0,0 +1,100 @@
1
+ // @bun
2
+ import {
3
+ exports_external,
4
+ init_zod
5
+ } from "./index-gknz3bv1.js";
6
+
7
+ // src/config/plan-schema.ts
8
+ init_zod();
9
+ var ExecutionProfileSchema = exports_external.object({
10
+ parallelization_enabled: exports_external.boolean().default(false),
11
+ max_concurrent_tasks: exports_external.number().int().min(1).max(64).default(10),
12
+ council_parallel: exports_external.boolean().default(true),
13
+ locked: exports_external.boolean().default(false),
14
+ auto_proceed: exports_external.boolean().default(false),
15
+ commit_after_each_completed_task: exports_external.boolean().default(false),
16
+ planning_profile: exports_external.enum(["balanced", "strict"]).optional()
17
+ });
18
+ var TaskStatusSchema = exports_external.enum([
19
+ "pending",
20
+ "in_progress",
21
+ "completed",
22
+ "blocked",
23
+ "closed"
24
+ ]);
25
+ var TaskSizeSchema = exports_external.enum(["small", "medium", "large"]);
26
+ var PhaseStatusSchema = exports_external.enum([
27
+ "pending",
28
+ "in_progress",
29
+ "complete",
30
+ "completed",
31
+ "blocked",
32
+ "closed"
33
+ ]);
34
+ var MigrationStatusSchema = exports_external.enum([
35
+ "native",
36
+ "migrated",
37
+ "migration_failed"
38
+ ]);
39
+ var TaskSchema = exports_external.object({
40
+ id: exports_external.string(),
41
+ phase: exports_external.number().int().min(1),
42
+ status: TaskStatusSchema.default("pending"),
43
+ size: TaskSizeSchema.default("small"),
44
+ description: exports_external.string().min(1),
45
+ depends: exports_external.array(exports_external.string()).default([]),
46
+ acceptance: exports_external.string().optional(),
47
+ files_touched: exports_external.array(exports_external.string()).default([]),
48
+ evidence_path: exports_external.string().optional(),
49
+ blocked_reason: exports_external.string().optional(),
50
+ fr_refs: exports_external.array(exports_external.string()).optional()
51
+ });
52
+ var PhaseSchema = exports_external.object({
53
+ id: exports_external.number().int().min(1),
54
+ name: exports_external.string().min(1),
55
+ status: PhaseStatusSchema.default("pending"),
56
+ tasks: exports_external.array(TaskSchema).default([]),
57
+ type: exports_external.enum(["code", "non-code"]).optional(),
58
+ required_agents: exports_external.array(exports_external.string()).optional()
59
+ });
60
+ var PlanSchema = exports_external.object({
61
+ schema_version: exports_external.literal("1.0.0"),
62
+ title: exports_external.string().min(1),
63
+ swarm: exports_external.string().min(1),
64
+ current_phase: exports_external.number().int().min(1).optional(),
65
+ phases: exports_external.array(PhaseSchema).min(1),
66
+ migration_status: MigrationStatusSchema.optional(),
67
+ specMtime: exports_external.string().optional(),
68
+ specHash: exports_external.string().optional(),
69
+ execution_profile: ExecutionProfileSchema.optional()
70
+ });
71
+ function isPhaseStatusTerminal(status) {
72
+ return status === "complete" || status === "completed" || status === "closed";
73
+ }
74
+ function isPhaseEffectivelyTerminal(phase) {
75
+ if (isPhaseStatusTerminal(phase.status))
76
+ return true;
77
+ const tasks = phase.tasks ?? [];
78
+ return tasks.length > 0 && tasks.every((task) => task.status === "completed" || task.status === "closed");
79
+ }
80
+ function resolveActivePhaseId(plan) {
81
+ const cursor = plan.current_phase;
82
+ if (cursor !== undefined) {
83
+ const cursorPhase = plan.phases.find((phase) => phase.id === cursor);
84
+ if (cursorPhase && !isPhaseEffectivelyTerminal(cursorPhase)) {
85
+ return cursorPhase.id;
86
+ }
87
+ }
88
+ const firstNonTerminal = plan.phases.find((phase) => !isPhaseEffectivelyTerminal(phase));
89
+ if (firstNonTerminal)
90
+ return firstNonTerminal.id;
91
+ return plan.phases[plan.phases.length - 1]?.id ?? 1;
92
+ }
93
+ function normalizeCurrentPhaseInPlace(plan) {
94
+ plan.current_phase = resolveActivePhaseId(plan);
95
+ }
96
+ function getCurrentPhase(plan) {
97
+ return resolveActivePhaseId(plan);
98
+ }
99
+
100
+ export { ExecutionProfileSchema, TaskStatusSchema, TaskSizeSchema, PhaseStatusSchema, MigrationStatusSchema, TaskSchema, PhaseSchema, PlanSchema, resolveActivePhaseId, normalizeCurrentPhaseInPlace, getCurrentPhase };
@@ -14739,26 +14739,82 @@ var PROFILE_ID = "go";
14739
14739
  var IMPORT_REGEX_SINGLE = /^\s*import\s+(?:[a-zA-Z_.][a-zA-Z0-9_]*\s+)?"([^"]+)"/gm;
14740
14740
  var IMPORT_REGEX_GROUP = /^\s*import\s*\(([\s\S]*?)\)/gm;
14741
14741
  var IMPORT_REGEX_GROUP_LINE = /(?:[a-zA-Z_.][a-zA-Z0-9_]*\s+)?"([^"]+)"/g;
14742
- function stripGoComments(block) {
14743
- const withoutBlockComments = block.replace(/\/\*[\s\S]*?\*\//g, " ");
14744
- return withoutBlockComments.split(`
14745
- `).map((line) => {
14746
- const idx = line.indexOf("//");
14747
- return idx === -1 ? line : line.slice(0, idx);
14748
- }).join(`
14749
- `);
14742
+ var MAX_IMPORT_SOURCE_BYTES = 1 * 1024 * 1024;
14743
+ function stripGoComments(source) {
14744
+ let state = "normal";
14745
+ let out = "";
14746
+ let escaped = false;
14747
+ for (let index = 0;index < source.length; index++) {
14748
+ const current = source[index];
14749
+ const next = source[index + 1];
14750
+ if (state === "line") {
14751
+ if (current === `
14752
+ ` || current === "\r") {
14753
+ state = "normal";
14754
+ out += current;
14755
+ } else {
14756
+ out += " ";
14757
+ }
14758
+ continue;
14759
+ }
14760
+ if (state === "block") {
14761
+ if (current === "*" && next === "/") {
14762
+ out += " ";
14763
+ index++;
14764
+ state = "normal";
14765
+ } else {
14766
+ out += current === `
14767
+ ` || current === "\r" ? current : " ";
14768
+ }
14769
+ continue;
14770
+ }
14771
+ if (state === "string") {
14772
+ out += current;
14773
+ if (escaped)
14774
+ escaped = false;
14775
+ else if (current === "\\")
14776
+ escaped = true;
14777
+ else if (current === '"')
14778
+ state = "normal";
14779
+ continue;
14780
+ }
14781
+ if (state === "raw") {
14782
+ out += current;
14783
+ if (current === "`")
14784
+ state = "normal";
14785
+ continue;
14786
+ }
14787
+ if (current === "/" && next === "/") {
14788
+ out += " ";
14789
+ index++;
14790
+ state = "line";
14791
+ } else if (current === "/" && next === "*") {
14792
+ out += " ";
14793
+ index++;
14794
+ state = "block";
14795
+ } else {
14796
+ out += current;
14797
+ if (current === '"')
14798
+ state = "string";
14799
+ else if (current === "`")
14800
+ state = "raw";
14801
+ }
14802
+ }
14803
+ return out;
14750
14804
  }
14751
14805
  function extractImports(_sourceFile, source) {
14806
+ if (Buffer.byteLength(source, "utf8") > MAX_IMPORT_SOURCE_BYTES)
14807
+ return [];
14752
14808
  const out = new Set;
14753
- const cleaned = stripGoComments(source);
14809
+ const uncommented = stripGoComments(source);
14754
14810
  IMPORT_REGEX_SINGLE.lastIndex = 0;
14755
- let m = IMPORT_REGEX_SINGLE.exec(cleaned);
14811
+ let m = IMPORT_REGEX_SINGLE.exec(uncommented);
14756
14812
  while (m !== null) {
14757
14813
  out.add(m[1]);
14758
- m = IMPORT_REGEX_SINGLE.exec(cleaned);
14814
+ m = IMPORT_REGEX_SINGLE.exec(uncommented);
14759
14815
  }
14760
14816
  IMPORT_REGEX_GROUP.lastIndex = 0;
14761
- m = IMPORT_REGEX_GROUP.exec(cleaned);
14817
+ m = IMPORT_REGEX_GROUP.exec(uncommented);
14762
14818
  while (m !== null) {
14763
14819
  const block = m[1];
14764
14820
  IMPORT_REGEX_GROUP_LINE.lastIndex = 0;
@@ -14767,7 +14823,7 @@ function extractImports(_sourceFile, source) {
14767
14823
  out.add(inner[1]);
14768
14824
  inner = IMPORT_REGEX_GROUP_LINE.exec(block);
14769
14825
  }
14770
- m = IMPORT_REGEX_GROUP.exec(cleaned);
14826
+ m = IMPORT_REGEX_GROUP.exec(uncommented);
14771
14827
  }
14772
14828
  return [...out];
14773
14829
  }
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  import {
3
3
  observeStoreHealth
4
- } from "./index-yfpswnjt.js";
4
+ } from "./index-jmrsfhwq.js";
5
5
  import {
6
6
  telemetry
7
7
  } from "./index-qt0793qm.js";
@@ -4,12 +4,12 @@ import {
4
4
  resolveLineageSalt,
5
5
  telemetry
6
6
  } from "./index-qt0793qm.js";
7
- import {
8
- atomicWriteSwarmFile
9
- } from "./index-ne9zamcs.js";
10
7
  import {
11
8
  canonicalRootKeyFresh
12
9
  } from "./index-1xnse449.js";
10
+ import {
11
+ atomicWriteSwarmFile
12
+ } from "./index-989v83pb.js";
13
13
 
14
14
  // src/health/learning-health.ts
15
15
  import { promises as fs } from "fs";
@@ -1,10 +1,10 @@
1
1
  // @bun
2
2
  import {
3
3
  computePlanStructureHash
4
- } from "./index-09wm3963.js";
4
+ } from "./index-x6kjbjya.js";
5
5
  import {
6
6
  appendCoreEventSync
7
- } from "./index-h59vsbch.js";
7
+ } from "./index-htrb9ec3.js";
8
8
  import {
9
9
  deleteCoordinationState,
10
10
  derivePlanId,
@@ -13,27 +13,27 @@ import {
13
13
  transitionCoordinationState,
14
14
  transitionCoordinationStateWithinTransaction,
15
15
  withCoordinationTransaction
16
- } from "./index-a11ztzs5.js";
16
+ } from "./index-vmthakz0.js";
17
17
  import {
18
18
  getProjectDb
19
- } from "./index-nzekzzs2.js";
19
+ } from "./index-bv4b8tpa.js";
20
20
  import {
21
21
  canonicalExistingFilesystemPath,
22
22
  legacyCanonicalExistingFilesystemPath
23
23
  } from "./index-ry16d01s.js";
24
24
  import {
25
25
  assertProjectRoot
26
- } from "./index-f2v90gfc.js";
26
+ } from "./index-0v1rtanv.js";
27
27
  import {
28
28
  require_proper_lockfile
29
29
  } from "./index-7g4c7s5r.js";
30
30
  import {
31
31
  atomicWriteSwarmFile,
32
32
  atomicWriteSwarmFileSync
33
- } from "./index-ne9zamcs.js";
33
+ } from "./index-989v83pb.js";
34
34
  import {
35
35
  PlanSchema
36
- } from "./index-1sz02k85.js";
36
+ } from "./index-gx2vp8gx.js";
37
37
  import {
38
38
  init_path_identity,
39
39
  unsafePathTextReason
@@ -9,7 +9,7 @@ import {
9
9
  readEvaluationRun,
10
10
  saveEvaluationRun,
11
11
  saveTaskSetSnapshot
12
- } from "./index-g6nyk713.js";
12
+ } from "./index-aspxz5r5.js";
13
13
  import {
14
14
  canonicalHash,
15
15
  computeCandidateInputContentHash,
@@ -3,10 +3,10 @@ import {
3
3
  EvaluationRunV1Schema,
4
4
  GateAuditResultV1Schema,
5
5
  getProtectedEvaluationRunIds
6
- } from "./index-g6nyk713.js";
6
+ } from "./index-aspxz5r5.js";
7
7
  import {
8
8
  readEffectiveSpecSync
9
- } from "./index-n1tcj1q7.js";
9
+ } from "./index-bx70zs8d.js";
10
10
  import {
11
11
  validateWorkspaceRoot
12
12
  } from "./index-6b295cas.js";
@@ -23,13 +23,13 @@ import {
23
23
  readTaskEvidence,
24
24
  readTaskEvidenceRaw,
25
25
  sanitizeTaskId
26
- } from "./index-kmhnkn6t.js";
26
+ } from "./index-caj76d0f.js";
27
27
  import {
28
28
  estimateCharsForTokens,
29
29
  estimateTokens,
30
30
  readSwarmFileAsync,
31
31
  validateSwarmPath
32
- } from "./index-s4bkey0q.js";
32
+ } from "./index-gc6h1fmf.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-09wm3963.js";
61
+ } from "./index-x6kjbjya.js";
62
62
  import {
63
63
  appendCoreEventSync
64
- } from "./index-h59vsbch.js";
64
+ } from "./index-htrb9ec3.js";
65
65
  import {
66
66
  derivePlanId,
67
67
  derivePlanIdentityHash,
@@ -69,40 +69,42 @@ import {
69
69
  importCoordinationOnce,
70
70
  listCoordinationStates,
71
71
  transitionCoordinationState
72
- } from "./index-a11ztzs5.js";
72
+ } from "./index-vmthakz0.js";
73
73
  import {
74
74
  DURABILITY_CLASSES,
75
75
  getProjectDb,
76
76
  projectDbExists,
77
77
  withDurabilityClass
78
- } from "./index-nzekzzs2.js";
78
+ } from "./index-bv4b8tpa.js";
79
79
  import {
80
80
  assertProjectRoot,
81
- tryAcquireLock,
82
81
  withEvidenceLock
83
- } from "./index-f2v90gfc.js";
82
+ } from "./index-0v1rtanv.js";
84
83
  import {
85
84
  emit
86
85
  } from "./index-qt0793qm.js";
86
+ import {
87
+ canonicalRootKeyFresh
88
+ } from "./index-1xnse449.js";
89
+ import {
90
+ tryAcquireLock
91
+ } from "./index-ejhxgyvm.js";
87
92
  import {
88
93
  atomicWriteSwarmFileSync,
89
94
  invalidateCachedArtifact,
90
95
  readCachedParsedFile
91
- } from "./index-ne9zamcs.js";
92
- import {
93
- canonicalRootKeyFresh
94
- } from "./index-1xnse449.js";
96
+ } from "./index-989v83pb.js";
95
97
  import {
96
98
  PlanSchema,
97
99
  normalizeCurrentPhaseInPlace,
98
100
  resolveActivePhaseId
99
- } from "./index-1sz02k85.js";
101
+ } from "./index-gx2vp8gx.js";
100
102
  import {
101
103
  GIT_BINARY_ENV_VAR,
102
104
  describeGitResolution,
103
105
  init_git_executable,
104
106
  resolveGitExecutable
105
- } from "./index-zz7gzw57.js";
107
+ } from "./index-zxdawwc7.js";
106
108
  import {
107
109
  ZodError,
108
110
  init_zod
@@ -2935,6 +2937,19 @@ async function updateTaskStatus(directory, taskId, status, options) {
2935
2937
  warn(`[plan/manager] run-memory record for ${taskId} failed: ${err instanceof Error ? err.message : String(err)}`);
2936
2938
  }
2937
2939
  }
2940
+ if (status === "completed") {
2941
+ try {
2942
+ const completedTask = updatedPlan.phases.flatMap((phase) => phase.tasks).find((candidate) => candidate.id === taskId);
2943
+ const { maybePropagateSpeckitCheckoff } = await import("./speckit-checkoff-46g9sqak.js");
2944
+ await maybePropagateSpeckitCheckoff(directory, {
2945
+ taskId,
2946
+ frRefs: completedTask?.fr_refs ?? [],
2947
+ text: completedTask?.description ?? ""
2948
+ });
2949
+ } catch (err) {
2950
+ warn(`[plan/manager] speckit check-off for ${taskId} failed (non-fatal): ${err instanceof Error ? err.message : String(err)}`);
2951
+ }
2952
+ }
2938
2953
  if (status === "completed" && _internals5.isGitRepo(directory) && _internals5.isEpicModeActiveForProject(directory)) {
2939
2954
  const mergeFailure = _internals5.getWorktreeMergeFailure(taskId);
2940
2955
  if (mergeFailure) {
@@ -2950,7 +2965,7 @@ async function updateTaskStatus(directory, taskId, status, options) {
2950
2965
  break;
2951
2966
  }
2952
2967
  }
2953
- const { readDeclaredScopeFilesFromBindings } = await import("./scope-persistence-1k4xsyh7.js");
2968
+ const { readDeclaredScopeFilesFromBindings } = await import("./scope-persistence-nsw324ce.js");
2954
2969
  const canonicalScope = readDeclaredScopeFilesFromBindings({
2955
2970
  directory,
2956
2971
  taskId,
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  _internals,
4
4
  resolveWorktreeIsolationConfig
5
- } from "./index-kanxpgf8.js";
5
+ } from "./index-dcttq1mn.js";
6
6
  import {
7
7
  ApprovalEvidenceSchema,
8
8
  BaseEvidenceSchema,
@@ -27,7 +27,7 @@ import {
27
27
  SpecSectionSchema,
28
28
  SwarmSpecSchema,
29
29
  validateSpecContent
30
- } from "./index-wrt875kh.js";
30
+ } from "./index-0725jpp7.js";
31
31
  import {
32
32
  ExecutionProfileSchema,
33
33
  MigrationStatusSchema,
@@ -36,7 +36,9 @@ import {
36
36
  PlanSchema,
37
37
  TaskSchema,
38
38
  TaskSizeSchema,
39
- TaskStatusSchema,
39
+ TaskStatusSchema
40
+ } from "./index-gx2vp8gx.js";
41
+ import {
40
42
  getSafeDefaultConfigLoadResult,
41
43
  loadAgentPrompt,
42
44
  loadGateOverrides,
@@ -44,9 +46,8 @@ import {
44
46
  loadPluginConfigWithMeta,
45
47
  loadPluginConfigWithMetaAsync,
46
48
  resetConfigAdvisoryDedup
47
- } from "./index-1sz02k85.js";
48
- import"./index-zz7gzw57.js";
49
- import"./index-4ddpvd5c.js";
49
+ } from "./index-zptq8mp1.js";
50
+ import"./index-zxdawwc7.js";
50
51
  import {
51
52
  AUTO_REVIEW_V8_BURN_IN_DECISION,
52
53
  AgentOverrideConfigSchema,
@@ -71,7 +72,7 @@ import {
71
72
  TurboConfigSchema,
72
73
  WorktreeIsolationConfigSchema,
73
74
  resolveAutoReviewConfig
74
- } from "./index-twtez316.js";
75
+ } from "./index-defq2crz.js";
75
76
  import {
76
77
  ALL_AGENT_NAMES,
77
78
  ALL_SUBAGENT_NAMES,
@@ -5,7 +5,7 @@ import {
5
5
  batchDurabilityClass,
6
6
  classifyDbWriteError,
7
7
  getProjectDb
8
- } from "./index-nzekzzs2.js";
8
+ } from "./index-bv4b8tpa.js";
9
9
  import {
10
10
  _internals,
11
11
  canonicalRootKeyFresh