lorenz 0.1.4 → 0.1.6

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 (249) hide show
  1. package/README.md +83 -20
  2. package/RELEASE-MANIFEST.json +6 -1
  3. package/node_modules/@lorenz/agent-sdk/dist/index.d.ts +1 -0
  4. package/node_modules/@lorenz/agent-sdk/dist/index.d.ts.map +1 -1
  5. package/node_modules/@lorenz/agent-sdk/dist/index.js +1 -0
  6. package/node_modules/@lorenz/agent-sdk/dist/index.js.map +1 -1
  7. package/node_modules/@lorenz/agent-sdk/dist/module.d.ts +38 -0
  8. package/node_modules/@lorenz/agent-sdk/dist/module.d.ts.map +1 -0
  9. package/node_modules/@lorenz/agent-sdk/dist/module.js +41 -0
  10. package/node_modules/@lorenz/agent-sdk/dist/module.js.map +1 -0
  11. package/node_modules/@lorenz/cli/dist/agentExecutorLoader.d.ts +30 -0
  12. package/node_modules/@lorenz/cli/dist/agentExecutorLoader.d.ts.map +1 -0
  13. package/node_modules/@lorenz/cli/dist/agentExecutorLoader.js +63 -0
  14. package/node_modules/@lorenz/cli/dist/agentExecutorLoader.js.map +1 -0
  15. package/node_modules/@lorenz/cli/dist/daemon.d.ts +42 -19
  16. package/node_modules/@lorenz/cli/dist/daemon.d.ts.map +1 -1
  17. package/node_modules/@lorenz/cli/dist/daemon.js +72 -23
  18. package/node_modules/@lorenz/cli/dist/daemon.js.map +1 -1
  19. package/node_modules/@lorenz/cli/dist/daemonLock.d.ts +59 -0
  20. package/node_modules/@lorenz/cli/dist/daemonLock.d.ts.map +1 -0
  21. package/node_modules/@lorenz/cli/dist/daemonLock.js +304 -0
  22. package/node_modules/@lorenz/cli/dist/daemonLock.js.map +1 -0
  23. package/node_modules/@lorenz/cli/dist/daemonStatus.d.ts +16 -0
  24. package/node_modules/@lorenz/cli/dist/daemonStatus.d.ts.map +1 -0
  25. package/node_modules/@lorenz/cli/dist/daemonStatus.js +21 -0
  26. package/node_modules/@lorenz/cli/dist/daemonStatus.js.map +1 -0
  27. package/node_modules/@lorenz/cli/dist/doctor.d.ts +6 -0
  28. package/node_modules/@lorenz/cli/dist/doctor.d.ts.map +1 -1
  29. package/node_modules/@lorenz/cli/dist/doctor.js +39 -2
  30. package/node_modules/@lorenz/cli/dist/doctor.js.map +1 -1
  31. package/node_modules/@lorenz/cli/dist/extensionLoader.d.ts +126 -0
  32. package/node_modules/@lorenz/cli/dist/extensionLoader.d.ts.map +1 -0
  33. package/node_modules/@lorenz/cli/dist/extensionLoader.js +187 -0
  34. package/node_modules/@lorenz/cli/dist/extensionLoader.js.map +1 -0
  35. package/node_modules/@lorenz/cli/dist/flags-manifest.d.ts +42 -0
  36. package/node_modules/@lorenz/cli/dist/flags-manifest.d.ts.map +1 -0
  37. package/node_modules/@lorenz/cli/dist/flags-manifest.js +67 -0
  38. package/node_modules/@lorenz/cli/dist/flags-manifest.js.map +1 -0
  39. package/node_modules/@lorenz/cli/dist/index.d.ts +6 -0
  40. package/node_modules/@lorenz/cli/dist/index.d.ts.map +1 -1
  41. package/node_modules/@lorenz/cli/dist/index.js +4 -0
  42. package/node_modules/@lorenz/cli/dist/index.js.map +1 -1
  43. package/node_modules/@lorenz/cli/dist/leadershipStore.d.ts +42 -0
  44. package/node_modules/@lorenz/cli/dist/leadershipStore.d.ts.map +1 -0
  45. package/node_modules/@lorenz/cli/dist/leadershipStore.js +2 -0
  46. package/node_modules/@lorenz/cli/dist/leadershipStore.js.map +1 -0
  47. package/node_modules/@lorenz/cli/dist/main.d.ts +11 -7
  48. package/node_modules/@lorenz/cli/dist/main.d.ts.map +1 -1
  49. package/node_modules/@lorenz/cli/dist/main.js +58 -8
  50. package/node_modules/@lorenz/cli/dist/main.js.map +1 -1
  51. package/node_modules/@lorenz/cli/dist/toolLoader.d.ts +28 -0
  52. package/node_modules/@lorenz/cli/dist/toolLoader.d.ts.map +1 -0
  53. package/node_modules/@lorenz/cli/dist/toolLoader.js +62 -0
  54. package/node_modules/@lorenz/cli/dist/toolLoader.js.map +1 -0
  55. package/node_modules/@lorenz/cli/dist/trackerLoader.d.ts +24 -0
  56. package/node_modules/@lorenz/cli/dist/trackerLoader.d.ts.map +1 -0
  57. package/node_modules/@lorenz/cli/dist/trackerLoader.js +34 -0
  58. package/node_modules/@lorenz/cli/dist/trackerLoader.js.map +1 -0
  59. package/node_modules/@lorenz/cli/dist/workerDriverLoader.d.ts +15 -55
  60. package/node_modules/@lorenz/cli/dist/workerDriverLoader.d.ts.map +1 -1
  61. package/node_modules/@lorenz/cli/dist/workerDriverLoader.js +26 -203
  62. package/node_modules/@lorenz/cli/dist/workerDriverLoader.js.map +1 -1
  63. package/node_modules/@lorenz/cli/package.json +1 -0
  64. package/node_modules/@lorenz/config/dist/index.d.ts +1 -1
  65. package/node_modules/@lorenz/config/dist/index.d.ts.map +1 -1
  66. package/node_modules/@lorenz/config/dist/index.js +1 -1
  67. package/node_modules/@lorenz/config/dist/index.js.map +1 -1
  68. package/node_modules/@lorenz/config/dist/parse.d.ts +17 -0
  69. package/node_modules/@lorenz/config/dist/parse.d.ts.map +1 -1
  70. package/node_modules/@lorenz/config/dist/parse.js +107 -11
  71. package/node_modules/@lorenz/config/dist/parse.js.map +1 -1
  72. package/node_modules/@lorenz/config/dist/schemas.d.ts +0 -2
  73. package/node_modules/@lorenz/config/dist/schemas.d.ts.map +1 -1
  74. package/node_modules/@lorenz/config/dist/schemas.js +5 -1
  75. package/node_modules/@lorenz/config/dist/schemas.js.map +1 -1
  76. package/node_modules/@lorenz/dispatch-coordinator/dist/coordinator.d.ts +55 -21
  77. package/node_modules/@lorenz/dispatch-coordinator/dist/coordinator.d.ts.map +1 -1
  78. package/node_modules/@lorenz/dispatch-coordinator/dist/coordinator.js +187 -82
  79. package/node_modules/@lorenz/dispatch-coordinator/dist/coordinator.js.map +1 -1
  80. package/node_modules/@lorenz/dispatch-coordinator/dist/gate.d.ts +6 -4
  81. package/node_modules/@lorenz/dispatch-coordinator/dist/gate.d.ts.map +1 -1
  82. package/node_modules/@lorenz/dispatch-coordinator/dist/gate.js +9 -6
  83. package/node_modules/@lorenz/dispatch-coordinator/dist/gate.js.map +1 -1
  84. package/node_modules/@lorenz/dispatch-coordinator/dist/index.d.ts +1 -1
  85. package/node_modules/@lorenz/dispatch-coordinator/dist/index.d.ts.map +1 -1
  86. package/node_modules/@lorenz/dispatch-coordinator/dist/index.js +5 -6
  87. package/node_modules/@lorenz/dispatch-coordinator/dist/index.js.map +1 -1
  88. package/node_modules/@lorenz/dispatch-coordinator/dist/mcpEndpointManager.d.ts +7 -5
  89. package/node_modules/@lorenz/dispatch-coordinator/dist/mcpEndpointManager.d.ts.map +1 -1
  90. package/node_modules/@lorenz/dispatch-coordinator/dist/mcpEndpointManager.js +12 -10
  91. package/node_modules/@lorenz/dispatch-coordinator/dist/mcpEndpointManager.js.map +1 -1
  92. package/node_modules/@lorenz/dispatch-coordinator/dist/nullEndpointManager.d.ts +11 -10
  93. package/node_modules/@lorenz/dispatch-coordinator/dist/nullEndpointManager.d.ts.map +1 -1
  94. package/node_modules/@lorenz/dispatch-coordinator/dist/nullEndpointManager.js +15 -22
  95. package/node_modules/@lorenz/dispatch-coordinator/dist/nullEndpointManager.js.map +1 -1
  96. package/node_modules/@lorenz/dispatch-coordinator/dist/types.d.ts +16 -15
  97. package/node_modules/@lorenz/dispatch-coordinator/dist/types.d.ts.map +1 -1
  98. package/node_modules/@lorenz/dispatch-coordinator/dist/types.js +6 -7
  99. package/node_modules/@lorenz/dispatch-coordinator/dist/types.js.map +1 -1
  100. package/node_modules/@lorenz/domain/dist/index.d.ts +75 -9
  101. package/node_modules/@lorenz/domain/dist/index.d.ts.map +1 -1
  102. package/node_modules/@lorenz/domain/dist/index.js +40 -0
  103. package/node_modules/@lorenz/domain/dist/index.js.map +1 -1
  104. package/node_modules/@lorenz/flags/dist/coerce.d.ts +12 -0
  105. package/node_modules/@lorenz/flags/dist/coerce.d.ts.map +1 -0
  106. package/node_modules/@lorenz/flags/dist/coerce.js +44 -0
  107. package/node_modules/@lorenz/flags/dist/coerce.js.map +1 -0
  108. package/node_modules/@lorenz/flags/dist/default.d.ts +6 -0
  109. package/node_modules/@lorenz/flags/dist/default.d.ts.map +1 -0
  110. package/node_modules/@lorenz/flags/dist/default.js +22 -0
  111. package/node_modules/@lorenz/flags/dist/default.js.map +1 -0
  112. package/node_modules/@lorenz/flags/dist/deprecations.d.ts +20 -0
  113. package/node_modules/@lorenz/flags/dist/deprecations.d.ts.map +1 -0
  114. package/node_modules/@lorenz/flags/dist/deprecations.js +42 -0
  115. package/node_modules/@lorenz/flags/dist/deprecations.js.map +1 -0
  116. package/node_modules/@lorenz/flags/dist/env.d.ts +17 -0
  117. package/node_modules/@lorenz/flags/dist/env.d.ts.map +1 -0
  118. package/node_modules/@lorenz/flags/dist/env.js +90 -0
  119. package/node_modules/@lorenz/flags/dist/env.js.map +1 -0
  120. package/node_modules/@lorenz/flags/dist/errors.d.ts +22 -0
  121. package/node_modules/@lorenz/flags/dist/errors.d.ts.map +1 -0
  122. package/node_modules/@lorenz/flags/dist/errors.js +61 -0
  123. package/node_modules/@lorenz/flags/dist/errors.js.map +1 -0
  124. package/node_modules/@lorenz/flags/dist/index.d.ts +8 -0
  125. package/node_modules/@lorenz/flags/dist/index.d.ts.map +1 -0
  126. package/node_modules/@lorenz/flags/dist/index.js +11 -0
  127. package/node_modules/@lorenz/flags/dist/index.js.map +1 -0
  128. package/node_modules/@lorenz/flags/dist/keys.d.ts +6 -0
  129. package/node_modules/@lorenz/flags/dist/keys.d.ts.map +1 -0
  130. package/node_modules/@lorenz/flags/dist/keys.js +15 -0
  131. package/node_modules/@lorenz/flags/dist/keys.js.map +1 -0
  132. package/node_modules/@lorenz/flags/dist/layers.d.ts +14 -0
  133. package/node_modules/@lorenz/flags/dist/layers.d.ts.map +1 -0
  134. package/node_modules/@lorenz/flags/dist/layers.js +107 -0
  135. package/node_modules/@lorenz/flags/dist/layers.js.map +1 -0
  136. package/node_modules/@lorenz/flags/dist/manifest.d.ts +71 -0
  137. package/node_modules/@lorenz/flags/dist/manifest.d.ts.map +1 -0
  138. package/node_modules/@lorenz/flags/dist/manifest.js +137 -0
  139. package/node_modules/@lorenz/flags/dist/manifest.js.map +1 -0
  140. package/node_modules/@lorenz/flags/dist/resolve.d.ts +8 -0
  141. package/node_modules/@lorenz/flags/dist/resolve.d.ts.map +1 -0
  142. package/node_modules/@lorenz/flags/dist/resolve.js +178 -0
  143. package/node_modules/@lorenz/flags/dist/resolve.js.map +1 -0
  144. package/node_modules/@lorenz/flags/dist/testing.d.ts +19 -0
  145. package/node_modules/@lorenz/flags/dist/testing.d.ts.map +1 -0
  146. package/node_modules/@lorenz/flags/dist/testing.js +68 -0
  147. package/node_modules/@lorenz/flags/dist/testing.js.map +1 -0
  148. package/node_modules/@lorenz/flags/dist/types.d.ts +93 -0
  149. package/node_modules/@lorenz/flags/dist/types.d.ts.map +1 -0
  150. package/node_modules/@lorenz/flags/dist/types.js +2 -0
  151. package/node_modules/@lorenz/flags/dist/types.js.map +1 -0
  152. package/node_modules/@lorenz/flags/package.json +16 -0
  153. package/node_modules/@lorenz/mcp/dist/agentEndpoint.d.ts +16 -3
  154. package/node_modules/@lorenz/mcp/dist/agentEndpoint.d.ts.map +1 -1
  155. package/node_modules/@lorenz/mcp/dist/agentEndpoint.js +105 -17
  156. package/node_modules/@lorenz/mcp/dist/agentEndpoint.js.map +1 -1
  157. package/node_modules/@lorenz/mcp/dist/auth.d.ts +88 -0
  158. package/node_modules/@lorenz/mcp/dist/auth.d.ts.map +1 -1
  159. package/node_modules/@lorenz/mcp/dist/auth.js +53 -0
  160. package/node_modules/@lorenz/mcp/dist/auth.js.map +1 -1
  161. package/node_modules/@lorenz/mcp/dist/index.d.ts +3 -2
  162. package/node_modules/@lorenz/mcp/dist/index.d.ts.map +1 -1
  163. package/node_modules/@lorenz/mcp/dist/index.js +1 -1
  164. package/node_modules/@lorenz/mcp/dist/index.js.map +1 -1
  165. package/node_modules/@lorenz/mcp/dist/server.d.ts +22 -0
  166. package/node_modules/@lorenz/mcp/dist/server.d.ts.map +1 -1
  167. package/node_modules/@lorenz/mcp/dist/server.js +85 -12
  168. package/node_modules/@lorenz/mcp/dist/server.js.map +1 -1
  169. package/node_modules/@lorenz/orchestrator/dist/claimStore.d.ts +157 -0
  170. package/node_modules/@lorenz/orchestrator/dist/claimStore.d.ts.map +1 -0
  171. package/node_modules/@lorenz/orchestrator/dist/claimStore.js +621 -0
  172. package/node_modules/@lorenz/orchestrator/dist/claimStore.js.map +1 -0
  173. package/node_modules/@lorenz/orchestrator/dist/codec.d.ts +38 -0
  174. package/node_modules/@lorenz/orchestrator/dist/codec.d.ts.map +1 -0
  175. package/node_modules/@lorenz/orchestrator/dist/codec.js +176 -0
  176. package/node_modules/@lorenz/orchestrator/dist/codec.js.map +1 -0
  177. package/node_modules/@lorenz/orchestrator/dist/index.d.ts +55 -51
  178. package/node_modules/@lorenz/orchestrator/dist/index.d.ts.map +1 -1
  179. package/node_modules/@lorenz/orchestrator/dist/index.js +285 -45
  180. package/node_modules/@lorenz/orchestrator/dist/index.js.map +1 -1
  181. package/node_modules/@lorenz/orchestrator/dist/sqlite.d.ts +34 -0
  182. package/node_modules/@lorenz/orchestrator/dist/sqlite.d.ts.map +1 -0
  183. package/node_modules/@lorenz/orchestrator/dist/sqlite.js +142 -0
  184. package/node_modules/@lorenz/orchestrator/dist/sqlite.js.map +1 -0
  185. package/node_modules/@lorenz/orchestrator/dist/state.d.ts +47 -0
  186. package/node_modules/@lorenz/orchestrator/dist/state.d.ts.map +1 -0
  187. package/node_modules/@lorenz/orchestrator/dist/state.js +15 -0
  188. package/node_modules/@lorenz/orchestrator/dist/state.js.map +1 -0
  189. package/node_modules/@lorenz/orchestrator/dist/turso.d.ts +28 -0
  190. package/node_modules/@lorenz/orchestrator/dist/turso.d.ts.map +1 -0
  191. package/node_modules/@lorenz/orchestrator/dist/turso.js +125 -0
  192. package/node_modules/@lorenz/orchestrator/dist/turso.js.map +1 -0
  193. package/node_modules/@lorenz/orchestrator/package.json +6 -2
  194. package/node_modules/@lorenz/presenter/dist/index.d.ts +14 -0
  195. package/node_modules/@lorenz/presenter/dist/index.d.ts.map +1 -1
  196. package/node_modules/@lorenz/presenter/dist/index.js +18 -0
  197. package/node_modules/@lorenz/presenter/dist/index.js.map +1 -1
  198. package/node_modules/@lorenz/projections/dist/index.d.ts.map +1 -1
  199. package/node_modules/@lorenz/projections/dist/index.js +1 -0
  200. package/node_modules/@lorenz/projections/dist/index.js.map +1 -1
  201. package/node_modules/@lorenz/runtime/dist/index.d.ts +27 -8
  202. package/node_modules/@lorenz/runtime/dist/index.d.ts.map +1 -1
  203. package/node_modules/@lorenz/runtime/dist/index.js +422 -98
  204. package/node_modules/@lorenz/runtime/dist/index.js.map +1 -1
  205. package/node_modules/@lorenz/runtime-events/dist/index.d.ts +14 -0
  206. package/node_modules/@lorenz/runtime-events/dist/index.d.ts.map +1 -1
  207. package/node_modules/@lorenz/server/dist/index.js +1 -1
  208. package/node_modules/@lorenz/server/dist/index.js.map +1 -1
  209. package/node_modules/@lorenz/ssh/dist/index.d.ts +2 -0
  210. package/node_modules/@lorenz/ssh/dist/index.d.ts.map +1 -1
  211. package/node_modules/@lorenz/ssh/dist/index.js +2 -1
  212. package/node_modules/@lorenz/ssh/dist/index.js.map +1 -1
  213. package/node_modules/@lorenz/tool-sdk/dist/index.d.ts +1 -0
  214. package/node_modules/@lorenz/tool-sdk/dist/index.d.ts.map +1 -1
  215. package/node_modules/@lorenz/tool-sdk/dist/index.js +1 -0
  216. package/node_modules/@lorenz/tool-sdk/dist/index.js.map +1 -1
  217. package/node_modules/@lorenz/tool-sdk/dist/module.d.ts +38 -0
  218. package/node_modules/@lorenz/tool-sdk/dist/module.d.ts.map +1 -0
  219. package/node_modules/@lorenz/tool-sdk/dist/module.js +42 -0
  220. package/node_modules/@lorenz/tool-sdk/dist/module.js.map +1 -0
  221. package/node_modules/@lorenz/tracker-sdk/dist/index.d.ts +1 -0
  222. package/node_modules/@lorenz/tracker-sdk/dist/index.d.ts.map +1 -1
  223. package/node_modules/@lorenz/tracker-sdk/dist/index.js +1 -0
  224. package/node_modules/@lorenz/tracker-sdk/dist/index.js.map +1 -1
  225. package/node_modules/@lorenz/tracker-sdk/dist/module.d.ts +37 -0
  226. package/node_modules/@lorenz/tracker-sdk/dist/module.d.ts.map +1 -0
  227. package/node_modules/@lorenz/tracker-sdk/dist/module.js +38 -0
  228. package/node_modules/@lorenz/tracker-sdk/dist/module.js.map +1 -0
  229. package/node_modules/@lorenz/worker-host-pool/dist/index.d.ts +34 -6
  230. package/node_modules/@lorenz/worker-host-pool/dist/index.d.ts.map +1 -1
  231. package/node_modules/@lorenz/worker-host-pool/dist/index.js +110 -143
  232. package/node_modules/@lorenz/worker-host-pool/dist/index.js.map +1 -1
  233. package/node_modules/@lorenz/worker-sdk/dist/index.d.ts +1 -0
  234. package/node_modules/@lorenz/worker-sdk/dist/index.d.ts.map +1 -1
  235. package/node_modules/@lorenz/worker-sdk/dist/index.js +1 -0
  236. package/node_modules/@lorenz/worker-sdk/dist/index.js.map +1 -1
  237. package/node_modules/@lorenz/worker-sdk/dist/local.d.ts +74 -0
  238. package/node_modules/@lorenz/worker-sdk/dist/local.d.ts.map +1 -0
  239. package/node_modules/@lorenz/worker-sdk/dist/local.js +112 -0
  240. package/node_modules/@lorenz/worker-sdk/dist/local.js.map +1 -0
  241. package/node_modules/@lorenz/worker-sdk/dist/module.d.ts +8 -16
  242. package/node_modules/@lorenz/worker-sdk/dist/module.d.ts.map +1 -1
  243. package/node_modules/@lorenz/worker-sdk/dist/module.js +15 -35
  244. package/node_modules/@lorenz/worker-sdk/dist/module.js.map +1 -1
  245. package/node_modules/@lorenz/workflow/dist/index.d.ts +11 -0
  246. package/node_modules/@lorenz/workflow/dist/index.d.ts.map +1 -1
  247. package/node_modules/@lorenz/workflow/dist/index.js +3 -0
  248. package/node_modules/@lorenz/workflow/dist/index.js.map +1 -1
  249. package/package.json +4 -1
