@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 @@
1
+ {"version":3,"file":"shortfall-park.d.ts","sourceRoot":"","sources":["../../src/verify/shortfall-park.ts"],"names":[],"mappings":"AAuDA,OAAO,EAEL,KAAK,iBAAiB,EACtB,KAAK,aAAa,EAClB,KAAK,qBAAqB,EAE3B,MAAM,mCAAmC,CAAC;AAO3C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAK/D,OAAO,EAAE,2BAA2B,EAAE,MAAM,uBAAuB,CAAC;AACpE,YAAY,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAEvE;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,CAInE;AAED,4GAA4G;AAC5G,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,OAAO,GAAG,aAAa,GAAG,IAAI,CAE1E;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,2BAA2B,CAAC,QAAQ,EAAE;IAAE,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,SAAS,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,aAAa,GAAG,IAAI,CAEpI;AAED,mEAAmE;AACnE,MAAM,WAAW,yBAAyB;IACxC,qFAAqF;IACrF,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB;;;OAGG;IACH,kBAAkB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACpC;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,aAAa,EAAE,OAAO,EAAE,yBAAyB,GAAG,OAAO,CAIxG;AAED,0DAA0D;AAC1D,MAAM,WAAW,2BAA2B;IAC1C,mGAAmG;IACnG,MAAM,EAAE,qBAAqB,CAAC;IAC9B,kFAAkF;IAClF,MAAM,EAAE,OAAO,CAAC;IAChB,sGAAsG;IACtG,IAAI,EAAE,aAAa,GAAG,IAAI,CAAC;CAC5B;AAkBD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAAgB,qBAAqB,CACnC,cAAc,EAAE,iBAAiB,GAAG,IAAI,GAAG,SAAS,EACpD,UAAU,EAAE,SAAS,eAAe,EAAE,EACtC,SAAS,EAAE,MAAM,GAAG,IAAI,EACxB,KAAK,GAAE,MAAoC,EAC3C,GAAG,GAAE,MAAiC,EACtC,kBAAkB,GAAE,MAAM,GAAG,IAAW,GACvC,2BAA2B,CAiC7B;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,iBAAiB,EAAE,IAAI,EAAE,aAAa,GAAG,IAAI,GAAG,iBAAiB,CAO7G"}
@@ -0,0 +1,208 @@
1
+ // PINNED-BY-BEGIN (generated by gen:pinned-by -- do not hand-edit; checked by lint:pinned-by)
2
+ // Pinned by: packages/daemon/src/completion/review-approved-head-gate.test.ts,
3
+ // packages/daemon/src/completion/review-exit-shortfall-park.test.ts,
4
+ // packages/daemon/src/completion/standing-approval-convergence.test.ts,
5
+ // packages/daemon/src/focus/parked-shortfall-spawn.test.ts,
6
+ // packages/daemon/src/focus/verify-routing-passes.test.ts,
7
+ // packages/daemon/src/integration/shortfall-park-incident-regression.test.ts,
8
+ // packages/daemon/src/integration/shortfall-ruling-disposes-proposals-regression.test.ts,
9
+ // packages/daemon/src/integration/shortfall-ruling-release.test.ts,
10
+ // packages/daemon/src/prompt/prompt-listing.test.ts,
11
+ // packages/daemon/src/spawn/review-hold-park-shortfall.test.ts,
12
+ // packages/daemon/src/verify/delivery-commit-set.test.ts,
13
+ // packages/daemon/src/verify/shortfall-park-escalation.test.ts,
14
+ // packages/daemon/src/verify/shortfall-park.test.ts, packages/daemon/src/verify/shortfall-routing.test.ts,
15
+ // packages/daemon/src/verify/shortfall-rulings.test.ts
16
+ // PINNED-BY-END
17
+ /**
18
+ * The SHORTFALL PARK: a delivery whose identical verify shortfall re-holds on an
19
+ * UNCHANGED delivery-trailered commit set is parked, not sent back to coding.
20
+ *
21
+ * Why (reality tree injection #13): the repetition discriminator
22
+ * (verify/shortfall-repeat.ts) counted identical shortfalls, but its at-limit
23
+ * outcome was a live gate_state hold nothing else honoured -- the review exit
24
+ * rewrote the gate and routed verify_failed, a coding team respawned with nothing
25
+ * truthful to commit, stamped the work done, and fed the next identical verdict.
26
+ * One delivery reached iterationCount 23 and stopped only when an operator
27
+ * disarmed the focus. Re-judging the SAME commits cannot change the verdict, so
28
+ * once the identical judgement has stood SHORTFALL_PARK_REPEAT_LIMIT times on an
29
+ * unchanged commit set the delivery is parked: a DURABLE record in the
30
+ * verification history (queries/shortfall-park-record.ts) that every carrying
31
+ * gate_state writer keeps and only a verify pass drops. Readers that must refuse
32
+ * to send a parked delivery to coding read it through readShortfallPark and
33
+ * isShortfallParkReleased.
34
+ *
35
+ * The count is keyed on (signature, commit set):
36
+ * - identical signature AND unchanged commit set -> the count climbs;
37
+ * - a CHANGED commit set -> the team produced new work; it restarts at 1 and is
38
+ * judged fresh (a producing team is never cut short);
39
+ * - a changed signature (a different node or declared claim; a reworded,
40
+ * model-authored reason is NOT a change -- see shortfallSignature) ->
41
+ * restarts at 1 (a genuine, moving shortfall);
42
+ * - an UNKNOWN commit set (the read failed, or a legacy record carries none) ->
43
+ * exactly the signature-only count that predates the park. A read failure
44
+ * therefore never resets a real loop, and never manufactures a park either:
45
+ * a park still needs the limit's worth of identical judgements.
46
+ *
47
+ * SELF-CONTAINED and mock-safe like shortfall-repeat.ts: node:crypto plus the
48
+ * gate-state vocabulary, NO daemon-core value import. Pure and deterministic.
49
+ *
50
+ * @module verify/shortfall-park
51
+ */
52
+ import { createHash } from 'node:crypto';
53
+ import { readVerificationHistory, } from '../queries/delivery-gate-state.js';
54
+ import { readPriorRepeat, sameShortfallSignature, shortfallSignature, SHORTFALL_PARK_REPEAT_LIMIT, } from './shortfall-repeat.js';
55
+ /** The delivery status a park refuses re-work in. Daemon-local literal (mock-safe: no daemon-core value import). */
56
+ const VERIFY_STATUS = 'verify';
57
+ export { SHORTFALL_PARK_REPEAT_LIMIT } from './shortfall-repeat.js';
58
+ /**
59
+ * Order-independent fingerprint of a delivery's commit set. The input is the set
60
+ * of commit IDENTITIES the resolver read (verify/delivery-commit-set.ts: patch ids,
61
+ * so a rebase that re-shas unchanged commits is not "new work"); trimmed,
62
+ * lowercased, deduped and sorted before hashing, so the same set in any order or
63
+ * with repeats fingerprints identically. The empty set has a fingerprint too: a
64
+ * delivery with no commits of its own is a known, unchanging set. Pure.
65
+ */
66
+ export function commitSetFingerprint(ids) {
67
+ const unique = [...new Set(ids.map((id) => id.trim().toLowerCase()).filter((id) => id !== ''))].sort();
68
+ const digest = createHash('sha256').update(unique.join('\n')).digest('hex');
69
+ return `${unique.length}:${digest}`;
70
+ }
71
+ /** The standing park a gate_state carries, or null (none, malformed, or a verify pass dropped it). Pure. */
72
+ export function readShortfallPark(gateState) {
73
+ return readVerificationHistory(gateState).shortfallPark ?? null;
74
+ }
75
+ /**
76
+ * The park that makes a delivery NON-REWORKABLE: a standing park on a delivery
77
+ * that sits in verify, or null. The ONE predicate every daemon writer and spawn
78
+ * gate reads before sending a verify delivery back to coding (the review exit's
79
+ * verify_failed route, the live open-issues pass, the review-next-step decision,
80
+ * the review park), so none of them can disagree about a parked delivery.
81
+ *
82
+ * The park is AUTHORITATIVE in those readers: they neither release nor replace
83
+ * it. VERIFY is its single releaser -- a verify re-judgement on a changed
84
+ * delivery commit set (a new focus HEAD re-arms every delivery in verify) routes
85
+ * the delivery to re-work and drops the park (routeShortfallOutcome ->
86
+ * withShortfallPark(..., null)); a pass drops it (clearVerificationHistory); an
87
+ * operator ruling releases it through isShortfallParkReleased, which re-arms that
88
+ * re-judgement at an unchanged focus HEAD (verify/shortfall-rulings.ts). A reader that cannot know the current commit set therefore holds.
89
+ *
90
+ * Only a delivery IN VERIFY is refused: a park carried onto another status (the
91
+ * Nexus hand-back of a declined request moves a verify delivery to re-plan on a
92
+ * new external fact, once) is not a verify re-judgement loop, and the park still
93
+ * re-holds at its first unchanged re-judgement. Literal 'verify' (mock-safe). Pure.
94
+ */
95
+ export function shortfallParkRefusingRework(delivery) {
96
+ return delivery.executionStatus === VERIFY_STATUS ? readShortfallPark(delivery.gateState) : null;
97
+ }
98
+ /**
99
+ * Whether a standing park is RELEASED -- the delivery may be judged and sent to
100
+ * coding again. Released when:
101
+ * - a KNOWN current commit set differs from the park's known set (someone
102
+ * committed new delivery work since the park); or
103
+ * - a non-empty current rulings fingerprint differs from the park's (a ruling
104
+ * was recorded since the park; verify/shortfall-rulings.ts re-arms verify on
105
+ * it at an unchanged focus HEAD).
106
+ * An unreadable current set, or a park recorded without one, releases nothing by
107
+ * commit set: a read failure must not respawn a parked loop. Pure.
108
+ */
109
+ export function isShortfallParkReleased(park, current) {
110
+ if (current.commitSet !== null && park.commitSet !== null && current.commitSet !== park.commitSet)
111
+ return true;
112
+ const rulings = current.rulingsFingerprint;
113
+ return typeof rulings === 'string' && rulings !== '' && rulings !== (park.rulingsFingerprint ?? '');
114
+ }
115
+ function sortedNodeIds(shortfalls) {
116
+ return [...new Set(shortfalls.map((s) => s.nodeId))].sort();
117
+ }
118
+ /**
119
+ * Whether a NEW ruling (a non-empty fingerprint the park has not applied) left a
120
+ * strict, non-empty subset of the park's nodes short (see classifyShortfallPark).
121
+ * Node ids compare case-insensitively (the edge stores ruled ids lowercased). Pure.
122
+ */
123
+ function narrowedByRuling(standing, shortfalls, rulingsFingerprint) {
124
+ if (rulingsFingerprint === null || !isShortfallParkReleased(standing, { commitSet: null, rulingsFingerprint }))
125
+ return false;
126
+ const parked = new Set(standing.nodeIds.map((id) => id.toLowerCase()));
127
+ const remaining = new Set(shortfalls.map((s) => s.nodeId.toLowerCase()));
128
+ return remaining.size > 0 && remaining.size < parked.size && [...remaining].every((id) => parked.has(id));
129
+ }
130
+ /**
131
+ * Classify this judgement's shortfall set against the delivery's prior gate_state
132
+ * and the commit set it was judged on (see the module header for the count rule).
133
+ *
134
+ * A standing, unreleased park for the SAME signature keeps the delivery parked
135
+ * even when the live repeat record was displaced by another writer: the count
136
+ * continues from the larger of the two, and the park keeps its original parkedAt.
137
+ * The count keeps climbing on every re-hold (it reports how many identical
138
+ * judgements the park has absorbed; it is never used as a cap). When the current
139
+ * set is unknown, the last KNOWN set is carried forward, so the next readable
140
+ * judgement still compares against real history.
141
+ *
142
+ * OPERATOR RULINGS (verify/shortfall-rulings.ts) are applied before this runs: a
143
+ * ruled node is no longer in `shortfalls`. `rulingsFingerprint` is the fingerprint
144
+ * of the rulings that judgement applied (null when they could not be read). Two
145
+ * rules follow:
146
+ * - the park records it (null keeps the standing park's), so a park re-held by
147
+ * the judgement a ruling re-armed is no longer released by that ruling -- the
148
+ * re-judgement happens once per new ruling, not on every tick;
149
+ * - a NEW ruling that disposed of SOME of the parked nodes on an unchanged
150
+ * commit set narrows the park to the rest instead of ending it: those nodes
151
+ * already repeated unchanged, so sending them back to coding would restart the
152
+ * loop the park stopped. The narrowed park keeps its parkedAt; its changed
153
+ * signature files its own escalation naming the nodes still held.
154
+ * A ruling that disposes of every node leaves no shortfall to classify: the
155
+ * verify passes and the pass reset drops the park.
156
+ *
157
+ * Pure -- the caller supplies the prior gate_state (read once), the current commit
158
+ * fingerprint (or null), `now` for a first park's parkedAt, and the applied
159
+ * rulings fingerprint (or null).
160
+ */
161
+ export function classifyShortfallPark(priorGateState, shortfalls, commitSet, limit = SHORTFALL_PARK_REPEAT_LIMIT, now = new Date().toISOString(), rulingsFingerprint = null) {
162
+ const signature = shortfallSignature(shortfalls);
163
+ const prior = readPriorRepeat(priorGateState);
164
+ const priorSet = prior?.commitSet ?? null;
165
+ // New work is only ever evidenced by two KNOWN, differing sets.
166
+ const setChanged = commitSet !== null && priorSet !== null && commitSet !== priorSet;
167
+ const continues = prior !== null && sameShortfallSignature(prior.signature, signature) && !setChanged;
168
+ let count = continues ? prior.count + 1 : 1;
169
+ let knownSet = commitSet ?? (continues ? priorSet : null);
170
+ const standing = readShortfallPark(priorGateState);
171
+ const sameAsStanding = standing !== null && sameShortfallSignature(standing.signature, signature);
172
+ const holding = standing !== null && !setChanged && !isShortfallParkReleased(standing, { commitSet })
173
+ && (sameAsStanding || narrowedByRuling(standing, shortfalls, rulingsFingerprint));
174
+ if (holding) {
175
+ count = Math.max(count, standing.count + 1);
176
+ knownSet = knownSet ?? standing.commitSet;
177
+ }
178
+ const repeat = { signature, count, ...(knownSet !== null ? { commitSet: knownSet } : {}) };
179
+ if (count < limit)
180
+ return { repeat, parked: false, park: null };
181
+ const applied = rulingsFingerprint ?? (holding ? standing.rulingsFingerprint : undefined);
182
+ const park = {
183
+ // A re-hold of the same shortfall keeps the standing park's signature text, so
184
+ // a park persisted in a legacy signature form keeps its escalation cause key.
185
+ signature: holding && sameAsStanding ? standing.signature : signature,
186
+ commitSet: knownSet,
187
+ nodeIds: sortedNodeIds(shortfalls),
188
+ count,
189
+ parkedAt: holding ? standing.parkedAt : now,
190
+ ...(applied ? { rulingsFingerprint: applied } : {}),
191
+ };
192
+ return { repeat, parked: true, park };
193
+ }
194
+ /**
195
+ * `gateState` with its shortfall park REPLACED: set to `park`, or removed when
196
+ * null (a shortfall routed back to re-work is not parked). The rest of the
197
+ * history is untouched; an emptied history key is dropped. Pure.
198
+ */
199
+ export function withShortfallPark(gateState, park) {
200
+ const history = { ...(gateState.verificationHistory ?? {}) };
201
+ delete history.shortfallPark;
202
+ if (park)
203
+ history.shortfallPark = park;
204
+ const next = { ...gateState };
205
+ delete next.verificationHistory;
206
+ return Object.keys(history).length > 0 ? { ...next, verificationHistory: history } : next;
207
+ }
208
+ //# sourceMappingURL=shortfall-park.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shortfall-park.js","sourceRoot":"","sources":["../../src/verify/shortfall-park.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,+EAA+E;AAC/E,uEAAuE;AACvE,0EAA0E;AAC1E,8DAA8D;AAC9D,6DAA6D;AAC7D,gFAAgF;AAChF,4FAA4F;AAC5F,sEAAsE;AACtE,uDAAuD;AACvD,kEAAkE;AAClE,4DAA4D;AAC5D,kEAAkE;AAClE,6GAA6G;AAC7G,yDAAyD;AACzD,gBAAgB;AAEhB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,OAAO,EACL,uBAAuB,GAKxB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EACL,eAAe,EACf,sBAAsB,EACtB,kBAAkB,EAClB,2BAA2B,GAC5B,MAAM,uBAAuB,CAAC;AAG/B,oHAAoH;AACpH,MAAM,aAAa,GAAG,QAAQ,CAAC;AAE/B,OAAO,EAAE,2BAA2B,EAAE,MAAM,uBAAuB,CAAC;AAGpE;;;;;;;GAOG;AACH,MAAM,UAAU,oBAAoB,CAAC,GAAsB;IACzD,MAAM,MAAM,GAAG,CAAC,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;IACvG,MAAM,MAAM,G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C,CAAC,QAAQ,CAAC,kBAAkB,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;IAC1F,MAAM,IAAI,GAAkB;QAC1B,+EAA+E;QAC/E,8EAA8E;QAC9E,SAAS,EAAE,OAAO,IAAI,cAAc,CAAC,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS;QACrE,SAAS,EAAE,QAAQ;QACnB,OAAO,EAAE,aAAa,CAAC,UAAU,CAAC;QAClC,KAAK;QACL,QAAQ,EAAE,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG;QAC3C,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,kBAAkB,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KACpD,CAAC;IACF,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;AACxC,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,iBAAiB,CAAC,SAA4B,EAAE,IAA0B;IACxF,MAAM,OAAO,GAAwB,EAAE,GAAG,CAAC,SAAS,CAAC,mBAAmB,IAAI,EAAE,CAAC,EAAE,CAAC;IAClF,OAAO,OAAO,CAAC,aAAa,CAAC;IAC7B,IAAI,IAAI;QAAE,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC;IACvC,MAAM,IAAI,GAAsB,EAAE,GAAG,SAAS,EAAE,CAAC;IACjD,OAAO,IAAI,CAAC,mBAAmB,CAAC;IAChC,OAAO,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,IAAI,EAAE,mBAAmB,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;AAC5F,CAAC"}
@@ -33,39 +33,70 @@ export interface ShortfallRepeat {
33
33
  signature: string;
34
34
  /** How many CONSECUTIVE iterations this exact signature has stood. >= 1. */
35
35
  count: number;
36
+ /** Fingerprint of the delivery-trailered commit set it was judged on (verify/shortfall-park.ts); absent when unread or legacy. */
37
+ commitSet?: string;
36
38
  }
