@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 @@
1
+ {"version":3,"file":"verification-baseline-run.d.ts","sourceRoot":"","sources":["../../src/verify/verification-baseline-run.ts"],"names":[],"mappings":"AAmFA,OAAO,EAA8B,KAAK,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC7F,OAAO,EAA4B,KAAK,0BAA0B,EAAE,MAAM,8CAA8C,CAAC;AAWzH;;;;GAIG;AACH,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,uCAAuC;AACvC,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,8DAA8D;IAC9D,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,4DAA4D;IAC5D,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB;AAED,oFAAoF;AACpF,MAAM,WAAW,eAAe;IAC9B,yDAAyD;IACzD,GAAG,EAAE,MAAM,EAAE,CAAC;IACd,iCAAiC;IACjC,MAAM,EAAE,YAAY,EAAE,CAAC;IACvB,sFAAsF;IACtF,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB;AAED,uFAAuF;AACvF,MAAM,WAAW,cAAc;IAC7B,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,sGAAsG;IACtG,MAAM,EAAE,eAAe,GAAG,IAAI,CAAC;CAChC;AAED,gFAAgF;AAChF,MAAM,WAAW,mBAAmB;IAClC,WAAW,EAAE,MAAM,CAAC;IACpB;;;;;OAKG;IACH,YAAY,CAAC,EAAE,IAAI,CAAC;CACrB;AAED,wDAAwD;AACxD,MAAM,WAAW,gBAAgB;IAC/B,0EAA0E;IAC1E,GAAG,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,iBAAiB,GAAG,MAAM,CAAC,CAAC;IAC9D,+DAA+D;IAC/D,IAAI,CAAC,EAAE,MAAM,CAAC;I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AgB,CAqBlB;AA2BD,iGAAiG;AACjG,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAW3G;AAED,wGAAwG;AACxG,MAAM,WAAW,qBAAqB;IACpC,wBAAwB,CAAC,EAAE,CAAC,iBAAiB,EAAE,MAAM,KAAK,0BAA0B,CAAC;IACrF,oBAAoB,CAAC,EAAE,CAAC,iBAAiB,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,gBAAgB,CAAC;IACxF,cAAc,CAAC,EAAE,CAAC,iBAAiB,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,KAAK,cAAc,GAAG,IAAI,CAAC;IACxG,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAC7F,WAAW,CAAC,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,MAAM,IAAI,CAAC;CACpD;AAED;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CACtC,iBAAiB,EAAE,MAAM,EACzB,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,MAAM,EACjB,KAAK,GAAE,qBAA0B,GAChC,CAAC,OAAO,EAAE,MAAM,KAAK,kBAAkB,CA2BzC"}
@@ -0,0 +1,386 @@
1
+ // PINNED-BY-BEGIN (generated by gen:pinned-by -- do not hand-edit; checked by lint:pinned-by)
2
+ // Pinned by: packages/daemon/src/integration/focus-commit-verdict-scenario.test.ts,
3
+ // packages/daemon/src/verify/verification-attribution.test.ts,
4
+ // packages/daemon/src/verify/verification-baseline-run.test.ts
5
+ // PINNED-BY-END
6
+ /**
7
+ * Measuring the focus base: a provisioned detached checkout at the base sha, the
8
+ * gate run there, and every red stage past the first measured too.
9
+ *
10
+ * Extracted from verification-baseline.ts, which owns the cache and the
11
+ * attribution orchestration; this module owns what one base measurement IS.
12
+ *
13
+ * The checkout carries the SAME readiness contract as the HEAD run
14
+ * (verify/verification-checkout.ts). A fresh `git worktree add` has no installed
15
+ * dependencies, and a nested package (packages/daemon, mcp/telora-products)
16
+ * resolves its node_modules only from its own ignored directory -- so a bare base
17
+ * checkout could not load eslint-import-resolver-typescript or tsx, and "base
18
+ * evidence" measured the checkout, not the base commit. The base checkout is
19
+ * therefore made off the PROVISIONED focus worktree (readWorktreeProvisioning
20
+ * must say ready), pinned to the base sha, with the focus worktree's node_modules
21
+ * mirrored in exactly as the HEAD checkout mirrors them, under a verify hold on
22
+ * the focus worktree so no install starts mid-run. An unready worktree, a
23
+ * checkout or mirror that cannot be made, a run that throws, or an install that
24
+ * moved the linked packages mid-run is EVIDENCE UNAVAILABLE: never a baseline
25
+ * verdict, never cached (the caller defers, and the next tick measures again).
26
+ *
27
+ * Dependency parity. Those mirrored installs were installed from the FOCUS
28
+ * worktree's lockfiles, so they stand for the base's only while the focus has
29
+ * not changed what an install reads. Were it measured anyway, a red the focus's
30
+ * own dependency change causes (a bumped tool version, a new resolver) would
31
+ * reproduce on base source under the focus's installs and be demoted as
32
+ * pre-existing. So before any checkout is made, every tracked install input
33
+ * (package-lock.json, npm-shrinkwrap.json, package.json, .npmrc, binding.gyp --
34
+ * at any depth, none under node_modules) is compared between the base sha and the
35
+ * focus worktree ({@link readBaseDependencyParity}), as install INTENT: a lockfile
36
+ * without the package's own name and version (a version bump installs nothing
37
+ * new, and this repo bumps a package version with most changes), a package.json's
38
+ * install-shaping fields and the lifecycle scripts an install RUNS (a
39
+ * `postinstall` and its kin write into the very node_modules the base borrows, so
40
+ * a red their side effects cause reproduces on base source too -- every other
41
+ * script is source, which the checkout pins to the base), an .npmrc or
42
+ * binding.gyp byte for byte. A lifecycle command's STRING is not the whole input,
43
+ * though: an unchanged `postinstall: node scripts/patch.cjs` whose script changed
44
+ * installs differently (TEL-9). So every file an install CONSUMES -- the scripts
45
+ * its lifecycle commands run and what they load, a native addon's sources -- is
46
+ * compared too, byte for byte, read from the install-input model the
47
+ * provisioning fingerprint reads (worktree/install-inputs.ts), on both the base
48
+ * and the focus worktree; a command the model cannot follow is a change. When
49
+ * they differ the base is INCOMPARABLE with the installs at hand. Retrying cannot change that for this base and worktree,
50
+ * so it is not deferred as missing evidence (which would re-run the gate every
51
+ * tick, forever): it is refused with `incomparable` set, never cached, demotes
52
+ * nothing, and every HEAD red is charged to the delivery
53
+ * (verify/verification-attribution.ts). A parity that cannot be READ (git fails)
54
+ * is plain evidence unavailable.
55
+ *
56
+ * Every red, not just the first. A gate run stops at its first red, so a base
57
+ * record of only that stage reads every later stage as "never ran on the base"
58
+ * -- and a head that inherits two reds would be charged for the second. The
59
+ * measurement runs the never-run stages as a CONTINUATION in the same checkout
60
+ * after each red, until the chain completes or a stage cannot be run (a
61
+ * continuation that times out or whose log vouches for nothing), recording each
62
+ * red's stage, failing-test ids and diagnostic signatures
63
+ * (verify/verification-diagnostics.ts). A stage that never ran on the base stays
64
+ * in `notRun`: never a pass, never pre-existing. All of it is one measurement per
65
+ * (base sha, gate), cached once.
66
+ *
67
+ * @module verify/verification-baseline-run
68
+ */
69
+ import { execFileSync, spawn } from 'node:child_process';
70
+ import { readFileSync } from 'node:fs';
71
+ import { basename, join } from 'node:path';
72
+ import { parseFailingTests } from './verification-failure-parser.js';
73
+ import { MAX_STAGE_ROUNDS, continuationCommand, hasStageToContinue, parseContinuationStages, parseGateRunStages, } from './verification-gate-stages.js';
74
+ import { diagnosticSignatures } from './verification-diagnostics.js';
75
+ import { createPinnedVerifyCheckout } from './verification-checkout.js';
76
+ import { readWorktreeProvisioning } from '../worktree/worktree-package-provisioning.js';
77
+ import { acquireVerifyHold } from '../worktree/verify-interlock.js';
78
+ import { INSTALL_LIFECYCLE_SCRIPTS, listInstallRoots, readInstallInputs, readWorktreeInstallTree, trackedInstallTree, } from '../worktree/install-inputs.js';
79
+ import { runGitSync } from '../git/exec.js';
80
+ export const isBaselineUnavailable = (value) => 'unavailable' in value;
81
+ const asRunOutput = (run) => (typeof run === 'string' ? { output: run, exitCode: null, timedOut: false } : run);
82
+ function redOf(stage, run, output, roots) {
83
+ return {
84
+ stage,
85
+ failingTests: [...parseFailingTests(output)].sort(),
86
+ diagnostics: diagnosticSignatures(run.failedStageOutput, roots),
87
+ };
88
+ }
89
+ /**
90
+ * Measure the base in `checkout` (module doc): the gate, then a continuation after
91
+ * each red until the chain completes or cannot be continued. A killed gate run
92
+ * vouches for no stages -- the last stage it started was cut off, not failed.
93
+ */
94
+ export async function measureBaseline(checkout, gateCommand) {
95
+ const first = asRunOutput(await checkout.run(gateCommand));
96
+ const failing = new Set(parseFailingTests(first.output));
97
+ const parsed = first.timedOut ? null : parseGateRunStages(first.output, first.exitCode, gateCommand);
98
+ if (!parsed)
99
+ return { failingTests: [...failing].sort(), stages: null };
100
+ const roots = checkout.path ? [checkout.path] : [];
101
+ const stages = { ran: [...parsed.ran], failed: [], notRun: [...parsed.notRun] };
102
+ let run = parsed;
103
+ let output = first.output;
104
+ for (let round = 1; run.failedStage !== null; round++) {
105
+ stages.failed.push(redOf(run.failedStage, run, output, roots));
106
+ if (!hasStageToContinue(run) || round >= MAX_STAGE_ROUNDS)
107
+ break;
108
+ const next = asRunOutput(await checkout.run(continuationCommand(run.continuation)));
109
+ for (const id of parseFailingTests(next.output))
110
+ failing.add(id);
111
+ const continued = next.timedOut
112
+ ? null
113
+ : parseContinuationStages(next.output, next.exitCode, run.continuation, run.package);
114
+ if (!continued)
115
+ break; // the stages after this red stay "did not run"
116
+ stages.ran.push(...continued.ran);
117
+ stages.notRun = [...continued.notRun];
118
+ output = next.output;
119
+ run = continued;
120
+ }
121
+ return { failingTests: [...failing].sort(), stages };
122
+ }
123
+ const isStringArray = (value) => Array.isArray(value) && value.every((item) => typeof item === 'string');
124
+ function readRed(value) {
125
+ if (value === null || typeof value !== 'object')
126
+ return undefined;
127
+ const { stage, failingTests, diagnostics } = value;
128
+ if (typeof stage !== 'string' || !isStringArray(failingTests) || !isStringArray(diagnostics))
129
+ return undefined;
130
+ return { stage, failingTests: [...failingTests], diagnostics: [...diagnostics] };
131
+ }
132
+ /**
133
+ * Validate a base stage record read back from a cache file: the record, null when
134
+ * the entry recorded that the base yielded none, or undefined when the value is
135
+ * not a record of this format (an old-format entry with a single `failedStage`
136
+ * and no diagnostics, or a corrupt one -- a cache miss).
137
+ */
138
+ export function readBaseStages(value) {
139
+ if (value === null)
140
+ return null;
141
+ if (typeof value !== 'object')
142
+ return undefined;
143
+ const { ran, failed, notRun } = value;
144
+ if (!isStringArray(ran) || !isStringArray(notRun) || !Array.isArray(failed))
145
+ return undefined;
146
+ const reds = failed.map(readRed);
147
+ if (reds.some((red) => red === undefined))
148
+ return undefined;
149
+ return { ran: [...ran], failed: reds, notRun: [...notRun] };
150
+ }
151
+ /** The tracked files an install reads, at any depth, none under a node_modules segment. */
152
+ const INSTALL_INPUT_PATHSPECS = [
153
+ ':(glob)**/package-lock.json',
154
+ ':(glob)**/npm-shrinkwrap.json',
155
+ ':(glob)**/package.json',
156
+ ':(glob)**/.npmrc',
157
+ ':(glob)**/binding.gyp',
158
+ ':(exclude,glob)**/node_modules/**',
159
+ ];
160
+ /** The install inputs compared byte for byte (the rest are JSON, compared as intent). */
161
+ const BYTE_FOR_BYTE_INPUTS = new Set(['.npmrc', 'binding.gyp']);
162
+ /**
163
+ * The package.json fields that decide what an install puts in node_modules: the
164
+ * dependency fields; `bin` (and `directories.bin`, which npm reads as `bin`),
165
+ * because a workspace's or linked package's bins are linked into node_modules/.bin;
166
+ * `gypfile`, which switches the implicit `node-gyp rebuild` install npm gives a
167
+ * package with a binding.gyp; and `packageManager`, which picks the installer a
168
+ * corepack shim runs (another npm can lay out another tree from the same
169
+ * lockfile). Left out: fields that decide only WHETHER an install proceeds, never
170
+ * what it installs -- `engines`/`devEngines` (a mismatch warns, or fails under
171
+ * engine-strict, itself an .npmrc input) and `os`/`cpu`/`libc` (a mismatch fails
172
+ * a non-optional package). A change to one leaves either an unprovisioned
173
+ * worktree, which is never measured, or the same tree.
174
+ */
175
+ const MANIFEST_INSTALL_FIELDS = [
176
+ 'dependencies', 'devDependencies', 'optionalDependencies', 'peerDependencies', 'peerDependenciesMeta',
177
+ 'bundleDependencies', 'bundledDependencies', 'overrides', 'workspaces', 'bin', 'gypfile', 'packageManager',
178
+ ];
179
+ /** `git show <sha>:<path>`, with room for a whole lockfile (runGitSync's buffer is not sized for one). */
180
+ const readCommitFile = (worktreePath, sha, path) => execFileSync('git', ['show', `${sha}:${path}`], {
181
+ cwd: worktreePath,
182
+ encoding: 'utf8',
183
+ maxBuffer: 256 * 1024 * 1024,
184
+ timeout: 60_000,
185
+ stdio: ['ignore', 'pipe', 'pipe'],
186
+ });
187
+ const isPlainObject = (value) => value !== null && typeof value === 'object' && !Array.isArray(value);
188
+ /** An object without the package's own identity (name, version); anything else unchanged. */
189
+ function withoutIdentity(value) {
190
+ if (!isPlainObject(value))
191
+ return value;
192
+ const copy = { ...value };
193
+ delete copy.name;
194
+ delete copy.version;
195
+ return copy;
196
+ }
197
+ /**
198
+ * What a package.json asks an install for: its install fields and install
199
+ * lifecycle scripts, or null when `scripts` or `directories` is not an object
200
+ * (not a manifest the projection can read, so a change).
201
+ */
202
+ function manifestIntent(manifest) {
203
+ const { scripts = {}, directories = {} } = manifest;
204
+ if (!isPlainObject(scripts) || !isPlainObject(directories))
205
+ return null;
206
+ return JSON.stringify([
207
+ ...MANIFEST_INSTALL_FIELDS.map((field) => [field, manifest[field] ?? null]),
208
+ ['directories.bin', directories.bin ?? null],
209
+ ...INSTALL_LIFECYCLE_SCRIPTS.map((script) => [`scripts.${script}`, scripts[script] ?? null]),
210
+ ]);
211
+ }
212
+ /** What one install input asks an install for (module doc), or null when it cannot be read as one. */
213
+ function installIntent(path, text) {
214
+ if (BYTE_FOR_BYTE_INPUTS.has(basename(path)))
215
+ return text;
216
+ let parsed;
217
+ try {
218
+ parsed = JSON.parse(text);
219
+ }
220
+ catch {
221
+ return null;
222
+ }
223
+ if (!isPlainObject(parsed))
224
+ return null;
225
+ if (basename(path) === 'package.json')
226
+ return manifestIntent(parsed);
227
+ const lock = withoutIdentity(parsed);
228
+ if (isPlainObject(lock) && isPlainObject(lock.packages))
229
+ lock.packages = { ...lock.packages, '': withoutIdentity(lock.packages['']) };
230
+ return JSON.stringify(lock);
231
+ }
232
+ /**
233
+ * The consumed install inputs (worktree/install-inputs.ts) that differ between
234
+ * `baseSha` and the focus worktree: for every install root on either side, each
235
+ * file either side's install consumes that git reports changed, and the manifest
236
+ * of every input either side cannot follow (fail closed: a change, with its
237
+ * reason -- that root's consumed files are then not listed one by one).
238
+ * Unreadable when git cannot list a tree or read an input.
239
+ */
240
+ function readConsumedInputChanges(focusWorktreePath, baseSha, runGit, readAtCommit) {
241
+ const base8 = baseSha.slice(0, 8);
242
+ const listed = runGit(['ls-tree', '-r', '-z', '--name-only', baseSha], focusWorktreePath);
243
+ const moved = runGit(['diff', '-z', '--name-only', '--no-renames', baseSha], focusWorktreePath);
244
+ const head = readWorktreeInstallTree(focusWorktreePath, runGit);
245
+ if (!listed.success || !moved.success || head === null) {
246
+ return { unreadable: `git could not list the tracked files of the focus worktree and its base ${base8}: ${listed.error || moved.error || 'ls-files failed'}` };
247
+ }
248
+ const base = trackedInstallTree(listed.output.split('\0'), (path) => Buffer.from(readAtCommit(focusWorktreePath, baseSha, path), 'utf8'));
249
+ const movedPaths = new Set(moved.output.split('\0'));
250
+ const changed = new Set();
251
+ const unresolvable = new Set();
252
+ for (const root of new Set([...listInstallRoots(base), ...listInstallRoots(head)])) {
253
+ let sides;
254
+ try {
255
+ sides = [readInstallInputs(base, root), readInstallInputs(head, root)];
256
+ }
257
+ catch (err) {
258
+ return { unreadable: `the install inputs of ${root || 'the repo root'} could not be read at both ${base8} and the focus worktree: ${err.message}` };
259
+ }
260
+ const unfollowed = sides.flatMap((inputs) => inputs.unresolvable);
261
+ for (const input of unfollowed) {
262
+ changed.add(input.manifest);
263
+ unresolvable.add(input.reason);
264
+ }
265
+ if (unfollowed.length > 0)
266
+ continue;
267
+ for (const path of sides.flatMap((inputs) => inputs.consumed))
268
+ if (movedPaths.has(path))
269
+ changed.add(path);
270
+ }
271
+ return { changed: [...changed], unresolvable: [...unresolvable].sort() };
272
+ }
273
+ /**
274
+ * Compare every tracked install input between `baseSha` and the focus worktree's
275
+ * working tree -- what its installs were provisioned from (module doc). A manifest
276
+ * added or removed since the base is a change; one modified on both sides is a
277
+ * change unless its install intent is equal (unparseable on either side is a
278
+ * change). Every file an install consumes is compared byte for byte, and an input
279
+ * the install-input model cannot follow is a change. Unreadable when git cannot
280
+ * list or read them.
281
+ */
282
+ export function readBaseDependencyParity(focusWorktreePath, baseSha, runGit = runGitSync, readAtCommit = readCommitFile) {
283
+ const diff = runGit(['diff', '-z', '--name-status', '--no-renames', baseSha, '--', ...INSTALL_INPUT_PATHSPECS], focusWorktreePath);
284
+ if (!diff.success)
285
+ return { unreadable: `git diff of the install inputs against ${baseSha.slice(0, 8)} failed: ${diff.error || diff.output}` };
286
+ const tokens = diff.output.split('\0').filter((token) => token.length > 0);
287
+ const changed = new Set();
288
+ for (let index = 0; index + 1 < tokens.length; index += 2) {
289
+ const [status, path] = [tokens[index], tokens[index + 1]];
290
+ try {
291
+ const base = status === 'M' ? installIntent(path, readAtCommit(focusWorktreePath, baseSha, path)) : null;
292
+ const focus = status === 'M' ? installIntent(path, readFileSync(join(focusWorktreePath, path), 'utf8')) : null;
293
+ if (base === null || focus === null || base !== focus)
294
+ changed.add(path);
295
+ }
296
+ catch (err) {
297
+ return { unreadable: `${path} could not be read at both ${baseSha.slice(0, 8)} and the focus worktree: ${err.message}` };
298
+ }
299
+ }
300
+ const consumed = readConsumedInputChanges(focusWorktreePath, baseSha, runGit, readAtCommit);
301
+ if ('unreadable' in consumed)
302
+ return consumed;
303
+ for (const path of consumed.changed)
304
+ changed.add(path);
305
+ if (changed.size === 0)
306
+ return { comparable: true };
307
+ const unresolvable = consumed.unresolvable.length > 0 ? { unresolvable: consumed.unresolvable } : {};
308
+ return { comparable: false, changed: [...changed].sort(), ...unresolvable };
309
+ }
310
+ /** The refusal a base checkout returns when the installs at hand do not stand for the base's, else null. */
311
+ function dependencyParityRefusal(parity, baseSha) {
312
+ const base = baseSha.slice(0, 8);
313
+ if ('unreadable' in parity) {
314
+ return {
315
+ unavailable: `the dependency install inputs of the focus base ${base} could not be compared with the focus worktree's `
316
+ + `(${parity.unreadable}), so whether its installs stand for the base's is unknown`,
317
+ };
318
+ }
319
+ if (parity.comparable)
320
+ return null;
321
+ const unfollowed = parity.unresolvable?.length
322
+ ? `; an install input that cannot be followed counts as changed: ${parity.unresolvable.join('; ')}`
323
+ : '';
324
+ return {
325
+ unavailable: `the focus changed dependency install inputs since the base ${base} (${parity.changed.join(', ')})${unfollowed}, so a base `
326
+ + 'checkout would borrow installs made from the focus\'s install inputs, not the base\'s, and a red those installs cause '
327
+ + 'could not be told apart from one already on the base',
328
+ incomparable: true,
329
+ };
330
+ }
331
+ // ---------------------------------------------------------------------------
332
+ // The default base checkout
333
+ // ---------------------------------------------------------------------------
334
+ /** Spawn `sh -c command` in cwd and capture the FULL combined stdout+stderr and how it ended. */
335
+ export function runShellCapture(command, cwd, timeoutMs) {
336
+ return new Promise((resolvePromise) => {
337
+ const child = spawn('sh', ['-c', command], { cwd, stdio: ['ignore', 'pipe', 'pipe'] });
338
+ let out = '';
339
+ let timedOut = false;
340
+ child.stdout?.on('data', (c) => { out += c.toString('utf8'); });
341
+ child.stderr?.on('data', (c) => { out += c.toString('utf8'); });
342
+ const timer = setTimeout(() => { timedOut = true; try {
343
+ child.kill('SIGKILL');
344
+ }
345
+ catch { /* ignore */ } }, timeoutMs);
346
+ child.on('error', () => { clearTimeout(timer); resolvePromise({ output: out, exitCode: null, timedOut }); });
347
+ child.on('close', (code) => { clearTimeout(timer); resolvePromise({ output: out, exitCode: code, timedOut }); });
348
+ });
349
+ }
350
+ /**
351
+ * The real base checkout (module doc): refused unless the focus worktree is
352
+ * provisioned and its install inputs match the base's; made off the focus
353
+ * worktree pinned to the base sha, its dependencies mirrored from the focus
354
+ * worktree; held against installs until disposed. `checkoutKey` names the
355
+ * directory (one per judged delivery, so two verifies never share it).
356
+ */
357
+ export function buildDefaultOpenBaseline(focusWorktreePath, checkoutKey, timeoutMs, seams = {}) {
358
+ return (baseSha) => {
359
+ const provisioning = (seams.readWorktreeProvisioning ?? readWorktreeProvisioning)(focusWorktreePath);
360
+ if (!provisioning.ready) {
361
+ return {
362
+ unavailable: `the focus worktree is not provisioned (${provisioning.state}: ${provisioning.reason}), so a base `
363
+ + 'checkout would measure missing dependencies, not the base commit',
364
+ };
365
+ }
366
+ const parity = (seams.readDependencyParity ?? readBaseDependencyParity)(focusWorktreePath, baseSha);
367
+ const refused = dependencyParityRefusal(parity, baseSha);
368
+ if (refused)
369
+ return refused;
370
+ const release = (seams.acquireHold ?? acquireVerifyHold)(focusWorktreePath);
371
+ const checkout = (seams.createCheckout ?? createPinnedVerifyCheckout)(focusWorktreePath, checkoutKey, baseSha);
372
+ if (!checkout || checkout.sha !== baseSha) {
373
+ checkout?.dispose();
374
+ release();
375
+ return { unavailable: `no provisioned detached checkout of the focus base ${baseSha.slice(0, 8)} could be made` };
376
+ }
377
+ const runCommand = seams.runCommand ?? runShellCapture;
378
+ return {
379
+ path: checkout.path,
380
+ run: (command) => runCommand(command, checkout.path, timeoutMs),
381
+ dependenciesMoved: checkout.dependenciesMoved,
382
+ dispose: () => { checkout.dispose(); release(); },
383
+ };
384
+ };
385
+ }
386
+ //# sourceMappingURL=verification-baseline-run.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"verification-baseline-run.js","sourceRoot":"","sources":["../../src/verify/verification-baseline-run.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,oFAAoF;AACpF,iEAAiE;AACjE,iEAAiE;AACjE,gBAAgB;AAEhB;;;;;;;;;;;;;;;;;;;;;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M,MAAM,GAAG,CAAC,KAAK,CAAC,oBAAoB,IAAI,wBAAwB,CAAC,CAAC,iBAAiB,EAAE,OAAO,CAAC,CAAC;QACpG,MAAM,OAAO,GAAG,uBAAuB,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QACzD,IAAI,OAAO;YAAE,OAAO,OAAO,CAAC;QAC5B,MAAM,OAAO,GAAG,CAAC,KAAK,CAAC,WAAW,IAAI,iBAAiB,CAAC,CAAC,iBAAiB,CAAC,CAAC;QAC5E,MAAM,QAAQ,GAAG,CAAC,KAAK,CAAC,cAAc,IAAI,0BAA0B,CAAC,CAAC,iBAAiB,EAAE,WAAW,EAAE,OAAO,CAAC,CAAC;QAC/G,IAAI,CAAC,QAAQ,IAAI,QAAQ,CAAC,GAAG,KAAK,OAAO,EAAE,CAAC;YAC1C,QAAQ,EAAE,OAAO,EAAE,CAAC;YACpB,OAAO,EAAE,CAAC;YACV,OAAO,EAAE,WAAW,EAAE,sDAAsD,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,gBAAgB,EAAE,CAAC;QACpH,CAAC;QACD,MAAM,UAAU,GAAG,KAAK,CAAC,UAAU,IAAI,eAAe,CAAC;QACvD,OAAO;YACL,IAAI,EAAE,QAAQ,CAAC,IAAI;YACnB,GAAG,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;YAC/D,iBAAiB,EAAE,QAAQ,CAAC,iBAAiB;YAC7C,OAAO,EAAE,GAAG,EAAE,GAAG,QAAQ,CAAC,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;SAClD,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC"}
@@ -1,52 +1,112 @@
1
+ import { type ParsedGateRun } from './verification-gate-stages.js';
2
+ import { type BaseStageRecord, type BaselineOpenResult, type BaselineRecord, type BaselineUnavailable } from './verification-baseline-run.js';
1
3
  import type { DaemonConfig } from '../types/index.js';
