@telora/daemon 0.22.85 → 0.22.91

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 (317) hide show
  1. package/build-info.json +4 -3
  2. package/dist/backends/index.d.ts +1 -1
  3. package/dist/backends/index.d.ts.map +1 -1
  4. package/dist/backends/index.js +1 -1
  5. package/dist/backends/index.js.map +1 -1
  6. package/dist/backends/resolve.d.ts +37 -8
  7. package/dist/backends/resolve.d.ts.map +1 -1
  8. package/dist/backends/resolve.js +62 -28
  9. package/dist/backends/resolve.js.map +1 -1
  10. package/dist/ci/ci-escalation.d.ts +17 -1
  11. package/dist/ci/ci-escalation.d.ts.map +1 -1
  12. package/dist/ci/ci-escalation.js +51 -3
  13. package/dist/ci/ci-escalation.js.map +1 -1
  14. package/dist/ci/ci-red-attribution.d.ts +85 -0
  15. package/dist/ci/ci-red-attribution.d.ts.map +1 -0
  16. package/dist/ci/ci-red-attribution.js +108 -0
  17. package/dist/ci/ci-red-attribution.js.map +1 -0
  18. package/dist/ci/ci-sensor-loop.d.ts +84 -80
  19. package/dist/ci/ci-sensor-loop.d.ts.map +1 -1
  20. package/dist/ci/ci-sensor-loop.js +132 -129
  21. package/dist/ci/ci-sensor-loop.js.map +1 -1
  22. package/dist/cli/connect/config-write.d.ts +7 -4
  23. package/dist/cli/connect/config-write.d.ts.map +1 -1
  24. package/dist/cli/connect/config-write.js +13 -7
  25. package/dist/cli/connect/config-write.js.map +1 -1
  26. package/dist/cli/connect.d.ts.map +1 -1
  27. package/dist/cli/connect.js +11 -1
  28. package/dist/cli/connect.js.map +1 -1
  29. package/dist/cli/update-commands.d.ts.map +1 -1
  30. package/dist/cli/update-commands.js +2 -1
  31. package/dist/cli/update-commands.js.map +1 -1
  32. package/dist/completion/coverage-stabilized.d.ts.map +1 -1
  33. package/dist/completion/coverage-stabilized.js +1 -1
  34. package/dist/completion/coverage-stabilized.js.map +1 -1
  35. package/dist/completion/escalations.d.ts +40 -5
  36. package/dist/completion/escalations.d.ts.map +1 -1
  37. package/dist/completion/escalations.js +19 -11
  38. package/dist/completion/escalations.js.map +1 -1
  39. package/dist/completion/event-escalations.d.ts +12 -1
  40. package/dist/completion/event-escalations.d.ts.map +1 -1
  41. package/dist/completion/event-escalations.js +73 -37
  42. package/dist/completion/event-escalations.js.map +1 -1
  43. package/dist/completion/event.d.ts +4 -1
  44. package/dist/completion/event.d.ts.map +1 -1
  45. package/dist/completion/event.js +1 -1
  46. package/dist/completion/event.js.map +1 -1
  47. package/dist/completion/human-only-act.d.ts +1 -1
  48. package/dist/completion/human-only-act.js +1 -1
  49. package/dist/completion/machine-remediable-demotion.d.ts +28 -1
  50. package/dist/completion/machine-remediable-demotion.d.ts.map +1 -1
  51. package/dist/completion/machine-remediable-demotion.js +9 -6
  52. package/dist/completion/machine-remediable-demotion.js.map +1 -1
  53. package/dist/completion/read-only-pristine.d.ts.map +1 -1
  54. package/dist/completion/read-only-pristine.js +4 -0
  55. package/dist/completion/read-only-pristine.js.map +1 -1
  56. package/dist/completion/review-exit-deps.js +1 -1
  57. package/dist/completion/review-exit-deps.js.map +1 -1
  58. package/dist/completion/review-exit-escalations.d.ts +10 -0
  59. package/dist/completion/review-exit-escalations.d.ts.map +1 -1
  60. package/dist/completion/review-exit-escalations.js +38 -3
  61. package/dist/completion/review-exit-escalations.js.map +1 -1
  62. package/dist/completion/review-exit-phase.d.ts.map +1 -1
  63. package/dist/completion/review-exit-phase.js +8 -7
  64. package/dist/completion/review-exit-phase.js.map +1 -1
  65. package/dist/completion/review-exit-shortfall.d.ts +5 -1
  66. package/dist/completion/review-exit-shortfall.d.ts.map +1 -1
  67. package/dist/completion/review-exit-shortfall.js +8 -3
  68. package/dist/completion/review-exit-shortfall.js.map +1 -1
  69. package/dist/completion/status-advance-phase.d.ts +2 -0
  70. package/dist/completion/status-advance-phase.d.ts.map +1 -1
  71. package/dist/completion/status-advance-phase.js +2 -1
  72. package/dist/completion/status-advance-phase.js.map +1 -1
  73. package/dist/completion/terminated-work-reconcile.js +2 -2
  74. package/dist/completion/terminated-work-reconcile.js.map +1 -1
  75. package/dist/delivery/delivery-advance-block.d.ts +3 -3
  76. package/dist/delivery/delivery-advance-block.d.ts.map +1 -1
  77. package/dist/delivery/delivery-advance-block.js +13 -8
  78. package/dist/delivery/delivery-advance-block.js.map +1 -1
  79. package/dist/delivery/delivery-lifecycle.d.ts +10 -0
  80. package/dist/delivery/delivery-lifecycle.d.ts.map +1 -1
  81. package/dist/delivery/delivery-lifecycle.js +12 -6
  82. package/dist/delivery/delivery-lifecycle.js.map +1 -1
  83. package/dist/delivery/delivery-merge-ops.d.ts.map +1 -1
  84. package/dist/delivery/delivery-merge-ops.js +39 -21
  85. package/dist/delivery/delivery-merge-ops.js.map +1 -1
  86. package/dist/delivery/external-hold.d.ts +8 -2
  87. package/dist/delivery/external-hold.d.ts.map +1 -1
  88. package/dist/delivery/external-hold.js +12 -5
  89. package/dist/delivery/external-hold.js.map +1 -1
  90. package/dist/delivery/operator-hold.d.ts +6 -1
  91. package/dist/delivery/operator-hold.d.ts.map +1 -1
  92. package/dist/delivery/operator-hold.js +31 -10
  93. package/dist/delivery/operator-hold.js.map +1 -1
  94. package/dist/delivery/paused-revival.d.ts +6 -0
  95. package/dist/delivery/paused-revival.d.ts.map +1 -1
  96. package/dist/delivery/paused-revival.js +3 -1
  97. package/dist/delivery/paused-revival.js.map +1 -1
  98. package/dist/directive/directive-dispatch.d.ts.map +1 -1
  99. package/dist/directive/directive-dispatch.js +6 -3
  100. package/dist/directive/directive-dispatch.js.map +1 -1
  101. package/dist/directive/directive-queue.d.ts.map +1 -1
  102. package/dist/directive/directive-queue.js +4 -1
  103. package/dist/directive/directive-queue.js.map +1 -1
  104. package/dist/drift/staleness-sensor.d.ts +20 -0
  105. package/dist/drift/staleness-sensor.d.ts.map +1 -1
  106. package/dist/drift/staleness-sensor.js +54 -21
  107. package/dist/drift/staleness-sensor.js.map +1 -1
  108. package/dist/drift/staleness.d.ts +18 -5
  109. package/dist/drift/staleness.d.ts.map +1 -1
  110. package/dist/drift/staleness.js +28 -15
  111. package/dist/drift/staleness.js.map +1 -1
  112. package/dist/focus/focus-executor.d.ts.map +1 -1
  113. package/dist/focus/focus-executor.js +6 -8
  114. package/dist/focus/focus-executor.js.map +1 -1
  115. package/dist/focus/focus-loop-registry.d.ts.map +1 -1
  116. package/dist/focus/focus-loop-registry.js +23 -13
  117. package/dist/focus/focus-loop-registry.js.map +1 -1
  118. package/dist/focus/focus-respawn-guard.d.ts.map +1 -1
  119. package/dist/focus/focus-respawn-guard.js +21 -4
  120. package/dist/focus/focus-respawn-guard.js.map +1 -1
  121. package/dist/focus/listener-auto-advance.d.ts.map +1 -1
  122. package/dist/focus/listener-auto-advance.js +10 -6
  123. package/dist/focus/listener-auto-advance.js.map +1 -1
  124. package/dist/focus/verify-open-issues.d.ts.map +1 -1
  125. package/dist/focus/verify-open-issues.js +21 -1
  126. package/dist/focus/verify-open-issues.js.map +1 -1
  127. package/dist/focus-stage-lifecycle/wedge-watchdog.d.ts.map +1 -1
  128. package/dist/focus-stage-lifecycle/wedge-watchdog.js +35 -14
  129. package/dist/focus-stage-lifecycle/wedge-watchdog.js.map +1 -1
  130. package/dist/loops/index.d.ts.map +1 -1
  131. package/dist/loops/index.js +2 -1
  132. package/dist/loops/index.js.map +1 -1
  133. package/dist/merge/focus-merge.d.ts +1 -1
  134. package/dist/merge/focus-merge.d.ts.map +1 -1
  135. package/dist/merge/focus-merge.js +5 -1
  136. package/dist/merge/focus-merge.js.map +1 -1
  137. package/dist/merge/merge-back-loop.d.ts +2 -1
  138. package/dist/merge/merge-back-loop.d.ts.map +1 -1
  139. package/dist/merge/merge-back-loop.js +15 -12
  140. package/dist/merge/merge-back-loop.js.map +1 -1
  141. package/dist/merge/merge-conflict-escalation.d.ts.map +1 -1
  142. package/dist/merge/merge-conflict-escalation.js +4 -0
  143. package/dist/merge/merge-conflict-escalation.js.map +1 -1
  144. package/dist/nexus/return.d.ts +14 -15
  145. package/dist/nexus/return.d.ts.map +1 -1
  146. package/dist/nexus/return.js +41 -31
  147. package/dist/nexus/return.js.map +1 -1
  148. package/dist/prompt-sections/execution-sections.d.ts +13 -5
  149. package/dist/prompt-sections/execution-sections.d.ts.map +1 -1
  150. package/dist/prompt-sections/execution-sections.js +78 -18
  151. package/dist/prompt-sections/execution-sections.js.map +1 -1
  152. package/dist/prompt-sections/routing-decider-sections.d.ts +60 -0
  153. package/dist/prompt-sections/routing-decider-sections.d.ts.map +1 -0
  154. package/dist/prompt-sections/routing-decider-sections.js +197 -0
  155. package/dist/prompt-sections/routing-decider-sections.js.map +1 -0
  156. package/dist/queries/agent-resolvable-aging.d.ts +4 -3
  157. package/dist/queries/agent-resolvable-aging.d.ts.map +1 -1
  158. package/dist/queries/agent-resolvable-aging.js +5 -4
  159. package/dist/queries/agent-resolvable-aging.js.map +1 -1
  160. package/dist/queries/agent-resolvable-promotion.d.ts +172 -124
  161. package/dist/queries/agent-resolvable-promotion.d.ts.map +1 -1
  162. package/dist/queries/agent-resolvable-promotion.js +332 -307
  163. package/dist/queries/agent-resolvable-promotion.js.map +1 -1
  164. package/dist/queries/agent-resolvable-retirement.d.ts +105 -0
  165. package/dist/queries/agent-resolvable-retirement.d.ts.map +1 -0
  166. package/dist/queries/agent-resolvable-retirement.js +227 -0
  167. package/dist/queries/agent-resolvable-retirement.js.map +1 -0
  168. package/dist/queries/cause-key.d.ts +109 -0
  169. package/dist/queries/cause-key.d.ts.map +1 -1
  170. package/dist/queries/cause-key.js +93 -1
  171. package/dist/queries/cause-key.js.map +1 -1
  172. package/dist/queries/deliveries.d.ts +14 -0
  173. package/dist/queries/deliveries.d.ts.map +1 -1
  174. package/dist/queries/deliveries.js +20 -2
  175. package/dist/queries/deliveries.js.map +1 -1
  176. package/dist/queries/delivery-gate-state.d.ts +130 -5
  177. package/dist/queries/delivery-gate-state.d.ts.map +1 -1
  178. package/dist/queries/delivery-gate-state.js +111 -2
  179. package/dist/queries/delivery-gate-state.js.map +1 -1
  180. package/dist/queries/escalation-consumption.d.ts +95 -15
  181. package/dist/queries/escalation-consumption.d.ts.map +1 -1
  182. package/dist/queries/escalation-consumption.js +162 -24
  183. package/dist/queries/escalation-consumption.js.map +1 -1
  184. package/dist/queries/escalation-dispositions.d.ts +19 -7
  185. package/dist/queries/escalation-dispositions.d.ts.map +1 -1
  186. package/dist/queries/escalation-dispositions.js +7 -0
  187. package/dist/queries/escalation-dispositions.js.map +1 -1
  188. package/dist/queries/escalation-suppression.d.ts +63 -19
  189. package/dist/queries/escalation-suppression.d.ts.map +1 -1
  190. package/dist/queries/escalation-suppression.js +64 -35
  191. package/dist/queries/escalation-suppression.js.map +1 -1
  192. package/dist/queries/escalations.d.ts +127 -70
  193. package/dist/queries/escalations.d.ts.map +1 -1
  194. package/dist/queries/escalations.js +170 -188
  195. package/dist/queries/escalations.js.map +1 -1
  196. package/dist/queries/filing-observation.d.ts +82 -0
  197. package/dist/queries/filing-observation.d.ts.map +1 -0
  198. package/dist/queries/filing-observation.js +157 -0
  199. package/dist/queries/filing-observation.js.map +1 -0
  200. package/dist/queries/holds.d.ts +69 -2
  201. package/dist/queries/holds.d.ts.map +1 -1
  202. package/dist/queries/holds.js +106 -11
  203. package/dist/queries/holds.js.map +1 -1
  204. package/dist/queries/incident-correlation.d.ts +291 -0
  205. package/dist/queries/incident-correlation.d.ts.map +1 -0
  206. package/dist/queries/incident-correlation.js +408 -0
  207. package/dist/queries/incident-correlation.js.map +1 -0
  208. package/dist/queries/routing-measurement.d.ts +48 -1
  209. package/dist/queries/routing-measurement.d.ts.map +1 -1
  210. package/dist/queries/routing-measurement.js +64 -2
  211. package/dist/queries/routing-measurement.js.map +1 -1
  212. package/dist/queries/routing-quality.d.ts +8 -0
  213. package/dist/queries/routing-quality.d.ts.map +1 -1
  214. package/dist/queries/routing-quality.js +12 -3
  215. package/dist/queries/routing-quality.js.map +1 -1
  216. package/dist/queries/shared.js +1 -1
  217. package/dist/shell/crash-recovery.d.ts.map +1 -1
  218. package/dist/shell/crash-recovery.js +6 -6
  219. package/dist/shell/crash-recovery.js.map +1 -1
  220. package/dist/shell/heartbeat-metadata.d.ts +18 -0
  221. package/dist/shell/heartbeat-metadata.d.ts.map +1 -1
  222. package/dist/shell/heartbeat-metadata.js +24 -0
  223. package/dist/shell/heartbeat-metadata.js.map +1 -1
  224. package/dist/shell/heartbeat.d.ts.map +1 -1
  225. package/dist/shell/heartbeat.js +6 -17
  226. package/dist/shell/heartbeat.js.map +1 -1
  227. package/dist/shell/install-probe-tick.d.ts.map +1 -1
  228. package/dist/shell/install-probe-tick.js +3 -1
  229. package/dist/shell/install-probe-tick.js.map +1 -1
  230. package/dist/shell/model-resolution.d.ts +9 -4
  231. package/dist/shell/model-resolution.d.ts.map +1 -1
  232. package/dist/shell/model-resolution.js +46 -7
  233. package/dist/shell/model-resolution.js.map +1 -1
  234. package/dist/shell/unified-init.d.ts +24 -0
  235. package/dist/shell/unified-init.d.ts.map +1 -1
  236. package/dist/shell/unified-init.js +22 -17
  237. package/dist/shell/unified-init.js.map +1 -1
  238. package/dist/spawn/model-id-guards.d.ts +50 -0
  239. package/dist/spawn/model-id-guards.d.ts.map +1 -0
  240. package/dist/spawn/model-id-guards.js +110 -0
  241. package/dist/spawn/model-id-guards.js.map +1 -0
  242. package/dist/spawn/model-routing.d.ts +1 -43
  243. package/dist/spawn/model-routing.d.ts.map +1 -1
  244. package/dist/spawn/model-routing.js +3 -94
  245. package/dist/spawn/model-routing.js.map +1 -1
  246. package/dist/spawn/respawn-cycle-escalation.d.ts +10 -2
  247. package/dist/spawn/respawn-cycle-escalation.d.ts.map +1 -1
  248. package/dist/spawn/respawn-cycle-escalation.js +16 -2
  249. package/dist/spawn/respawn-cycle-escalation.js.map +1 -1
  250. package/dist/spawn/routing-decider-spawn.d.ts +93 -0
  251. package/dist/spawn/routing-decider-spawn.d.ts.map +1 -0
  252. package/dist/spawn/routing-decider-spawn.js +185 -0
  253. package/dist/spawn/routing-decider-spawn.js.map +1 -0
  254. package/dist/spawn/routing-decider.d.ts +42 -0
  255. package/dist/spawn/routing-decider.d.ts.map +1 -0
  256. package/dist/spawn/routing-decider.js +95 -0
  257. package/dist/spawn/routing-decider.js.map +1 -0
  258. package/dist/spawn/shared.d.ts +8 -0
  259. package/dist/spawn/shared.d.ts.map +1 -1
  260. package/dist/spawn/shared.js +1 -1
  261. package/dist/spawn/shared.js.map +1 -1
  262. package/dist/spawn/spawn-decision.d.ts +24 -16
  263. package/dist/spawn/spawn-decision.d.ts.map +1 -1
  264. package/dist/spawn/spawn-decision.js +28 -11
  265. package/dist/spawn/spawn-decision.js.map +1 -1
  266. package/dist/spawn/worktree-session.d.ts +23 -7
  267. package/dist/spawn/worktree-session.d.ts.map +1 -1
  268. package/dist/spawn/worktree-session.js +54 -22
  269. package/dist/spawn/worktree-session.js.map +1 -1
  270. package/dist/testing/fixtures/index.js +1 -1
  271. package/dist/types/index.js +1 -1
  272. package/dist/update/auto-update.d.ts +20 -3
  273. package/dist/update/auto-update.d.ts.map +1 -1
  274. package/dist/update/auto-update.js +8 -24
  275. package/dist/update/auto-update.js.map +1 -1
  276. package/dist/update/self-update.d.ts +43 -4
  277. package/dist/update/self-update.d.ts.map +1 -1
  278. package/dist/update/self-update.js +61 -38
  279. package/dist/update/self-update.js.map +1 -1
  280. package/dist/update/version-check.d.ts +29 -45
  281. package/dist/update/version-check.d.ts.map +1 -1
  282. package/dist/update/version-check.js +48 -79
  283. package/dist/update/version-check.js.map +1 -1
  284. package/dist/verify/failure-signature.d.ts +91 -0
  285. package/dist/verify/failure-signature.d.ts.map +1 -0
  286. package/dist/verify/failure-signature.js +233 -0
  287. package/dist/verify/failure-signature.js.map +1 -0
  288. package/dist/verify/shortfall-repeat.d.ts +12 -9
  289. package/dist/verify/shortfall-repeat.d.ts.map +1 -1
  290. package/dist/verify/shortfall-repeat.js +38 -14
  291. package/dist/verify/shortfall-repeat.js.map +1 -1
  292. package/dist/verify/stall-detectors.d.ts +19 -43
  293. package/dist/verify/stall-detectors.d.ts.map +1 -1
  294. package/dist/verify/stall-detectors.js +26 -101
  295. package/dist/verify/stall-detectors.js.map +1 -1
  296. package/dist/verify/unreviewed-settle-detector.d.ts +8 -0
  297. package/dist/verify/unreviewed-settle-detector.d.ts.map +1 -1
  298. package/dist/verify/unreviewed-settle-detector.js +15 -1
  299. package/dist/verify/unreviewed-settle-detector.js.map +1 -1
  300. package/dist/verify/verification-deps-default.d.ts.map +1 -1
  301. package/dist/verify/verification-deps-default.js +14 -2
  302. package/dist/verify/verification-deps-default.js.map +1 -1
  303. package/dist/verify/verification-evidence-unavailable-feedback.d.ts.map +1 -1
  304. package/dist/verify/verification-evidence-unavailable-feedback.js +8 -2
  305. package/dist/verify/verification-evidence-unavailable-feedback.js.map +1 -1
  306. package/dist/verify/verification-feedback.d.ts +62 -14
  307. package/dist/verify/verification-feedback.d.ts.map +1 -1
  308. package/dist/verify/verification-feedback.js +101 -28
  309. package/dist/verify/verification-feedback.js.map +1 -1
  310. package/dist/verify/verify-gate-stall.d.ts +116 -0
  311. package/dist/verify/verify-gate-stall.d.ts.map +1 -0
  312. package/dist/verify/verify-gate-stall.js +169 -0
  313. package/dist/verify/verify-gate-stall.js.map +1 -0
  314. package/dist/verify/verify-restatement.d.ts.map +1 -1
  315. package/dist/verify/verify-restatement.js +2 -1
  316. package/dist/verify/verify-restatement.js.map +1 -1
  317. package/package.json +3 -3