37
39
  /**
38
- * How many consecutive identical shortfall iterations mark a claim as unclearable.
40
+ * How many consecutive identical shortfall judgements PARK a delivery -- the
41
+ * stated limit of the shortfall park (verify/shortfall-park.ts), re-exported
42
+ * there. One constant: the park REPLACES the old unclearable-claim hold as the
43
+ * at-limit outcome, so the two can never disagree.
39
44
  *
40
45
  * JUDGMENT CALL (recorded here rather than defaulted silently): too LOW and a team
41
46
  * legitimately re-attempting the same area gets cut off before it can respond; too
42
- * HIGH and the loop stays expensive. The Tinker Tailor case ran to iteration 10
43
- * and the Telora case to 6, so the current iteration cap is far too high to catch
44
- * this early. 3 identical occurrences -- i.e. the shortfall survived TWO re-work
47
+ * HIGH and the loop stays expensive. The Tinker Tailor case ran to iteration 10,
48
+ * the Telora case to 6, and the 2026-09 incident this park answers ran to
49
+ * iterationCount 23 -- a coding team respawned each time with nothing truthful to
50
+ * commit. 3 identical occurrences -- i.e. the shortfall survived TWO re-work
45
51
  * responses unchanged -- is strong evidence the diff cannot move it, while still
46
- * giving a responding team two full cycles to change something. Reversible: it is
47
- * a single constant, tunable later, and overridable per-call for tests. Kept a
52
+ * giving a responding team two full cycles to change something. And the park
53
+ * counts only on an UNCHANGED delivery commit set: a team that commits new work
54
+ * restarts the count, so the limit never cuts short a team that is still
55
+ * producing. Reversible: a single constant, overridable per-call for tests. Kept a
48
56
  * daemon-local constant (not a TELORA_* env var) deliberately -- adding an env var
49
57
  * would require a daemon-core publish; promote it there only if operators need to
50
58
  * tune it live.
51
59
  */
