@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,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 @@
1
+ {"version":3,"file":"verification-attribution.d.ts","sourceRoot":"","sources":["../../src/verify/verification-attribution.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,mCAAm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,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
@@ -0,0 +1 @@
1
+ {"version":3,"file":"verification-attribution.js","sourceRoot":"","sources":["../../src/verify/verification-attribution.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,yEAAyE;AACzE,gBAAgB;AAoDhB,OAAO,EAAE,+BAA+B,EAAuB,MAAM,iCAAiC,CAAC;AAEvG,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,qBAAqB,GAGtB,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AACrE,OAAO,EACL,gBAAgB,EAChB,mBAAmB,EACnB,kBAAkB,EAClB,uBAAuB,GAGxB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,WAAW,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAC7H,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,EACL,0BAA0B,EAC1B,6BAA6B,GAG9B,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,MAAM,GAAG,GAAG,YAAY,CAAC,EAAE,MAAM,EAAE,cAAc,EAAE,CAAC,CAAC;AAKrD;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,6BAA6B,CACjD,CAAsB,EACtB,MAAsB,EACtB,IAAsB;IAEtB,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC;QACpB,GAAG,CAAC,IAAI,CACN,2DAA2D,CAAC,CAAC,UAAU,MAAM;YAC7E,0DAA0D,CAC3D,CAAC;QACF,OAAO,qBAAqB,CAAC,MAAM,CAAC,CAAC;IACvC,CAAC;IACD,IAAI,CAAC,IAAI,CAAC,iBAAiB;QAAE,OAAO,IAAI,CAAC;IACzC,IAAI,CAAC;QACH,MAAM,cAAc,GAAG,MAAM,IAAI,CAAC,iBAAiB,CAAC,CAAC,EAAE,MAA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AE,aAAa,EAAE,OAAO,CAAC,aAAa,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;aAC7D;SACF,CAAC;QACF,OAAO,GAAG,CAAC,eAAe,CAAC;QAC3B,OAAO,gBAAgB,CACrB,EAAE,GAAG,IAAI,EAAE,oBAAoB,EAAE,CAAC,YAAY,EAAE,GAAG,EAAE,EAAE,CAAC,YAAY,CAAC,YAAY,EAAE,GAAG,GAAG,eAAe,EAAE,GAAG,CAAC,EAAE,EAChH,GAAG,CACJ,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,123 @@
1
+ import { type VerifyCheckout } from './verification-checkout.js';
2
+ import { type WorktreeProvisioningStatus } from '../worktree/worktree-package-provisioning.js';
3
+ /**
4
+ * A base run's output and how it ended. A runner that returns only the output
5
+ * string reports no exit status, so its stage outcomes are unknown: stage reds
6
+ * are then never demoted, while failing-test ids still parse.
7
+ */
8
+ export interface BaselineRunOutput {
9
+ output: string;
10
+ exitCode: number | null;
11
+ timedOut: boolean;
12
+ }
13
+ /** One red stage the base measured. */
14
+ export interface BaseStageRed {
15
+ stage: string;
16
+ /** The failing-test ids of the run that ended at this red. */
17
+ failingTests: string[];
18
+ /** The red's diagnostic signatures (a multiset, sorted). */
19
+ diagnostics: string[];
20
+ }
21
+ /** What the base did, stage by stage, across the gate run and its continuations. */
22
+ export interface BaseStageRecord {
23
+ /** Stages that ran green, in the order they finished. */
24
+ ran: string[];
25
+ /** Every red stage, in order. */
26
+ failed: BaseStageRed[];
27
+ /** Stages the base never ran: after a red the measurement could not continue past. */
28
+ notRun: string[];
29
+ }
30
+ /** What one base measurement recorded: its failing-test ids and its stage outcomes. */
31
+ export interface BaselineRecord {
32
+ failingTests: string[];
33
+ /** Null when the base gate run's log vouched for no stage outcomes (it then demotes no stage red). */
34
+ stages: BaseStageRecord | null;
35
+ }
36
+ /** No base evidence could be taken this time: never a verdict, never cached. */
37
+ export interface BaselineUnavailable {
38
+ unavailable: string;
39
+ /**
40
+ * Set when the base can never be measured comparably with the installs at hand
41
+ * (the focus changed its dependency install inputs -- module doc): retrying
42
+ * would refuse the same way, so nothing is demoted and every HEAD red is
43
+ * charged rather than deferred.
44
+ */
45
+ incomparable?: true;
46
+ }
47
+ /** A base checkout the measurement runs commands in. */
48
+ export interface BaselineCheckout {
49
+ /** Run one command (the gate, then each continuation) in the checkout. */
50
+ run: (command: string) => Promise<BaselineRunOutput | string>;
51
+ /** The checkout's absolute path, stripped from diagnostics. */
52
+ path?: string;
53
+ /** True when an install moved the linked dependency trees since the checkout was made. */
54
+ dependenciesMoved?: () => boolean;
55
+ dispose?: () => void;
56
+ }
57
+ export type BaselineOpenResult = BaselineCheckout | BaselineUnavailable;
58
+ export declare const isBaselineUnavailable: (value: object) => value is BaselineUnavailable;
59
+ /**
60
+ * Measure the base in `checkout` (module doc): the gate, then a continuation after
61
+ * each red until the chain completes or cannot be continued. A killed gate run
62
+ * vouches for no stages -- the last stage it started was cut off, not failed.
63
+ */
64
+ export declare function measureBaseline(checkout: BaselineCheckout, gateCommand: string): Promise<BaselineRecord>;
65
+ /**
66
+ * Validate a base stage record read back from a cache file: the record, null when
67
+ * the entry recorded that the base yielded none, or undefined when the value is
68
+ * not a record of this format (an old-format entry with a single `failedStage`
69
+ * and no diagnostics, or a corrupt one -- a cache miss).
70
+ */
71
+ export declare function readBaseStages(value: unknown): BaseStageRecord | null | undefined;
72
+ /** Git result slice the parity read uses (structural over runGitSync). */
73
+ type GitRun = (args: string[], cwd: string) => {
74
+ success: boolean;
75
+ output: string;
76
+ error?: string;
77
+ };
78
+ /**
79
+ * Whether the focus worktree's installs stand for the base's: yes, no (naming what
80
+ * changed, and why each input the install-input model could not follow counts as
81
+ * a change), or unknown.
82
+ */
83
+ export type DependencyParity = {
84
+ comparable: true;
85
+ } | {
86
+ comparable: false;
87
+ changed: string[];
88
+ unresolvable?: string[];
89
+ } | {
90
+ unreadable: string;
91
+ };
92
+ /** Reads a tracked file's content at a commit; throws when git cannot. */
93
+ export type CommitFileReader = (worktreePath: string, sha: string, path: string) => string;
94
+ /**
95
+ * Compare every tracked install input between `baseSha` and the focus worktree's
96
+ * working tree -- what its installs were provisioned from (module doc). A manifest
97
+ * added or removed since the base is a change; one modified on both sides is a
98
+ * change unless its install intent is equal (unparseable on either side is a
99
+ * change). Every file an install consumes is compared byte for byte, and an input
100
+ * the install-input model cannot follow is a change. Unreadable when git cannot
101
+ * list or read them.
102
+ */
103
+ export declare function readBaseDependencyParity(focusWorktreePath: string, baseSha: string, runGit?: GitRun, readAtCommit?: CommitFileReader): DependencyParity;
104
+ /** Spawn `sh -c command` in cwd and capture the FULL combined stdout+stderr and how it ended. */
105
+ export declare function runShellCapture(command: string, cwd: string, timeoutMs: number): Promise<BaselineRunOutput>;
106
+ /** Seams of the default base checkout (tests inject provisioning, dependency parity and the runner). */
107
+ export interface BaselineCheckoutSeams {
108
+ readWorktreeProvisioning?: (focusWorktreePath: string) => WorktreeProvisioningStatus;
109
+ readDependencyParity?: (focusWorktreePath: string, baseSha: string) => DependencyParity;
110
+ createCheckout?: (focusWorktreePath: string, checkoutKey: string, sha: string) => VerifyCheckout | null;
111
+ runCommand?: (command: string, cwd: string, timeoutMs: number) => Promise<BaselineRunOutput>;
112
+ acquireHold?: (worktreePath: string) => () => void;
113
+ }
114
+ /**
115
+ * The real base checkout (module doc): refused unless the focus worktree is
116
+ * provisioned and its install inputs match the base's; made off the focus
117
+ * worktree pinned to the base sha, its dependencies mirrored from the focus
118
+ * worktree; held against installs until disposed. `checkoutKey` names the
119
+ * directory (one per judged delivery, so two verifies never share it).
120
+ */
121
+ export declare function buildDefaultOpenBaseline(focusWorktreePath: string, checkoutKey: string, timeoutMs: number, seams?: BaselineCheckoutSeams): (baseSha: string) => BaselineOpenResult;
122
+ export {};
123
+ //# sourceMappingURL=verification-baseline-run.d.ts.map