opencode-swarm 7.173.1 → 7.175.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 (112) hide show
  1. package/.opencode/skills/swarm-pr-review/references/findings-persistence-contract.md +37 -0
  2. package/binaries/win32-arm64/swarm-sandbox-runner.exe +0 -0
  3. package/binaries/win32-x64/swarm-sandbox-runner.exe +0 -0
  4. package/dist/agents/critic.d.ts +44 -2
  5. package/dist/background/pending-delegations.d.ts +10 -0
  6. package/dist/background/pr-review-contract.d.ts +27 -0
  7. package/dist/background/stage-b-gates.d.ts +29 -0
  8. package/dist/background/status-artifact.d.ts +24 -1
  9. package/dist/cli/{coder-settlement-kxxmd9jt.js → coder-settlement-f2n9yp7a.js} +11 -11
  10. package/dist/cli/{config-doctor-nzcya5zr.js → config-doctor-zcyz614n.js} +2 -2
  11. package/dist/cli/{core-s9a9kmcc.js → core-jar8cmzf.js} +3 -3
  12. package/dist/cli/{curation-policy-tx4kb30e.js → curation-policy-e5p147bb.js} +5 -5
  13. package/dist/cli/{curator-jkp8558s.js → curator-3xfz7wdp.js} +36 -36
  14. package/dist/cli/{curator-drift-047n8fjw.js → curator-drift-x3tt8apf.js} +4 -4
  15. package/dist/cli/curator-llm-factory-rc7cqtx8.js +72 -0
  16. package/dist/cli/{evidence-summary-service-ek50h5b3.js → evidence-summary-service-bpe04ngj.js} +15 -15
  17. package/dist/cli/{gate-evidence-8dk50ten.js → gate-evidence-pyzzafp3.js} +6 -6
  18. package/dist/cli/guardrail-explain-ncrw7k8h.js +73 -0
  19. package/dist/cli/{guardrail-log-hq5xpm7g.js → guardrail-log-nn2t8xyd.js} +7 -7
  20. package/dist/cli/{guardrail-reset-gttz1y0h.js → guardrail-reset-3c3c7e5e.js} +36 -36
  21. package/dist/cli/{hive-promoter-44p7ng87.js → hive-promoter-xfbabpnm.js} +36 -36
  22. package/dist/cli/{index-53c0ajk4.js → index-20q20gpd.js} +1 -1
  23. package/dist/cli/{index-m51cmzxt.js → index-2dv07mw2.js} +1 -1
  24. package/dist/cli/{index-fnx0jzf7.js → index-2xwavnbg.js} +1 -1
  25. package/dist/cli/{index-62pcs7jg.js → index-4rm5saxs.js} +3 -3
  26. package/dist/cli/{index-za1kvsa0.js → index-5t71wd7j.js} +2 -2
  27. package/dist/cli/{index-dktpzjy9.js → index-6tbnev6y.js} +1 -1
  28. package/dist/cli/{index-1xfxzjq9.js → index-6yqszgky.js} +2 -2
  29. package/dist/cli/{index-pynk60z5.js → index-8bbhh3kx.js} +8 -8
  30. package/dist/cli/{index-bsnpv4xd.js → index-8tn4yx8b.js} +2 -2
  31. package/dist/cli/{index-mt8pbzda.js → index-96hz14wr.js} +12 -12
  32. package/dist/cli/{index-z35ynvj4.js → index-98r0bh1c.js} +1 -1
  33. package/dist/cli/{index-psb9rxt8.js → index-9gpe25nr.js} +5 -5
  34. package/dist/cli/{index-wf3s2t1t.js → index-ar3ve24w.js} +3005 -2328
  35. package/dist/cli/{index-dx9pz5n6.js → index-bmk77mpq.js} +7 -7
  36. package/dist/cli/{index-ndvgkxpf.js → index-c60t3sw6.js} +2 -2
  37. package/dist/cli/{index-43dmpa9w.js → index-cpgh76bk.js} +2 -2
  38. package/dist/cli/{index-evf5r7bk.js → index-czhbsgdh.js} +1 -1
  39. package/dist/cli/{index-j0vvq8se.js → index-d0wq7paf.js} +7 -7
  40. package/dist/cli/{index-cm0339fe.js → index-ddvva9fn.js} +4 -4
  41. package/dist/cli/{index-mjqjbq94.js → index-fzvh6trw.js} +11 -11
  42. package/dist/cli/{index-pjw95rxm.js → index-gtej1br8.js} +65 -10
  43. package/dist/cli/{index-c5nrcde1.js → index-hdwdapp6.js} +38 -38
  44. package/dist/cli/{index-m53v442a.js → index-hej0z0sm.js} +36 -36
  45. package/dist/cli/{index-r93ptj7j.js → index-hqmr21qx.js} +19 -1
  46. package/dist/cli/{index-18b9snn6.js → index-j1yd2gbz.js} +6 -6
  47. package/dist/cli/{index-kdyvk541.js → index-jgkva4r4.js} +2 -2
  48. package/dist/cli/{index-0dfhahxm.js → index-jj09bfnn.js} +2 -2
  49. package/dist/cli/{index-hhws1xkc.js → index-jn3m9s61.js} +1 -1
  50. package/dist/cli/{index-wr4m11x4.js → index-kj7h2yfv.js} +1 -1
  51. package/dist/cli/{index-6z404f7y.js → index-m6bsy0jb.js} +4 -4
  52. package/dist/cli/{index-90qbc4rp.js → index-mat5rawf.js} +11 -3
  53. package/dist/cli/{index-samx6zgc.js → index-n5jac8z9.js} +1 -1
  54. package/dist/cli/{index-r8g2meas.js → index-nr96hbpy.js} +5 -3
  55. package/dist/cli/{index-yeehyat1.js → index-ppb5krpy.js} +2 -2
  56. package/dist/cli/{index-jmn35na4.js → index-qz6ee73z.js} +3 -3
  57. package/dist/cli/{index-7gkdxs00.js → index-tr9jz898.js} +7 -7
  58. package/dist/cli/{index-yzwb6ja4.js → index-vqjkr1kd.js} +1 -1
  59. package/dist/cli/{index-p36b6t7w.js → index-vt9a5rbg.js} +16 -9
  60. package/dist/cli/{index-vwnd2szd.js → index-yk3es7m2.js} +22 -13
  61. package/dist/cli/{index-gwtb07gc.js → index-zpygn1tn.js} +3 -3
  62. package/dist/cli/{index-gwz9p53s.js → index-zz40vfbz.js} +2 -2
  63. package/dist/cli/index.js +37 -37
  64. package/dist/cli/{knowledge-escalator-ttp4x29h.js → knowledge-escalator-2zjpwg0q.js} +12 -12
  65. package/dist/cli/{knowledge-events-dx9mjgqb.js → knowledge-events-gp2ckzqm.js} +10 -10
  66. package/dist/cli/{knowledge-link-f7bhq7cx.js → knowledge-link-s77cyqxk.js} +4 -4
  67. package/dist/cli/{knowledge-store-6sq9rxma.js → knowledge-store-kd88k067.js} +5 -5
  68. package/dist/cli/{knowledge-validator-h49dkw2z.js → knowledge-validator-22t16mba.js} +7 -7
  69. package/dist/cli/{mcp-kd7w2572.js → mcp-1fjc89yp.js} +1 -1
  70. package/dist/cli/{pending-delegations-n4qyymj2.js → pending-delegations-k4hfqz12.js} +11 -11
  71. package/dist/cli/{pr-subscriptions-n8vkm5mv.js → pr-subscriptions-8g6w41vz.js} +11 -11
  72. package/dist/cli/{pr-workflow-gate-j67jhtzt.js → pr-workflow-gate-kb3e709n.js} +42 -36
  73. package/dist/cli/{runner-58k70bnr.js → runner-nzppg2ky.js} +5 -5
  74. package/dist/cli/{scan-cursor-sz8ncpw2.js → scan-cursor-erm49azh.js} +6 -6
  75. package/dist/cli/{schema-70c0yw8p.js → schema-kts10txe.js} +5 -1
  76. package/dist/cli/{scope-persistence-0dzyv0vt.js → scope-persistence-krnvsmsz.js} +14 -14
  77. package/dist/cli/{server-njmemwbm.js → server-9bqh036q.js} +36 -36
  78. package/dist/cli/{skill-generator-kf5yqmvk.js → skill-generator-7q75h2kr.js} +14 -14
  79. package/dist/cli/{snapshot-coordination-init-ezf5xqy2.js → snapshot-coordination-init-bw9mn21x.js} +36 -36
  80. package/dist/cli/{telemetry-zed80n86.js → telemetry-7bk8ps5p.js} +1 -1
  81. package/dist/cli/{workspace-snapshot-62be4368.js → workspace-snapshot-6aw002e8.js} +3 -3
  82. package/dist/cli/{worktree-collision-ownership-fe176vyv.js → worktree-collision-ownership-ajagwzh8.js} +12 -12
  83. package/dist/cli/{worktree-isolation-c0b1h3f1.js → worktree-isolation-rmqp04fx.js} +36 -36
  84. package/dist/commands/registry.d.ts +1 -1
  85. package/dist/config/index.d.ts +2 -2
  86. package/dist/config/schema.d.ts +22 -8
  87. package/dist/events/core-events.d.ts +2 -0
  88. package/dist/evidence/task-gate-requirements.d.ts +24 -0
  89. package/dist/gate-evidence.d.ts +12 -0
  90. package/dist/hooks/pr-workflow-gate.d.ts +28 -0
  91. package/dist/index.d.ts +8 -0
  92. package/dist/index.js +501 -488
  93. package/dist/parallel/review-router.d.ts +8 -2
  94. package/dist/pr-review/completion.d.ts +2 -1
  95. package/dist/pr-review/finding-policy.d.ts +194 -0
  96. package/dist/pr-review/types.d.ts +8 -0
  97. package/dist/review/routing-enforcement.d.ts +163 -0
  98. package/dist/session/snapshot-writer.d.ts +2 -0
  99. package/dist/state.d.ts +28 -0
  100. package/dist/tools/complete-pr-workflow.d.ts +2 -1
  101. package/dist/tools/dispatch-lanes.d.ts +29 -0
  102. package/dist/tools/tool-metadata.d.ts +16 -16
  103. package/dist/tools/update-task-status.d.ts +0 -10
  104. package/dist/tools/write-pr-review-artifact.d.ts +7 -0
  105. package/dist/workflow/coder-settlement.d.ts +7 -0
  106. package/dist/workflow/recovery-invocation.d.ts +35 -0
  107. package/dist/workflow/stage-a-repair.d.ts +17 -0
  108. package/dist/workflow/task-recovery-status.d.ts +61 -0
  109. package/opencode-swarm.schema.json +11 -0
  110. package/package.json +2 -1
  111. package/dist/cli/curator-llm-factory-dza1qtwr.js +0 -72
  112. package/dist/cli/guardrail-explain-s29vngen.js +0 -73
