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
@@ -12,13 +12,13 @@ import {
12
12
  PluginConfigSchema,
13
13
  init_schema,
14
14
  stripKnownSwarmPrefix
15
- } from "./index-wbkxbgk8.js";
15
+ } from "./index-twtez316.js";
16
16
  import {
17
17
  ALL_AGENT_NAMES,
18
18
  TOOL_NAME_SET,
19
19
  init_constants,
20
20
  init_tool_metadata
21
- } from "./index-m2n1rhgv.js";
21
+ } from "./index-w872yykk.js";
22
22
  import {
23
23
  log
24
24
  } from "./index-zgwm4ryv.js";
@@ -11,7 +11,7 @@ import {
11
11
  readLinkPointer,
12
12
  resolveKnowledgeStoreDir,
13
13
  resolveLinkDir
14
- } from "./index-yj1kr0ft.js";
14
+ } from "./index-34bwqcea.js";
15
15
 
16
16
  // src/knowledge/curation-policy.ts
17
17
  import { readFile as readFile2 } from "fs/promises";
@@ -38,6 +38,7 @@ INPUT: [focus areas/paths]
38
38
 
39
39
  ACTIONS:
40
40
  - FIRST call \`repo_map action="ask"\` with your mission question, and \`action="context_pack"\` (with include_source: true) for your target symbols; use the hits to decide what to read
41
+ - Locate symbols by name with \`repo_map action="symbol_search"\` before reading files; treat hits as pointers, not evidence
41
42
  - Graph output is orientation \u2014 read the located files before reporting on them
42
43
  - Fall back to tree/glob/grep only where the graph has no coverage (\`stale: true\`, missing files, or non-code assets)
43
44
  - Read key files (README, configs, entry points)
@@ -2,10 +2,10 @@
2
2
  import {
3
3
  readKnowledge,
4
4
  transactKnowledge
5
- } from "./index-2mdk6nt9.js";
5
+ } from "./index-ndwbb3xm.js";
6
6
  import {
7
7
  resolveKnowledgeStoreDir
8
- } from "./index-yj1kr0ft.js";
8
+ } from "./index-34bwqcea.js";
9
9
  import {
10
10
  init_git_executable,
11
11
  resolveGitExecutableAsync
@@ -14,7 +14,7 @@ import {
14
14
  PluginConfigSchema,
15
15
  init_schema,
16
16
  resolveExternalSkillsConfig
17
- } from "./index-wbkxbgk8.js";
17
+ } from "./index-twtez316.js";
18
18
  import {
19
19
  exports_external,
20
20
  init_zod
@@ -872,5 +872,33 @@ var PlanSchema = exports_external.object({
872
872
  specHash: exports_external.string().optional(),
873
873
  execution_profile: ExecutionProfileSchema.optional()
874
874
  });
875
+ function isPhaseStatusTerminal(status) {
876
+ return status === "complete" || status === "completed" || status === "closed";
877
+ }
878
+ function isPhaseEffectivelyTerminal(phase) {
879
+ if (isPhaseStatusTerminal(phase.status))
880
+ return true;
881
+ const tasks = phase.tasks ?? [];
882
+ return tasks.length > 0 && tasks.every((task) => task.status === "completed" || task.status === "closed");
883
+ }
884
+ function resolveActivePhaseId(plan) {
885
+ const cursor = plan.current_phase;
886
+ if (cursor !== undefined) {
887
+ const cursorPhase = plan.phases.find((phase) => phase.id === cursor);
888
+ if (cursorPhase && !isPhaseEffectivelyTerminal(cursorPhase)) {
889
+ return cursorPhase.id;
890
+ }
891
+ }
892
+ const firstNonTerminal = plan.phases.find((phase) => !isPhaseEffectivelyTerminal(phase));
893
+ if (firstNonTerminal)
894
+ return firstNonTerminal.id;
895
+ return plan.phases[plan.phases.length - 1]?.id ?? 1;
896
+ }
897
+ function normalizeCurrentPhaseInPlace(plan) {
898
+ plan.current_phase = resolveActivePhaseId(plan);
899
+ }
900
+ function getCurrentPhase(plan) {
901
+ return resolveActivePhaseId(plan);
902
+ }
875
903
 
876
- export { loadPluginConfig, loadPluginConfigWithMeta, loadGateOverrides, resetConfigAdvisoryDedup, getSafeDefaultConfigLoadResult, loadPluginConfigWithMetaAsync, loadAgentPrompt, exports_loader, init_loader, ExecutionProfileSchema, TaskStatusSchema, TaskSizeSchema, PhaseStatusSchema, MigrationStatusSchema, TaskSchema, PhaseSchema, PlanSchema };
904
+ export { loadPluginConfig, loadPluginConfigWithMeta, loadGateOverrides, resetConfigAdvisoryDedup, getSafeDefaultConfigLoadResult, loadPluginConfigWithMetaAsync, loadAgentPrompt, exports_loader, init_loader, ExecutionProfileSchema, TaskStatusSchema, TaskSizeSchema, PhaseStatusSchema, MigrationStatusSchema, TaskSchema, PhaseSchema, PlanSchema, resolveActivePhaseId, normalizeCurrentPhaseInPlace, getCurrentPhase };
@@ -1,13 +1,13 @@
1
1
  // @bun
2
2
  import {
3
3
  validateSwarmPath
4
- } from "./index-zmb8fjp5.js";
4
+ } from "./index-s4bkey0q.js";
5
5
  import {
6
6
  bunSpawn
7
7
  } from "./index-2s7dvzff.js";
8
8
  import {
9
9
  atomicWriteSwarmFile
10
- } from "./index-zsp9de3k.js";
10
+ } from "./index-ne9zamcs.js";
11
11
  import {
12
12
  canonicalRootKey,
13
13
  sameProjectRoot
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  import {
3
3
  atomicWriteFile
4
- } from "./index-j3rkh9mp.js";
4
+ } from "./index-f2v90gfc.js";
5
5
  import {
6
6
  canonicalRootKeyFresh
7
7
  } from "./index-1xnse449.js";
@@ -2,10 +2,10 @@
2
2
  import {
3
3
  captureWorkspaceSnapshotAsync,
4
4
  changedFilesSinceSnapshotAsync
5
- } from "./index-pm7c6f66.js";
5
+ } from "./index-2b0ktpbf.js";
6
6
  import {
7
7
  removeWorktreeProvisioningOwner
8
- } from "./index-2b1whj28.js";
8
+ } from "./index-3pzwsesm.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-kfk403mc.js";
17
+ } from "./index-kmhnkn6t.js";
18
18
  import {
19
19
  validateSwarmPath
20
- } from "./index-zmb8fjp5.js";
20
+ } from "./index-s4bkey0q.js";
21
21
  import {
22
22
  appendCoreEventSync
23
- } from "./index-j1v54ahd.js";
23
+ } from "./index-h59vsbch.js";
24
24
  import {
25
25
  tryAcquireLock
26
- } from "./index-j3rkh9mp.js";
26
+ } from "./index-f2v90gfc.js";
27
27
  import {
28
28
  canonicalRootKeyFresh
29
29
  } from "./index-1xnse449.js";
@@ -501,7 +501,7 @@ async function cleanupRecoveredWorktree(directory, descriptor, options) {
501
501
  awaitingMergeByCallID,
502
502
  cleanupStandardWorktreeForCallId,
503
503
  standardWorktreeByCallID
504
- } = await import("./worktree-isolation-aj20bs6q.js");
504
+ } = await import("./worktree-isolation-g4w74ccb.js");
505
505
  standardWorktreeByCallID.delete(descriptor.callID);
506
506
  if (hasResidue)
507
507
  awaitingMergeByCallID.set(descriptor.callID, {
@@ -633,7 +633,7 @@ async function recoverCoderSettlement(directory, taskId) {
633
633
  awaitingMergeByCallID,
634
634
  finishStandardWorktreeDispatch,
635
635
  standardWorktreeByCallID
636
- } = await import("./worktree-isolation-aj20bs6q.js");
636
+ } = await import("./worktree-isolation-g4w74ccb.js");
637
637
  const descriptor = wal.worktree;
638
638
  const reconstructedDispatch = {
639
639
  callID: descriptor.callID,
@@ -1,10 +1,10 @@
1
1
  // @bun
2
2
  import {
3
3
  validateSwarmPath
4
- } from "./index-zmb8fjp5.js";
4
+ } from "./index-s4bkey0q.js";
5
5
  import {
6
6
  atomicWriteSwarmFileSync
7
- } from "./index-zsp9de3k.js";
7
+ } from "./index-ne9zamcs.js";
8
8
 
9
9
  // src/hooks/delegation-gate/worktree-provisioning-owner.ts
10
10
  import { createHash } from "crypto";
@@ -1,30 +1,30 @@
1
1
  // @bun
2
2
  import {
3
3
  validateSwarmPath
4
- } from "./index-zmb8fjp5.js";
4
+ } from "./index-s4bkey0q.js";
5
5
  import {
6
6
  deleteCoordinationState,
7
7
  importCoordinationOnce,
8
8
  listCoordinationStates,
9
9
  transitionCoordinationState,
10
10
  withCoordinationTransaction
11
- } from "./index-w4yjy3vp.js";
11
+ } from "./index-a11ztzs5.js";
12
12
  import {
13
13
  getProjectDb,
14
14
  projectDbExists
15
- } from "./index-tnjmn0dn.js";
15
+ } from "./index-nzekzzs2.js";
16
16
  import {
17
17
  observeStoreHealth
18
- } from "./index-yeh78c1g.js";
18
+ } from "./index-yfpswnjt.js";
19
19
  import {
20
20
  withEvidenceLock
21
- } from "./index-j3rkh9mp.js";
21
+ } from "./index-f2v90gfc.js";
22
22
  import {
23
23
  telemetry
24
- } from "./index-wfbh1bx8.js";
24
+ } from "./index-qt0793qm.js";
25
25
  import {
26
26
  atomicWriteSwarmFileSync
27
- } from "./index-zsp9de3k.js";
27
+ } from "./index-ne9zamcs.js";
28
28
  import {
29
29
  canonicalRootKey,
30
30
  canonicalRootKeyFresh,
@@ -1,13 +1,13 @@
1
1
  // @bun
2
2
  import {
3
3
  validateSwarmPath
4
- } from "./index-zmb8fjp5.js";
4
+ } from "./index-s4bkey0q.js";
5
5
  import {
6
6
  bunSpawn
7
7
  } from "./index-2s7dvzff.js";
8
8
  import {
9
9
  atomicWriteSwarmFileSync
10
- } from "./index-zsp9de3k.js";
10
+ } from "./index-ne9zamcs.js";
11
11
  import {
12
12
  canonicalRootKeyFresh
13
13
  } from "./index-1xnse449.js";
@@ -22,7 +22,7 @@ import {
22
22
  import {
23
23
  SWARM_WORKTREE_DIR_NAME,
24
24
  init_constants
25
- } from "./index-m2n1rhgv.js";
25
+ } from "./index-w872yykk.js";
26
26
  import {
27
27
  init_logger,
28
28
  log
@@ -244,7 +244,7 @@ var _internals2 = {
244
244
  symlinkSync: fs2.symlinkSync
245
245
  },
246
246
  writeScopeToDisk: async (directory, taskId, files) => {
247
- const { writeScopeToDisk: realWrite } = await import("./scope-persistence-qcw3rtxq.js");
247
+ const { writeScopeToDisk: realWrite } = await import("./scope-persistence-1k4xsyh7.js");
248
248
  return realWrite(directory, taskId, files);
249
249
  },
250
250
  writeLaneProfileToDisk: async (_worktreePath, _laneIndex, _envOverrides) => {
@@ -1,17 +1,17 @@
1
1
  // @bun
2
2
  import {
3
3
  observeStoreHealth
4
- } from "./index-yeh78c1g.js";
4
+ } from "./index-yfpswnjt.js";
5
5
  import {
6
6
  telemetry
7
- } from "./index-wfbh1bx8.js";
7
+ } from "./index-qt0793qm.js";
8
8
  import {
9
9
  init_schema,
10
10
  stripKnownSwarmPrefix
11
- } from "./index-wbkxbgk8.js";
11
+ } from "./index-twtez316.js";
12
12
  import {
13
13
  init_constants
14
- } from "./index-m2n1rhgv.js";
14
+ } from "./index-w872yykk.js";
15
15
  import {
16
16
  getPathFlavor,
17
17
  init_path_identity,
@@ -14,14 +14,14 @@ import {
14
14
  detectWindowsWrites,
15
15
  getSharedClassifierGuardrailBlock,
16
16
  resolveWriteTargets
17
- } from "./index-heg4em8j.js";
17
+ } from "./index-d66zb40k.js";
18
18
  import {
19
19
  checkFileAuthority,
20
20
  classifyFile,
21
21
  isInDeclaredScope,
22
22
  redactPath,
23
23
  redactShellCommand
24
- } from "./index-qs8eth8h.js";
24
+ } from "./index-7zmbtxw1.js";
25
25
 
26
26
  // src/services/guardrail-explain-service.ts
27
27
  import path from "path";
@@ -5,18 +5,18 @@ import {
5
5
  import {
6
6
  effectiveRetrievalOutcomes,
7
7
  readAuthoritativeKnowledgeCounterRollups
8
- } from "./index-29begjkp.js";
8
+ } from "./index-hwcra3y9.js";
9
9
  import {
10
10
  ALLOWED_SKILL_PATH_PREFIXES,
11
11
  validateSkillPath
12
- } from "./index-d5dexrv1.js";
12
+ } from "./index-yagqxt2p.js";
13
13
  import {
14
14
  computeOutcomeSignal,
15
15
  readKnowledge,
16
16
  resolveHiveKnowledgePath,
17
17
  resolveSwarmKnowledgePath,
18
18
  transactKnowledge
19
- } from "./index-2mdk6nt9.js";
19
+ } from "./index-ndwbb3xm.js";
20
20
  import {
21
21
  appendCappedJsonl,
22
22
  resolveRetentionCap
@@ -24,7 +24,7 @@ import {
24
24
  import {
25
25
  atomicWriteFileAnyRoot,
26
26
  atomicWriteSwarmFile
27
- } from "./index-zsp9de3k.js";
27
+ } from "./index-ne9zamcs.js";
28
28
  import {
29
29
  canonicalRootKeyFresh
30
30
  } from "./index-1xnse449.js";
@@ -1,10 +1,10 @@
1
1
  // @bun
2
2
  import {
3
3
  computePlanStructureHash
4
- } from "./index-ke3m026z.js";
4
+ } from "./index-09wm3963.js";
5
5
  import {
6
6
  appendCoreEventSync
7
- } from "./index-j1v54ahd.js";
7
+ } from "./index-h59vsbch.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-w4yjy3vp.js";
16
+ } from "./index-a11ztzs5.js";
17
17
  import {
18
18
  getProjectDb
19
- } from "./index-tnjmn0dn.js";
19
+ } from "./index-nzekzzs2.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-j3rkh9mp.js";
26
+ } from "./index-f2v90gfc.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-zsp9de3k.js";
33
+ } from "./index-ne9zamcs.js";
34
34
  import {
35
35
  PlanSchema
36
- } from "./index-18hjycr1.js";
36
+ } from "./index-1sz02k85.js";
37
37
  import {
38
38
  init_path_identity,
39
39
  unsafePathTextReason
@@ -1179,6 +1179,31 @@ function readScopeBindingFromDisk(input) {
1179
1179
  });
1180
1180
  return resolved.status === "found" ? resolved.binding : null;
1181
1181
  }
1182
+ function readDeclaredScopeFilesFromBindings(input) {
1183
+ if (!isSafeTaskId(input.taskId))
1184
+ return null;
1185
+ const set = input.bindingSet !== undefined ? input.bindingSet : readAuthoritativeScopeBindingSet(input.directory);
1186
+ if (set === null)
1187
+ return null;
1188
+ const planId = derivePlanId(input.plan);
1189
+ const structureHash = computePlanStructureHash(input.plan);
1190
+ const now = Date.now();
1191
+ const candidates = set.filter((binding) => binding.taskId === input.taskId && binding.planId === planId && binding.planStructureHash === structureHash && binding.lifecycleState === "live" && binding.expiresAt > now);
1192
+ if (candidates.length < 1)
1193
+ return null;
1194
+ const first = [...candidates[0].files].sort().join(`
1195
+ `);
1196
+ const agreeing = candidates.every((candidate) => [...candidate.files].sort().join(`
1197
+ `) === first);
1198
+ if (!agreeing)
1199
+ return null;
1200
+ const files = candidates[0].files;
1201
+ return Array.isArray(files) && files.length > 0 ? files : null;
1202
+ }
1203
+ function readAuthoritativeScopeBindingSet(directory) {
1204
+ const set = readAllAuthoritativeScopeBindings(directory);
1205
+ return set.ok ? set.value : null;
1206
+ }
1182
1207
  function resolveScopeBindingFromDisk(input) {
1183
1208
  if (!isSafeTaskId(input.taskId))
1184
1209
  return { status: "not_declared" };
@@ -2015,4 +2040,4 @@ function resolveScopeWithFallbacks(input) {
2015
2040
  return null;
2016
2041
  }
2017
2042
 
2018
- export { MAX_PENDING_SCOPE_BINDINGS, canonicalWorkspaceIdentity, normalizeScopeFiles, clearScopeBindings, writeScopeToDisk, writeScopeBindingToDisk, persistAndRegisterScopeBinding, readScopeBindingFromDisk, resolveScopeBindingFromDisk, clearScopeBindingFromDisk, tombstoneScopeBinding, refreshScopeBindingLease, claimScopeBindingForChildDurably, replaceExistingScopeDeclaration, flushScopeBindingMaintenance, pruneScopeBindingTombstones, resolveAuthorizedScopeBinding, resolveAuthorizedScopeBindingDetailed, resolveAuthorizedScopeBindingForSession, resolveAuthorizedScopeBindingForSessionDetailed, resolveAuthorizedPrFeedbackScopeBindingFromDisk, _scopePersistenceInternals, readScopeFromDisk, readPlanScope, clearScopeForTask, clearAllScopes, resolveScopeWithFallbacks };
2043
+ export { MAX_PENDING_SCOPE_BINDINGS, canonicalWorkspaceIdentity, normalizeScopeFiles, clearScopeBindings, writeScopeToDisk, writeScopeBindingToDisk, persistAndRegisterScopeBinding, readScopeBindingFromDisk, readDeclaredScopeFilesFromBindings, readAuthoritativeScopeBindingSet, resolveScopeBindingFromDisk, clearScopeBindingFromDisk, tombstoneScopeBinding, refreshScopeBindingLease, claimScopeBindingForChildDurably, replaceExistingScopeDeclaration, flushScopeBindingMaintenance, pruneScopeBindingTombstones, resolveAuthorizedScopeBinding, resolveAuthorizedScopeBindingDetailed, resolveAuthorizedScopeBindingForSession, resolveAuthorizedScopeBindingForSessionDetailed, resolveAuthorizedPrFeedbackScopeBindingFromDisk, _scopePersistenceInternals, readScopeFromDisk, readPlanScope, clearScopeForTask, clearAllScopes, resolveScopeWithFallbacks };
@@ -4,7 +4,7 @@ import {
4
4
  getProjectDb,
5
5
  projectDbExists,
6
6
  withImmediateTransaction
7
- } from "./index-tnjmn0dn.js";
7
+ } from "./index-nzekzzs2.js";
8
8
 
9
9
  // src/db/coordination-store.ts
10
10
  import { createHash } from "crypto";
@@ -56,6 +56,23 @@ function readState(db, namespace, entityKey) {
56
56
  FROM coordination_state WHERE namespace = ? AND entity_key = ?`).get(namespace, entityKey) ?? null;
