@telora/daemon 0.22.85 → 0.22.87

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 (260) hide show
  1. package/build-info.json +4 -3
  2. package/dist/ci/ci-escalation.d.ts +17 -1
  3. package/dist/ci/ci-escalation.d.ts.map +1 -1
  4. package/dist/ci/ci-escalation.js +51 -3
  5. package/dist/ci/ci-escalation.js.map +1 -1
  6. package/dist/ci/ci-red-attribution.d.ts +85 -0
  7. package/dist/ci/ci-red-attribution.d.ts.map +1 -0
  8. package/dist/ci/ci-red-attribution.js +108 -0
  9. package/dist/ci/ci-red-attribution.js.map +1 -0
  10. package/dist/ci/ci-sensor-loop.d.ts +84 -80
  11. package/dist/ci/ci-sensor-loop.d.ts.map +1 -1
  12. package/dist/ci/ci-sensor-loop.js +132 -129
  13. package/dist/ci/ci-sensor-loop.js.map +1 -1
  14. package/dist/completion/coverage-stabilized.d.ts.map +1 -1
  15. package/dist/completion/coverage-stabilized.js +1 -1
  16. package/dist/completion/coverage-stabilized.js.map +1 -1
  17. package/dist/completion/escalations.d.ts +40 -5
  18. package/dist/completion/escalations.d.ts.map +1 -1
  19. package/dist/completion/escalations.js +19 -11
  20. package/dist/completion/escalations.js.map +1 -1
  21. package/dist/completion/event-escalations.d.ts +12 -1
  22. package/dist/completion/event-escalations.d.ts.map +1 -1
  23. package/dist/completion/event-escalations.js +73 -37
  24. package/dist/completion/event-escalations.js.map +1 -1
  25. package/dist/completion/event.d.ts +4 -1
  26. package/dist/completion/event.d.ts.map +1 -1
  27. package/dist/completion/event.js +1 -1
  28. package/dist/completion/event.js.map +1 -1
  29. package/dist/completion/human-only-act.d.ts +1 -1
  30. package/dist/completion/human-only-act.js +1 -1
  31. package/dist/completion/machine-remediable-demotion.d.ts +28 -1
  32. package/dist/completion/machine-remediable-demotion.d.ts.map +1 -1
  33. package/dist/completion/machine-remediable-demotion.js +9 -6
  34. package/dist/completion/machine-remediable-demotion.js.map +1 -1
  35. package/dist/completion/read-only-pristine.d.ts.map +1 -1
  36. package/dist/completion/read-only-pristine.js +4 -0
  37. package/dist/completion/read-only-pristine.js.map +1 -1
  38. package/dist/completion/review-exit-deps.js +1 -1
  39. package/dist/completion/review-exit-deps.js.map +1 -1
  40. package/dist/completion/review-exit-escalations.d.ts +10 -0
  41. package/dist/completion/review-exit-escalations.d.ts.map +1 -1
  42. package/dist/completion/review-exit-escalations.js +38 -3
  43. package/dist/completion/review-exit-escalations.js.map +1 -1
  44. package/dist/completion/review-exit-phase.d.ts.map +1 -1
  45. package/dist/completion/review-exit-phase.js +8 -7
  46. package/dist/completion/review-exit-phase.js.map +1 -1
  47. package/dist/completion/review-exit-shortfall.d.ts +5 -1
  48. package/dist/completion/review-exit-shortfall.d.ts.map +1 -1
  49. package/dist/completion/review-exit-shortfall.js +8 -3
  50. package/dist/completion/review-exit-shortfall.js.map +1 -1
  51. package/dist/completion/status-advance-phase.d.ts +2 -0
  52. package/dist/completion/status-advance-phase.d.ts.map +1 -1
  53. package/dist/completion/status-advance-phase.js +2 -1
  54. package/dist/completion/status-advance-phase.js.map +1 -1
  55. package/dist/completion/terminated-work-reconcile.js +2 -2
  56. package/dist/completion/terminated-work-reconcile.js.map +1 -1
  57. package/dist/delivery/delivery-advance-block.d.ts +3 -3
  58. package/dist/delivery/delivery-advance-block.d.ts.map +1 -1
  59. package/dist/delivery/delivery-advance-block.js +13 -8
  60. package/dist/delivery/delivery-advance-block.js.map +1 -1
  61. package/dist/delivery/delivery-lifecycle.d.ts +10 -0
  62. package/dist/delivery/delivery-lifecycle.d.ts.map +1 -1
  63. package/dist/delivery/delivery-lifecycle.js +12 -6
  64. package/dist/delivery/delivery-lifecycle.js.map +1 -1
  65. package/dist/delivery/delivery-merge-ops.d.ts.map +1 -1
  66. package/dist/delivery/delivery-merge-ops.js +39 -21
  67. package/dist/delivery/delivery-merge-ops.js.map +1 -1
  68. package/dist/delivery/external-hold.d.ts +8 -2
  69. package/dist/delivery/external-hold.d.ts.map +1 -1
  70. package/dist/delivery/external-hold.js +12 -5
  71. package/dist/delivery/external-hold.js.map +1 -1
  72. package/dist/delivery/operator-hold.d.ts +6 -1
  73. package/dist/delivery/operator-hold.d.ts.map +1 -1
  74. package/dist/delivery/operator-hold.js +31 -10
  75. package/dist/delivery/operator-hold.js.map +1 -1
  76. package/dist/delivery/paused-revival.d.ts +6 -0
  77. package/dist/delivery/paused-revival.d.ts.map +1 -1
  78. package/dist/delivery/paused-revival.js +3 -1
  79. package/dist/delivery/paused-revival.js.map +1 -1
  80. package/dist/directive/directive-dispatch.d.ts.map +1 -1
  81. package/dist/directive/directive-dispatch.js +6 -3
  82. package/dist/directive/directive-dispatch.js.map +1 -1
  83. package/dist/directive/directive-queue.d.ts.map +1 -1
  84. package/dist/directive/directive-queue.js +4 -1
  85. package/dist/directive/directive-queue.js.map +1 -1
  86. package/dist/drift/staleness-sensor.d.ts +14 -0
  87. package/dist/drift/staleness-sensor.d.ts.map +1 -1
  88. package/dist/drift/staleness-sensor.js +30 -1
  89. package/dist/drift/staleness-sensor.js.map +1 -1
  90. package/dist/focus/focus-executor.d.ts.map +1 -1
  91. package/dist/focus/focus-executor.js +6 -8
  92. package/dist/focus/focus-executor.js.map +1 -1
  93. package/dist/focus/focus-loop-registry.d.ts.map +1 -1
  94. package/dist/focus/focus-loop-registry.js +23 -13
  95. package/dist/focus/focus-loop-registry.js.map +1 -1
  96. package/dist/focus/focus-respawn-guard.d.ts.map +1 -1
  97. package/dist/focus/focus-respawn-guard.js +21 -4
  98. package/dist/focus/focus-respawn-guard.js.map +1 -1
  99. package/dist/focus/listener-auto-advance.d.ts.map +1 -1
  100. package/dist/focus/listener-auto-advance.js +10 -6
  101. package/dist/focus/listener-auto-advance.js.map +1 -1
  102. package/dist/focus/verify-open-issues.d.ts.map +1 -1
  103. package/dist/focus/verify-open-issues.js +21 -1
  104. package/dist/focus/verify-open-issues.js.map +1 -1
  105. package/dist/focus-stage-lifecycle/wedge-watchdog.d.ts.map +1 -1
  106. package/dist/focus-stage-lifecycle/wedge-watchdog.js +35 -14
  107. package/dist/focus-stage-lifecycle/wedge-watchdog.js.map +1 -1
  108. package/dist/loops/index.d.ts.map +1 -1
  109. package/dist/loops/index.js +2 -1
  110. package/dist/loops/index.js.map +1 -1
  111. package/dist/merge/focus-merge.d.ts +1 -1
  112. package/dist/merge/focus-merge.d.ts.map +1 -1
  113. package/dist/merge/focus-merge.js +5 -1
  114. package/dist/merge/focus-merge.js.map +1 -1
  115. package/dist/merge/merge-back-loop.d.ts +2 -1
  116. package/dist/merge/merge-back-loop.d.ts.map +1 -1
  117. package/dist/merge/merge-back-loop.js +15 -12
  118. package/dist/merge/merge-back-loop.js.map +1 -1
  119. package/dist/merge/merge-conflict-escalation.d.ts.map +1 -1
  120. package/dist/merge/merge-conflict-escalation.js +4 -0
  121. package/dist/merge/merge-conflict-escalation.js.map +1 -1
  122. package/dist/nexus/return.d.ts +14 -15
  123. package/dist/nexus/return.d.ts.map +1 -1
  124. package/dist/nexus/return.js +41 -31
  125. package/dist/nexus/return.js.map +1 -1
  126. package/dist/prompt-sections/execution-sections.d.ts +13 -5
  127. package/dist/prompt-sections/execution-sections.d.ts.map +1 -1
  128. package/dist/prompt-sections/execution-sections.js +78 -18
  129. package/dist/prompt-sections/execution-sections.js.map +1 -1
  130. package/dist/prompt-sections/routing-decider-sections.d.ts +60 -0
  131. package/dist/prompt-sections/routing-decider-sections.d.ts.map +1 -0
  132. package/dist/prompt-sections/routing-decider-sections.js +197 -0
  133. package/dist/prompt-sections/routing-decider-sections.js.map +1 -0
  134. package/dist/queries/agent-resolvable-aging.d.ts +4 -3
  135. package/dist/queries/agent-resolvable-aging.d.ts.map +1 -1
  136. package/dist/queries/agent-resolvable-aging.js +5 -4
  137. package/dist/queries/agent-resolvable-aging.js.map +1 -1
  138. package/dist/queries/agent-resolvable-promotion.d.ts +172 -124
  139. package/dist/queries/agent-resolvable-promotion.d.ts.map +1 -1
  140. package/dist/queries/agent-resolvable-promotion.js +332 -307
  141. package/dist/queries/agent-resolvable-promotion.js.map +1 -1
  142. package/dist/queries/agent-resolvable-retirement.d.ts +105 -0
  143. package/dist/queries/agent-resolvable-retirement.d.ts.map +1 -0
  144. package/dist/queries/agent-resolvable-retirement.js +227 -0
  145. package/dist/queries/agent-resolvable-retirement.js.map +1 -0
  146. package/dist/queries/cause-key.d.ts +109 -0
  147. package/dist/queries/cause-key.d.ts.map +1 -1
  148. package/dist/queries/cause-key.js +93 -1
  149. package/dist/queries/cause-key.js.map +1 -1
  150. package/dist/queries/deliveries.d.ts +14 -0
  151. package/dist/queries/deliveries.d.ts.map +1 -1
  152. package/dist/queries/deliveries.js +20 -2
  153. package/dist/queries/deliveries.js.map +1 -1
  154. package/dist/queries/delivery-gate-state.d.ts +130 -5
  155. package/dist/queries/delivery-gate-state.d.ts.map +1 -1
  156. package/dist/queries/delivery-gate-state.js +111 -2
  157. package/dist/queries/delivery-gate-state.js.map +1 -1
  158. package/dist/queries/escalation-consumption.d.ts +95 -15
  159. package/dist/queries/escalation-consumption.d.ts.map +1 -1
  160. package/dist/queries/escalation-consumption.js +162 -24
  161. package/dist/queries/escalation-consumption.js.map +1 -1
  162. package/dist/queries/escalation-dispositions.d.ts +19 -7
  163. package/dist/queries/escalation-dispositions.d.ts.map +1 -1
  164. package/dist/queries/escalation-dispositions.js +7 -0
  165. package/dist/queries/escalation-dispositions.js.map +1 -1
  166. package/dist/queries/escalation-suppression.d.ts +63 -19
  167. package/dist/queries/escalation-suppression.d.ts.map +1 -1
  168. package/dist/queries/escalation-suppression.js +64 -35
  169. package/dist/queries/escalation-suppression.js.map +1 -1
  170. package/dist/queries/escalations.d.ts +127 -70
  171. package/dist/queries/escalations.d.ts.map +1 -1
  172. package/dist/queries/escalations.js +170 -188
  173. package/dist/queries/escalations.js.map +1 -1
  174. package/dist/queries/filing-observation.d.ts +82 -0
  175. package/dist/queries/filing-observation.d.ts.map +1 -0
  176. package/dist/queries/filing-observation.js +157 -0
  177. package/dist/queries/filing-observation.js.map +1 -0
  178. package/dist/queries/holds.d.ts +69 -2
  179. package/dist/queries/holds.d.ts.map +1 -1
  180. package/dist/queries/holds.js +106 -11
  181. package/dist/queries/holds.js.map +1 -1
  182. package/dist/queries/incident-correlation.d.ts +291 -0
  183. package/dist/queries/incident-correlation.d.ts.map +1 -0
  184. package/dist/queries/incident-correlation.js +408 -0
  185. package/dist/queries/incident-correlation.js.map +1 -0
  186. package/dist/queries/routing-measurement.d.ts +48 -1
  187. package/dist/queries/routing-measurement.d.ts.map +1 -1
  188. package/dist/queries/routing-measurement.js +64 -2
  189. package/dist/queries/routing-measurement.js.map +1 -1
  190. package/dist/queries/routing-quality.d.ts +8 -0
  191. package/dist/queries/routing-quality.d.ts.map +1 -1
  192. package/dist/queries/routing-quality.js +12 -3
  193. package/dist/queries/routing-quality.js.map +1 -1
  194. package/dist/queries/shared.js +1 -1
  195. package/dist/shell/crash-recovery.d.ts.map +1 -1
  196. package/dist/shell/crash-recovery.js +6 -6
  197. package/dist/shell/crash-recovery.js.map +1 -1
  198. package/dist/shell/install-probe-tick.d.ts.map +1 -1
  199. package/dist/shell/install-probe-tick.js +3 -1
  200. package/dist/shell/install-probe-tick.js.map +1 -1
  201. package/dist/spawn/respawn-cycle-escalation.d.ts +10 -2
  202. package/dist/spawn/respawn-cycle-escalation.d.ts.map +1 -1
  203. package/dist/spawn/respawn-cycle-escalation.js +16 -2
  204. package/dist/spawn/respawn-cycle-escalation.js.map +1 -1
  205. package/dist/spawn/routing-decider-spawn.d.ts +93 -0
  206. package/dist/spawn/routing-decider-spawn.d.ts.map +1 -0
  207. package/dist/spawn/routing-decider-spawn.js +185 -0
  208. package/dist/spawn/routing-decider-spawn.js.map +1 -0
  209. package/dist/spawn/routing-decider.d.ts +42 -0
  210. package/dist/spawn/routing-decider.d.ts.map +1 -0
  211. package/dist/spawn/routing-decider.js +95 -0
  212. package/dist/spawn/routing-decider.js.map +1 -0
  213. package/dist/spawn/shared.d.ts +8 -0
  214. package/dist/spawn/shared.d.ts.map +1 -1
  215. package/dist/spawn/shared.js +1 -1
  216. package/dist/spawn/shared.js.map +1 -1
  217. package/dist/spawn/spawn-decision.d.ts +23 -16
  218. package/dist/spawn/spawn-decision.d.ts.map +1 -1
  219. package/dist/spawn/spawn-decision.js +27 -11
  220. package/dist/spawn/spawn-decision.js.map +1 -1
  221. package/dist/spawn/worktree-session.d.ts +19 -7
  222. package/dist/spawn/worktree-session.d.ts.map +1 -1
  223. package/dist/spawn/worktree-session.js +36 -8
  224. package/dist/spawn/worktree-session.js.map +1 -1
  225. package/dist/testing/fixtures/index.js +1 -1
  226. package/dist/types/index.js +1 -1
  227. package/dist/verify/failure-signature.d.ts +91 -0
  228. package/dist/verify/failure-signature.d.ts.map +1 -0
  229. package/dist/verify/failure-signature.js +233 -0
  230. package/dist/verify/failure-signature.js.map +1 -0
  231. package/dist/verify/shortfall-repeat.d.ts +12 -9
  232. package/dist/verify/shortfall-repeat.d.ts.map +1 -1
  233. package/dist/verify/shortfall-repeat.js +38 -14
  234. package/dist/verify/shortfall-repeat.js.map +1 -1
  235. package/dist/verify/stall-detectors.d.ts +19 -43
  236. package/dist/verify/stall-detectors.d.ts.map +1 -1
  237. package/dist/verify/stall-detectors.js +26 -101
  238. package/dist/verify/stall-detectors.js.map +1 -1
  239. package/dist/verify/unreviewed-settle-detector.d.ts +8 -0
  240. package/dist/verify/unreviewed-settle-detector.d.ts.map +1 -1
  241. package/dist/verify/unreviewed-settle-detector.js +15 -1
  242. package/dist/verify/unreviewed-settle-detector.js.map +1 -1
  243. package/dist/verify/verification-deps-default.d.ts.map +1 -1
  244. package/dist/verify/verification-deps-default.js +14 -2
  245. package/dist/verify/verification-deps-default.js.map +1 -1
  246. package/dist/verify/verification-evidence-unavailable-feedback.d.ts.map +1 -1
  247. package/dist/verify/verification-evidence-unavailable-feedback.js +8 -2
  248. package/dist/verify/verification-evidence-unavailable-feedback.js.map +1 -1
  249. package/dist/verify/verification-feedback.d.ts +62 -14
  250. package/dist/verify/verification-feedback.d.ts.map +1 -1
  251. package/dist/verify/verification-feedback.js +101 -28
  252. package/dist/verify/verification-feedback.js.map +1 -1
  253. package/dist/verify/verify-gate-stall.d.ts +116 -0
  254. package/dist/verify/verify-gate-stall.d.ts.map +1 -0
  255. package/dist/verify/verify-gate-stall.js +169 -0
  256. package/dist/verify/verify-gate-stall.js.map +1 -0
  257. package/dist/verify/verify-restatement.d.ts.map +1 -1
  258. package/dist/verify/verify-restatement.js +2 -1
  259. package/dist/verify/verify-restatement.js.map +1 -1
  260. package/package.json +2 -2