@@ -1,10 +1,10 @@
1
1
  // @bun
2
2
  import {
3
3
  computePlanStructureHash
4
- } from "./index-18b9snn6.js";
4
+ } from "./index-j1yd2gbz.js";
5
5
  import {
6
6
  appendCoreEventSync
7
- } from "./index-mt8pbzda.js";
7
+ } from "./index-96hz14wr.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-fnx0jzf7.js";
16
+ } from "./index-2xwavnbg.js";
17
17
  import {
18
18
  getProjectDb
19
- } from "./index-dktpzjy9.js";
19
+ } from "./index-6tbnev6y.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-kdyvk541.js";
26
+ } from "./index-jgkva4r4.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-bsnpv4xd.js";
33
+ } from "./index-8tn4yx8b.js";
34
34
  import {
35
35
  PlanSchema
36
- } from "./index-53c0ajk4.js";
36
+ } from "./index-20q20gpd.js";
37
37
  import {
38
38
  init_path_identity,
39
39
  unsafePathTextReason
@@ -1,13 +1,13 @@
1
1
  // @bun
2
2
  import {
3
3
  validateSwarmPath
4
- } from "./index-evf5r7bk.js";
4
+ } from "./index-czhbsgdh.js";
5
5
  import {
6
6
  bunSpawn
7
7
  } from "./index-2s7dvzff.js";
