@telora/daemon 0.22.97 → 0.22.131

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 (503) hide show
  1. package/build-info.json +4 -3
  2. package/dist/cli/verify-setup-config.d.ts +4 -3
  3. package/dist/cli/verify-setup-config.d.ts.map +1 -1
  4. package/dist/cli/verify-setup-config.js.map +1 -1
  5. package/dist/completion/commit-verdict-release.d.ts +49 -0
  6. package/dist/completion/commit-verdict-release.d.ts.map +1 -0
  7. package/dist/completion/commit-verdict-release.js +240 -0
  8. package/dist/completion/commit-verdict-release.js.map +1 -0
  9. package/dist/completion/completion-phase-registry.d.ts +10 -4
  10. package/dist/completion/completion-phase-registry.d.ts.map +1 -1
  11. package/dist/completion/completion-phase-registry.js +19 -7
  12. package/dist/completion/completion-phase-registry.js.map +1 -1
  13. package/dist/completion/detector.d.ts.map +1 -1
  14. package/dist/completion/detector.js +1 -0
  15. package/dist/completion/detector.js.map +1 -1
  16. package/dist/completion/event-entry-phases.d.ts +6 -3
  17. package/dist/completion/event-entry-phases.d.ts.map +1 -1
  18. package/dist/completion/event-entry-phases.js +135 -76
  19. package/dist/completion/event-entry-phases.js.map +1 -1
  20. package/dist/completion/event-phases.d.ts +24 -3
  21. package/dist/completion/event-phases.d.ts.map +1 -1
  22. package/dist/completion/event-phases.js +9 -9
  23. package/dist/completion/event-phases.js.map +1 -1
  24. package/dist/completion/event.d.ts +8 -0
  25. package/dist/completion/event.d.ts.map +1 -1
  26. package/dist/completion/event.js +47 -21
  27. package/dist/completion/event.js.map +1 -1
  28. package/dist/completion/exit-classification.d.ts.map +1 -1
  29. package/dist/completion/exit-classification.js +1 -0
  30. package/dist/completion/exit-classification.js.map +1 -1
  31. package/dist/completion/merge-phase.d.ts +21 -9
  32. package/dist/completion/merge-phase.d.ts.map +1 -1
  33. package/dist/completion/merge-phase.js +35 -10
  34. package/dist/completion/merge-phase.js.map +1 -1
  35. package/dist/completion/review-auto-approval-record.d.ts +19 -0
  36. package/dist/completion/review-auto-approval-record.d.ts.map +1 -0
  37. package/dist/completion/review-auto-approval-record.js +102 -0
  38. package/dist/completion/review-auto-approval-record.js.map +1 -0
  39. package/dist/completion/review-cycle-cap.d.ts +62 -0
  40. package/dist/completion/review-cycle-cap.d.ts.map +1 -0
  41. package/dist/completion/review-cycle-cap.js +180 -0
  42. package/dist/completion/review-cycle-cap.js.map +1 -0
  43. package/dist/completion/review-exit-deps.d.ts +17 -2
  44. package/dist/completion/review-exit-deps.d.ts.map +1 -1
  45. package/dist/completion/review-exit-deps.js +19 -2
  46. package/dist/completion/review-exit-deps.js.map +1 -1
  47. package/dist/completion/review-exit-escalations.d.ts +45 -23
  48. package/dist/completion/review-exit-escalations.d.ts.map +1 -1
  49. package/dist/completion/review-exit-escalations.js +15 -74
  50. package/dist/completion/review-exit-escalations.js.map +1 -1
  51. package/dist/completion/review-exit-evidence.d.ts +9 -0
  52. package/dist/completion/review-exit-evidence.d.ts.map +1 -1
  53. package/dist/completion/review-exit-evidence.js +4 -1
  54. package/dist/completion/review-exit-evidence.js.map +1 -1
  55. package/dist/completion/review-exit-foreign-findings.d.ts +151 -0
  56. package/dist/completion/review-exit-foreign-findings.d.ts.map +1 -0
  57. package/dist/completion/review-exit-foreign-findings.js +474 -0
  58. package/dist/completion/review-exit-foreign-findings.js.map +1 -0
  59. package/dist/completion/review-exit-phase.d.ts.map +1 -1
  60. package/dist/completion/review-exit-phase.js +71 -64
  61. package/dist/completion/review-exit-phase.js.map +1 -1
  62. package/dist/completion/review-exit-progress.d.ts +20 -0
  63. package/dist/completion/review-exit-progress.d.ts.map +1 -1
  64. package/dist/completion/review-exit-progress.js +28 -19
  65. package/dist/completion/review-exit-progress.js.map +1 -1
  66. package/dist/completion/review-exit-rehoming.d.ts +5 -0
  67. package/dist/completion/review-exit-rehoming.d.ts.map +1 -1
  68. package/dist/completion/review-exit-rehoming.js.map +1 -1
  69. package/dist/completion/review-exit-verdict-gate.d.ts +202 -0
  70. package/dist/completion/review-exit-verdict-gate.d.ts.map +1 -0
  71. package/dist/completion/review-exit-verdict-gate.js +228 -0
  72. package/dist/completion/review-exit-verdict-gate.js.map +1 -0
  73. package/dist/completion/review-next-step.d.ts +62 -0
  74. package/dist/completion/review-next-step.d.ts.map +1 -0
  75. package/dist/completion/review-next-step.js +63 -0
  76. package/dist/completion/review-next-step.js.map +1 -0
  77. package/dist/completion/session-hold-sweep-deps.d.ts +17 -0
  78. package/dist/completion/session-hold-sweep-deps.d.ts.map +1 -0
  79. package/dist/completion/session-hold-sweep-deps.js +89 -0
  80. package/dist/completion/session-hold-sweep-deps.js.map +1 -0
  81. package/dist/completion/session-hold.d.ts +180 -0
  82. package/dist/completion/session-hold.d.ts.map +1 -0
  83. package/dist/completion/session-hold.js +238 -0
  84. package/dist/completion/session-hold.js.map +1 -0
  85. package/dist/completion/state-cascade.d.ts +19 -0
  86. package/dist/completion/state-cascade.d.ts.map +1 -1
  87. package/dist/completion/state-cascade.js +85 -31
  88. package/dist/completion/state-cascade.js.map +1 -1
  89. package/dist/completion/team-lifecycle.d.ts +35 -2
  90. package/dist/completion/team-lifecycle.d.ts.map +1 -1
  91. package/dist/completion/team-lifecycle.js +165 -94
  92. package/dist/completion/team-lifecycle.js.map +1 -1
  93. package/dist/completion/team-phase.d.ts +27 -15
  94. package/dist/completion/team-phase.d.ts.map +1 -1
  95. package/dist/completion/team-phase.js +34 -15
  96. package/dist/completion/team-phase.js.map +1 -1
  97. package/dist/delivery/commit-verdict-hold.d.ts +55 -0
  98. package/dist/delivery/commit-verdict-hold.d.ts.map +1 -0
  99. package/dist/delivery/commit-verdict-hold.js +118 -0
  100. package/dist/delivery/commit-verdict-hold.js.map +1 -0
  101. package/dist/directive/directive-dispatch.d.ts.map +1 -1
  102. package/dist/directive/directive-dispatch.js +10 -3
  103. package/dist/directive/directive-dispatch.js.map +1 -1
  104. package/dist/directive/directive-executor.d.ts.map +1 -1
  105. package/dist/directive/directive-executor.js +1 -0
  106. package/dist/directive/directive-executor.js.map +1 -1
  107. package/dist/directive/directive-queue.d.ts.map +1 -1
  108. package/dist/directive/directive-queue.js +6 -1
  109. package/dist/directive/directive-queue.js.map +1 -1
  110. package/dist/directive/phase-sync.d.ts +29 -2
  111. package/dist/directive/phase-sync.d.ts.map +1 -1
  112. package/dist/directive/phase-sync.js +30 -6
  113. package/dist/directive/phase-sync.js.map +1 -1
  114. package/dist/drift/artifact-ref-shape.d.ts +34 -0
  115. package/dist/drift/artifact-ref-shape.d.ts.map +1 -0
  116. package/dist/drift/artifact-ref-shape.js +94 -0
  117. package/dist/drift/artifact-ref-shape.js.map +1 -0
  118. package/dist/drift/drift-eval-loop.d.ts +7 -0
  119. package/dist/drift/drift-eval-loop.d.ts.map +1 -1
  120. package/dist/drift/drift-eval-loop.js +34 -5
  121. package/dist/drift/drift-eval-loop.js.map +1 -1
  122. package/dist/drift/drift-evaluator.d.ts.map +1 -1
  123. package/dist/drift/drift-evaluator.js +8 -3
  124. package/dist/drift/drift-evaluator.js.map +1 -1
  125. package/dist/focus/awaiting-slot.d.ts +34 -0
  126. package/dist/focus/awaiting-slot.d.ts.map +1 -0
  127. package/dist/focus/awaiting-slot.js +26 -0
  128. package/dist/focus/awaiting-slot.js.map +1 -0
  129. package/dist/focus/focus-lifecycle.js +2 -2
  130. package/dist/focus/focus-lifecycle.js.map +1 -1
  131. package/dist/focus/focus-phase.d.ts.map +1 -1
  132. package/dist/focus/focus-phase.js +3 -1
  133. package/dist/focus/focus-phase.js.map +1 -1
  134. package/dist/focus/focus-spawn-decision.d.ts +62 -0
  135. package/dist/focus/focus-spawn-decision.d.ts.map +1 -0
  136. package/dist/focus/focus-spawn-decision.js +41 -0
  137. package/dist/focus/focus-spawn-decision.js.map +1 -0
  138. package/dist/focus/focus-team-state.d.ts.map +1 -1
  139. package/dist/focus/focus-team-state.js +1 -13
  140. package/dist/focus/focus-team-state.js.map +1 -1
  141. package/dist/focus/listener-spawn.d.ts +16 -55
  142. package/dist/focus/listener-spawn.d.ts.map +1 -1
  143. package/dist/focus/listener-spawn.js +102 -64
  144. package/dist/focus/listener-spawn.js.map +1 -1
  145. package/dist/focus/listener-state.d.ts.map +1 -1
  146. package/dist/focus/listener-state.js +4 -1
  147. package/dist/focus/listener-state.js.map +1 -1
  148. package/dist/focus/listener.d.ts +41 -2
  149. package/dist/focus/listener.d.ts.map +1 -1
  150. package/dist/focus/listener.js +135 -83
  151. package/dist/focus/listener.js.map +1 -1
  152. package/dist/focus/pending-spawn-pass-deps.d.ts +69 -0
  153. package/dist/focus/pending-spawn-pass-deps.d.ts.map +1 -0
  154. package/dist/focus/pending-spawn-pass-deps.js +34 -0
  155. package/dist/focus/pending-spawn-pass-deps.js.map +1 -0
  156. package/dist/focus/pending-spawn-review-next-step.d.ts +83 -0
  157. package/dist/focus/pending-spawn-review-next-step.d.ts.map +1 -0
  158. package/dist/focus/pending-spawn-review-next-step.js +325 -0
  159. package/dist/focus/pending-spawn-review-next-step.js.map +1 -0
  160. package/dist/focus/review-cycle-cap-hold.d.ts +132 -0
  161. package/dist/focus/review-cycle-cap-hold.d.ts.map +1 -0
  162. package/dist/focus/review-cycle-cap-hold.js +178 -0
  163. package/dist/focus/review-cycle-cap-hold.js.map +1 -0
  164. package/dist/focus/team-actionable-work.js +2 -2
  165. package/dist/focus/verify-open-issues.d.ts +22 -0
  166. package/dist/focus/verify-open-issues.d.ts.map +1 -1
  167. package/dist/focus/verify-open-issues.js +118 -57
  168. package/dist/focus/verify-open-issues.js.map +1 -1
  169. package/dist/focus/verify-routing-passes.d.ts +32 -0
  170. package/dist/focus/verify-routing-passes.d.ts.map +1 -0
  171. package/dist/focus/verify-routing-passes.js +18 -0
  172. package/dist/focus/verify-routing-passes.js.map +1 -0
  173. package/dist/git/exec.d.ts.map +1 -1
  174. package/dist/git/exec.js +2 -1
  175. package/dist/git/exec.js.map +1 -1
  176. package/dist/git/index.d.ts.map +1 -1
  177. package/dist/git/index.js +9 -5
  178. package/dist/git/index.js.map +1 -1
  179. package/dist/merge/focus-merge.d.ts +16 -2
  180. package/dist/merge/focus-merge.d.ts.map +1 -1
  181. package/dist/merge/focus-merge.js +53 -30
  182. package/dist/merge/focus-merge.js.map +1 -1
  183. package/dist/merge/merge-back-loop.d.ts +5 -0
  184. package/dist/merge/merge-back-loop.d.ts.map +1 -1
  185. package/dist/merge/merge-back-loop.js +17 -8
  186. package/dist/merge/merge-back-loop.js.map +1 -1
  187. package/dist/merge/merge-gate-coverage.d.ts +94 -0
  188. package/dist/merge/merge-gate-coverage.d.ts.map +1 -0
  189. package/dist/merge/merge-gate-coverage.js +217 -0
  190. package/dist/merge/merge-gate-coverage.js.map +1 -0
  191. package/dist/prompt/focus-prompt-builder.d.ts.map +1 -1
  192. package/dist/prompt/focus-prompt-builder.js +6 -0
  193. package/dist/prompt/focus-prompt-builder.js.map +1 -1
  194. package/dist/prompt/prompt-listing.d.ts.map +1 -1
  195. package/dist/prompt/prompt-listing.js +8 -0
  196. package/dist/prompt/prompt-listing.js.map +1 -1
  197. package/dist/prompt/team-prompt-base.d.ts.map +1 -1
  198. package/dist/prompt/team-prompt-base.js +5 -1
  199. package/dist/prompt/team-prompt-base.js.map +1 -1
  200. package/dist/prompt-sections/execution-sections.d.ts.map +1 -1
  201. package/dist/prompt-sections/execution-sections.js +14 -39
  202. package/dist/prompt-sections/execution-sections.js.map +1 -1
  203. package/dist/prompt-sections/gate-ownership.d.ts +36 -0
  204. package/dist/prompt-sections/gate-ownership.d.ts.map +1 -0
  205. package/dist/prompt-sections/gate-ownership.js +68 -0
  206. package/dist/prompt-sections/gate-ownership.js.map +1 -0
  207. package/dist/prompt-sections/gate-verdict-section.d.ts +58 -0
  208. package/dist/prompt-sections/gate-verdict-section.d.ts.map +1 -0
  209. package/dist/prompt-sections/gate-verdict-section.js +88 -0
  210. package/dist/prompt-sections/gate-verdict-section.js.map +1 -0
  211. package/dist/prompt-sections/persona-sections.d.ts +10 -0
  212. package/dist/prompt-sections/persona-sections.d.ts.map +1 -1
  213. package/dist/prompt-sections/persona-sections.js +35 -11
  214. package/dist/prompt-sections/persona-sections.js.map +1 -1
  215. package/dist/prompt-sections/shared.js +1 -1
  216. package/dist/prompt-sections/shared.js.map +1 -1
  217. package/dist/queries/agent-resolvable-promotion.d.ts +6 -3
  218. package/dist/queries/agent-resolvable-promotion.d.ts.map +1 -1
  219. package/dist/queries/agent-resolvable-promotion.js +20 -9
  220. package/dist/queries/agent-resolvable-promotion.js.map +1 -1
  221. package/dist/queries/deliveries.d.ts +46 -4
  222. package/dist/queries/deliveries.d.ts.map +1 -1
  223. package/dist/queries/deliveries.js +69 -16
  224. package/dist/queries/deliveries.js.map +1 -1
  225. package/dist/queries/delivery-gate-state.d.ts +159 -1
  226. package/dist/queries/delivery-gate-state.d.ts.map +1 -1
  227. package/dist/queries/delivery-gate-state.js +95 -14
  228. package/dist/queries/delivery-gate-state.js.map +1 -1
  229. package/dist/queries/delivery-write-discipline.d.ts +65 -0
  230. package/dist/queries/delivery-write-discipline.d.ts.map +1 -0
  231. package/dist/queries/delivery-write-discipline.js +101 -0
  232. package/dist/queries/delivery-write-discipline.js.map +1 -0
  233. package/dist/queries/escalation-consumption.d.ts +11 -0
  234. package/dist/queries/escalation-consumption.d.ts.map +1 -1
  235. package/dist/queries/escalation-consumption.js +22 -0
  236. package/dist/queries/escalation-consumption.js.map +1 -1
  237. package/dist/queries/escalation-spool.d.ts +75 -0
  238. package/dist/queries/escalation-spool.d.ts.map +1 -0
  239. package/dist/queries/escalation-spool.js +232 -0
  240. package/dist/queries/escalation-spool.js.map +1 -0
  241. package/dist/queries/escalation-suppression.d.ts.map +1 -1
  242. package/dist/queries/escalation-suppression.js +2 -0
  243. package/dist/queries/escalation-suppression.js.map +1 -1
  244. package/dist/queries/escalations.js +1 -1
  245. package/dist/queries/filing-observation.d.ts.map +1 -1
  246. package/dist/queries/filing-observation.js +2 -0
  247. package/dist/queries/filing-observation.js.map +1 -1
  248. package/dist/queries/focus-discovery.d.ts +4 -4
  249. package/dist/queries/focus-discovery.d.ts.map +1 -1
  250. package/dist/queries/focus-discovery.js +1 -0
  251. package/dist/queries/focus-discovery.js.map +1 -1
  252. package/dist/queries/focus-review-approval.d.ts +84 -0
  253. package/dist/queries/focus-review-approval.d.ts.map +1 -0
  254. package/dist/queries/focus-review-approval.js +158 -0
  255. package/dist/queries/focus-review-approval.js.map +1 -0
  256. package/dist/queries/focuses.d.ts +6 -5
  257. package/dist/queries/focuses.d.ts.map +1 -1
  258. package/dist/queries/focuses.js +9 -5
  259. package/dist/queries/focuses.js.map +1 -1
  260. package/dist/queries/incident-correlation.d.ts +5 -4
  261. package/dist/queries/incident-correlation.d.ts.map +1 -1
  262. package/dist/queries/incident-correlation.js +11 -5
  263. package/dist/queries/incident-correlation.js.map +1 -1
  264. package/dist/queries/issues.d.ts.map +1 -1
  265. package/dist/queries/issues.js +2 -1
  266. package/dist/queries/issues.js.map +1 -1
  267. package/dist/queries/loop-refusal-observation.d.ts +64 -0
  268. package/dist/queries/loop-refusal-observation.d.ts.map +1 -0
  269. package/dist/queries/loop-refusal-observation.js +137 -0
  270. package/dist/queries/loop-refusal-observation.js.map +1 -0
  271. package/dist/queries/schemas.d.ts +9 -0
  272. package/dist/queries/schemas.d.ts.map +1 -1
  273. package/dist/queries/schemas.js +11 -3
  274. package/dist/queries/schemas.js.map +1 -1
  275. package/dist/queries/shared.js +1 -1
  276. package/dist/queries/verification.d.ts +15 -0
  277. package/dist/queries/verification.d.ts.map +1 -1
  278. package/dist/queries/verification.js +1 -14
  279. package/dist/queries/verification.js.map +1 -1
  280. package/dist/queries/wire-contract.generated.d.ts +3 -0
  281. package/dist/queries/wire-contract.generated.d.ts.map +1 -1
  282. package/dist/queries/wire-contract.generated.js +3 -0
  283. package/dist/queries/wire-contract.generated.js.map +1 -1
  284. package/dist/resolvers/assembly-engine.d.ts.map +1 -1
  285. package/dist/resolvers/assembly-engine.js +3 -1
  286. package/dist/resolvers/assembly-engine.js.map +1 -1
  287. package/dist/resolvers/git-diff-against-base.d.ts +5 -2
  288. package/dist/resolvers/git-diff-against-base.d.ts.map +1 -1
  289. package/dist/resolvers/git-diff-against-base.js +121 -39
  290. package/dist/resolvers/git-diff-against-base.js.map +1 -1
  291. package/dist/resolvers/shared/git-diff.d.ts +2 -0
  292. package/dist/resolvers/shared/git-diff.d.ts.map +1 -1
  293. package/dist/resolvers/shared/git-diff.js +5 -1
  294. package/dist/resolvers/shared/git-diff.js.map +1 -1
  295. package/dist/resolvers/shared/review-window-commits.d.ts +96 -0
  296. package/dist/resolvers/shared/review-window-commits.d.ts.map +1 -0
  297. package/dist/resolvers/shared/review-window-commits.js +262 -0
  298. package/dist/resolvers/shared/review-window-commits.js.map +1 -0
  299. package/dist/session/session-lineage.d.ts.map +1 -1
  300. package/dist/session/session-lineage.js +4 -1
  301. package/dist/session/session-lineage.js.map +1 -1
  302. package/dist/shell/config.d.ts.map +1 -1
  303. package/dist/shell/config.js +10 -9
  304. package/dist/shell/config.js.map +1 -1
  305. package/dist/shell/fail-stop.d.ts +18 -0
  306. package/dist/shell/fail-stop.d.ts.map +1 -0
  307. package/dist/shell/fail-stop.js +53 -0
  308. package/dist/shell/fail-stop.js.map +1 -0
  309. package/dist/shell/graceful-shutdown.d.ts +48 -0
  310. package/dist/shell/graceful-shutdown.d.ts.map +1 -0
  311. package/dist/shell/graceful-shutdown.js +152 -0
  312. package/dist/shell/graceful-shutdown.js.map +1 -0
  313. package/dist/shell/heartbeat.d.ts.map +1 -1
  314. package/dist/shell/heartbeat.js +5 -4
  315. package/dist/shell/heartbeat.js.map +1 -1
  316. package/dist/shell/log.d.ts.map +1 -1
  317. package/dist/shell/log.js +4 -1
  318. package/dist/shell/log.js.map +1 -1
  319. package/dist/shell/stop-request.d.ts.map +1 -1
  320. package/dist/shell/stop-request.js +2 -1
  321. package/dist/shell/stop-request.js.map +1 -1
  322. package/dist/shell/unified-shell-status.d.ts +6 -0
  323. package/dist/shell/unified-shell-status.d.ts.map +1 -1
  324. package/dist/shell/unified-shell-status.js +9 -2
  325. package/dist/shell/unified-shell-status.js.map +1 -1
  326. package/dist/shell/unified-shell.d.ts.map +1 -1
  327. package/dist/shell/unified-shell.js +41 -114
  328. package/dist/shell/unified-shell.js.map +1 -1
  329. package/dist/spawn/lifecycle.d.ts +12 -0
  330. package/dist/spawn/lifecycle.d.ts.map +1 -1
  331. package/dist/spawn/lifecycle.js +25 -21
  332. package/dist/spawn/lifecycle.js.map +1 -1
  333. package/dist/spawn/prompt-assembly.d.ts +19 -1
  334. package/dist/spawn/prompt-assembly.d.ts.map +1 -1
  335. package/dist/spawn/prompt-assembly.js +70 -21
  336. package/dist/spawn/prompt-assembly.js.map +1 -1
  337. package/dist/spawn/review-hold-park.d.ts.map +1 -1
  338. package/dist/spawn/review-hold-park.js +18 -8
  339. package/dist/spawn/review-hold-park.js.map +1 -1
  340. package/dist/spawn/spawn-cooldown.d.ts.map +1 -1
  341. package/dist/spawn/spawn-cooldown.js +4 -0
  342. package/dist/spawn/spawn-cooldown.js.map +1 -1
  343. package/dist/spawn/spawn-decision.d.ts.map +1 -1
  344. package/dist/spawn/spawn-decision.js +2 -1
  345. package/dist/spawn/spawn-decision.js.map +1 -1
  346. package/dist/spawn/worktree-session.d.ts +6 -0
  347. package/dist/spawn/worktree-session.d.ts.map +1 -1
  348. package/dist/spawn/worktree-session.js +15 -2
  349. package/dist/spawn/worktree-session.js.map +1 -1
  350. package/dist/testing/fixtures/index.d.ts +10 -1
  351. package/dist/testing/fixtures/index.d.ts.map +1 -1
  352. package/dist/testing/fixtures/index.js +59 -1
  353. package/dist/testing/fixtures/index.js.map +1 -1
  354. package/dist/testing/fixtures/pending-spawn-world.d.ts +34 -0
  355. package/dist/testing/fixtures/pending-spawn-world.d.ts.map +1 -0
  356. package/dist/testing/fixtures/pending-spawn-world.js +92 -0
  357. package/dist/testing/fixtures/pending-spawn-world.js.map +1 -0
  358. package/dist/types/config.d.ts +9 -6
  359. package/dist/types/config.d.ts.map +1 -1
  360. package/dist/types/index.js +1 -1
  361. package/dist/verify/commit-gate-configured.d.ts +86 -0
  362. package/dist/verify/commit-gate-configured.d.ts.map +1 -0
  363. package/dist/verify/commit-gate-configured.js +234 -0
  364. package/dist/verify/commit-gate-configured.js.map +1 -0
  365. package/dist/verify/commit-verdict-record.d.ts +98 -0
  366. package/dist/verify/commit-verdict-record.d.ts.map +1 -0
  367. package/dist/verify/commit-verdict-record.js +297 -0
  368. package/dist/verify/commit-verdict-record.js.map +1 -0
  369. package/dist/verify/explicit-gate-outcome.d.ts +161 -0
  370. package/dist/verify/explicit-gate-outcome.d.ts.map +1 -0
  371. package/dist/verify/explicit-gate-outcome.js +215 -0
  372. package/dist/verify/explicit-gate-outcome.js.map +1 -0
  373. package/dist/verify/explicit-rearm.d.ts +27 -0
  374. package/dist/verify/explicit-rearm.d.ts.map +1 -0
  375. package/dist/verify/explicit-rearm.js +161 -0
  376. package/dist/verify/explicit-rearm.js.map +1 -0
  377. package/dist/verify/explicit-run-ledger.d.ts +26 -0
  378. package/dist/verify/explicit-run-ledger.d.ts.map +1 -0
  379. package/dist/verify/explicit-run-ledger.js +93 -0
  380. package/dist/verify/explicit-run-ledger.js.map +1 -0
  381. package/dist/verify/failure-signature.d.ts.map +1 -1
  382. package/dist/verify/failure-signature.js +5 -1
  383. package/dist/verify/failure-signature.js.map +1 -1
  384. package/dist/verify/gate-run-registry.d.ts +105 -0
  385. package/dist/verify/gate-run-registry.d.ts.map +1 -0
  386. package/dist/verify/gate-run-registry.js +111 -0
  387. package/dist/verify/gate-run-registry.js.map +1 -0
  388. package/dist/verify/gate-verdict-source.d.ts +68 -0
  389. package/dist/verify/gate-verdict-source.d.ts.map +1 -0
  390. package/dist/verify/gate-verdict-source.js +143 -0
  391. package/dist/verify/gate-verdict-source.js.map +1 -0
  392. package/dist/verify/judged-commit-gate.d.ts +11 -0
  393. package/dist/verify/judged-commit-gate.d.ts.map +1 -0
  394. package/dist/verify/judged-commit-gate.js +48 -0
  395. package/dist/verify/judged-commit-gate.js.map +1 -0
  396. package/dist/verify/rework-judgment.d.ts +58 -0
  397. package/dist/verify/rework-judgment.d.ts.map +1 -0
  398. package/dist/verify/rework-judgment.js +54 -0
  399. package/dist/verify/rework-judgment.js.map +1 -0
  400. package/dist/verify/verification-attribution.d.ts +105 -0
  401. package/dist/verify/verification-attribution.d.ts.map +1 -0
  402. package/dist/verify/verification-attribution.js +322 -0
  403. package/dist/verify/verification-attribution.js.map +1 -0
  404. package/dist/verify/verification-baseline-run.d.ts +123 -0
  405. package/dist/verify/verification-baseline-run.d.ts.map +1 -0
  406. package/dist/verify/verification-baseline-run.js +386 -0
  407. package/dist/verify/verification-baseline-run.js.map +1 -0
  408. package/dist/verify/verification-baseline.d.ts +117 -28
  409. package/dist/verify/verification-baseline.d.ts.map +1 -1
  410. package/dist/verify/verification-baseline.js +147 -120
  411. package/dist/verify/verification-baseline.js.map +1 -1
  412. package/dist/verify/verification-checkout.d.ts +32 -6
  413. package/dist/verify/verification-checkout.d.ts.map +1 -1
  414. package/dist/verify/verification-checkout.js +132 -8
  415. package/dist/verify/verification-checkout.js.map +1 -1
  416. package/dist/verify/verification-commit-sharing.d.ts +84 -0
  417. package/dist/verify/verification-commit-sharing.d.ts.map +1 -0
  418. package/dist/verify/verification-commit-sharing.js +416 -0
  419. package/dist/verify/verification-commit-sharing.js.map +1 -0
  420. package/dist/verify/verification-config.d.ts +76 -0
  421. package/dist/verify/verification-config.d.ts.map +1 -1
  422. package/dist/verify/verification-config.js +112 -14
  423. package/dist/verify/verification-config.js.map +1 -1
  424. package/dist/verify/verification-default-on.d.ts +102 -19
  425. package/dist/verify/verification-default-on.d.ts.map +1 -1
  426. package/dist/verify/verification-default-on.js +307 -38
  427. package/dist/verify/verification-default-on.js.map +1 -1
  428. package/dist/verify/verification-deps-default.d.ts.map +1 -1
  429. package/dist/verify/verification-deps-default.js +50 -43
  430. package/dist/verify/verification-deps-default.js.map +1 -1
  431. package/dist/verify/verification-deps.d.ts +86 -7
  432. package/dist/verify/verification-deps.d.ts.map +1 -1
  433. package/dist/verify/verification-deterministic.d.ts +56 -2
  434. package/dist/verify/verification-deterministic.d.ts.map +1 -1
  435. package/dist/verify/verification-deterministic.js +44 -25
  436. package/dist/verify/verification-deterministic.js.map +1 -1
  437. package/dist/verify/verification-diagnostics.d.ts +16 -0
  438. package/dist/verify/verification-diagnostics.d.ts.map +1 -0
  439. package/dist/verify/verification-diagnostics.js +219 -0
  440. package/dist/verify/verification-diagnostics.js.map +1 -0
  441. package/dist/verify/verification-engine.d.ts +12 -8
  442. package/dist/verify/verification-engine.d.ts.map +1 -1
  443. package/dist/verify/verification-engine.js +118 -102
  444. package/dist/verify/verification-engine.js.map +1 -1
  445. package/dist/verify/verification-evidence-unavailable-feedback.d.ts +2 -1
  446. package/dist/verify/verification-evidence-unavailable-feedback.d.ts.map +1 -1
  447. package/dist/verify/verification-evidence-unavailable-feedback.js +19 -5
  448. package/dist/verify/verification-evidence-unavailable-feedback.js.map +1 -1
  449. package/dist/verify/verification-feedback.d.ts +21 -34
  450. package/dist/verify/verification-feedback.d.ts.map +1 -1
  451. package/dist/verify/verification-feedback.js +37 -88
  452. package/dist/verify/verification-feedback.js.map +1 -1
  453. package/dist/verify/verification-gate-stages.d.ts +110 -0
  454. package/dist/verify/verification-gate-stages.d.ts.map +1 -0
  455. package/dist/verify/verification-gate-stages.js +179 -0
  456. package/dist/verify/verification-gate-stages.js.map +1 -0
  457. package/dist/verify/verification-history-reset.d.ts +61 -0
  458. package/dist/verify/verification-history-reset.d.ts.map +1 -0
  459. package/dist/verify/verification-history-reset.js +90 -0
  460. package/dist/verify/verification-history-reset.js.map +1 -0
  461. package/dist/verify/verification-manifest.d.ts.map +1 -1
  462. package/dist/verify/verification-manifest.js +3 -1
  463. package/dist/verify/verification-manifest.js.map +1 -1
  464. package/dist/verify/verification-rework-messages.d.ts +19 -0
  465. package/dist/verify/verification-rework-messages.d.ts.map +1 -0
  466. package/dist/verify/verification-rework-messages.js +52 -0
  467. package/dist/verify/verification-rework-messages.js.map +1 -0
  468. package/dist/verify/verification-timeout-fault.d.ts +147 -0
  469. package/dist/verify/verification-timeout-fault.d.ts.map +1 -0
  470. package/dist/verify/verification-timeout-fault.js +211 -0
  471. package/dist/verify/verification-timeout-fault.js.map +1 -0
  472. package/dist/verify/verify-gate-stall.d.ts +5 -1
  473. package/dist/verify/verify-gate-stall.d.ts.map +1 -1
  474. package/dist/verify/verify-gate-stall.js +10 -1
  475. package/dist/verify/verify-gate-stall.js.map +1 -1
  476. package/dist/worktree/install-inputs.d.ts +89 -0
  477. package/dist/worktree/install-inputs.d.ts.map +1 -0
  478. package/dist/worktree/install-inputs.js +625 -0
  479. package/dist/worktree/install-inputs.js.map +1 -0
  480. package/dist/worktree/install-script-effects.d.ts +30 -0
  481. package/dist/worktree/install-script-effects.d.ts.map +1 -0
  482. package/dist/worktree/install-script-effects.js +524 -0
  483. package/dist/worktree/install-script-effects.js.map +1 -0
  484. package/dist/worktree/install-script-tokens.d.ts +57 -0
  485. package/dist/worktree/install-script-tokens.d.ts.map +1 -0
  486. package/dist/worktree/install-script-tokens.js +299 -0
  487. package/dist/worktree/install-script-tokens.js.map +1 -0
  488. package/dist/worktree/provision.d.ts +27 -4
  489. package/dist/worktree/provision.d.ts.map +1 -1
  490. package/dist/worktree/provision.js +46 -7
  491. package/dist/worktree/provision.js.map +1 -1
  492. package/dist/worktree/safety.d.ts +11 -0
  493. package/dist/worktree/safety.d.ts.map +1 -1
  494. package/dist/worktree/safety.js +20 -3
  495. package/dist/worktree/safety.js.map +1 -1
  496. package/dist/worktree/verify-interlock.d.ts.map +1 -1
  497. package/dist/worktree/verify-interlock.js +3 -1
  498. package/dist/worktree/verify-interlock.js.map +1 -1
  499. package/dist/worktree/worktree-package-provisioning.d.ts +75 -0
  500. package/dist/worktree/worktree-package-provisioning.d.ts.map +1 -0
  501. package/dist/worktree/worktree-package-provisioning.js +362 -0
  502. package/dist/worktree/worktree-package-provisioning.js.map +1 -0
  503. package/package.json +1 -1
