@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 @@
1
+ {"version":3,"file":"commit-verdict-record.js","sourceRoot":"","sources":["../../src/verify/commit-verdict-record.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,2EAA2E;AAC3E,qEAAqE;AACrE,gEAAgE;AAChE,6DAA6D;AAC7D,8EAA8E;AAC9E,+EAA+E;AAC/E,2EAA2E;AAC3E,uFAAuF;AACvF,mFAAmF;AACnF,oEAAoE;AACpE,2EAA2E;AAC3E,0EAA0E;AAC1E,gFAAgF;AAChF,oEAAoE;AACpE,sEAAsE;AACtE,+DAA+D;AAC/D,8DAA8D;AAC9D,4DAA4D;AAC5D,mEAAmE;AACnE,gBAAgB;AAEhB;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,YAAY,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC1F,OAAO,EAAE,QAAQ,EAAE,OAAO,EAA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AAC,EAAE,CAAC;QACnD,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACvC,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACvC,GAAG,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC7C,GAAG,CAAC,UAAU,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACnD,GAAG,CAAC,UAAU,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACnD,GAAG,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,aAAa,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KAC5C,CAAC;AACJ,CAAC"}
@@ -0,0 +1,161 @@
1
+ /**
2
+ * The verdict an EXPLICIT-METHOD verification run rendered for its delivery, kept
3
+ * where a daemon restart cannot lose it, and read by the verify routing it gates.
4
+ *
5
+ * An explicit-method run may write no per-commit verdict record: an in-place run
6
+ * judges no commit and an ai_inspection writes none. Its recorded outcome is then
7
+ * its gate verdict (completion/review-exit-verdict-gate.ts). The in-process
8
+ * registry (verify/gate-run-registry.ts) holds it, but a restart clears that
9
+ * registry, and the delivery row's own verification columns cannot carry the whole
10
+ * verdict: the durable row names the method and records a pass, but the edge
11
+ * records verification_outcome with no judged commit and resets a failure to
12
+ * null. So from the row alone, after a restart, a failure read as pending and a
13
+ * pass applied to whatever commit was judged.
14
+ *
15
+ * So each explicit run's terminal outcome, with the commit it applies to (null
16
+ * when it judged none), is also written to the delivery's gate_state under
17
+ * verificationHistory.explicitOutcome (queries/delivery-gate-state.ts) -- the
18
+ * history every clearing writer already carries forward. No migration and no edge
19
+ * change: gate_state is already the daemon's durable per-delivery record. A run
20
+ * that rendered no verdict removes it.
21
+ *
22
+ * A verdict also belongs to the GATE that rendered it. The edge lets an operator
23
+ * change a row's method or config without resetting its outcome or this history,
24
+ * so a pass gate A rendered at commit H would otherwise read as a pass for gate B
25
+ * at H, which never ran. Both records keep the key of the gate the run applied
26
+ * (commit-verdict-record.ts explicitGateKeyOf), and a reader that names the
27
+ * delivery's current gate (verify/commit-gate-configured.ts) takes only a verdict
28
+ * rendered under it; the explicit re-arm scan runs gate B instead.
29
+ *
30
+ * Invalidate first. The in-process registry forgets the previous run's verdict the
31
+ * moment a replacement run is selected; the durable record must forget it before
32
+ * that run can start. Otherwise a restart while the run waits on the verification
33
+ * semaphore or runs -- or a verdict write after it that fails -- exposes the older
34
+ * verdict as the latest, and a stale pass approves a review the replacement may
35
+ * fail. So the tick removes the record (invalidateExplicitGateOutcome) for every
36
+ * explicit candidate it selects, before any of them waits
37
+ * (verify/verification-commit-sharing.ts), and a candidate whose removal did not
38
+ * land is not started that tick. An explicit DETERMINISTIC candidate whose focus
39
+ * HEAD a per-commit verdict under its own gate already judges is the exception: no
40
+ * run replaces anything at selection, so the removal is deferred to its dispatch
41
+ * and made there only when that dispatch is about to route a verdict -- the
42
+ * per-commit one it takes in place of a run, then recorded here for that commit and
43
+ * gate key, or, finding none after all, its own run's (refused, it routes nothing
44
+ * and starts nothing). The delivery can leave verify while that removal awaits its
45
+ * row write: the removal itself refuses one it finds done or cancelled, and the
46
+ * dispatch re-reads the status once the removal lands, so one that moved anywhere
47
+ * else outside verify is routed nothing either. A reused failure already fed back
48
+ * routes nothing, so it removes nothing and its record stands. ai_inspection and
49
+ * behavioral rows record
50
+ * no per-commit verdict, so theirs is always removed at selection. Until the
51
+ * replacement's own write lands, the durable state reads "no verdict": routing
52
+ * holds, and a restarted daemon selects the row again -- the pending queue lists
53
+ * it, or the explicit re-arm scan finds a row pass with no record of its run.
54
+ *
55
+ * Read: this process's own knowledge first -- a verdict it recorded, or a
56
+ * selection of the row since, which forgets the run before it -- else the durable
57
+ * record on the gate_state the caller read. Routing after a restart therefore
58
+ * consumes the verdict actually rendered and never depends on the registry. The
59
+ * row's own verification_outcome pass names no commit, so it approves nothing:
60
+ * where neither knows the run, the explicit re-arm scan (verify/explicit-rearm.ts)
61
+ * selects the row again, and that run's record binds the verdict to its commit.
62
+ *
63
+ * Direction of error: the removal fails closed -- no replacement run starts over a
64
+ * verdict it could not remove, and the next tick asks again -- while the verdict
65
+ * write after the run is best-effort: a failed write logs and leaves "no verdict"
66
+ * (the removal already landed), never the older record, so routing holds until a
67
+ * later run records one. A recorded verdict can only hold a done route or let
68
+ * re-work route: a failure holds done, and a pass applies only to the commit it
69
+ * judged -- or, when it judged none, to the delivery, exactly as the in-process
70
+ * record always has.
71
+ *
72
+ * Both writers own the record, its run id included, and only they change it. Each
73
+ * reads the row and writes it in the delivery's serialized write turn
74
+ * (queries/delivery-write-discipline.ts, via queries/deliveries.ts
75
+ * rewriteDeliveryGateStateAtOwnStatus), stamps only its own key over that FRESH
76
+ * gate_state, and writes at the fresh status -- nothing to a delivery that is done
77
+ * or cancelled. So a hold written after their read is never erased and a status
78
+ * never moves back; and every other gate_state writer that goes through the single
79
+ * writer sends the row's record, never one its own earlier read carried, so it
80
+ * never resurrects a removed verdict.
81
+ *
82
+ * A stale writer the discipline does not reach cannot bring it back either: a
83
+ * gate_state write that carries the history of a row read before the removal,
84
+ * outside this process's serialized turn, writes the older verdict back after it.
85
+ * So every removal first names a fresh run id in a host-local ledger
86
+ * (verify/explicit-run-ledger.ts): the verdict its dispatch routes -- run or reused
87
+ * -- is recorded with that id, a run a later removal superseded records nothing,
88
+ * and a durable record is a verdict only while its id is the current one -- carried
89
+ * back, it reads as no verdict.
90
+ *
91
+ * @module verify/explicit-gate-outcome
92
+ */
93
+ import { type DeliveryGateRowIo } from '../queries/deliveries.js';
94
+ import { type RecordedExplicitOutcome, type RecordedGateOutcome } from './gate-run-registry.js';
95
+ /** Injected row IO for the durable write (the real row read and physical write by default). */
96
+ export interface ExplicitGateOutcomeWriteDeps extends DeliveryGateRowIo {
97
+ now: () => string;
98
+ /** Name `runId` the delivery's current explicit run in the ledger; throws when that cannot be written. */
99
+ beginRun: (deliveryId: string, runId: string) => void;
100
+ /** Whether `runId` is still the delivery's current explicit run. */
101
+ isCurrentRun: (deliveryId: string, runId: string) => boolean;
102
+ }
103
+ /**
104
+ * Record an explicit-method run's verdict on its delivery's gate_state (see the
105
+ * module header): the verdict it rendered under the gate it applied (`gateKey`),
106
+ * as run `runId` (the id its dispatch named; undefined for a run none named), or
107
+ * no record when it rendered none. Stamped over the FRESH row at the row's OWN
108
+ * status in one serialized write turn, so the gate-only write never moves the
109
+ * delivery and keeps whatever else the row holds. Nothing is written when there is
110
+ * neither a verdict nor a record to remove, for a delivery that is done or
111
+ * cancelled, or for a run a later removal superseded -- asked inside that same
112
+ * turn, so a supersession named while this write waited for it is seen.
113
+ * Best-effort: never throws. Returns whether a write landed.
114
+ */
115
+ export declare function persistExplicitGateOutcome(deliveryId: string, result: {
116
+ outcome: string;
117
+ verifiedSha?: string;
118
+ }, gateKey: string, runId: string | undefined, deps?: Partial<ExplicitGateOutcomeWriteDeps>): Promise<boolean>;
119
+ /**
120
+ * Durably forget the verdict the delivery's previous explicit run rendered, before
121
+ * a replacement verdict is routed (see the module header): `runId`, the
122
+ * replacement, is first named the delivery's current run -- which voids every
123
+ * older record, wherever a writer carries it -- then the record is removed from the
124
+ * FRESH row at the row's OWN status in one serialized write turn, so the gate-only
125
+ * write never moves the delivery and keeps a hold written before it. Nothing is
126
+ * written to the row when there is no record to remove, or for a delivery that is
127
+ * not found or stopped cycling (done or cancelled). Never throws. Returns whether
128
+ * the replacement may be routed: true once the durable state reads "no verdict" for
129
+ * a delivery still cycling. False refuses it: the run could not be named, the row
130
+ * could not be read, or the write failed -- the older verdict may still stand -- or
131
+ * the delivery is not found or stopped cycling, which no verdict is routed to (its
132
+ * run was named first, so a record it keeps reads as no verdict). A delivery that
133
+ * moved to a status that still cycles (verify_failed, coding) has its record removed
134
+ * at that status and resolves true: the dispatch re-reads the status once this
135
+ * lands, and that read refuses it (verify/verification-commit-sharing.ts).
136
+ */
137
+ export declare function invalidateExplicitGateOutcome(deliveryId: string, runId: string, deps?: Partial<ExplicitGateOutcomeWriteDeps>): Promise<boolean>;
138
+ /**
139
+ * The explicit-method verdict to read for the delivery, whatever commit it applies
140
+ * to: this process's own knowledge, else the durable record on `gateState` while
141
+ * the run that recorded it is the delivery's current one; null when neither holds
142
+ * one (no run recorded, the latest run rendered none, or a later run superseded it).
143
+ */
144
+ export declare function readExplicitGateOutcomeRecord(deliveryId: string, gateState: unknown): RecordedExplicitOutcome | null;
145
+ /**
146
+ * The verdict an explicit-method run rendered for the delivery when it applies to
147
+ * `sha` -- the run judged that commit, or judged none -- under `gateKey`, else
148
+ * null. `gateState` is the delivery's gate_state as the caller read it. A null
149
+ * `gateKey` names no explicit gate (the row names no method), so no verdict
150
+ * applies; an undefined one (the delivery's gate could not be read) takes a
151
+ * verdict rendered under any gate.
152
+ */
153
+ export declare function readDeliveryGateOutcome(deliveryId: string, sha: string | null, gateState?: unknown, gateKey?: string | null): RecordedGateOutcome | null;
154
+ /**
155
+ * Whether an explicit-method run rendered a verdict for the delivery, in this
156
+ * process or on `gateState`, whatever commit it applies to. A terminal explicit
157
+ * row leaves daemon_get_pending_verifications, so this is what still says the
158
+ * delivery is gated by its own run (verify/commit-gate-configured.ts).
159
+ */
160
+ export declare function hasRecordedExplicitGateOutcome(deliveryId: string, gateState?: unknown): boolean;
161
+ //# sourceMappingURL=explicit-gate-outcome.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"explicit-gate-outcome.d.ts","sourceRoot":"","sources":["../../src/verify/explicit-gate-outcome.ts"],"names":[],"mappings":"AAWA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2FG;AAEH,O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AG,IAAI,CAI5B;AAED;;;;;GAKG;AACH,wBAAgB,8BAA8B,CAAC,UAAU,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,OAAO,GAAG,OAAO,CAG/F"}
@@ -0,0 +1,215 @@
1
+ // PINNED-BY-BEGIN (generated by gen:pinned-by -- do not hand-edit; checked by lint:pinned-by)
2
+ // Pinned by: packages/daemon/src/integration/delivery-gate-write-interleaving.test.ts,
3
+ // packages/daemon/src/integration/explicit-gate-outcome-restart.test.ts,
4
+ // packages/daemon/src/integration/explicit-verdict-departure-during-removal.test.ts,
5
+ // packages/daemon/src/integration/explicit-verdict-invalidation-restart.test.ts,
6
+ // packages/daemon/src/integration/explicit-verdict-reuse.test.ts,
7
+ // packages/daemon/src/verify/commit-gate-configured.test.ts,
8
+ // packages/daemon/src/verify/explicit-run-ledger.test.ts,
9
+ // packages/daemon/src/verify/verification-commit-sharing.test.ts
10
+ // PINNED-BY-END
11
+ /**
12
+ * The verdict an EXPLICIT-METHOD verification run rendered for its delivery, kept
13
+ * where a daemon restart cannot lose it, and read by the verify routing it gates.
14
+ *
15
+ * An explicit-method run may write no per-commit verdict record: an in-place run
16
+ * judges no commit and an ai_inspection writes none. Its recorded outcome is then
17
+ * its gate verdict (completion/review-exit-verdict-gate.ts). The in-process
18
+ * registry (verify/gate-run-registry.ts) holds it, but a restart clears that
19
+ * registry, and the delivery row's own verification columns cannot carry the whole
20
+ * verdict: the durable row names the method and records a pass, but the edge
21
+ * records verification_outcome with no judged commit and resets a failure to
22
+ * null. So from the row alone, after a restart, a failure read as pending and a
23
+ * pass applied to whatever commit was judged.
24
+ *
25
+ * So each explicit run's terminal outcome, with the commit it applies to (null
26
+ * when it judged none), is also written to the delivery's gate_state under
27
+ * verificationHistory.explicitOutcome (queries/delivery-gate-state.ts) -- the
28
+ * history every clearing writer already carries forward. No migration and no edge
29
+ * change: gate_state is already the daemon's durable per-delivery record. A run
30
+ * that rendered no verdict removes it.
31
+ *
32
+ * A verdict also belongs to the GATE that rendered it. The edge lets an operator
33
+ * change a row's method or config without resetting its outcome or this history,
34
+ * so a pass gate A rendered at commit H would otherwise read as a pass for gate B
35
+ * at H, which never ran. Both records keep the key of the gate the run applied
36
+ * (commit-verdict-record.ts explicitGateKeyOf), and a reader that names the
37
+ * delivery's current gate (verify/commit-gate-configured.ts) takes only a verdict
38
+ * rendered under it; the explicit re-arm scan runs gate B instead.
39
+ *
40
+ * Invalidate first. The in-process registry forgets the previous run's verdict the
41
+ * moment a replacement run is selected; the durable record must forget it before
42
+ * that run can start. Otherwise a restart while the run waits on the verification
43
+ * semaphore or runs -- or a verdict write after it that fails -- exposes the older
44
+ * verdict as the latest, and a stale pass approves a review the replacement may
45
+ * fail. So the tick removes the record (invalidateExplicitGateOutcome) for every
46
+ * explicit candidate it selects, before any of them waits
47
+ * (verify/verification-commit-sharing.ts), and a candidate whose removal did not
48
+ * land is not started that tick. An explicit DETERMINISTIC candidate whose focus
49
+ * HEAD a per-commit verdict under its own gate already judges is the exception: no
50
+ * run replaces anything at selection, so the removal is deferred to its dispatch
51
+ * and made there only when that dispatch is about to route a verdict -- the
52
+ * per-commit one it takes in place of a run, then recorded here for that commit and
53
+ * gate key, or, finding none after all, its own run's (refused, it routes nothing
54
+ * and starts nothing). The delivery can leave verify while that removal awaits its
55
+ * row write: the removal itself refuses one it finds done or cancelled, and the
56
+ * dispatch re-reads the status once the removal lands, so one that moved anywhere
57
+ * else outside verify is routed nothing either. A reused failure already fed back
58
+ * routes nothing, so it removes nothing and its record stands. ai_inspection and
59
+ * behavioral rows record
60
+ * no per-commit verdict, so theirs is always removed at selection. Until the
61
+ * replacement's own write lands, the durable state reads "no verdict": routing
62
+ * holds, and a restarted daemon selects the row again -- the pending queue lists
63
+ * it, or the explicit re-arm scan finds a row pass with no record of its run.
64
+ *
65
+ * Read: this process's own knowledge first -- a verdict it recorded, or a
66
+ * selection of the row since, which forgets the run before it -- else the durable
67
+ * record on the gate_state the caller read. Routing after a restart therefore
68
+ * consumes the verdict actually rendered and never depends on the registry. The
69
+ * row's own verification_outcome pass names no commit, so it approves nothing:
70
+ * where neither knows the run, the explicit re-arm scan (verify/explicit-rearm.ts)
71
+ * selects the row again, and that run's record binds the verdict to its commit.
72
+ *
73
+ * Direction of error: the removal fails closed -- no replacement run starts over a
74
+ * verdict it could not remove, and the next tick asks again -- while the verdict
75
+ * write after the run is best-effort: a failed write logs and leaves "no verdict"
76
+ * (the removal already landed), never the older record, so routing holds until a
77
+ * later run records one. A recorded verdict can only hold a done route or let
78
+ * re-work route: a failure holds done, and a pass applies only to the commit it
79
+ * judged -- or, when it judged none, to the delivery, exactly as the in-process
80
+ * record always has.
81
+ *
82
+ * Both writers own the record, its run id included, and only they change it. Each
83
+ * reads the row and writes it in the delivery's serialized write turn
84
+ * (queries/delivery-write-discipline.ts, via queries/deliveries.ts
85
+ * rewriteDeliveryGateStateAtOwnStatus), stamps only its own key over that FRESH
86
+ * gate_state, and writes at the fresh status -- nothing to a delivery that is done
87
+ * or cancelled. So a hold written after their read is never erased and a status
88
+ * never moves back; and every other gate_state writer that goes through the single
89
+ * writer sends the row's record, never one its own earlier read carried, so it
90
+ * never resurrects a removed verdict.
91
+ *
92
+ * A stale writer the discipline does not reach cannot bring it back either: a
93
+ * gate_state write that carries the history of a row read before the removal,
94
+ * outside this process's serialized turn, writes the older verdict back after it.
95
+ * So every removal first names a fresh run id in a host-local ledger
96
+ * (verify/explicit-run-ledger.ts): the verdict its dispatch routes -- run or reused
97
+ * -- is recorded with that id, a run a later removal superseded records nothing,
98
+ * and a durable record is a verdict only while its id is the current one -- carried
99
+ * back, it reads as no verdict.
100
+ *
101
+ * @module verify/explicit-gate-outcome
102
+ */
103
+ import { rewriteDeliveryGateStateAtOwnStatus } from '../queries/deliveries.js';
104
+ import { readVerificationHistory, stampExplicitGateOutcome, } from '../queries/delivery-gate-state.js';
105
+ import { explicitGateOutcomeOf, readLiveExplicitGateOutcome, } from './gate-run-registry.js';
106
+ import { beginExplicitRun, isCurrentExplicitRun } from './explicit-run-ledger.js';
107
+ import { createLogger } from '../shell/log.js';
108
+ const log = createLogger({ module: 'verification' });
109
+ /**
110
+ * Record an explicit-method run's verdict on its delivery's gate_state (see the
111
+ * module header): the verdict it rendered under the gate it applied (`gateKey`),
112
+ * as run `runId` (the id its dispatch named; undefined for a run none named), or
113
+ * no record when it rendered none. Stamped over the FRESH row at the row's OWN
114
+ * status in one serialized write turn, so the gate-only write never moves the
115
+ * delivery and keeps whatever else the row holds. Nothing is written when there is
116
+ * neither a verdict nor a record to remove, for a delivery that is done or
117
+ * cancelled, or for a run a later removal superseded -- asked inside that same
118
+ * turn, so a supersession named while this write waited for it is seen.
119
+ * Best-effort: never throws. Returns whether a write landed.
120
+ */
121
+ export async function persistExplicitGateOutcome(deliveryId, result, gateKey, runId, deps = {}) {
122
+ const now = deps.now ?? (() => new Date().toISOString());
123
+ const isCurrentRun = deps.isCurrentRun ?? ((id, run) => isCurrentExplicitRun(id, run));
124
+ const rendered = explicitGateOutcomeOf(result, gateKey);
125
+ try {
126
+ const written = await rewriteDeliveryGateStateAtOwnStatus(deliveryId, (row) => {
127
+ if (runId !== undefined && !isCurrentRun(deliveryId, runId)) {
128
+ log.info(`[verification] explicit: not recording the verdict of run ${runId} for delivery ${deliveryId} -- a later run of it was selected`);
129
+ return undefined;
130
+ }
131
+ if (!rendered && !readVerificationHistory(row.gateState).explicitOutcome)
132
+ return undefined;
133
+ const record = rendered
134
+ ? { ...rendered, recordedAt: now(), ...(runId !== undefined ? { runId } : {}) }
135
+ : null;
136
+ return stampExplicitGateOutcome(row.gateState, record);
137
+ }, { ownsExplicitOutcome: true, io: deps });
138
+ return written === 'written';
139
+ }
140
+ catch (err) {
141
+ log.warn(`[verification] failed to record the explicit gate verdict for delivery ${deliveryId}:`, err.message);
142
+ return false;
143
+ }
144
+ }
145
+ /**
146
+ * Durably forget the verdict the delivery's previous explicit run rendered, before
147
+ * a replacement verdict is routed (see the module header): `runId`, the
148
+ * replacement, is first named the delivery's current run -- which voids every
149
+ * older record, wherever a writer carries it -- then the record is removed from the
150
+ * FRESH row at the row's OWN status in one serialized write turn, so the gate-only
151
+ * write never moves the delivery and keeps a hold written before it. Nothing is
152
+ * written to the row when there is no record to remove, or for a delivery that is
153
+ * not found or stopped cycling (done or cancelled). Never throws. Returns whether
154
+ * the replacement may be routed: true once the durable state reads "no verdict" for
155
+ * a delivery still cycling. False refuses it: the run could not be named, the row
156
+ * could not be read, or the write failed -- the older verdict may still stand -- or
157
+ * the delivery is not found or stopped cycling, which no verdict is routed to (its
158
+ * run was named first, so a record it keeps reads as no verdict). A delivery that
159
+ * moved to a status that still cycles (verify_failed, coding) has its record removed
160
+ * at that status and resolves true: the dispatch re-reads the status once this
161
+ * lands, and that read refuses it (verify/verification-commit-sharing.ts).
162
+ */
163
+ export async function invalidateExplicitGateOutcome(deliveryId, runId, deps = {}) {
164
+ const beginRun = deps.beginRun ?? ((id, run) => beginExplicitRun(id, run));
165
+ try {
166
+ beginRun(deliveryId, runId);
167
+ const rewritten = await rewriteDeliveryGateStateAtOwnStatus(deliveryId, (row) => (readVerificationHistory(row.gateState).explicitOutcome ? stampExplicitGateOutcome(row.gateState, null) : undefined), { ownsExplicitOutcome: true, io: deps });
168
+ if (rewritten !== 'stopped')
169
+ return true;
170
+ log.info(`[verification] explicit: delivery ${deliveryId} is not found, done or cancelled -- no replacement verdict is routed to it`);
171
+ return false;
172
+ }
173
+ catch (err) {
174
+ log.warn(`[verification] failed to invalidate the explicit gate verdict for delivery ${deliveryId} -- its replacement run is not started:`, err.message);
175
+ return false;
176
+ }
177
+ }
178
+ /**
179
+ * The explicit-method verdict to read for the delivery, whatever commit it applies
180
+ * to: this process's own knowledge, else the durable record on `gateState` while
181
+ * the run that recorded it is the delivery's current one; null when neither holds
182
+ * one (no run recorded, the latest run rendered none, or a later run superseded it).
183
+ */
184
+ export function readExplicitGateOutcomeRecord(deliveryId, gateState) {
185
+ const live = readLiveExplicitGateOutcome(deliveryId);
186
+ if (live !== undefined)
187
+ return live;
188
+ const durable = readVerificationHistory(gateState).explicitOutcome;
189
+ return durable && isCurrentExplicitRun(deliveryId, durable.runId) ? durable : null;
190
+ }
191
+ /**
192
+ * The verdict an explicit-method run rendered for the delivery when it applies to
193
+ * `sha` -- the run judged that commit, or judged none -- under `gateKey`, else
194
+ * null. `gateState` is the delivery's gate_state as the caller read it. A null
195
+ * `gateKey` names no explicit gate (the row names no method), so no verdict
196
+ * applies; an undefined one (the delivery's gate could not be read) takes a
197
+ * verdict rendered under any gate.
198
+ */
199
+ export function readDeliveryGateOutcome(deliveryId, sha, gateState, gateKey) {
200
+ const recorded = readExplicitGateOutcomeRecord(deliveryId, gateState);
201
+ if (!recorded || (gateKey !== undefined && recorded.gateKey !== gateKey))
202
+ return null;
203
+ return recorded.sha === null || recorded.sha === sha ? recorded.outcome : null;
204
+ }
205
+ /**
206
+ * Whether an explicit-method run rendered a verdict for the delivery, in this
207
+ * process or on `gateState`, whatever commit it applies to. A terminal explicit
208
+ * row leaves daemon_get_pending_verifications, so this is what still says the
209
+ * delivery is gated by its own run (verify/commit-gate-configured.ts).
210
+ */
211
+ export function hasRecordedExplicitGateOutcome(deliveryId, gateState) {
212
+ return (readLiveExplicitGateOutcome(deliveryId) ?? null) !== null
213
+ || readVerificationHistory(gateState).explicitOutcome !== undefined;
214
+ }
215
+ //# sourceMappingURL=explicit-gate-outcome.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"explicit-gate-outcome.js","sourceRoot":"","sources":["../../src/verify/explicit-gate-outcome.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,uFAAuF;AACvF,2EAA2E;AAC3E,uFAAuF;AACvF,mFAAmF;AACnF,oEAAoE;AACpE,+DAA+D;AAC/D,4DAA4D;AAC5D,mEAAmE;AACnE,gBAAgB;AAEhB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AC;AAED;;;;;GAKG;AACH,MAAM,UAAU,8BAA8B,CAAC,UAAkB,EAAE,SAAmB;IACpF,OAAO,CAAC,2BAA2B,CAAC,UAAU,CAAC,IAAI,IAAI,CAAC,KAAK,IAAI;WAC5D,uBAAuB,CAAC,SAAS,CAAC,CAAC,eAAe,KAAK,SAAS,CAAC;AACxE,CAAC"}
@@ -0,0 +1,27 @@
1
+ import type { DaemonConfig } from '../types/index.js';
2
+ import type { PendingVerification } from '../queries/verification.js';
3
+ import type { getActiveFocuses } from '../queries/focus-discovery.js';
4
+ import type { getFocusDeliveries } from '../queries/focuses.js';
5
+ /** The reads the re-arm scan takes (a structural slice of VerificationDeps). */
6
+ export interface ExplicitRearmDeps {
7
+ getActiveFocuses: typeof getActiveFocuses;
8
+ getFocusDeliveries: typeof getFocusDeliveries;
9
+ resolveFocusHeadSha?: (focusId: string) => string | null;
10
+ }
11
+ /**
12
+ * The explicit-method rows of the product to select again this tick (see the
13
+ * module header). `pendingIds` are the rows daemon_get_pending_verifications
14
+ * already listed. Never throws: an unreadable focus list or delivery list re-arms
15
+ * nothing for it, and the next tick asks again.
16
+ */
17
+ export declare function collectRearmedExplicitVerifications(config: DaemonConfig, pendingIds: ReadonlySet<string>, deps: ExplicitRearmDeps): Promise<PendingVerification[]>;
18
+ /**
19
+ * Release the re-arm mark `candidate` set, when its run never judged its commit
20
+ * (see the module header), so the scan selects the delivery again at the same HEAD
21
+ * and gate. A no-op for a candidate this scan did not build, or once a later re-arm
22
+ * replaced its mark.
23
+ */
24
+ export declare function releaseExplicitRearm(candidate: PendingVerification): void;
25
+ /** Test seam: forget every re-arm this process made. */
26
+ export declare function __resetExplicitRearmForTests(): void;
27
+ //# sourceMappingURL=explicit-rearm.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"explicit-rearm.d.ts","sourceRoot":"","sources":["../../src/verify/explicit-rearm.ts"],"names":[],"mappings":"AAqDA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,KAAK,EAAE,mBAAmB,EAAsB,MAAM,4BAA4B,CAAC;AAC1F,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAShE,gFAAgF;AAChF,MAAM,WAAW,iBAAiB;IAChC,gBAAgB,EAAE,OAAO,gBAAgB,CAAC;IAC1C,kBAAkB,EAAE,OAAO,kBAAkB,CAAC;IAC9C,mBAAmB,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,MAAM,GAAG,IAAI,CAAC;CAC1D;AAwBD;;;;;GAKG;AACH,wBAAsB,mCAAmC,CACvD,MAAM,EAAE,YAAY,EACpB,UAAU,EAAE,WAAW,CAAC,MAAM,CAAC,EAC/B,IAAI,EAAE,iBAAiB,GACtB,OAAO,CAAC,mBAAmB,EAAE,CAAC,CAoDhC;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,mBAAmB,GAAG,IAAI,CAGzE;AAED,wDAAwD;AACxD,wBAAgB,4BAA4B,IAAI,IAAI,CAEnD"}
@@ -0,0 +1,161 @@
1
+ // PINNED-BY-BEGIN (generated by gen:pinned-by -- do not hand-edit; checked by lint:pinned-by)
2
+ // Pinned by: packages/daemon/src/integration/explicit-verdict-departure-during-removal.test.ts,
3
+ // packages/daemon/src/integration/explicit-verdict-invalidation-restart.test.ts,
4
+ // packages/daemon/src/integration/explicit-verdict-reuse.test.ts,
5
+ // packages/daemon/src/verify/verification-commit-sharing.test.ts
6
+ // PINNED-BY-END
7
+ /**
8
+ * Re-arm an explicit-method verification whose recorded pass does not cover the
9
+ * focus HEAD under the gate its row names now.
10
+ *
11
+ * daemon_get_pending_verifications lists an explicit-method row only while its
12
+ * verification_outcome is null or pending: the edge keeps a pass (and nulls a
13
+ * failure, which re-admits it). The default-on scan skips every row that names a
14
+ * method (verify/verification-default-on.ts). So once an explicit row passed at
15
+ * commit A, nothing ran its gate again: a team commit B was never judged, and the
16
+ * review exit either held for a verdict no run would render or -- through a
17
+ * commit-less row pass -- took A's pass for B. The same holds for the gate: the
18
+ * edge lets an operator change a row's method or config without resetting its
19
+ * outcome, so a new gate at an unchanged commit never ran either.
20
+ *
21
+ * Each tick, for a delivery still in verify whose durable row names a method that
22
+ * renders verdicts (not the always-pending behavioral scaffold) and records a pass,
23
+ * this reads the verdict its run is known to have rendered -- this process's record
24
+ * of the run, else the one on the delivery's gate_state
25
+ * (verify/explicit-gate-outcome.ts) -- and selects the row again, built from its
26
+ * durable columns, as an explicit candidate unless that verdict was rendered under
27
+ * the gate the row names now (explicitGateKeyOf) for the focus HEAD or for no commit:
28
+ * - only at a readable HEAD: an unreadable one re-arms nothing;
29
+ * - a verdict that judged NO commit (an in-place run, an ai_inspection) under the
30
+ * row's gate applies to the delivery, not to a commit: not re-armed;
31
+ * - a pass with no record of its run (a gate_state write that never landed), or
32
+ * one rendered under another gate, stands in for nothing, so it is re-armed;
33
+ * - not while a run for the delivery is selected or in flight, and at most once
34
+ * per (delivery, HEAD, gate) in this process once that run has routed a result:
35
+ * a routed result either moves the row off its pass (the edge records a
36
+ * pending, nulls a failure -- the pending queue takes it from there) or records
37
+ * the verdict this scan reads; a per-commit verdict a deterministic row's
38
+ * dispatch takes in place of a run is a routed result too.
39
+ * A re-armed run that routes NOTHING -- never started (the verdict its previous run
40
+ * recorded could not be durably removed, its delivery left verify, or its status
41
+ * could not be re-read), left verify mid-run, or threw -- judged nothing for the
42
+ * delivery, so the tick releases the mark (releaseExplicitRearm,
43
+ * verify/verification-commit-sharing.ts) and a later tick selects the unjudged HEAD
44
+ * again, rather than leaving it unjudged, and review held, until a restart or
45
+ * another commit.
46
+ * The explicit gate therefore runs once per new commit or gate, across ticks and a
47
+ * restart. Never throws.
48
+ *
49
+ * @module verify/explicit-rearm
50
+ */
51
+ import { DELIVERY_STATUS } from '@telora/daemon-core';
52
+ import { defaultResolveFocusHeadSha } from './verification-default-on.js';
53
+ import { isGateRunSelected } from './gate-run-registry.js';
54
+ import { readExplicitGateOutcomeRecord } from './explicit-gate-outcome.js';
55
+ import { explicitGateKeyOf } from './commit-verdict-record.js';
56
+ import { createLogger } from '../shell/log.js';
57
+ const log = createLogger({ module: 'verification' });
58
+ /** The (HEAD, gate) each delivery was last re-armed at in this process. */
59
+ const rearmedAt = new Map();
60
+ /** The mark each re-armed candidate set, so its dispatch releases exactly that mark. */
61
+ const candidateMarks = new WeakMap();
62
+ /** A method whose run renders a verdict (the behavioral scaffold always returns pending). */
63
+ function rendersVerdict(method) {
64
+ return method === 'deterministic' || method === 'ai_inspection';
65
+ }
66
+ function configRecord(value) {
67
+ return typeof value === 'object' && value !== null && !Array.isArray(value) ? value : null;
68
+ }
69
+ /** Why the recorded verdict does not cover `sha` under `gateKey`, or null when it does. */
70
+ function uncoveredBecause(recorded, sha, gateKey) {
71
+ if (recorded === null)
72
+ return 'there is no record of its run';
73
+ if (recorded.gateKey !== gateKey)
74
+ return 'its recorded verdict was rendered under another gate';
75
+ if (recorded.sha === null || recorded.sha === sha)
76
+ return null;
77
+ return `its recorded verdict judged ${recorded.sha.slice(0, 8)}`;
78
+ }
79
+ /**
80
+ * The explicit-method rows of the product to select again this tick (see the
81
+ * module header). `pendingIds` are the rows daemon_get_pending_verifications
82
+ * already listed. Never throws: an unreadable focus list or delivery list re-arms
83
+ * nothing for it, and the next tick asks again.
84
+ */
85
+ export async function collectRearmedExplicitVerifications(config, pendingIds, deps) {
86
+ const candidates = [];
87
+ let focuses;
88
+ try {
89
+ focuses = await deps.getActiveFocuses(config.organizationId, config.productId);
90
+ }
91
+ catch (err) {
92
+ log.warn(`[verification] explicit re-arm: failed to list focuses for product ${config.productId}:`, err.message);
93
+ return candidates;
94
+ }
95
+ for (const focus of focuses) {
96
+ if (focus.read_only === true)
97
+ continue;
98
+ let deliveries;
99
+ try {
100
+ deliveries = await deps.getFocusDeliveries(focus.focus_id);
101
+ }
102
+ catch (err) {
103
+ log.warn(`[verification] explicit re-arm: failed to fetch deliveries for focus ${focus.focus_id.slice(0, 8)}:`, err.message);
104
+ continue;
105
+ }
106
+ let head;
107
+ const readHead = () => (head ??= { sha: (deps.resolveFocusHeadSha ?? defaultResolveFocusHeadSha)(focus.focus_id) }).sha;
108
+ for (const d of deliveries) {
109
+ const method = d.verificationMethod;
110
+ if (d.executionStatus !== DELIVERY_STATUS.VERIFY || !d.injectionId || !rendersVerdict(method))
111
+ continue;
112
+ if (d.verificationOutcome !== 'passed' || pendingIds.has(d.id) || isGateRunSelected(d.id))
113
+ continue;
114
+ const sha = readHead();
115
+ if (sha === null)
116
+ continue;
117
+ const verificationConfig = configRecord(d.verificationConfig);
118
+ const gateKey = explicitGateKeyOf(method, verificationConfig);
119
+ const mark = `${sha}:${gateKey}`;
120
+ if (rearmedAt.get(d.id) === mark)
121
+ continue;
122
+ const why = uncoveredBecause(readExplicitGateOutcomeRecord(d.id, d.gateState), sha, gateKey);
123
+ if (why === null)
124
+ continue;
125
+ rearmedAt.set(d.id, mark);
126
+ log.info(`[verification] explicit: re-arming delivery "${d.name}" (${d.id}) at focus HEAD ${sha.slice(0, 8)} -- ${why}`);
127
+ const candidate = {
128
+ deliveryId: d.id,
129
+ deliveryName: d.name,
130
+ productId: config.productId,
131
+ focusId: focus.focus_id,
132
+ injectionNodeId: d.injectionId,
133
+ verificationMethod: method,
134
+ verificationConfig,
135
+ verificationOutcome: null,
136
+ verificationLastRunAt: null,
137
+ gitState: d.gitState,
138
+ mergeCommitSha: d.mergeCommitSha,
139
+ };
140
+ candidateMarks.set(candidate, mark);
141
+ candidates.push(candidate);
142
+ }
143
+ }
144
+ return candidates;
145
+ }
146
+ /**
147
+ * Release the re-arm mark `candidate` set, when its run never judged its commit
148
+ * (see the module header), so the scan selects the delivery again at the same HEAD
149
+ * and gate. A no-op for a candidate this scan did not build, or once a later re-arm
150
+ * replaced its mark.
151
+ */
152
+ export function releaseExplicitRearm(candidate) {
153
+ const mark = candidateMarks.get(candidate);
154
+ if (mark !== undefined && rearmedAt.get(candidate.deliveryId) === mark)
155
+ rearmedAt.delete(candidate.deliveryId);
156
+ }
157
+ /** Test seam: forget every re-arm this process made. */
158
+ export function __resetExplicitRearmForTests() {
159
+ rearmedAt.clear();
160
+ }
161
+ //# sourceMappingURL=explicit-rearm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"explicit-rearm.js","sourceRoot":"","sources":["../../src/verify/explicit-rearm.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,gGAAgG;AAChG,mFAAmF;AACnF,oEAAoE;AACpE,mEAAmE;AACnE,gBAAgB;AAEhB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAKtD,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAC1E,OAAO,EAAE,iBAAiB,EAAgC,MAAM,wBAAwB,CAAC;AACzF,OAAO,EAAE,6BAA6B,EAAE,MAAM,4BAA4B,CAAC;AAC3E,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,MAAM,GAAG,GAAG,YAAY,CAAC,EAAE,MAAM,EAAE,cAAc,EAAE,CAAC,CAAC;AASrD,2EAA2E;AAC3E,MAAM,SAAS,GAAG,IAAI,GAAG,EAAkB,CAAC;AAC5C,wFAAwF;AACxF,MAAM,cAAc,GAAG,IAAI,OAAO,EAA+B,CAAC;AAElE,6FAA6F;AAC7F,SAAS,cAAc,CAAC,MAAe;IACrC,OAAO,MAAM,KAAK,eAAe,IAAI,MAAM,KAAK,eAAe,CAAC;AAClE,CAAC;AAED,SAAS,YAAY,CAAC,KAAc;IAClC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,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