60
+ export declare const SHORTFALL_PARK_REPEAT_LIMIT = 3;
61
+ /** The former name of SHORTFALL_PARK_REPEAT_LIMIT, kept for existing importers. */
52
62
  export declare const UNCLEARABLE_SHORTFALL_REPEAT_THRESHOLD = 3;
53
63
  /**
54
64
  * Compute a stable, order-independent signature of a shortfall set.
55
65
  *
56
- * Keyed on (nodeId, declaredStatement, reason) per targeted node, sorted by
57
- * nodeId -- the fields that define "the same shortfall". DELIBERATELY EXCLUDES:
58
- * - achievedStatement: the authored-from-evidence side can vary in wording
59
- * across iterations while the underlying gap is identical;
66
+ * Keyed on (nodeId, declaredStatement) per targeted node -- the fields that
67
+ * define "the same gap" -- deduped and sorted. Both are STABLE across verify
68
+ * passes: nodeId is the tree node, and declaredStatement is read off that node
69
+ * (its preserved frt_statement, else its UDE statement: verify/verify-restatement.ts),
70
+ * so it changes only when someone edits the tree -- a genuine change of claim.
71
+ * DELIBERATELY EXCLUDES every MODEL-AUTHORED field, which the reconciler writes
72
+ * afresh on each pass:
73
+ * - reason: the divergence explanation. Kept on the shortfall as display detail
74
+ * only. When it was part of the key, an identical gap whose reason was merely
75
+ * reworded on a later pass reset the count to 1, so a park never came (or a
76
+ * standing park was dropped) and the coding loop resumed (injection #13, root
77
+ * cause #15);
78
+ * - achievedStatement: the authored-from-evidence side, reworded the same way;
60
79
  * - diffCitation: cites the specific changed hunk, which churns every time the
61
- * team edits ANYTHING, so including it would make an unclearable shortfall
62
- * look "changed" and defeat the discriminator.
63
- * So a team that genuinely changed its approach (different node targeted, or a
64
- * different reason the gap stands) produces a different signature and keeps
65
- * routing as ordinary re-work; a team stuck against an impossible claim produces
66
- * the same signature every time.
80
+ * team edits ANYTHING.
81
+ * So a genuinely different gap (a different node, or a different declared claim)
82
+ * produces a different signature and keeps routing as ordinary re-work; a team
83
+ * stuck against an impossible claim produces the same signature every time,
84
+ * however the model phrases it. A team that produces new work is still judged
85
+ * fresh: the park also keys on the delivery commit set (verify/shortfall-park.ts).
67
86
  */
