@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,105 @@
1
+ /**
2
+ * The gate runs a routing decision can still wait on, held in process.
3
+ *
4
+ * Two facts the review exit and the live open-work pass read before they route a
5
+ * verify delivery on review evidence alone (completion/review-exit-verdict-gate.ts):
6
+ *
7
+ * - which gate runs are SELECTED BUT NOT FINISHED, per focus. The verification
8
+ * tick registers every candidate the moment it selects it -- before the run
9
+ * waits on the shared verification semaphore behind another focus's gate --
10
+ * and ends the registration when its dispatch settles, however it settles
11
+ * (a verdict, a timeout, no checkout, a delivery that left verify, a throw).
12
+ * Once a run's detached checkout exists it names the commit it judges, so a
13
+ * wait keyed on one commit is not held by a run judging another; until then a
14
+ * registration may judge any commit on its focus (a dispatch reads HEAD only
15
+ * when it starts).
16
+ * - the outcome an EXPLICIT-METHOD run last recorded for its delivery. Such a run
17
+ * may execute in place or render a non-deterministic verdict, and neither
18
+ * writes a per-commit verdict record (verify/commit-verdict-record.ts), so its
19
+ * recorded outcome is its gate verdict: a pass or a failure, at the commit it
20
+ * judged, or for the delivery when it judged none. A run that rendered no
21
+ * verdict leaves none, and a new selection of the delivery forgets the outcome
22
+ * of the run before it -- both are remembered as "no verdict", so the durable
23
+ * copy of an older outcome is not read in their place. The tick also removes
24
+ * that durable copy before the selected run can start
25
+ * (verify/verification-commit-sharing.ts), so a restart reads "no verdict" too.
26
+ *
27
+ * The selected runs are in process on purpose. A daemon restart abandons every
28
+ * selected run, and an abandoned run renders no verdict, so after a restart
29
+ * nothing waits on one: a toward-intent route is never stranded behind a verdict
30
+ * no process will render. The explicit outcomes here are only the in-process fast
31
+ * path: each is also written to the delivery's gate_state
32
+ * (verify/explicit-gate-outcome.ts), which is what routing reads after a restart,
33
+ * when this process has seen no explicit run for the delivery.
34
+ *
35
+ * A leaf with no imports.
36
+ *
37
+ * @module verify/gate-run-registry
38
+ */
39
+ /** A candidate the verification tick selected. */
40
+ export interface GateRunSelection {
41
+ deliveryId: string;
42
+ focusId: string | null;
43
+ /** An explicit-method row: its run supersedes the outcome the delivery's previous run recorded. */
44
+ explicit: boolean;
45
+ }
46
+ /** The handle a selection is ended through. Idempotent. */
47
+ export interface GateRunRegistration {
48
+ end: () => void;
49
+ }
50
+ /** The outcome kept for an explicit-method delivery. */
51
+ export type RecordedGateOutcome = 'passed' | 'failed';
52
+ /** A verdict an explicit-method run rendered, the commit it applies to (null: it judged none, so it applies to any), and its gate. */
53
+ export interface RecordedExplicitOutcome {
54
+ outcome: RecordedGateOutcome;
55
+ sha: string | null;
56
+ /** The gate the run applied (verify/commit-verdict-record.ts explicitGateKeyOf); absent on a record that kept none. */
57
+ gateKey?: string;
58
+ }
59
+ /** Register a candidate the tick selected; end the registration when its dispatch settles. */
60
+ export declare function registerGateRun(selection: GateRunSelection): GateRunRegistration;
61
+ /** Name the commit a selected run judges (its detached checkout's sha). A no-op when the delivery has no selected run. */
62
+ export declare function noteGateRunCommit(deliveryId: string, sha: string): void;
63
+ /**
64
+ * Whether a selected, unfinished gate run on the focus may judge `sha`: one that
65
+ * names that commit, or one that names none yet. A null `sha` (a judged commit
66
+ * nobody could read) matches every run on the focus.
67
+ */
68
+ export declare function hasPendingGateRun(focusId: string, sha: string | null): boolean;
69
+ /** Whether a gate run for the delivery is selected and not yet finished (verify/explicit-rearm.ts selects no second one). */
70
+ export declare function isGateRunSelected(deliveryId: string): boolean;
71
+ /**
72
+ * The verdict a run's result renders: a pass or a failure, at its judged commit
73
+ * when that is a well-formed sha, else for no commit, under the gate the run
74
+ * applied (`gateKey`); null for any other outcome (no verdict). The one rule the
75
+ * in-process record and the durable one (verify/explicit-gate-outcome.ts) both
76
+ * apply. Pure.
77
+ */
78
+ export declare function explicitGateOutcomeOf(result: {
79
+ outcome: string;
80
+ verifiedSha?: string;
81
+ }, gateKey?: string): RecordedExplicitOutcome | null;
82
+ /** Note the run id a selected explicit candidate's selection named, so its verdict is recorded as that run's. */
83
+ export declare function noteExplicitRunId(candidate: object, runId: string): void;
84
+ /** The run id the candidate's selection named, or undefined when none did. */
85
+ export declare function explicitRunIdOf(candidate: object): string | undefined;
86
+ /** Record the outcome an explicit-method run rendered under the gate it applied (see the module header for what is kept). */
87
+ export declare function recordExplicitGateOutcome(deliveryId: string, result: {
88
+ outcome: string;
89
+ verifiedSha?: string;
90
+ }, gateKey?: string): void;
91
+ /**
92
+ * What this process knows about the delivery's explicit-method verdict: the
93
+ * verdict its latest run rendered, null for "no verdict" (a selection since, or a
94
+ * run that rendered none), or undefined when this process has seen no explicit run
95
+ * for the delivery -- the durable record is then the one to read.
96
+ */
97
+ export declare function readLiveExplicitGateOutcome(deliveryId: string): RecordedExplicitOutcome | null | undefined;
98
+ /**
99
+ * The outcome an explicit-method run recorded for the delivery in this process when
100
+ * it applies to `sha` -- the run judged that commit, or judged none -- else null.
101
+ */
102
+ export declare function readExplicitGateOutcome(deliveryId: string, sha: string | null): RecordedGateOutcome | null;
103
+ /** Test seam: forget every selected run and recorded outcome. */
104
+ export declare function __resetGateRunRegistryForTests(): void;
105
+ //# sourceMappingURL=gate-run-registry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gate-run-registry.d.ts","sourceRoot":"","sources":["../../src/verify/gate-run-registry.ts"],"names":[],"mappings":"AAgBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAEH,kDAAkD;AAClD,MAAM,WAAW,gBAAgB;IAC/B,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,mGAAmG;IACnG,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,2DAA2D;AAC3D,MAAM,WAAW,mBAAmB;IAClC,GAAG,EAAE,MAAM,IAAI,CAAC;CACjB;AAED,wDAAwD;AACxD,MAAM,MAAM,mBAAmB,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAStD,sIAAsI;AACtI,MAAM,WAAW,uBAAuB;IACtC,OAAO,EAAE,mBAAmB,CAAC;IAC7B,GAAG,EAAE,MAAM,GAAG,IA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IAAI,GAAG,mBAAmB,GAAG,IAAI,CAI1G;AAED,iEAAiE;AACjE,wBAAgB,8BAA8B,IAAI,IAAI,CAGrD"}
@@ -0,0 +1,111 @@
1
+ // PINNED-BY-BEGIN (generated by gen:pinned-by -- do not hand-edit; checked by lint:pinned-by)
2
+ // Pinned by: packages/daemon/src/completion/commit-verdict-release.test.ts,
3
+ // packages/daemon/src/focus/listener-product-poll.test.ts,
4
+ // packages/daemon/src/focus/verify-routing-passes.test.ts,
5
+ // packages/daemon/src/integration/delivery-gate-write-interleaving.test.ts,
6
+ // packages/daemon/src/integration/explicit-gate-identity-unreadable.test.ts,
7
+ // packages/daemon/src/integration/explicit-gate-outcome-restart.test.ts,
8
+ // packages/daemon/src/integration/explicit-verdict-departure-during-removal.test.ts,
9
+ // packages/daemon/src/integration/explicit-verdict-invalidation-restart.test.ts,
10
+ // packages/daemon/src/integration/explicit-verdict-reuse.test.ts,
11
+ // packages/daemon/src/integration/focus-commit-verdict-scenario.test.ts,
12
+ // packages/daemon/src/integration/review-rework-resume-verdict.test.ts,
13
+ // packages/daemon/src/verify/explicit-run-ledger.test.ts,
14
+ // packages/daemon/src/verify/verification-commit-sharing.test.ts
15
+ // PINNED-BY-END
16
+ const SHA_RE = /^[0-9a-f]{7,64}$/i;
17
+ const selectedRuns = new Set();
18
+ /** Per delivery this process has seen an explicit run for: its verdict, or null for "no verdict" (see the module header). */
19
+ const explicitOutcomes = new Map();
20
+ /** Register a candidate the tick selected; end the registration when its dispatch settles. */
21
+ export function registerGateRun(selection) {
22
+ const run = { deliveryId: selection.deliveryId, focusId: selection.focusId, sha: null };
23
+ selectedRuns.add(run);
24
+ if (selection.explicit)
25
+ explicitOutcomes.set(selection.deliveryId, null);
26
+ return {
27
+ end: () => {
28
+ selectedRuns.delete(run);
29
+ },
30
+ };
31
+ }
32
+ /** Name the commit a selected run judges (its detached checkout's sha). A no-op when the delivery has no selected run. */
33
+ export function noteGateRunCommit(deliveryId, sha) {
34
+ for (const run of selectedRuns) {
35
+ if (run.deliveryId === deliveryId)
36
+ run.sha = sha;
37
+ }
38
+ }
39
+ /**
40
+ * Whether a selected, unfinished gate run on the focus may judge `sha`: one that
41
+ * names that commit, or one that names none yet. A null `sha` (a judged commit
42
+ * nobody could read) matches every run on the focus.
43
+ */
44
+ export function hasPendingGateRun(focusId, sha) {
45
+ for (const run of selectedRuns) {
46
+ if (run.focusId === focusId && (run.sha === null || sha === null || run.sha === sha))
47
+ return true;
48
+ }
49
+ return false;
50
+ }
51
+ /** Whether a gate run for the delivery is selected and not yet finished (verify/explicit-rearm.ts selects no second one). */
52
+ export function isGateRunSelected(deliveryId) {
53
+ for (const run of selectedRuns) {
54
+ if (run.deliveryId === deliveryId)
55
+ return true;
56
+ }
57
+ return false;
58
+ }
59
+ /**
60
+ * The verdict a run's result renders: a pass or a failure, at its judged commit
61
+ * when that is a well-formed sha, else for no commit, under the gate the run
62
+ * applied (`gateKey`); null for any other outcome (no verdict). The one rule the
63
+ * in-process record and the durable one (verify/explicit-gate-outcome.ts) both
64
+ * apply. Pure.
65
+ */
66
+ export function explicitGateOutcomeOf(result, gateKey) {
67
+ const { outcome } = result;
68
+ if (outcome !== 'passed' && outcome !== 'failed')
69
+ return null;
70
+ const sha = typeof result.verifiedSha === 'string' && SHA_RE.test(result.verifiedSha) ? result.verifiedSha : null;
71
+ return { outcome, sha, ...(gateKey !== undefined ? { gateKey } : {}) };
72
+ }
73
+ /** The run id each selected explicit candidate was named (verify/explicit-run-ledger.ts), keyed by the candidate itself. */
74
+ const explicitRunIds = new WeakMap();
75
+ /** Note the run id a selected explicit candidate's selection named, so its verdict is recorded as that run's. */
76
+ export function noteExplicitRunId(candidate, runId) {
77
+ explicitRunIds.set(candidate, runId);
78
+ }
79
+ /** The run id the candidate's selection named, or undefined when none did. */
80
+ export function explicitRunIdOf(candidate) {
81
+ return explicitRunIds.get(candidate);
82
+ }
83
+ /** Record the outcome an explicit-method run rendered under the gate it applied (see the module header for what is kept). */
84
+ export function recordExplicitGateOutcome(deliveryId, result, gateKey) {
85
+ explicitOutcomes.set(deliveryId, explicitGateOutcomeOf(result, gateKey));
86
+ }
87
+ /**
88
+ * What this process knows about the delivery's explicit-method verdict: the
89
+ * verdict its latest run rendered, null for "no verdict" (a selection since, or a
90
+ * run that rendered none), or undefined when this process has seen no explicit run
91
+ * for the delivery -- the durable record is then the one to read.
92
+ */
93
+ export function readLiveExplicitGateOutcome(deliveryId) {
94
+ return explicitOutcomes.get(deliveryId);
95
+ }
96
+ /**
97
+ * The outcome an explicit-method run recorded for the delivery in this process when
98
+ * it applies to `sha` -- the run judged that commit, or judged none -- else null.
99
+ */
100
+ export function readExplicitGateOutcome(deliveryId, sha) {
101
+ const recorded = explicitOutcomes.get(deliveryId);
102
+ if (!recorded)
103
+ return null;
104
+ return recorded.sha === null || recorded.sha === sha ? recorded.outcome : null;
105
+ }
106
+ /** Test seam: forget every selected run and recorded outcome. */
107
+ export function __resetGateRunRegistryForTests() {
108
+ selectedRuns.clear();
109
+ explicitOutcomes.clear();
110
+ }
111
+ //# sourceMappingURL=gate-run-registry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gate-run-registry.js","sourceRoot":"","sources":["../../src/verify/gate-run-registry.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,4EAA4E;AAC5E,6DAA6D;AAC7D,6DAA6D;AAC7D,8EAA8E;AAC9E,+EAA+E;AAC/E,2EAA2E;AAC3E,uFAAuF;AACvF,mFAAmF;AACnF,oEAAoE;AACpE,2EAA2E;AAC3E,0EAA0E;AAC1E,4DAA4D;AAC5D,mEAAmE;AACnE,gBAAgB;AAwEhB,MAAM,MAAM,GAAG,mBAAmB,CAAC;AAEnC,MAAM,YAAY,GAAG,IAAI,GAAG,EAAe,CAAC;AAC5C,6HAA6H;AAC7H,MAAM,gBAAgB,GAAG,IAAI,GAAG,EAA0C,CAAC;AAE3E,8FAA8F;AAC9F,MAAM,UAAU,eAAe,CAAC,SAA2B;IACzD,MAAM,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,CAAC,UAAU,CAAC,CAAC;IAClD,IAAI,CAAC,QAAQ;QAAE,OAAO,IAAI,CAAC;IAC3B,OAAO,QAAQ,CAAC,GAAG,KAAK,IAAI,IAAI,QAAQ,CAAC,GAAG,KAAK,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC;AACjF,CAAC;AAED,iEAAiE;AACjE,MAAM,UAAU,8BAA8B;IAC5C,YAAY,CAAC,KAAK,EAAE,CAAC;IACrB,gBAAgB,CAAC,KAAK,EAAE,CAAC;AAC3B,CAAC"}
@@ -0,0 +1,68 @@
1
+ import { type GateVerdictSummary, type JudgedCommit } from '../queries/delivery-gate-state.js';
2
+ import { type CommitVerdict } from './commit-verdict-record.js';
3
+ /** The slice of a deterministic StrategyResult a verdict is derived from. */
4
+ export interface GateRunVerdictSource {
5
+ outcome?: string;
6
+ exitCode?: number | null;
7
+ timedOut?: boolean;
8
+ checkoutUnavailable?: boolean;
9
+ configUnresolved?: boolean;
10
+ verifiedSha?: string;
11
+ failedStage?: string;
12
+ preExistingStages?: string[];
13
+ }
14
+ /** The commit a run judged (its well-formed verifiedSha), or null for a run that judged none. Pure. */
15
+ export declare function judgedShaOfRun(run: Pick<GateRunVerdictSource, 'verifiedSha'>): string | null;
16
+ /** The verdict a finished deterministic run rendered for its commit, or null when it rendered none. Pure. */
17
+ export declare function gateVerdictFromRun(run: GateRunVerdictSource): GateVerdictSummary | null;
18
+ /** The summary of a durable commit verdict. Pure. */
19
+ export declare function gateVerdictFromCommitVerdict(verdict: CommitVerdict): GateVerdictSummary;
20
+ /** Injected IO for the judged-commit read; the default reaches the record store. */
21
+ export interface JudgedCommitVerdictDeps {
22
+ readVerdict: (productId: string, focusId: string, sha: string) => CommitVerdict | null;
23
+ }
24
+ /** Which judged commit to read: the exact sha a run judged, on its product + focus. */
25
+ export interface JudgedCommitTarget {
26
+ productId?: string | null;
27
+ focusId?: string | null;
28
+ sha?: string | null;
29
+ }
30
+ /**
31
+ * The recorded gate verdict for exactly the judged commit `target.sha`, or null
32
+ * (no product/focus, no or malformed sha, no record). Never resolves HEAD and
33
+ * never throws: a message that cannot read the verdict still goes out, just
34
+ * without the section.
35
+ */
36
+ export declare function readJudgedCommitGateVerdict(target: JudgedCommitTarget, deps?: Partial<JudgedCommitVerdictDeps>): GateVerdictSummary | null;
37
+ /**
38
+ * The recorded verdict for the commit a re-work's run judged, through the
39
+ * re-work's reader, or null when the run judged none (the reader is then not
40
+ * asked: no sha is never "the HEAD").
41
+ */
42
+ export declare function readJudgedVerdictFor(d: {
43
+ readGateVerdict: (target: JudgedCommitTarget) => GateVerdictSummary | null;
44
+ }, v: {
45
+ productId?: string | null;
46
+ focusId?: string | null;
47
+ }, judgedSha: string | null): GateVerdictSummary | null;
48
+ /** A focus delivery as the resume path reads it. */
49
+ export interface JudgedDeliveryRow {
50
+ executionStatus?: string | null;
51
+ gateState?: unknown;
52
+ }
53
+ /**
54
+ * The live (not done, not cancelled) delivery carrying the most recent judged
55
+ * commit stamped on its gate_state, with that judged commit, or null when none
56
+ * carries one. The delivery is what the resume resolves its own gate for. Pure.
57
+ */
58
+ export declare function latestJudgedDelivery<T extends JudgedDeliveryRow>(deliveries: readonly T[]): {
59
+ delivery: T;
60
+ judged: JudgedCommit;
61
+ } | null;
62
+ /**
63
+ * The most recent judged commit stamped on a live delivery's gate_state
64
+ * (latestJudgedDelivery), or null. What a resumed focus session is shown the
65
+ * verdict for. Pure.
66
+ */
67
+ export declare function latestJudgedCommit(deliveries: readonly JudgedDeliveryRow[]): JudgedCommit | null;
68
+ //# sourceMappingURL=gate-verdict-source.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gate-verdict-source.d.ts","sourceRoot":"","sources":["../../src/verify/gate-verdict-source.ts"],"names":[],"mappings":"AA4CA,OAAO,EAEL,KAAK,kBAAkB,EACvB,KAAK,YAAY,EAClB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAqB,KAAK,aAA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oBAAoB,CAClC,CAAC,EAAE;IAAE,eAAe,EAAE,CAAC,MAAM,EAAE,kBAAkB,KAAK,kBAAkB,GAAG,IAAI,CAAA;CAAE,EACjF,CAAC,EAAE;IAAE,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,EACzD,SAAS,EAAE,MAAM,GAAG,IAAI,GACvB,kBAAkB,GAAG,IAAI,CAE3B;AAED,oDAAoD;AACpD,MAAM,WAAW,iBAAiB;IAChC,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAKD;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,CAAC,SAAS,iBAAiB,EAAE,UAAU,EAAE,SAAS,CAAC,EAAE,GAAG;IAAE,QAAQ,EAAE,CAAC,CAAC;IAAC,MAAM,EAAE,YAAY,CAAA;CAAE,GAAG,IAAI,CAQxI;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,SAAS,iBAAiB,EAAE,GAAG,YAAY,GAAG,IAAI,CAEhG"}
@@ -0,0 +1,143 @@
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/gate-verdict-source.test.ts,
3
+ // packages/daemon/src/verify/rework-judgment.test.ts,
4
+ // packages/daemon/src/verify/verification-feedback.test.ts,
5
+ // packages/daemon/src/verify/verify-evidence-unavailable.test.ts
6
+ // PINNED-BY-END
7
+ /**
8
+ * Where the gate verdict a team is shown comes from.
9
+ *
10
+ * One shape (GateVerdictSummary), always for the commit a run JUDGED -- never
11
+ * for whatever the focus worktree HEAD is when the message is built. Commit B can
12
+ * land while commit A is being judged; a message about A that re-resolved HEAD
13
+ * would omit A's verdict or report B's.
14
+ *
15
+ * - the RUN in hand. The deterministic-failure feedback holds the StrategyResult
16
+ * and derives the verdict from it by the same rule the durable record uses
17
+ * (commit-verdict-record.buildCommitVerdict): no verdict for a timeout, an
18
+ * unavailable checkout, an unresolved config, or a run with no judged commit.
19
+ * - the durable RECORD for the judged sha. The shortfall and evidence-unavailable
20
+ * re-work are handed the sha of the run that judged them (judgedShaOfRun) and
21
+ * that run's own verdict (verify/rework-judgment.ts runVerdictOf); only a
22
+ * writer handed no run reads the record by exactly that sha.
23
+ * - the JUDGED COMMIT a re-work stamped. The resume delta holds no run, so it
24
+ * reads the judged commit the latest re-work stamped on a live delivery's
25
+ * gate_state (latestJudgedDelivery) -- a verification re-work's, or a
26
+ * verify_failed route for review-filed work (the review exit, or the live
27
+ * open-work pass; completion/review-exit-verdict-gate.ts). Every writer
28
+ * persists the delivery's OWN verdict beside that sha (a verification
29
+ * re-work: its run's; a review-filed route: its own-gate read), and the
30
+ * resume shows it. A stamp that carries none is resolved under THAT
31
+ * delivery's own gate (spawn/prompt-assembly.ts, through the review exit's
32
+ * own-gate reads), never by a gate-less record read: one commit can carry
33
+ * several gates' verdicts, and a sibling gate's must not answer. No judged
34
+ * sha, or no own-gate verdict for it, is no verdict: the message omits the
35
+ * section rather than guessing.
36
+ *
37
+ * Rendering lives in prompt-sections/gate-verdict-section.ts.
38
+ *
39
+ * @module gate-verdict-source
40
+ */
41
+ import { DELIVERY_STATUS } from '@telora/daemon-core';
42
+ import { createLogger } from '../shell/log.js';
43
+ import { readVerificationHistory, } from '../queries/delivery-gate-state.js';
44
+ import { readCommitVerdict } from './commit-verdict-record.js';
45
+ const log = createLogger({ module: 'verification' });
46
+ const SHA_RE = /^[0-9a-f]{7,64}$/i;
47
+ function carriedStages(stages) {
48
+ return stages && stages.length > 0 ? { preExistingStages: [...stages] } : {};
49
+ }
50
+ /** The commit a run judged (its well-formed verifiedSha), or null for a run that judged none. Pure. */
51
+ export function judgedShaOfRun(run) {
52
+ const sha = run.verifiedSha;
53
+ return typeof sha === 'string' && SHA_RE.test(sha) ? sha : null;
54
+ }
55
+ /** The verdict a finished deterministic run rendered for its commit, or null when it rendered none. Pure. */
56
+ export function gateVerdictFromRun(run) {
57
+ if (run.timedOut || run.checkoutUnavailable || run.configUnresolved)
58
+ return null;
59
+ const sha = judgedShaOfRun(run);
60
+ if (sha === null)
61
+ return null;
62
+ // Exit 0 is the gate command passing: the strategy never reports 'failed' at
63
+ // exit 0 itself, so a failed outcome at exit 0 was demoted AFTER the gate by a
64
+ // per-delivery check (the security verify-closed gate) -- not the commit's
65
+ // verdict. A non-zero exit whose reds all pre-exist was demoted to 'passed' by
66
+ // attribution, and that pass IS what the record holds for the commit.
67
+ const passed = run.exitCode === 0 || run.outcome === 'passed';
68
+ if (!passed && (run.outcome !== 'failed' || typeof run.exitCode !== 'number'))
69
+ return null;
70
+ return {
71
+ outcome: passed ? 'passed' : 'failed',
72
+ sha,
73
+ ...(!passed && run.failedStage ? { failedStage: run.failedStage } : {}),
74
+ ...carriedStages(run.preExistingStages),
75
+ };
76
+ }
77
+ /** The summary of a durable commit verdict. Pure. */
78
+ export function gateVerdictFromCommitVerdict(verdict) {
79
+ return {
80
+ outcome: verdict.outcome,
81
+ sha: verdict.sha,
82
+ ...(verdict.outcome === 'failed' && verdict.failedStage ? { failedStage: verdict.failedStage } : {}),
83
+ ...carriedStages(verdict.preExistingStages),
84
+ };
85
+ }
86
+ const defaultJudgedCommitVerdictDeps = () => ({
87
+ readVerdict: (productId, focusId, sha) => readCommitVerdict(productId, focusId, sha),
88
+ });
89
+ /**
90
+ * The recorded gate verdict for exactly the judged commit `target.sha`, or null
91
+ * (no product/focus, no or malformed sha, no record). Never resolves HEAD and
92
+ * never throws: a message that cannot read the verdict still goes out, just
93
+ * without the section.
94
+ */
95
+ export function readJudgedCommitGateVerdict(target, deps = {}) {
96
+ const { productId, focusId, sha } = target;
97
+ if (!productId || !focusId || !sha || !SHA_RE.test(sha))
98
+ return null;
99
+ const d = { ...defaultJudgedCommitVerdictDeps(), ...deps };
100
+ try {
101
+ const verdict = d.readVerdict(productId, focusId, sha);
102
+ return verdict ? gateVerdictFromCommitVerdict(verdict) : null;
103
+ }
104
+ catch (err) {
105
+ log.debug(`[verification] judged-commit verdict read failed for ${focusId}@${sha.slice(0, 8)}:`, err.message);
106
+ return null;
107
+ }
108
+ }
109
+ /**
110
+ * The recorded verdict for the commit a re-work's run judged, through the
111
+ * re-work's reader, or null when the run judged none (the reader is then not
112
+ * asked: no sha is never "the HEAD").
113
+ */
114
+ export function readJudgedVerdictFor(d, v, judgedSha) {
115
+ return judgedSha ? d.readGateVerdict({ productId: v.productId, focusId: v.focusId, sha: judgedSha }) : null;
116
+ }
117
+ /** Deliveries whose judgment no longer describes work a resumed team is doing. */
118
+ const SETTLED_STATUSES = new Set([DELIVERY_STATUS.DONE, DELIVERY_STATUS.CANCELLED]);
119
+ /**
120
+ * The live (not done, not cancelled) delivery carrying the most recent judged
121
+ * commit stamped on its gate_state, with that judged commit, or null when none
122
+ * carries one. The delivery is what the resume resolves its own gate for. Pure.
123
+ */
124
+ export function latestJudgedDelivery(deliveries) {
125
+ let latest = null;
126
+ for (const delivery of deliveries) {
127
+ if (delivery.executionStatus && SETTLED_STATUSES.has(delivery.executionStatus))
128
+ continue;
129
+ const judged = readVerificationHistory(delivery.gateState).judgedCommit;
130
+ if (judged && (latest === null || judged.judgedAt > latest.judged.judgedAt))
131
+ latest = { delivery, judged };
132
+ }
133
+ return latest;
134
+ }
135
+ /**
136
+ * The most recent judged commit stamped on a live delivery's gate_state
137
+ * (latestJudgedDelivery), or null. What a resumed focus session is shown the
138
+ * verdict for. Pure.
139
+ */
140
+ export function latestJudgedCommit(deliveries) {
141
+ return latestJudgedDelivery(deliveries)?.judged ?? null;
142
+ }
143
+ //# sourceMappingURL=gate-verdict-source.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gate-verdict-source.js","sourceRoot":"","sources":["../../src/verify/gate-verdict-source.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,qEAAqE;AACrE,wDAAwD;AACxD,8DA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IAAI,QAAQ,CAAC,eAAe,IAAI,gBAAgB,CAAC,GAAG,CAAC,QAAQ,CAAC,eAAe,CAAC;YAAE,SAAS;QACzF,MAAM,MAAM,GAAG,uBAAuB,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,YAAY,CAAC;QACxE,IAAI,MAAM,IAAI,CAAC,MAAM,KAAK,IAAI,IAAI,MAAM,CAAC,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC;YAAE,MAAM,GAAG,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC;IAC7G,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,kBAAkB,CAAC,UAAwC;IACzE,OAAO,oBAAoB,CAAC,UAAU,CAAC,EAAE,MAAM,IAAI,IAAI,CAAC;AAC1D,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { type VerificationConfigScope } from './verification-config.js';
2
+ import { type VerifyManifestReader } from './verification-manifest.js';
3
+ import type { CommitVerdictGate } from './commit-verdict-record.js';
4
+ import type { JudgedCommitManifest } from './verification-default-on.js';
5
+ /**
6
+ * The gate a default-on run applies at the judged commit `read` names (see the
7
+ * module header), or null when that run would record no verdict. `source` is the
8
+ * candidate's default-on source (its operator block and the product repoPath).
9
+ */
10
+ export declare function judgedCommitGate(source: VerificationConfigScope, read: JudgedCommitManifest, env?: NodeJS.ProcessEnv, readManifest?: VerifyManifestReader): CommitVerdictGate | null;
11
+ //# sourceMappingURL=judged-commit-gate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"judged-commit-gate.d.ts","sourceRoot":"","sources":["../../src/verify/judged-commit-gate.ts"],"names":[],"mappings":"AA6BA,OAAO,EAAoC,KAAK,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AAC1G,OAAO,EAAiD,KAAK,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AACtH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAEzE;;;;GAIG;AACH,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,uBAAuB,EAC/B,IAAI,EAAE,oBAAoB,EAC1B,GAAG,GAAE,MAAM,CAAC,UAAwB,EACpC,YAAY,GAAE,oBAAyC,GACtD,iBAAiB,GAAG,IAAI,CAW1B"}
@@ -0,0 +1,48 @@
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/judged-commit-gate.test.ts
3
+ // PINNED-BY-END
4
+ /**
5
+ * The gate a default-on run of a focus's judged commit actually APPLIES, resolved
6
+ * without a checkout -- the ONE derivation the per-commit verdict reuse read
7
+ * (verify/verification-commit-sharing.ts) and verify routing
8
+ * (verify/commit-gate-configured.ts) key a default-on verdict by.
9
+ *
10
+ * A default-on candidate is selected with a command + timeout resolved against
11
+ * the product repoPath, but its run re-resolves both from the detached checkout
12
+ * of the judged commit (verify/verification-checkout.ts) and records its verdict
13
+ * under the config it APPLIED (commit-verdict-record.ts recordCommitVerdictFor).
14
+ * A branch whose telora.verify.json overrides the repoPath gate therefore runs --
15
+ * and records -- gate B while it was selected under gate A. A read keyed by A
16
+ * would reuse a verdict of a gate that never ran on that commit, and miss the one
17
+ * that did. So this resolves the same layers the run does -- env > operator block
18
+ * > the manifest the judged commit ships (read from git at that sha) > the
19
+ * repoPath manifest as fallback -- through resolveAppliedVerificationConfig itself.
20
+ *
21
+ * No gate (null) where the run renders no verdict to key: a malformed committed
22
+ * manifest or a resolution that throws (the run refuses both as unresolvable), or
23
+ * no command at all.
24
+ *
25
+ * @module verify/judged-commit-gate
26
+ */
27
+ import { dirname } from 'node:path';
28
+ import { resolveAppliedVerificationConfig } from './verification-config.js';
29
+ import { readVerifyManifest, resolveVerifyManifestPath } from './verification-manifest.js';
30
+ /**
31
+ * The gate a default-on run applies at the judged commit `read` names (see the
32
+ * module header), or null when that run would record no verdict. `source` is the
33
+ * candidate's default-on source (its operator block and the product repoPath).
34
+ */
35
+ export function judgedCommitGate(source, read, env = process.env, readManifest = readVerifyManifest) {
36
+ if (read.malformed !== undefined)
37
+ return null;
38
+ // The judged commit's manifest answers for the worktree path; every other path (the fallback) is read as the run reads it.
39
+ const atJudgedCommit = (repoPath, fs) => (repoPath !== undefined && resolveVerifyManifestPath(repoPath) === read.manifestPath ? read.manifest : readManifest(repoPath, fs));
40
+ try {
41
+ const applied = resolveAppliedVerificationConfig(source, dirname(read.manifestPath), env, atJudgedCommit);
42
+ return applied.command.trim() === '' ? null : { command: applied.command, timeoutMs: applied.timeoutMs };
43
+ }
44
+ catch {
45
+ return null;
46
+ }
47
+ }
48
+ //# sourceMappingURL=judged-commit-gate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"judged-commit-gate.js","sourceRoot":"","sources":["../../src/verify/judged-commit-gate.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,mEAAmE;AACnE,gBAAgB;AAEhB;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,gCAAgC,EAAgC,MAAM,0BAA0B,CAAC;AAC1G,OAAO,EAAE,kBAAkB,EAAE,yBAAyB,EAA6B,MAAM,4BAA4B,CAAC;AAItH;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAC9B,MAA+B,EAC/B,IAA0B,EAC1B,MAAyB,OAAO,CAAC,GAAG,EACpC,eAAqC,kBAAkB;IAEvD,IAAI,IAAI,CAAC,SAAS,KAAK,SAAS;QAAE,OAAO,IAAI,CAAC;IAC9C,2HAA2H;IAC3H,MAAM,cAAc,GAAyB,CAAC,QAAQ,EAAE,EAAE,EAAE,EAAE,CAC5D,CAAC,QAAQ,KAAK,SAAS,IAAI,yBAAyB,CAAC,QAAQ,CAAC,KAAK,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,YAAY,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC;IACrI,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,gCAAgC,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,YAAY,CAAC,EAAE,GAAG,EAAE,cAAc,CAAC,CAAC;QAC1G,OAAO,OAAO,CAAC,OAAO,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,OAAO,EAAE,SAAS,EAAE,OAAO,CAAC,SAAS,EAAE,CAAC;IAC3G,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC"}
@@ -0,0 +1,58 @@
1
+ /**
2
+ * What a verification re-work stamps as the delivery's judged commit: the commit
3
+ * its run judged, and THAT run's own verdict persisted beside it.
4
+ *
5
+ * A run is selected under the delivery's own gate, so the verdict it rendered
6
+ * (gateVerdictFromRun, by the rule the durable per-commit record uses) is the
7
+ * delivery's own-gate verdict for the commit. Persisting it beside the sha is what
8
+ * lets the resume (spawn/prompt-assembly.ts) show it without reading any record.
9
+ * A stamp that carries none -- the run rendered no verdict (a timeout, an
10
+ * unavailable checkout, an instrument fault), or a legacy stamp -- is resolved
11
+ * there under the delivery's own gate, never by a gate-less record read.
12
+ *
13
+ * The deterministic-failure, shortfall and evidence-unavailable re-work writers
14
+ * share it (verify/verification-feedback.ts,
15
+ * verify/verification-evidence-unavailable-feedback.ts); extracted so
16
+ * verification-feedback.ts stays under the daemon 800-line cap.
17
+ *
18
+ * @module verify/rework-judgment
19
+ */
20
+ import { type DeliveryGateState, type GateVerdictSummary } from '../queries/delivery-gate-state.js';
21
+ import { type GateRunVerdictSource, type JudgedCommitTarget } from './gate-verdict-source.js';
22
+ /** The run a re-work feeds back, as its writer is handed it. */
23
+ export interface ReworkRunJudgment {
24
+ /** The commit the run judged; null or absent when it judged none. */
25
+ judgedSha?: string | null;
26
+ /**
27
+ * The verdict that run rendered for `judgedSha` (runVerdictOf); null when it
28
+ * rendered none. Absent only where the writer was not handed the run at all.
29
+ */
30
+ runVerdict?: GateVerdictSummary | null;
31
+ }
32
+ /**
33
+ * The verdict a finished run rendered for its commit, or null when it rendered
34
+ * none. `instrumentFault` is true when attribution routed the run to
35
+ * instrument-fault re-work, which records no verdict for the commit
36
+ * (commit-verdict-record.buildCommitVerdict), so none is shown for it either. Pure.
37
+ */
38
+ export declare function runVerdictOf(run: GateRunVerdictSource, instrumentFault: boolean): GateVerdictSummary | null;
39
+ /**
40
+ * `gateState` with its judged commit replaced by the run's, and the run's own
41
+ * verdict persisted beside it when it is a verdict for that commit
42
+ * (stampJudgedCommit). Never a record read. Pure.
43
+ */
44
+ export declare function stampReworkJudgment(gateState: DeliveryGateState, judgment: ReworkRunJudgment, judgedAt: string): DeliveryGateState;
45
+ /**
46
+ * The verdict a re-work DETAIL carries (the live inject, and the listing a
47
+ * respawned team reads): the run's own verdict whenever the writer was handed the
48
+ * run -- null included, since a run that rendered none has none to show -- else
49
+ * the recorded verdict for exactly the judged commit through the writer's reader.
50
+ * No judged sha asks nothing.
51
+ */
52
+ export declare function reworkDetailVerdict(d: {
53
+ readGateVerdict: (target: JudgedCommitTarget) => GateVerdictSummary | null;
54
+ }, v: {
55
+ productId?: string | null;
56
+ focusId?: string | null;
57
+ }, judgment: ReworkRunJudgment): GateVerdictSummary | null;
58
+ //# sourceMappingURL=rework-judgment.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rework-judgment.d.ts","sourceRoot":"","sources":["../../src/verify/rework-judgment.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAqB,KAAK,iBAAiB,EAAE,KAAK,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AACvH,OAAO,EAGL,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,EACxB,MAAM,0BAA0B,CAAC;AAElC,gEAAgE;AAChE,MAAM,WAAW,iBAAiB;IAChC,qEAAqE;IACrE,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B;;;OAGG;IACH,UAAU,CAAC,EAAE,kBAAkB,GAAG,IAAI,CAAC;CACxC;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,oBAAoB,EAAE,eAAe,EAAE,OAAO,GAAG,kBAAkB,GAAG,IAAI,CAE3G;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,iBAAiB,EAAE,QAAQ,EAAE,iBAAiB,EAAE,QAAQ,EAAE,MAAM,GAAG,iBAAiB,CAElI;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CACjC,CAAC,EAAE;IAAE,eAAe,EAAE,CAAC,MAAM,EAAE,kBAAkB,KAAK,kBAAkB,GAAG,IAAI,CAAA;CAAE,EACjF,CAAC,EAAE;IAAE,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,EACzD,QAAQ,EAAE,iBAAiB,GAC1B,kBAAkB,GAAG,IAAI,CAG3B"}