@telora/daemon 0.22.104 → 0.22.132

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 (482) hide show
  1. package/build-info.json +4 -3
  2. package/dist/completion/commit-verdict-release.d.ts +49 -0
  3. package/dist/completion/commit-verdict-release.d.ts.map +1 -0
  4. package/dist/completion/commit-verdict-release.js +240 -0
  5. package/dist/completion/commit-verdict-release.js.map +1 -0
  6. package/dist/completion/completion-phase-registry.d.ts +10 -4
  7. package/dist/completion/completion-phase-registry.d.ts.map +1 -1
  8. package/dist/completion/completion-phase-registry.js +19 -7
  9. package/dist/completion/completion-phase-registry.js.map +1 -1
  10. package/dist/completion/detector.d.ts.map +1 -1
  11. package/dist/completion/detector.js +1 -0
  12. package/dist/completion/detector.js.map +1 -1
  13. package/dist/completion/event-entry-phases.d.ts +6 -3
  14. package/dist/completion/event-entry-phases.d.ts.map +1 -1
  15. package/dist/completion/event-entry-phases.js +135 -76
  16. package/dist/completion/event-entry-phases.js.map +1 -1
  17. package/dist/completion/event-phases.d.ts +24 -3
  18. package/dist/completion/event-phases.d.ts.map +1 -1
  19. package/dist/completion/event-phases.js +9 -9
  20. package/dist/completion/event-phases.js.map +1 -1
  21. package/dist/completion/event.d.ts +8 -0
  22. package/dist/completion/event.d.ts.map +1 -1
  23. package/dist/completion/event.js +47 -21
  24. package/dist/completion/event.js.map +1 -1
  25. package/dist/completion/exit-classification.d.ts.map +1 -1
  26. package/dist/completion/exit-classification.js +1 -0
  27. package/dist/completion/exit-classification.js.map +1 -1
  28. package/dist/completion/merge-phase.d.ts +21 -9
  29. package/dist/completion/merge-phase.d.ts.map +1 -1
  30. package/dist/completion/merge-phase.js +35 -10
  31. package/dist/completion/merge-phase.js.map +1 -1
  32. package/dist/completion/review-auto-approval-record.d.ts +19 -0
  33. package/dist/completion/review-auto-approval-record.d.ts.map +1 -0
  34. package/dist/completion/review-auto-approval-record.js +102 -0
  35. package/dist/completion/review-auto-approval-record.js.map +1 -0
  36. package/dist/completion/review-cycle-cap.d.ts +62 -0
  37. package/dist/completion/review-cycle-cap.d.ts.map +1 -0
  38. package/dist/completion/review-cycle-cap.js +180 -0
  39. package/dist/completion/review-cycle-cap.js.map +1 -0
  40. package/dist/completion/review-exit-deps.d.ts +17 -2
  41. package/dist/completion/review-exit-deps.d.ts.map +1 -1
  42. package/dist/completion/review-exit-deps.js +19 -2
  43. package/dist/completion/review-exit-deps.js.map +1 -1
  44. package/dist/completion/review-exit-escalations.d.ts +45 -23
  45. package/dist/completion/review-exit-escalations.d.ts.map +1 -1
  46. package/dist/completion/review-exit-escalations.js +15 -74
  47. package/dist/completion/review-exit-escalations.js.map +1 -1
  48. package/dist/completion/review-exit-evidence.d.ts +9 -0
  49. package/dist/completion/review-exit-evidence.d.ts.map +1 -1
  50. package/dist/completion/review-exit-evidence.js +4 -1
  51. package/dist/completion/review-exit-evidence.js.map +1 -1
  52. package/dist/completion/review-exit-foreign-findings.d.ts +151 -0
  53. package/dist/completion/review-exit-foreign-findings.d.ts.map +1 -0
  54. package/dist/completion/review-exit-foreign-findings.js +474 -0
  55. package/dist/completion/review-exit-foreign-findings.js.map +1 -0
  56. package/dist/completion/review-exit-phase.d.ts.map +1 -1
  57. package/dist/completion/review-exit-phase.js +71 -64
  58. package/dist/completion/review-exit-phase.js.map +1 -1
  59. package/dist/completion/review-exit-progress.d.ts +20 -0
  60. package/dist/completion/review-exit-progress.d.ts.map +1 -1
  61. package/dist/completion/review-exit-progress.js +28 -19
  62. package/dist/completion/review-exit-progress.js.map +1 -1
  63. package/dist/completion/review-exit-rehoming.d.ts +5 -0
  64. package/dist/completion/review-exit-rehoming.d.ts.map +1 -1
  65. package/dist/completion/review-exit-rehoming.js.map +1 -1
  66. package/dist/completion/review-exit-verdict-gate.d.ts +202 -0
  67. package/dist/completion/review-exit-verdict-gate.d.ts.map +1 -0
  68. package/dist/completion/review-exit-verdict-gate.js +228 -0
  69. package/dist/completion/review-exit-verdict-gate.js.map +1 -0
  70. package/dist/completion/review-next-step.d.ts +62 -0
  71. package/dist/completion/review-next-step.d.ts.map +1 -0
  72. package/dist/completion/review-next-step.js +63 -0
  73. package/dist/completion/review-next-step.js.map +1 -0
  74. package/dist/completion/session-hold-sweep-deps.d.ts +17 -0
  75. package/dist/completion/session-hold-sweep-deps.d.ts.map +1 -0
  76. package/dist/completion/session-hold-sweep-deps.js +89 -0
  77. package/dist/completion/session-hold-sweep-deps.js.map +1 -0
  78. package/dist/completion/session-hold.d.ts +180 -0
  79. package/dist/completion/session-hold.d.ts.map +1 -0
  80. package/dist/completion/session-hold.js +238 -0
  81. package/dist/completion/session-hold.js.map +1 -0
  82. package/dist/completion/state-cascade.d.ts +19 -0
  83. package/dist/completion/state-cascade.d.ts.map +1 -1
  84. package/dist/completion/state-cascade.js +85 -31
  85. package/dist/completion/state-cascade.js.map +1 -1
  86. package/dist/completion/team-lifecycle.d.ts +35 -2
  87. package/dist/completion/team-lifecycle.d.ts.map +1 -1
  88. package/dist/completion/team-lifecycle.js +165 -94
  89. package/dist/completion/team-lifecycle.js.map +1 -1
  90. package/dist/completion/team-phase.d.ts +27 -15
  91. package/dist/completion/team-phase.d.ts.map +1 -1
  92. package/dist/completion/team-phase.js +34 -15
  93. package/dist/completion/team-phase.js.map +1 -1
  94. package/dist/delivery/commit-verdict-hold.d.ts +55 -0
  95. package/dist/delivery/commit-verdict-hold.d.ts.map +1 -0
  96. package/dist/delivery/commit-verdict-hold.js +118 -0
  97. package/dist/delivery/commit-verdict-hold.js.map +1 -0
  98. package/dist/directive/directive-dispatch.d.ts.map +1 -1
  99. package/dist/directive/directive-dispatch.js +10 -3
  100. package/dist/directive/directive-dispatch.js.map +1 -1
  101. package/dist/directive/directive-executor.d.ts.map +1 -1
  102. package/dist/directive/directive-executor.js +1 -0
  103. package/dist/directive/directive-executor.js.map +1 -1
  104. package/dist/directive/directive-queue.d.ts.map +1 -1
  105. package/dist/directive/directive-queue.js +6 -1
  106. package/dist/directive/directive-queue.js.map +1 -1
  107. package/dist/directive/phase-sync.d.ts +29 -2
  108. package/dist/directive/phase-sync.d.ts.map +1 -1
  109. package/dist/directive/phase-sync.js +30 -6
  110. package/dist/directive/phase-sync.js.map +1 -1
  111. package/dist/drift/artifact-ref-shape.d.ts +34 -0
  112. package/dist/drift/artifact-ref-shape.d.ts.map +1 -0
  113. package/dist/drift/artifact-ref-shape.js +94 -0
  114. package/dist/drift/artifact-ref-shape.js.map +1 -0
  115. package/dist/drift/drift-eval-loop.d.ts +7 -0
  116. package/dist/drift/drift-eval-loop.d.ts.map +1 -1
  117. package/dist/drift/drift-eval-loop.js +34 -5
  118. package/dist/drift/drift-eval-loop.js.map +1 -1
  119. package/dist/drift/drift-evaluator.d.ts.map +1 -1
  120. package/dist/drift/drift-evaluator.js +8 -3
  121. package/dist/drift/drift-evaluator.js.map +1 -1
  122. package/dist/focus/awaiting-slot.d.ts +34 -0
  123. package/dist/focus/awaiting-slot.d.ts.map +1 -0
  124. package/dist/focus/awaiting-slot.js +26 -0
  125. package/dist/focus/awaiting-slot.js.map +1 -0
  126. package/dist/focus/focus-lifecycle.js +2 -2
  127. package/dist/focus/focus-lifecycle.js.map +1 -1
  128. package/dist/focus/focus-phase.d.ts.map +1 -1
  129. package/dist/focus/focus-phase.js +3 -1
  130. package/dist/focus/focus-phase.js.map +1 -1
  131. package/dist/focus/focus-spawn-decision.d.ts +62 -0
  132. package/dist/focus/focus-spawn-decision.d.ts.map +1 -0
  133. package/dist/focus/focus-spawn-decision.js +41 -0
  134. package/dist/focus/focus-spawn-decision.js.map +1 -0
  135. package/dist/focus/focus-team-state.d.ts.map +1 -1
  136. package/dist/focus/focus-team-state.js +1 -13
  137. package/dist/focus/focus-team-state.js.map +1 -1
  138. package/dist/focus/listener-spawn.d.ts +16 -55
  139. package/dist/focus/listener-spawn.d.ts.map +1 -1
  140. package/dist/focus/listener-spawn.js +102 -64
  141. package/dist/focus/listener-spawn.js.map +1 -1
  142. package/dist/focus/listener-state.d.ts.map +1 -1
  143. package/dist/focus/listener-state.js +4 -1
  144. package/dist/focus/listener-state.js.map +1 -1
  145. package/dist/focus/listener.d.ts +41 -2
  146. package/dist/focus/listener.d.ts.map +1 -1
  147. package/dist/focus/listener.js +135 -83
  148. package/dist/focus/listener.js.map +1 -1
  149. package/dist/focus/pending-spawn-pass-deps.d.ts +69 -0
  150. package/dist/focus/pending-spawn-pass-deps.d.ts.map +1 -0
  151. package/dist/focus/pending-spawn-pass-deps.js +34 -0
  152. package/dist/focus/pending-spawn-pass-deps.js.map +1 -0
  153. package/dist/focus/pending-spawn-review-next-step.d.ts +83 -0
  154. package/dist/focus/pending-spawn-review-next-step.d.ts.map +1 -0
  155. package/dist/focus/pending-spawn-review-next-step.js +325 -0
  156. package/dist/focus/pending-spawn-review-next-step.js.map +1 -0
  157. package/dist/focus/review-cycle-cap-hold.d.ts +132 -0
  158. package/dist/focus/review-cycle-cap-hold.d.ts.map +1 -0
  159. package/dist/focus/review-cycle-cap-hold.js +178 -0
  160. package/dist/focus/review-cycle-cap-hold.js.map +1 -0
  161. package/dist/focus/team-actionable-work.js +2 -2
  162. package/dist/focus/verify-open-issues.d.ts +22 -0
  163. package/dist/focus/verify-open-issues.d.ts.map +1 -1
  164. package/dist/focus/verify-open-issues.js +118 -57
  165. package/dist/focus/verify-open-issues.js.map +1 -1
  166. package/dist/focus/verify-routing-passes.d.ts +32 -0
  167. package/dist/focus/verify-routing-passes.d.ts.map +1 -0
  168. package/dist/focus/verify-routing-passes.js +18 -0
  169. package/dist/focus/verify-routing-passes.js.map +1 -0
  170. package/dist/git/index.d.ts.map +1 -1
  171. package/dist/git/index.js +9 -5
  172. package/dist/git/index.js.map +1 -1
  173. package/dist/merge/focus-merge.d.ts +16 -2
  174. package/dist/merge/focus-merge.d.ts.map +1 -1
  175. package/dist/merge/focus-merge.js +53 -30
  176. package/dist/merge/focus-merge.js.map +1 -1
  177. package/dist/merge/merge-back-loop.d.ts +5 -0
  178. package/dist/merge/merge-back-loop.d.ts.map +1 -1
  179. package/dist/merge/merge-back-loop.js +17 -8
  180. package/dist/merge/merge-back-loop.js.map +1 -1
  181. package/dist/merge/merge-gate-coverage.d.ts +94 -0
  182. package/dist/merge/merge-gate-coverage.d.ts.map +1 -0
  183. package/dist/merge/merge-gate-coverage.js +217 -0
  184. package/dist/merge/merge-gate-coverage.js.map +1 -0
  185. package/dist/prompt/focus-prompt-builder.d.ts.map +1 -1
  186. package/dist/prompt/focus-prompt-builder.js +6 -0
  187. package/dist/prompt/focus-prompt-builder.js.map +1 -1
  188. package/dist/prompt/prompt-listing.d.ts.map +1 -1
  189. package/dist/prompt/prompt-listing.js +8 -0
  190. package/dist/prompt/prompt-listing.js.map +1 -1
  191. package/dist/prompt/team-prompt-base.d.ts.map +1 -1
  192. package/dist/prompt/team-prompt-base.js +5 -1
  193. package/dist/prompt/team-prompt-base.js.map +1 -1
  194. package/dist/prompt-sections/execution-sections.d.ts.map +1 -1
  195. package/dist/prompt-sections/execution-sections.js +14 -39
  196. package/dist/prompt-sections/execution-sections.js.map +1 -1
  197. package/dist/prompt-sections/gate-ownership.d.ts +36 -0
  198. package/dist/prompt-sections/gate-ownership.d.ts.map +1 -0
  199. package/dist/prompt-sections/gate-ownership.js +68 -0
  200. package/dist/prompt-sections/gate-ownership.js.map +1 -0
  201. package/dist/prompt-sections/gate-verdict-section.d.ts +58 -0
  202. package/dist/prompt-sections/gate-verdict-section.d.ts.map +1 -0
  203. package/dist/prompt-sections/gate-verdict-section.js +88 -0
  204. package/dist/prompt-sections/gate-verdict-section.js.map +1 -0
  205. package/dist/prompt-sections/persona-sections.d.ts +10 -0
  206. package/dist/prompt-sections/persona-sections.d.ts.map +1 -1
  207. package/dist/prompt-sections/persona-sections.js +35 -11
  208. package/dist/prompt-sections/persona-sections.js.map +1 -1
  209. package/dist/prompt-sections/shared.js +1 -1
  210. package/dist/prompt-sections/shared.js.map +1 -1
  211. package/dist/queries/agent-resolvable-promotion.d.ts +6 -3
  212. package/dist/queries/agent-resolvable-promotion.d.ts.map +1 -1
  213. package/dist/queries/agent-resolvable-promotion.js +20 -9
  214. package/dist/queries/agent-resolvable-promotion.js.map +1 -1
  215. package/dist/queries/deliveries.d.ts +46 -4
  216. package/dist/queries/deliveries.d.ts.map +1 -1
  217. package/dist/queries/deliveries.js +69 -16
  218. package/dist/queries/deliveries.js.map +1 -1
  219. package/dist/queries/delivery-gate-state.d.ts +151 -1
  220. package/dist/queries/delivery-gate-state.d.ts.map +1 -1
  221. package/dist/queries/delivery-gate-state.js +95 -14
  222. package/dist/queries/delivery-gate-state.js.map +1 -1
  223. package/dist/queries/delivery-write-discipline.d.ts +65 -0
  224. package/dist/queries/delivery-write-discipline.d.ts.map +1 -0
  225. package/dist/queries/delivery-write-discipline.js +101 -0
  226. package/dist/queries/delivery-write-discipline.js.map +1 -0
  227. package/dist/queries/escalation-consumption.d.ts +11 -0
  228. package/dist/queries/escalation-consumption.d.ts.map +1 -1
  229. package/dist/queries/escalation-consumption.js +22 -0
  230. package/dist/queries/escalation-consumption.js.map +1 -1
  231. package/dist/queries/escalation-spool.d.ts +75 -0
  232. package/dist/queries/escalation-spool.d.ts.map +1 -0
  233. package/dist/queries/escalation-spool.js +232 -0
  234. package/dist/queries/escalation-spool.js.map +1 -0
  235. package/dist/queries/escalation-suppression.d.ts.map +1 -1
  236. package/dist/queries/escalation-suppression.js +2 -0
  237. package/dist/queries/escalation-suppression.js.map +1 -1
  238. package/dist/queries/escalations.js +1 -1
  239. package/dist/queries/filing-observation.d.ts.map +1 -1
  240. package/dist/queries/filing-observation.js +2 -0
  241. package/dist/queries/filing-observation.js.map +1 -1
  242. package/dist/queries/focus-discovery.d.ts +4 -4
  243. package/dist/queries/focus-discovery.d.ts.map +1 -1
  244. package/dist/queries/focus-discovery.js +1 -0
  245. package/dist/queries/focus-discovery.js.map +1 -1
  246. package/dist/queries/focus-review-approval.d.ts +84 -0
  247. package/dist/queries/focus-review-approval.d.ts.map +1 -0
  248. package/dist/queries/focus-review-approval.js +158 -0
  249. package/dist/queries/focus-review-approval.js.map +1 -0
  250. package/dist/queries/focuses.d.ts +6 -5
  251. package/dist/queries/focuses.d.ts.map +1 -1
  252. package/dist/queries/focuses.js +9 -5
  253. package/dist/queries/focuses.js.map +1 -1
  254. package/dist/queries/incident-correlation.d.ts +5 -4
  255. package/dist/queries/incident-correlation.d.ts.map +1 -1
  256. package/dist/queries/incident-correlation.js +11 -5
  257. package/dist/queries/incident-correlation.js.map +1 -1
  258. package/dist/queries/issues.d.ts.map +1 -1
  259. package/dist/queries/issues.js +2 -1
  260. package/dist/queries/issues.js.map +1 -1
  261. package/dist/queries/loop-refusal-observation.d.ts +64 -0
  262. package/dist/queries/loop-refusal-observation.d.ts.map +1 -0
  263. package/dist/queries/loop-refusal-observation.js +137 -0
  264. package/dist/queries/loop-refusal-observation.js.map +1 -0
  265. package/dist/queries/schemas.d.ts +9 -0
  266. package/dist/queries/schemas.d.ts.map +1 -1
  267. package/dist/queries/schemas.js +11 -3
  268. package/dist/queries/schemas.js.map +1 -1
  269. package/dist/queries/shared.js +1 -1
  270. package/dist/queries/verification.d.ts.map +1 -1
  271. package/dist/queries/verification.js +1 -15
  272. package/dist/queries/verification.js.map +1 -1
  273. package/dist/queries/wire-contract.generated.d.ts +3 -0
  274. package/dist/queries/wire-contract.generated.d.ts.map +1 -1
  275. package/dist/queries/wire-contract.generated.js +3 -0
  276. package/dist/queries/wire-contract.generated.js.map +1 -1
  277. package/dist/resolvers/assembly-engine.d.ts.map +1 -1
  278. package/dist/resolvers/assembly-engine.js +3 -1
  279. package/dist/resolvers/assembly-engine.js.map +1 -1
  280. package/dist/resolvers/git-diff-against-base.d.ts +5 -2
  281. package/dist/resolvers/git-diff-against-base.d.ts.map +1 -1
  282. package/dist/resolvers/git-diff-against-base.js +121 -39
  283. package/dist/resolvers/git-diff-against-base.js.map +1 -1
  284. package/dist/resolvers/shared/git-diff.d.ts +2 -0
  285. package/dist/resolvers/shared/git-diff.d.ts.map +1 -1
  286. package/dist/resolvers/shared/git-diff.js +5 -1
  287. package/dist/resolvers/shared/git-diff.js.map +1 -1
  288. package/dist/resolvers/shared/review-window-commits.d.ts +96 -0
  289. package/dist/resolvers/shared/review-window-commits.d.ts.map +1 -0
  290. package/dist/resolvers/shared/review-window-commits.js +262 -0
  291. package/dist/resolvers/shared/review-window-commits.js.map +1 -0
  292. package/dist/session/session-lineage.d.ts.map +1 -1
  293. package/dist/session/session-lineage.js +4 -1
  294. package/dist/session/session-lineage.js.map +1 -1
  295. package/dist/shell/fail-stop.d.ts +18 -0
  296. package/dist/shell/fail-stop.d.ts.map +1 -0
  297. package/dist/shell/fail-stop.js +53 -0
  298. package/dist/shell/fail-stop.js.map +1 -0
  299. package/dist/shell/graceful-shutdown.d.ts +48 -0
  300. package/dist/shell/graceful-shutdown.d.ts.map +1 -0
  301. package/dist/shell/graceful-shutdown.js +152 -0
  302. package/dist/shell/graceful-shutdown.js.map +1 -0
  303. package/dist/shell/heartbeat.d.ts.map +1 -1
  304. package/dist/shell/heartbeat.js +5 -4
  305. package/dist/shell/heartbeat.js.map +1 -1
  306. package/dist/shell/log.d.ts.map +1 -1
  307. package/dist/shell/log.js +4 -1
  308. package/dist/shell/log.js.map +1 -1
  309. package/dist/shell/stop-request.d.ts.map +1 -1
  310. package/dist/shell/stop-request.js +2 -1
  311. package/dist/shell/stop-request.js.map +1 -1
  312. package/dist/shell/unified-shell.d.ts.map +1 -1
  313. package/dist/shell/unified-shell.js +41 -114
  314. package/dist/shell/unified-shell.js.map +1 -1
  315. package/dist/spawn/lifecycle.d.ts +12 -0
  316. package/dist/spawn/lifecycle.d.ts.map +1 -1
  317. package/dist/spawn/lifecycle.js +25 -21
  318. package/dist/spawn/lifecycle.js.map +1 -1
  319. package/dist/spawn/prompt-assembly.d.ts +19 -1
  320. package/dist/spawn/prompt-assembly.d.ts.map +1 -1
  321. package/dist/spawn/prompt-assembly.js +70 -21
  322. package/dist/spawn/prompt-assembly.js.map +1 -1
  323. package/dist/spawn/review-hold-park.d.ts.map +1 -1
  324. package/dist/spawn/review-hold-park.js +18 -8
  325. package/dist/spawn/review-hold-park.js.map +1 -1
  326. package/dist/spawn/spawn-cooldown.d.ts.map +1 -1
  327. package/dist/spawn/spawn-cooldown.js +4 -0
  328. package/dist/spawn/spawn-cooldown.js.map +1 -1
  329. package/dist/spawn/spawn-decision.d.ts.map +1 -1
  330. package/dist/spawn/spawn-decision.js +2 -1
  331. package/dist/spawn/spawn-decision.js.map +1 -1
  332. package/dist/spawn/worktree-session.d.ts +6 -0
  333. package/dist/spawn/worktree-session.d.ts.map +1 -1
  334. package/dist/spawn/worktree-session.js +15 -2
  335. package/dist/spawn/worktree-session.js.map +1 -1
  336. package/dist/testing/fixtures/index.d.ts +10 -1
  337. package/dist/testing/fixtures/index.d.ts.map +1 -1
  338. package/dist/testing/fixtures/index.js +59 -1
  339. package/dist/testing/fixtures/index.js.map +1 -1
  340. package/dist/testing/fixtures/pending-spawn-world.d.ts +34 -0
  341. package/dist/testing/fixtures/pending-spawn-world.d.ts.map +1 -0
  342. package/dist/testing/fixtures/pending-spawn-world.js +92 -0
  343. package/dist/testing/fixtures/pending-spawn-world.js.map +1 -0
  344. package/dist/types/index.js +1 -1
  345. package/dist/verify/commit-gate-configured.d.ts +86 -0
  346. package/dist/verify/commit-gate-configured.d.ts.map +1 -0
  347. package/dist/verify/commit-gate-configured.js +234 -0
  348. package/dist/verify/commit-gate-configured.js.map +1 -0
  349. package/dist/verify/commit-verdict-record.d.ts +98 -0
  350. package/dist/verify/commit-verdict-record.d.ts.map +1 -0
  351. package/dist/verify/commit-verdict-record.js +297 -0
  352. package/dist/verify/commit-verdict-record.js.map +1 -0
  353. package/dist/verify/explicit-gate-outcome.d.ts +161 -0
  354. package/dist/verify/explicit-gate-outcome.d.ts.map +1 -0
  355. package/dist/verify/explicit-gate-outcome.js +215 -0
  356. package/dist/verify/explicit-gate-outcome.js.map +1 -0
  357. package/dist/verify/explicit-rearm.d.ts +27 -0
  358. package/dist/verify/explicit-rearm.d.ts.map +1 -0
  359. package/dist/verify/explicit-rearm.js +161 -0
  360. package/dist/verify/explicit-rearm.js.map +1 -0
  361. package/dist/verify/explicit-run-ledger.d.ts +26 -0
  362. package/dist/verify/explicit-run-ledger.d.ts.map +1 -0
  363. package/dist/verify/explicit-run-ledger.js +93 -0
  364. package/dist/verify/explicit-run-ledger.js.map +1 -0
  365. package/dist/verify/failure-signature.d.ts.map +1 -1
  366. package/dist/verify/failure-signature.js +5 -1
  367. package/dist/verify/failure-signature.js.map +1 -1
  368. package/dist/verify/gate-run-registry.d.ts +105 -0
  369. package/dist/verify/gate-run-registry.d.ts.map +1 -0
  370. package/dist/verify/gate-run-registry.js +111 -0
  371. package/dist/verify/gate-run-registry.js.map +1 -0
  372. package/dist/verify/gate-verdict-source.d.ts +68 -0
  373. package/dist/verify/gate-verdict-source.d.ts.map +1 -0
  374. package/dist/verify/gate-verdict-source.js +143 -0
  375. package/dist/verify/gate-verdict-source.js.map +1 -0
  376. package/dist/verify/judged-commit-gate.d.ts +11 -0
  377. package/dist/verify/judged-commit-gate.d.ts.map +1 -0
  378. package/dist/verify/judged-commit-gate.js +48 -0
  379. package/dist/verify/judged-commit-gate.js.map +1 -0
  380. package/dist/verify/rework-judgment.d.ts +58 -0
  381. package/dist/verify/rework-judgment.d.ts.map +1 -0
  382. package/dist/verify/rework-judgment.js +54 -0
  383. package/dist/verify/rework-judgment.js.map +1 -0
  384. package/dist/verify/verification-attribution.d.ts +105 -0
  385. package/dist/verify/verification-attribution.d.ts.map +1 -0
  386. package/dist/verify/verification-attribution.js +322 -0
  387. package/dist/verify/verification-attribution.js.map +1 -0
  388. package/dist/verify/verification-baseline-run.d.ts +123 -0
  389. package/dist/verify/verification-baseline-run.d.ts.map +1 -0
  390. package/dist/verify/verification-baseline-run.js +386 -0
  391. package/dist/verify/verification-baseline-run.js.map +1 -0
  392. package/dist/verify/verification-baseline.d.ts +79 -33
  393. package/dist/verify/verification-baseline.d.ts.map +1 -1
  394. package/dist/verify/verification-baseline.js +99 -106
  395. package/dist/verify/verification-baseline.js.map +1 -1
  396. package/dist/verify/verification-checkout.d.ts +13 -0
  397. package/dist/verify/verification-checkout.d.ts.map +1 -1
  398. package/dist/verify/verification-checkout.js +39 -2
  399. package/dist/verify/verification-checkout.js.map +1 -1
  400. package/dist/verify/verification-commit-sharing.d.ts +84 -0
  401. package/dist/verify/verification-commit-sharing.d.ts.map +1 -0
  402. package/dist/verify/verification-commit-sharing.js +416 -0
  403. package/dist/verify/verification-commit-sharing.js.map +1 -0
  404. package/dist/verify/verification-config.d.ts.map +1 -1
  405. package/dist/verify/verification-config.js +12 -2
  406. package/dist/verify/verification-config.js.map +1 -1
  407. package/dist/verify/verification-default-on.d.ts +27 -11
  408. package/dist/verify/verification-default-on.d.ts.map +1 -1
  409. package/dist/verify/verification-default-on.js +159 -29
  410. package/dist/verify/verification-default-on.js.map +1 -1
  411. package/dist/verify/verification-deps-default.d.ts.map +1 -1
  412. package/dist/verify/verification-deps-default.js +49 -42
  413. package/dist/verify/verification-deps-default.js.map +1 -1
  414. package/dist/verify/verification-deps.d.ts +69 -4
  415. package/dist/verify/verification-deps.d.ts.map +1 -1
  416. package/dist/verify/verification-deterministic.d.ts +15 -2
  417. package/dist/verify/verification-deterministic.d.ts.map +1 -1
  418. package/dist/verify/verification-deterministic.js +12 -3
  419. package/dist/verify/verification-deterministic.js.map +1 -1
  420. package/dist/verify/verification-diagnostics.d.ts +16 -0
  421. package/dist/verify/verification-diagnostics.d.ts.map +1 -0
  422. package/dist/verify/verification-diagnostics.js +219 -0
  423. package/dist/verify/verification-diagnostics.js.map +1 -0
  424. package/dist/verify/verification-engine.d.ts +12 -8
  425. package/dist/verify/verification-engine.d.ts.map +1 -1
  426. package/dist/verify/verification-engine.js +110 -92
  427. package/dist/verify/verification-engine.js.map +1 -1
  428. package/dist/verify/verification-evidence-unavailable-feedback.d.ts +2 -1
  429. package/dist/verify/verification-evidence-unavailable-feedback.d.ts.map +1 -1
  430. package/dist/verify/verification-evidence-unavailable-feedback.js +14 -4
  431. package/dist/verify/verification-evidence-unavailable-feedback.js.map +1 -1
  432. package/dist/verify/verification-failure-parser.d.ts +37 -3
  433. package/dist/verify/verification-failure-parser.d.ts.map +1 -1
  434. package/dist/verify/verification-failure-parser.js +66 -3
  435. package/dist/verify/verification-failure-parser.js.map +1 -1
  436. package/dist/verify/verification-feedback.d.ts +21 -34
  437. package/dist/verify/verification-feedback.d.ts.map +1 -1
  438. package/dist/verify/verification-feedback.js +37 -88
  439. package/dist/verify/verification-feedback.js.map +1 -1
  440. package/dist/verify/verification-gate-stages.d.ts +110 -0
  441. package/dist/verify/verification-gate-stages.d.ts.map +1 -0
  442. package/dist/verify/verification-gate-stages.js +179 -0
  443. package/dist/verify/verification-gate-stages.js.map +1 -0
  444. package/dist/verify/verification-history-reset.d.ts +61 -0
  445. package/dist/verify/verification-history-reset.d.ts.map +1 -0
  446. package/dist/verify/verification-history-reset.js +90 -0
  447. package/dist/verify/verification-history-reset.js.map +1 -0
  448. package/dist/verify/verification-manifest.d.ts.map +1 -1
  449. package/dist/verify/verification-manifest.js +2 -1
  450. package/dist/verify/verification-manifest.js.map +1 -1
  451. package/dist/verify/verification-rework-messages.d.ts +19 -0
  452. package/dist/verify/verification-rework-messages.d.ts.map +1 -0
  453. package/dist/verify/verification-rework-messages.js +52 -0
  454. package/dist/verify/verification-rework-messages.js.map +1 -0
  455. package/dist/worktree/install-inputs.d.ts +89 -0
  456. package/dist/worktree/install-inputs.d.ts.map +1 -0
  457. package/dist/worktree/install-inputs.js +625 -0
  458. package/dist/worktree/install-inputs.js.map +1 -0
  459. package/dist/worktree/install-script-effects.d.ts +30 -0
  460. package/dist/worktree/install-script-effects.d.ts.map +1 -0
  461. package/dist/worktree/install-script-effects.js +524 -0
  462. package/dist/worktree/install-script-effects.js.map +1 -0
  463. package/dist/worktree/install-script-tokens.d.ts +57 -0
  464. package/dist/worktree/install-script-tokens.d.ts.map +1 -0
  465. package/dist/worktree/install-script-tokens.js +299 -0
  466. package/dist/worktree/install-script-tokens.js.map +1 -0
  467. package/dist/worktree/provision.d.ts +27 -4
  468. package/dist/worktree/provision.d.ts.map +1 -1
  469. package/dist/worktree/provision.js +46 -7
  470. package/dist/worktree/provision.js.map +1 -1
  471. package/dist/worktree/safety.d.ts +11 -0
  472. package/dist/worktree/safety.d.ts.map +1 -1
  473. package/dist/worktree/safety.js +20 -3
  474. package/dist/worktree/safety.js.map +1 -1
  475. package/dist/worktree/verify-interlock.d.ts.map +1 -1
  476. package/dist/worktree/verify-interlock.js +3 -1
  477. package/dist/worktree/verify-interlock.js.map +1 -1
  478. package/dist/worktree/worktree-package-provisioning.d.ts +75 -0
  479. package/dist/worktree/worktree-package-provisioning.d.ts.map +1 -0
  480. package/dist/worktree/worktree-package-provisioning.js +362 -0
  481. package/dist/worktree/worktree-package-provisioning.js.map +1 -0
  482. package/package.json +1 -1