68
87
  export declare function shortfallSignature(shortfalls: readonly TargetShortfall[]): string;
88
+ /**
89
+ * A persisted signature in the CURRENT canonical form, for comparison. A record
90
+ * written before the reason was dropped from the key (a JSON array of
91
+ * {nodeId, declared, reason}) re-keys to the form shortfallSignature produces
92
+ * now, so a repeat count or standing park persisted before this change continues
93
+ * instead of resetting once on deploy (which would release a standing park back
94
+ * to coding). A current-form signature is returned unchanged; anything
95
+ * unparseable is returned as-is and so matches only itself. Pure.
96
+ */
97
+ export declare function normalizeShortfallSignature(signature: string): string;
98
+ /** Whether two persisted signatures name the same shortfall set (legacy forms normalized). Pure. */
99
+ export declare function sameShortfallSignature(a: string, b: string): boolean;
69
100
  /**
70
101
  * Read the repeat state the previous shortfall iteration left on a delivery's
71
102
  * gate_state. It is either LIVE (`shortfallReconciliation.repeat`, the gate is
@@ -1 +1 @@
1
- {"version":3,"file":"shortfall-repeat.d.ts","sourceRoot":"","sources":["../../src/verify/shortfall-repeat.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,EAA2B,KAAK,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACpG,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE/D,yFAAyF;AACzF,MAAM,WAAW,eAAe;IAC9B,sEAAsE;IACtE,SAAS,EAAE,MAAM,CAAC;IAClB,4EAA4E;IAC5E,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,sCAAsC,IAAI,CAAC;AAMxD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,SAAS,eAAe,EAAE,GAAG,MAAM,CAKjF;AAED;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,cAAc,EAAE,iBAAiB,GAAG,IAAI,GAAG,SAAS,GAAG,eAAe,GAAG,IAAI,CAE5G;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,uBAAuB,CACrC,cAAc,EAAE,iBAAiB,GAAG,IAAI,GAAG,SAAS,EACpD,UAAU,EAAE,SAAS,eAAe,EAAE,EACtC,SAAS,GAAE,MAA+C,GACzD;IAAE,MAAM,EAAE,eAAe,CAAC;IAAC,WAAW,EAAE,OAAO,CAAA;CAAE,CAKnD"}
1
+ {"version":3,"file":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1
  // PINNED-BY-BEGIN (generated by gen:pinned-by -- do not hand-edit; checked by lint:pinned-by)
2
2
  // Pinned by: packages/daemon/src/integration/verification-history-round-trip.test.ts,
3
+ // packages/daemon/src/verify/misattributed-hold.test.ts, packages/daemon/src/verify/shortfall-park.test.ts,
3
4
  // packages/daemon/src/verify/shortfall-repeat.test.ts, packages/daemon/src/verify/shortfall-routing.test.ts
4
5
  // PINNED-BY-END
5
6
  /**
@@ -31,44 +32,97 @@
31
32
  */