@@ -0,0 +1,16 @@
1
+ /** The roots a verify log names for itself: every `(cwd: <path>)` preamble line. */
2
+ export declare function logCwdRoots(logText: string): string[];
3
+ /**
4
+ * The diagnostic signatures of one red stage's log segment (module doc), sorted.
5
+ * `roots` are checkout paths to strip in addition to those the text names.
6
+ */
7
+ export declare function diagnosticSignatures(stageLines: readonly string[], roots?: readonly string[]): string[];
8
+ /**
9
+ * The head signatures the base does not cover, as a multiset difference (a
10
+ * signature the head reports N times and the base M < N times contributes N - M
11
+ * copies). Empty means covered. Sorted.
12
+ */
13
+ export declare function uncoveredDiagnostics(head: readonly string[], base: readonly string[]): string[];
14
+ /** A short, bounded rendering of diagnostics for a rationale. */
15
+ export declare function describeDiagnostics(signatures: readonly string[], limit?: number): string;
16
+ //# sourceMappingURL=verification-diagnostics.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"verification-diagnostics.d.ts","sourceRoot":"","sources":["../../src/verify/verification-diagnostics.ts"],"names":[],"mappings":"AAgFA,oFAAoF;AACpF,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CAOrD;AAqGD;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,UAAU,EAAE,SAAS,MAAM,EAAE,EAAE,KAAK,GAAE,SAAS,MAAM,EAAO,GAAG,MAAM,EAAE,CAU3G;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,EAAE,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,EAAE,CAU/F;AAED,iEAAiE;AACjE,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,SAAS,MAAM,EAAE,EAAE,KAAK,SAAI,GAAG,MAAM,CAGpF"}
@@ -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":"","sources":["../../src/verify/verification-diagnostics.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,yEAAyE;AACzE,gBAAgB;AAEhB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AAEH,MAAM,GAAG,GAAG,MAAM,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC;AACpC,MAAM,OAAO,GAAG,IAAI,MAAM,CAAC,GAAG,GAAG,qBAAqB,EAAE,GAAG,CAAC,CAAC;AAC7D,MAAM,aAAa,GAAG,qCAAqC,CAAC;AAC5D,wGAAwG;AACxG,MAAM,YAAY,GAAG,iEAAiE,CAAC;AACvF,MAAM,UAAU,GAAG,iBAAiB,CAAC;AACrC,+FAA+F;AAC/F,MAAM,gBAAgB,GAAG,8EAA8E,CAAC;AAExG,MAAM,WAAW,GAAG,MAAM,CAAC,GAAG,CAAA,6EAA6E,CAAC;AAC5G,MAAM,cAAc,GAAG,IAAI,MAAM,CAAC,KAAK,WAAW,IAAI,CAAC,CAAC;AACxD,MAAM,iBAAiB,GAAG,wDAAwD,CAAC;AACnF,MAAM,MAAM,GAAG,IAAI,MAAM,CAAC,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E;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":"AAUA;;;;;;;;;;;;;;;;;;;;;;;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;AAYtD,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,EAC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;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,17 +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,
14
+ // packages/daemon/src/verify/verification-run-config-source.test.ts,
7
15
  // packages/daemon/src/verify/verification-tick-product-scoping.test.ts,