2
4
  import type { PendingVerification } from '../queries/verification.js';
5
+ export type { BaselineRecord, BaselineRunOutput, BaselineUnavailable } from './verification-baseline-run.js';
3
6
  /** Failing-test ids partitioned against the focus base. */
4
7
  export interface FailureClassification {
5
8
  /** In HEAD but not baseline -> the focus introduced these -> GATE. */
6
9
  newFailures: string[];
7
10
  /** In both HEAD and baseline -> pre-existing on the base -> recorded, non-blocking. */
8
11
  preExisting: string[];
12
+ /**
13
+ * Stage outcomes of both sides, when attribution resolved a baseline. The
14
+ * verify attribution (verify/verification-attribution.ts) judges the HEAD red
15
+ * stage against the base's; a null side is one whose log vouched for no stages,
16
+ * and a null base demotes nothing.
17
+ */
18
+ stages?: StagedAttribution;
19
+ /**
20
+ * Set when a base was resolvable but could not be MEASURED this tick (an
21
+ * unprovisioned worktree, no checkout, dependencies moved): the reason. Nothing
22
+ * is attributed against it -- the caller defers the verdict and retries.
23
+ */
24
+ baseUnavailable?: string;
25
+ /**
26
+ * Set when a base was resolvable but can never be measured comparably with the
27
+ * installs at hand -- the focus changed its dependency install inputs
28
+ * (verify/verification-baseline-run.ts): the reason. Nothing is demoted (every
29
+ * HEAD failure is in newFailures), and the caller charges every red rather than
30
+ * defer: a retry would refuse the same way.
31
+ */
32
+ baseIncomparable?: string;
33
+ }
34
+ /** Both sides of a stage-aware attribution. */
35
+ export interface StagedAttribution {
36
+ /** The HEAD run's stages (with its continuation), or null when unparseable. */
37
+ head: ParsedGateRun | null;
38
+ /** The HEAD red stage's diagnostic signatures ([] when no stage red was located). */
39
+ headDiagnostics: string[];
40
+ /** The base's stage outcomes across its gate run and continuations, or null when its log vouched for none. */
41
+ base: BaseStageRecord | null;
42
+ /** Every failing-test id the base runs parsed. */
43
+ baseFailingTests: string[];
9
44
  }