32
33
  import { readVerificationHistory } from '../queries/delivery-gate-state.js';
33
34
  /**
34
- * How many consecutive identical shortfall iterations mark a claim as unclearable.
35
+ * How many consecutive identical shortfall judgements PARK a delivery -- the
36
+ * stated limit of the shortfall park (verify/shortfall-park.ts), re-exported
37
+ * there. One constant: the park REPLACES the old unclearable-claim hold as the
38
+ * at-limit outcome, so the two can never disagree.
35
39
  *
36
40
  * JUDGMENT CALL (recorded here rather than defaulted silently): too LOW and a team
37
41
  * legitimately re-attempting the same area gets cut off before it can respond; too
38
- * HIGH and the loop stays expensive. The Tinker Tailor case ran to iteration 10
39
- * and the Telora case to 6, so the current iteration cap is far too high to catch
40
- * this early. 3 identical occurrences -- i.e. the shortfall survived TWO re-work
42
+ * HIGH and the loop stays expensive. The Tinker Tailor case ran to iteration 10,
43
+ * the Telora case to 6, and the 2026-09 incident this park answers ran to
44
+ * iterationCount 23 -- a coding team respawned each time with nothing truthful to
45
+ * commit. 3 identical occurrences -- i.e. the shortfall survived TWO re-work
41
46
  * responses unchanged -- is strong evidence the diff cannot move it, while still
42
- * giving a responding team two full cycles to change something. Reversible: it is
43
- * a single constant, tunable later, and overridable per-call for tests. Kept a
47
+ * giving a responding team two full cycles to change something. And the park
48
+ * counts only on an UNCHANGED delivery commit set: a team that commits new work
49
+ * restarts the count, so the limit never cuts short a team that is still
50
+ * producing. Reversible: a single constant, overridable per-call for tests. Kept a
44
51
  * daemon-local constant (not a TELORA_* env var) deliberately -- adding an env var
45
52
  * would require a daemon-core publish; promote it there only if operators need to
46
53
  * tune it live.
47
54
  */