@@ -1,14 +1,15 @@
1
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-owning-focus-resolve.test.ts,
3
- // packages/daemon/src/ci/ci-sensor-loop.test.ts
2
+ // Pinned by: packages/daemon/src/ci/ci-sensor-loop.test.ts,
3
+ // packages/daemon/src/queries/incident-correlation.test.ts,
4
+ // packages/daemon/src/queries/incident-stamping.test.ts
4
5
  // PINNED-BY-END
5
6
  import { configForProduct } from '../shell/config.js';
6
7
  import { decideCiSensorAction, createGitNativeCiStatusReader } from './ci-status.js';
7
8
  import { listCiStatusRefs, resolveRemoteIntegrationTip } from './ci-status-git.js';
8
- import { createEscalation, markEscalationResolved } from '../queries/escalations.js';
9
- import { getDeliveryContext } from '../queries/deliveries.js';
10
- import { getActiveFocuses } from '../queries/focus-discovery.js';
11
- import { readDeliveryTrailer, resolveRecordedMergeRange, listRangeCommits } from '../resolvers/shared/git-diff.js';
9
+ import { resolveRedRunAnchor } from './ci-red-attribution.js';
10
+ import { createEscalation, markEscalationResolved, retireAbsorbedSymptoms } from '../queries/escalations.js';
11
+ import { NO_HUMAN_ACT } from '../queries/filing-observation.js';
12
+ import { openRowSymptomCauseKeys } from '../queries/incident-correlation.js';
12
13
  import { callApi } from '../queries/shared.js';