10
45
  /**
11
46
  * Partition a HEAD failing-test set against the baseline failing-test set. Pure.
12
47
  * Sorted for stable output / comparison.
13
48
  */
14
49
  export declare function classifyFailures(headFailing: ReadonlySet<string>, baselineFailing: ReadonlySet<string>): FailureClassification;
15
- /** Cache file path for a (product, base SHA). Exported for tests. */
16
- export declare function baselineCachePath(productId: string, baseSha: string): string;
17
- /** Read the cached baseline failing-test set, or null on miss / unreadable. */
18
- export declare function readBaselineCache(productId: string, baseSha: string): string[] | null;
19
- /** Write the baseline failing-test set for a (product, base SHA). Best-effort. */
20
- export declare function writeBaselineCache(productId: string, baseSha: string, failingTests: string[]): void;
21
- /** Injected seams for getBaselineFailingSet (cache + baseline runner). */
50
+ /**
51
+ * The gate a baseline ran: the command + timeout the HEAD run applied. A failing
52
+ * set measured under one gate says nothing about another -- a different command
53
+ * runs different checks, and a longer timeout can let a suite finish that a
54
+ * shorter one killed -- so it is part of the cache identity, not just the SHA.
55
+ */
56
+ export interface BaselineGate {
57
+ command: string;
58
+ timeoutMs: number;
59
+ }
60
+ /** Cache file path for a (product, base SHA, gate). Exported for tests. */
61
+ export declare function baselineCachePath(productId: string, baseSha: string, gate: BaselineGate): string;
62
+ /**
63
+ * Read the cached baseline record, or null on miss / unreadable. The file records
64
+ * the gate it was run with and is re-checked against the one asked for, so an
65
+ * entry only ever answers for its own gate. An entry of an older format (no
66
+ * `stages` key, or stages recorded as a single red with no diagnostic signatures)
67
+ * is a MISS: it cannot answer which diagnostics each red carried, nor any red
68
+ * after the first, so the base is measured once more and the entry is rewritten.
69
+ */
70
+ export declare function readBaselineCache(productId: string, baseSha: string, gate: BaselineGate): BaselineRecord | null;
71
+ /** Write the baseline record for a (product, base SHA, gate). Best-effort. */
72
+ export declare function writeBaselineCache(productId: string, baseSha: string, gate: BaselineGate, record: BaselineRecord): void;
73
+ /** Injected seams for getBaselineRecord (cache + base checkout). */
22
74
  export interface BaselineDeps {
23
- readCache: (productId: string, baseSha: string) => string[] | null;
24
- writeCache: (productId: string, baseSha: string, failingTests: string[]) => void;
25
- /** Run the verification command at the base SHA; returns the raw combined output. */
26
- runBaseline: (baseSha: string) => Promise<string>;
75
+ readCache: (productId: string, baseSha: string, gate: BaselineGate) => BaselineRecord | null;
76
+ writeCache: (productId: string, baseSha: string, gate: BaselineGate, record: BaselineRecord) => void;
77
+ /** Open a checkout at the base SHA the gate's command (and its continuations) run in. */
78
+ openBaseline: (baseSha: string) => BaselineOpenResult | Promise<BaselineOpenResult>;
27
79
  }
