@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
@@ -0,0 +1,82 @@
1
+ /**
2
+ * The three shapes of act only a human can perform:
3
+ * - irreversible: an act that cannot be undone by the machine (delete prod data,
4
+ * rotate a shared secret, cancel a contract).
5
+ * - outward: an act that leaves the system boundary (publish to a shared
6
+ * registry, send to a customer, deploy to prod).
7
+ * - unreachable_capability: a capability no agent session can reach (a
8
+ * credential it does not hold, operator-only control-plane state, an armed
9
+ * focus that does not exist).
10
+ */
11
+ export type HumanActKind = 'irreversible' | 'outward' | 'unreachable_capability';
12
+ /** The specific act a filing names -- from a detector, a PROPOSAL; from an agent, the human-facing act. */
13
+ export interface HumanAct {
14
+ kind: HumanActKind;
15
+ /** The act itself, imperative and specific -- NOT the condition that contains it. */
16
+ act: string;
17
+ }
18
+ /**
19
+ * The explicit "no act named" marker a filing site passes as `humanAct` when its
20
+ * detector proposes a human owner (needs_operator) but can name no act only a
21
+ * human can perform. Spelling it out at the call site (rather than omitting the
22
+ * field) keeps each detector's proposal visible and lets the disposition scan
23
+ * gate require every needs_operator filing to carry a `humanAct` property. Named
24
+ * act or not, the chokepoint files the filing as an OBSERVATION.
25
+ */
26
+ export declare const NO_HUMAN_ACT: null;
27
+ /** metadata.observation: what a detector reported, and the routing it proposed. */
28
+ export interface FilingObservation {
29
+ /** The disposition the detector asked for (its guess, not a routing decision). */
30
+ proposed_disposition: string;
31
+ /** A short head of the reported condition (first line of the description). */
32
+ condition: string;
33
+ /** The human act the detector named, if any (a proposal the deciding agent weighs). */
34
+ proposed_human_act?: HumanAct;
35
+ }
36
+ /** Cap on the stored condition head. */
37
+ export declare const OBSERVATION_CONDITION_MAX = 200;
38
+ /** Cap on a named act (a human-facing row leads its description with it, so it must leave room for the body). */
39
+ export declare const HUMAN_ACT_MAX = 1000;
40
+ /** Pure: the first non-blank line of a description, trimmed and capped. */
41
+ export declare function conditionHead(description: string | null | undefined): string;
42
+ /**
43
+ * Pure: narrow an unknown value to a named HumanAct -- a known kind and a
44
+ * non-blank act (trimmed, capped). Anything else is "no act named" (null).
45
+ */
46
+ export declare function readHumanAct(value: unknown): HumanAct | null;
47
+ /** Pure: narrow a row's metadata bag to its observation, when it carries a well-formed one. */
48
+ export declare function readObservation(metadata: unknown): FilingObservation | null;
49
+ /** The filing fields the routing rule reads and may rewrite. */
50
+ export interface FilingRouteInput {
51
+ disposition?: string;
52
+ description: string;
53
+ helpNeeded?: string;
54
+ metadata?: Record<string, unknown>;
55
+ /** The detector's proposed human act -- carried into the observation, never routed on. */
56
+ humanAct?: HumanAct | null;
57
+ }
58
+ /** The routed filing: what createEscalation actually sends. */
59
+ export interface FilingRoute {
60
+ /** agent_resolvable, or undefined when the filing named no disposition. Never a human-owning value. */
61
+ disposition: string | undefined;
62
+ description: string;
63
+ helpNeeded: string | undefined;
64
+ metadata: Record<string, unknown> | undefined;
65
+ /** Which branch of the rule applied (for logging + tests). There is no human-facing branch. */
66
+ route: 'observation' | 'pass_through';
67
+ }
68
+ /**
69
+ * Pure: lead a description with the named act, fitting the result under `cap`.
70
+ * The canonical lead-line format of a filing an AGENT made human-facing (the MCP
71
+ * escalate surface mirrors this template byte-for-byte and pins it against this
72
+ * source); the daemon chokepoint does not apply it.
73
+ */
74
+ export declare function leadWithHumanAct(act: HumanAct, description: string, cap: number): string;
75
+ /**
76
+ * Pure: apply the chokepoint routing rule (see the module header) to one filing.
77
+ * `_descriptionCap` (the server-side ESCALATION_DESCRIPTION_MAX createEscalation
78
+ * passes) is unused: no route rewrites the description any more. It stays in the
79
+ * signature so the createEscalation call site is unchanged.
80
+ */
81
+ export declare function routeFilingDisposition(input: FilingRouteInput, _descriptionCap?: number): FilingRoute;
82
+ //# sourceMappingURL=filing-observation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"filing-observation.d.ts","sourceRoot":"","sources":["../../src/queries/filing-observation.ts"],"names":[],"mappings":"AA6DA;;;;;;;;;GASG;AACH,MAAM,MAAM,YAAY,GAAG,cAAc,GAAG,SAAS,GAAG,wBAAwB,CAAC;AAEjF,2GAA2G;AAC3G,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,YAAY,CAAC;IACnB,qFAAqF;IACrF,GAAG,EAAE,MAAM,CAAC;CACb;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,YAAY,MAAO,CAAC;AAEjC,mFAAmF;AACnF,MAAM,WAAW,iBAAiB;IAChC,kFAAkF;IAClF,oBAAoB,EAAE,MAAM,CAAC;IAC7B,8EAA8E;IAC9E,SAAS,EAAE,MAAM,CAAC;IAClB,uFAAuF;IACvF,kBAAkB,CAAC,EAAE,QAAQ,CA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yBrG"}
@@ -0,0 +1,157 @@
1
+ // PINNED-BY-BEGIN (generated by gen:pinned-by -- do not hand-edit; checked by lint:pinned-by)
2
+ // Pinned by: packages/daemon/src/ci/ci-escalation.test.ts, packages/daemon/src/ci/ci-sensor-loop.test.ts,
3
+ // packages/daemon/src/directive/directive-executor.test.ts,
4
+ // packages/daemon/src/focus-stage-lifecycle/wedge-watchdog.test.ts,
5
+ // packages/daemon/src/merge/dirty-worktree-merge-refusal.test.ts,
6
+ // packages/daemon/src/merge/merge-back-loop.test.ts,
7
+ // packages/daemon/src/merge/merge-conflict-escalation-dedup.test.ts,
8
+ // packages/daemon/src/queries/filing-chokepoint.test.ts, packages/daemon/src/shell/crash-recovery.test.ts
9
+ // PINNED-BY-END
10
+ /**
11
+ * The filing chokepoint's routing rule: detectors REPORT conditions; the daemon
12
+ * has NO human-facing route. Only an agent that has assembled the intent ladder
13
+ * makes a filing human-facing, through the MCP escalate surface.
14
+ *
15
+ * Deterministic detectors used to assign the human-facing disposition
16
+ * themselves (needs_operator / external_wait / needs_intent / needs_clarification),
17
+ * and a detector that attached a `humanAct` reached the operator inbox directly,
18
+ * before anything able to climb the intent ladder had examined the condition.
19
+ * The worked example (2026-09-11, delivery e8e8fa15): a needs_operator filing
20
+ * whose three remediations were two plain machine tasks (bump a root pin,
21
+ * regenerate a lockfile) and ONE authority act (publish an unpublished package
22
+ * to the shared registry). The human was handed the whole condition instead of
23
+ * the one act, and no agent had judged whether even that act was the human's.
24
+ *
25
+ * routeFilingDisposition is applied inside queries/escalations.ts createEscalation,
26
+ * so every daemon filing path (fileEscalationIdempotent, fileEscalation, direct
27
+ * callers) inherits it:
28
+ *
29
+ * - ANY disposition other than agent_resolvable (needs_operator, external_wait,
30
+ * needs_intent, needs_clarification -- and any value added later) -> sent
31
+ * agent_resolvable as an OBSERVATION: metadata.observation =
32
+ * { proposed_disposition, condition, proposed_human_act? }. The detector's
33
+ * named `humanAct`, when it passed one, travels as proposed_human_act -- a
34
+ * PROPOSAL for the deciding agent, never a routing decision. Description and
35
+ * helpNeeded are the condition as filed, unchanged.
36
+ * - agent_resolvable / no disposition -> untouched (a humanAct on them is ignored).
37
+ *
38
+ * The rule is by EXCLUSION (everything that is not already machine-lane enters
39
+ * the machine lane), so no branch here can return a human-owning disposition,
40
+ * and this module names none: queries/detector-disposition-gate.test.ts fails
41
+ * if the source regains one, and queries/filing-chokepoint.test.ts feeds every
42
+ * disposition value through the rule.
43
+ *
44
+ * This module does NOT write metadata.human_act. That key marks a row an AGENT
45
+ * made human-facing through the MCP escalate surface
46
+ * (mcp/telora-products/src/handlers/agentHandlers.ts), which leads the
47
+ * description with leadWithHumanAct's format (kept here as the canonical
48
+ * template that surface mirrors and pins).
49
+ *
50
+ * Why the call-site `humanAct` still exists: every daemon needs_operator filing
51
+ * states it (a named act or NO_HUMAN_ACT), so each detector's proposal stays
52
+ * visible at the site and in the observation the deciding agent reads.
53
+ *
54
+ * Pure and dependency-light (no daemon-core VALUE import -- see the mock-loader
55
+ * note in queries/escalation-dispositions.ts). Types live daemon-side because
56
+ * @telora/daemon-core is registry-installed.
57
+ */
58
+ import { DISPOSITION_AGENT_RESOLVABLE } from './escalation-dispositions.js';
59
+ /**
60
+ * The explicit "no act named" marker a filing site passes as `humanAct` when its
61
+ * detector proposes a human owner (needs_operator) but can name no act only a
62
+ * human can perform. Spelling it out at the call site (rather than omitting the
63
+ * field) keeps each detector's proposal visible and lets the disposition scan
64
+ * gate require every needs_operator filing to carry a `humanAct` property. Named
65
+ * act or not, the chokepoint files the filing as an OBSERVATION.
66
+ */
67
+ export const NO_HUMAN_ACT = null;
68
+ const HUMAN_ACT_KINDS = new Set(['irreversible', 'outward', 'unreachable_capability']);
69
+ /** Cap on the stored condition head. */
70
+ export const OBSERVATION_CONDITION_MAX = 200;
71
+ /** Cap on a named act (a human-facing row leads its description with it, so it must leave room for the body). */
72
+ export const HUMAN_ACT_MAX = 1000;
73
+ function capText(text, max) {
74
+ return text.length > max ? `${text.slice(0, max - 3)}...` : text;
75
+ }
76
+ /** Pure: the first non-blank line of a description, trimmed and capped. */
77
+ export function conditionHead(description) {
78
+ const first = (description ?? '').split('\n').map((l) => l.trim()).find((l) => l.length > 0) ?? '';
79
+ return capText(first, OBSERVATION_CONDITION_MAX);
80
+ }
81
+ /**
82
+ * Pure: narrow an unknown value to a named HumanAct -- a known kind and a
83
+ * non-blank act (trimmed, capped). Anything else is "no act named" (null).
84
+ */
85
+ export function readHumanAct(value) {
86
+ if (!value || typeof value !== 'object')
87
+ return null;
88
+ const v = value;
89
+ if (typeof v.kind !== 'string' || !HUMAN_ACT_KINDS.has(v.kind))
90
+ return null;
91
+ if (typeof v.act !== 'string' || v.act.trim().length === 0)
92
+ return null;
93
+ return { kind: v.kind, act: capText(v.act.trim(), HUMAN_ACT_MAX) };
94
+ }
95
+ /** Pure: narrow a row's metadata bag to its observation, when it carries a well-formed one. */
96
+ export function readObservation(metadata) {
97
+ if (!metadata || typeof metadata !== 'object')
98
+ return null;
99
+ const obs = metadata.observation;
100
+ if (!obs || typeof obs !== 'object')
101
+ return null;
102
+ const o = obs;
103
+ if (typeof o.proposed_disposition !== 'string' || typeof o.condition !== 'string')
104
+ return null;
105
+ const act = readHumanAct(o.proposed_human_act);
106
+ return {
107
+ proposed_disposition: o.proposed_disposition,
108
+ condition: o.condition,
109
+ ...(act ? { proposed_human_act: act } : {}),
110
+ };
111
+ }
112
+ /**
113
+ * Pure: lead a description with the named act, fitting the result under `cap`.
114
+ * The canonical lead-line format of a filing an AGENT made human-facing (the MCP
115
+ * escalate surface mirrors this template byte-for-byte and pins it against this
116
+ * source); the daemon chokepoint does not apply it.
117
+ */
118
+ export function leadWithHumanAct(act, description, cap) {
119
+ const lead = `**Human act required (${act.kind}):** ${act.act}\n\n`;
120
+ const full = `${lead}${description}`;
121
+ if (full.length <= cap)
122
+ return full;
123
+ const budget = cap - lead.length - 3;
124
+ return budget > 0 ? `${lead}${description.slice(0, budget)}...` : lead.slice(0, cap);
125
+ }
126
+ /**
127
+ * Pure: apply the chokepoint routing rule (see the module header) to one filing.
128
+ * `_descriptionCap` (the server-side ESCALATION_DESCRIPTION_MAX createEscalation
129
+ * passes) is unused: no route rewrites the description any more. It stays in the
130
+ * signature so the createEscalation call site is unchanged.
131
+ */
132
+ export function routeFilingDisposition(input, _descriptionCap) {
133
+ const proposed = input.disposition;
134
+ if (proposed === undefined || proposed === DISPOSITION_AGENT_RESOLVABLE) {
135
+ return {
136
+ disposition: proposed,
137
+ description: input.description,
138
+ helpNeeded: input.helpNeeded,
139
+ metadata: input.metadata,
140
+ route: 'pass_through',
141
+ };
142
+ }
143
+ const act = readHumanAct(input.humanAct);
144
+ const observation = {
145
+ proposed_disposition: proposed,
146
+ condition: conditionHead(input.description),
147
+ ...(act ? { proposed_human_act: act } : {}),
148
+ };
149
+ return {
150
+ disposition: DISPOSITION_AGENT_RESOLVABLE,
151
+ description: input.description,
152
+ helpNeeded: input.helpNeeded,
153
+ metadata: { ...(input.metadata ?? {}), observation },
154
+ route: 'observation',
155
+ };
156
+ }
157
+ //# sourceMappingURL=filing-observation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"filing-observation.js","sourceRoot":"","sources":["../../src/queries/filing-observation.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,0GAA0G;AAC1G,8DAA8D;AAC9D,sEAAsE;AACtE,oEAAoE;AACpE,uDAAuD;AACvD,uEAAuE;AACvE,4GAA4G;AAC5G,gBAAgB;AAEhB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AAEH,OAAO,EAAE,4BAA4B,EAAE,MAAM,8BAA8B,CAAC;AAqB5E;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,CAAC;AAYjC,MAAM,eAAe,GAAwB,IAAI,GAAG,CAAC,CAAC,cAAc,EAAE,SAAS,EAAE,wBAAwB,CAAC,CAAC,CAAC;AAE5G,wCAAwC;AACxC,MAAM,CA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CAAC,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;AACvF,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,sBAAsB,CAAC,KAAuB,EAAE,eAAwB;IACtF,MAAM,QAAQ,GAAG,KAAK,CAAC,WAAW,CAAC;IACnC,IAAI,QAAQ,KAAK,SAAS,IAAI,QAAQ,KAAK,4BAA4B,EAAE,CAAC;QACxE,OAAO;YACL,WAAW,EAAE,QAAQ;YACrB,WAAW,EAAE,KAAK,CAAC,WAAW;YAC9B,UAAU,EAAE,KAAK,CAAC,UAAU;YAC5B,QAAQ,EAAE,KAAK,CAAC,QAAQ;YACxB,KAAK,EAAE,cAAc;SACtB,CAAC;IACJ,CAAC;IAED,MAAM,GAAG,GAAG,YAAY,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IACzC,MAAM,WAAW,GAAsB;QACrC,oBAAoB,EAAE,QAAQ;QAC9B,SAAS,EAAE,aAAa,CAAC,KAAK,CAAC,WAAW,CAAC;QAC3C,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,kBAAkB,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KAC5C,CAAC;IACF,OAAO;QACL,WAAW,EAAE,4BAA4B;QACzC,WAAW,EAAE,KAAK,CAAC,WAAW;QAC9B,UAAU,EAAE,KAAK,CAAC,UAAU;QAC5B,QAAQ,EAAE,EAAE,GAAG,CAAC,KAAK,CAAC,QAAQ,IAAI,EAAE,CAAC,EAAE,WAAW,EAAE;QACpD,KAAK,EAAE,aAAa;KACrB,CAAC;AACJ,CAAC"}
@@ -11,7 +11,24 @@
11
11
  * question the daemon reads back to the asking agent. Fails OPEN at its
