@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":"gate-verdict-source.js","sourceRoot":"","sources":["../../src/verify/gate-verdict-source.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,qEAAqE;AACrE,wDAAwD;AACxD,8DAA8D;AAC9D,mEAAmE;AACnE,gBAAgB;AAEhB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EACL,uBAAuB,GAGxB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,iBAAiB,EAAsB,MAAM,4BAA4B,CAAC;AAEnF,MAAM,GAAG,GAAG,YAAY,CAAC,EAAE,MAAM,EAAE,cAAc,EAAE,CAAC,CAAC;AAErD,MAAM,MAAM,GAAG,mBAAmB,CAAC;AAcnC,SAAS,aAAa,CAAC,MAAqC;IAC1D,OAAO,MAAM,IAAI,MAAM,CAAC,MAAM,GAA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AAM,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-g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}
@@ -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"}
@@ -0,0 +1,54 @@
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/rework-judgment.test.ts
3
+ // PINNED-BY-END
4
+ /**
5
+ * What a verification re-work stamps as the delivery's judged commit: the commit
6
+ * its run judged, and THAT run's own verdict persisted beside it.
7
+ *
8
+ * A run is selected under the delivery's own gate, so the verdict it rendered
9
+ * (gateVerdictFromRun, by the rule the durable per-commit record uses) is the
10
+ * delivery's own-gate verdict for the commit. Persisting it beside the sha is what
11
+ * lets the resume (spawn/prompt-assembly.ts) show it without reading any record.
12
+ * A stamp that carries none -- the run rendered no verdict (a timeout, an
13
+ * unavailable checkout, an instrument fault), or a legacy stamp -- is resolved
14
+ * there under the delivery's own gate, never by a gate-less record read.
15
+ *
16
+ * The deterministic-failure, shortfall and evidence-unavailable re-work writers
17
+ * share it (verify/verification-feedback.ts,
18
+ * verify/verification-evidence-unavailable-feedback.ts); extracted so
19
+ * verification-feedback.ts stays under the daemon 800-line cap.
20
+ *
21
+ * @module verify/rework-judgment
22
+ */
23
+ import { stampJudgedCommit } from '../queries/delivery-gate-state.js';
24
+ import { gateVerdictFromRun, readJudgedVerdictFor, } from './gate-verdict-source.js';
25
+ /**
26
+ * The verdict a finished run rendered for its commit, or null when it rendered
27
+ * none. `instrumentFault` is true when attribution routed the run to
28
+ * instrument-fault re-work, which records no verdict for the commit
29
+ * (commit-verdict-record.buildCommitVerdict), so none is shown for it either. Pure.
30
+ */
31
+ export function runVerdictOf(run, instrumentFault) {
32
+ return instrumentFault ? null : gateVerdictFromRun(run);
33
+ }
34
+ /**
35
+ * `gateState` with its judged commit replaced by the run's, and the run's own
36
+ * verdict persisted beside it when it is a verdict for that commit
37
+ * (stampJudgedCommit). Never a record read. Pure.
38
+ */
39
+ export function stampReworkJudgment(gateState, judgment, judgedAt) {
40
+ return stampJudgedCommit(gateState, judgment.judgedSha ?? null, judgedAt, judgment.runVerdict ?? null);
41
+ }
42
+ /**
43
+ * The verdict a re-work DETAIL carries (the live inject, and the listing a
44
+ * respawned team reads): the run's own verdict whenever the writer was handed the
45
+ * run -- null included, since a run that rendered none has none to show -- else
46
+ * the recorded verdict for exactly the judged commit through the writer's reader.
47
+ * No judged sha asks nothing.
48
+ */
49
+ export function reworkDetailVerdict(d, v, judgment) {
50
+ if (judgment.runVerdict !== undefined)
51
+ return judgment.runVerdict;
52
+ return readJudgedVerdictFor(d, v, judgment.judgedSha ?? null);
53
+ }
54
+ //# sourceMappingURL=rework-judgment.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rework-judgment.js","sourceRoot":"","sources":["../../src/verify/rework-judgment.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,gEAAgE;AAChE,gBAAgB;AAEhB;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,iBAAiB,EAAmD,MAAM,mCAAmC,CAAC;AACvH,OAAO,EACL,kBAAkB,EAClB,oBAAoB,GAGrB,MAAM,0BAA0B,CAAC;AAalC;;;;;GAKG;AACH,MAAM,UAAU,YAAY,CAAC,GAAyB,EAAE,eAAwB;IAC9E,OAAO,eAAe,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,kBAAkB,CAAC,GAAG,CAAC,CAAC;AAC1D,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,mBAAmB,CAAC,SAA4B,EAAE,QAA2B,EAAE,QAAgB;IAC7G,OAAO,iBAAiB,CAAC,SAAS,EAAE,QAAQ,CAAC,SAAS,IAAI,IAAI,EAAE,QAAQ,EAAE,QAAQ,CAAC,UAAU,IAAI,IAAI,CAAC,CAAC;AACzG,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,mBAAmB,CACjC,CAAiF,EACjF,CAAyD,EACzD,QAA2B;IAE3B,IAAI,QAAQ,CAAC,UAAU,KAAK,SAAS;QAAE,OAAO,QAAQ,CAAC,UAAU,CAAC;IAClE,OAAO,oBAAoB,CAAC,CAAC,EAAE,CAAC,EAAE,QAAQ,CAAC,SAAS,IAAI,IAAI,CAAC,CAAC;AAChE,CAAC"}
@@ -0,0 +1,105 @@
1
+ /**
2
+ * Attribution of a FAILED deterministic verify run: which red is the delivery's
3
+ * own, and which was already on the focus base.
4
+ *
5
+ * Extracted from verification-engine.ts (runVerificationForDelivery calls
6
+ * attributeDeterministicFailure for every failed deterministic run and routes the
7
+ * instrument-fault hold it returns). Shapes, in order:
8
+ *
9
+ * 1. TIMED OUT -- never attributed. A killed run's output parses to nothing
10
+ * meaningful, so it routes to bounded instrument-fault re-work: a timeout is
11
+ * never a verdict about the work.
12
+ * 2. BASE UNAVAILABLE -- the focus base resolved but could not be measured this
13
+ * tick (verify/verification-baseline-run.ts: an unprovisioned worktree, no
14
+ * checkout, dependencies moved). No verdict: pending, retried.
15
+ * 2a. BASE INCOMPARABLE -- the focus changed its dependency install inputs since
16
+ * the base (lockfiles, manifest install fields, install lifecycle scripts), so
17
+ * the base could only be measured under installs made from the focus's
18
+ * inputs, where a red those installs cause would pass as the
19
+ * base's. A retry would refuse the same way, so this IS a verdict: nothing is
20
+ * demoted and every red is charged (naming the HEAD red stage when located).
21
+ * 3. STAGE-AWARE -- the HEAD log vouches for its gate stages
22
+ * (verify/verification-gate-stages.ts). The red stage is judged against the
23
+ * focus base's reds (judgeFailedStage): pre-existing only when the base failed
24
+ * that very stage AND reports everything this run reports there -- the same
25
+ * failing tests, or for a non-test red every diagnostic signature
26
+ * (verify/verification-diagnostics.ts). A red the base shares is RECORDED
27
+ * (preExistingStages), but the stages after it never ran at HEAD, and a stage
28
+ * that did not run is never counted as passing: they are run as a
29
+ * CONTINUATION at the same judged commit and judged in turn before any pass.
30
+ * A red the base does not share fails the delivery naming the stage
31
+ * (failedStage) and what is new in it. A continuation that times out, cannot
32
+ * run, or runs at a different commit yields no pass.
33
+ * 4. FAILING-TEST IDS ONLY -- the gate's shape is unknown (no stage outcomes),
34
+ * so attribution behaves exactly as before stages existed: all-pre-existing
35
+ * ids demote to a pass, zero parsed ids are blind.
36
+ *
37
+ * Why a continuation rather than running every stage on its own: it costs nothing
38
+ * unless a pre-existing red actually occurred (a green run or a red of the
39
+ * delivery's own stays one gate run), it goes through the unchanged fixed-commit
40
+ * checkout path, and the base is still measured at most once per (base sha,
41
+ * gate) -- the base measurement continues past each of ITS reds the same way, so
42
+ * a second, third... inherited red has a base outcome to be judged against. A
43
+ * stage the base never ran stays "did not run" there: its red at HEAD is charged,
44
+ * erring toward re-work, never toward a pass.
45
+ *
46
+ * @module verify/verification-attribution
47
+ */
48
+ import type { PendingVerification } from '../queries/verification.js';
49
+ import type { EvidenceUnavailableDetail } from '../queries/delivery-gate-state.js';
50
+ import { type StrategyResult } from './verification-deterministic.js';
51
+ import type { StageContinuationRunner, VerificationDeps } from './verification-deps.js';
52
+ import type { BaseStageRecord } from './verification-baseline-run.js';
53
+ import { type FixedCommitVerifyDeps, type VerifyCheckout } from './verification-checkout.js';
54
+ /** An instrument-fault hold, minus the `heldAt` stamp the requeue path adds. */
55
+ export type InstrumentFaultHold = Omit<EvidenceUnavailableDetail, 'heldAt'>;
56
+ /**
57
+ * Attribute a FAILED deterministic run in place (outcome, rationale and the
58
+ * attribution fields of `result`) and return the instrument-fault hold it must
59
+ * route to, if any. An attribution that could not run leaves the run failed.
60
+ */
61
+ export declare function attributeDeterministicFailure(v: PendingVerification, result: StrategyResult, deps: VerificationDeps): Promise<InstrumentFaultHold | null>;
62
+ /** What a run reports for one red stage: its failing-test ids and its diagnostic signatures. */
63
+ export interface StageEvidence {
64
+ failing: ReadonlySet<string>;
65
+ diagnostics: readonly string[];
66
+ }
67
+ /** The verdict on one red stage. */
68
+ export type StageJudgment = {
69
+ kind: 'pre_existing';
70
+ preExisting: string[];
71
+ } | {
72
+ kind: 'charged';
73
+ newFailures: string[];
74
+ preExisting: string[];
75
+ newDiagnostics: string[];
76
+ baseStatus: string;
77
+ };
78
+ /**
79
+ * Judge one red stage against the focus base. PRE-EXISTING only when the base
80
+ * failed that very stage AND reports everything this run reports there: with
81
+ * failing tests, every id this run parsed the base's red parsed too; without,
82
+ * the base's red parsed none either and covers every diagnostic signature this
83
+ * run's stage output carries, counted as a multiset. A red whose output yields no
84
+ * signature at all is charged (module doc of verify/verification-diagnostics.ts).
85
+ * A base with no stage outcomes matches nothing. Anything else is charged, saying
86
+ * why. Pure.
87
+ */
88
+ export declare function judgeFailedStage(stage: string, head: StageEvidence, base: BaseStageRecord | null, baseFailing: ReadonlySet<string>): StageJudgment;
89
+ /** Seams of the default continuation runner (tests drive it without a real checkout). */
90
+ export interface StageContinuationSeams {
91
+ runAtFixedCommit?: (deps: FixedCommitVerifyDeps, v: PendingVerification) => Promise<StrategyResult>;
92
+ createPinnedCheckout?: (focusWorktreePath: string, checkoutKey: string, sha: string) => VerifyCheckout | null;
93
+ }
94
+ /**
95
+ * The real continuation: the never-run segments, chained as the gate chained them,
96
+ * run through the same fixed-commit strategy as the HEAD run -- a detached checkout
97
+ * pinned to the HEAD run's verifiedSha (createPinnedVerifyCheckout), under the
98
+ * focus worktree's verify hold, with the timeout the HEAD run applied. The command
99
+ * is the gate's own steps, so it is never re-resolved from a manifest (the row
100
+ * carries no default-on source). The judge loop still requires the continuation's
101
+ * verifiedSha to equal the judged sha, so a checkout that stopped honouring the
102
+ * pin yields no verdict, never a verdict about another commit.
103
+ */
104
+ export declare function buildDefaultStageContinuation(deps: VerificationDeps, seams?: StageContinuationSeams): StageContinuationRunner;
105
+ //# sourceMappingURL=verification-attribution.d.ts.map
@@ -0,0 +1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;CAAE,CAAC;AAIpH;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,aAAa,EACnB,IAAI,EAAE,eAAe,GAAG,IAAI,EAC5B,WAAW,EAAE,WAAW,CAAC,MAAM,CAAC,GAC/B,aAAa,CAQf;AAuND,yFAAyF;AACzF,MAAM,WAAW,sBAAsB;IACrC,gBAAgB,CAAC,EAAE,CAAC,IAAI,EAAE,qBAAqB,EAAE,CAAC,EAAE,mBAAmB,KAAK,OAAO,CAAC,cAAc,CAAC,CAAC;IACpG,oBAAoB,CAAC,EAAE,CAAC,iBAAiB,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,KAAK,cAAc,GAAG,IAAI,CAAC;CAC/G;AAED;;;;;;;;;GASG;AACH,wBAAgB,6BAA6B,CAAC,IAAI,EAAE,gBAAgB,EAAE,KAAK,GAAE,sBAA2B,GAAG,uBAAuB,CAqBjI"}
@@ -0,0 +1,322 @@
1
+ // PINNED-BY-BEGIN (generated by gen:pinned-by -- do not hand-edit; checked by lint:pinned-by)
2
+ // Pinned by: packages/daemon/src/verify/verification-attribution.test.ts
3
+ // PINNED-BY-END
4
+ import { DEFAULT_VERIFICATION_TIMEOUT_MS } from './verification-deterministic.js';
5
+ import { applyAttribution, classifyFailures, readHeadOutputDefault, } from './verification-baseline.js';
6
+ import { parseFailingTests } from './verification-failure-parser.js';
7
+ import { MAX_STAGE_ROUNDS, continuationCommand, hasStageToContinue, parseContinuationStages, } from './verification-gate-stages.js';
8
+ import { describeDiagnostics, diagnosticSignatures, logCwdRoots, uncoveredDiagnostics } from './verification-diagnostics.js';
9
+ import { buildTimeoutFaultHold } from './verification-timeout-fault.js';
10
+ import { createPinnedVerifyCheckout, runDeterministicAtFixedCommit, } from './verification-checkout.js';
11
+ import { createLogger } from '../shell/log.js';
12
+ const log = createLogger({ module: 'verification' });
13
+ /**
14
+ * Attribute a FAILED deterministic run in place (outcome, rationale and the
15
+ * attribution fields of `result`) and return the instrument-fault hold it must
16
+ * route to, if any. An attribution that could not run leaves the run failed.
17
+ */
18
+ export async function attributeDeterministicFailure(v, result, deps) {
19
+ if (result.timedOut) {
20
+ log.warn(`[verification] deterministic run timed out for delivery ${v.deliveryId} -- ` +
21
+ `routing to bounded instrument-fault re-work (not a pass)`);
22
+ return buildTimeoutFaultHold(result);
23
+ }
24
+ if (!deps.attributeFailures)
25
+ return null;
26
+ try {
27
+ const classification = await deps.attributeFailures(v, result);
28
+ if (!classification)
29
+ return null; // no baseline resolvable: every HEAD red gates
30
+ if (classification.baseUnavailable !== undefined)
31
+ return deferForUnavailableBase(v, result, classification.baseUnavailable);
32
+ if (classification.baseIncomparable !== undefined)
33
+ return chargeIncomparableBase(v, result, classification, classification.baseIncomparable);
34
+ const staged = classification.stages;
35
+ if (staged?.head && staged.head.failedStage !== null) {
36
+ return await judgeStagedFailure(v, result, classification, { ...staged, head: staged.head }, deps);
37
+ }
38
+ return applyIdAttribution(v, result, classification);
39
+ }
40
+ catch (err) {
41
+ log.warn(`[verification] baseline attribution failed for delivery ${v.deliveryId}:`, err.message);
42
+ return null;
43
+ }
44
+ }
45
+ /** Failing-test-id attribution (the gate's stages unknown): the behaviour before stages existed. */
46
+ function applyIdAttribution(v, result, classification) {
47
+ const attributed = applyAttribution(v.deliveryId, classification);
48
+ result.newFailures = attributed.newFailures;
49
+ result.preExisting = attributed.preExisting;
50
+ result.rationale = attributed.rationale;
51
+ if (attributed.outcome === 'blind') {
52
+ // Exited non-zero but zero parseable failing ids: the gate cannot attribute
53
+ // the failure. Keep the run FAILED (never a differential pass) and route it
54
+ // to the bounded instrument-fault re-work path.
55
+ result.outcome = 'failed';
56
+ log.warn(`[verification] ${attributed.rationale} (delivery ${v.deliveryId}) -- routing to bounded instrument-fault re-work`);
57
+ return blindHold(result.exitCode);
58
+ }
59
+ result.outcome = attributed.outcome;
60
+ if (attributed.log)
61
+ log.info(attributed.log);
62
+ return null;
63
+ }
64
+ function blindHold(exitCode) {
65
+ return {
66
+ missing: ['attributable failing-test ids (deterministic run exited non-zero, parsed zero)'],
67
+ commitsAhead: 0,
68
+ deterministicFault: { kind: 'blind_zero_parse', exitCode: exitCode ?? null },
69
+ };
70
+ }
71
+ /** The base could not be measured this tick: no verdict either way, retried. */
72
+ function deferForUnavailableBase(v, result, reason) {
73
+ result.outcome = 'pending';
74
+ result.checkoutUnavailable = true;
75
+ result.rationale =
76
+ `the deterministic check failed at ${shortSha(result.verifiedSha)}, but the focus base could not be measured to ` +
77
+ `attribute the red (${reason}) -- base evidence unavailable, not a verdict; retried next tick`;
78
+ log.warn(`[verification] ${result.rationale} (delivery ${v.deliveryId})`);
79
+ return null;
80
+ }
81
+ /**
82
+ * The base can never be measured comparably with the installs at hand (the focus
83
+ * changed its dependency install inputs): a verdict, not a deferral -- a retry
84
+ * would refuse the same way. Nothing is demoted; every red is charged, naming the
85
+ * HEAD red stage when the log located one.
86
+ */
87
+ function chargeIncomparableBase(v, result, classification, reason) {
88
+ const stage = classification.stages?.head?.failedStage ?? null;
89
+ result.outcome = 'failed';
90
+ if (stage !== null)
91
+ result.failedStage = stage;
92
+ result.newFailures = [...classification.newFailures, ...classification.preExisting].sort();
93
+ result.preExisting = [];
94
+ result.rationale =
95
+ `deterministic check failed${stage !== null ? ` at stage "${stage}"` : ''} at ${shortSha(result.verifiedSha)}, and no red ` +
96
+ `can be attributed to the focus base: ${reason} -- every red is charged to the delivery`;
97
+ log.warn(`[verification] ${result.rationale} (delivery ${v.deliveryId})`);
98
+ return null;
99
+ }
100
+ /**
101
+ * Judge one red stage against the focus base. PRE-EXISTING only when the base
102
+ * failed that very stage AND reports everything this run reports there: with
103
+ * failing tests, every id this run parsed the base's red parsed too; without,
104
+ * the base's red parsed none either and covers every diagnostic signature this
105
+ * run's stage output carries, counted as a multiset. A red whose output yields no
106
+ * signature at all is charged (module doc of verify/verification-diagnostics.ts).
107
+ * A base with no stage outcomes matches nothing. Anything else is charged, saying
108
+ * why. Pure.
109
+ */
110
+ export function judgeFailedStage(stage, head, base, baseFailing) {
111
+ const red = base?.failed.find((candidate) => candidate.stage === stage) ?? null;
112
+ const { newFailures, preExisting } = classifyFailures(head.failing, red ? new Set(red.failingTests) : baseFailing);
113
+ const verdict = red
114
+ ? judgeSharedRed(red, head, newFailures.length)
115
+ : { kind: 'charged', newDiagnostics: [], baseStatus: describeUnsharedStage(stage, base) };
116
+ if (verdict.kind === 'pre_existing')
117
+ return { kind: 'pre_existing', preExisting };
118
+ return { kind: 'charged', newFailures, preExisting, newDiagnostics: verdict.newDiagnostics, baseStatus: verdict.baseStatus };
119
+ }
120
+ const ALSO_FAILS = 'the stage also fails on the focus base';
121
+ function judgeSharedRed(red, head, newCount) {
122
+ const charged = (baseStatus, newDiagnostics = []) => ({ kind: 'charged', newDiagnostics, baseStatus });
123
+ if (head.failing.size > 0) {
124
+ return newCount === 0 ? { kind: 'pre_existing' } : charged(`${ALSO_FAILS}, but not with these failing tests`);
125
+ }
126
+ if (red.failingTests.length > 0)
127
+ return charged(`${ALSO_FAILS}, but with failing tests this run did not report`);
128
+ if (head.diagnostics.length === 0) {
129
+ return charged(`${ALSO_FAILS}, but this run's stage output carries no diagnostic to compare with the base's, so the red cannot be shown to be the base's`);
130
+ }
131
+ const uncovered = uncoveredDiagnostics(head.diagnostics, red.diagnostics);
132
+ if (uncovered.length === 0)
133
+ return { kind: 'pre_existing' };
134
+ return charged(`${ALSO_FAILS}, but this run reports ${uncovered.length} diagnostic(s) the base does not: ${describeDiagnostics(uncovered)}`, uncovered);
135
+ }
136
+ function describeUnsharedStage(stage, base) {
137
+ if (base === null)
138
+ return 'the focus base run yielded no stage outcomes to compare against, so the red is charged';
139
+ if (base.ran.includes(stage))
140
+ return 'the stage passes on the focus base';
141
+ if (base.notRun.includes(stage)) {
142
+ const lastRed = base.failed[base.failed.length - 1]?.stage ?? 'an earlier stage';
143
+ return `the stage never ran on the focus base (it could not be measured past its red at "${lastRed}")`;
144
+ }
145
+ return 'the stage does not run on the focus base';
146
+ }
147
+ async function judgeStagedFailure(v, result, classification, staged, deps) {
148
+ const runContinuation = deps.runStageContinuation ?? buildDefaultStageContinuation(deps);
149
+ const baseFailing = new Set(staged.baseFailingTests);
150
+ const record = { stages: [], tests: new Set() };
151
+ let run = staged.head;
152
+ let evidence = {
153
+ failing: new Set([...classification.newFailures, ...classification.preExisting]),
154
+ diagnostics: staged.headDiagnostics,
155
+ };
156
+ for (let round = 0; round < MAX_STAGE_ROUNDS && run.failedStage !== null; round++) {
157
+ const stage = run.failedStage;
158
+ const judged = judgeFailedStage(stage, evidence, staged.base, baseFailing);
159
+ if (judged.kind === 'charged')
160
+ return chargeStage(result, stage, judged, record);
161
+ record.stages.push(stage);
162
+ for (const id of judged.preExisting)
163
+ record.tests.add(id);
164
+ if (!hasStageToContinue(run))
165
+ return passDifferentially(v, result, record, 'no gate stage follows them');
166
+ if (!result.verifiedSha)
167
+ return unjudgeableRemainder(v, result, record, 'the run recorded no judged commit');
168
+ const continued = await runContinuationSafely(runContinuation, v, run.continuation, result);
169
+ const step = settleContinuation(v, result, continued, run, record);
170
+ if (step.kind === 'settled')
171
+ return step.hold;
172
+ run = step.run;
173
+ evidence = step.evidence;
174
+ }
175
+ return unjudgeableRemainder(v, result, record, 'the continuation did not settle');
176
+ }
177
+ /** Read a continuation's result: a terminal verdict, or its own red stage to judge next. */
178
+ function settleContinuation(v, result, continued, from, record) {
179
+ const sameCommit = continued.verifiedSha !== undefined && continued.verifiedSha === result.verifiedSha;
180
+ if (continued.outcome === 'passed' && sameCommit) {
181
+ return settled(passDifferentially(v, result, record, `every gate stage after them ran green at ${shortSha(result.verifiedSha)}`));
182
+ }
183
+ if (continued.timedOut) {
184
+ adoptEvidence(result, continued);
185
+ result.outcome = 'failed';
186
+ result.timedOut = true;
187
+ recordPreExisting(result, record);
188
+ result.rationale = `${continued.rationale ?? 'the continuation timed out'} -- the gate stages after the pre-existing ` +
189
+ `red(s) in ${quoteStages(record.stages)} were killed before completing, so they were never judged (not a pass)`;
190
+ log.warn(`[verification] ${result.rationale} (delivery ${v.deliveryId})`);
191
+ return settled(buildTimeoutFaultHold(continued));
192
+ }
193
+ if (continued.outcome !== 'failed' || !sameCommit)
194
+ return settled(deferRemainder(v, result, record, continued));
195
+ adoptEvidence(result, continued);
196
+ const text = readHeadOutputDefault(continued);
197
+ const failing = parseFailingTests(text);
198
+ const next = parseContinuationStages(text, continued.exitCode, from.continuation, from.package);
199
+ if (next && next.failedStage !== null) {
200
+ return { kind: 'staged', run: next, evidence: { failing, diagnostics: diagnosticSignatures(next.failedStageOutput, logCwdRoots(text)) } };
201
+ }
202
+ return settled(chargeUnlocated(v, result, record, failing));
203
+ }
204
+ const settled = (hold) => ({ kind: 'settled', hold });
205
+ async function runContinuationSafely(run, v, segments, head) {
206
+ try {
207
+ return await run(v, segments, head);
208
+ }
209
+ catch (err) {
210
+ return { outcome: 'pending', rationale: `the continuation run threw: ${err.message}`, checkoutUnavailable: true };
211
+ }
212
+ }
213
+ // ---------------------------------------------------------------------------
214
+ // Terminal verdicts (each writes the result it names)
215
+ // ---------------------------------------------------------------------------
216
+ function chargeStage(result, stage, judged, record) {
217
+ result.outcome = 'failed';
218
+ result.failedStage = stage;
219
+ result.newFailures = judged.newFailures;
220
+ result.preExisting = [...new Set([...record.tests, ...judged.preExisting])].sort();
221
+ if (record.stages.length > 0)
222
+ result.preExistingStages = [...record.stages];
223
+ result.rationale =
224
+ `deterministic check failed at stage "${stage}": ${judged.baseStatus}` +
225
+ (judged.newFailures.length > 0 ? `; ${judged.newFailures.length} NEW failing test(s) vs focus base` : '') +
226
+ (record.stages.length > 0 ? `; pre-existing base red(s) recorded, non-blocking: ${quoteStages(record.stages)}` : '');
227
+ return null;
228
+ }
229
+ function passDifferentially(v, result, record, after) {
230
+ result.outcome = 'passed';
231
+ delete result.failedStage;
232
+ result.newFailures = [];
233
+ recordPreExisting(result, record);
234
+ result.rationale =
235
+ `deterministic check exited non-zero only on red(s) that fail the same way on the focus base -- ` +
236
+ `${quoteStages(record.stages)} (recorded, non-blocking); ${after} (differential pass)`;
237
+ log.info(`[verification] delivery ${v.deliveryId}: pre-existing base red(s) in ${quoteStages(record.stages)} ` +
238
+ `recorded, non-blocking; ${after} (differential pass)`);
239
+ return null;
240
+ }
241
+ /** The continuation failed at a stage its log does not identify: charged, or blind when it parsed no ids. */
242
+ function chargeUnlocated(v, result, record, failing) {
243
+ result.outcome = 'failed';
244
+ recordPreExisting(result, record);
245
+ const after = `the gate stages run after the pre-existing red(s) in ${quoteStages(record.stages)}`;
246
+ if (failing.size === 0) {
247
+ result.rationale = `${after} exited non-zero at a stage the log does not identify and parsed zero failing-test ids -- ` +
248
+ 'the gate cannot attribute the failure (instrument fault, not a differential pass)';
249
+ log.warn(`[verification] ${result.rationale} (delivery ${v.deliveryId}) -- routing to bounded instrument-fault re-work`);
250
+ return blindHold(result.exitCode);
251
+ }
252
+ // No base red is located for these tests, so none of them can be excused by it.
253
+ result.newFailures = [...failing].sort();
254
+ result.rationale = `deterministic check failed: ${after} report ${failing.size} failing test(s) at a stage the log does not identify`;
255
+ return null;
256
+ }
257
+ /** The stages after a pre-existing red could not be run at the judged commit this tick: no verdict, retried. */
258
+ function deferRemainder(v, result, record, continued) {
259
+ result.outcome = 'pending';
260
+ result.checkoutUnavailable = true;
261
+ recordPreExisting(result, record);
262
+ result.rationale =
263
+ `the red(s) in ${quoteStages(record.stages)} fail the same way on the focus base, but the gate stages after them ` +
264
+ `could not be run at ${shortSha(result.verifiedSha)} (${continued.rationale ?? continued.outcome}) -- not a pass; retried next tick`;
265
+ log.warn(`[verification] ${result.rationale} (delivery ${v.deliveryId})`);
266
+ return null;
267
+ }
268
+ /** The stages after a pre-existing red can never be run for this result: the gate is blind to them. */
269
+ function unjudgeableRemainder(v, result, record, why) {
270
+ result.outcome = 'failed';
271
+ recordPreExisting(result, record);
272
+ result.rationale =
273
+ `the red(s) in ${quoteStages(record.stages)} fail the same way on the focus base, but the gate stages after them ` +
274
+ `cannot be judged (${why}) -- the gate is blind to them, not the work passing`;
275
+ log.warn(`[verification] ${result.rationale} (delivery ${v.deliveryId}) -- routing to bounded instrument-fault re-work`);
276
+ return { missing: [`the gate stages after the pre-existing red(s) in ${quoteStages(record.stages)} (${why})`], commitsAhead: 0 };
277
+ }
278
+ function recordPreExisting(result, record) {
279
+ result.preExistingStages = [...record.stages];
280
+ result.preExisting = [...record.tests].sort();
281
+ }
282
+ /** The continuation rendered the verdict, so its log, tails and exit status are the evidence feedback points at. */
283
+ function adoptEvidence(result, continued) {
284
+ result.logPath = continued.logPath;
285
+ result.stdoutTail = continued.stdoutTail;
286
+ result.stderrTail = continued.stderrTail;
287
+ result.exitCode = continued.exitCode;
288
+ result.runnerSummary = continued.runnerSummary;
289
+ }
290
+ const quoteStages = (stages) => stages.map((stage) => `"${stage}"`).join(', ');
291
+ const shortSha = (sha) => (sha ? sha.slice(0, 8) : 'the judged commit');
292
+ /**
293
+ * The real continuation: the never-run segments, chained as the gate chained them,
294
+ * run through the same fixed-commit strategy as the HEAD run -- a detached checkout
295
+ * pinned to the HEAD run's verifiedSha (createPinnedVerifyCheckout), under the
296
+ * focus worktree's verify hold, with the timeout the HEAD run applied. The command
297
+ * is the gate's own steps, so it is never re-resolved from a manifest (the row
298
+ * carries no default-on source). The judge loop still requires the continuation's
299
+ * verifiedSha to equal the judged sha, so a checkout that stopped honouring the
300
+ * pin yields no verdict, never a verdict about another commit.
301
+ */
302
+ export function buildDefaultStageContinuation(deps, seams = {}) {
303
+ const runAtFixedCommit = seams.runAtFixedCommit ?? runDeterministicAtFixedCommit;
304
+ const createPinned = seams.createPinnedCheckout ?? createPinnedVerifyCheckout;
305
+ return async (v, segments, head) => {
306
+ const sha = head.verifiedSha;
307
+ if (!sha)
308
+ return { outcome: 'pending', rationale: 'no judged commit to continue the gate at', checkoutUnavailable: true };
309
+ const applied = head.appliedConfig;
310
+ const row = {
311
+ ...v,
312
+ verificationConfig: {
313
+ command: continuationCommand(segments),
314
+ timeoutMs: applied?.timeoutMs ?? DEFAULT_VERIFICATION_TIMEOUT_MS,
315
+ ...(applied ? { timeoutSource: applied.timeoutSource } : {}),
316
+ },
317
+ };
318
+ delete row.defaultOnSource;
319
+ return runAtFixedCommit({ ...deps, createVerifyCheckout: (worktreePath, key) => createPinned(worktreePath, `${key}-continuation`, sha) }, row);
320
+ };
321
+ }
322
+ //# sourceMappingURL=verification-attribution.js.map