28
80
  /**
29
- * Resolve the baseline failing-test set for a (product, base SHA): a cache hit
30
- * short-circuits (an unchanged SHA never re-runs the suite); a miss runs the
31
- * baseline once, parses, and caches.
81
+ * Resolve the baseline record for a (product, base SHA, gate): a cache hit
82
+ * short-circuits (an unchanged SHA under an unchanged gate is never measured
83
+ * again); a miss opens ONE base checkout, measures the gate and every red past
84
+ * the first in it (verify/verification-baseline-run.ts), and caches the record.
85
+ * A base that could not be measured -- no checkout, a run that threw, an install
86
+ * that moved its dependencies mid-run, or a checkout refused because the focus
87
+ * changed its dependency install inputs (`incomparable`) -- is returned as
88
+ * unavailable and NOT cached: another HEAD at the same base sha may leave them
89
+ * unchanged. `gate` must be the one the checkout runs.
32
90
  */
33
- export declare function getBaselineFailingSet(productId: string, baseSha: string, deps: BaselineDeps): Promise<Set<string>>;
91
+ export declare function getBaselineRecord(productId: string, baseSha: string, gate: BaselineGate, deps: BaselineDeps): Promise<BaselineRecord | BaselineUnavailable>;
34
92
  /** Resolve the focus base = merge-base(integrationBranch, HEAD) in a worktree. Null on failure. */
