@telora/daemon 0.22.132 → 0.22.136

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 (549) hide show
  1. package/build-info.json +6 -3
  2. package/dist/audit/audit-hooks.d.ts +6 -2
  3. package/dist/audit/audit-hooks.d.ts.map +1 -1
  4. package/dist/audit/audit-hooks.js +12 -5
  5. package/dist/audit/audit-hooks.js.map +1 -1
  6. package/dist/audit/audit-phase.js +1 -1
  7. package/dist/audit/audit-phase.js.map +1 -1
  8. package/dist/backends/index.d.ts.map +1 -1
  9. package/dist/backends/index.js +1 -0
  10. package/dist/backends/index.js.map +1 -1
  11. package/dist/completion/completion-phase-registry.d.ts +4 -0
  12. package/dist/completion/completion-phase-registry.d.ts.map +1 -1
  13. package/dist/completion/completion-phase-registry.js +63 -18
  14. package/dist/completion/completion-phase-registry.js.map +1 -1
  15. package/dist/completion/exit-classification.d.ts.map +1 -1
  16. package/dist/completion/exit-classification.js +1 -0
  17. package/dist/completion/exit-classification.js.map +1 -1
  18. package/dist/completion/review-approved-head-gate.d.ts +53 -0
  19. package/dist/completion/review-approved-head-gate.d.ts.map +1 -0
  20. package/dist/completion/review-approved-head-gate.js +124 -0
  21. package/dist/completion/review-approved-head-gate.js.map +1 -0
  22. package/dist/completion/review-census-record.d.ts +52 -0
  23. package/dist/completion/review-census-record.d.ts.map +1 -0
  24. package/dist/completion/review-census-record.js +145 -0
  25. package/dist/completion/review-census-record.js.map +1 -0
  26. package/dist/completion/review-exit-deps.d.ts +5 -1
  27. package/dist/completion/review-exit-deps.d.ts.map +1 -1
  28. package/dist/completion/review-exit-deps.js +7 -2
  29. package/dist/completion/review-exit-deps.js.map +1 -1
  30. package/dist/completion/review-exit-phase.d.ts.map +1 -1
  31. package/dist/completion/review-exit-phase.js +29 -16
  32. package/dist/completion/review-exit-phase.js.map +1 -1
  33. package/dist/completion/review-exit-progress.d.ts +8 -0
  34. package/dist/completion/review-exit-progress.d.ts.map +1 -1
  35. package/dist/completion/review-exit-progress.js +14 -0
  36. package/dist/completion/review-exit-progress.js.map +1 -1
  37. package/dist/completion/review-exit-shortfall-park.d.ts +14 -0
  38. package/dist/completion/review-exit-shortfall-park.d.ts.map +1 -0
  39. package/dist/completion/review-exit-shortfall-park.js +52 -0
  40. package/dist/completion/review-exit-shortfall-park.js.map +1 -0
  41. package/dist/completion/review-exit-shortfall.js +1 -1
  42. package/dist/completion/review-exit-shortfall.js.map +1 -1
  43. package/dist/completion/review-exit-verdict-gate.d.ts +58 -0
  44. package/dist/completion/review-exit-verdict-gate.d.ts.map +1 -1
  45. package/dist/completion/review-exit-verdict-gate.js +68 -8
  46. package/dist/completion/review-exit-verdict-gate.js.map +1 -1
  47. package/dist/completion/review-next-step.d.ts +15 -3
  48. package/dist/completion/review-next-step.d.ts.map +1 -1
  49. package/dist/completion/review-next-step.js +7 -2
  50. package/dist/completion/review-next-step.js.map +1 -1
  51. package/dist/completion/standing-approval-convergence.d.ts +68 -0
  52. package/dist/completion/standing-approval-convergence.d.ts.map +1 -0
  53. package/dist/completion/standing-approval-convergence.js +230 -0
  54. package/dist/completion/standing-approval-convergence.js.map +1 -0
  55. package/dist/completion/standing-approval-deps.d.ts +5 -0
  56. package/dist/completion/standing-approval-deps.d.ts.map +1 -0
  57. package/dist/completion/standing-approval-deps.js +37 -0
  58. package/dist/completion/standing-approval-deps.js.map +1 -0
  59. package/dist/completion/state-cascade.d.ts +11 -0
  60. package/dist/completion/state-cascade.d.ts.map +1 -1
  61. package/dist/completion/state-cascade.js +40 -1
  62. package/dist/completion/state-cascade.js.map +1 -1
  63. package/dist/completion/team-lifecycle.d.ts +14 -2
  64. package/dist/completion/team-lifecycle.d.ts.map +1 -1
  65. package/dist/completion/team-lifecycle.js +36 -36
  66. package/dist/completion/team-lifecycle.js.map +1 -1
  67. package/dist/completion/terminated-work-reconcile.d.ts +3 -1
  68. package/dist/completion/terminated-work-reconcile.d.ts.map +1 -1
  69. package/dist/completion/terminated-work-reconcile.js +24 -11
  70. package/dist/completion/terminated-work-reconcile.js.map +1 -1
  71. package/dist/delivery/delivery-advance-block.d.ts +6 -0
  72. package/dist/delivery/delivery-advance-block.d.ts.map +1 -1
  73. package/dist/delivery/delivery-advance-block.js +29 -3
  74. package/dist/delivery/delivery-advance-block.js.map +1 -1
  75. package/dist/delivery/delivery-reconciler.d.ts.map +1 -1
  76. package/dist/delivery/delivery-reconciler.js +4 -1
  77. package/dist/delivery/delivery-reconciler.js.map +1 -1
  78. package/dist/delivery/operator-hold.d.ts.map +1 -1
  79. package/dist/delivery/operator-hold.js +3 -1
  80. package/dist/delivery/operator-hold.js.map +1 -1
  81. package/dist/directive/directive-executor.d.ts.map +1 -1
  82. package/dist/directive/directive-executor.js +6 -0
  83. package/dist/directive/directive-executor.js.map +1 -1
  84. package/dist/directive/directive-queue.d.ts +8 -0
  85. package/dist/directive/directive-queue.d.ts.map +1 -1
  86. package/dist/directive/directive-queue.js +20 -0
  87. package/dist/directive/directive-queue.js.map +1 -1
  88. package/dist/directive/phase-sync.d.ts +5 -0
  89. package/dist/directive/phase-sync.d.ts.map +1 -1
  90. package/dist/directive/phase-sync.js +11 -1
  91. package/dist/directive/phase-sync.js.map +1 -1
  92. package/dist/directive/stranded-review-reroute.d.ts +37 -0
  93. package/dist/directive/stranded-review-reroute.d.ts.map +1 -0
  94. package/dist/directive/stranded-review-reroute.js +150 -0
  95. package/dist/directive/stranded-review-reroute.js.map +1 -0
  96. package/dist/focus/focus-engine.d.ts.map +1 -1
  97. package/dist/focus/focus-engine.js +15 -3
  98. package/dist/focus/focus-engine.js.map +1 -1
  99. package/dist/focus/focus-executor.d.ts.map +1 -1
  100. package/dist/focus/focus-executor.js +9 -65
  101. package/dist/focus/focus-executor.js.map +1 -1
  102. package/dist/focus/focus-lifecycle.d.ts +12 -0
  103. package/dist/focus/focus-lifecycle.d.ts.map +1 -1
  104. package/dist/focus/focus-lifecycle.js +66 -37
  105. package/dist/focus/focus-lifecycle.js.map +1 -1
  106. package/dist/focus/focus-phase.d.ts.map +1 -1
  107. package/dist/focus/focus-phase.js +6 -0
  108. package/dist/focus/focus-phase.js.map +1 -1
  109. package/dist/focus/focus-spawn-decision.d.ts.map +1 -1
  110. package/dist/focus/focus-spawn-decision.js +1 -0
  111. package/dist/focus/focus-spawn-decision.js.map +1 -1
  112. package/dist/focus/focus-team-state.d.ts +10 -0
  113. package/dist/focus/focus-team-state.d.ts.map +1 -1
  114. package/dist/focus/focus-team-state.js +19 -1
  115. package/dist/focus/focus-team-state.js.map +1 -1
  116. package/dist/focus/listener-auto-advance.d.ts.map +1 -1
  117. package/dist/focus/listener-auto-advance.js +1 -0
  118. package/dist/focus/listener-auto-advance.js.map +1 -1
  119. package/dist/focus/listener-spawn.d.ts +10 -0
  120. package/dist/focus/listener-spawn.d.ts.map +1 -1
  121. package/dist/focus/listener-spawn.js +46 -4
  122. package/dist/focus/listener-spawn.js.map +1 -1
  123. package/dist/focus/listener-state.d.ts.map +1 -1
  124. package/dist/focus/listener-state.js +11 -1
  125. package/dist/focus/listener-state.js.map +1 -1
  126. package/dist/focus/listener.d.ts +42 -0
  127. package/dist/focus/listener.d.ts.map +1 -1
  128. package/dist/focus/listener.js +62 -33
  129. package/dist/focus/listener.js.map +1 -1
  130. package/dist/focus/pending-review-approved-head.d.ts +41 -0
  131. package/dist/focus/pending-review-approved-head.d.ts.map +1 -0
  132. package/dist/focus/pending-review-approved-head.js +198 -0
  133. package/dist/focus/pending-review-approved-head.js.map +1 -0
  134. package/dist/focus/pending-spawn-pass-deps.d.ts +5 -0
  135. package/dist/focus/pending-spawn-pass-deps.d.ts.map +1 -1
  136. package/dist/focus/pending-spawn-pass-deps.js +2 -1
  137. package/dist/focus/pending-spawn-pass-deps.js.map +1 -1
  138. package/dist/focus/pending-spawn-review-next-step.d.ts.map +1 -1
  139. package/dist/focus/pending-spawn-review-next-step.js +26 -4
  140. package/dist/focus/pending-spawn-review-next-step.js.map +1 -1
  141. package/dist/focus/review-spawn-coverage.d.ts +87 -0
  142. package/dist/focus/review-spawn-coverage.d.ts.map +1 -0
  143. package/dist/focus/review-spawn-coverage.js +104 -0
  144. package/dist/focus/review-spawn-coverage.js.map +1 -0
  145. package/dist/focus/session-health.d.ts +5 -2
  146. package/dist/focus/session-health.d.ts.map +1 -1
  147. package/dist/focus/session-health.js +2 -1
  148. package/dist/focus/session-health.js.map +1 -1
  149. package/dist/focus/session-process-reap.d.ts +50 -0
  150. package/dist/focus/session-process-reap.d.ts.map +1 -0
  151. package/dist/focus/session-process-reap.js +77 -0
  152. package/dist/focus/session-process-reap.js.map +1 -0
  153. package/dist/focus/unchanged-reviewed-head.d.ts +40 -0
  154. package/dist/focus/unchanged-reviewed-head.d.ts.map +1 -0
  155. package/dist/focus/unchanged-reviewed-head.js +84 -0
  156. package/dist/focus/unchanged-reviewed-head.js.map +1 -0
  157. package/dist/focus/verify-open-issues.d.ts +4 -19
  158. package/dist/focus/verify-open-issues.d.ts.map +1 -1
  159. package/dist/focus/verify-open-issues.js +83 -41
  160. package/dist/focus/verify-open-issues.js.map +1 -1
  161. package/dist/git/focus-integration-sync.d.ts +61 -0
  162. package/dist/git/focus-integration-sync.d.ts.map +1 -0
  163. package/dist/git/focus-integration-sync.js +73 -0
  164. package/dist/git/focus-integration-sync.js.map +1 -0
  165. package/dist/git/focus-own-delta.d.ts +38 -0
  166. package/dist/git/focus-own-delta.d.ts.map +1 -0
  167. package/dist/git/focus-own-delta.js +193 -0
  168. package/dist/git/focus-own-delta.js.map +1 -0
  169. package/dist/git/index.d.ts +2 -0
  170. package/dist/git/index.d.ts.map +1 -1
  171. package/dist/git/index.js +4 -0
  172. package/dist/git/index.js.map +1 -1
  173. package/dist/git/merge.d.ts.map +1 -1
  174. package/dist/git/merge.js +11 -1
  175. package/dist/git/merge.js.map +1 -1
  176. package/dist/git/resolution-restore.d.ts +66 -0
  177. package/dist/git/resolution-restore.d.ts.map +1 -0
  178. package/dist/git/resolution-restore.js +331 -0
  179. package/dist/git/resolution-restore.js.map +1 -0
  180. package/dist/loops/engine.d.ts.map +1 -1
  181. package/dist/loops/engine.js.map +1 -1
  182. package/dist/merge/abandoned-merge-recovery.d.ts +72 -0
  183. package/dist/merge/abandoned-merge-recovery.d.ts.map +1 -0
  184. package/dist/merge/abandoned-merge-recovery.js +117 -0
  185. package/dist/merge/abandoned-merge-recovery.js.map +1 -0
  186. package/dist/merge/focus-merge.d.ts +19 -0
  187. package/dist/merge/focus-merge.d.ts.map +1 -1
  188. package/dist/merge/focus-merge.js +136 -99
  189. package/dist/merge/focus-merge.js.map +1 -1
  190. package/dist/merge/merge-back-activity.d.ts +11 -0
  191. package/dist/merge/merge-back-activity.d.ts.map +1 -0
  192. package/dist/merge/merge-back-activity.js +57 -0
  193. package/dist/merge/merge-back-activity.js.map +1 -0
  194. package/dist/merge/merge-back-conflict.d.ts +119 -0
  195. package/dist/merge/merge-back-conflict.d.ts.map +1 -0
  196. package/dist/merge/merge-back-conflict.js +178 -0
  197. package/dist/merge/merge-back-conflict.js.map +1 -0
  198. package/dist/merge/merge-back-followup.d.ts +109 -0
  199. package/dist/merge/merge-back-followup.d.ts.map +1 -0
  200. package/dist/merge/merge-back-followup.js +316 -0
  201. package/dist/merge/merge-back-followup.js.map +1 -0
  202. package/dist/merge/merge-back-loop.d.ts +2 -0
  203. package/dist/merge/merge-back-loop.d.ts.map +1 -1
  204. package/dist/merge/merge-back-loop.js +14 -15
  205. package/dist/merge/merge-back-loop.js.map +1 -1
  206. package/dist/merge/merge-conflict-escalation.d.ts +12 -0
  207. package/dist/merge/merge-conflict-escalation.d.ts.map +1 -1
  208. package/dist/merge/merge-conflict-escalation.js +37 -2
  209. package/dist/merge/merge-conflict-escalation.js.map +1 -1
  210. package/dist/merge/merge-gate-coverage.d.ts.map +1 -1
  211. package/dist/merge/merge-gate-coverage.js +1 -0
  212. package/dist/merge/merge-gate-coverage.js.map +1 -1
  213. package/dist/prompt/prompt-listing.d.ts +5 -0
  214. package/dist/prompt/prompt-listing.d.ts.map +1 -1
  215. package/dist/prompt/prompt-listing.js +35 -0
  216. package/dist/prompt/prompt-listing.js.map +1 -1
  217. package/dist/prompt-sections/routing-decider-sections.d.ts.map +1 -1
  218. package/dist/prompt-sections/routing-decider-sections.js +2 -0
  219. package/dist/prompt-sections/routing-decider-sections.js.map +1 -1
  220. package/dist/prompt-sections/shortfall-park-section.d.ts +43 -0
  221. package/dist/prompt-sections/shortfall-park-section.d.ts.map +1 -0
  222. package/dist/prompt-sections/shortfall-park-section.js +36 -0
  223. package/dist/prompt-sections/shortfall-park-section.js.map +1 -0
  224. package/dist/queries/agent-resolvable-promotion.d.ts +16 -2
  225. package/dist/queries/agent-resolvable-promotion.d.ts.map +1 -1
  226. package/dist/queries/agent-resolvable-promotion.js +30 -3
  227. package/dist/queries/agent-resolvable-promotion.js.map +1 -1
  228. package/dist/queries/cause-key.d.ts +17 -22
  229. package/dist/queries/cause-key.d.ts.map +1 -1
  230. package/dist/queries/cause-key.js +50 -1
  231. package/dist/queries/cause-key.js.map +1 -1
  232. package/dist/queries/commit-attributions.d.ts +18 -0
  233. package/dist/queries/commit-attributions.d.ts.map +1 -0
  234. package/dist/queries/commit-attributions.js +39 -0
  235. package/dist/queries/commit-attributions.js.map +1 -0
  236. package/dist/queries/deliveries.d.ts.map +1 -1
  237. package/dist/queries/deliveries.js +3 -1
  238. package/dist/queries/deliveries.js.map +1 -1
  239. package/dist/queries/delivery-gate-state.d.ts +21 -5
  240. package/dist/queries/delivery-gate-state.d.ts.map +1 -1
  241. package/dist/queries/delivery-gate-state.js +35 -9
  242. package/dist/queries/delivery-gate-state.js.map +1 -1
  243. package/dist/queries/escalation-consumption.d.ts.map +1 -1
  244. package/dist/queries/escalation-consumption.js +2 -1
  245. package/dist/queries/escalation-consumption.js.map +1 -1
  246. package/dist/queries/escalation-field-bounds.d.ts +48 -0
  247. package/dist/queries/escalation-field-bounds.d.ts.map +1 -0
  248. package/dist/queries/escalation-field-bounds.js +83 -0
  249. package/dist/queries/escalation-field-bounds.js.map +1 -0
  250. package/dist/queries/escalation-refusal.d.ts +88 -0
  251. package/dist/queries/escalation-refusal.d.ts.map +1 -0
  252. package/dist/queries/escalation-refusal.js +217 -0
  253. package/dist/queries/escalation-refusal.js.map +1 -0
  254. package/dist/queries/escalation-suppression.d.ts +6 -0
  255. package/dist/queries/escalation-suppression.d.ts.map +1 -1
  256. package/dist/queries/escalation-suppression.js +4 -13
  257. package/dist/queries/escalation-suppression.js.map +1 -1
  258. package/dist/queries/escalations.d.ts +5 -13
  259. package/dist/queries/escalations.d.ts.map +1 -1
  260. package/dist/queries/escalations.js +25 -30
  261. package/dist/queries/escalations.js.map +1 -1
  262. package/dist/queries/filing-observation.d.ts.map +1 -1
  263. package/dist/queries/filing-observation.js +3 -1
  264. package/dist/queries/filing-observation.js.map +1 -1
  265. package/dist/queries/focus-review-approval.d.ts +2 -0
  266. package/dist/queries/focus-review-approval.d.ts.map +1 -1
  267. package/dist/queries/focus-review-approval.js +7 -2
  268. package/dist/queries/focus-review-approval.js.map +1 -1
  269. package/dist/queries/focuses.d.ts.map +1 -1
  270. package/dist/queries/focuses.js +2 -1
  271. package/dist/queries/focuses.js.map +1 -1
  272. package/dist/queries/incident-correlation.d.ts.map +1 -1
  273. package/dist/queries/incident-correlation.js +4 -1
  274. package/dist/queries/incident-correlation.js.map +1 -1
  275. package/dist/queries/misattributed-commits-record.d.ts +26 -0
  276. package/dist/queries/misattributed-commits-record.d.ts.map +1 -0
  277. package/dist/queries/misattributed-commits-record.js +5 -0
  278. package/dist/queries/misattributed-commits-record.js.map +1 -0
  279. package/dist/queries/reality-tree.d.ts.map +1 -1
  280. package/dist/queries/reality-tree.js +2 -1
  281. package/dist/queries/reality-tree.js.map +1 -1
  282. package/dist/queries/schemas.d.ts +3 -0
  283. package/dist/queries/schemas.d.ts.map +1 -1
  284. package/dist/queries/schemas.js +1 -0
  285. package/dist/queries/schemas.js.map +1 -1
  286. package/dist/queries/shared.js +1 -1
  287. package/dist/queries/shortfall-park-record.d.ts +48 -0
  288. package/dist/queries/shortfall-park-record.d.ts.map +1 -0
  289. package/dist/queries/shortfall-park-record.js +31 -0
  290. package/dist/queries/shortfall-park-record.js.map +1 -0
  291. package/dist/queries/shortfall-rulings.d.ts +71 -0
  292. package/dist/queries/shortfall-rulings.d.ts.map +1 -0
  293. package/dist/queries/shortfall-rulings.js +53 -0
  294. package/dist/queries/shortfall-rulings.js.map +1 -0
  295. package/dist/queries/verification.d.ts +20 -1
  296. package/dist/queries/verification.d.ts.map +1 -1
  297. package/dist/queries/verification.js +48 -8
  298. package/dist/queries/verification.js.map +1 -1
  299. package/dist/resolvers/index.d.ts +2 -2
  300. package/dist/resolvers/index.d.ts.map +1 -1
  301. package/dist/resolvers/index.js +1 -1
  302. package/dist/resolvers/index.js.map +1 -1
  303. package/dist/resolvers/shared/delivery-trailer.d.ts +99 -0
  304. package/dist/resolvers/shared/delivery-trailer.d.ts.map +1 -0
  305. package/dist/resolvers/shared/delivery-trailer.js +103 -0
  306. package/dist/resolvers/shared/delivery-trailer.js.map +1 -0
  307. package/dist/resolvers/shared/git-diff.d.ts +11 -84
  308. package/dist/resolvers/shared/git-diff.d.ts.map +1 -1
  309. package/dist/resolvers/shared/git-diff.js +17 -84
  310. package/dist/resolvers/shared/git-diff.js.map +1 -1
  311. package/dist/resolvers/shared/review-window-commits.d.ts.map +1 -1
  312. package/dist/resolvers/shared/review-window-commits.js +1 -0
  313. package/dist/resolvers/shared/review-window-commits.js.map +1 -1
  314. package/dist/session/session-lineage.d.ts.map +1 -1
  315. package/dist/session/session-lineage.js +1 -0
  316. package/dist/session/session-lineage.js.map +1 -1
  317. package/dist/shell/config.d.ts +2 -1
  318. package/dist/shell/config.d.ts.map +1 -1
  319. package/dist/shell/config.js +21 -4
  320. package/dist/shell/config.js.map +1 -1
  321. package/dist/shell/crash-recovery.d.ts +3 -7
  322. package/dist/shell/crash-recovery.d.ts.map +1 -1
  323. package/dist/shell/crash-recovery.js +28 -31
  324. package/dist/shell/crash-recovery.js.map +1 -1
  325. package/dist/shell/orphan-capture.d.ts +42 -0
  326. package/dist/shell/orphan-capture.d.ts.map +1 -0
  327. package/dist/shell/orphan-capture.js +53 -0
  328. package/dist/shell/orphan-capture.js.map +1 -0
  329. package/dist/shell/worker-pidfile.d.ts +22 -4
  330. package/dist/shell/worker-pidfile.d.ts.map +1 -1
  331. package/dist/shell/worker-pidfile.js +51 -13
  332. package/dist/shell/worker-pidfile.js.map +1 -1
  333. package/dist/spawn/helpers.d.ts +3 -0
  334. package/dist/spawn/helpers.d.ts.map +1 -1
  335. package/dist/spawn/helpers.js +28 -9
  336. package/dist/spawn/helpers.js.map +1 -1
  337. package/dist/spawn/lead-launch.d.ts +34 -0
  338. package/dist/spawn/lead-launch.d.ts.map +1 -0
  339. package/dist/spawn/lead-launch.js +34 -0
  340. package/dist/spawn/lead-launch.js.map +1 -0
  341. package/dist/spawn/lead-process-ownership.d.ts +91 -0
  342. package/dist/spawn/lead-process-ownership.d.ts.map +1 -0
  343. package/dist/spawn/lead-process-ownership.js +120 -0
  344. package/dist/spawn/lead-process-ownership.js.map +1 -0
  345. package/dist/spawn/lifecycle.d.ts +43 -3
  346. package/dist/spawn/lifecycle.d.ts.map +1 -1
  347. package/dist/spawn/lifecycle.js +75 -44
  348. package/dist/spawn/lifecycle.js.map +1 -1
  349. package/dist/spawn/liveness.d.ts.map +1 -1
  350. package/dist/spawn/liveness.js +5 -1
  351. package/dist/spawn/liveness.js.map +1 -1
  352. package/dist/spawn/one-shot-process-ownership.d.ts +48 -0
  353. package/dist/spawn/one-shot-process-ownership.d.ts.map +1 -0
  354. package/dist/spawn/one-shot-process-ownership.js +44 -0
  355. package/dist/spawn/one-shot-process-ownership.js.map +1 -0
  356. package/dist/spawn/process-group-kill.d.ts +79 -0
  357. package/dist/spawn/process-group-kill.d.ts.map +1 -0
  358. package/dist/spawn/process-group-kill.js +210 -0
  359. package/dist/spawn/process-group-kill.js.map +1 -0
  360. package/dist/spawn/process-spawn.d.ts +18 -1
  361. package/dist/spawn/process-spawn.d.ts.map +1 -1
  362. package/dist/spawn/process-spawn.js +51 -20
  363. package/dist/spawn/process-spawn.js.map +1 -1
  364. package/dist/spawn/resolution-budget.d.ts +38 -0
  365. package/dist/spawn/resolution-budget.d.ts.map +1 -0
  366. package/dist/spawn/resolution-budget.js +87 -0
  367. package/dist/spawn/resolution-budget.js.map +1 -0
  368. package/dist/spawn/review-hold-park.d.ts.map +1 -1
  369. package/dist/spawn/review-hold-park.js +37 -5
  370. package/dist/spawn/review-hold-park.js.map +1 -1
  371. package/dist/spawn/spawn-cooldown.d.ts.map +1 -1
  372. package/dist/spawn/spawn-cooldown.js +9 -0
  373. package/dist/spawn/spawn-cooldown.js.map +1 -1
  374. package/dist/spawn/untracked-lead-sweep.d.ts +29 -0
  375. package/dist/spawn/untracked-lead-sweep.d.ts.map +1 -0
  376. package/dist/spawn/untracked-lead-sweep.js +100 -0
  377. package/dist/spawn/untracked-lead-sweep.js.map +1 -0
  378. package/dist/spawn/worker-registry.d.ts.map +1 -1
  379. package/dist/spawn/worker-registry.js +4 -1
  380. package/dist/spawn/worker-registry.js.map +1 -1
  381. package/dist/spawn/worktree-session.d.ts.map +1 -1
  382. package/dist/spawn/worktree-session.js +8 -6
  383. package/dist/spawn/worktree-session.js.map +1 -1
  384. package/dist/testing/fixtures/exit-capture-verify.d.ts +41 -0
  385. package/dist/testing/fixtures/exit-capture-verify.d.ts.map +1 -0
  386. package/dist/testing/fixtures/exit-capture-verify.js +152 -0
  387. package/dist/testing/fixtures/exit-capture-verify.js.map +1 -0
  388. package/dist/testing/fixtures/index.js +1 -1
  389. package/dist/testing/fixtures/pending-spawn-world.d.ts +7 -0
  390. package/dist/testing/fixtures/pending-spawn-world.d.ts.map +1 -1
  391. package/dist/testing/fixtures/pending-spawn-world.js +21 -1
  392. package/dist/testing/fixtures/pending-spawn-world.js.map +1 -1
  393. package/dist/testing/fixtures/stubborn-lead-process.d.ts +22 -0
  394. package/dist/testing/fixtures/stubborn-lead-process.d.ts.map +1 -0
  395. package/dist/testing/fixtures/stubborn-lead-process.js +68 -0
  396. package/dist/testing/fixtures/stubborn-lead-process.js.map +1 -0
  397. package/dist/types/config.d.ts +13 -0
  398. package/dist/types/config.d.ts.map +1 -1
  399. package/dist/types/focus.d.ts +7 -0
  400. package/dist/types/focus.d.ts.map +1 -1
  401. package/dist/types/index.js +1 -1
  402. package/dist/verify/commit-verdict-record.d.ts +13 -3
  403. package/dist/verify/commit-verdict-record.d.ts.map +1 -1
  404. package/dist/verify/commit-verdict-record.js +45 -25
  405. package/dist/verify/commit-verdict-record.js.map +1 -1
  406. package/dist/verify/credit-rearm.d.ts +18 -0
  407. package/dist/verify/credit-rearm.d.ts.map +1 -0
  408. package/dist/verify/credit-rearm.js +69 -0
  409. package/dist/verify/credit-rearm.js.map +1 -0
  410. package/dist/verify/delivery-commit-set.d.ts +10 -0
  411. package/dist/verify/delivery-commit-set.d.ts.map +1 -0
  412. package/dist/verify/delivery-commit-set.js +82 -0
  413. package/dist/verify/delivery-commit-set.js.map +1 -0
  414. package/dist/verify/explicit-rearm.d.ts.map +1 -1
  415. package/dist/verify/explicit-rearm.js +2 -0
  416. package/dist/verify/explicit-rearm.js.map +1 -1
  417. package/dist/verify/failure-signature.d.ts.map +1 -1
  418. package/dist/verify/failure-signature.js +1 -0
  419. package/dist/verify/failure-signature.js.map +1 -1
  420. package/dist/verify/gate-run-registry.d.ts.map +1 -1
  421. package/dist/verify/gate-run-registry.js +3 -0
  422. package/dist/verify/gate-run-registry.js.map +1 -1
  423. package/dist/verify/injection-stamp.d.ts +29 -0
  424. package/dist/verify/injection-stamp.d.ts.map +1 -0
  425. package/dist/verify/injection-stamp.js +139 -0
  426. package/dist/verify/injection-stamp.js.map +1 -0
  427. package/dist/verify/misattributed-commits-read.d.ts +31 -0
  428. package/dist/verify/misattributed-commits-read.d.ts.map +1 -0
  429. package/dist/verify/misattributed-commits-read.js +47 -0
  430. package/dist/verify/misattributed-commits-read.js.map +1 -0
  431. package/dist/verify/misattributed-commits.d.ts +52 -0
  432. package/dist/verify/misattributed-commits.d.ts.map +1 -0
  433. package/dist/verify/misattributed-commits.js +148 -0
  434. package/dist/verify/misattributed-commits.js.map +1 -0
  435. package/dist/verify/no-own-delta-verdict.d.ts +47 -0
  436. package/dist/verify/no-own-delta-verdict.d.ts.map +1 -0
  437. package/dist/verify/no-own-delta-verdict.js +74 -0
  438. package/dist/verify/no-own-delta-verdict.js.map +1 -0
  439. package/dist/verify/shortfall-park-escalation.d.ts +41 -0
  440. package/dist/verify/shortfall-park-escalation.d.ts.map +1 -0
  441. package/dist/verify/shortfall-park-escalation.js +177 -0
  442. package/dist/verify/shortfall-park-escalation.js.map +1 -0
  443. package/dist/verify/shortfall-park.d.ts +109 -0
  444. package/dist/verify/shortfall-park.d.ts.map +1 -0
  445. package/dist/verify/shortfall-park.js +208 -0
  446. package/dist/verify/shortfall-park.js.map +1 -0
  447. package/dist/verify/shortfall-repeat.d.ts +47 -16
  448. package/dist/verify/shortfall-repeat.d.ts.map +1 -1
  449. package/dist/verify/shortfall-repeat.js +77 -23
  450. package/dist/verify/shortfall-repeat.js.map +1 -1
  451. package/dist/verify/shortfall-rulings.d.ts +106 -0
  452. package/dist/verify/shortfall-rulings.d.ts.map +1 -0
  453. package/dist/verify/shortfall-rulings.js +118 -0
  454. package/dist/verify/shortfall-rulings.js.map +1 -0
  455. package/dist/verify/stall-detectors.d.ts.map +1 -1
  456. package/dist/verify/stall-detectors.js +10 -4
  457. package/dist/verify/stall-detectors.js.map +1 -1
  458. package/dist/verify/verification-attribution-base.d.ts +26 -0
  459. package/dist/verify/verification-attribution-base.d.ts.map +1 -0
  460. package/dist/verify/verification-attribution-base.js +127 -0
  461. package/dist/verify/verification-attribution-base.js.map +1 -0
  462. package/dist/verify/verification-attribution-deps.d.ts +32 -0
  463. package/dist/verify/verification-attribution-deps.d.ts.map +1 -0
  464. package/dist/verify/verification-attribution-deps.js +209 -0
  465. package/dist/verify/verification-attribution-deps.js.map +1 -0
  466. package/dist/verify/verification-baseline.d.ts +6 -0
  467. package/dist/verify/verification-baseline.d.ts.map +1 -1
  468. package/dist/verify/verification-baseline.js +27 -11
  469. package/dist/verify/verification-baseline.js.map +1 -1
  470. package/dist/verify/verification-commit-sharing.d.ts.map +1 -1
  471. package/dist/verify/verification-commit-sharing.js +30 -8
  472. package/dist/verify/verification-commit-sharing.js.map +1 -1
  473. package/dist/verify/verification-config.d.ts.map +1 -1
  474. package/dist/verify/verification-config.js +2 -0
  475. package/dist/verify/verification-config.js.map +1 -1
  476. package/dist/verify/verification-default-on.d.ts +3 -0
  477. package/dist/verify/verification-default-on.d.ts.map +1 -1
  478. package/dist/verify/verification-default-on.js +5 -1
  479. package/dist/verify/verification-default-on.js.map +1 -1
  480. package/dist/verify/verification-deps-default.d.ts.map +1 -1
  481. package/dist/verify/verification-deps-default.js +61 -120
  482. package/dist/verify/verification-deps-default.js.map +1 -1
  483. package/dist/verify/verification-deps.d.ts +26 -4
  484. package/dist/verify/verification-deps.d.ts.map +1 -1
  485. package/dist/verify/verification-deterministic.d.ts +15 -0
  486. package/dist/verify/verification-deterministic.d.ts.map +1 -1
  487. package/dist/verify/verification-deterministic.js +1 -12
  488. package/dist/verify/verification-deterministic.js.map +1 -1
  489. package/dist/verify/verification-engine.d.ts +9 -6
  490. package/dist/verify/verification-engine.d.ts.map +1 -1
  491. package/dist/verify/verification-engine.js +43 -62
  492. package/dist/verify/verification-engine.js.map +1 -1
  493. package/dist/verify/verification-evidence-unavailable-feedback.d.ts +2 -1
  494. package/dist/verify/verification-evidence-unavailable-feedback.d.ts.map +1 -1
  495. package/dist/verify/verification-evidence-unavailable-feedback.js +19 -1
  496. package/dist/verify/verification-evidence-unavailable-feedback.js.map +1 -1
  497. package/dist/verify/verification-failure-parser.d.ts +57 -1
  498. package/dist/verify/verification-failure-parser.d.ts.map +1 -1
  499. package/dist/verify/verification-failure-parser.js +116 -10
  500. package/dist/verify/verification-failure-parser.js.map +1 -1
  501. package/dist/verify/verification-feedback.d.ts +60 -43
  502. package/dist/verify/verification-feedback.d.ts.map +1 -1
  503. package/dist/verify/verification-feedback.js +115 -120
  504. package/dist/verify/verification-feedback.js.map +1 -1
  505. package/dist/verify/verification-history-reset.d.ts +2 -1
  506. package/dist/verify/verification-history-reset.d.ts.map +1 -1
  507. package/dist/verify/verification-history-reset.js +4 -2
  508. package/dist/verify/verification-history-reset.js.map +1 -1
  509. package/dist/verify/verification-rework-issue.d.ts +87 -0
  510. package/dist/verify/verification-rework-issue.d.ts.map +1 -0
  511. package/dist/verify/verification-rework-issue.js +212 -0
  512. package/dist/verify/verification-rework-issue.js.map +1 -0
  513. package/dist/verify/verification-rework-messages.d.ts.map +1 -1
  514. package/dist/verify/verification-rework-messages.js +10 -0
  515. package/dist/verify/verification-rework-messages.js.map +1 -1
  516. package/dist/verify/verify-gate-stall.d.ts +2 -0
  517. package/dist/verify/verify-gate-stall.d.ts.map +1 -1
  518. package/dist/verify/verify-gate-stall.js +35 -9
  519. package/dist/verify/verify-gate-stall.js.map +1 -1
  520. package/dist/verify/verify-restatement.d.ts.map +1 -1
  521. package/dist/verify/verify-restatement.js +9 -2
  522. package/dist/verify/verify-restatement.js.map +1 -1
  523. package/dist/worktree/capture-attribution-read.d.ts +47 -0
  524. package/dist/worktree/capture-attribution-read.d.ts.map +1 -0
  525. package/dist/worktree/capture-attribution-read.js +98 -0
  526. package/dist/worktree/capture-attribution-read.js.map +1 -0
  527. package/dist/worktree/capture-attribution.d.ts +26 -0
  528. package/dist/worktree/capture-attribution.d.ts.map +1 -0
  529. package/dist/worktree/capture-attribution.js +111 -0
  530. package/dist/worktree/capture-attribution.js.map +1 -0
  531. package/dist/worktree/index.d.ts.map +1 -1
  532. package/dist/worktree/index.js +2 -1
  533. package/dist/worktree/index.js.map +1 -1
  534. package/dist/worktree/provision.d.ts.map +1 -1
  535. package/dist/worktree/provision.js +23 -6
  536. package/dist/worktree/provision.js.map +1 -1
  537. package/dist/worktree/safety.d.ts +14 -4
  538. package/dist/worktree/safety.d.ts.map +1 -1
  539. package/dist/worktree/safety.js +37 -7
  540. package/dist/worktree/safety.js.map +1 -1
  541. package/dist/worktree/scratch-guard.d.ts +53 -2
  542. package/dist/worktree/scratch-guard.d.ts.map +1 -1
  543. package/dist/worktree/scratch-guard.js +115 -30
  544. package/dist/worktree/scratch-guard.js.map +1 -1
  545. package/dist/worktree/unmerged-capture-escalation.d.ts +52 -0
  546. package/dist/worktree/unmerged-capture-escalation.d.ts.map +1 -0
  547. package/dist/worktree/unmerged-capture-escalation.js +64 -0
  548. package/dist/worktree/unmerged-capture-escalation.js.map +1 -0
  549. package/package.json +2 -2
