@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 +1 @@
1
- {"version":3,"file":"escalation-consumption.d.ts","sourceRoot":"","sources":["../../src/queries/escalation-consumption.ts"],"names":[],"mappings":"AAYA;;;;;;;;;;GAUG;AAEH,OAAO,EAAW,KAAK,WAAW,EAAE,MAAM,aAAa,CAAC;AAIxD,gFAAgF;AAChF,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CA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yB,CACvC,IAAI,EAAE,SAAS,4BAA4B,EAAE,GAC5C,sBAAsB,EAAE,CAgB1B;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,6BAA6B,CACjD,IAAI,GAAE,WAAgB,GACrB,OAAO,CAAC,sBAAsB,EAAE,CAAC,CAanC;AAED,wFAAwF;AACxF,MAAM,WAAW,wBAAwB;IACvC,EAAE,EAAE,MAAM,CAAC;IACX,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,uEAAuE;IACvE,WAAW,EAAE,MAAM,GAAG,SAAS,CAAC;CACjC;AAED,UAAU,sBAAuB,SAAQ,4BAA4B;IACnE,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;CAC3C;AAED;;;;;;GAMG;AACH,wBAAgB,2BAA2B,CACzC,IAAI,EAAE,SAAS,sBAAsB,EAAE,GACtC,wBAAwB,EAAE,CAqB5B;AAED;;;;;GAKG;AACH,wBAAsB,kCAAkC,CACtD,IAAI,GAAE,WAAgB,GACrB,OAAO,CAAC,wBAAwB,EAAE,CAAC,CAQrC"}
1
+ {"version":3,"file":"escalation-consumption.d.ts","sourceRoot":"","sources":["../../src/queries/escalation-consumption.ts"],"names":[],"mappings":"AAaA;;;;;;;;;;GAUG;AAEH,OAAO,EAAW,KAAK,WAAW,EAAE,MAAM,aAAa,CAAC;AAKxD,OAAO,EAAiC,KAAK,iBAAiB,EAAE,KAAK,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAE/G,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAEtE;;;;GAIG;AACH,MAAM,WAAW,mBAAm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(generated by gen:pinned-by -- do not hand-edit; checked by lint:pinned-by)
2
2
  // Pinned by: packages/daemon/src/completion/machine-remediable-demotion.test.ts,
3
+ // packages/daemon/src/integration/resolution-class-routing-flow.test.ts,
3
4
  // packages/daemon/src/prompt-sections/agent-resolvable-inbox-section.test.ts,
4
5
  // packages/daemon/src/queries/agent-resolvable-aging.test.ts,
5
6
  // packages/daemon/src/queries/agent-resolvable-filter.test.ts,
@@ -11,8 +12,8 @@
11
12
  // PINNED-BY-END
12
13
  /**
13
14
  * Escalation consumption reads: the machine-side reads that FEED the daemon's
14
- * agent-resolvable ride-into-spawn, the org-wide promotion sweep, and the
15
- * evidence-driven team_failure demotion (TEL-3).
15
+ * agent-resolvable ride-into-spawn, the org-wide routing hand-off sweep (and its
16
+ * lineage-carrier read), and the evidence-driven team_failure demotion (TEL-3).
16
17
  *
17
18
  * Split out of queries/escalations.ts (file-size limit) and re-exported from it
18
19
  * (which is in turn re-exported from queries/issues.ts), so every existing
@@ -22,45 +23,149 @@
22
23
  */
23
24
  import { callApi } from './shared.js';
24
25
  import { OPEN_ESCALATION_STATUSES } from './holds.js';
26
+ // DISPOSITION_NEEDS_INTENT is a READ of historic rows here (the team_failure
27
+ // demotion candidates); no daemon module files needs_intent any more.
25
28
  import { DISPOSITION_AGENT_RESOLVABLE, DISPOSITION_NEEDS_INTENT } from './escalation-dispositions.js';
29
+ import { readHumanAct, readObservation } from './filing-observation.js';
30
+ import { isMachineLaneRow, readIncidentKey, readSymptoms } from './incident-correlation.js';
31
+ /** Pure: the optional observation + metadata fields an item carries from its row. */
32
+ function observationFields(metadata) {
33
+ const observation = readObservation(metadata);
34
+ return { ...(metadata ? { metadata } : {}), ...(observation ? { observation } : {}) };
35
+ }
36
+ /**
37
+ * escalation_kind (and metadata.cause) of a HISTORIC agent_resolvable promotion
38
+ * refile, and the cause-key prefix that promotion minted. The daemon no longer
39
+ * files these (a routing-decider agent makes a filing human-facing now), but
40
+ * resolved rows of that shape stay in the sample, so the reader keeps them.
41
+ */
42
+ const PROMOTED_REFILE_KIND = 'agent_resolvable_promoted';
43
+ const PROMOTION_CAUSE_KEY_PREFIX = `${PROMOTED_REFILE_KIND}::escalationId=`;
44
+ /**
45
+ * Dispositions of a HUMAN-lane row: the only rows whose metadata.originalEscalationId
46
+ * marks a hand-off OUT of the machine lane. (A demotion refile carries the key too,
47
+ * but files agent_resolvable -- the other direction -- so it is not lineage here.)
48
+ * Local literals, same reason as routing-measurement.ts.
49
+ */
50
+ const HUMAN_LANE_LINEAGE_DISPOSITIONS = new Set(['needs_operator', 'external_wait']);
51
+ /** Pure: a non-blank metadata.originalEscalationId, or null. */
52
+ function originalEscalationIdOf(meta) {
53
+ const original = meta?.originalEscalationId;
54
+ return typeof original === 'string' && original.trim() !== '' ? original : null;
55
+ }
56
+ /** Pure: the source filing id a promotion cause key names, or null for any other key. */
57
+ function promotionSourceOfCauseKey(causeKey) {
58
+ if (typeof causeKey !== 'string' || !causeKey.startsWith(PROMOTION_CAUSE_KEY_PREFIX))
59
+ return null;
60
+ const id = causeKey.slice(PROMOTION_CAUSE_KEY_PREFIX.length);
61
+ return id.trim() !== '' && !id.includes('|') ? id : null;
62
+ }
63
+ /**
64
+ * Pure: the promotion lineage a resolved row carries on the wire.
65
+ * - promotedFrom: the row IS a hand-off out of the machine lane -- either a
66
+ * historic promotion refile (kind or metadata.cause agent_resolvable_promoted),
67
+ * or a HUMAN-lane row (needs_operator / external_wait) whose
68
+ * metadata.originalEscalationId names its source: what a routing-decider agent
69
+ * files through telora_agent escalate (sourceEscalationId), kind 'agent_filed'.
70
+ * The value is metadata.originalEscalationId, falling back to the source id a
71
+ * historic promotion cause_key names.
72
+ * - absorbedPromotions: the sources of promotion symptoms correlated onto the row
73
+ * (metadata.symptoms whose cause_key is a promotion key) other than its own.
74
+ * Incident correlation is focus-scoped, so a second promotion on a focus attached
75
+ * to the first open needs_operator row there rather than filing a refile.
76
+ * Historic only: a routing decider's MCP filing never passes the incident reducer.
77
+ */
78
+ export function readPromotionLineage(row) {
79
+ const meta = row.metadata ?? null;
80
+ const isDeciderHandoff = originalEscalationIdOf(meta) !== null && HUMAN_LANE_LINEAGE_DISPOSITIONS.has(row.disposition ?? '');
81
+ const isRefile = row.escalationKind === PROMOTED_REFILE_KIND || meta?.cause === PROMOTED_REFILE_KIND || isDeciderHandoff;
82
+ const original = meta?.originalEscalationId;
83
+ const own = !isRefile
84
+ ? null
85
+ : typeof original === 'string' && original.trim() !== '' ? original : promotionSourceOfCauseKey(meta?.cause_key);
86
+ const absorbed = [];
87
+ for (const symptom of readSymptoms(meta)) {
88
+ const source = promotionSourceOfCauseKey(symptom.cause_key);
89
+ if (source !== null && source !== own && !absorbed.includes(source))
90
+ absorbed.push(source);
91
+ }
92
+ return { ...(own ? { promotedFrom: own } : {}), ...(absorbed.length > 0 ? { absorbedPromotions: absorbed } : {}) };
93
+ }
94
+ /** Pure: one escalation_list row as a routing sample row. */
95
+ export function toRoutingSampleRow(e) {
96
+ return {
97
+ disposition: e.disposition ?? null,
98
+ resolutionClass: e.resolutionClass ?? null,
99
+ ...(e.id ? { id: e.id } : {}),
100
+ ...readPromotionLineage(e),
101
+ };
102
+ }
26
103
  /**
27
104
  * Sample the org's RESOLVED escalations, reduced to (disposition, resolution_class)
28
- * -- the live population the routing-quality measure differences to compute the
29
- * mis-route rate. Both axes ride in the summary base of transformEscalation, so
30
- * detail:'summary' suffices. A bounded recent page (default 500) is enough for a
105
+ * plus promotion lineage -- the live population the routing-quality measure
106
+ * differences to compute the mis-route rate. id, disposition, resolutionClass,
107
+ * escalationKind and metadata all ride in the summary base of transformEscalation,
108
+ * so detail:'summary' suffices. A bounded recent page (default 500) is enough for a
31
109
  * rate; this is a measurement, not an exhaustive audit.
32
110
  */
33
111
  export async function listResolvedRoutingSample(deps = {}, limit = 500) {
34
112
  const call = deps.callApi ?? callApi;
35
113
  const result = await call('escalation_list', { fields: { status: 'resolved' }, limit, detail: 'summary' });
36
- return (result.escalations ?? []).map((e) => ({
37
- disposition: e.disposition ?? null,
38
- resolutionClass: e.resolutionClass ?? null,
39
- }));
114
+ return (result.escalations ?? []).map(toRoutingSampleRow);
115
+ }
116
+ /**
117
+ * Pure: index the OPEN human-lane rows (disposition other than agent_resolvable)
118
+ * that carry an incident_key, first row per key. The contract allows at most one
119
+ * open human-lane row per incident, so first-wins only matters for legacy data.
120
+ */
121
+ function openHumanLaneByIncident(rows) {
122
+ const byKey = new Map();
123
+ for (const row of rows) {
124
+ if ((row.status && !OPEN_ESCALATION_STATUSES.has(row.status)) || isMachineLaneRow(row))
125
+ continue;
126
+ const key = readIncidentKey(row.metadata);
127
+ if (!key || byKey.has(key))
128
+ continue;
129
+ byKey.set(key, { id: row.id, escalationKind: row.escalationKind ?? null, humanAct: readHumanAct(row.metadata?.human_act) });
130
+ }
131
+ return byKey;
40
132
  }
41
133
  /**
42
134
  * Pure: keep only the OPEN, agent_resolvable rows and shape them into
43
135
  * AgentResolvableItems. The status re-check is defense-in-depth so a
44
136
  * resolved/dismissed row can never ride into a spawn even if the fetch returned
45
- * one. Exported for direct unit testing (no callApi mocking needed).
137
+ * one. An item whose incident_key is shared by an OPEN human-lane row in the
138
+ * same `rows` carries it as pendingHumanLane (the focus-scoped read already
139
+ * returns every open row for the focus, so no second read is needed). Exported
140
+ * for direct unit testing (no callApi mocking needed).
46
141
  */
47
142
  export function toAgentResolvableItems(rows) {
143
+ const humanLane = openHumanLaneByIncident(rows);
48
144
  return rows
49
145
  .filter((e) => (!e.status || OPEN_ESCALATION_STATUSES.has(e.status)) &&
50
146
  e.disposition === DISPOSITION_AGENT_RESOLVABLE)
51
- .map((e) => ({
52
- id: e.id,
53
- escalationKind: e.escalationKind ?? null,
54
- description: e.description ?? '',
55
- createdAt: e.createdAt ?? '',
56
- }));
147
+ .map((e) => {
148
+ const key = readIncidentKey(e.metadata);
149
+ const pending = key ? humanLane.get(key) : undefined;
150
+ return {
151
+ id: e.id,
152
+ escalationKind: e.escalationKind ?? null,
153
+ description: e.description ?? '',
154
+ createdAt: e.createdAt ?? '',
155
+ ...observationFields(e.metadata),
156
+ ...(pending ? { pendingHumanLane: pending } : {}),
157
+ };
158
+ });
57
159
  }
58
160
  /**
59
161
  * List the OPEN (pending/in_review) agent_resolvable escalations anchored to a
60
162
  * focus -- the filings a machine (the next spawned team) can resolve without a
61
- * human. This is how the daemon CONSUMES agent_resolvable filings: it hands them
163
+ * human. The same page's open human-lane rows link onto the items that share
164
+ * their incident_key (pendingHumanLane). This is how the daemon CONSUMES
165
+ * agent_resolvable filings: it hands them
62
166
  * to the focus's next execution spawn (ride-into-next-spawn) so the agent
63
- * addresses them as part of its work, and on a clean exit they auto-resolve.
167
+ * addresses them as part of its work and resolves each itself (escalation_update,
168
+ * resolutionClass agent_session) -- there is no daemon-side clean-exit auto-close.
64
169
  * agent_resolvable rows are hidden from the operator inbox (the disposition
65
170
  * routes to the machine, not the human); this is the machine-side counterpart read.
66
171
  *
@@ -69,8 +174,9 @@ export function toAgentResolvableItems(rows) {
69
174
  * and filter disposition === agent_resolvable client-side. The status re-check is
70
175
  * defense-in-depth so a resolved/dismissed row can never ride into a spawn.
71
176
  */
72
- export async function listOpenAgentResolvableForFocus(focusId) {
73
- const result = await callApi('escalation_list', {
177
+ export async function listOpenAgentResolvableForFocus(focusId, deps = {}) {
178
+ const call = deps.callApi ?? callApi;
179
+ const result = await call('escalation_list', {
74
180
  fields: { statuses: ['pending', 'in_review'], focusId },
75
181
  limit: 500,
76
182
  });
@@ -94,6 +200,7 @@ export function toOrgAgentResolvableItems(rows) {
94
200
  organizationId: e.organizationId ?? null,
95
201
  focusId: e.focusId ?? null,
96
202
  productId: e.productId ?? null,
203
+ ...observationFields(e.metadata),
97
204
  }));
98
205
  }
99
206
  /**
@@ -108,8 +215,8 @@ export function toOrgAgentResolvableItems(rows) {
108
215
  * disposition server-side, so we narrow to open statuses server-side (the 500-row
109
216
  * page) and filter disposition === agent_resolvable client-side. Each row's
110
217
  * first-class focus_id / product_id / organization_id columns are carried onto
111
- * the item so the promotion can anchor its needs_operator refile to the right
112
- * focus.
218
+ * the item so the hand-off sweep can judge its focus's reachability and hand the
219
+ * routing decider the right focus.
113
220
  */
114
221
  export async function listOpenAgentResolvableForOrg(deps = {}) {
115
222
  const call = deps.callApi ?? callApi;
@@ -119,12 +226,43 @@ export async function listOpenAgentResolvableForOrg(deps = {}) {
119
226
  // detail:'full' is REQUIRED: transformEscalation only emits organizationId AND
120
227
  // description in the full branch (the summary base carries neither). Without it
121
228
  // the org anchor is dropped and sweepAgentResolvablePromotions skips every item
122
- // -- the org-wide sweep scans N and promotes 0 forever. The dropped description
123
- // would also refile an empty body on any promotion that did fire.
229
+ // -- the org-wide sweep scans N and hands off 0 forever. The dropped description
230
+ // would also hand the routing decider an empty condition body.
124
231
  detail: 'full',
125
232
  });
126
233
  return toOrgAgentResolvableItems(result.escalations ?? []);
127
234
  }
235
+ /**
236
+ * Pure: keep the OPEN human-lane rows (needs_operator / external_wait) whose
237
+ * metadata.originalEscalationId names a source. Exported for direct unit testing.
238
+ */
239
+ export function toLineageCarriers(rows) {
240
+ const carriers = [];
241
+ for (const row of rows) {
242
+ if (row.status && !OPEN_ESCALATION_STATUSES.has(row.status))
243
+ continue;
244
+ if (!HUMAN_LANE_LINEAGE_DISPOSITIONS.has(row.disposition ?? ''))
245
+ continue;
246
+ const source = originalEscalationIdOf(row.metadata);
247
+ if (source !== null)
248
+ carriers.push({ id: row.id, sourceEscalationId: source });
249
+ }
250
+ return carriers;
251
+ }
252
+ /**
253
+ * List the org's OPEN lineage carriers (see LineageCarrier). id, disposition,
254
+ * status and metadata all ride in the summary base of transformEscalation, so
255
+ * detail:'summary' suffices; the 500-row open page matches the lane read.
256
+ */
257
+ export async function listOpenLineageCarriersForOrg(deps = {}) {
258
+ const call = deps.callApi ?? callApi;
259
+ const result = await call('escalation_list', {
260
+ fields: { statuses: ['pending', 'in_review'] },
261
+ limit: 500,
262
+ detail: 'summary',
263
+ });
264
+ return toLineageCarriers(result.escalations ?? []);
265
+ }
128
266
  /**
129
267
  * Pure: keep only OPEN team_failure escalations disposed needs_intent, shaping
130
268
  * them for the demotion sweep. team_failure kind (not daemon_gate_stuck) with
@@ -1 +1 @@
1
- {"version":3,"file":"escalation-consumption.js","sourceRoot":"","sources":["../../src/queries/escalation-consumption.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,iFAAiF;AACjF,gFAAgF;AAChF,gEAAgE;AAChE,iEAAiE;AACjE,0EAA0E;AAC1E,oEAAoE;AACpE,wEAAwE;AACxE,0EAA0E;AAC1E,wDAAwD;AACxD,gBAAgB;AAEhB;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,OAAO,EAAoB,MAAM,aAAa,CAAC;AACxD,OAAO,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC;AACtD,OAAO,EAAE,4BAA4B,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AA8BtG;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,yBAAyB,CAC7C,OAAoB,EAAE,EACtB,KAAK,GAAG,GAAG;IAEX,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,IAAI,OAAO,CAAC;IACrC,MAAM,MAAM,GAAG,MAAM,IAAI,CACvB,iBAAiB,EACjB,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,CAC7D,CAAC;IACF,OAAO,CAAC,MAAM,CAAC,WAAW,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QAC5C,WAAW,EAAE,CAAC,CAAC,WAAW,IAAI,IAAI;QAClC,eAAe,EAAE,CAAC,CAAC,eAAe,IAAI,IAAI;KAC3C,CAAC,CAAC,CAAC;AACN,CAAC;AAeD;;;;;GAKG;AACH,MAAM,UAAU,sBAAsB,CACpC,IAA6C;IAE7C,OAAO,IAAI;SACR,MAAM,CACL,CAAC,CAAC,EAAE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C,CACtD,OAAoB,EAAE;IAEtB,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,IAAI,OAAO,CAAC;IACrC,MAAM,MAAM,GAAG,MAAM,IAAI,CAA4C,iBAAiB,EAAE;QACtF,MAAM,EAAE,EAAE,QAAQ,EAAE,CAAC,SAAS,EAAE,WAAW,CAAC,EAAE;QAC9C,KAAK,EAAE,GAAG;QACV,MAAM,EAAE,MAAM;KACf,CAAC,CAAC;IACH,OAAO,2BAA2B,CAAC,MAAM,CAAC,WAAW,IAAI,EAAE,CAAC,CAAC;AAC/D,CAAC"}
@@ -1,19 +1,31 @@
1
1
  /**
2
2
  * Daemon-local literals, TYPE-PINNED to the daemon-core disposition vocabulary.
3
3
  *
4
- * Shared by the escalation dedup guards (escalations.ts) and the consumption
5
- * reads (escalation-consumption.ts) so the pinned mirror lives in exactly one
6
- * place. This module must NOT take a runtime (value) import of
7
- * `@telora/daemon-core` -- only the type import below. Under the node:test
8
- * module-mock loader a bare `@telora/*` value specifier resolves relative to
9
- * this file and dies with ERR_MODULE_NOT_FOUND, so the vocabulary is mirrored as
10
- * local literals rather than imported values.
4
+ * Shared by the escalation dedup guards (escalations.ts), the consumption
5
+ * reads (escalation-consumption.ts) and the filing chokepoint
6
+ * (filing-observation.ts) so the pinned mirror lives in exactly one place. This
7
+ * module must NOT take a runtime (value) import of `@telora/daemon-core` -- only
8
+ * the type import below. Under the node:test module-mock loader a bare
9
+ * `@telora/*` value specifier resolves relative to this file and dies with
10
+ * ERR_MODULE_NOT_FOUND, so the vocabulary is mirrored as local literals rather
11
+ * than imported values.
11
12
  *
12
13
  * The `Extract<...>` annotation keeps each honest: it stops compiling if the
13
14
  * value is dropped or renamed in daemon-core, so these are pinned mirrors of the
14
15
  * vocabulary rather than redeclarations that can silently drift.
16
+ *
17
+ * READ-ONLY vocabulary for the directed holds: DISPOSITION_NEEDS_INTENT and
18
+ * DISPOSITION_NEEDS_CLARIFICATION exist so readers of HISTORIC rows (the
19
+ * team_failure demotion read, answer read-back) and the chokepoint's refusal set
20
+ * can name them. No daemon module FILES either -- createEscalation downgrades
21
+ * them to an observation, and queries/detector-disposition-gate.test.ts fails on
22
+ * any filing that passes one as `disposition`.
15
23
  */
16
24
  import type { EscalationDisposition } from '@telora/daemon-core';
17
25
  export declare const DISPOSITION_AGENT_RESOLVABLE: Extract<EscalationDisposition, 'agent_resolvable'>;
26
+ export declare const DISPOSITION_NEEDS_OPERATOR: Extract<EscalationDisposition, 'needs_operator'>;
18
27
  export declare const DISPOSITION_NEEDS_INTENT: Extract<EscalationDisposition, 'needs_intent'>;
28
+ export declare const DISPOSITION_NEEDS_CLARIFICATION: Extract<EscalationDisposition, 'needs_clarification'>;
29
+ /** The directed-hold dispositions: a human asked to steer mid-flight. Never sent by the daemon. */
30
+ export declare const DIRECTED_HOLD_DISPOSITIONS: ReadonlySet<string>;
19
31
  //# sourceMappingURL=escalation-dispositions.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"escalation-dispositions.d.ts","sourceRoot":"","sources":["../../src/queries/escalation-dispositions.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAEjE,eAAO,MAAM,4BAA4B,EAAE,OAAO,CAAC,qBAAqB,EAAE,kBAAkB,CACxE,CAAC;AAErB,eAAO,MAAM,wBAAwB,EAAE,OAAO,CAAC,qBAAqB,EAAE,cAAc,CACpE,CAAC"}
1
+ {"version":3,"file":"escalation-dispositions.d.ts","sourceRoot":"","sources":["../../src/queries/escalation-dispositions.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAEjE,eAAO,MAAM,4BAA4B,EAAE,OAAO,CAAC,qBAAqB,EAAE,kBAAkB,CACxE,CAAC;AAErB,eAAO,MAAM,0BAA0B,EAAE,OAAO,CAAC,qBAAqB,EAAE,gBAAgB,CACtE,CAAC;AAEnB,eAAO,MAAM,wBAAwB,EAAE,OAAO,CAAC,qBAAqB,EAAE,cAAc,CACpE,CAAC;AAEjB,eAAO,MAAM,+BAA+B,EAAE,OAAO,CAAC,qBAAqB,EAAE,qBAAqB,CAC3E,CAAC;AAExB,mGAAmG;AACnG,eAAO,MAAM,0BAA0B,EAAE,WAAW,CAAC,MAAM,CAGzD,CAAC"}
@@ -2,5 +2,12 @@
2
2
  // Pinned by: none -- no test imports this module directly (baselined; see lint:pinned-by)
3
3
  // PINNED-BY-END
4
4
  export const DISPOSITION_AGENT_RESOLVABLE = 'agent_resolvable';
5
+ export const DISPOSITION_NEEDS_OPERATOR = 'needs_operator';
5
6
  export const DISPOSITION_NEEDS_INTENT = 'needs_intent';
7
+ export const DISPOSITION_NEEDS_CLARIFICATION = 'needs_clarification';
8
+ /** The directed-hold dispositions: a human asked to steer mid-flight. Never sent by the daemon. */
9
+ export const DIRECTED_HOLD_DISPOSITIONS = new Set([
10
+ DISPOSITION_NEEDS_INTENT,
11
+ DISPOSITION_NEEDS_CLARIFICATION,
12
+ ]);
6
13
  //# sourceMappingURL=escalation-dispositions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"escalation-dispositions.js","sourceRoot":"","sources":["../../src/queries/escalation-dispositions.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,0FAA0F;AAC1F,gBAAgB;AAoBhB,MAAM,CAAC,MAAM,4BAA4B,GACvC,kBAAkB,CAAC;AAErB,MAAM,CAAC,MAAM,wBAAwB,GACnC,cAAc,CAAC"}
1
+ {"version":3,"file":"escalation-dispositions.js","sourceRoot":"","sources":["../../src/queries/escalation-dispositions.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,0FAA0F;AAC1F,gBAAgB;AA4BhB,MAAM,CAAC,MAAM,4BAA4B,GACvC,kBAAkB,CAAC;AAErB,MAAM,CAAC,MAAM,0BAA0B,GACrC,gBAAgB,CAAC;AAEnB,MAAM,CAAC,MAAM,wBAAwB,GACnC,cAAc,CAAC;AAEjB,MAAM,CAAC,MAAM,+BAA+B,GAC1C,qBAAqB,CAAC;AAExB,mGAAmG;AACnG,MAAM,CAAC,MAAM,0BAA0B,GAAwB,IAAI,GAAG,CAAC;IACrE,wBAAwB;IACxB,+BAA+B;CAChC,CAAC,CAAC"}
@@ -1,24 +1,56 @@
1
+ /**
2
+ * Cause-keyed escalation suppression + idempotent filing.
3
+ *
4
+ * Generalizes the narrow per-delivery precedent (hasOpenEscalationForDelivery in
5
+ * queries/escalations.ts) to EVERY daemon detector via a deterministic cause key
6
+ * (queries/cause-key.ts). Two properties, both DB-backed so they survive a
7
+ * daemon restart:
8
+ *
9
+ * 1. Idempotent while open. While a filing carrying this cause key is OPEN
10
+ * (pending or in_review) -- as the row's own cause key OR as a symptom
11
+ * correlated onto an open incident row -- a detector re-observing the same
12
+ * cause does not file again (nor append a duplicate symptom).
13
+ *
14
+ * 2. Dismissal memory. A DISMISSED filing carrying this cause key keeps the
15
+ * cause silent: the same cause cannot re-file until its subject state
16
+ * changes. Because the subject is encoded IN the cause key, a changed subject
17
+ * (a NEW sha going red) yields a DIFFERENT key with no matching dismissed row
18
+ * and re-files naturally. Dismissal memory stays per cause key: a dismissed
19
+ * incident row's correlated symptoms do not suppress.
20
+ *
21
+ * A RESOLVED filing does NOT suppress: resolve means the cause was addressed, so a
22
+ * recurrence should re-file. This is achieved simply by excluding 'resolved' from
23
+ * the suppression status set below.
24
+ *
25
+ * The cause key is stamped into agent_escalations.metadata.cause_key at file time.
26
+ * Cross-detector correlation (one incident per root cause) is NOT decided here: an
27
+ * unsuppressed filing goes to createEscalation, whose ONE incident reducer
28
+ * (queries/incident-correlation.ts) attaches every daemon filing -- this path's and
29
+ * the direct filers' alike -- to its incident's open lane row.
30
+ */
31
+ import { type CallApiDeps } from './shared.js';
1
32
  import { createEscalation, type CreateEscalationParams } from './escalations.js';
2
- /** Minimal escalation row shape the cause-key suppression check reads. */
3
- interface CauseKeyEscalationRow {
4
- id: string;
5
- status?: string | null;
6
- metadata?: Record<string, unknown> | null;
7
- }
33
+ import { type IncidentRow } from './incident-correlation.js';
8
34
  /**
9
35
  * Dependency seam. The real implementations query the Telora API / file via
10
- * createEscalation; tests inject stubs to avoid the fragile bare-specifier
11
- * `mock.module` path under tsx (same rationale as the stall-detectors /
12
- * verification-feedback deps seams).
36
+ * createEscalation; tests inject stubs (or a `callApi` over an in-memory row
37
+ * store) to avoid the fragile bare-specifier `mock.module` path under tsx (same
38
+ * rationale as the stall-detectors / verification-feedback deps seams).
13
39
  */
14
- export interface EscalationSuppressionDeps {
15
- /** Fetch the open+dismissed escalation rows to scan for a matching cause key. */
40
+ export interface EscalationSuppressionDeps extends CallApiDeps {
41
+ /** Fetch the open+dismissed escalation rows to scan for a cause key. */
16
42
  listSuppressingEscalations?: (opts: {
17
43
  focusId?: string;
18
- }) => Promise<CauseKeyEscalationRow[]>;
19
- /** File a fresh escalation (defaults to the real createEscalation). */
44
+ }) => Promise<IncidentRow[]>;
45
+ /** File a fresh escalation (defaults to the real createEscalation, over this seam's callApi). */
20
46
  createEscalation?: typeof createEscalation;
21
47
  }
48
+ /**
49
+ * Pure: whether already-fetched rows suppress a re-file of `causeKey` -- an OPEN
50
+ * or DISMISSED row carrying it as its own (or original) cause key, or an OPEN row
51
+ * carrying it as a correlated symptom.
52
+ */
53
+ export declare function rowsSuppressCauseKey(rows: readonly IncidentRow[], causeKey: string): boolean;
22
54
  /**
23
55
  * True when an OPEN (pending/in_review) or DISMISSED escalation already carries
24
56
  * this cause key -- i.e. a new filing for the same cause must be suppressed.
@@ -42,19 +74,31 @@ export interface FileEscalationIdempotentResult {
42
74
  filed: boolean;
43
75
  /** Whether the call was suppressed by an existing open/dismissed cause-key row. */
44
76
  suppressed: boolean;
45
- /** The new escalation id when filed; null when suppressed or the create returned no id. */
77
+ /** The new escalation id when filed; null when suppressed, correlated, or the create returned no id. */
46
78
  escalationId: string | null;
79
+ /**
80
+ * Whether createEscalation's incident reducer attached the observation to its
81
+ * incident's open lane row instead of filing (filed and suppressed are then both
82
+ * false). Always set by fileEscalationIdempotent; optional so hand-built stubs
83
+ * keep type-checking.
84
+ */
85
+ correlated?: boolean;
86
+ /**
87
+ * The lane row this observation was attached to (correlated), or whose attach
88
+ * failed before this row was filed; null otherwise.
89
+ */
90
+ incidentEscalationId?: string | null;
47
91
  }
48
92
  /**
49
- * File an escalation ONLY if its cause key is not already suppressed (open or
50
- * dismissed). The cause key is stamped into metadata.cause_key so a later
51
- * re-observation of the same cause is suppressed by hasSuppressedCauseKey.
93
+ * File an escalation ONLY if its cause key is not already suppressed (open,
94
+ * dismissed, or an open incident's symptom). The cause key is stamped into
95
+ * metadata.cause_key so a later re-observation of the same cause is suppressed;
96
+ * createEscalation then correlates the filing onto its incident (see the header).
52
97
  *
53
- * This is the single filing entry point every daemon detector should route
98
+ * This is the single cause-keyed entry point every daemon detector should route
54
99
  * through. It replaces per-detector ad-hoc dedup (hasOpenEscalationForDelivery,
55
100
  * hasOpenWorktreeDirtyEscalation, hasOpenWedgedFocusEscalation, in-memory Sets)
56
101
  * with one cause-keyed gate that also carries dismissal memory.
57
102
  */
58
103
  export declare function fileEscalationIdempotent(params: FileEscalationIdempotentParams, deps?: EscalationSuppressionDeps): Promise<FileEscalationIdempotentResult>;
59
- export {};
60
104
  //# sourceMappingURL=escalation-suppression.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"escalation-suppression.d.ts","sourceRoot":"","sources":["../../src/queries/escalation-suppression.ts"],"names":[],"mappings":"AAwCA,OAAO,EAAE,gBAAgB,EAAE,KAAK,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAYjF,0EAA0E;AAC1E,UAAU,qBAAqB;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAA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