8
8
  import {
9
9
  atomicWriteSwarmFile
10
- } from "./index-bsnpv4xd.js";
10
+ } from "./index-8tn4yx8b.js";
11
11
  import {
12
12
  canonicalRootKey,
13
13
  sameProjectRoot
@@ -3,10 +3,10 @@ import {
3
3
  pseudonymousRef,
4
4
  resolveLineageSalt,
5
5
  telemetry
6
- } from "./index-jmn35na4.js";
6
+ } from "./index-qz6ee73z.js";
7
7
  import {
8
8
  atomicWriteSwarmFile
9
- } from "./index-bsnpv4xd.js";
9
+ } from "./index-8tn4yx8b.js";
10
10
  import {
11
11
  canonicalRootKeyFresh
12
12
  } from "./index-1xnse449.js";
@@ -7,7 +7,7 @@ import {
7
7
  readCachedTextFile,
8
8
  wasObservedToExist,
9
9
  wasRecentlyWrittenByThisProcess
10
- } from "./index-bsnpv4xd.js";
10
+ } from "./index-8tn4yx8b.js";
11
11
  import {
12
12
  SwarmError
13
13
  } from "./index-c1ggtmpm.js";
@@ -11,16 +11,16 @@ import {
11
11
  } from "./index-ae75rja9.js";
12
12
  import {
13
13
  resolveKnowledgeStoreDir
14
- } from "./index-yzwb6ja4.js";
14
+ } from "./index-vqjkr1kd.js";
15
15
  import {
16
16
  atomicWriteFile
17
- } from "./index-kdyvk541.js";
17
+ } from "./index-jgkva4r4.js";
18
18
  import {
19
19
  require_proper_lockfile
20
20
  } from "./index-7g4c7s5r.js";
21
21
  import {
22
22
  readCachedParsedFile
23
- } from "./index-bsnpv4xd.js";
23
+ } from "./index-8tn4yx8b.js";
24
24
  import {
25
25
  init_knowledge_types,
26
26
  isActiveStatus
@@ -739,7 +739,7 @@ async function applyConfidenceFloorAction(directory, touched, options) {
739
739
  const {
740
740
  readAuthoritativeKnowledgeCounterRollups,
741
741
  effectiveRetrievalOutcomes
742
- } = await import("./knowledge-events-dx9mjgqb.js");
742
+ } = await import("./knowledge-events-gp2ckzqm.js");
743
743
  const rollups = await readAuthoritativeKnowledgeCounterRollups(directory);
744
744
  const flagIds = new Set;
745
745
  for (const e of atFloor) {
@@ -806,11 +806,11 @@ async function applyConfidenceFloorAction(directory, touched, options) {
806
806
  });
807
807
  }