8
- // 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
9
18
  // PINNED-BY-END
10
19
  export { runDeterministicStrategy } from './verification-deterministic.js';
11
20
  import { emitObservedShortfallDrift, } from '../queries/verification.js';
12
21
  import { diagnoseEmptyDiffSource } from '../resolvers/index.js';
13
22
  import { collectDefaultOnVerifications, markDefaultOnRan, resolveDaemonWideVerifyCap, resolveProductVerificationScopes, verificationSemaphore, } from './verification-default-on.js';
14
- import { applyAttribution } from './verification-baseline.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';
15
29
  // Re-export the default-on selection + concurrency surface so existing
16
30
  // importers (and tests) can reach it through verification-engine.
17
31
  export { collectDefaultOnVerifications, resolveDaemonWideVerifyCap, resolveProductVerificationScopes, verificationSemaphore, VerificationSemaphore, __getVerificationSemaphoreForTests, __resetDefaultOnGuardForTests, __getDefaultOnGuardForTests, __markDefaultOnRanForTests, } from './verification-default-on.js';
@@ -68,7 +82,6 @@ import { defaultDeps } from './verification-deps-default.js';
68
82
  // daemon 800-line limit. Re-exported so existing importers/tests reach it here.
69
83
  export { VERIFY_BASE_REF_ENV, VERIFY_RECORDED_COMMIT_COUNT_ENV, resolveVerifyBoundaryEnv, } from './verification-boundary-env.js';