@@ -1,8 +1,7 @@
1
- // The DispatchCoordinator: STEP 1 is a 1:1 passthrough over the proven
2
- // @lorenz/worker-pool WorkerPool.
1
+ // The DispatchCoordinator wraps the @lorenz/worker-pool WorkerPool.
3
2
  //
4
3
  // With the default settings (slotsPerMachine=1) and the NULL McpEndpointManager
5
- // (perRunEndpoint=false, mcpEndpoint=null), every operation here is byte-identical
4
+ // (perRunClaimEnforcement=false, mcpEndpoint=null), every operation here is byte-identical
6
5
  // at the runtime boundary to calling the underlying WorkerPool directly:
7
6
  // - acquireRunSlot calls pool.acquire and, on `leased`, mints a RunSlot whose
8
7
  // release/fail/heartbeat delegate straight to the wrapped WorkerLease (so the
@@ -77,11 +76,11 @@ function isLocalWorkerHost(workerHost) {
77
76
  * SAME machine. `(issueId, slotIndex)` is the key that feeds both the per-run
78
77
  * `runKey` (`${slotIndex}`) AND the workspace slot suffix, so two co-resident slots
79
78
  * sharing it would collide on BOTH the per-run endpoint/tunnel key and the
80
- * workspace dir. Rather than silently disambiguate (openQuestion #1), the
81
- * coordinator ASSERTS-AND-REJECTS: the just-bound lease is settled HEALTHY (the worker
82
- * itself is fine) and NO slot is registered, so this invariant violation surfaces
83
- * loudly. The runtime maps the throw to `worker_pool_acquire_error` exactly like any
84
- * other acquire fault, leaving the first slot untouched.
79
+ * workspace dir. Rather than silently disambiguate, the coordinator
80
+ * ASSERTS-AND-REJECTS: the just-bound lease is settled HEALTHY (the worker itself is
81
+ * fine) and NO slot is registered, so this invariant violation surfaces loudly. The
82
+ * runtime maps the throw to `worker_pool_acquire_error` exactly like any other
83
+ * acquire fault, leaving the first slot untouched.
85
84
  */
86
85
  export class RunSlotCollisionError extends Error {
87
86
  issueId;
@@ -96,8 +95,34 @@ export class RunSlotCollisionError extends Error {
96
95
  }
97
96
  }
98
97
  /**
99
- * Mints a {@link RunSlot} wrapping a settled-once {@link WorkerLease}. STEP 1 always
100
- * passes `mcpEndpoint = null` (the null manager mints nothing) so release/fail are
98
+ * Thrown by {@link DispatchCoordinator.acquireRunSlot} when a co-residence run
99
+ * (`slotsPerMachine > 1`, per-run-claim enforcement on) binds to a LOCAL (empty)
100
+ * worker host. The per-run claim model only covers REAL remote hosts: an empty
101
+ * host routes through the manager's null/local path, which mints NO Token B claim
102
+ * and keeps acp's settings-wide endpoint, so a co-resident local run would share an
103
+ * unscoped endpoint with its neighbours - a cross-run authority leak. The startup
104
+ * gate refuses co-residence without claim enforcement; this is the runtime backstop
105
+ * for a slot that lands on an empty host at acquire time. The just-bound lease is
106
+ * settled HEALTHY (the worker is fine) and NO slot is registered; the runtime maps
107
+ * the throw to worker_pool_acquire_error.
108
+ */
109
+ export class LocalCoResidenceError extends Error {
110
+ issueId;
111
+ slotIndex;
112
+ machineLeaseId;
113
+ constructor(args) {
114
+ super(`local_co_residence_unscoped: (issueId=${args.issueId}, slotIndex=${args.slotIndex}) bound to ` +
115
+ `an empty worker host under slotsPerMachine>1; a local run cannot mint a per-run scoped ` +
116
+ `Token B claim, so co-residence on a local host is refused`);
117
+ this.name = "LocalCoResidenceError";
118
+ this.issueId = args.issueId;
119
+ this.slotIndex = args.slotIndex;
120
+ this.machineLeaseId = args.machineLeaseId;
121
+ }
122
+ }
123
+ /**
124
+ * Mints a {@link RunSlot} wrapping a settled-once {@link WorkerLease}. With the
125
+ * null manager `mcpEndpoint = null` (nothing is minted) so release/fail are
101
126
  * byte-identical to the underlying lease settle. The slot holds a single
102
127
  * `settled` flag so release/fail are exactly-once on THIS handle (a second call is
103
128
  * a no-op and never reaches the lease); the lease itself stays the authoritative
@@ -173,12 +198,11 @@ function createRunSlot(args) {
173
198
  };
174
199
  }
175
200
  /**
176
- * Constructs the STEP 1 passthrough {@link DispatchCoordinator}. `settings` is
177
- * retained for the later reconcile/co-residence paths; in STEP 1 it is not read
178
- * past construction (the pool owns the live settings). The injected
179
- * `mcpEndpointManager` is the null passthrough in STEP 1, so every minted slot
180
- * carries `mcpEndpoint = null` and the coordinator advertises
181
- * `perRunEndpoint = false`.
201
+ * Constructs a {@link DispatchCoordinator}. With the null `mcpEndpointManager`
202
+ * every minted slot carries `mcpEndpoint = null` and the coordinator advertises
203
+ * `perRunClaimEnforcement = false` (the passthrough path); a concrete manager
204
+ * mints a per-run endpoint per slot and advertises `true`. `settings` is read for
205
+ * the coordinator-owned tunnel budget (the pool owns its own live settings).
182
206
  */
183
207
  export function createDispatchCoordinator(deps) {
184
208
  const { pool, mcpEndpointManager } = deps;
@@ -197,38 +221,67 @@ export function createDispatchCoordinator(deps) {
197
221
  // BEFORE drain returns and the daemon stops the local server - otherwise shutdown
198
222
  // races live slot teardown and strands those resources.
199
223
  const pendingRecycleFails = new Set();
200
- // SYNCHRONOUS tunnel reservations held while an acquire is between the ceiling
201
- // check and a successful registration. The ceiling check passes and increments
202
- // this in the SAME JS tick (before any `await mcpEndpointManager.open`), so two
203
- // concurrent acquires can never both slip past a maxConcurrentTunnels ceiling:
204
- // the second sees the first's pending reservation. Each reservation is released
205
- // exactly once - on open FAILURE, on a post-open guard rejection, or on slot
206
- // settlement (via the slot's onSettled) - mirroring the worker pool's single-flight
207
- // reservedProvisions counter. A negative count is impossible because every
208
- // increment is paired with exactly one release.
209
- let reservedTunnels = 0;
224
+ // SYNCHRONOUS per-HOST tunnel reservations held while an acquire is between the
225
+ // ceiling check and a successful registration, keyed by worker host. The ceiling
226
+ // check passes and increments the host's reservation count in the SAME JS tick
227
+ // (before any `await mcpEndpointManager.open`), so two concurrent acquires can
228
+ // never both slip past a maxConcurrentTunnels ceiling: the second sees the first's
229
+ // pending reservation. Co-resident runs on ONE host share ONE `ssh -R` tunnel, so
230
+ // the budget counts DISTINCT hosts: a host that already has a live tunnel (or
231
+ // reservation) consumes no additional budget for a second co-resident run. Each
232
+ // reservation is released exactly once - on open FAILURE, on a post-open guard
233
+ // rejection, or on slot settlement (via the slot's onSettled).
234
+ const reservedTunnelHosts = new Map();
235
+ const reserveTunnelHost = (workerHost) => {
236
+ reservedTunnelHosts.set(workerHost, (reservedTunnelHosts.get(workerHost) ?? 0) + 1);
237
+ };
238
+ const unreserveTunnelHost = (workerHost) => {
239
+ const count = reservedTunnelHosts.get(workerHost);
240
+ if (count === undefined)
241
+ return;
242
+ if (count <= 1)
243
+ reservedTunnelHosts.delete(workerHost);
244
+ else
245
+ reservedTunnelHosts.set(workerHost, count - 1);
246
+ };
210
247
  // The live settings the coordinator reads for the tunnel-exhaustion ceiling.
211
248
  // `reconcile` updates this in place so a config reload that raises/lowers the
212
249
  // ceiling takes effect WITHOUT reconstructing the singleton (the live-slot
213
250
  // registry is preserved across the reload). The pool owns its own live settings;
214
251
  // this reference is only read for the coordinator-owned tunnel budget.
215
252
  let currentSettings = deps.settings;
216
- // Counts LIVE per-run tunnels: registered slots whose `mcpEndpoint` is non-null
217
- // (a local / null-endpoint slot consumes no tunnel budget) PLUS the pending
218
- // reservations held by in-flight acquires that have passed the ceiling check but
219
- // not yet registered. Including the reservations is what closes the
253
+ // Counts LIVE per-HOST tunnels: the number of DISTINCT worker hosts that hold a
254
+ // live `ssh -R` reverse tunnel. A host is counted when it has a registered slot
255
+ // whose `mcpEndpoint` is non-null (a local / null-endpoint slot consumes no
256
+ // tunnel budget) OR a pending reservation held by an in-flight acquire. Two
257
+ // co-resident runs on ONE host SHARE one tunnel, so that host counts ONCE - the
258
+ // budget tracks actual tunnels, not slots. Including the reservations closes the
220
259
  // concurrent-acquire race: registration happens only AFTER `await
221
- // mcpEndpointManager.open`, so without the reservation a second acquire would
222
- // count zero live tunnels while the first is still mid-open and over-open the
223
- // ceiling. The registered refcount stays exact via the open-on-bind /
260
+ // mcpEndpointManager.open`, so without the reservation a second acquire (on a NEW
261
+ // host) would count one fewer tunnel while the first is still mid-open and
262
+ // over-open the ceiling. The registered set stays exact via the open-on-bind /
224
263
  // close-on-settle lifecycle; the reservation covers the open-in-flight gap.
225
264
  const liveTunnelCount = () => {
226
- let count = reservedTunnels;
265
+ const hosts = new Set(reservedTunnelHosts.keys());
227
266
  for (const slot of slots.values()) {
228
267
  if (slot.mcpEndpoint !== null)
229
- count += 1;
268
+ hosts.add(slot.workerHost);
230
269
  }
231
- return count;
270
+ return hosts.size;
271
+ };
272
+ // Whether `workerHost` ALREADY holds a live per-host tunnel (a registered
273
+ // non-null-endpoint slot on it, or a pending in-flight reservation for it). A
274
+ // co-resident acquire on such a host opens NO new tunnel, so it neither trips the
275
+ // ceiling nor takes an additional budget unit; the shared host tunnel is already
276
+ // counted.
277
+ const hostHasLiveTunnel = (workerHost) => {
278
+ if ((reservedTunnelHosts.get(workerHost) ?? 0) > 0)
279
+ return true;
280
+ for (const slot of slots.values()) {
281
+ if (slot.mcpEndpoint !== null && slot.workerHost === workerHost)
282
+ return true;
283
+ }
284
+ return false;
232
285
  };
233
286
  // Recycle-vs-endpoint ordering invariant: the pool fires this INSIDE the per-worker
234
287
  // mutex immediately BEFORE it destroys a machine. We fail every still-open
@@ -267,7 +320,9 @@ export function createDispatchCoordinator(deps) {
267
320
  }
268
321
  });
269
322
  }
270
- const capabilities = { perRunEndpoint: mcpEndpointManager.perRunEndpoint };
323
+ const capabilities = {
324
+ perRunClaimEnforcement: mcpEndpointManager.perRunClaimEnforcement,
325
+ };
271
326
  return {
272
327
  capabilities,
273
328
  async acquireRunSlot(req) {
@@ -282,16 +337,15 @@ export function createDispatchCoordinator(deps) {
282
337
  // runtime maps every reason onto the single worker_host_capacity event.
283
338
  return { status: "no_capacity", reason: acquired.reason };
284
339
  }
285
- // (issueId, slotIndex) uniqueness invariant (STEP 3 / T3b): `(issueId,
286
- // slotIndex)` feeds BOTH the per-run `runKey` (`${slotIndex}`) and the
287
- // workspace slot suffix, so the coordinator must NEVER place two live slots
288
- // sharing it on ONE machine - they would collide on the endpoint/tunnel key
289
- // AND the workspace dir. We check the registry RIGHT AFTER bind and BEFORE
290
- // opening the endpoint (so a colliding endpoint is never minted): if a live
291
- // slot already holds this (issueId, slotIndex) on this worker, settle the
292
- // just-bound lease HEALTHY (the worker is fine) and assert-and-reject rather than
293
- // silently disambiguate (openQuestion #1). The runtime maps the throw to
294
- // worker_pool_acquire_error, leaving the first slot untouched.
340
+ // (issueId, slotIndex) uniqueness invariant: `(issueId, slotIndex)` feeds
341
+ // BOTH the per-run `runKey` (`${slotIndex}`) and the workspace slot suffix, so
342
+ // the coordinator must NEVER place two live slots sharing it on ONE machine -
343
+ // they would collide on the endpoint/tunnel key AND the workspace dir. Check
344
+ // the registry RIGHT AFTER bind and BEFORE opening the endpoint (so a colliding
345
+ // endpoint is never minted): if a live slot already holds this (issueId,
346
+ // slotIndex) on this worker, settle the just-bound lease HEALTHY (the worker is
347
+ // fine) and assert-and-reject rather than silently disambiguate. The runtime
348
+ // maps the throw to worker_pool_acquire_error, leaving the first slot untouched.
295
349
  const machineLeaseId = acquired.lease.workerId;
296
350
  for (const existing of slots.values()) {
297
351
  if (existing.issueId === req.issueId &&
@@ -310,42 +364,75 @@ export function createDispatchCoordinator(deps) {
310
364
  });
311
365
  }
312
366
  }
313
- // STEP 3 (T3c #1): tunnel-exhaustion ceiling. When `maxConcurrentTunnels` is
314
- // set, opening another per-run endpoint that would exceed it surfaces as a
315
- // TYPED `no_capacity` ('tunnel_exhausted'), NEVER an unhandled throw inside
316
- // acquireRunSlot. We check this AFTER lease-bind + the collision guard but
317
- // BEFORE the open so a budget-exhausted slot never mints (then has to tear
318
- // down) a tunnel. The ceiling counts ONLY live remote tunnels and applies
319
- // ONLY when this open would actually mint one - a local (empty) host
320
- // (and the null passthrough, which mints nothing) consumes no `ssh -N` child,
321
- // so it is neither gated by nor counted against the budget. The just-bound
322
- // WorkerLease is settled HEALTHY (the worker is fine; only the tunnel budget is
323
- // exhausted) and NO slot is registered, so a sibling run recovers via the
324
- // single `worker_host_capacity` dispatch signal instead of seeing a fault.
367
+ // Empty-host fail-loud bypass closure: a CO-RESIDENCE run (`slotsPerMachine >
368
+ // 1`, per-run-claim enforcement on) that needs an MCP endpoint must NEVER land
369
+ // on a LOCAL (empty) worker host. An empty host routes through the manager's
370
+ // null/local path, which mints NO Token B claim and keeps acp's settings-wide
371
+ // endpoint, so a co-resident local run would share one unscoped endpoint with
372
+ // its neighbours - a cross-run authority leak. The startup gate refuses
373
+ // co-residence without claim enforcement; this is the runtime backstop for a
374
+ // slot that lands on an empty host at acquire time. Checked AFTER lease-bind +
375
+ // collision but BEFORE the endpoint open / tunnel reservation so no unscoped
376
+ // endpoint is ever minted. The lease is settled HEALTHY and NO slot is
377
+ // registered; the runtime maps the throw to worker_pool_acquire_error.
378
+ // Single-tenant (slotsPerMachine<=1) and runs that consume no endpoint are
379
+ // unaffected.
380
+ const needsMcpEndpoint = req.needsMcpEndpoint ?? true;
381
+ if (needsMcpEndpoint &&
382
+ mcpEndpointManager.perRunClaimEnforcement &&
383
+ currentSettings.slotsPerMachine > 1 &&
384
+ isLocalWorkerHost(acquired.lease.workerHost)) {
385
+ try {
386
+ await acquired.lease.release("healthy");
387
+ }
388
+ catch {
389
+ // Swallow: the bypass refusal is the surfaced fault; the worker is healthy.
390
+ }
391
+ throw new LocalCoResidenceError({
392
+ issueId: req.issueId,
393
+ slotIndex: req.slotIndex,
394
+ machineLeaseId,
395
+ });
396
+ }
397
+ // Tunnel-exhaustion ceiling. When `maxConcurrentTunnels` is set, opening
398
+ // another per-run endpoint that would exceed it surfaces as a TYPED
399
+ // `no_capacity` ('tunnel_exhausted'), NEVER an unhandled throw inside
400
+ // acquireRunSlot. Checked AFTER lease-bind + the collision guard but BEFORE the
401
+ // open so a budget-exhausted slot never mints (then has to tear down) a tunnel.
402
+ // The ceiling counts ONLY live remote tunnels and applies ONLY when this open
403
+ // would actually mint one - a local (empty) host (and the null passthrough,
404
+ // which mints nothing) consumes no `ssh -N` child, so it is neither gated by
405
+ // nor counted against the budget. The just-bound WorkerLease is settled HEALTHY
406
+ // (only the tunnel budget is exhausted) and NO slot is registered, so a sibling
407
+ // run recovers via the single `worker_host_capacity` dispatch signal.
325
408
  //
326
409
  // The ceiling check + the reservation are a SINGLE synchronous step (no
327
- // `await` between `liveTunnelCount()` and `reservedTunnels += 1`): two
328
- // concurrent acquires therefore cannot both pass it, because the second's
329
- // count includes the first's pending reservation. The reservation is held
330
- // across the (awaited) open so the gap between check and registration cannot
331
- // be over-subscribed; it is released on open FAILURE and otherwise handed off
332
- // to the slot's settlement (so the budget is freed exactly once when the run
333
- // finishes). Mirrors the worker pool's reservedProvisions single-flight.
410
+ // `await` between `liveTunnelCount()` and `reserveTunnelHost(...)`): two
411
+ // concurrent acquires therefore cannot both pass it, because the second's count
412
+ // includes the first's pending reservation. The reservation is held across the
413
+ // (awaited) open so the gap between check and registration cannot be
414
+ // over-subscribed; it is released on open FAILURE and otherwise handed off to
415
+ // the slot's settlement (freed exactly once when the run finishes). Mirrors the
416
+ // worker pool's reservedProvisions single-flight.
334
417
  const runKey = runKeyFor(req.issueId, req.slotIndex);
335
418
  const tunnelCeiling = currentSettings.maxConcurrentTunnels;
336
- // Whether THIS run actually consumes a per-run MCP endpoint. The Codex/appserver
337
- // executor runs its dynamic tools IN-PROCESS and ignores the endpoint, so a
338
- // run that needs none must SKIP the open AND the tunnel reservation/ceiling
339
- // entirely (it would otherwise be SKIPPED by an open failure / port-forward
340
- // restriction / maxConcurrentTunnels for an endpoint it never uses). Only
341
- // ACP/Claude reads `/mcp` over the reverse tunnel. Defaults to `true`
342
- // (the existing ACP behaviour) when a legacy caller omits the field.
343
- const needsMcpEndpoint = req.needsMcpEndpoint ?? true;
419
+ // `needsMcpEndpoint` (resolved above the local-co-residence guard) is whether
420
+ // THIS run actually consumes a per-run MCP endpoint. The Codex/appserver
421
+ // executor runs its dynamic tools IN-PROCESS and ignores the endpoint, so a run
422
+ // that needs none SKIPS the open AND the tunnel reservation/ceiling entirely
423
+ // (it would otherwise be SKIPPED by an open failure / port-forward restriction /
424
+ // maxConcurrentTunnels for an endpoint it never uses). Only ACP/Claude reads
425
+ // `/mcp` over the reverse tunnel.
344
426
  const wouldOpenTunnel = needsMcpEndpoint &&
345
- mcpEndpointManager.perRunEndpoint &&
427
+ mcpEndpointManager.perRunClaimEnforcement &&
346
428
  !isLocalWorkerHost(acquired.lease.workerHost);
429
+ // A co-resident acquire on a host that ALREADY holds a live tunnel opens no NEW
430
+ // tunnel, so it is exempt from the ceiling AND takes no extra budget unit (the
431
+ // shared host tunnel is already counted). Only an acquire that would open a
432
+ // tunnel on a NEW host is gated/reserved.
433
+ const opensNewHostTunnel = wouldOpenTunnel && !hostHasLiveTunnel(acquired.lease.workerHost);
347
434
  let tunnelReserved = false;
348
- if (wouldOpenTunnel && tunnelCeiling !== undefined) {
435
+ if (opensNewHostTunnel && tunnelCeiling !== undefined) {
349
436
  if (liveTunnelCount() >= tunnelCeiling) {
350
437
  // Settle the just-bound lease HEALTHY (best-effort; a settle hiccup must
351
438
  // not mask the capacity signal) and return the typed no_capacity reason.
@@ -357,8 +444,8 @@ export function createDispatchCoordinator(deps) {
357
444
  }
358
445
  return { status: "no_capacity", reason: "tunnel_exhausted" };
359
446
  }
360
- // Take the reservation in the SAME JS tick the ceiling check passed.
361
- reservedTunnels += 1;
447
+ // Take the per-host reservation in the SAME JS tick the ceiling check passed.
448
+ reserveTunnelHost(acquired.lease.workerHost);
362
449
  tunnelReserved = true;
363
450
  }
364
451
  // Releases this acquire's pending tunnel reservation exactly once (a no-op if
@@ -366,12 +453,12 @@ export function createDispatchCoordinator(deps) {
366
453
  const releaseReservation = () => {
367
454
  if (tunnelReserved) {
368
455
  tunnelReserved = false;
369
- reservedTunnels -= 1;
456
+ unreserveTunnelHost(acquired.lease.workerHost);
370
457
  }
371
458
  };
372
- // STEP 2: open the WHOLE per-run endpoint AFTER the lease-bind (the null
373
- // manager still mints nothing, keeping the single-slot/local path
374
- // byte-identical). The runKey is the issue-scoped `${issueId}#${slotIndex}`.
459
+ // Open the WHOLE per-run endpoint AFTER the lease-bind (the null manager mints
460
+ // nothing, keeping the single-slot/local path byte-identical). The runKey is
461
+ // the issue-scoped `${issueId}#${slotIndex}`.
375
462
  // SKIP the open entirely for a run that consumes no endpoint (Codex/appserver):
376
463
  // the slot binds with a null endpoint (no reservation was taken, since
377
464
  // wouldOpenTunnel is false when needsMcpEndpoint is false) so it can never be
@@ -492,6 +579,24 @@ export function createDispatchCoordinator(deps) {
492
579
  async hydrate() {
493
580
  await pool.hydrate();
494
581
  },
582
+ isRunLive(runKey, workerHost, generation) {
583
+ // SYNCHRONOUS read of the live-slot registry the coordinator itself mutates
584
+ // (never a cached copy), so a settled/recycled run is observed not-live
585
+ // immediately. runKey and workerHost both come from the resolved Token B claim
586
+ // (no self-reported identity the caller could spoof). The generation must match
587
+ // the endpoint the live slot holds: a recycle bumps the slot's generation, so a
588
+ // token stamped against the prior generation is denied even inside the
589
+ // registry's own async teardown window.
590
+ for (const slot of slots.values()) {
591
+ if (slot.runKey === runKey &&
592
+ slot.workerHost === workerHost &&
593
+ slot.mcpEndpoint !== null &&
594
+ slot.mcpEndpoint.generation === generation) {
595
+ return true;
596
+ }
597
+ }
598
+ return false;
599
+ },
495
600
  snapshot() {
496
601
  const base = pool.snapshot();
497
602
  const slotEntries = [];
@@ -1 +1 @@
1
- {"version":3,"file":"coordinator.js","sourceRoot":"","sources":["../src/coordinator.ts"],"names":[],"mappings":"AAAA,uEAAuE;AACvE,kCAAkC;AAClC,EAAE;AACF,gFAAgF;AAChF,mFAAmF;AACnF,yEAAyE;AACzE,gFAAgF;AAChF,kFAAkF;AAClF,iFAAiF;AACjF,iFAAiF;AACjF,kFAAkF;AAClF,6CAA6C;AAC7C,kFAAkF;AAClF,+EAA+E;AAC/E,kFAAkF;AAClF,wCAAwC;AACxC,+EAA+E;AAC/E,mEAAmE;AACnE,EAAE;AACF,iFAAiF;AACjF,4EAA4E;AAC5E,wCAAwC;AAkCxC;;;;;;;;;GASG;AACH,MAAM,OAAO,iBAAkB,SAAQ,KAAK;IACxB,KAAK,CAAU;IACxB,UAAU,CAAS;IACnB,MAAM,CAAS;IAExB,YAAY,IAA4D;QACtE,KAAK,CACH,6BAA6B,IAAI,CAAC,UAAU,IAA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AAC,WAAW,CAAC,UAAU,KAAK,UAAU,EAC1C,CAAC;oBACD,OAAO,IAAI,CAAC;gBACd,CAAC;YACH,CAAC;YACD,OAAO,KAAK,CAAC;QACf,CAAC;QAED,QAAQ;YACN,MAAM,IAAI,GAAG,IAAI,CAAC,QAAQ,EAAE,CAAC;YAC7B,MAAM,WAAW,GAA2B,EAAE,CAAC;YAC/C,KAAK,MAAM,IAAI,IAAI,KAAK,CAAC,MAAM,EAAE,EAAE,CAAC;gBAClC,WAAW,CAAC,IAAI,CAAC;oBACf,MAAM,EAAE,IAAI,CAAC,MAAM;oBACnB,cAAc,EAAE,IAAI,CAAC,cAAc;oBACnC,OAAO,EAAE,IAAI,CAAC,OAAO;oBACrB,SAAS,EAAE,IAAI,CAAC,SAAS;oBACzB,UAAU,EAAE,IAAI,CAAC,UAAU;oBAC3B,UAAU,EAAE,sBAAsB,CAAC,IAAI,CAAC,WAAW,CAAC;iBACrD,CAAC,CAAC;YACL,CAAC;YACD,OAAO,EAAE,GAAG,IAAI,EAAE,KAAK,EAAE,WAAW,EAAE,CAAC;QACzC,CAAC;KACF,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,SAAS,sBAAsB,CAAC,QAAsC;IACpE,IAAI,CAAC,QAAQ;QAAE,OAAO,IAAI,CAAC;IAC3B,IAAI,CAAC;QACH,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC;QAChD,OAAO,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC;IAC1D,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC"}
@@ -1,16 +1,18 @@
1
1
  import type { WorkerPoolSettings } from "@lorenz/domain";
2
2
  /** The subset of a coordinator's capabilities the gate consumes. */
3
3
  export interface SlotsPerMachineGateCapabilities {
4
- readonly perRunEndpoint: boolean;
4
+ readonly perRunClaimEnforcement: boolean;
5
5
  }
6
6
  /**
7
7
  * Returns an operator-facing error message when `workerPool` would be unsafe to run,
8
8
  * or `null` when it passes. Co-residence packs multiple run slots onto one machine,
9
9
  * so `slotsPerMachine > 1` requires BOTH:
10
10
  *
11
- * 1. a coordinator that advertises `capabilities.perRunEndpoint === true` (each
12
- * RunSlot owns its own MCP endpoint - token + local-server + tunnel - so two
13
- * co-resident runs never share or tear out each other's endpoint), and
11
+ * 1. a coordinator whose gateway advertises `capabilities.perRunClaimEnforcement
12
+ * === true`: the shared MCP gateway resolves each request's per-run scoped Token
13
+ * B claim server-side, re-checks the owning run is still live, fences it by
14
+ * generation, and fails closed otherwise - so two co-resident runs sharing one
15
+ * host + one reverse tunnel can never authorize against each other's claim, and
14
16
  * 2. an explicit `worker.worker_pool.co_residence` operator opt-in, because a single
15
17
  * poisoned worker fails every co-resident run on recycle: widening that blast
16
18
  * radius is a deliberate tradeoff, not just a capability.
@@ -1 +1 @@
1
- {"version":3,"file":"gate.d.ts","sourceRoot":"","sources":["../src/gate.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAEzD,oEAAoE;AACpE,MAAM,WAAW,+BAA+B;IAC9C,QAAQ,CAAC,cAAc,EAAE,OAAO,CAAC;CAClC;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,wBAAwB,CACtC,UAAU,EAAE,kBAAkB,GAAG,SAAS,EAC1C,YAAY,EAAE,+BAA+B,GAAG,SAAS,GACxD,MAAM,GAAG,IAAI,CAkBf"}
1
+ {"version":3,"file":"gate.d.ts","sourceRoot":"","sources":["../src/gate.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAEzD,oEAAoE;AACpE,MAAM,WAAW,+BAA+B;IAC9C,QAAQ,CAAC,sBAAsB,EAAE,OAAO,CAAC;CAC1C;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,wBAAwB,CACtC,UAAU,EAAE,kBAAkB,GAAG,SAAS,EAC1C,YAAY,EAAE,+BAA+B,GAAG,SAAS,GACxD,MAAM,GAAG,IAAI,CAmBf"}
@@ -17,9 +17,11 @@
17
17
  * or `null` when it passes. Co-residence packs multiple run slots onto one machine,
18
18
  * so `slotsPerMachine > 1` requires BOTH:
19
19
  *
20
- * 1. a coordinator that advertises `capabilities.perRunEndpoint === true` (each
21
- * RunSlot owns its own MCP endpoint - token + local-server + tunnel - so two
22
- * co-resident runs never share or tear out each other's endpoint), and
20
+ * 1. a coordinator whose gateway advertises `capabilities.perRunClaimEnforcement
21
+ * === true`: the shared MCP gateway resolves each request's per-run scoped Token
22
+ * B claim server-side, re-checks the owning run is still live, fences it by
23
+ * generation, and fails closed otherwise - so two co-resident runs sharing one
24
+ * host + one reverse tunnel can never authorize against each other's claim, and
23
25
  * 2. an explicit `worker.worker_pool.co_residence` operator opt-in, because a single
24
26
  * poisoned worker fails every co-resident run on recycle: widening that blast
25
27
  * radius is a deliberate tradeoff, not just a capability.
@@ -32,9 +34,10 @@
32
34
  export function checkSlotsPerMachineGate(workerPool, capabilities) {
33
35
  if (!workerPool || workerPool.enabled === false || workerPool.slotsPerMachine <= 1)
34
36
  return null;
35
- if (capabilities?.perRunEndpoint !== true) {
36
- return ("worker.worker_pool.max_in_flight > 1 requires a dispatch coordinator with per-run MCP " +
37
- "endpoints (capabilities.perRunEndpoint), which the current build does not provide");
37
+ if (capabilities?.perRunClaimEnforcement !== true) {
38
+ return ("worker.worker_pool.max_in_flight > 1 requires a dispatch coordinator whose MCP gateway " +
39
+ "enforces per-run scoped claims (capabilities.perRunClaimEnforcement): server-side Token B " +
40
+ "resolution, owner re-check, and a generation fence, which the current build does not provide");
38
41
  }
39
42
  if (workerPool.coResidence !== true) {
40
43
  return ("worker.worker_pool.max_in_flight > 1 requires the explicit worker.worker_pool.co_residence " +
@@ -1 +1 @@
1
- {"version":3,"file":"gate.js","sourceRoot":"","sources":["../src/gate.ts"],"names":[],"mappings":"AAAA,oFAAoF;AACpF,kFAAkF;AAClF,+DAA+D;AAC/D,EAAE;AACF,+EAA+E;AAC/E,wCAAwC;AACxC,gFAAgF;AAChF,8EAA8E;AAC9E,8EAA8E;AAC9E,EAAE;AACF,iFAAiF;AACjF,iFAAiF;AACjF,iFAAiF;AACjF,gBAAgB;AAShB;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,wBAAwB,CACtC,UAA0C,EAC1C,YAAyD;IAEzD,IAAI,CAAC,UAAU,IAAI,UAAU,CAAC,OAAO,KAAK,KAAK,IAAI,UAAU,CAAC,eAAe,IAAI,CAAC;QAAE,OAAO,IAAI,CAAC;IAEhG,IAAI,YAAY,EAAE,cAAc,KAAK,IAAI,EAAE,CAAC;QAC1C,OAAO,CACL,wFAAwF;YACxF,mFAAmF,CACpF,CAAC;IACJ,CAAC;IACD,IAAI,UAAU,CAAC,WAAW,KAAK,IAAI,EAAE,CAAC;QACpC,OAAO,CACL,6FAA6F;YAC7F,wFAAwF;YACxF,uFAAuF;YACvF,cAAc,CACf,CAAC;IACJ,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
1
+ {"version":3,"file":"gate.js","sourceRoot":"","sources":["../src/gate.ts"],"names":[],"mappings":"AAAA,oFAAoF;AACpF,kFAAkF;AAClF,+DAA+D;AAC/D,EAAE;AACF,+EAA+E;AAC/E,wCAAwC;AACxC,gFAAgF;AAChF,8EAA8E;AAC9E,8EAA8E;AAC9E,EAAE;AACF,iFAAiF;AACjF,iFAAiF;AACjF,iFAAiF;AACjF,gBAAgB;AAShB;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,UAAU,wBAAwB,CACtC,UAA0C,EAC1C,YAAyD;IAEzD,IAAI,CAAC,UAAU,IAAI,UAAU,CAAC,OAAO,KAAK,KAAK,IAAI,UAAU,CAAC,eAAe,IAAI,CAAC;QAAE,OAAO,IAAI,CAAC;IAEhG,IAAI,YAAY,EAAE,sBAAsB,KAAK,IAAI,EAAE,CAAC;QAClD,OAAO,CACL,yFAAyF;YACzF,4FAA4F;YAC5F,8FAA8F,CAC/F,CAAC;IACJ,CAAC;IACD,IAAI,UAAU,CAAC,WAAW,KAAK,IAAI,EAAE,CAAC;QACpC,OAAO,CACL,6FAA6F;YAC7F,wFAAwF;YACxF,uFAAuF;YACvF,cAAc,CACf,CAAC;IACJ,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
@@ -1,4 +1,4 @@
1
- export { createDispatchCoordinator, EndpointOpenError, RunSlotCollisionError, type DispatchCoordinator, type CreateDispatchCoordinatorDeps, type AcquireRunSlotResult, type NoCapacityReason, type CapacityProbe, type DispatchCoordinatorSnapshot, type RunSlotSnapshotEntry, } from "./coordinator.js";
1
+ export { createDispatchCoordinator, EndpointOpenError, LocalCoResidenceError, RunSlotCollisionError, type DispatchCoordinator, type CreateDispatchCoordinatorDeps, type AcquireRunSlotResult, type NoCapacityReason, type CapacityProbe, type DispatchCoordinatorSnapshot, type RunSlotSnapshotEntry, } from "./coordinator.js";
2
2
  export { type RunSlot, type AcquireRunSlotRequest, type McpEndpointManager } from "./types.js";
3
3
  export { nullEndpointManager, createNullEndpointManager } from "./nullEndpointManager.js";
4
4
  export { createPerRunEndpointManager, type CreatePerRunEndpointManagerDeps, type AcquireAgentMcpEndpointForRun, } from "./mcpEndpointManager.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAYA,OAAO,EACL,yBAAyB,EACzB,iBAAiB,EACjB,qBAAqB,EACrB,KAAK,mBAAmB,EACxB,KAAK,6BAA6B,EAClC,KAAK,oBAAoB,EACzB,KAAK,gBAAgB,EACrB,KAAK,aAAa,EAClB,KAAK,2BAA2B,EAChC,KAAK,oBAAoB,GAC1B,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,qBAAqB,EAAE,KAAK,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAE/F,OAAO,EAAE,mBAAmB,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AAE1F,OAAO,EACL,2BAA2B,EAC3B,KAAK,+BAA+B,EACpC,KAAK,6BAA6B,GACnC,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,wBAAwB,EAAE,KAAK,+BAA+B,EAAE,MAAM,WAAW,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAWA,OAAO,EACL,yBAAyB,EACzB,iBAAiB,EACjB,qBAAqB,EACrB,qBAAqB,EACrB,KAAK,mBAAmB,EACxB,KAAK,6BAA6B,EAClC,KAAK,oBAAoB,EACzB,KAAK,gBAAgB,EACrB,KAAK,aAAa,EAClB,KAAK,2BAA2B,EAChC,KAAK,oBAAoB,GAC1B,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,qBAAqB,EAAE,KAAK,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAE/F,OAAO,EAAE,mBAAmB,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AAE1F,OAAO,EACL,2BAA2B,EAC3B,KAAK,+BAA+B,EACpC,KAAK,6BAA6B,GACnC,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,wBAAwB,EAAE,KAAK,+BAA+B,EAAE,MAAM,WAAW,CAAC"}
@@ -4,12 +4,11 @@
4
4
  // machine pool and an injected McpEndpointManager to mint per-run RunSlots.
5
5
  // Distinct from the pure-policy @lorenz/dispatch package.
6
6
  //
7
- // STEP 1 surface: the DispatchCoordinator is a 1:1 passthrough over WorkerPool
8
- // (default slotsPerMachine=1 + the null McpEndpointManager make every RunSlot
9
- // carry mcpEndpoint=null), so the runtime boundary is byte-identical to calling
10
- // the WorkerPool directly. Later steps add per-run MCP endpoints, co-residence, and
11
- // a provider hot-swap behind this same surface.
12
- export { createDispatchCoordinator, EndpointOpenError, RunSlotCollisionError, } from "./coordinator.js";
7
+ // With default slotsPerMachine=1 and the null McpEndpointManager every RunSlot
8
+ // carries mcpEndpoint=null, so the runtime boundary is byte-identical to calling
9
+ // the WorkerPool directly. A concrete McpEndpointManager adds per-run MCP
10
+ // endpoints and co-residence behind this same surface.
11
+ export { createDispatchCoordinator, EndpointOpenError, LocalCoResidenceError, RunSlotCollisionError, } from "./coordinator.js";
13
12
  export { nullEndpointManager, createNullEndpointManager } from "./nullEndpointManager.js";
14
13
  export { createPerRunEndpointManager, } from "./mcpEndpointManager.js";
15
14
  export { checkSlotsPerMachineGate } from "./gate.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,EAAE;AACF,uEAAuE;AACvE,4EAA4E;AAC5E,0DAA0D;AAC1D,EAAE;AACF,+EAA+E;AAC/E,8EAA8E;AAC9E,gFAAgF;AAChF,oFAAoF;AACpF,gDAAgD;AAEhD,OAAO,EACL,yBAAyB,EACzB,iBAAiB,EACjB,qBAAqB,GAQtB,MAAM,kBAAkB,CAAC;AAI1B,OAAO,EAAE,mBAAmB,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AAE1F,OAAO,EACL,2BAA2B,GAG5B,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,wBAAwB,EAAwC,MAAM,WAAW,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,EAAE;AACF,uEAAuE;AACvE,4EAA4E;AAC5E,0DAA0D;AAC1D,EAAE;AACF,+EAA+E;AAC/E,iFAAiF;AACjF,0EAA0E;AAC1E,uDAAuD;AAEvD,OAAO,EACL,yBAAyB,EACzB,iBAAiB,EACjB,qBAAqB,EACrB,qBAAqB,GAQtB,MAAM,kBAAkB,CAAC;AAI1B,OAAO,EAAE,mBAAmB,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AAE1F,OAAO,EACL,2BAA2B,GAG5B,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,wBAAwB,EAAwC,MAAM,WAAW,CAAC"}
@@ -16,11 +16,13 @@ export interface CreatePerRunEndpointManagerDeps {
16
16
  acquireForRun: AcquireAgentMcpEndpointForRun;
17
17
  }
18
18
  /**
19
- * Constructs the CONCRETE per-run {@link McpEndpointManager} (`perRunEndpoint =
20
- * true`, the capability the STEP 3 startup gate consumes). For an ssh-addressable
21
- * `workerHost` it opens the WHOLE per-run endpoint lease via the injected
22
- * `acquireForRun`; for a local (empty) host it returns `null` (acp keeps its
23
- * own endpoint, the byte-identical local path). `release(lease)` closes the lease
19
+ * Constructs the CONCRETE per-run {@link McpEndpointManager}
20
+ * (`perRunClaimEnforcement = true`, the capability the startup gate consumes:
21
+ * each run gets a scoped Token B claim the shared gateway re-checks server-side).
22
+ * For an ssh-addressable `workerHost` it opens the WHOLE per-run endpoint lease
23
+ * via the injected `acquireForRun`; for a local (empty) host it returns `null`
24
+ * (acp keeps its own endpoint, the byte-identical local path). `release(lease)`
25
+ * closes the lease
24
26
  * (revoking the token, dropping the local-server ref, and closing the per-run
25
27
  * tunnel together) and is a safe no-op for the `null` local lease.
26
28
  */
@@ -1 +1 @@
1
- {"version":3,"file":"mcpEndpointManager.d.ts","sourceRoot":"","sources":["../src/mcpEndpointManager.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAEzD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAErD;;;;;;;GAOG;AACH,MAAM,MAAM,6BAA6B,GAAG,CAC1C,QAAQ,EAAE,QAAQ,EAClB,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,KACX,OAAO,CAAC,qBAAqB,CAAC,CAAC;AAEpC,gEAAgE;AAChE,MAAM,WAAW,+BAA+B;IAC9C,yFAAyF;IACzF,aAAa,EAAE,6BAA6B,CAAC;CAC9C;AAaD;;;;;;;;GAQG;AACH,wBAAgB,2BAA2B,CACzC,IAAI,EAAE,+BAA+B,GACpC,kBAAkB,CAuBpB"}
1
+ {"version":3,"file":"mcpEndpointManager.d.ts","sourceRoot":"","sources":["../src/mcpEndpointManager.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAEzD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAErD;;;;;;;GAOG;AACH,MAAM,MAAM,6BAA6B,GAAG,CAC1C,QAAQ,EAAE,QAAQ,EAClB,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,KACX,OAAO,CAAC,qBAAqB,CAAC,CAAC;AAEpC,gEAAgE;AAChE,MAAM,WAAW,+BAA+B;IAC9C,yFAAyF;IACzF,aAAa,EAAE,6BAA6B,CAAC;CAC9C;AAaD;;;;;;;;;;GAUG;AACH,wBAAgB,2BAA2B,CACzC,IAAI,EAAE,+BAA+B,GACpC,kBAAkB,CAuBpB"}