808
808
  if (action === "quarantine" && toQuarantine.length > 0) {
809
- const { quarantineEntry } = await import("./knowledge-validator-h49dkw2z.js");
810
- const { KnowledgeConfigSchema } = await import("./schema-70c0yw8p.js");
809
+ const { quarantineEntry } = await import("./knowledge-validator-22t16mba.js");
810
+ const { KnowledgeConfigSchema } = await import("./schema-kts10txe.js");
811
811
  let config;
812
812
  try {
813
- const { loadPluginConfigWithMeta } = await import("./index-r8g2meas.js");
813
+ const { loadPluginConfigWithMeta } = await import("./index-nr96hbpy.js");
814
814
  const { config: loadedConfig } = loadPluginConfigWithMeta(directory);
815
815
  config = KnowledgeConfigSchema.parse(loadedConfig.knowledge ?? {});
816
816
  } catch {
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  import {
3
3
  authorizeCuration
4
- } from "./index-m51cmzxt.js";
4
+ } from "./index-2dv07mw2.js";
5
5
  import {
6
6
  findNearDuplicate,
7
7
  inferTags,
@@ -9,13 +9,13 @@ import {
9
9
  resolveSwarmKnowledgePath,
10
10
  resolveSwarmRejectedPath,
11
11
  transactKnowledge
12
- } from "./index-j0vvq8se.js";
12
+ } from "./index-d0wq7paf.js";
13
13
  import {
14
14
  resolveKnowledgeStoreDir
15
- } from "./index-yzwb6ja4.js";
15
+ } from "./index-vqjkr1kd.js";
16
16
  import {
17
17
  atomicWriteFile
18
- } from "./index-kdyvk541.js";
18
+ } from "./index-jgkva4r4.js";
19
19
  import {
20
20
  require_proper_lockfile
21
21
  } from "./index-7g4c7s5r.js";
@@ -3,7 +3,7 @@ import {
3
3
  EvaluationRunV1Schema,
4
4
  GateAuditResultV1Schema,
5
5
  getProtectedEvaluationRunIds
6
- } from "./index-z35ynvj4.js";
6
+ } from "./index-98r0bh1c.js";
7
7
  import {
8
8
  readEffectiveSpecSync
9
9
  } from "./index-z2deqhpp.js";
@@ -23,13 +23,13 @@ import {
23
23
  readTaskEvidence,
24
24
  readTaskEvidenceRaw,
25
25
  sanitizeTaskId
26
- } from "./index-pjw95rxm.js";
26
+ } from "./index-gtej1br8.js";
27
27
  import {
28
28
  estimateCharsForTokens,
29
29
  estimateTokens,
30
30
  readSwarmFileAsync,
31
31
  validateSwarmPath
32
- } from "./index-evf5r7bk.js";
32
+ } from "./index-czhbsgdh.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-18b9snn6.js";
61
+ } from "./index-j1yd2gbz.js";
62
62
  import {
63
63
  appendCoreEventSync
64
- } from "./index-mt8pbzda.js";
64
+ } from "./index-96hz14wr.js";
65
65
  import {
66
66
  derivePlanId,
67
67
  derivePlanIdentityHash,
@@ -69,32 +69,32 @@ import {
69
69
  importCoordinationOnce,
70
70
  listCoordinationStates,
71
71
  transitionCoordinationState
72
- } from "./index-fnx0jzf7.js";
72
+ } from "./index-2xwavnbg.js";
73
73
  import {
74
74
  DURABILITY_CLASSES,
75
75
  getProjectDb,
76
76
  projectDbExists,
77
77
  withDurabilityClass
78
- } from "./index-dktpzjy9.js";
78
+ } from "./index-6tbnev6y.js";
79
79
  import {
80
80
  assertProjectRoot,
81
81
  tryAcquireLock,
82
82
  withEvidenceLock
83
- } from "./index-kdyvk541.js";
83
+ } from "./index-jgkva4r4.js";
84
84
  import {
85
85
  emit
86
- } from "./index-jmn35na4.js";
86
+ } from "./index-qz6ee73z.js";
87
87
  import {
88
88
  atomicWriteSwarmFileSync,
89
89
  invalidateCachedArtifact,
90
90
  readCachedParsedFile
91
- } from "./index-bsnpv4xd.js";
91
+ } from "./index-8tn4yx8b.js";
92
92
  import {
93
93
  canonicalRootKeyFresh
94
94
  } from "./index-1xnse449.js";