70
84
  import { runDeterministicAtFixedCommit } from './verification-checkout.js';
71
- import { noteDefaultOnResult } from './verification-default-on.js';
72
85
  const STRATEGIES = {
73
86
  // Judges a detached checkout of the focus HEAD, never the live worktree a team
74
87
  // may be moving (verify/verification-checkout.ts).
@@ -89,19 +102,41 @@ import { buildVerifyEvidence, summarizeEvidenceForInjection, describeMissingJudg
89
102
  * Record a verification outcome (a VERDICT only -- the reconciler owns the
90
103
  * verify -> done edge) and log it by delivery NAME, so a pass is visible in the
91
104
  * daemon log directly (not merely as a tick count) and the closing that follows
92
- * on review evidence reads as a distinct, later event. Extracted to keep
93
- * 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).
94
120
  */
95
- async function recordAndLogOutcome(deps, v, outcome) {
96
- 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)'}`;
97
131
  log.info(`[verification] recorded outcome '${outcome}' for delivery ` +
98
- `"${v.deliveryName}" (${v.deliveryId}) -- verdict only; reconciler owns any status edge`);
132
+ `"${v.deliveryName}" (${v.deliveryId}) -- ${recorded}; reconciler owns any status edge`);
99
133
  }
100
134
  /**
101
135
  * Run verification for a single delivery.
102
136
  *
103
137
  * Ordering invariants:
104
- * 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.
105
140
  * 2. On verdict 'passed' with an injection node: retire injection FIRST
106
141
  * (verifyInjection runs the reality_tree_verify_injection compound op).
107
142
  * If retirement fails, the outcome demotes to 'pending' so the loop
@@ -114,10 +149,14 @@ async function recordAndLogOutcome(deps, v, outcome) {
114
149
  * Drift emission is best-effort: a single failure logs and continues so
115
150
  * one bad observation does not prevent the rest from being persisted.
116
151
  */