@@ -1,4 +1,5 @@
1
1
  import { type FileEscalationIdempotentParams, type FileEscalationIdempotentResult } from '../queries/escalation-suppression.js';
2
+ import type { HumanAct } from '../queries/filing-observation.js';
2
3
  /** escalation_kind for a terminated respawn cycle (DB CHECK is the real gate). */
3
4
  export declare const RESPAWN_CYCLE_EXHAUSTED_KIND = "respawn_cycle_exhausted";
4
5
  export interface RespawnCycleEscalationContext {
@@ -17,8 +18,15 @@ export interface RespawnCycleEscalationDeps {
17
18
  now?: () => number;
18
19
  }
19
20
  /**
20
- * File the one-per-focus respawn_cycle_exhausted escalation (needs_operator).
21
- * Best-effort: never throws -- a failed file must not abort the poll loop.
21
+ * Pure: the act that ends a halted respawn cycle. Arming is the human go-signal,
22
+ * so this billed-loop bound is where the lane hands back to a human: un-arm or
23
+ * re-scope. Exported for testing.
24
+ */
25
+ export declare function respawnCycleExhaustedHumanAct(focusName: string): HumanAct;
26
+ /**
27
+ * File the one-per-focus respawn_cycle_exhausted escalation (needs_operator,
28
+ * naming the un-arm / re-scope act). Best-effort: never throws -- a failed file
29
+ * must not abort the poll loop.
22
30
  */
23
31
  export declare function fileRespawnCycleExhaustedEscalation(ctx: RespawnCycleEscalationContext, deps?: RespawnCycleEscalationDeps): Promise<void>;
24
32
  //# sourceMappingURL=respawn-cycle-escalation.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"respawn-cycle-escalation.d.ts","sourceRoot":"","sources":["../../src/spawn/respawn-cycle-escalation.ts"],"names":[],"mappings":"AAuBA,OAAO,EAEL,KAAK,8BAA8B,EACnC,KAAK,8BAA8B,EACpC,MAAM,sCAAsC,CAAC;AAO9C,kFAAkF;AAClF,eAAO,MAAM,4BAA4B,4BAA4B,CAAC;AAEtE,MAAM,WAAW,6BAA6B;IAC5C,cAAc,EAAE,MAAM,CAAC;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,0BAA0B;IACzC,cAAc,EAAE,CAAC,MAAM,EAAE,8BAA8B,KAAK,OAAO,CAAC,8BAA8B,CAAC,CAAC;IACpG,+FAA+F;IAC/F,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IAC7E,8CAA8C;IAC9C,GAAG,CAAC,EAAE,MAAM,MAAM,CAAC;CACpB;AAQD;;;GAGG;AACH,wBAAsB,mCAAmC,CACvD,GAAG,EAAE,6BAA6B,EAClC,IAAI,GAAE,0BAAwC,GAC7C,OAAO,CAAC,IAAI,CAAC,CA0Df"}
1
+ {"version":3,"file":"respawn-cycle-escalation.d.ts","sourceRoot":"","sources":["../../src/spawn/respawn-cycle-escalation.ts"],"names":[],"mappings":"AAuBA,OAAO,EAEL,KAAK,8BAA8B,EACnC,KAAK,8BAA8B,EACpC,MAAM,sCAAsC,CAAC;AAE9C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AAMjE,kFAAkF;AAClF,eAAO,MAAM,4BAA4B,4BAA4B,CAAC;AAEtE,MAAM,WAAW,6BAA6B;IAC5C,cAAc,EAAE,MAAM,CAAC;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,0BAA0B;IACzC,cAAc,EAAE,CAAC,MAAM,EAAE,8BAA8B,KAAK,OAAO,CAAC,8BAA8B,CAAC,CAAC;IACpG,+FAA+F;IAC/F,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IAC7E,8CAA8C;IAC9C,GAAG,CAAC,EAAE,MAAM,MAAM,CAAC;CACpB;AAQD;;;;GAIG;AACH,wBAAgB,6BAA6B,CAAC,SAAS,EAAE,MAAM,GAAG,QAAQ,CAOzE;AAED;;;;GAIG;AACH,wBAAsB,mCAAmC,CACvD,GAAG,EAAE,6BAA6B,EAClC,IAAI,GAAE,0BAAwC,GAC7C,OAAO,CAAC,IAAI,CAAC,CA2Df"}
@@ -32,8 +32,21 @@ const defaultDeps = {
32
32
  now: () => Date.now(),
33
33
  };
34
34
  /**
35
- * File the one-per-focus respawn_cycle_exhausted escalation (needs_operator).
36
- * Best-effort: never throws -- a failed file must not abort the poll loop.
35
+ * Pure: the act that ends a halted respawn cycle. Arming is the human go-signal,
36
+ * so this billed-loop bound is where the lane hands back to a human: un-arm or
37
+ * re-scope. Exported for testing.
38
+ */
39
+ export function respawnCycleExhaustedHumanAct(focusName) {
40
+ return {
41
+ kind: 'unreachable_capability',
42
+ act: `Un-arm focus "${focusName}" (clear its assigned agent role), or re-scope it so a spawned team ` +
43
+ `has actionable work -- respawns stay halted until then or until a team makes progress.`,
44
+ };
45
+ }
46
+ /**
47
+ * File the one-per-focus respawn_cycle_exhausted escalation (needs_operator,
48
+ * naming the un-arm / re-scope act). Best-effort: never throws -- a failed file
49
+ * must not abort the poll loop.
37
50
  */
38
51
  export async function fileRespawnCycleExhaustedEscalation(ctx, deps = defaultDeps) {
39
52
  const getStreak = deps.getStreak ?? getRespawnCycleStreak;
@@ -50,6 +63,7 @@ export async function fileRespawnCycleExhaustedEscalation(ctx, deps = defaultDep
50
63
  issueId: null,
51
64
  reasonType: ESCALATION_REASONS.BLOCKED_BY_EXTERNAL,
52
65
  disposition: ESCALATION_DISPOSITIONS.NEEDS_OPERATOR,
66
+ humanAct: respawnCycleExhaustedHumanAct(ctx.focusName),
53
67
  anchor: { focusId: ctx.focusId },
54
68
  escalationKind: RESPAWN_CYCLE_EXHAUSTED_KIND,
55
69
  description: `Focus "${ctx.focusName}" respawn cycle has been terminated: its teams have been ` +
@@ -1 +1 @@
1
- {"version":3,"file":"respawn-cycle-escalation.js","sourceRoot":"","sources":["../../src/spawn/respawn-cycle-escalation.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,8DAA8D;AAC9D,gBAAgB;AAEhB;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,kBAAkB,EAAE,uBAAuB,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAC7F,OAAO,EACL,wBAAwB,IAAI,+BAA+B,GAG5D,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAA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AAM,EAAE,EAAE,OAAO,EAAE,GAAG,CAAC,OAAO,EAAE;YAChC,cAAc,EAAE,4BAA4B;YAC5C,WAAW,EACT,UAAU,GAAG,CAAC,SAAS,2DAA2D;gBAClF,yBAAyB,KAAK,kBAAkB,UAAU,4BAA4B;gBACtF,yFAAyF;gBACzF,0FAA0F;gBAC1F,gGAAgG;gBAChG,cAAc,GAAG,CAAC,SAAS,IAAI;gBAC/B,iBAAiB,GAAG,CAAC,OAAO,IAAI;gBAChC,uBAAuB,KAAK,IAAI;gBAChC,wBAAwB,UAAU,MAAM;gBACxC,sFAAsF;gBACtF,qFAAqF;gBACrF,0CAA0C;YAC5C,YAAY,EACV,2BAA2B,KAAK,gEAAgE;gBAChG,wFAAwF;gBACxF,sDAAsD;YACxD,UAAU,EACR,0FAA0F;gBAC1F,2EAA2E;YAC7E,QAAQ,EAAE;gBACR,KAAK,EAAE,4BAA4B;gBACnC,SAAS,EAAE,GAAG,CAAC,SAAS;gBACxB,aAAa,EAAE,KAAK;gBACpB,cAAc,EAAE,UAAU;aAC3B;SACF,CAAC,EACF,EAAE,WAAW,EAAE,CAAC,EAAE,KAAK,EAAE,sCAAsC,GAAG,CAAC,OAAO,EAAE,EAAE,CAC/E,CAAC;QACF,GAAG,CAAC,IAAI,CACN,wEAAwE,GAAG,CAAC,SAAS,IAAI;YACzF,cAAc,KAAK,aAAa,UAAU,MAAM,CACjD,CAAC;IACJ,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,GAAG,CAAC,IAAI,CACN,iFAAiF,GAAG,CAAC,SAAS,IAAI,EACjG,GAAa,CAAC,OAAO,CACvB,CAAC;IACJ,CAAC;AACH,CAAC"}
1
+ {"version":3,"file":"respawn-cycle-escalation.js","sourceRoot":"","sources":["../../src/spawn/respawn-cycle-escalation.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,8DAA8D;AAC9D,gBAAgB;AAEhB;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,kBA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EAAE,CAC/E,CAAC;QACF,GAAG,CAAC,IAAI,CACN,wEAAwE,GAAG,CAAC,SAAS,IAAI;YACzF,cAAc,KAAK,aAAa,UAAU,MAAM,CACjD,CAAC;IACJ,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,GAAG,CAAC,IAAI,CACN,iFAAiF,GAAG,CAAC,SAAS,IAAI,EACjG,GAAa,CAAC,OAAO,CACvB,CAAC;IACJ,CAAC;AACH,CAAC"}
@@ -0,0 +1,93 @@
1
+ /**
2
+ * The routing decider's PROCESS: a one-shot `claude --print` session.
3
+ *
4
+ * Built on the audit assessor's one-shot template (spawn/lifecycle.ts
5
+ * spawnAuditAgent) and its shared pieces rather than a copy of them: the levered
6
+ * spawn environment (phase + stage required), the StreamJsonParser for the
7
+ * assistant text + session id, the worker registry (so the single teardown reap
8
+ * covers a decider still running at stop), and buildAuditMetricRow for the
9
+ * stream-json `result` cost capture (--print sessions emit no OTLP rows).
10
+ *
11
+ * The process seam is injected (RoutingDeciderSpawnSeam) so the args, the kill
12
+ * timeout and the cost row are unit-tested without a real process.
13
+ */
14
+ import { type ChildProcess } from 'node:child_process';
15
+ import { type TokenUsage } from '@telora/daemon-core';
16
+ import type { DaemonConfig } from '../types/index.js';
17
+ import { type TelemetryMetricRow } from '../otlp/telemetry-writer.js';
18
+ /**
19
+ * MODEL PIN: 'opus'. A routing decision is the one place the system chooses to
20
+ * interrupt a human: it climbs the intent ladder (product/focus context +
21
+ * in-flight injections), verifies the condition against live state, separates the
22
+ * machine work inside a condition from the one act only a human can perform, and
23
+ * often performs that machine work itself. A wrong call either spends human
24
+ * attention on machine work or strands a genuine human act in a hidden lane, so
25
+ * the reasoning depth warrants the stronger model -- the same judgment the audit
26
+ * assessor's pin records (AUDIT_CAPTURE_MODEL). Volume is bounded by
27
+ * ROUTING_DECIDER_MAX_PER_SWEEP + a governor slot. The pricing table keys on the
28
+ * 'opus' substring.
29
+ */
30
+ export declare const ROUTING_DECIDER_MODEL = "opus";
31
+ /** Kill a decider that has not exited within this window (10 minutes). */
32
+ export declare const ROUTING_DECIDER_TIMEOUT_MS: number;
33
+ /** Telemetry phase + stage tag (a routing decision has no workflow-stage dimension). */
34
+ export declare const ROUTING_DECIDER_PHASE = "routing_decision";
35
+ /**
36
+ * MCP tools pre-approved for the decider: telora_agent (escalation_get /
37
+ * escalation_update / escalate) plus the Telora context it verifies against and
38
+ * the planning tools it may use to clear a condition itself. (--allowed-tools
39
+ * pre-approves; the spawn environment's execution MCP profile registers them.)
40
+ */
41
+ export declare const ROUTING_DECIDER_MCP_TOOLS: readonly string[];
42
+ export interface RoutingDeciderSpawnOptions {
43
+ config: DaemonConfig;
44
+ prompt: string;
45
+ /** Where the session runs: the product repo (its .mcp.json + CLAUDE.md). No git work is done. */
46
+ cwd: string;
47
+ focusId: string | null;
48
+ /** The observation being decided (telemetry + worker label). */
49
+ escalationId: string;
50
+ model: string;
51
+ timeoutMs: number;
52
+ allowedTools: readonly string[];
53
+ }
54
+ export interface RoutingDeciderSpawnResult {
55
+ /** Whether the process actually started (the 'spawn' event fired). */
56
+ started: boolean;
57
+ exitCode: number | null;
58
+ timedOut: boolean;
59
+ /** The reconstructed assistant text (raw stdout when no stream-json parsed). */
60
+ stdout: string;
61
+ stderr: string;
62
+ sessionId: string | null;
63
+ errorMessage?: string;
64
+ }
65
+ /** Injectable process seam (tests pass a fake child). */
66
+ export interface RoutingDeciderSpawnSeam {
67
+ spawnProcess: (command: string, args: string[], options: {
68
+ cwd: string;
69
+ env: Record<string, string | undefined>;
70
+ }) => ChildProcess;
71
+ bufferMetric?: (row: TelemetryMetricRow) => void;
72
+ }
73
+ /** Pure: the CLI args (prompt last). */
74
+ export declare function buildRoutingDeciderArgs(opts: Pick<RoutingDeciderSpawnOptions, 'allowedTools' | 'model' | 'prompt'>): string[];
75
+ /**
76
+ * Pure: the telemetry row for a decider's stream-json `result` usage -- the audit
77
+ * row shape (buildAuditMetricRow) re-tagged with the decider's model, phase and
78
+ * source. The cost is the event's total_cost_usd, else estimated for THIS model.
79
+ */
80
+ export declare function buildRoutingDeciderMetricRow(params: {
81
+ organizationId: string;
82
+ focusId: string | null;
83
+ sessionId: string | null;
84
+ escalationId: string;
85
+ model: string;
86
+ usage: TokenUsage;
87
+ totalCostUsd: number | null;
88
+ periodStart: string;
89
+ periodEnd: string;
90
+ }): TelemetryMetricRow;
91
+ /** Spawn one routing decider and resolve when it exits (or is killed at the timeout). Never rejects. */
92
+ export declare function spawnRoutingDecider(opts: RoutingDeciderSpawnOptions, seam?: RoutingDeciderSpawnSeam): Promise<RoutingDeciderSpawnResult>;
93
+ //# sourceMappingURL=routing-decider-spawn.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"routing-decider-spawn.d.ts","sourceRoot":"","sources":["../../src/spawn/routing-decider-spawn.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAsB,KAAK,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAC3E,OAAO,EAKL,KAAK,UAAU,EAChB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAItD,OAAO,EAAuC,KAAK,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAM3G;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,qBAAqB,SAAS,CAAC;AAE5C,0EAA0E;AAC1E,eAAO,MAAM,0BAA0B,QAAiB,CAAC;AAEzD,wFAAwF;AACxF,eAAO,MAAM,qBAAqB,qBAAqB,CAAC;AAExD;;;;;GAKG;AACH,eAAO,MAAM,yBAAyB,EAAE,SAAS,MAAM,EAQtD,CAAC;AAEF,MAAM,WAAW,0BAA0B;IACzC,MAAM,EAAE,YAAY,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,iGAAiG;IACjG,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,gEAAgE;IAChE,YAAY,EAA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B,SAAS,EAAE,MAAM,CAAC;CACnB,GAAG,kBAAkB,CAoBrB;AAED,wGAAwG;AACxG,wBAAsB,mBAAmB,CACvC,IAAI,EAAE,0BAA0B,EAChC,IAAI,GAAE,uBAAqC,GAC1C,OAAO,CAAC,yBAAyB,CAAC,CA+EpC"}
@@ -0,0 +1,185 @@
1
+ // PINNED-BY-BEGIN (generated by gen:pinned-by -- do not hand-edit; checked by lint:pinned-by)
2
+ // Pinned by: packages/daemon/src/spawn/routing-decider-spawn.test.ts
3
+ // PINNED-BY-END
4
+ /**
5
+ * The routing decider's PROCESS: a one-shot `claude --print` session.
6
+ *
7
+ * Built on the audit assessor's one-shot template (spawn/lifecycle.ts
8
+ * spawnAuditAgent) and its shared pieces rather than a copy of them: the levered
9
+ * spawn environment (phase + stage required), the StreamJsonParser for the
10
+ * assistant text + session id, the worker registry (so the single teardown reap
11
+ * covers a decider still running at stop), and buildAuditMetricRow for the
12
+ * stream-json `result` cost capture (--print sessions emit no OTLP rows).
13
+ *
14
+ * The process seam is injected (RoutingDeciderSpawnSeam) so the args, the kill
15
+ * timeout and the cost row are unit-tested without a real process.
16
+ */
17
+ import { spawn as nodeSpawn } from 'node:child_process';
18
+ import { stripClaudeCodeEnvVars, StreamJsonParser, } from '@telora/daemon-core';
19
+ import { trackChildProcess } from './worker-registry.js';
20
+ import { buildLeveredSpawnEnvironment } from './spawn-environment.js';
21
+ import { buildAuditMetricRow } from './lifecycle.js';
22
+ import { bufferMetric as defaultBufferMetric } from '../otlp/telemetry-writer.js';
23
+ import { estimateLoopCostUsd } from '../loops/index.js';
24
+ import { createLogger } from '../shell/log.js';
25
+ const log = createLogger({ module: 'routing-decider' });
26
+ /**
27
+ * MODEL PIN: 'opus'. A routing decision is the one place the system chooses to
28
+ * interrupt a human: it climbs the intent ladder (product/focus context +
29
+ * in-flight injections), verifies the condition against live state, separates the
30
+ * machine work inside a condition from the one act only a human can perform, and
31
+ * often performs that machine work itself. A wrong call either spends human
32
+ * attention on machine work or strands a genuine human act in a hidden lane, so
33
+ * the reasoning depth warrants the stronger model -- the same judgment the audit
34
+ * assessor's pin records (AUDIT_CAPTURE_MODEL). Volume is bounded by
35
+ * ROUTING_DECIDER_MAX_PER_SWEEP + a governor slot. The pricing table keys on the
36
+ * 'opus' substring.
37
+ */
38
+ export const ROUTING_DECIDER_MODEL = 'opus';
39
+ /** Kill a decider that has not exited within this window (10 minutes). */
40
+ export const ROUTING_DECIDER_TIMEOUT_MS = 10 * 60 * 1000;
41
+ /** Telemetry phase + stage tag (a routing decision has no workflow-stage dimension). */
42
+ export const ROUTING_DECIDER_PHASE = 'routing_decision';
43
+ /**
44
+ * MCP tools pre-approved for the decider: telora_agent (escalation_get /
45
+ * escalation_update / escalate) plus the Telora context it verifies against and
46
+ * the planning tools it may use to clear a condition itself. (--allowed-tools
47
+ * pre-approves; the spawn environment's execution MCP profile registers them.)
48
+ */
49
+ export const ROUTING_DECIDER_MCP_TOOLS = [
50
+ 'mcp__telora-products__telora_agent',
51
+ 'mcp__telora-products__telora_product',
52
+ 'mcp__telora-products__telora_product_focus',
53
+ 'mcp__telora-products__telora_product_delivery',
54
+ 'mcp__telora-products__telora_product_issue',
55
+ 'mcp__telora-products__telora_reality_tree_traverse',
56
+ 'mcp__telora-products__telora_wiki_search',
57
+ ];
58
+ const defaultSeam = {
59
+ spawnProcess: (command, args, options) => nodeSpawn(command, args, { cwd: options.cwd, env: options.env, stdio: ['pipe', 'pipe', 'pipe'] }),
60
+ };
61
+ /** Pure: the CLI args (prompt last). */
62
+ export function buildRoutingDeciderArgs(opts) {
63
+ return [
64
+ '--print',
65
+ '--output-format', 'stream-json',
66
+ '--verbose',
67
+ '--dangerously-skip-permissions',
68
+ '--setting-sources', 'project,local',
69
+ '--allowed-tools', opts.allowedTools.join(','),
70
+ '--model', opts.model,
71
+ opts.prompt,
72
+ ];
73
+ }
74
+ /**
75
+ * Pure: the telemetry row for a decider's stream-json `result` usage -- the audit
76
+ * row shape (buildAuditMetricRow) re-tagged with the decider's model, phase and
77
+ * source. The cost is the event's total_cost_usd, else estimated for THIS model.
78
+ */
79
+ export function buildRoutingDeciderMetricRow(params) {
80
+ const cost = params.totalCostUsd !== null && Number.isFinite(params.totalCostUsd)
81
+ ? params.totalCostUsd
82
+ : estimateLoopCostUsd(params.model, params.usage);
83
+ const row = buildAuditMetricRow({
84
+ organizationId: params.organizationId,
85
+ focusId: params.focusId,
86
+ sessionId: params.sessionId,
87
+ cycleNumber: 0,
88
+ usage: params.usage,
89
+ totalCostUsd: cost,
90
+ periodStart: params.periodStart,
91
+ periodEnd: params.periodEnd,
92
+ });
93
+ return {
94
+ ...row,
95
+ model: params.model,
96
+ phase: ROUTING_DECIDER_PHASE,
97
+ metadata: { source: 'routing-decider', escalationId: params.escalationId },
98
+ };
99
+ }
100
+ /** Spawn one routing decider and resolve when it exits (or is killed at the timeout). Never rejects. */
101
+ export async function spawnRoutingDecider(opts, seam = defaultSeam) {
102
+ const { config, focusId, escalationId } = opts;
103
+ const spawnEnv = buildLeveredSpawnEnvironment(config, {
104
+ orgId: config.organizationId,
105
+ ...(focusId ? { focusId } : {}),
106
+ phase: ROUTING_DECIDER_PHASE,
107
+ stage: ROUTING_DECIDER_PHASE,
108
+ });
109
+ spawnEnv.TELORA_DAEMON_ROUTING_DECIDER = escalationId;
110
+ const periodStart = new Date().toISOString();
111
+ return await new Promise((resolve) => {
112
+ let child;
113
+ try {
114
+ child = seam.spawnProcess(config.claudeCodePath, buildRoutingDeciderArgs(opts), {
115
+ cwd: opts.cwd,
116
+ env: stripClaudeCodeEnvVars(spawnEnv),
117
+ });
118
+ }
119
+ catch (err) {
120
+ resolve({ started: false, exitCode: null, timedOut: false, stdout: '', stderr: '', sessionId: null, errorMessage: `spawn failed: ${err.message}` });
121
+ return;
122
+ }
123
+ let started = false;
124
+ let timedOut = false;
125
+ let rawStdout = '';
126
+ let stderr = '';
127
+ let assistantText = '';
128
+ child.once('spawn', () => {
129
+ started = true;
130
+ // Register so the single teardown reap covers a decider still running at stop.
131
+ trackChildProcess(child, `routing-decider:${escalationId}`);
132
+ });
133
+ child.stdin?.end();
134
+ const parser = new StreamJsonParser();
135
+ if (child.stdout)
136
+ parser.attach(child.stdout);
137
+ parser.on('assistant', (msg) => {
138
+ for (const block of msg.message.content) {
139
+ if (block.type === 'text')
140
+ assistantText += block.text + '\n';
141
+ }
142
+ });
143
+ parser.on('error', () => { });
144
+ parser.on('result', (ev) => {
145
+ if (!ev.usage)
146
+ return;
147
+ try {
148
+ (seam.bufferMetric ?? defaultBufferMetric)(buildRoutingDeciderMetricRow({
149
+ organizationId: config.organizationId,
150
+ focusId,
151
+ sessionId: parser.sessionId ?? null,
152
+ escalationId,
153
+ model: opts.model,
154
+ usage: ev.usage,
155
+ totalCostUsd: typeof ev.total_cost_usd === 'number' && Number.isFinite(ev.total_cost_usd) ? ev.total_cost_usd : null,
156
+ periodStart,
157
+ periodEnd: new Date().toISOString(),
158
+ }));
159
+ }
160
+ catch (err) {
161
+ log.info(`[routing-decider] Telemetry capture failed (non-fatal): ${err.message}`);
162
+ }
163
+ });
164
+ child.stdout?.on('data', (chunk) => { rawStdout += chunk.toString('utf8'); });
165
+ child.stderr?.on('data', (chunk) => { stderr += chunk.toString('utf8'); });
166
+ const timer = setTimeout(() => {
167
+ timedOut = true;
168
+ log.warn(`[routing-decider] decider for ${escalationId} timed out after ${Math.round(opts.timeoutMs / 1000)}s, killing`);
169
+ try {
170
+ child.kill('SIGKILL');
171
+ }
172
+ catch { /* already gone */ }
173
+ }, opts.timeoutMs);
174
+ const text = () => (assistantText.trim() ? assistantText : rawStdout);
175
+ child.on('error', (err) => {
176
+ clearTimeout(timer);
177
+ resolve({ started, exitCode: null, timedOut, stdout: text(), stderr, sessionId: parser.sessionId, errorMessage: `spawn error: ${err.message}` });
178
+ });
179
+ child.on('close', (code) => {
180
+ clearTimeout(timer);
181
+ resolve({ started, exitCode: code, timedOut, stdout: text(), stderr, sessionId: parser.sessionId });
182
+ });
183
+ });
184
+ }
185
+ //# sourceMappingURL=routing-decider-spawn.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"routing-decider-spawn.js","sourceRoot":"","sources":["../../src/spawn/routing-decider-spawn.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,qEAAqE;AACrE,gBAAgB;AAEhB;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,KAAK,IAAI,SAAS,EAAqB,MAAM,oBAAoB,CAAC;AAC3E,OAAO,EACL,sBAAsB,EACtB,gBAAgB,GAIjB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,4BAA4B,EAAE,MAAM,wBAAwB,CAAC;AACtE,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAE,YAAY,IAAI,mBAAmB,EAA2B,MAAM,6BAA6B,CAAC;AAC3G,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,MAAM,GAAG,GAAG,YAAY,CAAC,EAAE,MAAM,EAAE,iBAAiB,EAAE,CAAC,CAAC;AAExD;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,MAAM,CAAC;AAE5C,0EAA0E;AAC1E,MAAM,CAAC,MAAM,0BAA0B,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AAEzD,wFAAwF;AACxF,MAAM,CAAC,MAAM,qBAAqB,GAAG,kBAAkB,CAAC;AAExD;;;;;GAKG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAsB;IAC1D,oCAAoC;IACpC,sCAAsC;IACtC,4CAA4C;IAC5C,+CAA+C;IAC/C,4CAA4C;IAC5C,oDAAoD;IACpD,0CAA0C;CAC3C,CAAC;AAiCF,MAAM,WAAW,GAA4B;IAC3C,YAAY,EAAE,CAAC,OAAO,EAAE,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AAG,GAAW,EAAE,CAAC,CAAC,aAAa,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;QAC9E,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,GAAG,EAAE,EAAE;YACxB,YAAY,CAAC,KAAK,CAAC,CAAC;YACpB,OAAO,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,CAAC,SAAS,EAAE,YAAY,EAAE,gBAAgB,GAAG,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;QACnJ,CAAC,CAAC,CAAC;QACH,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,IAAmB,EAAE,EAAE;YACxC,YAAY,CAAC,KAAK,CAAC,CAAC;YACpB,OAAO,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,CAAC,SAAS,EAAE,CAAC,CAAC;QACtG,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,42 @@
1
+ /**
2
+ * The ROUTING DECIDER the org-wide agent_resolvable sweep hands observations to
3
+ * (queries/agent-resolvable-promotion.ts `decide`). Only an agent makes a filing
4
+ * human-facing; this is that agent.
5
+ *
6
+ * One call = one observation:
7
+ * 1. take a non-blocking governor slot (engine ROUTING_DECIDER_GOVERNOR_ENGINE,
8
+ * bounded by the global session cap) -- none free: the decider does not run
9
+ * and the observation stays in the lane (the sweep counts it undecided);
10
+ * 2. assemble the intent ladder for the observation's focus through the
11
+ * assembly resolvers (ROUTING_DECIDER_LADDER_RECIPE, the same loop.context /
12
+ * focus.injections a coding spawn gets, led by focus.context);
13
+ * 3. build the prompt (prompt-sections/routing-decider-sections.ts) and spawn the
14
+ * one-shot session (spawn/routing-decider-spawn.ts);
15
+ * 4. release the slot, and report ran / decided / detail.
16
+ * The decision itself lands on Telora through the decider's own MCP calls.
17
+ */
18
+ import type { ResourceGovernor } from '@telora/daemon-core';
19
+ import type { DaemonConfig } from '../types/index.js';
20
+ import type { RoutingDecider, RoutingDecisionRequest, RoutingDecisionResult } from '../queries/agent-resolvable-promotion.js';
21
+ import { type RoutingDeciderSpawnOptions, type RoutingDeciderSpawnResult } from './routing-decider-spawn.js';
22
+ /** The intent ladder a decider reads first. */
23
+ export declare const ROUTING_DECIDER_LADDER_RECIPE: readonly string[];
24
+ /**
25
+ * Governor engine name for decider slots. No per-engine limit is configured for it,
26
+ * so a decider counts against (and is bounded by) the global session cap alongside
27
+ * focus teams; the per-sweep cap keeps it from crowding them out.
28
+ */
29
+ export declare const ROUTING_DECIDER_GOVERNOR_ENGINE = "routing-decider";
30
+ export interface RoutingDeciderDeps {
31
+ governor: Pick<ResourceGovernor, 'tryAcquireSlot' | 'releaseSlot'> | null;
32
+ config: DaemonConfig;
33
+ assembleLadder?: (request: RoutingDecisionRequest, config: DaemonConfig) => Promise<string>;
34
+ spawn?: (opts: RoutingDeciderSpawnOptions) => Promise<RoutingDeciderSpawnResult>;
35
+ }
36
+ /** Pure: the product-scoped config for an observation's product (the base config when unknown). */
37
+ export declare function deciderConfigFor(config: DaemonConfig, productId: string | null): DaemonConfig;
38
+ /** Pure: a spawn result as the sweep's RoutingDecisionResult. */
39
+ export declare function toRoutingDecisionResult(result: RoutingDeciderSpawnResult): RoutingDecisionResult;
40
+ /** Build the decider the sweep injects. */
41
+ export declare function createRoutingDecider(deps: RoutingDeciderDeps): RoutingDecider;
42
+ //# sourceMappingURL=routing-decider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"routing-decider.d.ts","sourceRoot":"","sources":["../../src/spawn/routing-decider.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAa,MAAM,qBAAqB,CAAC;AACvE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,KAAK,EAAE,cAAc,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,0CAA0C,CAAC;AAM9H,OAAO,EAKL,KAAK,0BAA0B,EAC/B,KAAK,yBAAyB,EAC/B,MAAM,4BAA4B,CAAC;AAEpC,+CAA+C;AAC/C,eAAO,MAAM,6BAA6B,EAAE,SAAS,MAAM,EAA0D,CAAC;AAEtH;;;;GAIG;AACH,eAAO,MAAM,+BAA+B,oBAAoB,CAAC;AAEjE,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,IAAI,CAAC,gBAAgB,EAAE,gBAAgB,GAAG,aAAa,CAAC,GAAG,IAAI,CAAC;IAC1E,MAAM,EAAE,YAAY,CAAC;IACrB,cAAc,CAAC,EAAE,CAAC,OAAO,EAAE,sBAAsB,EAAE,MAAM,EAAE,YAAY,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IAC5F,KAAK,CAAC,EAAE,CAAC,IAAI,EAAE,0BAA0B,KAAK,OAAO,CAAC,yBAAyB,CAAC,CAAC;CAClF;AAED,mGAAmG;AACnG,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI,GAAG,YAAY,CAG7F;AAED,iEAAiE;AACjE,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,yBAAyB,GAAG,qBAAqB,CAShG;AAyCD,2CAA2C;AAC3C,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,kBAAkB,GAAG,cAAc,CAe7E"}
@@ -0,0 +1,95 @@
1
+ // PINNED-BY-BEGIN (generated by gen:pinned-by -- do not hand-edit; checked by lint:pinned-by)
2
+ // Pinned by: packages/daemon/src/spawn/routing-decider-spawn.test.ts
3
+ // PINNED-BY-END
4
+ import { resolveAssemblyRecipeWithManifest } from '../resolvers/assembly-engine.js';
5
+ import { initResolvers } from '../resolvers/index.js';
6
+ import { getFocusDeliveries } from '../queries/focuses.js';
7
+ import { configForProduct, findProduct } from '../shell/config.js';
8
+ import { buildRoutingDeciderPrompt, parseRoutingDecision } from '../prompt-sections/routing-decider-sections.js';
9
+ import { spawnRoutingDecider, ROUTING_DECIDER_MCP_TOOLS, ROUTING_DECIDER_MODEL, ROUTING_DECIDER_TIMEOUT_MS, } from './routing-decider-spawn.js';
10
+ /** The intent ladder a decider reads first. */
11
+ export const ROUTING_DECIDER_LADDER_RECIPE = ['focus.context', 'loop.context', 'focus.injections'];
12
+ /**
13
+ * Governor engine name for decider slots. No per-engine limit is configured for it,
14
+ * so a decider counts against (and is bounded by) the global session cap alongside
15
+ * focus teams; the per-sweep cap keeps it from crowding them out.
16
+ */
17
+ export const ROUTING_DECIDER_GOVERNOR_ENGINE = 'routing-decider';
18
+ /** Pure: the product-scoped config for an observation's product (the base config when unknown). */
19
+ export function deciderConfigFor(config, productId) {
20
+ const product = productId ? findProduct(config, productId) : undefined;
21
+ return product ? configForProduct(config, product) : config;
22
+ }
23
+ /** Pure: a spawn result as the sweep's RoutingDecisionResult. */
24
+ export function toRoutingDecisionResult(result) {
25
+ if (!result.started) {
26
+ return { ran: false, decided: false, detail: result.errorMessage ?? 'decider process did not start' };
27
+ }
28
+ if (result.timedOut)
29
+ return { ran: true, decided: false, detail: 'decider timed out (killed)' };
30
+ if (result.exitCode !== 0 || result.errorMessage) {
31
+ return { ran: true, decided: false, detail: `decider exited ${result.exitCode ?? 'null'}${result.errorMessage ? ` (${result.errorMessage})` : ''}` };
32
+ }
33
+ return { ran: true, decided: true, detail: `decider exited 0; decision ${parseRoutingDecision(result.stdout) ?? 'unstated'}` };
34
+ }
35
+ async function defaultAssembleLadder(request, config) {
36
+ const focusId = request.item.focusId;
37
+ if (!focusId)
38
+ return '';
39
+ initResolvers();
40
+ const deliveries = await getFocusDeliveries(focusId).catch(() => []);
41
+ const ctx = {
42
+ focusId,
43
+ deliveryIds: deliveries.map((d) => d.id),
44
+ worktreePath: null,
45
+ config,
46
+ organizationId: request.item.organizationId ?? config.organizationId,
47
+ productId: request.item.productId ?? config.productId,
48
+ };
49
+ return (await resolveAssemblyRecipeWithManifest([...ROUTING_DECIDER_LADDER_RECIPE], ctx)).content;
50
+ }
51
+ async function runDecider(deps, request) {
52
+ const config = deciderConfigFor(deps.config, request.item.productId);
53
+ let ladder = '';
54
+ let ladderError;
55
+ try {
56
+ ladder = await (deps.assembleLadder ?? defaultAssembleLadder)(request, config);
57
+ }
58
+ catch (err) {
59
+ ladderError = err.message;
60
+ }
61
+ const prompt = buildRoutingDeciderPrompt({ request, ladder, ...(ladderError ? { ladderError } : {}) });
62
+ const result = await (deps.spawn ?? spawnRoutingDecider)({
63
+ config,
64
+ prompt,
65
+ cwd: config.repoPath,
66
+ focusId: request.item.focusId,
67
+ escalationId: request.item.id,
68
+ model: ROUTING_DECIDER_MODEL,
69
+ timeoutMs: ROUTING_DECIDER_TIMEOUT_MS,
70
+ allowedTools: ROUTING_DECIDER_MCP_TOOLS,
71
+ });
72
+ return toRoutingDecisionResult(result);
73
+ }
74
+ /** Build the decider the sweep injects. */
75
+ export function createRoutingDecider(deps) {
76
+ return async (request) => {
77
+ let token = null;
78
+ if (deps.governor) {
79
+ token = deps.governor.tryAcquireSlot(ROUTING_DECIDER_GOVERNOR_ENGINE);
80
+ if (!token)
81
+ return { ran: false, decided: false, detail: 'no governor slot free' };
82
+ }
83
+ try {
84
+ return await runDecider(deps, request);
85
+ }
86
+ catch (err) {
87
+ return { ran: false, decided: false, detail: `decider failed before spawn: ${err.message}` };
88
+ }
89
+ finally {
90
+ if (token && deps.governor)
91
+ deps.governor.releaseSlot(token);
92
+ }
93
+ };
94
+ }
95
+ //# sourceMappingURL=routing-decider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"routing-decider.js","sourceRoot":"","sources":["../../src/spawn/routing-decider.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,qEA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AAc,CAAC,+BAA+B,CAAC,CAAC;YACtE,IAAI,CAAC,KAAK;gBAAE,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,uBAAuB,EAAE,CAAC;QACrF,CAAC;QACD,IAAI,CAAC;YACH,OAAO,MAAM,UAAU,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QACzC,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,gCAAiC,GAAa,CAAC,OAAO,EAAE,EAAE,CAAC;QAC1G,CAAC;gBAAS,CAAC;YACT,IAAI,KAAK,IAAI,IAAI,CAAC,QAAQ;gBAAE,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;QAC/D,CAAC;IACH,CAAC,CAAC;AACJ,CAAC"}
@@ -100,4 +100,12 @@ export interface DirectiveResolution {
100
100
  /** True => no usable directive; build the legacy full focus prompt. */
101
101
  useLegacyFullPrompt: boolean;
102
102
  }
103
+ /**
104
+ * The directive metadata Phase B selects a spawn's engine from. Every field is
105
+ * known before the directive body is assembled, so Phase A can resolve the same
106
+ * engine early and tell whether a same-engine resume will discard that body.
107
+ */
108
+ export type EngineSelectionMetadata = Pick<DirectiveResolution, 'spawnDirectiveDeclared' | 'spawnStageName' | 'directiveEngine' | 'directiveModel' | 'directiveLocalModel' | 'pendingFocusOverrideModel' | 'workflowIsBuiltin'>;
109
+ /** Resolves the engine id Phase B selects for the given directive metadata. */
110
+ export type EngineIdSelector = (metadata: EngineSelectionMetadata) => string;
103
111
  //# sourceMappingURL=shared.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../src/spawn/shared.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EACV,kBAAkB,EAClB,cAAc,EACd,mCAAmC,EAC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C;;;;;;;OAOG;IACH,yBAAyB,EAAE,MAAM,GAAG,IAAI,CAAC;IACzC;;;;;OAKG;IACH,iBAAiB,EAAE,OAAO,CAAC;IAC3B,+EAA+E;IAC/E,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,mFAAmF;IACnF,sBAAsB,EAClB;QAAE,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QAAC,UAAU,CAAC,EAAE,iBAAiB,GAAG,IAAI,CAAA;KAAE,GAClE,IAAI,CAAC;IACT,uEAAuE;IACvE,mBAAmB,EAAE,OAAO,CAAC;CAC9B;AAED;;;;GAIG;AACH,MAAM,MAAM,uBAAuB,GAAG,IAAI,CACxC,mBAAmB,EACjB,wBAAwB,GAAG,gBAAgB,GAAG,iBAAiB,GAAG,gBAAgB,GAClF,qBAAqB,GAAG,2BAA2B,GAAG,mBAAmB,CAC5E,CAAC;AAEF,+EAA+E;AAC/E,MAAM,MAAM,gBAAgB,GAAG,CAAC,QAAQ,EAAE,uBAAuB,KAAK,MAAM,CAAC"}
@@ -1,5 +1,5 @@
1
1
  // PINNED-BY-BEGIN (generated by gen:pinned-by -- do not hand-edit; checked by lint:pinned-by)
2
- // Pinned by: none -- no test imports this module directly (baselined; see lint:pinned-by)
2
+ // Pinned by: packages/daemon/src/spawn/directive-body-skip.test.ts
3
3
  // PINNED-BY-END
4
4
  export {};
5
5
  //# sourceMappingURL=shared.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"shared.js","sourceRoot":"","sources":["../../src/spawn/shared.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,0FAA0F;AAC1F,gBAAgB"}
1
+ {"version":3,"file":"shared.js","sourceRoot":"","sources":["../../src/spawn/shared.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,mEAAmE;AACnE,gBAAgB"}