35
93
  export declare function resolveFocusBaseSha(worktreePath: string, integrationBranch: string): string | null;
36
94
  /** Resolve the worktree HEAD sha. Null on failure. */
37
95
  export declare function resolveHeadSha(worktreePath: string): string | null;
38
- /**
39
- * Default baseline runner: create a detached worktree at the base SHA off the
40
- * product's main repo, run the command there, capture output, and remove the
41
- * worktree. Best-effort -- on any git failure returns '' (no baseline -> the
42
- * caller treats all HEAD failures as new, i.e. the pre-attribution gate).
43
- */
44
- export declare function buildDefaultRunBaseline(config: DaemonConfig, productId: string, command: string, timeoutMs: number): (baseSha: string) => Promise<string>;
45
96
  /** The slice of a StrategyResult attribution reads. */
46
97
  export interface AttributionInputResult {
47
98
  logPath?: string;
48
99
  stdoutTail?: string;
49
100
  stderrTail?: string;
101
+ /** The command + timeout the HEAD run applied (verify/verification-checkout.ts); the baseline runs the same. */
102
+ appliedConfig?: {
103
+ command: string;
104
+ timeoutMs: number;
105
+ };
106
+ /** True when no command ran (config unresolvable from the verified code): nothing to attribute. */
107
+ configUnresolved?: boolean;
108
+ /** The HEAD run's exit status; without it the HEAD log vouches for no stage outcomes. */
109
+ exitCode?: number | null;
50
110
  }