13
14
  import { ciRunRedCauseKey } from '../queries/cause-key.js';
14
15
  import { ESCALATION_REASONS, ESCALATION_DISPOSITIONS, healthEvents } from '@telora/daemon-core';
@@ -81,15 +82,16 @@ export function ciRunRedEscalationDescription(params) {
81
82
  `Do not hand-roll the Gitea API chain or wait for a human to paste the log. Full ` +
82
83
  `reference: ${route.runbook}.\n\n` +
83
84
  `This filing auto-resolves when a later integration run goes green; if ` +
84
- `the machine cannot clear it, the 24h agent_resolvable promotion backstop surfaces ` +
85
+ `no agent clears it, the agent_resolvable promotion backstop surfaces ` +
85
86
  `it to an operator.`);
86
87
  }
87
88
  /**
88
89
  * Structured metadata for a ci_run_red filing: the cause-key routing fields, the
89
- * posture it sets and that posture's termination condition, PLUS the self-
90
- * contained `diagnosis` route (see ciLogDiagnosisRoute) so a team inheriting the
91
- * escalation later reads the same log route the original filing carried. Pure and
92
- * exported so the metadata contract is unit-testable without mocking createEscalation.
90
+ * attributed anchor (focus_id / delivery_id, null when branch-only), the posture
91
+ * it sets and that posture's termination condition, PLUS the self-contained
92
+ * `diagnosis` route (see ciLogDiagnosisRoute) so a team inheriting the escalation
93
+ * later reads the same log route the original filing carried. Pure and exported
94
+ * so the metadata contract is unit-testable without mocking createEscalation.
93
95
  */