57
57
  return rowToState(row);
58
58
  }
59
+ function getCoordinationStateRaw(directory, namespace, entityKey) {
60
+ if (!projectDbExists(directory))
61
+ return null;
62
+ const row = getProjectDb(directory).query(`SELECT namespace, entity_key, revision, generation, status, payload, updated_at
63
+ FROM coordination_state WHERE namespace = ? AND entity_key = ?`).get(namespace, entityKey) ?? null;
64
+ if (!row)
65
+ return null;
66
+ return {
67
+ namespace: row.namespace,
68
+ entityKey: row.entity_key,
69
+ revision: row.revision,
70
+ generation: row.generation,
71
+ status: row.status,
72
+ payload: row.payload,
73
+ updatedAt: row.updated_at
74
+ };
75
+ }
59
76
  function transactionHooks() {
60
77
  return {
61
78
  beforeBegin: (db) => _internals.coordinationFaultInjector?.("before_begin", db),
@@ -358,4 +375,4 @@ function derivePlanIdentityHash(plan) {
358
375
  return createHash2("sha256").update(JSON.stringify([plan.swarm, plan.title]), "utf8").digest("hex");
359
376
  }
360
377
 
361
- export { MAX_COORDINATION_STATE_LIST_ROWS, withCoordinationTransaction, getCoordinationState, listCoordinationStates, countCoordinationStates, deleteCoordinationState, deleteCoordinationStateWithinTransaction, transitionCoordinationStateWithinTransaction, transitionCoordinationState, getCoordinationLease, acquireCoordinationLease, releaseCoordinationLease, importCoordinationOnce, deleteCoordinationImports, derivePlanId, derivePlanIdentityHash };
378
+ export { MAX_COORDINATION_STATE_LIST_ROWS, getCoordinationStateRaw, withCoordinationTransaction, getCoordinationState, listCoordinationStates, countCoordinationStates, deleteCoordinationState, deleteCoordinationStateWithinTransaction, transitionCoordinationStateWithinTransaction, transitionCoordinationState, getCoordinationLease, acquireCoordinationLease, releaseCoordinationLease, importCoordinationOnce, deleteCoordinationImports, derivePlanId, derivePlanIdentityHash };
@@ -4,7 +4,7 @@ import {
4
4
  readShellAuditTail,
5
5
  redactPath,
6
6
  redactShellCommand
7
- } from "./index-qs8eth8h.js";
7
+ } from "./index-7zmbtxw1.js";
8
8
 
9
9
  // src/services/guardrail-log-service.ts
10
10
  var BLOCK_TYPES = new Set([
@@ -2,13 +2,13 @@
2
2
  import {
3
3
  derivePlanId,
4
4
  derivePlanIdentityHash
5
- } from "./index-w4yjy3vp.js";
5
+ } from "./index-a11ztzs5.js";
6
6
  import {
7
7
  DURABILITY_CLASSES,
8
8
  getProjectDb,
9
9
  projectDbExists,
10
10
  withImmediateTransaction
11
- } from "./index-tnjmn0dn.js";
11
+ } from "./index-nzekzzs2.js";
12
12
  import {
13
13
  init_logger,
14
14
  warn