95
95
  import {
96
96
  PlanSchema
97
- } from "./index-53c0ajk4.js";
97
+ } from "./index-20q20gpd.js";
98
98
  import {
99
99
  GIT_BINARY_ENV_VAR,
100
100
  describeGitResolution,
@@ -2,10 +2,10 @@
2
2
  import {
3
3
  autoCommitDirty,
4
4
  cleanUntrackedFiles
5
- } from "./index-gwtb07gc.js";
5
+ } from "./index-zpygn1tn.js";
6
6
  import {
7
7
  validateSwarmPath
8
- } from "./index-evf5r7bk.js";
8
+ } from "./index-czhbsgdh.js";
9
9
  import {
10
10
  bunSpawn,
11
11
  classifySpawnFailure
@@ -15,10 +15,10 @@ import {
15
15
  atomicWriteFile,
16
16
  taskEvidencePath,
17
17
  withTaskEvidenceLock
18
- } from "./index-kdyvk541.js";
18
+ } from "./index-jgkva4r4.js";
19
19
  import {
20
20
  telemetry
21
- } from "./index-jmn35na4.js";
21
+ } from "./index-qz6ee73z.js";
22
22
  import {
23
23
  init_git_executable,
24
24
  resolveGitExecutable
@@ -61,6 +61,16 @@ var TaskGateRequirementsReceiptSchema = exports_external.object({
61
61
  sourceEvent: exports_external.string().min(1).max(120),
62
62
  sourceTransitionId: exports_external.string().min(1).max(200).nullable(),
63
63
  recordedAt: exports_external.string().min(1).max(128),
64
+ routeBinding: exports_external.object({
65
+ role: exports_external.enum(["reviewer", "test_engineer"]),
66
+ identity: exports_external.string().trim().min(1).max(256),
67
+ sessionId: exports_external.string().trim().min(1).max(256),
68
+ taskId: exports_external.string().trim().min(1).max(120),
69
+ slotId: exports_external.string().trim().min(1).max(256),
70
+ callId: exports_external.string().trim().min(1).max(256),
71
+ childSessionId: exports_external.string().trim().min(1).max(256),
72
+ generation: exports_external.number().int().nonnegative()
73
+ }).strict().optional(),
64
74
  previousChainHash: exports_external.string().regex(/^[a-f0-9]{64}$/).nullable(),
65
75
  chainHash: exports_external.string().regex(/^[a-f0-9]{64}$/)
66
76
  }).strict();
@@ -116,14 +126,42 @@ function sha256(value) {
116
126
  return createHash("sha256").update(value).digest("hex");
117
127
  }
118
128
  function canonicalReceiptPayload(receipt) {
129
+ const routeBinding = receipt.routeBinding ? {
130
+ role: receipt.routeBinding.role,
131
+ identity: receipt.routeBinding.identity,
132
+ sessionId: receipt.routeBinding.sessionId,
133
+ taskId: receipt.routeBinding.taskId,
134
+ slotId: receipt.routeBinding.slotId,
135
+ callId: receipt.routeBinding.callId,
136
+ childSessionId: receipt.routeBinding.childSessionId,
137
+ generation: receipt.routeBinding.generation
138
+ } : undefined;
119
139
  return JSON.stringify({
120
- ...receipt,
121
- requiredGates: [...receipt.requiredGates]
140
+ schemaVersion: receipt.schemaVersion,
141
+ taskId: receipt.taskId,
142
+ generation: receipt.generation,
143
+ normalizedRole: receipt.normalizedRole,
144
+ testEngineerExempt: receipt.testEngineerExempt,
145
+ requiredGates: [...receipt.requiredGates],
146
+ sourceEvent: receipt.sourceEvent,
147
+ sourceTransitionId: receipt.sourceTransitionId,
148
+ recordedAt: receipt.recordedAt,
149
+ ...routeBinding ? { routeBinding } : {},
150
+ previousChainHash: receipt.previousChainHash
122
151
  });
123
152
  }
124
153
  function computeChainHash(receipt) {
125
154
  return sha256(canonicalReceiptPayload(receipt));
126
155
  }
156
+ function routeBindingFromEvent(event) {
157
+ if (event.type !== "stage_b_completed" || !event.routeBinding)
158
+ return;
159
+ const binding = event.routeBinding;
160
+ if (binding.role !== event.gate || !binding.sessionId || !binding.taskId || !binding.slotId || !binding.callId || !binding.childSessionId || typeof binding.generation !== "number") {
161
+ return;
162
+ }
163
+ return binding;
164
+ }
127
165
  function readBoundedTextFile(filePath) {
128
166
  let pathStat;
129
167
  try {
@@ -164,7 +202,7 @@ async function readTaskGateRequirementsReceipts(directory, taskId) {
164
202
  if (!line.trim())
165
203
  continue;
166
204
  const parsed = TaskGateRequirementsReceiptSchema.parse(JSON.parse(line));
167
- if (parsed.taskId !== taskId) {
205
+ if (parsed.taskId !== taskId || parsed.routeBinding !== undefined && parsed.routeBinding.taskId !== taskId) {
168
206
  throw new Error(`TASK_GATE_REQUIREMENTS_IDENTITY_MISMATCH: expected ${taskId}, found ${parsed.taskId}`);
169
207
  }
170
208
  const { chainHash, ...withoutChainHash } = parsed;
@@ -219,8 +257,13 @@ function shouldAppendReceipt(current, next, role) {
219
257
  }
220
258
  async function appendTaskGateRequirementsReceiptIfNeeded(directory, taskId, current, next, event) {
221
259
  const role = deriveReceiptRole(event);
222
- if (!role || !shouldAppendReceipt(current, next, role))
260
+ const routeBinding = routeBindingFromEvent(event);
261
+ if (routeBinding && routeBinding.taskId !== taskId) {
262
+ throw new Error(`TASK_GATE_REQUIREMENTS_ROUTE_IDENTITY_MISMATCH: expected ${taskId}, found ${routeBinding.taskId}`);
263
+ }
264
+ if (!role || !shouldAppendReceipt(current, next, role) && !routeBinding) {
223
265
  return;
266
+ }
224
267
  const filePath = safeTaskGateRequirementsReceiptPath(directory, taskId, true);
225
268
  const receipts = await readTaskGateRequirementsReceipts(directory, taskId);
226
269
  const latest = receipts.at(-1);
@@ -234,13 +277,14 @@ async function appendTaskGateRequirementsReceiptIfNeeded(directory, taskId, curr
234
277
  sourceEvent: event.type,
235
278
  sourceTransitionId: event.transitionId ?? null,
236
279
  recordedAt: new Date().toISOString(),
237
- previousChainHash: latest?.chainHash ?? null
280
+ previousChainHash: latest?.chainHash ?? null,
281
+ ...routeBinding ? { routeBinding } : {}
238
282
  };
239
283
  const receipt = {
240
284
  ...baseReceipt,
241
285
  chainHash: computeChainHash(baseReceipt)
242
286
  };
243
- if (latest && latest.generation === receipt.generation && latest.normalizedRole === receipt.normalizedRole && latest.testEngineerExempt === receipt.testEngineerExempt && JSON.stringify(latest.requiredGates) === JSON.stringify(receipt.requiredGates) && latest.sourceTransitionId === receipt.sourceTransitionId) {
287
+ if (latest && latest.generation === receipt.generation && latest.normalizedRole === receipt.normalizedRole && latest.testEngineerExempt === receipt.testEngineerExempt && JSON.stringify(latest.requiredGates) === JSON.stringify(receipt.requiredGates) && latest.sourceTransitionId === receipt.sourceTransitionId && JSON.stringify(latest.routeBinding ?? null) === JSON.stringify(receipt.routeBinding ?? null)) {
244
288
  return;
245
289
  }
246
290
  const lines = [...receipts, receipt].map((entry) => JSON.stringify(entry));
@@ -1954,6 +1998,15 @@ function reduceTaskWorkflowSnapshot(current, event, context) {
1954
1998
  if (current.state !== "pre_check_passed" && current.state !== "reviewer_run" && current.state !== "tests_run") {
1955
1999
  throw new Error(`TASK_WORKFLOW_STAGE_A_REQUIRED: cannot record ${event.gate} from ${current.state}`);
1956
2000
  }
2001
+ if (event.routeComplete === false) {
2002
+ return {
2003
+ ...base,
2004
+ state: event.gate === "reviewer" || current.state === "reviewer_run" ? "reviewer_run" : current.state
2005
+ };
2006
+ }
2007
+ if (event.routeComplete === true) {
2008
+ return { ...base, state: "tests_run" };
2009
+ }
1957
2010
  return {
1958
2011
  ...base,
1959
2012
  state: hasAllRequiredGatesPassed(context.requiredGates, context.gates) ? "tests_run" : "reviewer_run"
@@ -2182,6 +2235,8 @@ async function recordGateEvidence(directory, taskId, gate, sessionId, turbo, opt
2182
2235
  type: "stage_b_completed",
2183
2236
  gate,
2184
2237
  sessionId,
2238
+ routeBinding: options.routeBinding,
2239
+ routeComplete: options.routeComplete,
2185
2240
  turbo,
2186
2241
  ensureDefaultStageB: options.ensureDefaultStageB,
2187
2242
  expectedGeneration: options.expectedGeneration,
@@ -1,10 +1,10 @@
1
1
  // @bun
2
2
  import {
3
3
  handleGuardrailExplain
4
- } from "./index-yeehyat1.js";
4
+ } from "./index-ppb5krpy.js";
5
5
  import {
6
6
  handleGuardrailLog
7
- } from "./index-samx6zgc.js";
7
+ } from "./index-n5jac8z9.js";
8
8
  import {
9
9
  COMMAND_REGISTRY,
10
10
  DEFAULT_CI_DEADLINE_MS,
@@ -97,67 +97,67 @@ import {
97
97
  handleWriteRetroCommand,
98
98
  normalizeSwarmCommandInput,
99
99
  resolveCommand
100
- } from "./index-wf3s2t1t.js";
100
+ } from "./index-ar3ve24w.js";
101
101
  import"./index-hnvmj9wx.js";
102
- import"./index-hhws1xkc.js";
103
- import"./index-62pcs7jg.js";
104
- import"./index-wr4m11x4.js";
105
- import"./index-r93ptj7j.js";
106
- import"./index-mjqjbq94.js";
107
- import"./index-z35ynvj4.js";
102
+ import"./index-jn3m9s61.js";
103
+ import"./index-4rm5saxs.js";
104
+ import"./index-kj7h2yfv.js";
105
+ import"./index-hqmr21qx.js";
106
+ import"./index-fzvh6trw.js";
107
+ import"./index-98r0bh1c.js";
108
108
  import"./index-txdagbh7.js";
109
109
  import"./index-z2deqhpp.js";
110
110
  import"./index-fpbcxykc.js";
111
- import"./index-6z404f7y.js";
112
- import"./index-psb9rxt8.js";
113
- import"./index-1xfxzjq9.js";
111
+ import"./index-m6bsy0jb.js";
112
+ import"./index-9gpe25nr.js";
113
+ import"./index-6yqszgky.js";
114
114
  import"./index-fyfbpz4f.js";
115
- import"./index-7gkdxs00.js";
115
+ import"./index-tr9jz898.js";
116
116
  import"./index-0hgmsyfp.js";
117
117
  import"./index-zsrtt42s.js";
118
- import"./index-p36b6t7w.js";
119
- import"./index-ndvgkxpf.js";
120
- import"./index-0dfhahxm.js";
118
+ import"./index-vt9a5rbg.js";
119
+ import"./index-c60t3sw6.js";
120
+ import"./index-jj09bfnn.js";
121
121
  import"./index-pt7h91zc.js";
122
122
  import"./index-q7sjgr1y.js";
123
- import"./index-pjw95rxm.js";
124
- import"./index-gwtb07gc.js";
125
- import"./index-vwnd2szd.js";
126
- import"./index-pynk60z5.js";
127
- import"./index-evf5r7bk.js";
123
+ import"./index-gtej1br8.js";
124
+ import"./index-zpygn1tn.js";
125
+ import"./index-yk3es7m2.js";
126
+ import"./index-8bbhh3kx.js";
127
+ import"./index-czhbsgdh.js";
128
128
  import"./index-2s7dvzff.js";
129
- import"./index-cm0339fe.js";
130
- import"./index-m51cmzxt.js";
129
+ import"./index-ddvva9fn.js";
130
+ import"./index-2dv07mw2.js";
131
131
  import"./index-rtry5xyf.js";
132
- import"./index-gwz9p53s.js";
132
+ import"./index-zz40vfbz.js";
133
133
  import"./index-frcemc0b.js";
134
134
  import"./index-wrt875kh.js";
135
- import"./index-dx9pz5n6.js";
136
- import"./index-18b9snn6.js";
137
- import"./index-mt8pbzda.js";
138
- import"./index-za1kvsa0.js";
139
- import"./index-fnx0jzf7.js";
140
- import"./index-dktpzjy9.js";
135
+ import"./index-bmk77mpq.js";
136
+ import"./index-j1yd2gbz.js";
137
+ import"./index-96hz14wr.js";
138
+ import"./index-5t71wd7j.js";
139
+ import"./index-2xwavnbg.js";
140
+ import"./index-6tbnev6y.js";
141
141
  import"./index-rdm3px0g.js";
142
142
  import"./index-ry16d01s.js";
143
- import"./index-43dmpa9w.js";
144
- import"./index-j0vvq8se.js";
143
+ import"./index-cpgh76bk.js";
144
+ import"./index-d0wq7paf.js";
145
145
  import"./index-vzm6zre7.js";
146
146
  import"./index-ae75rja9.js";
147
- import"./index-yzwb6ja4.js";
148
- import"./index-kdyvk541.js";
147
+ import"./index-vqjkr1kd.js";
148
+ import"./index-jgkva4r4.js";
149
149
  import"./index-7g4c7s5r.js";
150
- import"./index-jmn35na4.js";
151
- import"./index-bsnpv4xd.js";
150
+ import"./index-qz6ee73z.js";
151
+ import"./index-8tn4yx8b.js";
152
152
  import"./index-1xnse449.js";
153
153
  import"./index-c1ggtmpm.js";
154
- import"./index-53c0ajk4.js";
154
+ import"./index-20q20gpd.js";
155
155
  import"./index-0mhftbpp.js";
156
156
  import"./index-a1w58b47.js";
157
157
  import {
158
158
  init_schema,
159
159
  stripKnownSwarmPrefix
160
- } from "./index-90qbc4rp.js";
160
+ } from "./index-mat5rawf.js";
161
161
  import {
162
162
  AGENT_TOOL_MAP,
163
163
  ORCHESTRATOR_NAME,
@@ -22,66 +22,66 @@ import {
22
22
  resolveFallbackModel,
23
23
  resolvePrimaryAgentNames,
24
24
  stripSwarmPrefix
25
- } from "./index-wf3s2t1t.js";
25
+ } from "./index-ar3ve24w.js";
26
26
  import"./index-hnvmj9wx.js";
27
- import"./index-hhws1xkc.js";
28
- import"./index-62pcs7jg.js";
29
- import"./index-wr4m11x4.js";
30
- import"./index-r93ptj7j.js";
31
- import"./index-mjqjbq94.js";
32
- import"./index-z35ynvj4.js";
27
+ import"./index-jn3m9s61.js";
28
+ import"./index-4rm5saxs.js";
29
+ import"./index-kj7h2yfv.js";
30
+ import"./index-hqmr21qx.js";
31
+ import"./index-fzvh6trw.js";
32
+ import"./index-98r0bh1c.js";
33
33
  import"./index-txdagbh7.js";
34
34
  import"./index-z2deqhpp.js";
35
35
  import"./index-fpbcxykc.js";
36
- import"./index-6z404f7y.js";
37
- import"./index-psb9rxt8.js";
38
- import"./index-1xfxzjq9.js";
36
+ import"./index-m6bsy0jb.js";
37
+ import"./index-9gpe25nr.js";
38
+ import"./index-6yqszgky.js";
39
39
  import {
40
40
  createExplorerAgent
41
41
  } from "./index-fyfbpz4f.js";
42
- import"./index-7gkdxs00.js";
42
+ import"./index-tr9jz898.js";
43
43
  import"./index-0hgmsyfp.js";
44
44
  import"./index-zsrtt42s.js";
45
- import"./index-p36b6t7w.js";
46
- import"./index-ndvgkxpf.js";
47
- import"./index-0dfhahxm.js";
45
+ import"./index-vt9a5rbg.js";
46
+ import"./index-c60t3sw6.js";
47
+ import"./index-jj09bfnn.js";
48
48
  import"./index-pt7h91zc.js";
49
49
  import"./index-q7sjgr1y.js";
50
- import"./index-pjw95rxm.js";
51
- import"./index-gwtb07gc.js";
52
- import"./index-vwnd2szd.js";
53
- import"./index-pynk60z5.js";
54
- import"./index-evf5r7bk.js";
50
+ import"./index-gtej1br8.js";
51
+ import"./index-zpygn1tn.js";
52
+ import"./index-yk3es7m2.js";
53
+ import"./index-8bbhh3kx.js";
54
+ import"./index-czhbsgdh.js";
55
55
  import"./index-2s7dvzff.js";
56
- import"./index-cm0339fe.js";
57
- import"./index-m51cmzxt.js";
56
+ import"./index-ddvva9fn.js";
57
+ import"./index-2dv07mw2.js";
58
58
  import"./index-rtry5xyf.js";
59
- import"./index-gwz9p53s.js";
59
+ import"./index-zz40vfbz.js";
60
60
  import"./index-frcemc0b.js";
61
61
  import"./index-wrt875kh.js";
62
- import"./index-dx9pz5n6.js";
63
- import"./index-18b9snn6.js";
64
- import"./index-mt8pbzda.js";
65
- import"./index-za1kvsa0.js";
66
- import"./index-fnx0jzf7.js";
67
- import"./index-dktpzjy9.js";
62
+ import"./index-bmk77mpq.js";
63
+ import"./index-j1yd2gbz.js";
64
+ import"./index-96hz14wr.js";
65
+ import"./index-5t71wd7j.js";
66
+ import"./index-2xwavnbg.js";
67
+ import"./index-6tbnev6y.js";
68
68
  import"./index-rdm3px0g.js";
69
69
  import"./index-ry16d01s.js";
70
- import"./index-43dmpa9w.js";
71
- import"./index-j0vvq8se.js";
70
+ import"./index-cpgh76bk.js";
71
+ import"./index-d0wq7paf.js";
72
72
  import"./index-vzm6zre7.js";
73
73
  import"./index-ae75rja9.js";
74
- import"./index-yzwb6ja4.js";
75
- import"./index-kdyvk541.js";
74
+ import"./index-vqjkr1kd.js";
75
+ import"./index-jgkva4r4.js";
76
76
  import"./index-7g4c7s5r.js";
77
- import"./index-jmn35na4.js";
78
- import"./index-bsnpv4xd.js";
77
+ import"./index-qz6ee73z.js";
78
+ import"./index-8tn4yx8b.js";
79
79
  import"./index-1xnse449.js";
80
80
  import"./index-c1ggtmpm.js";
81
- import"./index-53c0ajk4.js";
81
+ import"./index-20q20gpd.js";
82
82
  import"./index-0mhftbpp.js";
83
83
  import"./index-a1w58b47.js";
84
- import"./index-90qbc4rp.js";
84
+ import"./index-mat5rawf.js";
85
85
  import"./index-5frh43fj.js";
86
86
  import"./index-bk5tah7q.js";
87
87
  import"./index-gknz3bv1.js";
@@ -12,7 +12,7 @@ import {
12
12
  PluginConfigSchema,
13
13
  init_schema,
14
14
  stripKnownSwarmPrefix
15
- } from "./index-90qbc4rp.js";
15
+ } from "./index-mat5rawf.js";
16
16
  import {
17
17
  ALL_AGENT_NAMES,
18
18
  TOOL_NAME_SET,
@@ -1295,6 +1295,24 @@ function validateConfigKey(path2, value) {
1295
1295
  emitObjectTypeMismatch("pr_review_resilience", value, findings);
1296
1296
  break;
1297
1297
  }
1298
+ case "review_routing": {
1299
+ emitObjectTypeMismatch("review_routing", value, findings);
1300
+ if (isPlainObject(value)) {
1301
+ const enforceReceipts = value.enforce_receipts;
1302
+ if (enforceReceipts !== undefined && typeof enforceReceipts !== "boolean") {
1303
+ findings.push({
1304
+ id: "invalid-review_routing-enforce_receipts-type",
1305
+ title: "Invalid review_routing.enforce_receipts type",
1306
+ description: `"review_routing.enforce_receipts" must be a boolean, got ${typeof enforceReceipts}`,
1307
+ severity: "error",
1308
+ path: "review_routing.enforce_receipts",
1309
+ currentValue: enforceReceipts,
1310
+ autoFixable: false
1311
+ });
1312
+ }
1313
+ }
1314
+ break;
1315
+ }
1298
1316
  case "lane_liveness_watchdog": {
1299
1317
  emitObjectTypeMismatch("lane_liveness_watchdog", value, findings);
1300
1318
  break;