@@ -0,0 +1,219 @@
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/verification-diagnostics.test.ts
3
+ // PINNED-BY-END
4
+ /**
5
+ * Diagnostic signatures of one red gate stage, comparable across two checkouts.
6
+ *
7
+ * Stage attribution (verify/verification-attribution.ts) used to call a non-test
8
+ * red pre-existing when only the stage NAMES matched and neither side parsed a
9
+ * failing-test id -- so a base lint error in file A and a new lint or type error
10
+ * in file B laundered together. A stage red is the base's only when the base
11
+ * reports every diagnostic this run reports. This module reduces a stage's log
12
+ * segment to a MULTISET of stable, effect-bearing signatures:
13
+ *
14
+ * - eslint (stylish): `eslint <file> <rule> <message>`, errors only (a warning
15
+ * never fails the stage); the file comes from the path line above the problem
16
+ * lines;
17
+ * - tsc: `tsc <file> <TSxxxx> <message>` from `file(l,c): error TSxxxx: msg`
18
+ * and the pretty `file:l:c - error TSxxxx: msg`;
19
+ * - every OTHER line that bears an error word (error, fail, violated, drift,
20
+ * exceeds, ...) or names a file path -- which keeps ratchet counts
21
+ * (`name: 130 > baseline 120`) and drift file lines, and drops progress prose
22
+ * such as an IMPROVED count;
23
+ * - and when none of that yields anything, every remaining output line.
24
+ *
25
+ * The tiers compose; a structured tier never replaces the rest. A stage whose
26
+ * output mixes a structured tool with anything else (an eslint error beside a
27
+ * ratchet count) keeps every effect-bearing line the structured parsers did not
28
+ * account for. What they account for is left out, because their signatures
29
+ * already count it: the lines they consumed (an eslint file header and its
30
+ * problem lines, warnings included; a tsc diagnostic, its indented message chain
31
+ * and its code frame) and the tallies they print about them (eslint's `N
32
+ * problems` and `--fix` lines, tsc's `Found N errors` and its per-file table).
33
+ * (Structured signatures used to win outright, so a head reporting the base's
34
+ * eslint error PLUS a new ratchet violation compared identical to the base and
35
+ * the new red was laundered as pre-existing -- TEL-6.)
36
+ *
37
+ * Normalised away, because they differ between two runs of the same defect:
38
+ * ANSI codes, npm's own script headers and lifecycle trailer (their package
39
+ * VERSION and paths move between base and head), timestamps and durations, the
40
+ * checkout's absolute path prefix (base and head run in DIFFERENT checkout
41
+ * directories: the `(cwd: ...)` preamble a verify log opens with, any explicitly
42
+ * known root, and the daemon's checkout-root layout), and line/column numbers
43
+ * (an unrelated edit above a base error moves it). Counts are kept: a count is
44
+ * the effect.
45
+ *
46
+ * Comparison ({@link uncoveredDiagnostics}): the head red is covered only if every
47
+ * head signature occurs at least as many times in the base. A head red with no
48
+ * extractable signature is NOT covered by anything -- attribution charges it
49
+ * rather than launder an unreadable red (decided: a charge names the stage, which
50
+ * the team can act on; the base red it might match cannot be shown). Pure.
51
+ *
52
+ * @module verify/verification-diagnostics
53
+ */
54
+ const ESC = String.fromCharCode(27);
55
+ const ANSI_RE = new RegExp(`${ESC}\\[[0-9;?]*[A-Za-z]`, 'g');
56
+ const NPM_HEADER_RE = /^> (?:@[^\s@/]+\/)?[^\s@]+@\S+ \S+$/;
57
+ /** npm's own lines about the script it ran (not the script's diagnostics); a missing script is kept. */
58
+ const NPM_NOISE_RE = /^npm (?:error|ERR!|warn|WARN|notice|verb)\b(?!.*Missing script)/;
59
+ const LOG_CWD_RE = /^\(cwd: (.+)\)$/;
60
+ /** The daemon's checkout layouts under its state dir: `<...>/verification-checkout/<key>/`. */
61
+ const CHECKOUT_ROOT_RE = /(?:\/[^\s/:'"()]+)*\/verification-(?:checkout|baseline-wt)\/[^\s/:'"()]+\/?/g;
62
+ const SOURCE_PATH = String.raw `[^\s:()'"]+\.(?:[cm]?[jt]sx?|json|mjs|cjs|sql|md|ya?ml|css|html|sh|py|toml)`;
63
+ const ESLINT_FILE_RE = new RegExp(`^(${SOURCE_PATH})$`);
64
+ const ESLINT_PROBLEM_RE = /^\s+\d+:\d+\s+(error|warning)\s+(.+?)(?:\s{2,}(\S+))?$/;
65
+ const TSC_RE = new RegExp(`^(${SOURCE_PATH})(?:\\(\\d+,\\d+\\):|:\\d+:\\d+ -) error (TS\\d+): (.*)$`);
66
+ const ERROR_WORD_RE = /\b(?:errors?|fail(?:s|ed|ure|ures|ing)?|violat(?:ed|ion|ions)|drift|exceed(?:s|ed)?|grew|stale|mismatch(?:es)?|missing|not found|forbidden|invalid|cannot|unable|not ok)\b|[✖✗×]/i;
67
+ const PATH_TOKEN_RE = new RegExp(`(?:^|\\s)(?:\\./)?[\\w@.-]+/${SOURCE_PATH}`);
68
+ /** The tallies eslint and tsc print about their own diagnostics (trimmed line). */
69
+ const STRUCTURED_TALLY_RE = /^(?:[✖✗×]\s*)?\d+ problems?\b|^\d+ errors? and \d+ warnings? potentially fixable\b|^Found \d+ errors?\b/;
70
+ /** tsc's per-file error table: its `Errors Files` head, then `<count> <file>` rows. */
71
+ const TSC_TABLE_HEAD_RE = /^Errors\s+Files$/;
72
+ const TSC_TABLE_ROW_RE = /^\d+\s+\S/;
73
+ /** A code frame: a numbered source line directly above its squiggle underline. */
74
+ const FRAME_SOURCE_RE = /^\d+ /;
75
+ const FRAME_UNDERLINE_RE = /^~+$/;
76
+ /** The roots a verify log names for itself: every `(cwd: <path>)` preamble line. */
77
+ export function logCwdRoots(logText) {
78
+ const roots = [];
79
+ for (const line of (typeof logText === 'string' ? logText : '').split(/\r?\n/)) {
80
+ const match = LOG_CWD_RE.exec(line.trim());
81
+ if (match)
82
+ roots.push(match[1].trim());
83
+ }
84
+ return roots;
85
+ }
86
+ function stripRoots(line, roots) {
87
+ let out = line;
88
+ for (const root of roots) {
89
+ const trimmed = root.replace(/\/+$/, '');
90
+ if (trimmed.length > 1)
91
+ out = out.split(`${trimmed}/`).join('').split(trimmed).join('.');
92
+ }
93
+ return out.replace(CHECKOUT_ROOT_RE, '');
94
+ }
95
+ /** One line reduced to what is stable across two runs of the same defect. */
96
+ function normaliseLine(line, roots) {
97
+ return stripRoots(line.replace(ANSI_RE, ''), roots)
98
+ .replace(/\b\d{4}-\d{2}-\d{2}[T ]\d{2}[:_]\d{2}[:_]\d{2}(?:[._]\d+)?Z?/g, '<time>')
99
+ .replace(/\b\d{1,2}:\d{2}:\d{2}(?:\.\d+)?\b/g, '<time>')
100
+ .replace(/\b(duration(?:_ms)?:?\s*)\d+(?:\.\d+)?/gi, '$1<dur>')
101
+ .replace(/\b\d+(?:\.\d+)?\s?(?:ms|s|sec|secs|seconds|m|min|mins|minutes|h)\b/g, '<dur>')
102
+ .replace(/\(\d+,\d+\)/g, '')
103
+ .replace(/:\d+(?::\d+)?\b/g, '')
104
+ .replace(/\s+/g, ' ')
105
+ .trim();
106
+ }
107
+ /**
108
+ * The stage's own output lines: npm's script headers (and their command lines)
109
+ * and lifecycle trailer removed. A blank line, and each removed line, stays as ''
110
+ * -- a boundary the structured reading needs (a tsc message chain ends at one).
111
+ */
112
+ function ownOutput(lines) {
113
+ const out = [];
114
+ for (let index = 0; index < lines.length; index++) {
115
+ const line = lines[index].replace(ANSI_RE, '').trimEnd();
116
+ if (NPM_HEADER_RE.test(line)) {
117
+ if (lines[index + 1]?.startsWith('> '))
118
+ index += 1;
119
+ out.push('');
120
+ continue;
121
+ }
122
+ out.push(line.trim().length === 0 || NPM_NOISE_RE.test(line.trim()) ? '' : line);
123
+ }
124
+ return out;
125
+ }
126
+ /** eslint stylish + tsc signatures (the structured tiers), with the lines each consumed. */
127
+ function structuredSignatures(lines, roots) {
128
+ const signatures = [];
129
+ const consumed = new Set(structuredTallies(lines));
130
+ let eslintFile = null;
131
+ let tscChain = false;
132
+ for (let index = 0; index < lines.length; index++) {
133
+ const line = lines[index];
134
+ const indented = /^\s/.test(line);
135
+ if (tscChain && indented) {
136
+ consumed.add(index); // the diagnostic's indented message chain
137
+ continue;
138
+ }
139
+ const tsc = TSC_RE.exec(line.trim());
140
+ tscChain = tsc !== null;
141
+ if (tsc) {
142
+ signatures.push(`tsc ${normaliseLine(tsc[1], roots)} ${tsc[2]} ${normaliseLine(tsc[3], roots)}`);
143
+ consumed.add(index);
144
+ continue;
145
+ }
146
+ const file = ESLINT_FILE_RE.exec(line.trim());
147
+ if (file && !indented) {
148
+ eslintFile = { name: normaliseLine(file[1], roots), index };
149
+ continue;
150
+ }
151
+ const problem = eslintFile === null ? null : ESLINT_PROBLEM_RE.exec(line);
152
+ if (problem && eslintFile) {
153
+ consumed.add(eslintFile.index).add(index);
154
+ if (problem[1] === 'error')
155
+ signatures.push(`eslint ${eslintFile.name} ${problem[3] ?? '-'} ${normaliseLine(problem[2], roots)}`);
156
+ continue;
157
+ }
158
+ if (!indented)
159
+ eslintFile = null;
160
+ }
161
+ return { signatures, consumed };
162
+ }
163
+ /** Indexes of the tallies, per-file tables and code frames eslint and tsc print about their diagnostics. */
164
+ function structuredTallies(lines) {
165
+ const tallies = [];
166
+ let inTable = false;
167
+ lines.forEach((line, index) => {
168
+ const text = line.replace(ANSI_RE, '').trim();
169
+ inTable = TSC_TABLE_HEAD_RE.test(text) || (inTable && TSC_TABLE_ROW_RE.test(text));
170
+ if (inTable || STRUCTURED_TALLY_RE.test(text))
171
+ tallies.push(index);
172
+ if (FRAME_UNDERLINE_RE.test(text)) {
173
+ tallies.push(index);
174
+ if (FRAME_SOURCE_RE.test(lines[index - 1]?.trim() ?? ''))
175
+ tallies.push(index - 1);
176
+ }
177
+ });
178
+ return tallies;
179
+ }
180
+ /**
181
+ * The diagnostic signatures of one red stage's log segment (module doc), sorted.
182
+ * `roots` are checkout paths to strip in addition to those the text names.
183
+ */
184
+ export function diagnosticSignatures(stageLines, roots = []) {
185
+ const allRoots = [...roots, ...stageLines.flatMap((line) => logCwdRoots(line))];
186
+ const lines = ownOutput(stageLines);
187
+ const { signatures, consumed } = structuredSignatures(lines, allRoots);
188
+ // What the structured tiers consumed is left out only when they read a signature from it.
189
+ const rest = lines.filter((line, index) => line.length > 0 && !(signatures.length > 0 && consumed.has(index)));
190
+ const bearing = rest.filter((line) => ERROR_WORD_RE.test(line) || PATH_TOKEN_RE.test(line));
191
+ const chosen = bearing.length > 0 || signatures.length > 0 ? bearing : rest;
192
+ const unstructured = chosen.map((line) => normaliseLine(line, allRoots)).filter((line) => line.length > 0);
193
+ return [...signatures, ...unstructured].sort();
194
+ }
195
+ /**
196
+ * The head signatures the base does not cover, as a multiset difference (a
197
+ * signature the head reports N times and the base M < N times contributes N - M
198
+ * copies). Empty means covered. Sorted.
199
+ */
200
+ export function uncoveredDiagnostics(head, base) {
201
+ const available = new Map();
202
+ for (const signature of base)
203
+ available.set(signature, (available.get(signature) ?? 0) + 1);
204
+ const uncovered = [];
205
+ for (const signature of head) {
206
+ const left = available.get(signature) ?? 0;
207
+ if (left > 0)
208
+ available.set(signature, left - 1);
209
+ else
210
+ uncovered.push(signature);
211
+ }
212
+ return uncovered.sort();
213
+ }
214
+ /** A short, bounded rendering of diagnostics for a rationale. */
215
+ export function describeDiagnostics(signatures, limit = 3) {
216
+ const shown = signatures.slice(0, limit).map((signature) => `"${signature}"`).join(', ');
217
+ return signatures.length > limit ? `${shown} (+${signatures.length - limit} more)` : shown;
218
+ }
219
+ //# sourceMappingURL=verification-diagnostics.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"verification-diagnostics.js","sourceRoot":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AY,CAAC,CAAC,IAAI,EAAE,CAAC;AACjD,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,oBAAoB,CAAC,IAAuB,EAAE,IAAuB;IACnF,MAAM,SAAS,GAAG,IAAI,GAAG,EAAkB,CAAC;IAC5C,KAAK,MAAM,SAAS,IAAI,IAAI;QAAE,SAAS,CAAC,GAAG,CAAC,SAAS,EAAE,CAAC,SAAS,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IAC5F,MAAM,SAAS,GAAa,EAAE,CAAC;IAC/B,KAAK,MAAM,SAAS,IAAI,IAAI,EAAE,CAAC;QAC7B,MAAM,IAAI,GAAG,SAAS,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;QAC3C,IAAI,IAAI,GAAG,CAAC;YAAE,SAAS,CAAC,GAAG,CAAC,SAAS,EAAE,IAAI,GAAG,CAAC,CAAC,CAAC;;YAC5C,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IACjC,CAAC;IACD,OAAO,SAAS,CAAC,IAAI,EAAE,CAAC;AAC1B,CAAC;AAED,iEAAiE;AACjE,MAAM,UAAU,mBAAmB,CAAC,UAA6B,EAAE,KAAK,GAAG,CAAC;IAC1E,MAAM,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,IAAI,SAAS,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACzF,OAAO,UAAU,CAAC,MAAM,GAAG,KAAK,CAAC,CAAC,CAAC,GAAG,KAAK,MAAM,UAAU,CAAC,MAAM,GAAG,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC;AAC7F,CAAC"}
@@ -26,6 +26,7 @@ import { type StrategyResult } from './verification-deterministic.js';
26
26
  export { runDeterministicStrategy, type DeterministicLogContext } from './verification-deterministic.js';
27
27
  import { type PendingVerification } from '../queries/verification.js';
28
28
  import type { DaemonConfig } from '../types/index.js';
29
+ import { type JudgeOptions } from './verification-commit-sharing.js';
29
30
  export { collectDefaultOnVerifications, resolveDaemonWideVerifyCap, resolveProductVerificationScopes, verificationSemaphore, VerificationSemaphore, __getVerificationSemaphoreForTests, __resetDefaultOnGuardForTests, __getDefaultOnGuardForTests, __markDefaultOnRanForTests, } from './verification-default-on.js';
30
31
  import { type InspectionResult } from './ai-inspection-runner.js';
31
32
  export declare function runBehavioralStrategy(): Promise<StrategyResult>;
@@ -67,7 +68,8 @@ export { MERGED_BACK_GIT_STATES, recordedMergeShaForVerify, type VerifyEvidenceD
67
68
  * Run verification for a single delivery.
68
69
  *
69
70
  * Ordering invariants:
70
- * 1. Run the strategy.
71
+ * 1. Judge: run the strategy -- or, given `opts.reused`, take the verdict
72
+ * already recorded for the commit the delivery is judged on.
71
73
  * 2. On verdict 'passed' with an injection node: retire injection FIRST
72
74
  * (verifyInjection runs the reality_tree_verify_injection compound op).
73
75
  * If retirement fails, the outcome demotes to 'pending' so the loop
@@ -80,16 +82,18 @@ export { MERGED_BACK_GIT_STATES, recordedMergeShaForVerify, type VerifyEvidenceD
80
82
  * Drift emission is best-effort: a single failure logs and continues so
81
83
  * one bad observation does not prevent the rest from being persisted.
82
84
  */
83
- export declare function runVerificationForDelivery(v: PendingVerification, deps: VerificationDeps): Promise<StrategyResult>;
84
- /**
85
- * One tick: fetch pending verifications across products, dispatch each.
86
- * Returns counts for telemetry.
87
- */
88
- export declare function runVerificationTick(config: DaemonConfig, deps?: Partial<VerificationDeps>): Promise<{
85
+ export declare function runVerificationForDelivery(v: PendingVerification, deps: VerificationDeps, opts?: JudgeOptions): Promise<StrategyResult>;
86
+ /** A tick's telemetry counts. */
87
+ type TickCounts = {
89
88
  checked: number;
90
89
  passed: number;
91
90
  failed: number;
92
91
  pending: number;
93
92
  escalated: number;
94
- }>;
93
+ };
94
+ /**
95
+ * One tick: fetch pending verifications across products, dispatch each.
96
+ * Returns counts for telemetry.
97
+ */
98
+ export declare function runVerificationTick(config: DaemonConfig, deps?: Partial<VerificationDeps>): Promise<TickCounts>;
95
99
  //# sourceMappingURL=verification-engine.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"verification-engine.d.ts","sourceRoot":"","sources":["../../src/verify/verification-engine.ts"],"names":[],"mappings":"AAWA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,EAAE,wBAAwB,EAAE,KAAK,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AACzG,OAAO,EAEL,KAAK,mBAAmB,EAGzB,MAAM,4BAA4B,CAAC;AAQpC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAatD,OAAO,EACL,6BAA6B,EAC7B,0BAA0B,EAC1B,gCAAgC,EAChC,qBAAqB,EACrB,qBAAqB,EACrB,kCAAkC,EAClC,6BAA6B,EAC7B,2BAA2B,EAC3B,0BAA0B,GAC3B,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,KAAK,gBAAgB,EACtB,MAAM,2BAA2B,CAAC;AAenC,wBAAsB,qBAAqB,IAAI,OAAO,CAAC,cAAc,CAAC,CAKrE;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,uBAAuB,CAC3C,IAAI,EAAE,gBAAgB,EACtB,CAAC,EAAE,mBAAmB,GACrB,OAAO,CAAC,cAAc,GAAG;IAAE,UAAU,CAAC,EAAE,gBAAgB,CAAA;CAAE,CAAC,CAmB7D;AAMD;;;;GAIG;AACH,YAAY,EAAE,0BAA0B,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC3F,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAO/D,OAAO,EACL,mBAAmB,EACnB,gCAAgC,EAChC,wBAAwB,GACzB,MAAM,gCAAgC,CAAC;AAYxC;;;;;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AO,CAAC,cAAc,CAAC,CAKrE;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,uBAAuB,CAC3C,IAAI,EAAE,gBAAgB,EACtB,CAAC,EAAE,mBAAmB,GACrB,OAAO,CAAC,cAAc,GAAG;IAAE,UAAU,CAAC,EAAE,gBAAgB,CAAA;CAAE,CAAC,CAmB7D;AAMD;;;;GAIG;AACH,YAAY,EAAE,0BAA0B,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC3F,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAO/D,OAAO,EACL,mBAAmB,EACnB,gCAAgC,EAChC,wBAAwB,GACzB,MAAM,gCAAgC,CAAC;AAWxC;;;;;;GAMG;AACH,OAAO,EACL,sBAAsB,EACtB,yBAAyB,EACzB,KAAK,kBAAkB,GACxB,MAAM,4BAA4B,CAAC;AAoDpC;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAsB,0BAA0B,CAC9C,CAAC,EAAE,mBAAmB,EACtB,IAAI,EAAE,gBAAgB,EACtB,IAAI,GAAE,YAAiB,GACtB,OAAO,CAAC,cAAc,CAAC,CA6YzB;AAED,iCAAiC;AACjC,KAAK,UAAU,GAAG;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAAC;AAoD1G;;;GAGG;AACH,wBAAsB,mBAAmB,CACvC,MAAM,EAAE,YAAY,EACpB,IAAI,CAAC,EAAE,OAAO,CAAC,gBAAgB,CAAC,GAC/B,OAAO,CAAC,UAAU,CAAC,CAuErB"}
@@ -1,19 +1,31 @@
1
1
  // PINNED-BY-BEGIN (generated by gen:pinned-by -- do not hand-edit; checked by lint:pinned-by)
2
- // Pinned by: packages/daemon/src/resolvers/verify-evidence-merged-back.test.ts,
2
+ // Pinned by: packages/daemon/src/integration/explicit-gate-outcome-restart.test.ts,
3
+ // packages/daemon/src/integration/explicit-verdict-departure-during-removal.test.ts,
4
+ // packages/daemon/src/integration/explicit-verdict-invalidation-restart.test.ts,
5
+ // packages/daemon/src/integration/explicit-verdict-reuse.test.ts,
6
+ // packages/daemon/src/integration/focus-commit-verdict-scenario.test.ts,
7
+ // packages/daemon/src/resolvers/verify-evidence-merged-back.test.ts,
3
8
  // packages/daemon/src/verify/shortfall-inward-proposal.test.ts,
9
+ // packages/daemon/src/verify/verification-attribution.test.ts,
10
+ // packages/daemon/src/verify/verification-commit-sharing.test.ts,
4
11
  // packages/daemon/src/verify/verification-default-on.test.ts,
5
12
  // packages/daemon/src/verify/verification-engine-real-paths.test.ts,
6
13
  // packages/daemon/src/verify/verification-engine.test.ts,
7
14
  // packages/daemon/src/verify/verification-run-config-source.test.ts,
8
15
  // packages/daemon/src/verify/verification-tick-product-scoping.test.ts,
9
- // packages/daemon/src/verify/verify-injection-evidence.test.ts
16
+ // packages/daemon/src/verify/verify-injection-evidence.test.ts,
17
+ // packages/daemon/src/verify/verify-unprovisioned-worktree.test.ts
10
18
  // PINNED-BY-END
11
19
  export { runDeterministicStrategy } from './verification-deterministic.js';
12
20
  import { emitObservedShortfallDrift, } from '../queries/verification.js';
13
21
  import { diagnoseEmptyDiffSource } from '../resolvers/index.js';
14
22
  import { collectDefaultOnVerifications, markDefaultOnRan, resolveDaemonWideVerifyCap, resolveProductVerificationScopes, verificationSemaphore, } from './verification-default-on.js';
15
- import { applyAttribution } from './verification-baseline.js';
16
- import { buildTimeoutFaultHold } from './verification-timeout-fault.js';
23
+ import { dispatchDefaultOnCandidate, dispatchExplicitCandidate, invalidateSupersededExplicitVerdicts, judgeDelivery } from './verification-commit-sharing.js';
24
+ import { collectRearmedExplicitVerifications } from './explicit-rearm.js';
25
+ import { explicitRunIdOf, recordExplicitGateOutcome, registerGateRun } from './gate-run-registry.js';
26
+ import { explicitGateKeyOf } from './commit-verdict-record.js';
27
+ import { judgedShaOfRun } from './gate-verdict-source.js';
28
+ import { runVerdictOf } from './rework-judgment.js';
17
29
  // Re-export the default-on selection + concurrency surface so existing
18
30
  // importers (and tests) can reach it through verification-engine.
19
31
  export { collectDefaultOnVerifications, resolveDaemonWideVerifyCap, resolveProductVerificationScopes, verificationSemaphore, VerificationSemaphore, __getVerificationSemaphoreForTests, __resetDefaultOnGuardForTests, __getDefaultOnGuardForTests, __markDefaultOnRanForTests, } from './verification-default-on.js';
@@ -70,7 +82,6 @@ import { defaultDeps } from './verification-deps-default.js';
70
82
  // daemon 800-line limit. Re-exported so existing importers/tests reach it here.
71
83
  export { VERIFY_BASE_REF_ENV, VERIFY_RECORDED_COMMIT_COUNT_ENV, resolveVerifyBoundaryEnv, } from './verification-boundary-env.js';
72
84
  import { runDeterministicAtFixedCommit } from './verification-checkout.js';
73
- import { noteDefaultOnResult } from './verification-default-on.js';
74
85
  const STRATEGIES = {
75
86
  // Judges a detached checkout of the focus HEAD, never the live worktree a team
76
87
  // may be moving (verify/verification-checkout.ts).
@@ -91,19 +102,41 @@ import { buildVerifyEvidence, summarizeEvidenceForInjection, describeMissingJudg
91
102
  * Record a verification outcome (a VERDICT only -- the reconciler owns the
92
103
  * verify -> done edge) and log it by delivery NAME, so a pass is visible in the
93
104
  * daemon log directly (not merely as a tick count) and the closing that follows
94
- * on review evidence reads as a distinct, later event. Extracted to keep
95
- * runVerificationForDelivery under the daemon per-function line limit.
105
+ * on review evidence reads as a distinct, later event. A 'pending' is a finished
106
+ * run that rendered NO verdict (a discarded checkout run, a pass demoted because
107
+ * injection retirement threw, an inconclusive inspection), so its line names the
108
+ * rationale recorded for it. Extracted to keep runVerificationForDelivery under
109
+ * the daemon per-function line limit.
110
+ *
111
+ * An EXPLICIT-METHOD row's outcome is also kept as its gate verdict: its run may
112
+ * write no per-commit record, and the review exit reads the outcome in its place.
113
+ * It is kept in process (verify/gate-run-registry.ts) AND on the delivery's
114
+ * gate_state after recordOutcome's pass reset (verify/explicit-gate-outcome.ts),
115
+ * under the gate the row applied, so a daemon restart still reads the verdict the
116
+ * run rendered, and a gate the row names later does not.
117
+ *
118
+ * The judged commit rides along, so a pass keeps a review route's stamp of that
119
+ * same commit (verify/verification-history-reset.ts).
96
120
  */
97
- async function recordAndLogOutcome(deps, v, outcome) {
98
- await deps.recordOutcome(v.deliveryId, outcome);
121
+ async function recordAndLogOutcome(deps, v, result) {
122
+ const { outcome, rationale } = result;
123
+ await deps.recordOutcome(v.deliveryId, outcome, judgedShaOfRun(result));
124
+ if (!v.defaultOnSource) {
125
+ const gateKey = explicitGateKeyOf(v.verificationMethod, v.verificationConfig);
126
+ recordExplicitGateOutcome(v.deliveryId, result, gateKey);
127
+ await deps.persistExplicitGateOutcome?.(v.deliveryId, result, gateKey, explicitRunIdOf(v));
128
+ }
129
+ const recorded = outcome !== 'pending' ? 'verdict only'
130
+ : `no verdict: ${rationale !== undefined && rationale.trim() !== '' ? rationale : '(no rationale recorded)'}`;
99
131
  log.info(`[verification] recorded outcome '${outcome}' for delivery ` +
100
- `"${v.deliveryName}" (${v.deliveryId}) -- verdict only; reconciler owns any status edge`);
132
+ `"${v.deliveryName}" (${v.deliveryId}) -- ${recorded}; reconciler owns any status edge`);
101
133
  }
102
134
  /**
103
135
  * Run verification for a single delivery.
104
136
  *
105
137
  * Ordering invariants:
106
- * 1. Run the strategy.
138
+ * 1. Judge: run the strategy -- or, given `opts.reused`, take the verdict
139
+ * already recorded for the commit the delivery is judged on.
107
140
  * 2. On verdict 'passed' with an injection node: retire injection FIRST
108
141
  * (verifyInjection runs the reality_tree_verify_injection compound op).
109
142
  * If retirement fails, the outcome demotes to 'pending' so the loop
@@ -116,10 +149,14 @@ async function recordAndLogOutcome(deps, v, outcome) {
116
149
  * Drift emission is best-effort: a single failure logs and continues so
117
150
  * one bad observation does not prevent the rest from being persisted.
118
151
  */
119
- export async function runVerificationForDelivery(v, deps) {
120
- const strategy = STRATEGIES[v.verificationMethod];
121
- const strategyResult = await strategy(deps, v);
122
- const result = { ...strategyResult };
152
+ export async function runVerificationForDelivery(v, deps, opts = {}) {
153
+ // Judge (verify/verification-commit-sharing.ts): the strategy's verdict or the
154
+ // commit's recorded one, baseline-attributed, and recorded against the commit.
155
+ const judged = await judgeDelivery(v, deps, () => STRATEGIES[v.verificationMethod](deps, v), opts);
156
+ const result = judged.result;
157
+ // Left verify while its run was in flight: the verdict is the commit's (recorded above) and routes nothing.
158
+ if (!judged.routes)
159
+ return result;
123
160
  // Instrument-fault tracking: set when the verify path could render NO verdict
124
161
  // about the WORK. Three origins share this hold and the SAME bounded
125
162
  // verify_failed re-work (evidence-unavailable guard, files no escalation):
@@ -129,56 +166,9 @@ export async function runVerificationForDelivery(v, deps) {
129
166
  // failing-test ids (a type-check crash / missing deps / a run that died
130
167
  // before any test ran), or was KILLED by its timeout before completing.
131
168
  // A blind or timed-out deterministic run must NEVER be laundered into a
132
- // differential pass; it routes here instead. Declared before the attribution
133
- // block so that block can set it.
134
- let evidenceUnavailableHold = null;
135
- // Baseline-diff attribution (deterministic only): a failed HEAD run whose
136
- // failures ALL pre-exist on the focus base introduced no regression -> demote
137
- // to 'passed' (the differential gate measures only the focus's delta). Runs
138
- // BEFORE the pass path so a demotion feeds injection retirement; a null
139
- // classification (no baseline) leaves the outcome unchanged (all failures gate).
140
- if (v.verificationMethod === 'deterministic' && result.outcome === 'failed') {
141
- if (result.timedOut) {
142
- // A killed-mid-run process produces garbage output that parses to zero ids;
143
- // do NOT attempt baseline attribution against it. Route straight to bounded
144
- // instrument-fault re-work -- a timeout is never a verdict about the work.
145
- evidenceUnavailableHold = buildTimeoutFaultHold(result);
146
- log.warn(`[verification] deterministic run timed out for delivery ${v.deliveryId} -- ` +
147
- `routing to bounded instrument-fault re-work (not a pass)`);
148
- }
149
- else if (deps.attributeFailures) {
150
- try {
151
- const classification = await deps.attributeFailures(v, result);
152
- if (classification) {
153
- const attributed = applyAttribution(v.deliveryId, classification);
154
- result.newFailures = attributed.newFailures;
155
- result.preExisting = attributed.preExisting;
156
- result.rationale = attributed.rationale;
157
- if (attributed.outcome === 'blind') {
158
- // Exited non-zero but zero parseable failing ids: the gate cannot
159
- // attribute the failure. Keep the run FAILED (never a differential
160
- // pass) and route it to the bounded instrument-fault re-work path.
161
- result.outcome = 'failed';
162
- evidenceUnavailableHold = {
163
- missing: ['attributable failing-test ids (deterministic run exited non-zero, parsed zero)'],
164
- commitsAhead: 0,
165
- deterministicFault: { kind: 'blind_zero_parse', exitCode: result.exitCode ?? null },
166
- };
167
- log.warn(`[verification] ${attributed.rationale} (delivery ${v.deliveryId}) -- ` +
168
- `routing to bounded instrument-fault re-work`);
169
- }
170
- else {
171
- result.outcome = attributed.outcome;
172
- if (attributed.log)
173
- log.info(attributed.log);
174
- }
175
- }
176
- }
177
- catch (err) {
178
- log.warn(`[verification] baseline attribution failed for delivery ${v.deliveryId}:`, err.message);
179
- }
180
- }
181
- }
169
+ // differential pass; it routes here instead. The judge step's attribution
170
+ // seeds it.
171
+ let evidenceUnavailableHold = judged.evidenceUnavailableHold;
182
172
  // Shortfall-origin tracking: set when the reconciliation demotes a PASSED
183
173
  // outcome to 'failed'. Feedback for a shortfall hold routes under its own
184
174
  // guard (not deterministic_verification), so the origin must survive to the
@@ -454,7 +444,7 @@ export async function runVerificationForDelivery(v, deps) {
454
444
  }
455
445
  }
456
446
  }
457
- await recordAndLogOutcome(deps, v, result.outcome);
447
+ await recordAndLogOutcome(deps, v, result);
458
448
  // Feedback dispatch by FAILURE ORIGIN. The three origins are mutually
459
449
  // exclusive: a shortfall / instrument-fault hold only demotes a PASSED
460
450
  // outcome, so a deterministic-failed run carries neither.
@@ -467,7 +457,7 @@ export async function runVerificationForDelivery(v, deps) {
467
457
  // holds; the iteration cap (verify_gate_unclearable) is the sole residue.
468
458
  if (evidenceUnavailableHold && deps.requeueEvidenceUnavailableAsRework) {
469
459
  try {
470
- await deps.requeueEvidenceUnavailableAsRework(v, evidenceUnavailableHold);
460
+ await deps.requeueEvidenceUnavailableAsRework(v, evidenceUnavailableHold, judgedShaOfRun(result), runVerdictOf(result, judged.evidenceUnavailableHold !== null));
471
461
  }
472
462
  catch (err) {
473
463
  log.warn(`[verification] evidence-unavailable re-work failed for delivery ${v.deliveryId}:`, err.message);
@@ -475,7 +465,7 @@ export async function runVerificationForDelivery(v, deps) {
475
465
  }
476
466
  else if (shortfallHold.length > 0 && deps.deliverShortfallFeedback) {
477
467
  try {
478
- await deps.deliverShortfallFeedback(v, shortfallHold);
468
+ await deps.deliverShortfallFeedback(v, shortfallHold, judgedShaOfRun(result), runVerdictOf(result, judged.evidenceUnavailableHold !== null));
479
469
  }
480
470
  catch (err) {
481
471
  log.warn(`[verification] shortfall feedback failed for delivery ${v.deliveryId}:`, err.message);
@@ -511,6 +501,53 @@ export async function runVerificationForDelivery(v, deps) {
511
501
  }
512
502
  return result;
513
503
  }
504
+ /**
505
+ * Dispatch one product's selected candidates, one at a time under the shared
506
+ * semaphore. Every candidate is registered as a selected gate run BEFORE any of
507
+ * them waits on the semaphore (verify/gate-run-registry.ts) -- a review exit about
508
+ * to send its delivery's work back waits for that verdict -- and each registration
509
+ * ends when its own dispatch settles. Before any wait, an explicit candidate's
510
+ * previous verdict is also removed from gate_state, and one whose removal did not
511
+ * land is not started. Default-on candidates share one run per
512
+ * focus commit, and neither kind starts or routes a run for a delivery that left
513
+ * verify (verify/verification-commit-sharing.ts).
514
+ */
515
+ async function dispatchSelected(selected, explicitIds, deps, counts) {
516
+ const registrations = selected.map((v) => registerGateRun({ deliveryId: v.deliveryId, focusId: v.focusId, explicit: explicitIds.has(v.deliveryId) }));
517
+ try {
518
+ const startable = await invalidateSupersededExplicitVerdicts(selected, explicitIds, registrations, deps);
519
+ for (const [i, v] of selected.entries()) {
520
+ if (!startable[i])
521
+ continue;
522
+ counts.checked += 1;
523
+ // Mark default-on candidates as run BEFORE dispatch so a mid-run failure
524
+ // does not re-enqueue the same 30-min suite on the next tick.
525
+ const defaultOnCandidate = v.verificationOutcome === null && !explicitIds.has(v.deliveryId);
526
+ if (defaultOnCandidate)
527
+ markDefaultOnRan(v.deliveryId);
528
+ // Cap concurrent whole-repo runs across overlapping ticks.
529
+ await verificationSemaphore.acquire();
530
+ try {
531
+ const r = defaultOnCandidate
532
+ ? await dispatchDefaultOnCandidate(v, deps, runVerificationForDelivery)
533
+ : await dispatchExplicitCandidate(v, deps, runVerificationForDelivery);
534
+ if (r)
535
+ counts[r.outcome] = (counts[r.outcome] ?? 0) + 1;
536
+ }
537
+ catch (err) {
538
+ log.warn(`[verification] tick failed for delivery ${v.deliveryId}:`, err.message);
539
+ }
540
+ finally {
541
+ verificationSemaphore.release();
542
+ registrations[i]?.end();
543
+ }
544
+ }
545
+ }
546
+ finally {
547
+ for (const registration of registrations)
548
+ registration.end();
549
+ }
550
+ }
514
551
  /**
515
552
  * One tick: fetch pending verifications across products, dispatch each.
516
553
  * Returns counts for telemetry.
@@ -545,6 +582,10 @@ export async function runVerificationTick(config, deps) {
545
582
  // repoPath manifest is malformed (resolved === undefined, logged at ERROR
546
583
  // above) still scans, arming only from judged commits (judgedCommitOnly).
547
584
  const explicitIds = new Set(pending.map((p) => p.deliveryId));
585
+ // An explicit row whose recorded pass judged an older commit is selected again (verify/explicit-rearm.ts).
586
+ const rearmed = await collectRearmedExplicitVerifications(productConfig, explicitIds, merged);
587
+ for (const r of rearmed)
588
+ explicitIds.add(r.deliveryId);
548
589
  const scanResolved = resolved ?? judgedCommitOnly;
549
590
  let defaultOn = [];
550
591
  if (scanResolved) {
@@ -555,30 +596,7 @@ export async function runVerificationTick(config, deps) {
555
596
  log.warn(`[verification] default-on scan failed for product ${product.id}:`, err.message);
556
597
  }
557
598
  }
558
- for (const v of [...pending, ...defaultOn]) {
559
- counts.checked += 1;
560
- // Mark default-on candidates as run BEFORE dispatch so a mid-run failure
561
- // does not re-enqueue the same 30-min suite on the next tick.
562
- const defaultOnCandidate = v.verificationOutcome === null && !explicitIds.has(v.deliveryId);
563
- if (defaultOnCandidate) {
564
- markDefaultOnRan(v.deliveryId);
565
- }
566
- // Cap concurrent whole-repo runs across overlapping ticks.
567
- await verificationSemaphore.acquire();
568
- try {
569
- const r = await runVerificationForDelivery(v, merged);
570
- // HEAD-keyed guard: a failed commit is not re-verified until HEAD moves.
571
- if (defaultOnCandidate)
572
- noteDefaultOnResult(v.deliveryId, r);
573
- counts[r.outcome] = (counts[r.outcome] ?? 0) + 1;
574
- }
575
- catch (err) {
576
- log.warn(`[verification] tick failed for delivery ${v.deliveryId}:`, err.message);
577
- }
578
- finally {
579
- verificationSemaphore.release();
580
- }
581
- }
599
+ await dispatchSelected([...pending, ...rearmed, ...defaultOn], explicitIds, merged, counts);
582
600
  }
583
601
  // Clean-environment install probe (Review Gate Hardening, deferrable): an
584
602
  // ADDITIONAL, out-of-band pass over manifest-touching verify deliveries,