51
111
  /** Injected seams for attributeFailures. */
52
112
  export interface AttributionDeps {
@@ -55,7 +115,8 @@ export interface AttributionDeps {
55
115
  /** Resolve the HEAD sha of the focus worktree (to refuse a baseline == HEAD). */
56
116
  resolveHeadSha: (worktreePath: string) => string | null;
57
117
  integrationBranch: string;
58
- getBaselineFailingSet: (productId: string, baseSha: string) => Promise<Set<string>>;
118
+ /** The base record at `baseSha`, measured off the focus worktree at `worktreePath`. */
119
+ getBaseline: (productId: string, baseSha: string, worktreePath: string) => Promise<BaselineRecord | BaselineUnavailable>;
59
120
  /** Resolve HEAD output: read the full log file when present, else the tails. */
60
121
  readHeadOutput: (result: AttributionInputResult) => string;
61
122
  }
@@ -63,18 +124,46 @@ export interface AttributionDeps {
63
124
  * Classify a failed HEAD run against the focus base. Returns null when no
64
125
  * baseline could be resolved (no worktree / no merge-base) -- the caller then
65
126
  * treats all HEAD failures as new (fail-closed toward gating, the behavior
66
- * before attribution existed).
127
+ * before attribution existed). A base that resolved but could not be measured
128
+ * returns a classification carrying `baseUnavailable` and nothing attributed.
67
129
  */
68
130
  export declare function attributeFailures(v: PendingVerification, result: AttributionInputResult, deps: AttributionDeps): Promise<FailureClassification | null>;
69
131
  /** Default HEAD-output reader: full log file when present, else the tails. */
70
132
  export declare function readHeadOutputDefault(result: AttributionInputResult): string;
133
+ /**
134
+ * The command + timeout the baseline run applies: the HEAD run's applied config
135
+ * when the result carries one, else the verification row's. Both sides of the
136
+ * diff must run the SAME gate. A default-on HEAD run re-resolves its command +
137
+ * timeout from the verified checkout's manifest at dispatch, so sizing the
138
+ * baseline from the tick's provisional row config would kill a baseline the
139
+ * branch declared a longer timeout for -- and a killed baseline attributes
140
+ * nothing. Pure -- exported for testing.
141
+ */
142
+ export declare function resolveBaselineRunConfig(v: Pick<PendingVerification, 'verificationConfig'>, result: AttributionInputResult): BaselineGate;
143
+ /** Builds the base-checkout opener for one judgement: off `focusWorktreePath`, in directory `checkoutKey`, under `gate`. */
144
+ export type OpenBaselineBuilder = (focusWorktreePath: string, checkoutKey: string, gate: BaselineGate) => (baseSha: string) => BaselineOpenResult | Promise<BaselineOpenResult>;
145
+ /**
146
+ * The I/O the default attribution closure is wired to. Overridable so a test
147
+ * drives the REAL closure -- its config-unresolved guard and the gate it builds
148
+ * the base checkout with -- rather than the pure helpers beside it, which stay
149
+ * green if the closure stops calling them.
150
+ */
151
+ export interface DefaultAttributionSeams {
152
+ resolveWorktreePath: AttributionDeps['resolveWorktreePath'];
153
+ resolveHeadSha: AttributionDeps['resolveHeadSha'];
154
+ readCache: BaselineDeps['readCache'];
155
+ writeCache: BaselineDeps['writeCache'];
156
+ buildOpenBaseline: OpenBaselineBuilder;
157
+ readHeadOutput: AttributionDeps['readHeadOutput'];
158
+ }
71
159
  /**
72
160
  * Build the default `attributeFailures` closure: reads the focus-worktree cwd,
73
- * resolves the merge-base, runs (or reuses a cached) baseline at that SHA in a
74
- * detached worktree, and classifies HEAD failures against it. Returns null when
75
- * no baseline is resolvable (caller gates all failures).
161
+ * resolves the merge-base, measures (or reuses a cached measurement of) the base
162
+ * at that SHA in a provisioned detached checkout -- with the command + timeout the
163
+ * HEAD run applied -- and classifies HEAD failures against it. Returns null when
164
+ * no baseline is resolvable (caller gates all failures) or when no command ran.
76
165
  */
77
- export declare function buildDefaultAttributeFailures(config: DaemonConfig): (v: PendingVerification, result: AttributionInputResult) => Promise<FailureClassification | null>;
166
+ export declare function buildDefaultAttributeFailures(config: DaemonConfig, overrides?: Partial<DefaultAttributionSeams>): (v: PendingVerification, result: AttributionInputResult) => Promise<FailureClassification | null>;
78
167
  /**
79
168
  * Build the default `resolveVerificationCwd`: the focus worktree (HEAD of the
80
169
  * focus branch) so the deterministic run measures the focus's changes, falling