117
- export async function runVerificationForDelivery(v, deps) {
118
- const strategy = STRATEGIES[v.verificationMethod];
119
- const strategyResult = await strategy(deps, v);
120
- 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;
121
160
  // Instrument-fault tracking: set when the verify path could render NO verdict
122
161
  // about the WORK. Three origins share this hold and the SAME bounded
123
162
  // verify_failed re-work (evidence-unavailable guard, files no escalation):
@@ -127,60 +166,9 @@ export async function runVerificationForDelivery(v, deps) {
127
166
  // failing-test ids (a type-check crash / missing deps / a run that died
128
167
  // before any test ran), or was KILLED by its timeout before completing.
129
168
  // A blind or timed-out deterministic run must NEVER be laundered into a
130
- // differential pass; it routes here instead. Declared before the attribution
131
- // block so that block can set it.
132
- let evidenceUnavailableHold = null;
133
- // Baseline-diff attribution (deterministic only): a failed HEAD run whose
134
- // failures ALL pre-exist on the focus base introduced no regression -> demote
135
- // to 'passed' (the differential gate measures only the focus's delta). Runs
136
- // BEFORE the pass path so a demotion feeds injection retirement; a null
137
- // classification (no baseline) leaves the outcome unchanged (all failures gate).
138
- if (v.verificationMethod === 'deterministic' && result.outcome === 'failed') {
139
- if (result.timedOut) {
140
- // A killed-mid-run process produces garbage output that parses to zero ids;
141
- // do NOT attempt baseline attribution against it. Route straight to bounded
142
- // instrument-fault re-work -- a timeout is never a verdict about the work.
143
- evidenceUnavailableHold = {
144
- missing: ['complete deterministic run output (killed by timeout before completion)'],
145
- commitsAhead: 0,
146
- deterministicFault: { kind: 'timeout', exitCode: result.exitCode ?? null },
147
- };
148
- log.warn(`[verification] deterministic run timed out for delivery ${v.deliveryId} -- ` +
149
- `routing to bounded instrument-fault re-work (not a pass)`);
150
- }
151
- else if (deps.attributeFailures) {
152
- try {
153
- const classification = await deps.attributeFailures(v, result);
154
- if (classification) {
155
- const attributed = applyAttribution(v.deliveryId, classification);
156
- result.newFailures = attributed.newFailures;
157
- result.preExisting = attributed.preExisting;
158
- result.rationale = attributed.rationale;
159
- if (attributed.outcome === 'blind') {
160
- // Exited non-zero but zero parseable failing ids: the gate cannot
161
- // attribute the failure. Keep the run FAILED (never a differential
162
- // pass) and route it to the bounded instrument-fault re-work path.
163
- result.outcome = 'failed';
164
- evidenceUnavailableHold = {
165
- missing: ['attributable failing-test ids (deterministic run exited non-zero, parsed zero)'],
166
- commitsAhead: 0,
167
- deterministicFault: { kind: 'blind_zero_parse', exitCode: result.exitCode ?? null },
168
- };
169
- log.warn(`[verification] ${attributed.rationale} (delivery ${v.deliveryId}) -- ` +
170
- `routing to bounded instrument-fault re-work`);
171
- }
172
- else {
173
- result.outcome = attributed.outcome;
174
- if (attributed.log)
175
- log.info(attributed.log);
176
- }
177
- }
178
- }
179
- catch (err) {
180
- log.warn(`[verification] baseline attribution failed for delivery ${v.deliveryId}:`, err.message);
181
- }
182
- }
183
- }
169
+ // differential pass; it routes here instead. The judge step's attribution
170
+ // seeds it.
171
+ let evidenceUnavailableHold = judged.evidenceUnavailableHold;
184
172
  // Shortfall-origin tracking: set when the reconciliation demotes a PASSED
185
173
  // outcome to 'failed'. Feedback for a shortfall hold routes under its own
186
174
  // guard (not deterministic_verification), so the origin must survive to the
@@ -456,7 +444,7 @@ export async function runVerificationForDelivery(v, deps) {
456
444
  }
457
445
  }
458
446
  }