@@ -0,0 +1,148 @@
1
+ // PINNED-BY-BEGIN (generated by gen:pinned-by -- do not hand-edit; checked by lint:pinned-by)
2
+ // Pinned by: packages/daemon/src/verify/misattributed-commits.test.ts
3
+ // PINNED-BY-END
4
+ /**
5
+ * Commits in a focus's recorded batches that may hold a held delivery's work
6
+ * without being attributed to it.
7
+ *
8
+ * Verify judges a delivery on its OWN commits: those whose Telora-Delivery
9
+ * trailer names it. A commit trailered `none` (housekeeping), `unattributed` (a
10
+ * daemon capture whose delivery was unknown) or not trailered at all belongs to
11
+ * no delivery's evidence. When such a commit holds a delivery's implementation,
12
+ * verify reports "the diff lacks the work" on every pass while the work sits one
13
+ * commit away (Tinker Tailor 1bc76c8e: a 51-file exit capture stamped `none`,
14
+ * iteration 23). This module finds those commits so a shortfall hold can name
15
+ * them, making misattributed work distinguishable from missing work.
16
+ *
17
+ * Scope -- "the files a held node concerns" -- is the union of the shortfall's
18
+ * cited diff file, the delivery's issues' completion-artifact files and tests,
19
+ * and its Context Groups' relevantFiles. When none of those name a file the
20
+ * scope is `unscoped` and every candidate commit is named, labelled unscoped --
21
+ * never silently nothing. An unattributed capture is named whatever it touches:
22
+ * it is delivery work by declaration.
23
+ */
24
+ import { runGitSync } from '../git/index.js';
25
+ import { classifyTrailerValue, DELIVERY_TRAILER_KEY } from '../resolvers/shared/delivery-trailer.js';
26
+ import { compilePathPattern } from '../worktree/capture-attribution.js';
27
+ import { completionFilesOf } from '../worktree/capture-attribution-read.js';
28
+ /** Bound on commits named, and files listed per commit, in a hold. */
29
+ const MAX_NAMED_COMMITS = 20;
30
+ const MAX_FILES_PER_COMMIT = 10;
31
+ /** Commits per `git show` invocation when reading the batch. */
32
+ const READ_CHUNK = 100;
33
+ const FIELD = '\x1f';
34
+ const RECORD = '\x1e';
35
+ /**
36
+ * Read and classify every distinct commit in the focus's recorded batches. A
37
+ * commit git cannot read is skipped. `overrides` (sha -> delivery id) replaces a
38
+ * commit's trailer classification with a delivery attribution.
39
+ */
40
+ export function readFocusCommitRecords(cwd, batches, overrides = new Map()) {
41
+ const shas = [...new Set(batches.flatMap((b) => b ?? []).map((s) => s.trim()).filter((s) => /^[0-9a-f]{7,64}$/i.test(s)))];
42
+ const records = [];
43
+ for (let i = 0; i < shas.length; i += READ_CHUNK) {
44
+ const chunk = shas.slice(i, i + READ_CHUNK);
45
+ const res = runGitSync(['show', '-s', '--ignore-missing',
46
+ `--format=%H${FIELD}%P${FIELD}%s${FIELD}%(trailers:key=${DELIVERY_TRAILER_KEY},valueonly,separator=%x2c)${RECORD}`,
47
+ ...chunk], cwd);
48
+ if (!res.success)
49
+ continue;
50
+ for (const raw of res.output.split(RECORD)) {
51
+ const [sha = '', parents = '', subject = '', trailers = ''] = raw.trim().split(FIELD);
52
+ if (!/^[0-9a-f]{40,64}$/i.test(sha))
53
+ continue;
54
+ const override = overrides.get(sha);
55
+ const firstTrailer = trailers.split(',').map((t) => t.trim()).find((t) => t !== '') ?? '';
56
+ records.push({
57
+ sha,
58
+ subject,
59
+ isMerge: parents.trim().split(/\s+/).filter(Boolean).length > 1,
60
+ attribution: override ? { kind: 'delivery', deliveryId: override } : classifyTrailerValue(firstTrailer),
61
+ });
62
+ }
63
+ }
64
+ return records;
65
+ }
66
+ /** The files a commit changed (renames split), or null when git cannot read it. */
67
+ export function readCommitChangedFiles(cwd, sha) {
68
+ const res = runGitSync(['show', '--name-only', '--no-renames', '--format=', sha, '--'], cwd);
69
+ if (!res.success)
70
+ return null;
71
+ return res.output.split('\n').map((l) => l.trim()).filter((l) => l !== '');
72
+ }
73
+ /** The file named by a shortfall's diff citation ("path:line", "path @@ ..."), or null. */
74
+ export function citedFile(diffCitation) {
75
+ const token = (diffCitation ?? '').trim().split(/[\s:@(]/)[0] ?? '';
76
+ return /[./]/.test(token) ? token.replace(/^[ab]\//, '') : null;
77
+ }
78
+ /** Pure: the node's file scope from its shortfall citations and the delivery's issues. */
79
+ export function resolveNodeFileScope(diffCitations, deliveryIssues) {
80
+ const patterns = new Set();
81
+ for (const c of diffCitations) {
82
+ const f = citedFile(c);
83
+ if (f)
84
+ patterns.add(f);
85
+ }
86
+ for (const issue of deliveryIssues) {
87
+ for (const f of completionFilesOf(issue.completionArtifacts))
88
+ patterns.add(f);
89
+ for (const line of (issue.relevantFiles ?? '').split('\n')) {
90
+ if (line.trim() !== '')
91
+ patterns.add(line.trim());
92
+ }
93
+ }
94
+ return patterns.size === 0 ? { kind: 'unscoped' } : { kind: 'files', patterns: [...patterns] };
95
+ }
96
+ /**
97
+ * Pure: the commits a held node's work may live in -- every non-merge commit in
98
+ * the batches trailered `none`, `unattributed` or not at all whose changed files
99
+ * meet the node's scope (any, when unscoped). An unattributed capture is named
100
+ * whatever it touches. Commits attributed to a delivery -- this one or another --
101
+ * never are. Newest-batch order is kept; the list and each file list are bounded.
102
+ */
103
+ export function findMisattributedCommits(commits, changedFilesOf, scope) {
104
+ const matchers = scope.kind === 'files'
105
+ ? scope.patterns.map(compilePathPattern).filter((m) => m !== null)
106
+ : [];
107
+ const named = [];
108
+ for (const c of commits) {
109
+ if (named.length >= MAX_NAMED_COMMITS)
110
+ break;
111
+ const trailer = c.attribution.kind;
112
+ if (trailer === 'delivery' || c.isMerge)
113
+ continue;
114
+ const changed = changedFilesOf(c.sha) ?? [];
115
+ const inScope = scope.kind === 'unscoped' ? changed : changed.filter((f) => matchers.some((m) => m(f)));
116
+ if (inScope.length === 0 && trailer !== 'unattributed_capture')
117
+ continue;
118
+ named.push({ sha: c.sha, subject: c.subject, trailer, files: inScope.slice(0, MAX_FILES_PER_COMMIT) });
119
+ }
120
+ return { scope: scope.kind, commits: named };
121
+ }
122
+ const TRAILER_LABEL = {
123
+ sentinel: 'Telora-Delivery: none',
124
+ unattributed: 'no Telora-Delivery trailer',
125
+ unattributed_capture: 'Telora-Delivery: unattributed (daemon capture, delivery unknown)',
126
+ };
127
+ /** The lines a hold renders for a non-empty note; [] when there is nothing to name. */
128
+ export function renderMisattributedCommitLines(note) {
129
+ if (!note || note.commits.length === 0)
130
+ return [];
131
+ const lines = [
132
+ note.scope === 'files'
133
+ ? `Possibly misattributed work (${note.commits.length}): these commits in the focus's merged batches touch ` +
134
+ `files this delivery concerns but are not attributed to it, so verify did not count them. The work ` +
135
+ `may already exist -- if a commit holds this delivery's work, credit it to the delivery instead of ` +
136
+ `re-writing it.`
137
+ : `Possibly misattributed work (${note.commits.length}, unscoped -- no file scope is recorded for this ` +
138
+ `delivery): these commits in the focus's merged batches are not attributed to any delivery, so verify ` +
139
+ `did not count them. If one holds this delivery's work, credit it to the delivery instead of re-writing it.`,
140
+ ];
141
+ for (const c of note.commits) {
142
+ lines.push(`- ${c.sha.slice(0, 12)} "${c.subject}" (${TRAILER_LABEL[c.trailer]})`);
143
+ if (c.files.length > 0)
144
+ lines.push(` files: ${c.files.join(', ')}`);
145
+ }
146
+ return lines;
147
+ }
148
+ //# sourceMappingURL=misattributed-commits.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"misattributed-commits.js","sourceRoot":"","sources":["../../src/verify/misattributed-commits.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,sEAAsE;AACtE,gBAAgB;AAEhB;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C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AAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QACnF,IAAI,CAAC,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC;YAAE,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACvE,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
@@ -0,0 +1,47 @@
1
+ /**
2
+ * A focus commit that adds nothing of the focus's own is not judged again: it
3
+ * carries the verdict the focus's own commits already earned.
4
+ *
5
+ * When every commit on a focus branch is already on integration and the branch
6
+ * tip moved past the newest commit the gate judged ONLY by commits other foci own
7
+ * (git/focus-own-delta.ts isForeignOnlyExtension), a run at that tip would judge
8
+ * the integration tip in the focus's place -- the 2026-09-17 incident, where a
9
+ * sibling's failing tests were charged to a fast-forwarded focus. So no run
10
+ * starts: the verdict recorded for that newest judged ancestor is carried to the
11
+ * tip (recorded there, naming where it came from), and the delivery is routed on
12
+ * it exactly as on any recorded verdict -- its state follows from what its own
13
+ * commits earned, and it is never stranded waiting on a run that must not happen.
14
+ *
15
+ * Anything short of proof -- an own or unattributed commit since the judged
16
+ * ancestor, no judged ancestor within the search depth, an unreadable read --
17
+ * carries nothing, and the dispatch runs the gate as before.
18
+ *
19
+ * @module verify/no-own-delta-verdict
20
+ */
21
+ import { isForeignOnlyExtension } from '../git/focus-own-delta.js';
22
+ import type { CommitVerdict, CommitVerdictGate, CommitVerdictReader } from './commit-verdict-record.js';
23
+ /** How many ancestors of the tip are searched for the newest judged one. */
24
+ export declare const CARRIED_VERDICT_SEARCH_DEPTH = 200;
25
+ /** The reads a carried verdict is resolved from. */
26
+ export interface CarriedVerdictDeps {
27
+ integrationBranch: string;
28
+ /** The focus worktree path, null when the focus has none. */
29
+ resolveWorktreePath: (focusId: string) => string | null;
30
+ /** The focus's delivery ids. May throw (then nothing is carried). */
31
+ listFocusDeliveryIds: (focusId: string) => Promise<readonly string[]>;
32
+ readCommitVerdict: CommitVerdictReader;
33
+ /** Ancestors of `tip`, newest first, excluding `tip`; null when unreadable. */
34
+ listAncestors?: (worktreePath: string, tip: string, depth: number) => string[] | null;
35
+ isForeignOnlyExtension?: typeof isForeignOnlyExtension;
36
+ }
37
+ /** A verdict carried to `head`, and the judged commit it came from. */
38
+ export interface CarriedVerdict {
39
+ verdict: CommitVerdict;
40
+ carriedFrom: string;
41
+ }
42
+ /**
43
+ * The verdict `head` carries from its newest judged ancestor when it adds nothing
44
+ * of the focus's own (module doc), or null.
45
+ */
46
+ export declare function resolveCarriedVerdict(productId: string, focusId: string, head: string, gate: CommitVerdictGate, deps: CarriedVerdictDeps): Promise<CarriedVerdict | null>;
47
+ //# sourceMappingURL=no-own-delta-verdict.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"no-own-delta-verdict.d.ts","sourceRoot":"","sources":["../../src/verify/no-own-delta-verdict.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AAEnE,OAAO,KAAK,EAAE,aAAa,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAExG,4EAA4E;AAC5E,eAAO,MAAM,4BAA4B,MAAM,CAAC;AAEhD,oDAAoD;AACpD,MAAM,WAAW,kBAAkB;IACjC,iBAAiB,EAAE,MAAM,CAAC;IAC1B,6DAA6D;IAC7D,mBAAmB,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,MAAM,GAAG,IAAI,CAAC;IACxD,qEAAqE;IACrE,oBAAoB,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,SAAS,MAAM,EAAE,CAAC,CAAC;IACtE,iBAAiB,EAAE,mBAAmB,CAAC;IACvC,+EAA+E;IAC/E,aAAa,CAAC,EAAE,CAAC,YAAY,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,MAAM,EAAE,GAAG,IAAI,CAAC;IACtF,sBAAsB,CAAC,EAAE,OAAO,sBAAsB,CAAC;CACxD;AAQD,uEAAuE;AACvE,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,aAAa,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;;GAGG;AACH,wBAAsB,qBAAqB,CACzC,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,iBAAiB,EACvB,IAAI,EAAE,kBAAkB,GACvB,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC,CA8BhC"}
@@ -0,0 +1,74 @@
1
+ // PINNED-BY-BEGIN (generated by gen:pinned-by -- do not hand-edit; checked by lint:pinned-by)
2
+ // Pinned by: packages/daemon/src/integration/fully-merged-focus-sibling-red-scenario.test.ts,
3
+ // packages/daemon/src/verify/verification-commit-sharing.test.ts
4
+ // PINNED-BY-END
5
+ /**
6
+ * A focus commit that adds nothing of the focus's own is not judged again: it
7
+ * carries the verdict the focus's own commits already earned.
8
+ *
9
+ * When every commit on a focus branch is already on integration and the branch
10
+ * tip moved past the newest commit the gate judged ONLY by commits other foci own
11
+ * (git/focus-own-delta.ts isForeignOnlyExtension), a run at that tip would judge
12
+ * the integration tip in the focus's place -- the 2026-09-17 incident, where a
13
+ * sibling's failing tests were charged to a fast-forwarded focus. So no run
14
+ * starts: the verdict recorded for that newest judged ancestor is carried to the
15
+ * tip (recorded there, naming where it came from), and the delivery is routed on
16
+ * it exactly as on any recorded verdict -- its state follows from what its own
17
+ * commits earned, and it is never stranded waiting on a run that must not happen.
18
+ *
19
+ * Anything short of proof -- an own or unattributed commit since the judged
20
+ * ancestor, no judged ancestor within the search depth, an unreadable read --
21
+ * carries nothing, and the dispatch runs the gate as before.
22
+ *
23
+ * @module verify/no-own-delta-verdict
24
+ */
25
+ import { isForeignOnlyExtension } from '../git/focus-own-delta.js';
26
+ import { runGitSync } from '../git/types.js';
27
+ /** How many ancestors of the tip are searched for the newest judged one. */
28
+ export const CARRIED_VERDICT_SEARCH_DEPTH = 200;
29
+ function defaultListAncestors(worktreePath, tip, depth) {
30
+ const r = runGitSync(['rev-list', '--topo-order', `--max-count=${depth}`, '--skip=1', tip], worktreePath);
31
+ if (!r.success)
32
+ return null;
33
+ return r.output.split('\n').map((l) => l.trim()).filter((l) => l !== '');
34
+ }
35
+ /**
36
+ * The verdict `head` carries from its newest judged ancestor when it adds nothing
37
+ * of the focus's own (module doc), or null.
38
+ */
39
+ export async function resolveCarriedVerdict(productId, focusId, head, gate, deps) {
40
+ const worktreePath = deps.resolveWorktreePath(focusId);
41
+ if (!worktreePath)
42
+ return null;
43
+ const ancestors = (deps.listAncestors ?? defaultListAncestors)(worktreePath, head, CARRIED_VERDICT_SEARCH_DEPTH);
44
+ if (!ancestors)
45
+ return null;
46
+ const judged = ancestors.find((sha) => deps.readCommitVerdict(productId, focusId, sha, gate) !== null);
47
+ if (!judged)
48
+ return null;
49
+ const recorded = deps.readCommitVerdict(productId, focusId, judged, gate);
50
+ if (!recorded)
51
+ return null;
52
+ let ids;
53
+ try {
54
+ ids = await deps.listFocusDeliveryIds(focusId);
55
+ }
56
+ catch {
57
+ return null;
58
+ }
59
+ const foreignOnly = (deps.isForeignOnlyExtension ?? isForeignOnlyExtension)(worktreePath, deps.integrationBranch, judged, head, new Set(ids));
60
+ if (!foreignOnly)
61
+ return null;
62
+ const carriedWhy = `carried from ${judged.slice(0, 8)}: the focus has no unverified delta of its own -- every commit `
63
+ + `since is another focus's, already on integration`;
64
+ return {
65
+ carriedFrom: judged,
66
+ verdict: {
67
+ ...recorded,
68
+ sha: head,
69
+ recordedAt: new Date().toISOString(),
70
+ rationale: recorded.rationale ? `${carriedWhy}; ${recorded.rationale}` : carriedWhy,
71
+ },
72
+ };
73
+ }
74
+ //# sourceMappingURL=no-own-delta-verdict.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"no-own-delta-verdict.js","sourceR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ult } from '../queries/escalation-suppression.js';
2
+ import type { HumanAct } from '../queries/filing-observation.js';
3
+ import type { MisattributedCommitsRecord, ShortfallReconciliationDetail } from '../queries/delivery-gate-state.js';
4
+ import type { PendingVerification } from '../queries/verification.js';
5
+ import { type ShortfallPark } from './shortfall-park.js';
6
+ import type { ShortfallRepeat } from './shortfall-repeat.js';
7
+ import type { TargetShortfall } from './verify-restatement.js';
8
+ /**
9
+ * The MCP tool and action an operator rules a shortfall node met or excused with.
10
+ * ONE definition: the operator-rulings delivery aligns its action name to this
11
+ * constant, and the filing's proposed human act names it.
12
+ */
13
+ export declare const SHORTFALL_RULING_TOOL = "telora_product_delivery";
14
+ export declare const SHORTFALL_RULING_ACTION = "shortfall_rule";
15
+ /**
16
+ * escalation_kind of the park filing: the existing verify_gate_unclearable (see
17
+ * the module header for why reuse, and why its self-report exclusion is right).
18
+ */
19
+ export declare const SHORTFALL_PARK_ESCALATION_KIND = "verify_gate_unclearable";
20
+ /** metadata.diagnosis of the park filing. */
21
+ export declare const SHORTFALL_PARK_DIAGNOSIS = "shortfall_park";
22
+ /** Pure: the park a filing is about -- the standing record, or one read off the repeat when none was passed. */
23
+ export declare function shortfallParkOf(shortfalls: readonly TargetShortfall[], repeat: ShortfallRepeat, park: ShortfallPark | undefined, at: string): ShortfallPark;
24
+ /** Pure: the human act a park proposes -- rule the named nodes, or correct their tree claim. */
25
+ export declare function shortfallParkHumanAct(deliveryName: string, nodeIds: readonly string[]): HumanAct;
26
+ /** Pure: the park filing's body -- every repeated node, the count and limit, the commit-set fact, what releases it. */
27
+ export declare function buildShortfallParkEscalation(deliveryName: string, shortfalls: readonly TargetShortfall[], park: ShortfallPark, limit?: number, misattributed?: MisattributedCommitsRecord): {
28
+ description: string;
29
+ whatWasTried: string;
30
+ helpNeeded: string;
31
+ };
32
+ /**
33
+ * File the park's ONE escalation through the cause-keyed idempotent gate (see the
34
+ * module header). Returns whether the filing call completed (filed, suppressed as
35
+ * the same standing park, or correlated onto the delivery's open incident row).
36
+ * Best-effort: a failure is logged, never thrown.
37
+ */
38
+ export declare function fileShortfallParkEscalation(v: Pick<PendingVerification, 'deliveryId' | 'deliveryName' | 'focusId' | 'productId'>, shortfalls: readonly TargetShortfall[], park: ShortfallPark, organizationId: string, fileEscalation: (params: FileEscalationIdempotentParams) => Promise<FileEscalationIdempotentResult>, limit?: number, misattributed?: MisattributedCommitsRecord): Promise<boolean>;
39
+ /** Pure: the message a live coding team is sent when its delivery is parked. */
40
+ export declare function buildShortfallParkInjectMessage(deliveryName: string, park: ShortfallPark, detail: ShortfallReconciliationDetail): string;
41
+ //# sourceMappingURL=shortfall-park-escalation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shortfall-park-escalation.d.ts","sourceRoot":"","sources":["../../src/verify/shortfall-park-escalation.ts"],"names":[],"mappings":"AAyCA,OAAO,KAAK,EACV,8BAA8B,EAC9B,8BAA8B,EAC/B,MAAM,sCAAsC,CAAC;AAE9C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AACjE,OAAO,KAAK,EAAE,0BAA0B,EAAE,6BAA6B,EAAE,MAAM,mCAAmC,CAAC;AACnH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAGtE,OAAO,EAA+B,KAAK,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACtF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAE7D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAI/D;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,4BAA4B,CAAC;AAC/D,eAAO,MAAM,uBAAuB,mBAAmB,CAAC;AAExD;;;GAGG;AACH,eAAO,MAAM,8BAA8B,4BAA4B,CAAC;AAExE,6CAA6C;AAC7C,eAAO,MAAM,wBAAwB,mBAAmB,CAAC;AAEzD,gHAAgH;AAChH,wBAAgB,eAAe,CAC7B,UAAU,EAAE,SAAS,eAAe,EAAE,EACtC,MAAM,EAAE,eAAe,EACvB,IAAI,EAAE,aAAa,GAAG,SAAS,EAC/B,EAAE,EAAE,MAAM,GACT,aAAa,CAQf;AAED,gGAAgG;AAChG,wBAAgB,qBAAqB,CAAC,YAAY,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,MAAM,EAAE,GAAG,QAAQ,CAQhG;AAED,uHAAuH;AACvH,wBAAgB,4BAA4B,CAC1C,YAAY,EAAE,MAAM,EACpB,UAAU,EAAE,SAAS,eAAe,EAAE,EACtC,IAAI,EAAE,aAAa,EACnB,KAAK,GAAE,MAAoC,EAC3C,aAAa,CAAC,EAAE,0BAA0B,GACzC;IAAE,WAAW,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,CAuCnE;AAED;;;;;GAKG;AACH,wBAAsB,2BAA2B,CAC/C,CAAC,EAAE,IAAI,CAAC,mBAAmB,EAAE,YAAY,GAAG,cAAc,GAAG,SAAS,GAAG,WAAW,CAAC,EACrF,UAAU,EAAE,SAAS,eAAe,EAAE,EACtC,IAAI,EAAE,aAAa,EACnB,cAAc,EAAE,MAAM,EACtB,cAAc,EAAE,CAAC,MAAM,EAAE,8BAA8B,KAAK,OAAO,CAAC,8BAA8B,CAAC,EACnG,KAAK,GAAE,MAAoC,EAC3C,aAAa,CAAC,EAAE,0BAA0B,GACzC,OAAO,CAAC,OAAO,CAAC,CAiDlB;AAED,gFAAgF;AAChF,wBAAgB,+BAA+B,CAC7C,YAAY,EAAE,MAAM,EACpB,IAAI,EAAE,aAAa,EACnB,MAAM,EAAE,6BAA6B,GACpC,MAAM,CAQR"}
@@ -0,0 +1,177 @@
1
+ // PINNED-BY-BEGIN (generated by gen:pinned-by -- do not hand-edit; checked by lint:pinned-by)
2
+ // Pinned by: packages/daemon/src/verify/shortfall-park-escalation.test.ts
3
+ // PINNED-BY-END
4
+ /**
5
+ * The ONE filing a shortfall PARK makes, and the message a live team gets when a
6
+ * park lands.
7
+ *
8
+ * Why (reality tree injection #13): a delivery looping on an identical verify
9
+ * shortfall stopped only when an operator disarmed its focus. The park
10
+ * (verify/shortfall-park.ts) now stops the loop on its own; this module is how a
11
+ * human learns of it. The act that ends a park is not a coding act: either the
12
+ * named nodes are ruled met or excused on the delivery (a recorded, attributed
13
+ * lowering of the bar -- an operator's, never a team's) or the tree claim for them
14
+ * is corrected. So the filing NAMES that act as its proposed human act, names
15
+ * every repeated node with its declared/achieved/reason, and states what releases
16
+ * the park.
17
+ *
18
+ * Routing (queries/filing-observation.ts): the daemon files no human-facing row.
19
+ * The filing lands as a machine-lane observation carrying proposed_disposition
20
+ * needs_operator and the proposed act; the promotion sweep hands it to a routing
21
+ * decider IMMEDIATELY on the delivery_parked basis (queries/agent-resolvable-promotion.ts
22
+ * isDeliveryParkObservation, keyed on this filing's cause key), which is what
23
+ * makes it the one human-facing escalation.
24
+ *
25
+ * Exactly one: the cause key (queries/cause-key.ts shortfallParkCauseKey) is the
26
+ * delivery plus the park's subject (repeated signature + commit set), filed
27
+ * through the idempotent gate. A re-judgement of the same park re-holds and is
28
+ * suppressed by the open (or dismissed) row; a NEW park (new commits, or another
29
+ * shortfall) is a new key -- and while the delivery's earlier row is still open,
30
+ * the incident reducer attaches it there as a symptom rather than filing a second
31
+ * row. The kind is the existing verify_gate_unclearable (admitted by the DB CHECK;
32
+ * a new kind would need a CHECK migration), and its self-report exclusion from the
33
+ * operator-hold predicate (queries/holds.ts) is right for a park: the durable park
34
+ * record, not this row, is what holds the delivery, so a ruling that releases the
35
+ * park is not also blocked on the row being closed.
36
+ *
37
+ * @module verify/shortfall-park-escalation
38
+ */
39
+ import { ESCALATION_DISPOSITIONS, ESCALATION_REASONS, withRetry } from '@telora/daemon-core';
40
+ import { shortfallParkCauseKey } from '../queries/cause-key.js';
41
+ import { buildShortfallParkLines, SHORTFALL_PARK_HEADING } from '../prompt-sections/shortfall-park-section.js';
42
+ import { createLogger } from '../shell/log.js';
43
+ import { SHORTFALL_PARK_REPEAT_LIMIT } from './shortfall-park.js';
44
+ import { renderMisattributedCommitLines } from './misattributed-commits.js';
45
+ const log = createLogger({ module: 'verification' });
46
+ /**
47
+ * The MCP tool and action an operator rules a shortfall node met or excused with.
48
+ * ONE definition: the operator-rulings delivery aligns its action name to this
49
+ * constant, and the filing's proposed human act names it.
50
+ */
51
+ export const SHORTFALL_RULING_TOOL = 'telora_product_delivery';
52
+ export const SHORTFALL_RULING_ACTION = 'shortfall_rule';
53
+ /**
54
+ * escalation_kind of the park filing: the existing verify_gate_unclearable (see
55
+ * the module header for why reuse, and why its self-report exclusion is right).
56
+ */
57
+ export const SHORTFALL_PARK_ESCALATION_KIND = 'verify_gate_unclearable';
58
+ /** metadata.diagnosis of the park filing. */
59
+ export const SHORTFALL_PARK_DIAGNOSIS = 'shortfall_park';
60
+ /** Pure: the park a filing is about -- the standing record, or one read off the repeat when none was passed. */
61
+ export function shortfallParkOf(shortfalls, repeat, park, at) {
62
+ return park ?? {
63
+ signature: repeat.signature,
64
+ commitSet: repeat.commitSet ?? null,
65
+ nodeIds: [...new Set(shortfalls.map((s) => s.nodeId))].sort(),
66
+ count: repeat.count,
67
+ parkedAt: at,
68
+ };
69
+ }
70
+ /** Pure: the human act a park proposes -- rule the named nodes, or correct their tree claim. */
71
+ export function shortfallParkHumanAct(deliveryName, nodeIds) {
72
+ return {
73
+ kind: 'unreachable_capability',
74
+ act: `Rule the repeated shortfall node(s) ${nodeIds.join(', ')} on delivery "${deliveryName}" met or excused ` +
75
+ `(${SHORTFALL_RULING_TOOL} action ${SHORTFALL_RULING_ACTION}, with a rationale), or correct the tree claim ` +
76
+ `for those nodes.`,
77
+ };
78
+ }
79
+ /** Pure: the park filing's body -- every repeated node, the count and limit, the commit-set fact, what releases it. */
80
+ export function buildShortfallParkEscalation(deliveryName, shortfalls, park, limit = SHORTFALL_PARK_REPEAT_LIMIT, misattributed) {
81
+ // Unattributed commits touching the delivery's files make an unchanged commit set
82
+ // doubtful evidence: the work may exist and merely be uncredited. Say so first.
83
+ const misattributedLines = renderMisattributedCommitLines(misattributed);
84
+ const misattributedBlock = misattributedLines.length > 0
85
+ ? `BEFORE ruling or correcting the tree, check attribution: ${misattributedLines.join('\n')}\n\n`
86
+ : '';
87
+ const nodeLines = shortfalls.map((s) => `- tree node ${s.nodeId}\n` +
88
+ ` declared (the outcome the injection claims): ${s.declaredStatement}\n` +
89
+ ` achieved (what the diff actually produced): ${s.achievedStatement}\n` +
90
+ ` reason: ${s.reason}`);
91
+ const commitFact = park.commitSet !== null
92
+ ? `No new delivery-trailered commits since the last judgement: every one of those judgements saw the same ` +
93
+ `delivery commit set (fingerprint ${park.commitSet}).`
94
+ : `The delivery's commit set could not be read, so the park counted identical judgements alone.`;
95
+ return {
96
+ description: `Delivery "${deliveryName}" is PARKED on a repeating verify shortfall naming node(s) ${park.nodeIds.join(', ')}.\n\n` +
97
+ `The identical shortfall has held on ${park.count} consecutive verify judgements (the park limit is ${limit}). ` +
98
+ `${commitFact} Re-coding the same diff cannot change the verdict, so the daemon has stopped sending the ` +
99
+ `delivery back to coding and holds it in verify (parked at ${park.parkedAt}).\n\n` +
100
+ `Repeated shortfall node(s):\n${nodeLines.join('\n')}\n\n` +
101
+ misattributedBlock +
102
+ `What releases the park:\n` +
103
+ `- genuinely new delivery commits (Telora-Delivery trailer) that change the judged commit set -- the next ` +
104
+ `verify judges them fresh; or\n` +
105
+ `- a ruling on the named node(s): ${SHORTFALL_RULING_TOOL} action ${SHORTFALL_RULING_ACTION}, met or excused, ` +
106
+ `with a rationale; or\n` +
107
+ `- a tree correction (telora_reality_tree_*) so the declared claim is one this delivery's diff can produce.`,
108
+ whatWasTried: `The delivery re-entered verify_failed re-work and was judged ${park.count} times; the identical shortfall ` +
109
+ `reproduced on an unchanged commit set each time, so further re-work was stopped.`,
110
+ helpNeeded: `Rule the named node(s) met or excused on the delivery (${SHORTFALL_RULING_ACTION}, with a rationale), or ` +
111
+ `correct the tree claim for them. The delivery stays parked in verify -- NOT re-queued for re-work -- until ` +
112
+ `one of those lands or new delivery commits change the outcome.`,
113
+ };
114
+ }
115
+ /**
116
+ * File the park's ONE escalation through the cause-keyed idempotent gate (see the
117
+ * module header). Returns whether the filing call completed (filed, suppressed as
118
+ * the same standing park, or correlated onto the delivery's open incident row).
119
+ * Best-effort: a failure is logged, never thrown.
120
+ */
121
+ export async function fileShortfallParkEscalation(v, shortfalls, park, organizationId, fileEscalation, limit = SHORTFALL_PARK_REPEAT_LIMIT, misattributed) {
122
+ const body = buildShortfallParkEscalation(v.deliveryName, shortfalls, park, limit, misattributed);
123
+ try {
124
+ const result = await withRetry(() => fileEscalation({
125
+ causeKey: shortfallParkCauseKey(v.deliveryId, park.signature, park.commitSet),
126
+ organizationId,
127
+ sessionId: '',
128
+ issueId: null,
129
+ reasonType: ESCALATION_REASONS.ERROR_ENCOUNTERED,
130
+ disposition: ESCALATION_DISPOSITIONS.NEEDS_OPERATOR,
131
+ // Lowering the bar on a declared node is an authority act no agent session
132
+ // holds; the chokepoint carries it as the observation's proposed_human_act.
133
+ humanAct: shortfallParkHumanAct(v.deliveryName, park.nodeIds),
134
+ anchor: {
135
+ deliveryId: v.deliveryId,
136
+ ...(v.focusId ? { focusId: v.focusId } : {}),
137
+ ...(v.productId ? { productId: v.productId } : {}),
138
+ },
139
+ escalationKind: SHORTFALL_PARK_ESCALATION_KIND,
140
+ description: body.description,
141
+ whatWasTried: body.whatWasTried,
142
+ helpNeeded: body.helpNeeded,
143
+ metadata: {
144
+ cause: SHORTFALL_PARK_ESCALATION_KIND,
145
+ diagnosis: SHORTFALL_PARK_DIAGNOSIS,
146
+ deliveryName: v.deliveryName,
147
+ nodeIds: park.nodeIds,
148
+ repeatCount: park.count,
149
+ repeatLimit: limit,
150
+ commitSet: park.commitSet,
151
+ signature: park.signature,
152
+ parkedAt: park.parkedAt,
153
+ rulingAction: SHORTFALL_RULING_ACTION,
154
+ },
155
+ }), { maxAttempts: 3, label: `escalation-shortfall-park-${v.deliveryId}` });
156
+ if (result.filed) {
157
+ log.info(`[verification] Parked delivery "${v.deliveryName}" on a repeating shortfall (x${park.count}, nodes ` +
158
+ `${park.nodeIds.join(', ')}); filed its one escalation.`);
159
+ }
160
+ return true;
161
+ }
162
+ catch (err) {
163
+ log.warn(`failed to file shortfall-park escalation for delivery ${v.deliveryId}:`, err.message);
164
+ return false;
165
+ }
166
+ }
167
+ /** Pure: the message a live coding team is sent when its delivery is parked. */
168
+ export function buildShortfallParkInjectMessage(deliveryName, park, detail) {
169
+ return [
170
+ `VERIFY PARKED for delivery "${deliveryName}".`,
171
+ '',
172
+ `**${SHORTFALL_PARK_HEADING}:**`,
173
+ ...buildShortfallParkLines(park, detail.shortfalls),
174
+ ...renderMisattributedCommitLines(detail.misattributed).map((l) => `- ${l}`),
175
+ ].join('\n');
176
+ }
177
+ //# sourceMappingURL=shortfall-park-escalation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shortfall-park-escalation.js","sourceRoot":"","sources":["../../src/verify/shortfall-park-escalation.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,0EAA0E;AAC1E,gBAAgB;AAEhB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAEH,OAAO,EAAE,uBAAuB,EAAE,kBAAkB,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAK7F,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAIhE,OAAO,EAAE,uBAAuB,EAAE,sBAAsB,EAAE,MAAM,8CAA8C,CAAC;AAC/G,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,2BAA2B,EAAsB,MAAM,qBAAqB,CAAC;AAEtF,OAAO,EAAE,8BAA8B,EAAE,MAAM,4BAA4B,CAAC;AAG5E,MAAM,GAAG,GAAG,YAAY,CAAC,EAAE,MAAM,EAAE,cAAc,EAAE,CAAC,CAAC;AAErD;;;;GAIG;AACH,MA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AI,CAAC,SAAS;gBACzB,SAAS,EAAE,IAAI,CAAC,SAAS;gBACzB,QAAQ,EAAE,IAAI,CAAC,QAAQ;gBACvB,YAAY,EAAE,uBAAuB;aACtC;SACF,CAAC,EACF,EAAE,WAAW,EAAE,CAAC,EAAE,KAAK,EAAE,6BAA6B,CAAC,CAAC,UAAU,EAAE,EAAE,CACvE,CAAC;QACF,IAAI,MAAM,CAAC,KAAK,EAAE,CAAC;YACjB,GAAG,CAAC,IAAI,CACN,mCAAmC,CAAC,CAAC,YAAY,gCAAgC,IAAI,CAAC,KAAK,UAAU;gBACrG,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,8BAA8B,CACzD,CAAC;QACJ,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,GAAG,CAAC,IAAI,CAAC,yDAAyD,CAAC,CAAC,UAAU,GAAG,EAAG,GAAa,CAAC,OAAO,CAAC,CAAC;QAC3G,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC;AAED,gFAAgF;AAChF,MAAM,UAAU,+BAA+B,CAC7C,YAAoB,EACpB,IAAmB,EACnB,MAAqC;IAErC,OAAO;QACL,+BAA+B,YAAY,IAAI;QAC/C,EAAE;QACF,KAAK,sBAAsB,KAAK;QAChC,GAAG,uBAAuB,CAAC,IAAI,EAAE,MAAM,CAAC,UAAU,CAAC;QACnD,GAAG,8BAA8B,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC;KAC7E,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC"}
@@ -0,0 +1,109 @@
1
+ import { type DeliveryGateState, type ShortfallPark, type ShortfallRepeatRecord } from '../queries/delivery-gate-state.js';
2
+ import type { TargetShortfall } from './verify-restatement.js';
3
+ export { SHORTFALL_PARK_REPEAT_LIMIT } from './shortfall-repeat.js';
4
+ export type { ShortfallPark } from '../queries/delivery-gate-state.js';
5
+ /**
6
+ * Order-independent fingerprint of a delivery's commit set. The input is the set
7
+ * of commit IDENTITIES the resolver read (verify/delivery-commit-set.ts: patch ids,
8
+ * so a rebase that re-shas unchanged commits is not "new work"); trimmed,
9
+ * lowercased, deduped and sorted before hashing, so the same set in any order or
10
+ * with repeats fingerprints identically. The empty set has a fingerprint too: a
11
+ * delivery with no commits of its own is a known, unchanging set. Pure.
12
+ */
13
+ export declare function commitSetFingerprint(ids: readonly string[]): string;
14
+ /** The standing park a gate_state carries, or null (none, malformed, or a verify pass dropped it). Pure. */
15
+ export declare function readShortfallPark(gateState: unknown): ShortfallPark | null;
16
+ /**
17
+ * The park that makes a delivery NON-REWORKABLE: a standing park on a delivery
18
+ * that sits in verify, or null. The ONE predicate every daemon writer and spawn
19
+ * gate reads before sending a verify delivery back to coding (the review exit's
20
+ * verify_failed route, the live open-issues pass, the review-next-step decision,
21
+ * the review park), so none of them can disagree about a parked delivery.
22
+ *
23
+ * The park is AUTHORITATIVE in those readers: they neither release nor replace
24
+ * it. VERIFY is its single releaser -- a verify re-judgement on a changed
25
+ * delivery commit set (a new focus HEAD re-arms every delivery in verify) routes
26
+ * the delivery to re-work and drops the park (routeShortfallOutcome ->
27
+ * withShortfallPark(..., null)); a pass drops it (clearVerificationHistory); an
28
+ * operator ruling releases it through isShortfallParkReleased, which re-arms that
29
+ * re-judgement at an unchanged focus HEAD (verify/shortfall-rulings.ts). A reader that cannot know the current commit set therefore holds.
30
+ *
31
+ * Only a delivery IN VERIFY is refused: a park carried onto another status (the
32
+ * Nexus hand-back of a declined request moves a verify delivery to re-plan on a
33
+ * new external fact, once) is not a verify re-judgement loop, and the park still
34
+ * re-holds at its first unchanged re-judgement. Literal 'verify' (mock-safe). Pure.
35
+ */
36
+ export declare function shortfallParkRefusingRework(delivery: {
37
+ executionStatus?: string | null;
38
+ gateState?: unknown;
39
+ }): ShortfallPark | null;
40
+ /** What a reader knows NOW about the facts that release a park. */
41
+ export interface ShortfallParkReleaseFacts {
42
+ /** The delivery's current commit-set fingerprint; null when it could not be read. */
43
+ commitSet: string | null;
44
+ /**
45
+ * The fingerprint of the operator rulings recorded on the delivery now
46
+ * (queries/shortfall-rulings.ts). Absent or null means the reader has no ruling facts.
47
+ */
48
+ rulingsFingerprint?: string | null;
49
+ }
50
+ /**
51
+ * Whether a standing park is RELEASED -- the delivery may be judged and sent to
52
+ * coding again. Released when:
53
+ * - a KNOWN current commit set differs from the park's known set (someone
54
+ * committed new delivery work since the park); or
55
+ * - a non-empty current rulings fingerprint differs from the park's (a ruling
56
+ * was recorded since the park; verify/shortfall-rulings.ts re-arms verify on
57
+ * it at an unchanged focus HEAD).
58
+ * An unreadable current set, or a park recorded without one, releases nothing by
59
+ * commit set: a read failure must not respawn a parked loop. Pure.
60
+ */
61
+ export declare function isShortfallParkReleased(park: ShortfallPark, current: ShortfallParkReleaseFacts): boolean;
62
+ /** The outcome of classifying one shortfall judgement. */
63
+ export interface ShortfallParkClassification {
64
+ /** The repeat record to persist (live on the written gate), carrying the commit set when known. */
65
+ repeat: ShortfallRepeatRecord;
66
+ /** True when the delivery is (or stays) parked: do NOT send it back to coding. */
67
+ parked: boolean;
68
+ /** The park record to carry when parked (the original parkedAt kept on a re-hold); null otherwise. */
69
+ park: ShortfallPark | null;
70
+ }
71
+ /**
72
+ * Classify this judgement's shortfall set against the delivery's prior gate_state
73
+ * and the commit set it was judged on (see the module header for the count rule).
74
+ *
75
+ * A standing, unreleased park for the SAME signature keeps the delivery parked
76
+ * even when the live repeat record was displaced by another writer: the count
77
+ * continues from the larger of the two, and the park keeps its original parkedAt.
78
+ * The count keeps climbing on every re-hold (it reports how many identical
79
+ * judgements the park has absorbed; it is never used as a cap). When the current
80
+ * set is unknown, the last KNOWN set is carried forward, so the next readable
81
+ * judgement still compares against real history.
82
+ *
83
+ * OPERATOR RULINGS (verify/shortfall-rulings.ts) are applied before this runs: a
84
+ * ruled node is no longer in `shortfalls`. `rulingsFingerprint` is the fingerprint
85
+ * of the rulings that judgement applied (null when they could not be read). Two
86
+ * rules follow:
87
+ * - the park records it (null keeps the standing park's), so a park re-held by
88
+ * the judgement a ruling re-armed is no longer released by that ruling -- the
89
+ * re-judgement happens once per new ruling, not on every tick;
90
+ * - a NEW ruling that disposed of SOME of the parked nodes on an unchanged
91
+ * commit set narrows the park to the rest instead of ending it: those nodes
92
+ * already repeated unchanged, so sending them back to coding would restart the
93
+ * loop the park stopped. The narrowed park keeps its parkedAt; its changed
94
+ * signature files its own escalation naming the nodes still held.
95
+ * A ruling that disposes of every node leaves no shortfall to classify: the
96
+ * verify passes and the pass reset drops the park.
97
+ *
98
+ * Pure -- the caller supplies the prior gate_state (read once), the current commit
99
+ * fingerprint (or null), `now` for a first park's parkedAt, and the applied
100
+ * rulings fingerprint (or null).
101
+ */
102
+ export declare function classifyShortfallPark(priorGateState: DeliveryGateState | null | undefined, shortfalls: readonly TargetShortfall[], commitSet: string | null, limit?: number, now?: string, rulingsFingerprint?: string | null): ShortfallParkClassification;
103
+ /**
104
+ * `gateState` with its shortfall park REPLACED: set to `park`, or removed when
105
+ * null (a shortfall routed back to re-work is not parked). The rest of the
106
+ * history is untouched; an emptied history key is dropped. Pure.
107
+ */
108
+ export declare function withShortfallPark(gateState: DeliveryGateState, park: ShortfallPark | null): DeliveryGateState;
109
+ //# sourceMappingURL=shortfall-park.d.ts.map