48
- export const UNCLEARABLE_SHORTFALL_REPEAT_THRESHOLD = 3;
55
+ export const SHORTFALL_PARK_REPEAT_LIMIT = 3;
56
+ /** The former name of SHORTFALL_PARK_REPEAT_LIMIT, kept for existing importers. */
57
+ export const UNCLEARABLE_SHORTFALL_REPEAT_THRESHOLD = SHORTFALL_PARK_REPEAT_LIMIT;
49
58
  function byId(a, b) {
50
59
  return a < b ? -1 : a > b ? 1 : 0;
51
60
  }
61
+ function canonicalSignature(identities) {
62
+ const unique = new Map();
63
+ for (const i of identities)
64
+ unique.set(JSON.stringify([i.nodeId, i.declared]), { nodeId: i.nodeId, declared: i.declared });
65
+ const key = [...unique.values()].sort((a, b) => byId(a.nodeId, b.nodeId) || byId(a.declared, b.declared));
66
+ return JSON.stringify(key);
67
+ }
52
68
  /**
53
69
  * Compute a stable, order-independent signature of a shortfall set.
54
70
  *
55
- * Keyed on (nodeId, declaredStatement, reason) per targeted node, sorted by
56
- * nodeId -- the fields that define "the same shortfall". DELIBERATELY EXCLUDES:
57
- * - achievedStatement: the authored-from-evidence side can vary in wording
58
- * across iterations while the underlying gap is identical;
71
+ * Keyed on (nodeId, declaredStatement) per targeted node -- the fields that
72
+ * define "the same gap" -- deduped and sorted. Both are STABLE across verify
73
+ * passes: nodeId is the tree node, and declaredStatement is read off that node
74
+ * (its preserved frt_statement, else its UDE statement: verify/verify-restatement.ts),
75
+ * so it changes only when someone edits the tree -- a genuine change of claim.
76
+ * DELIBERATELY EXCLUDES every MODEL-AUTHORED field, which the reconciler writes
77
+ * afresh on each pass:
78
+ * - reason: the divergence explanation. Kept on the shortfall as display detail
79
+ * only. When it was part of the key, an identical gap whose reason was merely
80
+ * reworded on a later pass reset the count to 1, so a park never came (or a
81
+ * standing park was dropped) and the coding loop resumed (injection #13, root
82
+ * cause #15);
83
+ * - achievedStatement: the authored-from-evidence side, reworded the same way;
59
84
  * - diffCitation: cites the specific changed hunk, which churns every time the
60
- * team edits ANYTHING, so including it would make an unclearable shortfall
61
- * look "changed" and defeat the discriminator.
62
- * So a team that genuinely changed its approach (different node targeted, or a
63
- * different reason the gap stands) produces a different signature and keeps
64
- * routing as ordinary re-work; a team stuck against an impossible claim produces
65
- * the same signature every time.
85
+ * team edits ANYTHING.
86
+ * So a genuinely different gap (a different node, or a different declared claim)
87
+ * produces a different signature and keeps routing as ordinary re-work; a team
88
+ * stuck against an impossible claim produces the same signature every time,
89
+ * however the model phrases it. A team that produces new work is still judged
90
+ * fresh: the park also keys on the delivery commit set (verify/shortfall-park.ts).
66
91
  */
67
92
  export function shortfallSignature(shortfalls) {
68
- const key = [...shortfalls]
69
- .map((s) => ({ nodeId: s.nodeId, declared: s.declaredStatement, reason: s.reason }))
70
- .sort((a, b) => byId(a.nodeId, b.nodeId));
71
- return JSON.stringify(key);
93
+ return canonicalSignature(shortfalls.map((s) => ({ nodeId: s.nodeId, declared: s.declaredStatement })));
94
+ }
95
+ /**
96
+ * A persisted signature in the CURRENT canonical form, for comparison. A record
97
+ * written before the reason was dropped from the key (a JSON array of
98
+ * {nodeId, declared, reason}) re-keys to the form shortfallSignature produces
99
+ * now, so a repeat count or standing park persisted before this change continues
100
+ * instead of resetting once on deploy (which would release a standing park back
101
+ * to coding). A current-form signature is returned unchanged; anything
102
+ * unparseable is returned as-is and so matches only itself. Pure.
103
+ */
104
+ export function normalizeShortfallSignature(signature) {
105
+ let parsed;
106
+ try {
107
+ parsed = JSON.parse(signature);
108
+ }
109
+ catch {
110
+ return signature;
111
+ }
112
+ if (!Array.isArray(parsed))
113
+ return signature;
114
+ const identities = [];
115
+ for (const entry of parsed) {
116
+ const e = entry;
117
+ if (!e || typeof e.nodeId !== 'string' || typeof e.declared !== 'string')
118
+ return signature;
119
+ identities.push({ nodeId: e.nodeId, declared: e.declared });
120
+ }
121
+ return canonicalSignature(identities);
122
+ }
123
+ /** Whether two persisted signatures name the same shortfall set (legacy forms normalized). Pure. */
124
+ export function sameShortfallSignature(a, b) {
125
+ return a === b || normalizeShortfallSignature(a) === normalizeShortfallSignature(b);
72
126
  }