459
- await recordAndLogOutcome(deps, v, result.outcome);
447
+ await recordAndLogOutcome(deps, v, result);
460
448
  // Feedback dispatch by FAILURE ORIGIN. The three origins are mutually
461
449
  // exclusive: a shortfall / instrument-fault hold only demotes a PASSED
462
450
  // outcome, so a deterministic-failed run carries neither.
@@ -469,7 +457,7 @@ export async function runVerificationForDelivery(v, deps) {
469
457
  // holds; the iteration cap (verify_gate_unclearable) is the sole residue.
470
458
  if (evidenceUnavailableHold && deps.requeueEvidenceUnavailableAsRework) {
471
459
  try {
472
- await deps.requeueEvidenceUnavailableAsRework(v, evidenceUnavailableHold);
460
+ await deps.requeueEvidenceUnavailableAsRework(v, evidenceUnavailableHold, judgedShaOfRun(result), runVerdictOf(result, judged.evidenceUnavailableHold !== null));
473
461
  }
474
462
  catch (err) {
475
463
  log.warn(`[verification] evidence-unavailable re-work failed for delivery ${v.deliveryId}:`, err.message);
@@ -477,7 +465,7 @@ export async function runVerificationForDelivery(v, deps) {
477
465
  }
478
466
  else if (shortfallHold.length > 0 && deps.deliverShortfallFeedback) {
479
467
  try {
480
- await deps.deliverShortfallFeedback(v, shortfallHold);
468
+ await deps.deliverShortfallFeedback(v, shortfallHold, judgedShaOfRun(result), runVerdictOf(result, judged.evidenceUnavailableHold !== null));
481
469
  }
482
470
  catch (err) {
483
471
  log.warn(`[verification] shortfall feedback failed for delivery ${v.deliveryId}:`, err.message);
@@ -513,6 +501,53 @@ export async function runVerificationForDelivery(v, deps) {
513
501
  }
514
502
  return result;
515
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
+ }
516
551
  /**
517
552
  * One tick: fetch pending verifications across products, dispatch each.
518
553
  * Returns counts for telemetry.
@@ -533,7 +568,7 @@ export async function runVerificationTick(config, deps) {
533
568
  // last product iterated would silently win. See resolveDaemonWideVerifyCap for
534
569
  // the rule (min across products) and why.
535
570
  verificationSemaphore.setLimit(resolveDaemonWideVerifyCap(scopes));
536
- for (const { product, productConfig, resolved } of scopes) {
571
+ for (const { product, productConfig, resolved, judgedCommitOnly } of scopes) {
537
572
  let pending;
538
573
  try {
539
574
  pending = await merged.getPendingVerifications(product.id);
@@ -543,44 +578,25 @@ export async function runVerificationTick(config, deps) {
543
578
  continue;
544
579
  }
545
580
  // Default-on: append deterministic runs for verify deliveries with no
546
- // explicit method (the whole-repo suite the daemon now owns). Inert when
547
- // no default command is configured for THIS product (resolved.enabled ===
548
- // false) or when its config could not be resolved at all (resolved ===
549
- // undefined -- malformed manifest, already logged at ERROR above).
581
+ // explicit method (the whole-repo suite the daemon now owns). A product whose
582
+ // repoPath manifest is malformed (resolved === undefined, logged at ERROR
583
+ // above) still scans, arming only from judged commits (judgedCommitOnly).
550
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);
589
+ const scanResolved = resolved ?? judgedCommitOnly;
551
590
  let defaultOn = [];
552
- if (resolved) {
591
+ if (scanResolved) {
553
592
  try {
554
- defaultOn = await collectDefaultOnVerifications(productConfig, resolved, explicitIds, merged);
593
+ defaultOn = await collectDefaultOnVerifications(productConfig, scanResolved, explicitIds, merged);
555
594
  }
556
595
  catch (err) {
557
596
  log.warn(`[verification] default-on scan failed for product ${product.id}:`, err.message);
558
597
  }
559
598
  }
560
- for (const v of [...pending, ...defaultOn]) {
561
- counts.checked += 1;
562
- // Mark default-on candidates as run BEFORE dispatch so a mid-run failure
563
- // does not re-enqueue the same 30-min suite on the next tick.
564
- const defaultOnCandidate = v.verificationOutcome === null && !explicitIds.has(v.deliveryId);
565
- if (defaultOnCandidate) {
566
- markDefaultOnRan(v.deliveryId);
567
- }
568
- // Cap concurrent whole-repo runs across overlapping ticks.
569
- await verificationSemaphore.acquire();
570
- try {
571
- const r = await runVerificationForDelivery(v, merged);
572
- // HEAD-keyed guard: a failed commit is not re-verified until HEAD moves.
573
- if (defaultOnCandidate)
574
- noteDefaultOnResult(v.deliveryId, r);
575
- counts[r.outcome] = (counts[r.outcome] ?? 0) + 1;
576
- }
577
- catch (err) {
578
- log.warn(`[verification] tick failed for delivery ${v.deliveryId}:`, err.message);
579
- }
580
- finally {
581
- verificationSemaphore.release();
582
- }
583
- }
599
+ await dispatchSelected([...pending, ...rearmed, ...defaultOn], explicitIds, merged, counts);
584
600
  }
585
601
  // Clean-environment install probe (Review Gate Hardening, deferrable): an
586
602
  // ADDITIONAL, out-of-band pass over manifest-touching verify deliveries,