94
96
  export function ciRunRedEscalationMetadata(params) {
95
97
  return {
@@ -97,6 +99,7 @@ export function ciRunRedEscalationMetadata(params) {
97
99
  branch: params.branch,
98
100
  product_id: params.productId,
99
101
  focus_id: params.focusId,
102
+ delivery_id: params.deliveryId ?? null,
100
103
  cause_key: ciRunRedCauseKey(params.branch),
101
104
  posture: CI_RUN_RED_POSTURE,
102
105
  terminates_when: CI_RUN_RED_POSTURE_TERMINATES,
@@ -106,32 +109,46 @@ export function ciRunRedEscalationMetadata(params) {
106
109
  const OPEN_STATUSES = new Set(['pending', 'in_review']);
107
110
  /** Statuses whose cause_key suppresses a re-file: open (idempotency) + dismissed (memory). */
108
111
  const SUPPRESSING_STATUSES = new Set(['pending', 'in_review', 'dismissed']);
109
- function isOpenCiRedForProduct(e, productId) {
112
+ /** The prefix every ci_run_red cause key carries (queries/cause-key.ciRunRedCauseKey). */
113
+ const CI_RUN_RED_CAUSE_KEY_PREFIX = `${CI_RUN_RED_ESCALATION_KIND}::`;
114
+ /**
115
+ * An OPEN ci_run_red row for this product, including the two HAND-OFF rows that
116
+ * stand in for one:
117
+ * - a routing decider's human-facing filing (MCP escalate with sourceCauseKey):
118
+ * kind agent_filed, carrying metadata.original_cause_key `ci_run_red::...` and
119
+ * metadata.originalEscalationId but NO originalKind;
120
+ * - a historic promotion-backstop refile (the daemon no longer files these):
121
+ * re-kinded agent_resolvable_promoted, carrying metadata.originalKind.
122
+ * A row's originalKind, when it carries one, is authoritative for its origin; the
123
+ * original_cause_key prefix decides only for a row without it (the decider's).
124
+ * Covering both lets a later green resolve the human-facing row too (no stale
125
+ * inbox item once the red cleared), and keeps an open one suppressing a fresh
126
+ * branch-only observation. Exported for direct unit testing.
127
+ */
128
+ export function isOpenCiRedForProduct(e, productId) {
110
129
  if (e.status && !OPEN_STATUSES.has(e.status))
111
130
  return false;
112
- if (e.escalationKind !== CI_RUN_RED_ESCALATION_KIND)
113
- return false;
114
131
  const meta = e.metadata ?? null;
115
- return e.productId === productId || meta?.productId === productId;
132
+ const originalKind = meta?.originalKind;
133
+ const originalCauseKey = meta?.original_cause_key;
134
+ const handedOffCiRed = typeof originalKind === 'string'
135
+ ? originalKind === CI_RUN_RED_ESCALATION_KIND
136
+ : typeof originalCauseKey === 'string' && originalCauseKey.startsWith(CI_RUN_RED_CAUSE_KEY_PREFIX);
137
+ if (e.escalationKind !== CI_RUN_RED_ESCALATION_KIND && !handedOffCiRed)
138
+ return false;
139
+ return e.productId === productId || meta?.productId === productId || meta?.product_id === productId;
116
140
  }
117
- /**
118
- * Whether a re-file for THIS red sha must be suppressed. Two ways it is:
119
- * - an OPEN or DISMISSED row already carries the same cause key (sha+branch) --
120
- * the cause-keyed path with DISMISSAL MEMORY. This is what fixes the incident
121
- * where an operator dismissed a ci_run_red for a sha and the daemon re-filed
122
- * the SAME sha on the next scan: a dismissed cause_key now keeps it silent
123
- * until a NEW sha (a different cause key) goes red.
124
- * - a legacy OPEN product+kind row with no cause_key exists (deployment-window
125
- * back-compat for rows filed before this change).
126
- *
127
- * A new sha yields a different cause key with no matching open/dismissed row and
128
- * re-files; a later green run resolves the open row via resolveCiRedEscalations.
129
- */
130
141
  /**
131
142
  * Pure suppression predicate over already-fetched rows. A re-file for this red
132
- * sha is suppressed when an open/dismissed row carries the same cause key
133
- * (dismissal memory), or a legacy open product+kind row exists. Exported for
134
- * direct unit testing (no callApi mocking needed).
143
+ * sha is suppressed when an OPEN or DISMISSED row carries the same cause key
144
+ * (dismissal memory: an operator-dismissed branch stays silent until a new
145
+ * breakage resolves and re-reds it), an OPEN row carries it as a live absorbed
146
+ * symptom (the filing would only be "already carried" by the incident reducer --
147
+ * and a green tick must still see it open, so resolve-on-green retires it), or a
148
+ * legacy OPEN product+kind row with no cause_key exists (deployment-window
149
+ * back-compat). A later green run resolves the open row via
150
+ * resolveCiRedEscalations. Exported for direct unit testing (no callApi mocking
151
+ * needed).
135
152
  */
136
153
  export function isCiRedRefileSuppressed(rows, params) {
137
154
  // Branch-scoped: one open ci_run_red per red integration branch. Successive
@@ -140,11 +157,16 @@ export function isCiRedRefileSuppressed(rows, params) {
140
157
  return rows.some((e) => {
141
158
  // A cause-key match suppresses only for OPEN or DISMISSED rows -- 'resolved'
142
159
  // is excluded so a recurrence of the same sha after a green resolve re-files.
160
+ // original_cause_key marks a hand-off row for a branch-only observation (a
161
+ // routing decider's filing with sourceCauseKey, or a historic promotion
162
+ // refile): it must keep suppressing, or the sensor would re-file while it is open.
143
163
  if (SUPPRESSING_STATUSES.has(e.status ?? '')) {
144
164
  const meta = e.metadata ?? null;
145
- if (typeof meta?.cause_key === 'string' && meta.cause_key === causeKey)
165
+ if (meta?.cause_key === causeKey || meta?.original_cause_key === causeKey)
146
166
  return true;
147
167
  }
168
+ if (openRowSymptomCauseKeys(e).includes(causeKey))
169
+ return true;
148
170
  // Legacy back-compat: an OPEN product+kind row with no cause_key still suppresses.
149
171
  return isOpenCiRedForProduct(e, params.productId);
150
172
  });
@@ -157,8 +179,16 @@ async function defaultHasOpenCiRedEscalation(params) {
157
179
  });
158
180
  return isCiRedRefileSuppressed(result.escalations ?? [], params);
159
181
  }
160
- async function defaultResolveCiRedEscalations(productId) {
161
- const result = await callApi('escalation_list', {
182
+ /**
183
+ * Resolve-on-green (the production resolveCiRedEscalations): resolve the product's
184
+ * open ci_run_red rows (and the hand-off rows standing in for one: a routing decider's
185
+ * human-facing filing, a historic promoted refile) auto_swept, then retire a ci_run_red
186
+ * absorbed as a symptom onto another open row of the product (incident contract
187
+ * rule 6), over the same read. Best-effort per row. Exported with a callApi seam
188
+ * for tests.
189
+ */
190
+ export async function defaultResolveCiRedEscalations(productId, deps = {}) {
191
+ const result = await (deps.callApi ?? callApi)('escalation_list', {
162
192
  fields: { statuses: ['pending', 'in_review'] },
163
193
  limit: 500,
164
194
  });
@@ -166,28 +196,43 @@ async function defaultResolveCiRedEscalations(productId) {
166
196
  let resolved = 0;
167
197
  for (const e of open) {
168
198
  try {
169
- await markEscalationResolved(e.id, 'Auto-resolved by the daemon: a later CI run on integration went green.');
199
+ await markEscalationResolved(e.id, 'auto_swept', 'Auto-resolved by the daemon: a later CI run on integration went green.', deps);
170
200
  resolved++;
171
201
  }
172
202
  catch (err) {
173
203
  log.warn(`Failed to resolve ci_run_red escalation ${e.id}: ${err.message}`);
174
204
  }
175
205
  }
206
+ const clearing = { kinds: [CI_RUN_RED_ESCALATION_KIND], scope: { productId }, resolutionClass: 'auto_swept' };
207
+ await retireAbsorbedSymptoms(clearing, { rows: result.escalations ?? [], skipIds: open.map((e) => e.id) }, deps);
176
208
  return resolved;
177
209
  }
178
- async function defaultFileCiRedEscalation(params) {
179
- await createEscalation({
210
+ /**
211
+ * The ci_run_red filing. Pure and exported so its routing is unit-testable (the
212
+ * poll-loop tests inject a mock fileCiRedEscalation).
213
+ *
214
+ * - Focus-attributed: agent_resolvable. Fixing a failing CI gate is CODING work;
215
+ * the focus whose merge turned integration red carries it into its next coding
216
+ * pass (the focus-scoped agent_resolvable pickup).
217
+ * - Branch-only: a plain agent_resolvable row reaches no spawn and is never
218
+ * promoted, so the red would sit invisible while the merge gate holds main. It
219
+ * is proposed needs_operator with an explicit NO_HUMAN_ACT (the fix is still
220
+ * coding work, not a human act), so the filing chokepoint files it as a
221
+ * detector OBSERVATION, which the anchorless promotion sweep surfaces next pass.
222
+ */
223
+ export function ciRunRedEscalationParams(params) {
224
+ return {
180
225
  organizationId: params.organizationId,
181
226
  issueId: null,
182
227
  reasonType: ESCALATION_REASONS.ERROR_ENCOUNTERED,
183
- // Fixing a failing CI gate is CODING work: file it as machine-routable
184
- // (hidden from the operator inbox) and anchor it to a focus so the daemon's
185
- // focus-scoped agent_resolvable pickup rides it into that focus's next
186
- // coding pass. A needs_operator filing only ever comes from the 24h
187
- // promotion backstop, after the machine has failed to clear it.
188
- disposition: ESCALATION_DISPOSITIONS.AGENT_RESOLVABLE,
228
+ disposition: params.focusId
229
+ ? ESCALATION_DISPOSITIONS.AGENT_RESOLVABLE
230
+ : ESCALATION_DISPOSITIONS.NEEDS_OPERATOR,
231
+ humanAct: NO_HUMAN_ACT,
189
232
  productId: params.productId,
190
- focusId: params.focusId,
233
+ // Branch-only when unattributable: no focus/delivery is guessed.
234
+ ...(params.focusId ? { focusId: params.focusId } : {}),
235
+ ...(params.deliveryId ? { deliveryId: params.deliveryId } : {}),
191
236
  escalationKind: CI_RUN_RED_ESCALATION_KIND,
192
237
  description: ciRunRedEscalationDescription(params),
193
238
  // cause_key (branch) collapses successive red tips onto one open filing and
@@ -195,68 +240,40 @@ async function defaultFileCiRedEscalation(params) {
195
240
  // The posture + terminates_when keys make the obligation's exit legible from
196
241
  // the escalation itself (see ciRunRedEscalationMetadata).
197
242
  metadata: ciRunRedEscalationMetadata(params),
198
- });
199
- }
200
- const defaultOwningFocusResolverDeps = {
201
- readTrailer: readDeliveryTrailer,
202
- resolveMergeRange: resolveRecordedMergeRange,
203
- listCommits: listRangeCommits,
204
- focusForDelivery: async (deliveryId) => (await getDeliveryContext(deliveryId))?.focus?.id ?? null,
205
- firstActiveFocus: async (config) => (await getActiveFocuses(config.organizationId, config.productId))[0]?.focus_id ?? null,
206
- };
207
- /**
208
- * Resolve the focus a red run's fix routes to. Order: (1) the tip's own
209
- * `Telora-Delivery` trailer; (2) when the tip is a MERGE (no own trailer), the
210
- * owning focus of the first trailered commit the merge introduced; (3) fallback
211
- * to any active focus. The arbitrary-active-focus fallback is reached ONLY when
212
- * no attributable commit exists at all. Best-effort: any git/DB failure degrades
213
- * to the fallback / null, never throws.
214
- */
215
- export async function resolveOwningFocus(config, sha, deps = defaultOwningFocusResolverDeps) {
216
- try {
217
- const deliveryId = deps.readTrailer(config.repoPath, sha);
218
- if (deliveryId) {
219
- const focusId = await deps.focusForDelivery(deliveryId);
220
- if (focusId)
221
- return focusId;
222
- }
223
- // Tip has no own trailer (the merge-commit case that made this path degrade
224
- // to the arbitrary-active-focus fallback and route red runs to the wrong
225
- // focus). Walk the merge's own commits and route to their owning focus.
226
- const mergeRange = deps.resolveMergeRange(config.repoPath, sha);
227
- if (mergeRange) {
228
- for (const commit of deps.listCommits(config.repoPath, mergeRange)) {
229
- const did = deps.readTrailer(config.repoPath, commit);
230
- if (!did)
231
- continue;
232
- const focusId = await deps.focusForDelivery(did);
233
- if (focusId)
234
- return focusId;
235
- }
236
- }
237
- }
238
- catch (err) {
239
- log.debug(`owning-focus trailer resolution failed for ${sha.slice(0, 12)}: ${err.message}`);
240
- }
241
- try {
242
- return await deps.firstActiveFocus(config);
243
- }
244
- catch (err) {
245
- log.debug(`active-focus fallback failed for product ${config.productId}: ${err.message}`);
246
- return null;
247
- }
243
+ };
248
244
  }
249
- function defaultResolveOwningFocus(config, sha) {
250
- return resolveOwningFocus(config, sha);
245
+ async function defaultFileCiRedEscalation(params) {
246
+ await createEscalation(ciRunRedEscalationParams(params));
251
247
  }
252
248
  const defaultDeps = {
253
249
  getCiStatus: createGitNativeCiStatusReader(listCiStatusRefs),
254
250
  resolveIntegrationTip: resolveRemoteIntegrationTip,
255
- resolveOwningFocus: defaultResolveOwningFocus,
251
+ resolveRedRunAnchor: (config, sha) => resolveRedRunAnchor(config, sha),
256
252
  hasOpenCiRedEscalation: defaultHasOpenCiRedEscalation,
257
253
  fileCiRedEscalation: defaultFileCiRedEscalation,
258
254
  resolveCiRedEscalations: defaultResolveCiRedEscalations,
259
255
  };
256
+ /**
257
+ * Surface a red run that has no team to route to as durable operator-visible
258
+ * STATE (TEL-6): a health event, not an escalation -- the hold clears itself when
259
+ * the run goes green. Emitted once per red episode (cleared on green in the tick).
260
+ * Returns whether this call emitted.
261
+ */
262
+ function surfaceHeldGate(productId, branch, sha) {
263
+ const heldKey = `${productId}:${sha}`;
264
+ if (surfacedHeldGates.has(heldKey))
265
+ return false;
266
+ surfacedHeldGates.add(heldKey);
267
+ healthEvents.emit({
268
+ severity: 'error',
269
+ source: `ci:${productId}`,
270
+ code: MERGE_HELD_NO_RECEIVER_CODE,
271
+ message: `Integration '${branch}' is RED at ${sha.slice(0, 12)} and the merge gate is holding ` +
272
+ 'main out, but the red could not be attributed to one focus -- there is no team to route ' +
273
+ 'the fix to (filed branch-only). Push a green fix, or pick up the branch-scoped ci_run_red.',
274
+ });
275
+ return true;
276
+ }
260
277
  /**
261
278
  * One CI-result sensor tick over every configured product. Per product: resolve
262
279
  * the remote integration tip, read its CI status (fail-closed), and file/resolve
@@ -276,40 +293,26 @@ export async function runCiSensorTick(config, deps = defaultDeps) {
276
293
  const hasOpen = await deps.hasOpenCiRedEscalation({ productId: pc.productId, sha, branch: pc.integrationBranch });
277
294
  const action = decideCiSensorAction(status, hasOpen);
278
295
  if (action === 'file') {
279
- const focusId = await deps.resolveOwningFocus(pc, sha);
280
- if (!focusId) {
281
- // No armed focus to route the fix to. File nothing and retry next
282
- // tick -- the fail-closed merge gate still holds main out on the red,
283
- // so nothing merges while the signal waits for a team. Filing an
284
- // unanchored agent_resolvable would be invisible forever (never
285
- // ridden, never promoted); a direct needs_operator is exactly the
286
- // inbox line this focus removes.
287
- //
288
- // But the held gate must not be SILENT (TEL-6): surface it as durable
289
- // operator-visible STATE (a health event, not an escalation -- there is
290
- // no human-only act to file, and the hold clears itself when a focus is
291
- // armed or the run goes green). Emitted once per red episode; cleared
292
- // when integration goes green below. This gives the held merge gate a
293
- // receiver even with no focus to anchor an escalation to.
294
- const heldKey = `${pc.productId}:${sha}`;
295
- if (!surfacedHeldGates.has(heldKey)) {
296
- surfacedHeldGates.add(heldKey);
296
+ const anchor = await deps.resolveRedRunAnchor(pc, sha);
297
+ await deps.fileCiRedEscalation({
298
+ organizationId: pc.organizationId,
299
+ productId: pc.productId,
300
+ focusId: anchor.focusId,
301
+ deliveryId: anchor.deliveryId,
302
+ sha,
303
+ branch: pc.integrationBranch,
304
+ });
305
+ counts.escalationsFiled++;
306
+ if (anchor.focusId) {
307
+ log.warn(`ci_run_red (agent_resolvable) filed for product ${pc.productId}, focus ${anchor.focusId.slice(0, 8)} (integration @ ${sha.slice(0, 12)}).`);
308
+ }
309
+ else {
310
+ // Not determinable: filed branch-only (never a guessed focus). No team
311
+ // rides it, so the held gate must not be SILENT either.
312
+ if (surfaceHeldGate(pc.productId, pc.integrationBranch, sha))
297
313
  counts.heldGatesSurfaced++;
298
- healthEvents.emit({
299
- severity: 'error',
300
- source: `ci:${pc.productId}`,
301
- code: MERGE_HELD_NO_RECEIVER_CODE,
302
- message: `Integration '${pc.integrationBranch}' is RED at ${sha.slice(0, 12)} and the ` +
303
- 'merge gate is holding main out, but no armed focus owns the fix -- there is no ' +
304
- 'team to route it to. Arm a focus on this product (or push a green fix) to clear the hold.',
305
- });
306
- }
307
- log.warn(`CI red on ${pc.integrationBranch} @ ${sha.slice(0, 12)} but no armed focus to route the fix to; holding (merge gate still fail-closed, surfaced as ${MERGE_HELD_NO_RECEIVER_CODE}), will retry.`);
308
- continue;
314
+ log.warn(`ci_run_red filed BRANCH-ONLY as an observation for product ${pc.productId} (integration @ ${sha.slice(0, 12)}): the red could not be attributed to one focus, so the promotion sweep surfaces it; merge gate still fail-closed, surfaced as ${MERGE_HELD_NO_RECEIVER_CODE}.`);
309
315
  }
310
- await deps.fileCiRedEscalation({ organizationId: pc.organizationId, productId: pc.productId, focusId, sha, branch: pc.integrationBranch });
311
- counts.escalationsFiled++;
312
- log.warn(`ci_run_red (agent_resolvable) filed for product ${pc.productId}, focus ${focusId.slice(0, 8)} (integration @ ${sha.slice(0, 12)}).`);
313
316
  }
314
317
  else if (action === 'resolve') {
315
318
  counts.escalationsResolved += await deps.resolveCiRedEscalations(pc.productId);
@@ -1 +1 @@
1
- {"version":3,"file":"ci-sensor-loop.js","sourceRoot":"","sources":["../../src/ci/ci-sensor-loop.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,qEAAqE;AACrE,kDAAkD;AAClD,gBAAgB;AA8ChB,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,oBAAoB,EAAE,6BAA6B,EAAuB,MAAM,gBAAgB,CAAC;AAC1G,OAAO,EAAE,gBAAgB,EAAE,2BAA2B,EAAE,MAAM,oBAAoB,CAAC;AACnF,OAAO,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AACrF,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,mBAAmB,EAAE,yBAAyB,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACnH,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,uBAAuB,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AA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age-stabilized.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,EAAE,8BAA8B,EAAE,sBAAsB,IAAI,6BAA6B,EAA8C,MAAM,2BAA2B,CAAC;AAChL,OAAO,EAAE,UAAU,IAAI,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAKlE;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CACpC,WAAW,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EACtC,OAAO,EAAE,MAAM,GAAG,IAAI,GACrB,OAAO,CAET;AAED,MAAM,WAAW,sBAAsB;IACrC,6EAA6E;IAC7E,QAAQ,EAAE,OAAO,8BAA8B,CAAC;IAChD,+EAA+E;IAC/E,UAAU,EAAE,OAAO,iBAAiB,CAAC;IACrC,8DAA8D;IAC9D,sBAAsB,EAAE,OAAO,6BAA6B,CAAC;CAC9D;AAQD,MAAM,WAAW,yBAAyB;IACxC,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,2EAA2E;IAC3E,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,qFAAqF;IACrF,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;GAMG;AACH,wBAAsB,+BAA+B,CACnD,GAAG,EAAE,yBAAyB,EAC9B,IAAI,GAAE,sBAAoC,GACzC,OAAO,CAAC,MAAM,CAAC,CAkCjB"}
1
+ {"version":3,"file":"coverage-stabilized.d.ts","sourceRoot":"","sources":["../../src/completion/coverage-stabilized.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,EAAE,8BAA8B,EAAE,sBAAsB,IAAI,6BAA6B,EAA8C,MAAM,2BAA2B,CAAC;AAChL,OAAO,EAAE,UAAU,IAAI,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAKlE;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CACpC,WAAW,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EACtC,OAAO,EAAE,MAAM,GAAG,IAAI,GACrB,OAAO,CAET;AAED,MAAM,WAAW,sBAAsB;IACrC,6EAA6E;IAC7E,QAAQ,EAAE,OAAO,8BAA8B,CAAC;IAChD,+EAA+E;IAC/E,UAAU,EAAE,OAAO,iBAAiB,CAAC;IACrC,8DAA8D;IAC9D,sBAAsB,EAAE,OAAO,6BAA6B,CAAC;CAC9D;AAQD,MAAM,WAAW,yBAAyB;IACxC,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,2EAA2E;IAC3E,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,qFAAqF;IACrF,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;GAMG;AACH,wBAAsB,+BAA+B,CACnD,GAAG,EAAE,yBAAyB,EAC9B,IAAI,GAAE,sBAAoC,GACzC,OAAO,CAAC,MAAM,CAAC,CAmCjB"}
@@ -70,7 +70,7 @@ export async function reconcileCoverageIncompleteHold(ctx, deps = defaultDeps) {
70
70
  if (!isCoverageBranchStable(recordedTip, liveTip))
71
71
  continue;
72
72
  try {
73
- await deps.markEscalationResolved(row.id, 'Auto-resolved by the daemon: the focus branch stabilized at the tip recorded when coverage-incomplete ' +
73
+ await deps.markEscalationResolved(row.id, 'auto_swept', 'Auto-resolved by the daemon: the focus branch stabilized at the tip recorded when coverage-incomplete ' +
74
74
  'was filed (no commits since), so a re-review can now complete coverage -- the spawn block cleared.');
75
75
  resolved++;
76
76
  }
@@ -1 +1 @@
1
- {"version":3,"file":"coverage-stabilized.js","sourceRoot":"","sources":["../../src/completion/coverage-stabilized.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,wEAAwE;AACxE,gBAAgB;AAEhB;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,EAAE,8BAA8B,EAAE,sBAAsB,IAAI,6BAA6B,EAAE,0CAA0C,EAAE,MAAM,2BAA2B,CAAC;AAChL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AAC;YACF,QAAQ,EAAE,CAAC;QACb,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,GAAG,CAAC,IAAI,CAAC,uDAAuD,GAAG,CAAC,EAAE,QAAQ,GAAG,CAAC,SAAS,MAAO,GAAa,CAAC,OAAO,EAAE,CAAC,CAAC;QAC7H,CAAC;IACH,CAAC;IACD,IAAI,QAAQ,GAAG,CAAC,EAAE,CAAC;QACjB,GAAG,CAAC,IAAI,CACN,kCAAkC,QAAQ,4CAA4C,GAAG,CAAC,SAAS,IAAI;YACvG,2BAA2B,OAAO,EAAE,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,8CAA8C,CAC/F,CAAC;IACJ,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC"}
@@ -1,5 +1,25 @@
1
+ /**
2
+ * Narrow escalation seam for the PRD divergence/realign core (Delivery E).
3
+ *
4
+ * The PRD controller files an escalation when a chosen pathway diverges and
5
+ * NO surviving alternative remains (loss of phase-lock with no re-capture). Per
6
+ * the PLL framing, the machine must hand the condition up, never silently lower
7
+ * the goal. That hand-up is always an OBSERVATION: the filing chokepoint
8
+ * (queries/filing-observation.ts) sends every daemon filing to the machine lane,
9
+ * where an agent that has climbed the intent ladder decides who owns it. The
10
+ * daemon has no human-facing route.
11
+ *
12
+ * This module exposes `fileEscalation({ focusId?, productId?, reason, kind?,
13
+ * details? })` -- the controller-facing shape -- and adapts it onto the existing
14
+ * `createEscalation` transport (queries/issues.js -> `agent_escalate`). The
15
+ * adapter is deliberately thin: it carries `organizationId` (resolved from
16
+ * config at the wiring site) and folds focus/product/details into the
17
+ * escalation metadata. No business logic lives here.
18
+ */
19
+ import { createEscalation } from '../queries/escalations.js';
1
20
  import { type EscalationReasonType, type EscalationDisposition } from '@telora/daemon-core';
2
21
  import { type NexusEscalationBridgeDeps } from '../nexus/index.js';
22
+ import { type HumanAct } from '../queries/filing-observation.js';
3
23
  /** Controller-facing escalation input (narrow; tests inject a fake). */
4
24
  export interface FileEscalationInput {
5
25
  /** Org scope; required by the underlying transport. */
@@ -18,14 +38,25 @@ export interface FileEscalationInput {
18
38
  reason: string;
19
39
  /**
20
40
  * Backend reason_type enum value (the SHAPE of help needed). Defaults to
21
- * 'decision_needed' -- a stalled/diverged PRD needs a human decision.
41
+ * 'decision_needed' -- a stalled/diverged PRD needs a decision.
22
42
  */
23
43
  reasonType?: EscalationReasonType;
24
44
  /**
25
- * Resolution routing axis. Defaults to 'needs_intent' -- a stalled/diverged
26
- * PRD is an intent-owner decision (Play the PRD, commit a pathway, retire it).
45
+ * The disposition the controller PROPOSES. Defaults to needs_operator. Whatever
46
+ * it names, the filing chokepoint (queries/escalations.ts createEscalation) sends
47
+ * it to the machine lane as an OBSERVATION carrying this as
48
+ * proposed_disposition; a deciding agent routes it. No daemon module files
49
+ * needs_intent / needs_clarification.
27
50
  */
28
51
  disposition?: EscalationDisposition;
52
+ /**
53
+ * The specific act only a human can perform, if the controller can name one.
54
+ * A PROPOSAL, never a routing decision: the chokepoint carries it as
55
+ * metadata.observation.proposed_human_act for the deciding agent, and the
56
+ * filing still enters the machine lane. Pass NO_HUMAN_ACT (or omit it) when
57
+ * no such act is named.
58
+ */
59
+ humanAct?: HumanAct | null;
29
60
  /**
30
61
  * Optional machine discriminator for grouping. Carried in metadata under
31
62
  * `machine_discriminator` (NOT the DB escalation_kind enum -- PRD machine
@@ -55,8 +86,12 @@ export interface FileEscalationInput {
55
86
  /** Optional acceptance contract carried onto the Nexus request. */
56
87
  acceptanceContract?: string;
57
88
  }
89
+ /** Test seam: the filing transport (production passes nothing). */
90
+ export interface FileEscalationDeps {
91
+ createEscalation?: typeof createEscalation;
92
+ }
58
93
  /**
59
- * File a human escalation from the PRD realign core. Best-effort wrapper over
94
+ * File an escalation from the PRD realign core. Best-effort wrapper over
60
95
  * `createEscalation`. The transport requires a session id; PRD-controller ticks
61
96
  * run outside any agent session, so we pass the empty string (server tolerates
62
97
  * a null/empty session for system-filed escalations).
@@ -66,5 +101,5 @@ export interface FileEscalationInput {
66
101
  * in metadata so they survive without tripping the enum/CHECK validation that
67
102
  * `reason_type` and `escalation_kind` enforce server-side.
68
103
  */
69
- export declare function fileEscalation(input: FileEscalationInput, nexusDeps?: NexusEscalationBridgeDeps): Promise<void>;
104
+ export declare function fileEscalation(input: FileEscalationInput, nexusDeps?: NexusEscalationBridgeDeps, deps?: FileEscalationDeps): Promise<void>;
70
105
  //# sourceMappingURL=escalations.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"escalations.d.ts","sourceRoot":"","sources":["../../src/completion/escalations.ts"],"names":[],"mappings":"AAqBA,OAAO,EAGL,KAAK,oBAAoB,EACzB,KAAK,qBAAqB,EAC3B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAEL,KAAK,yBAAyB,EAC/B,MAAM,mBAAmB,CAAC;AAE3B,wEAAwE;AACxE,MAAM,WAAW,mBAAmB;IAClC,uDAAuD;IACvD,cAAc,EAAE,MAAM,CAAC;IACvB,wDAAwD;IACxD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,8CAA8C;IAC9C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;;;OAMG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,UAAU,CAAC,EAAE,oBAAoB,CAAC;IAClC;;;OAGG;IACH,WAAW,CAAC,EAAE,qBAAqB,CAAC;IACpC;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,4DAA4D;IAC5D,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAOlC;;;;OAIG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;;;OAIG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,yEAAyE;IACzE,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,4EAA4E;IAC5E,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,yEAAyE;IACzE,KAAK,CAAC,EAAE,MAA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zE,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,4EAA4E;IAC5E,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,yEAAyE;IACzE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,mEAAmE;IACnE,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,mEAAmE;AACnE,MAAM,WAAW,kBAAkB;IACjC,gBAAgB,CAAC,EAAE,OAAO,gBAAgB,CAAC;CAC5C;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,cAAc,CAClC,KAAK,EAAE,mBAAmB,EAC1B,SAAS,CAAC,EAAE,yBAAyB,EACrC,IAAI,GAAE,kBAAuB,GAC5B,OAAO,CAAC,IAAI,CAAC,CAyEf"}
@@ -4,10 +4,13 @@
4
4
  /**
5
5
  * Narrow escalation seam for the PRD divergence/realign core (Delivery E).
6
6
  *
7
- * The PRD controller files a human escalation when a chosen pathway diverges and
7
+ * The PRD controller files an escalation when a chosen pathway diverges and
8
8
  * NO surviving alternative remains (loss of phase-lock with no re-capture). Per
9
- * the PLL framing, the human owns intent: when the machine cannot re-acquire a
10
- * viable path it must hand control up, never silently lower the goal.
9
+ * the PLL framing, the machine must hand the condition up, never silently lower
10
+ * the goal. That hand-up is always an OBSERVATION: the filing chokepoint
11
+ * (queries/filing-observation.ts) sends every daemon filing to the machine lane,
12
+ * where an agent that has climbed the intent ladder decides who owns it. The
13
+ * daemon has no human-facing route.
11
14
  *
12
15
  * This module exposes `fileEscalation({ focusId?, productId?, reason, kind?,
13
16
  * details? })` -- the controller-facing shape -- and adapts it onto the existing
@@ -19,8 +22,9 @@
19
22
  import { createEscalation, markEscalationResolved } from '../queries/escalations.js';
20
23
  import { ESCALATION_REASONS, ESCALATION_DISPOSITIONS, } from '@telora/daemon-core';
21
24
  import { maybeRouteToNexus, } from '../nexus/index.js';
25
+ import { NO_HUMAN_ACT } from '../queries/filing-observation.js';
22
26
  /**
23
- * File a human escalation from the PRD realign core. Best-effort wrapper over
27
+ * File an escalation from the PRD realign core. Best-effort wrapper over
24
28
  * `createEscalation`. The transport requires a session id; PRD-controller ticks
25
29
  * run outside any agent session, so we pass the empty string (server tolerates
26
30
  * a null/empty session for system-filed escalations).
@@ -30,9 +34,10 @@ import { maybeRouteToNexus, } from '../nexus/index.js';
30
34
  * in metadata so they survive without tripping the enum/CHECK validation that
31
35
  * `reason_type` and `escalation_kind` enforce server-side.
32
36
  */
33
- export async function fileEscalation(input, nexusDeps) {
37
+ export async function fileEscalation(input, nexusDeps, deps = {}) {
38
+ const create = deps.createEscalation ?? createEscalation;
34
39
  // ---- Escalation -> Nexus bridge (cross-product blockers) ----
35
- // BEFORE filing the human escalation: if this is a cross-product blocker that
40
+ // BEFORE filing the escalation: if this is a cross-product blocker that
36
41
  // names a target + source product, try to route it into a Nexus request. The
37
42
  // disposition router lives in nexus-escalation-bridge.routeEscalation; here we
38
43
  // just attempt the route and record whether it landed. Non-cross-product
@@ -64,12 +69,15 @@ export async function fileEscalation(input, nexusDeps) {
64
69
  : {}),
65
70
  ...(input.details ?? {}),
66
71
  };
67
- const { escalationId } = await createEscalation({
72
+ const { escalationId } = await create({
68
73
  organizationId: input.organizationId,
69
74
  sessionId: '',
70
75
  issueId: null,
71
76
  reasonType,
72
- disposition: input.disposition ?? ESCALATION_DISPOSITIONS.NEEDS_INTENT,
77
+ // The DEFAULT proposes needs_operator and names no act. Named act or not, the
78
+ // chokepoint files it as an observation; input.humanAct is only a proposal.
79
+ disposition: input.disposition ?? ESCALATION_DISPOSITIONS.NEEDS_OPERATOR,
80
+ humanAct: input.humanAct ?? NO_HUMAN_ACT,
73
81
  // Provenance via the anchor -- focus carries product; the resolver fills
74
82
  // any gaps and never throws.
75
83
  anchor: {
@@ -83,12 +91,12 @@ export async function fileEscalation(input, nexusDeps) {
83
91
  description: input.reason,
84
92
  ...(Object.keys(metadata).length > 0 ? { metadata } : {}),
85
93
  });
86
- // When routed to Nexus, the audit escalation must NOT linger in the human
87
- // pending inbox -- the blocker is now owned by the other product's team. Mark
94
+ // When routed to Nexus, the audit escalation must NOT linger as a pending
95
+ // row -- the blocker is now owned by the other product's team. Mark
88
96
  // it resolved with a note pointing at the Nexus request. Best-effort: a missing
89
97
  // id (older edge build) just leaves the row pending, which is the safe default.
90
98
  if (nexusResult.routed && escalationId) {
91
- await markEscalationResolved(escalationId, `Routed to Nexus request ${nexusResult.requestId}`);
99
+ await markEscalationResolved(escalationId, 'auto_swept', `Routed to Nexus request ${nexusResult.requestId}`);
92
100
  }
93
101
  }
94
102
  //# sourceMappingURL=escalations.js.map