73
127
  /**
74
128
  * Read the repeat state the previous shortfall iteration left on a delivery's
@@ -94,10 +148,10 @@ export function readPriorRepeat(priorGateState) {
94
148
  * returned `repeat` back into the new gate_state so the next iteration compares
95
149
  * against it.
96
150
  */
97
- export function classifyShortfallRepeat(priorGateState, shortfalls, threshold = UNCLEARABLE_SHORTFALL_REPEAT_THRESHOLD) {
151
+ export function classifyShortfallRepeat(priorGateState, shortfalls, threshold = SHORTFALL_PARK_REPEAT_LIMIT) {
98
152
  const signature = shortfallSignature(shortfalls);
99
153
  const prior = readPriorRepeat(priorGateState);
100
- const count = prior && prior.signature === signature ? prior.count + 1 : 1;
154
+ const count = prior && sameShortfallSignature(prior.signature, signature) ? prior.count + 1 : 1;
101
155
  return { repeat: { signature, count }, unclearable: count >= threshold };
102
156
  }
103
157
  //# sourceMappingURL=shortfall-repeat.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"shortfall-repeat.js","sourceRoot":"","sources":["../../src/verify/shortfall-repeat.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,sFAAsF;AACtF,8GAA8G;AAC9G,gBAAgB;AAEhB;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,EAAE,uBAAuB,EAA0B,MAAM,mCAAmC,CAAC;AAWpG;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,MAAM,sCAAsC,GAAG,CAAC,CAAC;AAExD,SAAS,IAAI,CAAC,CAAS,EAAE,CAAS;IAChC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACpC,CAAC;AAED;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,kBAAkB,CAAC,UAAsC;IACvE,MAAM,GAAG,GAAG,CAAC,GAAG,UAAU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rC,cAAoD,EACpD,UAAsC,EACtC,YAAoB,2BAA2B;IAE/C,MAAM,SAAS,GAAG,kBAAkB,CAAC,UAAU,CAAC,CAAC;IACjD,MAAM,KAAK,GAAG,eAAe,CAAC,cAAc,CAAC,CAAC;IAC9C,MAAM,KAAK,GAAG,KAAK,IAAI,sBAAsB,CAAC,KAAK,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAChG,OAAO,EAAE,MAAM,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,WAAW,EAAE,KAAK,IAAI,SAAS,EAAE,CAAC;AAC3E,CAAC"}
@@ -0,0 +1,106 @@
1
+ /**
2
+ * Verify honors OPERATOR SHORTFALL RULINGS: a node an operator ruled MET or
3
+ * EXCUSED on a delivery (queries/shortfall-rulings.ts) no longer holds its verify
4
+ * gate, and a ruling recorded since a shortfall park is a change verify re-judges.
5
+ *
6
+ * Why: before rulings were read, an operator's "these nodes are met, re-verify"
7
+ * lived only in an escalation's resolution notes. The next verify pass re-judged
8
+ * the same nodes short and re-held the delivery, and a delivery parked for a
9
+ * repeating shortfall (verify/shortfall-park.ts) stayed parked: nothing but a new
10
+ * commit re-armed its verify.
11
+ *
12
+ * APPLYING rulings (applyShortfallRulings, called by the verification engine
13
+ * between the reconciliation and the shortfall routing):
14
+ * - MET: the node counts as achieved. It leaves the shortfall set and joins the
15
+ * restatements the injection flip carries, as a `match` whose statement is the
16
+ * DECLARED desired effect -- the operator ruled that intent realized, and a
17
+ * match carries the declared effect forward unchanged. The ruling's rationale
18
+ * is stamped into the injection's evidence (withRulingEvidence), the only
19
+ * place a match's reason can land (the edge persists a reason only on a
20
+ * legitimate_divergence, and a divergence would also file inward drift
21
+ * against a claim the operator just upheld).
22
+ * - EXCUSED: the node stops holding, but it was NOT achieved, so the flip must
23
+ * not promote it as reality. It is WITHHELD from the flip (withheldNodeIds):
24
+ * queries/verification.ts sends it to reality_tree_verify_injection as a
25
+ * shortfall-classified entry, which the edge skips entirely -- no node_type
26
+ * flip, no statement, no classification -- so it stays an undesired effect
27
+ * the tree can target again. The declared effect is never softened.
28
+ * - Neither files inward shortfall drift: a ruled node leaves the shortfall set
29
+ * before the engine emits it.
30
+ * - A read FAILURE fails closed: no ruling is applied, the shortfalls stand as
31
+ * judged, and the fingerprint is unknown (null), so a park re-held on it keeps
32
+ * the fingerprint it had.
33
+ * Rulings are read only when the reconciliation found a shortfall: with none,
34
+ * there is nothing to rule and no park to record a fingerprint on.
35
+ *
36
+ * RE-JUDGING a park at an unchanged focus HEAD (withShortfallRulingRearm): a
37
+ * default-on verify is not re-selected while its run mark stands for the focus
38
+ * HEAD (verify/verification-default-on.ts), and a parked delivery stays in
39
+ * verify, so with no new commit verify never re-judged it -- a ruling alone could
40
+ * not release the park. The default-on scan therefore reads its deliveries
41
+ * through a reader that, for each delivery in verify carrying a park, reads its
42
+ * rulings and, when the fingerprint releases the park (isShortfallParkReleased),
43
+ * drops the delivery's run mark, so the same scan selects it again. Once per
44
+ * (delivery, fingerprint) in this process; durably, the re-judgement records the
45
+ * fingerprint it applied on any park it re-holds, so the ruling releases nothing
46
+ * further, even after a restart. The re-judgement runs no gate: the dispatch takes
47
+ * the verdict already recorded for that commit (verify/verification-commit-sharing.ts
48
+ * readReusableVerdict), and only the reconciliation runs again -- a focus commit
49
+ * is still run through the gate at most once. A read failure re-arms nothing.
50
+ * EXPLICIT-method rows need no re-arm: a shortfall records a failed outcome, which
51
+ * the edge nulls, so daemon_get_pending_verifications lists a parked explicit row
52
+ * again every tick and its next dispatch applies the rulings.
53
+ *
54
+ * @module verify/shortfall-rulings
55
+ */
56
+ import type { getFocusDeliveries } from '../queries/focuses.js';
57
+ import type { DeliveryShortfallRulings, ShortfallRuling } from '../queries/shortfall-rulings.js';
58
+ import type { PendingVerification } from '../queries/verification.js';
59
+ import type { TargetRestatement, TargetShortfall } from './verify-restatement.js';
60
+ /** Read a delivery's active shortfall rulings (queries/shortfall-rulings.ts getDeliveryShortfallRulings). */
61
+ export type ShortfallRulingsReader = (deliveryId: string) => Promise<DeliveryShortfallRulings>;
62
+ /** A ruling that cleared one of this judgement's shortfalls. */
63
+ export type HonoredRuling = Pick<ShortfallRuling, 'nodeId' | 'verdict' | 'rationale'>;
64
+ /** A reconciliation with the delivery's rulings applied. */
65
+ export interface RuledReconciliation {
66
+ restatements: TargetRestatement[];
67
+ /** The shortfalls no ruling cleared: these still hold the gate. */
68
+ shortfalls: TargetShortfall[];
69
+ /** The fingerprint of the rulings read; null when none were read (no shortfall, no reader, or a failed read). */
70
+ rulingsFingerprint: string | null;
71
+ /** EXCUSED nodes: cleared, but withheld from the injection flip (never promoted as achieved). */
72
+ withheldNodeIds: string[];
73
+ /** Every ruling that cleared a shortfall, in shortfall order. */
74
+ honored: HonoredRuling[];
75
+ }
76
+ /**
77
+ * Apply the delivery's active rulings to this judgement's reconciliation (see the
78
+ * module header). Never throws: a failed read applies nothing.
79
+ */
80
+ export declare function applyShortfallRulings(v: Pick<PendingVerification, 'deliveryId' | 'deliveryName'>, reconciled: {
81
+ restatements: readonly TargetRestatement[];
82
+ shortfalls: readonly TargetShortfall[];
83
+ }, read: ShortfallRulingsReader | undefined): Promise<RuledReconciliation>;
84
+ /** The injection evidence with the honored rulings appended (unchanged when none were honored). Pure. */
85
+ export declare function withRulingEvidence(evidence: string, honored: readonly HonoredRuling[]): string;
86
+ /** The delivery fields the re-arm reads. */
87
+ type ParkedCandidate = Pick<Awaited<ReturnType<typeof getFocusDeliveries>>[number], 'id' | 'name' | 'executionStatus' | 'gateState' | 'verificationMethod'>;
88
+ /**
89
+ * For each delivery in verify carrying a shortfall park, drop its default-on run
90
+ * mark when its rulings release the park and it was not already re-armed on that
91
+ * fingerprint (module header). Returns the re-armed delivery ids. Never throws.
92
+ */
93
+ export declare function rearmRuledShortfallParks(deliveries: readonly ParkedCandidate[], read: ShortfallRulingsReader): Promise<string[]>;
94
+ /**
95
+ * The scan deps with a delivery reader that re-arms ruling-released parks before
96
+ * the default-on scan selects from the deliveries it returns (module header).
97
+ * Unchanged when the deps carry no rulings reader.
98
+ */
99
+ export declare function withShortfallRulingRearm<D extends {
100
+ getFocusDeliveries: typeof getFocusDeliveries;
101
+ readShortfallRulings?: ShortfallRulingsReader;
102
+ }>(deps: D): D;
103
+ /** Test seam: forget every re-arm this process made. */
104
+ export declare function __resetShortfallRulingRearmForTests(): void;
105
+ export {};
106
+ //# sourceMappingURL=shortfall-rulings.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shortfall-rulings.d.ts","sourceRoot":"","sources":["../../src/verify/shortfall-rulings.ts"],"names":[],"mappings":"AAMA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsDG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,KAAK,EAAE,wBAAwB,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AACjG,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,KAAK,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAQlF,6GAA6G;AAC7G,MAAM,MAAM,sBAAsB,GAAG,CAAC,UAAU,EAAE,MAAM,KAAK,OAAO,CAAC,wBAAwB,CAAC,CAAC;AAE/F,gEAAgE;AAChE,MAAM,MAAM,aAAa,GAAG,IAAI,CAAC,eAAe,EAAE,QAAQ,GAAG,SAAS,GAAG,WAAW,CAAC,CAAC;AAEtF,4DAA4D;AAC5D,MAAM,WAAW,mBAAmB;IAClC,YAAY,EAAE,iBAAiB,EAAE,CAAC;IAClC,mEAAmE;IACnE,UAAU,EAAE,eAAe,EAAE,CAAC;IAC9B,iHAAiH;IACjH,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,iGAAiG;IACjG,eAAe,EAAE,MA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