12
12
  * call site.
13
13
  *
14
- * Plus two exclusion families the operator predicate drops: SELF_REPORT_STALL_HOLD_KINDS
14
+ * The operator family ALSO matches an open OBSERVATION anchored to the delivery
15
+ * whose metadata.observation proposed_disposition is an operator-hold disposition.
16
+ * The chokepoint in queries/escalations.ts createEscalation sends EVERY daemon
17
+ * filing that names a human-owning disposition to the machine lane as an
18
+ * observation (named act or not), so the observation form is how a daemon-detected
19
+ * hold now arrives. Routing decides WHO resolves a condition; it does not clear
20
+ * the condition. An uncleared condition keeps its delivery out of done whether an
21
+ * agent or a human resolves it. A plain agent_resolvable filing (no observation)
22
+ * still does not hold. A DIRECT needs_operator / external_wait row is one an agent
23
+ * made human-facing through MCP escalate (metadata.human_act), or a legacy row;
24
+ * both still hold. No hold here depends on a disposition only the daemon routed.
25
+ *
26
+ * isMachineStopObservation (below) is the focus-level sibling: a stop-kind
27
+ * observation carrying its detector's proposed act keeps the machine stopped
28
+ * (the respawn guard reads it through queries/escalations.ts).
29
+ *
30
+ * Plus two exclusion families the operator predicate drops, for a direct match
31
+ * and an observation match alike: SELF_REPORT_STALL_HOLD_KINDS
15
32
  * (machine-filed alarms ABOUT a delivery's own cycling, so an alarm cannot
16
33
  * constitute the condition it reports) and REFUSED_OPERATOR_HOLD_KINDS (kinds that
17
34
  * name no human-only act -- refused at their filing surface and routed to bounded
@@ -136,11 +153,60 @@ export declare const SELF_REPORT_STALL_HOLD_KINDS: readonly string[];
136
153
  * SELF_REPORT_STALL_HOLD_KINDS / OPERATOR_HOLD_DISPOSITIONS above.
137
154
  */
138
155
  export declare const REFUSED_OPERATOR_HOLD_KINDS: readonly string[];
156
+ /**
157
+ * escalation_kind discriminators whose filing reports a MACHINE STOP -- the daemon
158
+ * has halted something and the detector proposed the act that ends it. Read from
159
+ * the filing sites that name a humanAct and stop the machine; each stop is
160
+ * enforced where its row is read:
161
+ *
162
+ * team_failure -- completion/event-escalations.ts escalateNonAdvanceable and
163
+ * escalateDeliveryAdvancementStalled. Enforced by the respawn guard
164
+ * (focus/focus-respawn-guard.ts, via hasOpenTeamFailureEscalation).
165
+ * respawn_cycle_exhausted -- spawn/respawn-cycle-escalation.ts. Enforced by the
166
+ * durable spawn-cooldown `exhausted` latch (spawn/spawn-cooldown.ts), NOT by
167
+ * this row: the respawn guard does not read the kind, so the halt is
168
+ * disposition-independent, and the latch's spawn-independent recovery
169
+ * (clearSpawnCooldown on an auto-advance) is never stranded behind a row that
170
+ * nothing auto-resolves.
171
+ * review_handoff_exhausted (zero findings) -- completion/review-exit-escalations.ts.
172
+ * Enforced by the state cascade's kind-keyed breaker hold (any disposition).
173
+ *
174
+ * Not a stop kind: review_coverage_incomplete names no act; it is a machine
175
+ * wait-state the coverage stabilizer clears, and the respawn guard reads it by
176
+ * kind regardless of disposition.
177
+ */
178
+ export declare const MACHINE_STOP_KINDS: readonly string[];
179
+ /**
180
+ * Pure: whether an escalation row is an OPEN machine-stop OBSERVATION -- a
181
+ * MACHINE_STOP_KINDS row (typed kind column, metadata.kind fallback) whose
182
+ * well-formed metadata.observation carries the detector's proposed_human_act.
183
+ *
184
+ * The ONE definition of "a machine-lane record that still stops the machine".
185
+ * The filing chokepoint sends every daemon filing to the machine lane, so a
186
+ * detector's named act no longer makes its row needs_operator; this predicate is
187
+ * what keeps that stop holding. The respawn guard's machine-lane exclusion keeps
188
+ * such a row blocking, and the routing decider treats it as immediately eligible
189
+ * (a stopped focus spawns no team to decide it). A stop-kind observation with NO
190
+ * proposed act is a plain record the incoming team resolves (TEL-2) -> false.
191
+ * Disposition-independent: a row an agent made human-facing (needs_operator,
192
+ * metadata.human_act) blocks on its disposition, not on this predicate.
193
+ */
194
+ export declare function isMachineStopObservation(row: {
195
+ status?: string | null;
196
+ escalationKind?: string | null;
197
+ metadata?: Record<string, unknown> | null;
198
+ }): boolean;
139
199
  /** The open operator-hold escalation a delivery is blocked on (for gate_state). */
140
200
  export interface OperatorHoldEscalation {
141
201
  id: string;
142
202
  escalationKind: string | null;
203
+ /** The row's own disposition (agent_resolvable for an observation). */
143
204
  disposition: string;
205
+ /**
206
+ * Present only when the hold is an OBSERVATION: the operator-hold disposition
207
+ * its detector proposed (metadata.observation.proposed_disposition).
208
+ */
209
+ proposedDisposition?: string;
144
210
  }
145
211
  /**
146
212
  * Returns the OPEN (pending|in_review) operator-hold escalation anchored to the
@@ -148,7 +214,8 @@ export interface OperatorHoldEscalation {
148
214
  *
149
215
  * DISPOSITION-keyed sibling of hasOpenEscalationForDelivery (which is KIND-keyed):
150
216
  * it matches ANY escalation_kind whose disposition is in OPERATOR_HOLD_DISPOSITIONS
151
- * (needs_operator / external_wait). This is the vocabulary the verify->done gate
217
+ * (needs_operator / external_wait), or that is an observation proposing one (see
218
+ * the module header). This is the vocabulary the verify->done gate
152
219
  * previously lacked -- an operator blocked ON a delivery (e.g. "the host restore
153
220
  * was NOT executed") could not hold that delivery out of done, so a clean review
154
221
  * auto-approved it. Returning the matching row (id + kind + disposition), not a
@@ -1 +1 @@
1
- {"version":3,"file":"holds.d.ts","sourceRoot":"","sources":["../../src/queries/holds.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,EAAW,KAAK,WAAW,EAAE,MAAM,aAAa,CAAC;AAExD,yEAAyE;AACzE,eAAO,MAAM,wBAAwB,EAAE,WAAW,CAAC,MAAM,CAAqC,CAAC;AAE/F;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,0BAA0B,EAAE,SAAS,MAAM,EAGvD,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsEG;AACH,eAAO,MAAM,4BAA4B,EAAE,SAAS,MAAM,EAEzD,CAAC;AAEF;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,2BAA2B,EAAE,SAAS,MAAM,EAExD,CAAC;AAEF,mFAAmF;AACnF,MAAM,WAAW,sBAAsB;IACrC,EAAE,EAAE,MAAM,CAAC;IACX,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;;;;;;;;;;;;;;;;;;;;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O,CAAC,GAAG,IAAI,CAAC;CAC3C,GAAG,OAAO,CAMV;AAED,mFAAmF;AACnF,MAAM,WAAW,sBAAsB;IACrC,EAAE,EAAE,MAAM,CAAC;IACX,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,uEAAuE;IACvE,WAAW,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAsB,+BAA+B,CACnD,UAAU,EAAE,MAAM,EAClB,OAAO,CAAC,EAAE,MAAM,EAChB,IAAI,GAAE,WAAgB,GACrB,OAAO,CAAC,sBAAsB,GAAG,IAAI,CAAC,CAYxC;AAED;;;GAGG;AACH,wBAAsB,8BAA8B,CAClD,UAAU,EAAE,MAAM,EAClB,OAAO,CAAC,EAAE,MAAM,EAChB,IAAI,GAAE,WAAgB,GACrB,OAAO,CAAC,OAAO,CAAC,CAElB"}
@@ -1,5 +1,6 @@
1
1
  // PINNED-BY-BEGIN (generated by gen:pinned-by -- do not hand-edit; checked by lint:pinned-by)
2
2
  // Pinned by: packages/daemon/src/queries/has-open-operator-hold-for-delivery.test.ts,
3
+ // packages/daemon/src/queries/incident-correlation.test.ts,
3
4
  // packages/daemon/src/queries/no-directed-hold-producer.test.ts
4
5
  // PINNED-BY-END
5
6
  /**
@@ -15,7 +16,24 @@
15
16
  * question the daemon reads back to the asking agent. Fails OPEN at its
16
17
  * call site.
17
18
  *
18
- * Plus two exclusion families the operator predicate drops: SELF_REPORT_STALL_HOLD_KINDS
19
+ * The operator family ALSO matches an open OBSERVATION anchored to the delivery
20
+ * whose metadata.observation proposed_disposition is an operator-hold disposition.
21
+ * The chokepoint in queries/escalations.ts createEscalation sends EVERY daemon
22
+ * filing that names a human-owning disposition to the machine lane as an
23
+ * observation (named act or not), so the observation form is how a daemon-detected
24
+ * hold now arrives. Routing decides WHO resolves a condition; it does not clear
25
+ * the condition. An uncleared condition keeps its delivery out of done whether an
26
+ * agent or a human resolves it. A plain agent_resolvable filing (no observation)
27
+ * still does not hold. A DIRECT needs_operator / external_wait row is one an agent
28
+ * made human-facing through MCP escalate (metadata.human_act), or a legacy row;
29
+ * both still hold. No hold here depends on a disposition only the daemon routed.
30
+ *
31
+ * isMachineStopObservation (below) is the focus-level sibling: a stop-kind
32
+ * observation carrying its detector's proposed act keeps the machine stopped
33
+ * (the respawn guard reads it through queries/escalations.ts).
34
+ *
35
+ * Plus two exclusion families the operator predicate drops, for a direct match
36
+ * and an observation match alike: SELF_REPORT_STALL_HOLD_KINDS
19
37
  * (machine-filed alarms ABOUT a delivery's own cycling, so an alarm cannot
20
38
  * constitute the condition it reports) and REFUSED_OPERATOR_HOLD_KINDS (kinds that
21
39
  * name no human-only act -- refused at their filing surface and routed to bounded
@@ -29,6 +47,9 @@
29
47
  * @module queries/holds
30
48
  */
31
49
  import { callApi } from './shared.js';
50
+ import { DISPOSITION_AGENT_RESOLVABLE } from './escalation-dispositions.js';
51
+ import { readObservation } from './filing-observation.js';
52
+ import { readSymptoms } from './incident-correlation.js';
32
53
  /** Escalation statuses that count as OPEN for every hold lookup here. */
33
54
  export const OPEN_ESCALATION_STATUSES = new Set(['pending', 'in_review']);
34
55
  /**
@@ -147,13 +168,65 @@ export const SELF_REPORT_STALL_HOLD_KINDS = [
147
168
  export const REFUSED_OPERATOR_HOLD_KINDS = [
148
169
  'verify_evidence_unavailable',
149
170
  ];
171
+ /**
172
+ * escalation_kind discriminators whose filing reports a MACHINE STOP -- the daemon
173
+ * has halted something and the detector proposed the act that ends it. Read from
174
+ * the filing sites that name a humanAct and stop the machine; each stop is
175
+ * enforced where its row is read:
176
+ *
177
+ * team_failure -- completion/event-escalations.ts escalateNonAdvanceable and
178
+ * escalateDeliveryAdvancementStalled. Enforced by the respawn guard
179
+ * (focus/focus-respawn-guard.ts, via hasOpenTeamFailureEscalation).
180
+ * respawn_cycle_exhausted -- spawn/respawn-cycle-escalation.ts. Enforced by the
181
+ * durable spawn-cooldown `exhausted` latch (spawn/spawn-cooldown.ts), NOT by
182
+ * this row: the respawn guard does not read the kind, so the halt is
183
+ * disposition-independent, and the latch's spawn-independent recovery
184
+ * (clearSpawnCooldown on an auto-advance) is never stranded behind a row that
185
+ * nothing auto-resolves.
186
+ * review_handoff_exhausted (zero findings) -- completion/review-exit-escalations.ts.
187
+ * Enforced by the state cascade's kind-keyed breaker hold (any disposition).
188
+ *
189
+ * Not a stop kind: review_coverage_incomplete names no act; it is a machine
190
+ * wait-state the coverage stabilizer clears, and the respawn guard reads it by
191
+ * kind regardless of disposition.
192
+ */
193
+ export const MACHINE_STOP_KINDS = [
194
+ 'team_failure',
195
+ 'respawn_cycle_exhausted',
196
+ 'review_handoff_exhausted',
197
+ ];
198
+ /**
199
+ * Pure: whether an escalation row is an OPEN machine-stop OBSERVATION -- a
200
+ * MACHINE_STOP_KINDS row (typed kind column, metadata.kind fallback) whose
201
+ * well-formed metadata.observation carries the detector's proposed_human_act.
202
+ *
203
+ * The ONE definition of "a machine-lane record that still stops the machine".
204
+ * The filing chokepoint sends every daemon filing to the machine lane, so a
205
+ * detector's named act no longer makes its row needs_operator; this predicate is
206
+ * what keeps that stop holding. The respawn guard's machine-lane exclusion keeps
207
+ * such a row blocking, and the routing decider treats it as immediately eligible
208
+ * (a stopped focus spawns no team to decide it). A stop-kind observation with NO
209
+ * proposed act is a plain record the incoming team resolves (TEL-2) -> false.
210
+ * Disposition-independent: a row an agent made human-facing (needs_operator,
211
+ * metadata.human_act) blocks on its disposition, not on this predicate.
212
+ */
213
+ export function isMachineStopObservation(row) {
214
+ if (row.status && !OPEN_ESCALATION_STATUSES.has(row.status))
215
+ return false;
216
+ const metaKind = row.metadata?.kind;
217
+ const kind = row.escalationKind ?? (typeof metaKind === 'string' ? metaKind : null);
218
+ if (kind === null || !MACHINE_STOP_KINDS.includes(kind))
219
+ return false;
220
+ return readObservation(row.metadata)?.proposed_human_act !== undefined;
221
+ }
150
222
  /**
151
223
  * Returns the OPEN (pending|in_review) operator-hold escalation anchored to the
152
224
  * given delivery, or null when none is open.
153
225
  *
154
226
  * DISPOSITION-keyed sibling of hasOpenEscalationForDelivery (which is KIND-keyed):
155
227
  * it matches ANY escalation_kind whose disposition is in OPERATOR_HOLD_DISPOSITIONS
156
- * (needs_operator / external_wait). This is the vocabulary the verify->done gate
228
+ * (needs_operator / external_wait), or that is an observation proposing one (see
229
+ * the module header). This is the vocabulary the verify->done gate
157
230
  * previously lacked -- an operator blocked ON a delivery (e.g. "the host restore
158
231
  * was NOT executed") could not hold that delivery out of done, so a clean review
159
232
  * auto-approved it. Returning the matching row (id + kind + disposition), not a
@@ -199,7 +272,9 @@ export async function hasOpenOperatorHoldForDelivery(deliveryId, focusId, deps =
199
272
  * address -- and returns the first whose delivery matches (typed delivery_id
200
273
  * COLUMN preferred, metadata.deliveryId fallback for rows open at deploy time)
201
274
  * AND whose disposition (typed column preferred, metadata fallback) is in the
202
- * given set. Status is re-checked client-side as defense-in-depth against a
275
+ * given set -- or, when it is not, whose metadata.observation proposed a
276
+ * disposition in the set (an observation hold; the result then carries
277
+ * proposedDisposition). Status is re-checked client-side as defense-in-depth against a
203
278
  * deploy-lagged edge fn returning resolved rows. THROWS on a hard API error;
204
279
  * fail-open/closed is the CALLER's choice.
205
280
  *
@@ -224,14 +299,34 @@ async function findOpenHoldForDelivery(deliveryId, dispositions, focusId, exclud
224
299
  const disposition = (typeof e.disposition === 'string' ? e.disposition : null) ??
225
300
  (typeof meta?.disposition === 'string' ? meta.disposition : null);
226
301
  const matchedDelivery = e.deliveryId === deliveryId || meta?.deliveryId === deliveryId;
227
- if (matchedDelivery && disposition !== null && holdSet.has(disposition)) {
228
- const kind = (typeof e.escalationKind === 'string' ? e.escalationKind : null) ??
229
- (typeof meta?.kind === 'string' ? meta.kind : null);
230
- // A self-referential stall alarm about this delivery must not hold it.
231
- if (excludeKinds && kind !== null && excludeKinds.has(kind))
232
- continue;
233
- return { id: e.id, escalationKind: e.escalationKind ?? null, disposition };
234
- }
302
+ if (!matchedDelivery)
303
+ continue;
304
+ const direct = disposition !== null && holdSet.has(disposition);
305
+ const kind = (typeof e.escalationKind === 'string' ? e.escalationKind : null) ??
306
+ (typeof meta?.kind === 'string' ? meta.kind : null);
307
+ // The row's own condition first, then each condition correlated onto it as a
308
+ // symptom (queries/incident-correlation.ts): an attached observation keeps the
309
+ // hold it proposed even when the row that absorbed it holds nothing itself.
310
+ const conditions = [
311
+ { kind, reportedKind: e.escalationKind ?? null, proposed: readObservation(meta)?.proposed_disposition ?? null },
312
+ ...readSymptoms(meta).map((s) => ({ kind: s.escalation_kind, reportedKind: s.escalation_kind, proposed: s.proposed_disposition ?? null })),
313
+ ];
314
+ const held = conditions.find(
315
+ // An observation proposing a hold disposition is the same uncleared condition,
316
+ // routed to the machine lane (see the module header). A self-referential stall
317
+ // alarm about this delivery must not hold it -- and the exclusions bind an
318
+ // observation of an excluded kind exactly as they bind a direct filing, so the
319
+ // fixpoint cannot return through the machine lane (or through a symptom).
320
+ (c) => (direct || (c.proposed !== null && holdSet.has(c.proposed))) &&
321
+ !(excludeKinds && c.kind !== null && excludeKinds.has(c.kind)));
322
+ if (!held)
323
+ continue;
324
+ return {
325
+ id: e.id,
326
+ escalationKind: held.reportedKind,
327
+ disposition: disposition ?? DISPOSITION_AGENT_RESOLVABLE,
328
+ ...(!direct && held.proposed !== null ? { proposedDisposition: held.proposed } : {}),
329
+ };
235
330
  }
236
331
  return null;
237
332
  }
@@ -1 +1 @@
1
- {"version":3,"file":"holds.js","sourceRoot":"","sources":["../../src/queries/holds.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,sFAAsF;AACtF,kEAAkE;AAClE,gBAAgB;AAEhB;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,EAAE,OAAO,EAAoB,MAAM,aAAa,CAAC;AAExD,yEAAyE;AACzE,MAAM,CAAC,MAAM,wBAAwB,GAAwB,IAAI,GAAG,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