@telora/daemon 0.22.131 → 0.22.136

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 (549) hide show
  1. package/build-info.json +6 -3
  2. package/dist/audit/audit-hooks.d.ts +6 -2
  3. package/dist/audit/audit-hooks.d.ts.map +1 -1
  4. package/dist/audit/audit-hooks.js +12 -5
  5. package/dist/audit/audit-hooks.js.map +1 -1
  6. package/dist/audit/audit-phase.js +1 -1
  7. package/dist/audit/audit-phase.js.map +1 -1
  8. package/dist/backends/index.d.ts.map +1 -1
  9. package/dist/backends/index.js +1 -0
  10. package/dist/backends/index.js.map +1 -1
  11. package/dist/completion/completion-phase-registry.d.ts +4 -0
  12. package/dist/completion/completion-phase-registry.d.ts.map +1 -1
  13. package/dist/completion/completion-phase-registry.js +63 -18
  14. package/dist/completion/completion-phase-registry.js.map +1 -1
  15. package/dist/completion/exit-classification.d.ts.map +1 -1
  16. package/dist/completion/exit-classification.js +1 -0
  17. package/dist/completion/exit-classification.js.map +1 -1
  18. package/dist/completion/review-approved-head-gate.d.ts +53 -0
  19. package/dist/completion/review-approved-head-gate.d.ts.map +1 -0
  20. package/dist/completion/review-approved-head-gate.js +124 -0
  21. package/dist/completion/review-approved-head-gate.js.map +1 -0
  22. package/dist/completion/review-census-record.d.ts +52 -0
  23. package/dist/completion/review-census-record.d.ts.map +1 -0
  24. package/dist/completion/review-census-record.js +145 -0
  25. package/dist/completion/review-census-record.js.map +1 -0
  26. package/dist/completion/review-exit-deps.d.ts +5 -1
  27. package/dist/completion/review-exit-deps.d.ts.map +1 -1
  28. package/dist/completion/review-exit-deps.js +7 -2
  29. package/dist/completion/review-exit-deps.js.map +1 -1
  30. package/dist/completion/review-exit-phase.d.ts.map +1 -1
  31. package/dist/completion/review-exit-phase.js +29 -16
  32. package/dist/completion/review-exit-phase.js.map +1 -1
  33. package/dist/completion/review-exit-progress.d.ts +8 -0
  34. package/dist/completion/review-exit-progress.d.ts.map +1 -1
  35. package/dist/completion/review-exit-progress.js +14 -0
  36. package/dist/completion/review-exit-progress.js.map +1 -1
  37. package/dist/completion/review-exit-shortfall-park.d.ts +14 -0
  38. package/dist/completion/review-exit-shortfall-park.d.ts.map +1 -0
  39. package/dist/completion/review-exit-shortfall-park.js +52 -0
  40. package/dist/completion/review-exit-shortfall-park.js.map +1 -0
  41. package/dist/completion/review-exit-shortfall.js +1 -1
  42. package/dist/completion/review-exit-shortfall.js.map +1 -1
  43. package/dist/completion/review-exit-verdict-gate.d.ts +58 -0
  44. package/dist/completion/review-exit-verdict-gate.d.ts.map +1 -1
  45. package/dist/completion/review-exit-verdict-gate.js +68 -8
  46. package/dist/completion/review-exit-verdict-gate.js.map +1 -1
  47. package/dist/completion/review-next-step.d.ts +15 -3
  48. package/dist/completion/review-next-step.d.ts.map +1 -1
  49. package/dist/completion/review-next-step.js +7 -2
  50. package/dist/completion/review-next-step.js.map +1 -1
  51. package/dist/completion/standing-approval-convergence.d.ts +68 -0
  52. package/dist/completion/standing-approval-convergence.d.ts.map +1 -0
  53. package/dist/completion/standing-approval-convergence.js +230 -0
  54. package/dist/completion/standing-approval-convergence.js.map +1 -0
  55. package/dist/completion/standing-approval-deps.d.ts +5 -0
  56. package/dist/completion/standing-approval-deps.d.ts.map +1 -0
  57. package/dist/completion/standing-approval-deps.js +37 -0
  58. package/dist/completion/standing-approval-deps.js.map +1 -0
  59. package/dist/completion/state-cascade.d.ts +11 -0
  60. package/dist/completion/state-cascade.d.ts.map +1 -1
  61. package/dist/completion/state-cascade.js +40 -1
  62. package/dist/completion/state-cascade.js.map +1 -1
  63. package/dist/completion/team-lifecycle.d.ts +14 -2
  64. package/dist/completion/team-lifecycle.d.ts.map +1 -1
  65. package/dist/completion/team-lifecycle.js +36 -36
  66. package/dist/completion/team-lifecycle.js.map +1 -1
  67. package/dist/completion/terminated-work-reconcile.d.ts +3 -1
  68. package/dist/completion/terminated-work-reconcile.d.ts.map +1 -1
  69. package/dist/completion/terminated-work-reconcile.js +24 -11
  70. package/dist/completion/terminated-work-reconcile.js.map +1 -1
  71. package/dist/delivery/delivery-advance-block.d.ts +6 -0
  72. package/dist/delivery/delivery-advance-block.d.ts.map +1 -1
  73. package/dist/delivery/delivery-advance-block.js +29 -3
  74. package/dist/delivery/delivery-advance-block.js.map +1 -1
  75. package/dist/delivery/delivery-reconciler.d.ts.map +1 -1
  76. package/dist/delivery/delivery-reconciler.js +4 -1
  77. package/dist/delivery/delivery-reconciler.js.map +1 -1
  78. package/dist/delivery/operator-hold.d.ts.map +1 -1
  79. package/dist/delivery/operator-hold.js +3 -1
  80. package/dist/delivery/operator-hold.js.map +1 -1
  81. package/dist/directive/directive-executor.d.ts.map +1 -1
  82. package/dist/directive/directive-executor.js +6 -0
  83. package/dist/directive/directive-executor.js.map +1 -1
  84. package/dist/directive/directive-queue.d.ts +8 -0
  85. package/dist/directive/directive-queue.d.ts.map +1 -1
  86. package/dist/directive/directive-queue.js +20 -0
  87. package/dist/directive/directive-queue.js.map +1 -1
  88. package/dist/directive/phase-sync.d.ts +5 -0
  89. package/dist/directive/phase-sync.d.ts.map +1 -1
  90. package/dist/directive/phase-sync.js +11 -1
  91. package/dist/directive/phase-sync.js.map +1 -1
  92. package/dist/directive/stranded-review-reroute.d.ts +37 -0
  93. package/dist/directive/stranded-review-reroute.d.ts.map +1 -0
  94. package/dist/directive/stranded-review-reroute.js +150 -0
  95. package/dist/directive/stranded-review-reroute.js.map +1 -0
  96. package/dist/focus/focus-engine.d.ts.map +1 -1
  97. package/dist/focus/focus-engine.js +15 -3
  98. package/dist/focus/focus-engine.js.map +1 -1
  99. package/dist/focus/focus-executor.d.ts.map +1 -1
  100. package/dist/focus/focus-executor.js +9 -65
  101. package/dist/focus/focus-executor.js.map +1 -1
  102. package/dist/focus/focus-lifecycle.d.ts +12 -0
  103. package/dist/focus/focus-lifecycle.d.ts.map +1 -1
  104. package/dist/focus/focus-lifecycle.js +66 -37
  105. package/dist/focus/focus-lifecycle.js.map +1 -1
  106. package/dist/focus/focus-phase.d.ts.map +1 -1
  107. package/dist/focus/focus-phase.js +6 -0
  108. package/dist/focus/focus-phase.js.map +1 -1
  109. package/dist/focus/focus-spawn-decision.d.ts.map +1 -1
  110. package/dist/focus/focus-spawn-decision.js +1 -0
  111. package/dist/focus/focus-spawn-decision.js.map +1 -1
  112. package/dist/focus/focus-team-state.d.ts +10 -0
  113. package/dist/focus/focus-team-state.d.ts.map +1 -1
  114. package/dist/focus/focus-team-state.js +19 -1
  115. package/dist/focus/focus-team-state.js.map +1 -1
  116. package/dist/focus/listener-auto-advance.d.ts.map +1 -1
  117. package/dist/focus/listener-auto-advance.js +1 -0
  118. package/dist/focus/listener-auto-advance.js.map +1 -1
  119. package/dist/focus/listener-spawn.d.ts +10 -0
  120. package/dist/focus/listener-spawn.d.ts.map +1 -1
  121. package/dist/focus/listener-spawn.js +46 -4
  122. package/dist/focus/listener-spawn.js.map +1 -1
  123. package/dist/focus/listener-state.d.ts.map +1 -1
  124. package/dist/focus/listener-state.js +11 -1
  125. package/dist/focus/listener-state.js.map +1 -1
  126. package/dist/focus/listener.d.ts +42 -0
  127. package/dist/focus/listener.d.ts.map +1 -1
  128. package/dist/focus/listener.js +62 -33
  129. package/dist/focus/listener.js.map +1 -1
  130. package/dist/focus/pending-review-approved-head.d.ts +41 -0
  131. package/dist/focus/pending-review-approved-head.d.ts.map +1 -0
  132. package/dist/focus/pending-review-approved-head.js +198 -0
  133. package/dist/focus/pending-review-approved-head.js.map +1 -0
  134. package/dist/focus/pending-spawn-pass-deps.d.ts +5 -0
  135. package/dist/focus/pending-spawn-pass-deps.d.ts.map +1 -1
  136. package/dist/focus/pending-spawn-pass-deps.js +2 -1
  137. package/dist/focus/pending-spawn-pass-deps.js.map +1 -1
  138. package/dist/focus/pending-spawn-review-next-step.d.ts.map +1 -1
  139. package/dist/focus/pending-spawn-review-next-step.js +26 -4
  140. package/dist/focus/pending-spawn-review-next-step.js.map +1 -1
  141. package/dist/focus/review-spawn-coverage.d.ts +87 -0
  142. package/dist/focus/review-spawn-coverage.d.ts.map +1 -0
  143. package/dist/focus/review-spawn-coverage.js +104 -0
  144. package/dist/focus/review-spawn-coverage.js.map +1 -0
  145. package/dist/focus/session-health.d.ts +5 -2
  146. package/dist/focus/session-health.d.ts.map +1 -1
  147. package/dist/focus/session-health.js +2 -1
  148. package/dist/focus/session-health.js.map +1 -1
  149. package/dist/focus/session-process-reap.d.ts +50 -0
  150. package/dist/focus/session-process-reap.d.ts.map +1 -0
  151. package/dist/focus/session-process-reap.js +77 -0
  152. package/dist/focus/session-process-reap.js.map +1 -0
  153. package/dist/focus/unchanged-reviewed-head.d.ts +40 -0
  154. package/dist/focus/unchanged-reviewed-head.d.ts.map +1 -0
  155. package/dist/focus/unchanged-reviewed-head.js +84 -0
  156. package/dist/focus/unchanged-reviewed-head.js.map +1 -0
  157. package/dist/focus/verify-open-issues.d.ts +4 -19
  158. package/dist/focus/verify-open-issues.d.ts.map +1 -1
  159. package/dist/focus/verify-open-issues.js +83 -41
  160. package/dist/focus/verify-open-issues.js.map +1 -1
  161. package/dist/git/focus-integration-sync.d.ts +61 -0
  162. package/dist/git/focus-integration-sync.d.ts.map +1 -0
  163. package/dist/git/focus-integration-sync.js +73 -0
  164. package/dist/git/focus-integration-sync.js.map +1 -0
  165. package/dist/git/focus-own-delta.d.ts +38 -0
  166. package/dist/git/focus-own-delta.d.ts.map +1 -0
  167. package/dist/git/focus-own-delta.js +193 -0
  168. package/dist/git/focus-own-delta.js.map +1 -0
  169. package/dist/git/index.d.ts +2 -0
  170. package/dist/git/index.d.ts.map +1 -1
  171. package/dist/git/index.js +4 -0
  172. package/dist/git/index.js.map +1 -1
  173. package/dist/git/merge.d.ts.map +1 -1
  174. package/dist/git/merge.js +11 -1
  175. package/dist/git/merge.js.map +1 -1
  176. package/dist/git/resolution-restore.d.ts +66 -0
  177. package/dist/git/resolution-restore.d.ts.map +1 -0
  178. package/dist/git/resolution-restore.js +331 -0
  179. package/dist/git/resolution-restore.js.map +1 -0
  180. package/dist/loops/engine.d.ts.map +1 -1
  181. package/dist/loops/engine.js.map +1 -1
  182. package/dist/merge/abandoned-merge-recovery.d.ts +72 -0
  183. package/dist/merge/abandoned-merge-recovery.d.ts.map +1 -0
  184. package/dist/merge/abandoned-merge-recovery.js +117 -0
  185. package/dist/merge/abandoned-merge-recovery.js.map +1 -0
  186. package/dist/merge/focus-merge.d.ts +19 -0
  187. package/dist/merge/focus-merge.d.ts.map +1 -1
  188. package/dist/merge/focus-merge.js +136 -99
  189. package/dist/merge/focus-merge.js.map +1 -1
  190. package/dist/merge/merge-back-activity.d.ts +11 -0
  191. package/dist/merge/merge-back-activity.d.ts.map +1 -0
  192. package/dist/merge/merge-back-activity.js +57 -0
  193. package/dist/merge/merge-back-activity.js.map +1 -0
  194. package/dist/merge/merge-back-conflict.d.ts +119 -0
  195. package/dist/merge/merge-back-conflict.d.ts.map +1 -0
  196. package/dist/merge/merge-back-conflict.js +178 -0
  197. package/dist/merge/merge-back-conflict.js.map +1 -0
  198. package/dist/merge/merge-back-followup.d.ts +109 -0
  199. package/dist/merge/merge-back-followup.d.ts.map +1 -0
  200. package/dist/merge/merge-back-followup.js +316 -0
  201. package/dist/merge/merge-back-followup.js.map +1 -0
  202. package/dist/merge/merge-back-loop.d.ts +2 -0
  203. package/dist/merge/merge-back-loop.d.ts.map +1 -1
  204. package/dist/merge/merge-back-loop.js +14 -15
  205. package/dist/merge/merge-back-loop.js.map +1 -1
  206. package/dist/merge/merge-conflict-escalation.d.ts +12 -0
  207. package/dist/merge/merge-conflict-escalation.d.ts.map +1 -1
  208. package/dist/merge/merge-conflict-escalation.js +37 -2
  209. package/dist/merge/merge-conflict-escalation.js.map +1 -1
  210. package/dist/merge/merge-gate-coverage.d.ts.map +1 -1
  211. package/dist/merge/merge-gate-coverage.js +1 -0
  212. package/dist/merge/merge-gate-coverage.js.map +1 -1
  213. package/dist/prompt/prompt-listing.d.ts +5 -0
  214. package/dist/prompt/prompt-listing.d.ts.map +1 -1
  215. package/dist/prompt/prompt-listing.js +35 -0
  216. package/dist/prompt/prompt-listing.js.map +1 -1
  217. package/dist/prompt-sections/routing-decider-sections.d.ts.map +1 -1
  218. package/dist/prompt-sections/routing-decider-sections.js +2 -0
  219. package/dist/prompt-sections/routing-decider-sections.js.map +1 -1
  220. package/dist/prompt-sections/shortfall-park-section.d.ts +43 -0
  221. package/dist/prompt-sections/shortfall-park-section.d.ts.map +1 -0
  222. package/dist/prompt-sections/shortfall-park-section.js +36 -0
  223. package/dist/prompt-sections/shortfall-park-section.js.map +1 -0
  224. package/dist/queries/agent-resolvable-promotion.d.ts +16 -2
  225. package/dist/queries/agent-resolvable-promotion.d.ts.map +1 -1
  226. package/dist/queries/agent-resolvable-promotion.js +30 -3
  227. package/dist/queries/agent-resolvable-promotion.js.map +1 -1
  228. package/dist/queries/cause-key.d.ts +17 -22
  229. package/dist/queries/cause-key.d.ts.map +1 -1
  230. package/dist/queries/cause-key.js +50 -1
  231. package/dist/queries/cause-key.js.map +1 -1
  232. package/dist/queries/commit-attributions.d.ts +18 -0
  233. package/dist/queries/commit-attributions.d.ts.map +1 -0
  234. package/dist/queries/commit-attributions.js +39 -0
  235. package/dist/queries/commit-attributions.js.map +1 -0
  236. package/dist/queries/deliveries.d.ts.map +1 -1
  237. package/dist/queries/deliveries.js +3 -1
  238. package/dist/queries/deliveries.js.map +1 -1
  239. package/dist/queries/delivery-gate-state.d.ts +21 -5
  240. package/dist/queries/delivery-gate-state.d.ts.map +1 -1
  241. package/dist/queries/delivery-gate-state.js +35 -9
  242. package/dist/queries/delivery-gate-state.js.map +1 -1
  243. package/dist/queries/escalation-consumption.d.ts.map +1 -1
  244. package/dist/queries/escalation-consumption.js +2 -1
  245. package/dist/queries/escalation-consumption.js.map +1 -1
  246. package/dist/queries/escalation-field-bounds.d.ts +48 -0
  247. package/dist/queries/escalation-field-bounds.d.ts.map +1 -0
  248. package/dist/queries/escalation-field-bounds.js +83 -0
  249. package/dist/queries/escalation-field-bounds.js.map +1 -0
  250. package/dist/queries/escalation-refusal.d.ts +88 -0
  251. package/dist/queries/escalation-refusal.d.ts.map +1 -0
  252. package/dist/queries/escalation-refusal.js +217 -0
  253. package/dist/queries/escalation-refusal.js.map +1 -0
  254. package/dist/queries/escalation-suppression.d.ts +6 -0
  255. package/dist/queries/escalation-suppression.d.ts.map +1 -1
  256. package/dist/queries/escalation-suppression.js +4 -13
  257. package/dist/queries/escalation-suppression.js.map +1 -1
  258. package/dist/queries/escalations.d.ts +5 -13
  259. package/dist/queries/escalations.d.ts.map +1 -1
  260. package/dist/queries/escalations.js +25 -30
  261. package/dist/queries/escalations.js.map +1 -1
  262. package/dist/queries/filing-observation.d.ts.map +1 -1
  263. package/dist/queries/filing-observation.js +3 -1
  264. package/dist/queries/filing-observation.js.map +1 -1
  265. package/dist/queries/focus-review-approval.d.ts +2 -0
  266. package/dist/queries/focus-review-approval.d.ts.map +1 -1
  267. package/dist/queries/focus-review-approval.js +7 -2
  268. package/dist/queries/focus-review-approval.js.map +1 -1
  269. package/dist/queries/focuses.d.ts.map +1 -1
  270. package/dist/queries/focuses.js +2 -1
  271. package/dist/queries/focuses.js.map +1 -1
  272. package/dist/queries/incident-correlation.d.ts.map +1 -1
  273. package/dist/queries/incident-correlation.js +4 -1
  274. package/dist/queries/incident-correlation.js.map +1 -1
  275. package/dist/queries/misattributed-commits-record.d.ts +26 -0
  276. package/dist/queries/misattributed-commits-record.d.ts.map +1 -0
  277. package/dist/queries/misattributed-commits-record.js +5 -0
  278. package/dist/queries/misattributed-commits-record.js.map +1 -0
  279. package/dist/queries/reality-tree.d.ts.map +1 -1
  280. package/dist/queries/reality-tree.js +2 -1
  281. package/dist/queries/reality-tree.js.map +1 -1
  282. package/dist/queries/schemas.d.ts +3 -0
  283. package/dist/queries/schemas.d.ts.map +1 -1
  284. package/dist/queries/schemas.js +1 -0
  285. package/dist/queries/schemas.js.map +1 -1
  286. package/dist/queries/shared.js +1 -1
  287. package/dist/queries/shortfall-park-record.d.ts +48 -0
  288. package/dist/queries/shortfall-park-record.d.ts.map +1 -0
  289. package/dist/queries/shortfall-park-record.js +31 -0
  290. package/dist/queries/shortfall-park-record.js.map +1 -0
  291. package/dist/queries/shortfall-rulings.d.ts +71 -0
  292. package/dist/queries/shortfall-rulings.d.ts.map +1 -0
  293. package/dist/queries/shortfall-rulings.js +53 -0
  294. package/dist/queries/shortfall-rulings.js.map +1 -0
  295. package/dist/queries/verification.d.ts +20 -1
  296. package/dist/queries/verification.d.ts.map +1 -1
  297. package/dist/queries/verification.js +48 -8
  298. package/dist/queries/verification.js.map +1 -1
  299. package/dist/resolvers/index.d.ts +2 -2
  300. package/dist/resolvers/index.d.ts.map +1 -1
  301. package/dist/resolvers/index.js +1 -1
  302. package/dist/resolvers/index.js.map +1 -1
  303. package/dist/resolvers/shared/delivery-trailer.d.ts +99 -0
  304. package/dist/resolvers/shared/delivery-trailer.d.ts.map +1 -0
  305. package/dist/resolvers/shared/delivery-trailer.js +103 -0
  306. package/dist/resolvers/shared/delivery-trailer.js.map +1 -0
  307. package/dist/resolvers/shared/git-diff.d.ts +11 -84
  308. package/dist/resolvers/shared/git-diff.d.ts.map +1 -1
  309. package/dist/resolvers/shared/git-diff.js +17 -84
  310. package/dist/resolvers/shared/git-diff.js.map +1 -1
  311. package/dist/resolvers/shared/review-window-commits.d.ts.map +1 -1
  312. package/dist/resolvers/shared/review-window-commits.js +1 -0
  313. package/dist/resolvers/shared/review-window-commits.js.map +1 -1
  314. package/dist/session/session-lineage.d.ts.map +1 -1
  315. package/dist/session/session-lineage.js +1 -0
  316. package/dist/session/session-lineage.js.map +1 -1
  317. package/dist/shell/config.d.ts +2 -1
  318. package/dist/shell/config.d.ts.map +1 -1
  319. package/dist/shell/config.js +21 -4
  320. package/dist/shell/config.js.map +1 -1
  321. package/dist/shell/crash-recovery.d.ts +3 -7
  322. package/dist/shell/crash-recovery.d.ts.map +1 -1
  323. package/dist/shell/crash-recovery.js +28 -31
  324. package/dist/shell/crash-recovery.js.map +1 -1
  325. package/dist/shell/orphan-capture.d.ts +42 -0
  326. package/dist/shell/orphan-capture.d.ts.map +1 -0
  327. package/dist/shell/orphan-capture.js +53 -0
  328. package/dist/shell/orphan-capture.js.map +1 -0
  329. package/dist/shell/worker-pidfile.d.ts +22 -4
  330. package/dist/shell/worker-pidfile.d.ts.map +1 -1
  331. package/dist/shell/worker-pidfile.js +51 -13
  332. package/dist/shell/worker-pidfile.js.map +1 -1
  333. package/dist/spawn/helpers.d.ts +3 -0
  334. package/dist/spawn/helpers.d.ts.map +1 -1
  335. package/dist/spawn/helpers.js +28 -9
  336. package/dist/spawn/helpers.js.map +1 -1
  337. package/dist/spawn/lead-launch.d.ts +34 -0
  338. package/dist/spawn/lead-launch.d.ts.map +1 -0
  339. package/dist/spawn/lead-launch.js +34 -0
  340. package/dist/spawn/lead-launch.js.map +1 -0
  341. package/dist/spawn/lead-process-ownership.d.ts +91 -0
  342. package/dist/spawn/lead-process-ownership.d.ts.map +1 -0
  343. package/dist/spawn/lead-process-ownership.js +120 -0
  344. package/dist/spawn/lead-process-ownership.js.map +1 -0
  345. package/dist/spawn/lifecycle.d.ts +43 -3
  346. package/dist/spawn/lifecycle.d.ts.map +1 -1
  347. package/dist/spawn/lifecycle.js +75 -44
  348. package/dist/spawn/lifecycle.js.map +1 -1
  349. package/dist/spawn/liveness.d.ts.map +1 -1
  350. package/dist/spawn/liveness.js +5 -1
  351. package/dist/spawn/liveness.js.map +1 -1
  352. package/dist/spawn/one-shot-process-ownership.d.ts +48 -0
  353. package/dist/spawn/one-shot-process-ownership.d.ts.map +1 -0
  354. package/dist/spawn/one-shot-process-ownership.js +44 -0
  355. package/dist/spawn/one-shot-process-ownership.js.map +1 -0
  356. package/dist/spawn/process-group-kill.d.ts +79 -0
  357. package/dist/spawn/process-group-kill.d.ts.map +1 -0
  358. package/dist/spawn/process-group-kill.js +210 -0
  359. package/dist/spawn/process-group-kill.js.map +1 -0
  360. package/dist/spawn/process-spawn.d.ts +18 -1
  361. package/dist/spawn/process-spawn.d.ts.map +1 -1
  362. package/dist/spawn/process-spawn.js +51 -20
  363. package/dist/spawn/process-spawn.js.map +1 -1
  364. package/dist/spawn/resolution-budget.d.ts +38 -0
  365. package/dist/spawn/resolution-budget.d.ts.map +1 -0
  366. package/dist/spawn/resolution-budget.js +87 -0
  367. package/dist/spawn/resolution-budget.js.map +1 -0
  368. package/dist/spawn/review-hold-park.d.ts.map +1 -1
  369. package/dist/spawn/review-hold-park.js +37 -5
  370. package/dist/spawn/review-hold-park.js.map +1 -1
  371. package/dist/spawn/spawn-cooldown.d.ts.map +1 -1
  372. package/dist/spawn/spawn-cooldown.js +9 -0
  373. package/dist/spawn/spawn-cooldown.js.map +1 -1
  374. package/dist/spawn/untracked-lead-sweep.d.ts +29 -0
  375. package/dist/spawn/untracked-lead-sweep.d.ts.map +1 -0
  376. package/dist/spawn/untracked-lead-sweep.js +100 -0
  377. package/dist/spawn/untracked-lead-sweep.js.map +1 -0
  378. package/dist/spawn/worker-registry.d.ts.map +1 -1
  379. package/dist/spawn/worker-registry.js +4 -1
  380. package/dist/spawn/worker-registry.js.map +1 -1
  381. package/dist/spawn/worktree-session.d.ts.map +1 -1
  382. package/dist/spawn/worktree-session.js +8 -6
  383. package/dist/spawn/worktree-session.js.map +1 -1
  384. package/dist/testing/fixtures/exit-capture-verify.d.ts +41 -0
  385. package/dist/testing/fixtures/exit-capture-verify.d.ts.map +1 -0
  386. package/dist/testing/fixtures/exit-capture-verify.js +152 -0
  387. package/dist/testing/fixtures/exit-capture-verify.js.map +1 -0
  388. package/dist/testing/fixtures/index.js +1 -1
  389. package/dist/testing/fixtures/pending-spawn-world.d.ts +7 -0
  390. package/dist/testing/fixtures/pending-spawn-world.d.ts.map +1 -1
  391. package/dist/testing/fixtures/pending-spawn-world.js +21 -1
  392. package/dist/testing/fixtures/pending-spawn-world.js.map +1 -1
  393. package/dist/testing/fixtures/stubborn-lead-process.d.ts +22 -0
  394. package/dist/testing/fixtures/stubborn-lead-process.d.ts.map +1 -0
  395. package/dist/testing/fixtures/stubborn-lead-process.js +68 -0
  396. package/dist/testing/fixtures/stubborn-lead-process.js.map +1 -0
  397. package/dist/types/config.d.ts +13 -0
  398. package/dist/types/config.d.ts.map +1 -1
  399. package/dist/types/focus.d.ts +7 -0
  400. package/dist/types/focus.d.ts.map +1 -1
  401. package/dist/types/index.js +1 -1
  402. package/dist/verify/commit-verdict-record.d.ts +13 -3
  403. package/dist/verify/commit-verdict-record.d.ts.map +1 -1
  404. package/dist/verify/commit-verdict-record.js +45 -25
  405. package/dist/verify/commit-verdict-record.js.map +1 -1
  406. package/dist/verify/credit-rearm.d.ts +18 -0
  407. package/dist/verify/credit-rearm.d.ts.map +1 -0
  408. package/dist/verify/credit-rearm.js +69 -0
  409. package/dist/verify/credit-rearm.js.map +1 -0
  410. package/dist/verify/delivery-commit-set.d.ts +10 -0
  411. package/dist/verify/delivery-commit-set.d.ts.map +1 -0
  412. package/dist/verify/delivery-commit-set.js +82 -0
  413. package/dist/verify/delivery-commit-set.js.map +1 -0
  414. package/dist/verify/explicit-rearm.d.ts.map +1 -1
  415. package/dist/verify/explicit-rearm.js +2 -0
  416. package/dist/verify/explicit-rearm.js.map +1 -1
  417. package/dist/verify/failure-signature.d.ts.map +1 -1
  418. package/dist/verify/failure-signature.js +1 -0
  419. package/dist/verify/failure-signature.js.map +1 -1
  420. package/dist/verify/gate-run-registry.d.ts.map +1 -1
  421. package/dist/verify/gate-run-registry.js +3 -0
  422. package/dist/verify/gate-run-registry.js.map +1 -1
  423. package/dist/verify/injection-stamp.d.ts +29 -0
  424. package/dist/verify/injection-stamp.d.ts.map +1 -0
  425. package/dist/verify/injection-stamp.js +139 -0
  426. package/dist/verify/injection-stamp.js.map +1 -0
  427. package/dist/verify/misattributed-commits-read.d.ts +31 -0
  428. package/dist/verify/misattributed-commits-read.d.ts.map +1 -0
  429. package/dist/verify/misattributed-commits-read.js +47 -0
  430. package/dist/verify/misattributed-commits-read.js.map +1 -0
  431. package/dist/verify/misattributed-commits.d.ts +52 -0
  432. package/dist/verify/misattributed-commits.d.ts.map +1 -0
  433. package/dist/verify/misattributed-commits.js +148 -0
  434. package/dist/verify/misattributed-commits.js.map +1 -0
  435. package/dist/verify/no-own-delta-verdict.d.ts +47 -0
  436. package/dist/verify/no-own-delta-verdict.d.ts.map +1 -0
  437. package/dist/verify/no-own-delta-verdict.js +74 -0
  438. package/dist/verify/no-own-delta-verdict.js.map +1 -0
  439. package/dist/verify/shortfall-park-escalation.d.ts +41 -0
  440. package/dist/verify/shortfall-park-escalation.d.ts.map +1 -0
  441. package/dist/verify/shortfall-park-escalation.js +177 -0
  442. package/dist/verify/shortfall-park-escalation.js.map +1 -0
  443. package/dist/verify/shortfall-park.d.ts +109 -0
  444. package/dist/verify/shortfall-park.d.ts.map +1 -0
  445. package/dist/verify/shortfall-park.js +208 -0
  446. package/dist/verify/shortfall-park.js.map +1 -0
  447. package/dist/verify/shortfall-repeat.d.ts +47 -16
  448. package/dist/verify/shortfall-repeat.d.ts.map +1 -1
  449. package/dist/verify/shortfall-repeat.js +77 -23
  450. package/dist/verify/shortfall-repeat.js.map +1 -1
  451. package/dist/verify/shortfall-rulings.d.ts +106 -0
  452. package/dist/verify/shortfall-rulings.d.ts.map +1 -0
  453. package/dist/verify/shortfall-rulings.js +118 -0
  454. package/dist/verify/shortfall-rulings.js.map +1 -0
  455. package/dist/verify/stall-detectors.d.ts.map +1 -1
  456. package/dist/verify/stall-detectors.js +10 -4
  457. package/dist/verify/stall-detectors.js.map +1 -1
  458. package/dist/verify/verification-attribution-base.d.ts +26 -0
  459. package/dist/verify/verification-attribution-base.d.ts.map +1 -0
  460. package/dist/verify/verification-attribution-base.js +127 -0
  461. package/dist/verify/verification-attribution-base.js.map +1 -0
  462. package/dist/verify/verification-attribution-deps.d.ts +32 -0
  463. package/dist/verify/verification-attribution-deps.d.ts.map +1 -0
  464. package/dist/verify/verification-attribution-deps.js +209 -0
  465. package/dist/verify/verification-attribution-deps.js.map +1 -0
  466. package/dist/verify/verification-baseline.d.ts +10 -0
  467. package/dist/verify/verification-baseline.d.ts.map +1 -1
  468. package/dist/verify/verification-baseline.js +35 -13
  469. package/dist/verify/verification-baseline.js.map +1 -1
  470. package/dist/verify/verification-commit-sharing.d.ts.map +1 -1
  471. package/dist/verify/verification-commit-sharing.js +30 -8
  472. package/dist/verify/verification-commit-sharing.js.map +1 -1
  473. package/dist/verify/verification-config.d.ts.map +1 -1
  474. package/dist/verify/verification-config.js +2 -0
  475. package/dist/verify/verification-config.js.map +1 -1
  476. package/dist/verify/verification-default-on.d.ts +3 -0
  477. package/dist/verify/verification-default-on.d.ts.map +1 -1
  478. package/dist/verify/verification-default-on.js +9 -1
  479. package/dist/verify/verification-default-on.js.map +1 -1
  480. package/dist/verify/verification-deps-default.d.ts.map +1 -1
  481. package/dist/verify/verification-deps-default.js +61 -120
  482. package/dist/verify/verification-deps-default.js.map +1 -1
  483. package/dist/verify/verification-deps.d.ts +26 -4
  484. package/dist/verify/verification-deps.d.ts.map +1 -1
  485. package/dist/verify/verification-deterministic.d.ts +15 -0
  486. package/dist/verify/verification-deterministic.d.ts.map +1 -1
  487. package/dist/verify/verification-deterministic.js +1 -12
  488. package/dist/verify/verification-deterministic.js.map +1 -1
  489. package/dist/verify/verification-engine.d.ts +9 -6
  490. package/dist/verify/verification-engine.d.ts.map +1 -1
  491. package/dist/verify/verification-engine.js +43 -62
  492. package/dist/verify/verification-engine.js.map +1 -1
  493. package/dist/verify/verification-evidence-unavailable-feedback.d.ts +2 -1
  494. package/dist/verify/verification-evidence-unavailable-feedback.d.ts.map +1 -1
  495. package/dist/verify/verification-evidence-unavailable-feedback.js +20 -1
  496. package/dist/verify/verification-evidence-unavailable-feedback.js.map +1 -1
  497. package/dist/verify/verification-failure-parser.d.ts +93 -3
  498. package/dist/verify/verification-failure-parser.d.ts.map +1 -1
  499. package/dist/verify/verification-failure-parser.js +172 -3
  500. package/dist/verify/verification-failure-parser.js.map +1 -1
  501. package/dist/verify/verification-feedback.d.ts +60 -43
  502. package/dist/verify/verification-feedback.d.ts.map +1 -1
  503. package/dist/verify/verification-feedback.js +115 -120
  504. package/dist/verify/verification-feedback.js.map +1 -1
  505. package/dist/verify/verification-history-reset.d.ts +2 -1
  506. package/dist/verify/verification-history-reset.d.ts.map +1 -1
  507. package/dist/verify/verification-history-reset.js +4 -2
  508. package/dist/verify/verification-history-reset.js.map +1 -1
  509. package/dist/verify/verification-rework-issue.d.ts +87 -0
  510. package/dist/verify/verification-rework-issue.d.ts.map +1 -0
  511. package/dist/verify/verification-rework-issue.js +212 -0
  512. package/dist/verify/verification-rework-issue.js.map +1 -0
  513. package/dist/verify/verification-rework-messages.d.ts.map +1 -1
  514. package/dist/verify/verification-rework-messages.js +10 -0
  515. package/dist/verify/verification-rework-messages.js.map +1 -1
  516. package/dist/verify/verify-gate-stall.d.ts +2 -0
  517. package/dist/verify/verify-gate-stall.d.ts.map +1 -1
  518. package/dist/verify/verify-gate-stall.js +35 -9
  519. package/dist/verify/verify-gate-stall.js.map +1 -1
  520. package/dist/verify/verify-restatement.d.ts.map +1 -1
  521. package/dist/verify/verify-restatement.js +9 -2
  522. package/dist/verify/verify-restatement.js.map +1 -1
  523. package/dist/worktree/capture-attribution-read.d.ts +47 -0
  524. package/dist/worktree/capture-attribution-read.d.ts.map +1 -0
  525. package/dist/worktree/capture-attribution-read.js +98 -0
  526. package/dist/worktree/capture-attribution-read.js.map +1 -0
  527. package/dist/worktree/capture-attribution.d.ts +26 -0
  528. package/dist/worktree/capture-attribution.d.ts.map +1 -0
  529. package/dist/worktree/capture-attribution.js +111 -0
  530. package/dist/worktree/capture-attribution.js.map +1 -0
  531. package/dist/worktree/index.d.ts.map +1 -1
  532. package/dist/worktree/index.js +2 -1
  533. package/dist/worktree/index.js.map +1 -1
  534. package/dist/worktree/provision.d.ts.map +1 -1
  535. package/dist/worktree/provision.js +23 -6
  536. package/dist/worktree/provision.js.map +1 -1
  537. package/dist/worktree/safety.d.ts +14 -4
  538. package/dist/worktree/safety.d.ts.map +1 -1
  539. package/dist/worktree/safety.js +37 -7
  540. package/dist/worktree/safety.js.map +1 -1
  541. package/dist/worktree/scratch-guard.d.ts +53 -2
  542. package/dist/worktree/scratch-guard.d.ts.map +1 -1
  543. package/dist/worktree/scratch-guard.js +115 -30
  544. package/dist/worktree/scratch-guard.js.map +1 -1
  545. package/dist/worktree/unmerged-capture-escalation.d.ts +52 -0
  546. package/dist/worktree/unmerged-capture-escalation.d.ts.map +1 -0
  547. package/dist/worktree/unmerged-capture-escalation.js +64 -0
  548. package/dist/worktree/unmerged-capture-escalation.js.map +1 -0
  549. package/package.json +2 -2
@@ -0,0 +1,99 @@
1
+ /**
2
+ * The git trailer key that attributes a commit to the delivery whose work it is.
3
+ * Stamped by agents at commit time (see execution-sections / the agent CLAUDE.md
4
+ * template). The value is the delivery UUID. The trailer travels with the commit
5
+ * object, so it survives fast-forward and rebase exactly like the recorded commit
6
+ * set -- reading it is reading a durable fact, not re-deriving from branch topology.
7
+ */
8
+ export declare const DELIVERY_TRAILER_KEY = "Telora-Delivery";
9
+ /**
10
+ * The explicit non-delivery sentinel trailer VALUE. A commit that legitimately
11
+ * belongs to no delivery -- daemon housekeeping (safety commit, WIP-on-exit
12
+ * capture, generated-lockfile remediation), or any genuinely delivery-less
13
+ * commit -- declares that by stamping `Telora-Delivery: none` rather than
14
+ * omitting the trailer or borrowing a real delivery id.
15
+ *
16
+ * It is a TRAILER value, not a bypass token: git's own trailer parser reads it
17
+ * back, so a sentinel commit is still a LABELLED commit. That keeps the verify
18
+ * gate's partition TOTAL -- a batch of sentinel commits is fully accounted for
19
+ * and stays distinguishable from a legacy pre-convention batch where the
20
+ * trailer is genuinely absent. The single source of truth for the literal:
21
+ * both the commit-msg guard (audit-hooks) and the daemon-side stamp
22
+ * (worktree/scratch-guard) import it from here, and the partition read below
23
+ * classifies it as its own third state. Compared case-insensitively.
24
+ */
25
+ export declare const NON_DELIVERY_SENTINEL = "none";
26
+ /**
27
+ * The trailer VALUE for delivery work the daemon captured without being able to
28
+ * tell which delivery it belongs to (an agent-exit or safety capture whose paths
29
+ * no delivery claims, or whose delivery read failed). Distinct from
30
+ * {@link NON_DELIVERY_SENTINEL} on purpose: `none` declares housekeeping that
31
+ * belongs to no delivery, while this declares real delivery work whose delivery
32
+ * is unknown. A capture stamped `none` held a delivery's whole implementation
33
+ * and verify dropped it as housekeeping on every pass (Tinker Tailor 1bc76c8e).
34
+ * Compared case-insensitively.
35
+ */
36
+ export declare const UNATTRIBUTED_CAPTURE_SENTINEL = "unattributed";
37
+ /**
38
+ * Read the RAW `Telora-Delivery` trailer value of a single commit -- the trimmed
39
+ * string exactly as git's trailer parser returns it. That is a delivery UUID, the
40
+ * literal non-delivery sentinel {@link NON_DELIVERY_SENTINEL} (`none`), or '' when
41
+ * the commit carries no such trailer. Empty on any git failure.
42
+ *
43
+ * NOTE: '' here collapses TWO facts (no trailer at all -- a legacy commit or a
44
+ * merge) and is distinct from the sentinel string. Callers that must reason about
45
+ * "deliberately non-delivery" vs "genuinely unattributed" -- the verify-gate
46
+ * partition -- MUST use {@link classifyDeliveryTrailer}, which resolves the raw
47
+ * value into the three states explicitly rather than overloading this string.
48
+ * This raw reader is retained for the write-time round-trip (confirmDeliveryTrailer)
49
+ * and the id-equality confirmation in resolveGitTrailerCommitSet.
50
+ */
51
+ export declare function readDeliveryTrailer(worktreePath: string, sha: string): string;
52
+ /**
53
+ * The four attribution states a commit's `Telora-Delivery` trailer can hold --
54
+ * the partition the verify gate reasons over.
55
+ *
56
+ * - `delivery`: attributed to a specific delivery (a UUID). Its work belongs to
57
+ * that delivery's evidence.
58
+ * - `sentinel`: the explicit non-delivery marker ({@link NON_DELIVERY_SENTINEL}).
59
+ * A DELIBERATELY unattributed commit -- daemon housekeeping (safety / WIP /
60
+ * lockfile). Fully accounted for, but belongs to NO delivery's evidence.
61
+ * - `unattributed_capture`: the {@link UNATTRIBUTED_CAPTURE_SENTINEL} marker. Delivery
62
+ * work the daemon captured without knowing its delivery. Labelled (so a batch
63
+ * of them is partitionable, like sentinels) and in NO delivery's evidence, but
64
+ * it is work, not housekeeping: verify names these commits instead of
65
+ * dropping them silently.
66
+ * - `unattributed`: no parseable trailer. A merge commit (exempt by shape at the
67
+ * hook), or a legacy / genuinely-negligent commit whose attribution is missing.
68
+ * This is the state the total-attribution-failure guard reacts to.
69
+ *
70
+ * The point of the discriminated result is that `sentinel` and `unattributed` are
71
+ * NOT the same fact, even though the raw trailer read collapses both toward ''
72
+ * (unattributed) vs the literal 'none' (sentinel): a batch of all-sentinel commits
73
+ * is COMPLETELY attributed and the gate can render a verdict, whereas a batch with
74
+ * genuinely `unattributed` commits (and no delivery anchor) is the loud
75
+ * total-attribution failure that must NOT be laundered into apparent completeness.
76
+ */
77
+ export type TrailerAttribution = {
78
+ readonly kind: 'delivery';
79
+ readonly deliveryId: string;
80
+ } | {
81
+ readonly kind: 'sentinel';
82
+ } | {
83
+ readonly kind: 'unattributed_capture';
84
+ } | {
85
+ readonly kind: 'unattributed';
86
+ };
87
+ /**
88
+ * Classify a single commit's `Telora-Delivery` trailer into its four-state
89
+ * attribution. Sentinel matches are case-insensitive (matching the commit-msg
90
+ * guard and the stamp). A merge commit carries no trailer, so it classifies as
91
+ * `unattributed` -- deliberately its own-and-same as a missing-trailer commit for
92
+ * the read: both are excluded from every delivery's evidence, and both only feed
93
+ * the loudness check when there is no delivery anchor in the batch (so an
94
+ * incidental merge among real delivery commits never trips it).
95
+ */
96
+ export declare function classifyDeliveryTrailer(worktreePath: string, sha: string): TrailerAttribution;
97
+ /** The same rule over a trimmed value git's trailer parser already read (the batched review-window read). */
98
+ export declare function classifyTrailerValue(raw: string): TrailerAttribution;
99
+ //# sourceMappingURL=delivery-trailer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delivery-trailer.d.ts","sourceRoot":"","sources":["../../../src/resolvers/shared/delivery-trailer.ts"],"names":[],"mappings":"AAkBA;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,oBAAoB,CAAC;AAEtD;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,qBAAqB,SAAS,CAAC;AAE5C;;;;;;;;;GASG;AACH,eAAO,MAAM,6BAA6B,iBAAiB,CAAC;AAE5D;;;;;;;;;;;;;GAaG;AACH,wBAAgB,mBAAmB,CAAC,YAAY,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAe7E;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,MAAM,kBAAkB,GAC1B;IAAE,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAAC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;CAAE,GAC1D;IAAE,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAA;CAAE,GAC7B;IAAE,QAAQ,CAAC,IAAI,EAAE,sBAAsB,CAAA;CAAE,GACzC;IAAE,QAAQ,CAAC,IAAI,EAAE,cAAc,CAAA;CAAE,CAAC;AAEtC;;;;;;;;GAQG;AACH,wBAAgB,uBAAuB,CAAC,YAAY,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,kBAAkB,CAE7F;AAED,6GAA6G;AAC7G,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,MAAM,GAAG,kBAAkB,CAKpE"}
@@ -0,0 +1,103 @@
1
+ // PINNED-BY-BEGIN (generated by gen:pinned-by -- do not hand-edit; checked by lint:pinned-by)
2
+ // Pinned by: packages/daemon/src/merge/attributed-capture-merge-gate.test.ts,
3
+ // packages/daemon/src/resolvers/git-diff-delivery-attribution.test.ts,
4
+ // packages/daemon/src/shell/safety-capture-entry-points.test.ts,
5
+ // packages/daemon/src/worktree/capture-attribution-commit.test.ts
6
+ // PINNED-BY-END
7
+ /**
8
+ * The Telora-Delivery trailer vocabulary: the trailer key, the sentinel values a
9
+ * commit may carry instead of a delivery id, and the one classification rule
10
+ * every reader of attribution applies.
11
+ *
12
+ * Split out of resolvers/shared/git-diff.ts (file-size limit), which re-exports
13
+ * every name here so existing importers keep working.
14
+ */
15
+ import { execSync } from 'node:child_process';
16
+ /**
17
+ * The git trailer key that attributes a commit to the delivery whose work it is.
18
+ * Stamped by agents at commit time (see execution-sections / the agent CLAUDE.md
19
+ * template). The value is the delivery UUID. The trailer travels with the commit
20
+ * object, so it survives fast-forward and rebase exactly like the recorded commit
21
+ * set -- reading it is reading a durable fact, not re-deriving from branch topology.
22
+ */
23
+ export const DELIVERY_TRAILER_KEY = 'Telora-Delivery';
24
+ /**
25
+ * The explicit non-delivery sentinel trailer VALUE. A commit that legitimately
26
+ * belongs to no delivery -- daemon housekeeping (safety commit, WIP-on-exit
27
+ * capture, generated-lockfile remediation), or any genuinely delivery-less
28
+ * commit -- declares that by stamping `Telora-Delivery: none` rather than
29
+ * omitting the trailer or borrowing a real delivery id.
30
+ *
31
+ * It is a TRAILER value, not a bypass token: git's own trailer parser reads it
32
+ * back, so a sentinel commit is still a LABELLED commit. That keeps the verify
33
+ * gate's partition TOTAL -- a batch of sentinel commits is fully accounted for
34
+ * and stays distinguishable from a legacy pre-convention batch where the
35
+ * trailer is genuinely absent. The single source of truth for the literal:
36
+ * both the commit-msg guard (audit-hooks) and the daemon-side stamp
37
+ * (worktree/scratch-guard) import it from here, and the partition read below
38
+ * classifies it as its own third state. Compared case-insensitively.
39
+ */
40
+ export const NON_DELIVERY_SENTINEL = 'none';
41
+ /**
42
+ * The trailer VALUE for delivery work the daemon captured without being able to
43
+ * tell which delivery it belongs to (an agent-exit or safety capture whose paths
44
+ * no delivery claims, or whose delivery read failed). Distinct from
45
+ * {@link NON_DELIVERY_SENTINEL} on purpose: `none` declares housekeeping that
46
+ * belongs to no delivery, while this declares real delivery work whose delivery
47
+ * is unknown. A capture stamped `none` held a delivery's whole implementation
48
+ * and verify dropped it as housekeeping on every pass (Tinker Tailor 1bc76c8e).
49
+ * Compared case-insensitively.
50
+ */
51
+ export const UNATTRIBUTED_CAPTURE_SENTINEL = 'unattributed';
52
+ /**
53
+ * Read the RAW `Telora-Delivery` trailer value of a single commit -- the trimmed
54
+ * string exactly as git's trailer parser returns it. That is a delivery UUID, the
55
+ * literal non-delivery sentinel {@link NON_DELIVERY_SENTINEL} (`none`), or '' when
56
+ * the commit carries no such trailer. Empty on any git failure.
57
+ *
58
+ * NOTE: '' here collapses TWO facts (no trailer at all -- a legacy commit or a
59
+ * merge) and is distinct from the sentinel string. Callers that must reason about
60
+ * "deliberately non-delivery" vs "genuinely unattributed" -- the verify-gate
61
+ * partition -- MUST use {@link classifyDeliveryTrailer}, which resolves the raw
62
+ * value into the three states explicitly rather than overloading this string.
63
+ * This raw reader is retained for the write-time round-trip (confirmDeliveryTrailer)
64
+ * and the id-equality confirmation in resolveGitTrailerCommitSet.
65
+ */
66
+ export function readDeliveryTrailer(worktreePath, sha) {
67
+ const clean = (sha ?? '').trim();
68
+ if (clean === '')
69
+ return '';
70
+ try {
71
+ // Single-quote the format: the `%(...)` parentheses are shell metacharacters.
72
+ const out = execSync(`git show -s '--format=%(trailers:key=${DELIVERY_TRAILER_KEY},valueonly)' ${clean}^{commit}`, { cwd: worktreePath, maxBuffer: 1024 * 1024, encoding: 'utf-8' });
73
+ // A commit can in principle carry several trailer lines; take the first
74
+ // non-empty value -- attribution is single-delivery by construction.
75
+ return out.split('\n').map((l) => l.trim()).find((l) => l !== '') ?? '';
76
+ }
77
+ catch {
78
+ return '';
79
+ }
80
+ }
81
+ /**
82
+ * Classify a single commit's `Telora-Delivery` trailer into its four-state
83
+ * attribution. Sentinel matches are case-insensitive (matching the commit-msg
84
+ * guard and the stamp). A merge commit carries no trailer, so it classifies as
85
+ * `unattributed` -- deliberately its own-and-same as a missing-trailer commit for
86
+ * the read: both are excluded from every delivery's evidence, and both only feed
87
+ * the loudness check when there is no delivery anchor in the batch (so an
88
+ * incidental merge among real delivery commits never trips it).
89
+ */
90
+ export function classifyDeliveryTrailer(worktreePath, sha) {
91
+ return classifyTrailerValue(readDeliveryTrailer(worktreePath, sha));
92
+ }
93
+ /** The same rule over a trimmed value git's trailer parser already read (the batched review-window read). */
94
+ export function classifyTrailerValue(raw) {
95
+ if (raw === '')
96
+ return { kind: 'unattributed' };
97
+ if (raw.toLowerCase() === NON_DELIVERY_SENTINEL.toLowerCase())
98
+ return { kind: 'sentinel' };
99
+ if (raw.toLowerCase() === UNATTRIBUTED_CAPTURE_SENTINEL.toLowerCase())
100
+ return { kind: 'unattributed_capture' };
101
+ return { kind: 'delivery', deliveryId: raw };
102
+ }
103
+ //# sourceMappingURL=delivery-trailer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delivery-trailer.js","sourceRoot":"","sources":["../../../src/resolvers/shared/delivery-trailer.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,8EAA8E;AAC9E,yEAAyE;AACzE,mEAAmE;AACnE,oEAAoE;AACpE,gBAAgB;AAEhB;;;;;;;GAOG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,iBAAiB,CAAC;AAEtD;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,MAAM,CAAC;AAE5C;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG,cAAc,CAAC;AAE5D;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,mBAAmB,CAAC,YAAoB,EAAE,GAAW;IACnE,MAAM,KAAK,GAAG,CAAC,GAAG,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;IACjC,IAAI,KAAK,KAAK,EAAE;QAAE,OAAO,EAAE,CAAC;IAC5B,IAAI,CAAC;QACH,8EAA8E;QAC9E,MAAM,GAAG,GAAG,QAAQ,CAClB,wCAAwC,oBAAoB,gBAAgB,KAAK,WAAW,EAC5F,EAAE,GAAG,EAAE,YAAY,EAAE,SAAS,EAAE,IAAI,GAAG,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,CACjE,CAAC;QACF,wEAAwE;QACxE,qEAAqE;QACrE,OAAO,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC,IAAI,EAAE,CAAC;IAC1E,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC;AAiCD;;;;;;;;GAQG;AACH,MAAM,UAAU,uBAAuB,CAAC,YAAoB,EAAE,GAAW;IACvE,OAAO,oBAAoB,CAAC,mBAAmB,CAAC,YAAY,EAAE,GAAG,CAAC,CAAC,CAAC;AACtE,CAAC;AAED,6GAA6G;AAC7G,MAAM,UAAU,oBAAoB,CAAC,GAAW;IAC9C,IAAI,GAAG,KAAK,EAAE;QAAE,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,CAAC;IAChD,IAAI,GAAG,CAAC,WAAW,EAAE,KAAK,qBAAqB,CAAC,WAAW,EAAE;QAAE,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC;IAC3F,IAAI,GAAG,CAAC,WAAW,EAAE,KAAK,6BAA6B,CAAC,WAAW,EAAE;QAAE,OAAO,EAAE,IAAI,EAAE,sBAAsB,EAAE,CAAC;IAC/G,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,UAAU,EAAE,GAAG,EAAE,CAAC;AAC/C,CAAC"}
@@ -1,3 +1,4 @@
1
+ export { DELIVERY_TRAILER_KEY, NON_DELIVERY_SENTINEL, UNATTRIBUTED_CAPTURE_SENTINEL, readDeliveryTrailer, classifyDeliveryTrailer, classifyTrailerValue, type TrailerAttribution, } from './delivery-trailer.js';
1
2
  export declare const MAX_DIFF_BYTES: number;
2
3
  /**
3
4
  * Run `git diff <range>` in a worktree. Returns the raw diff output, or empty
@@ -112,86 +113,6 @@ export declare function resolveRecordedCommitRange(worktreePath: string, commitS
112
113
  * the reason this source exists rather than deriving the boundary from that array.
113
114
  */
114
115
  export declare function resolveRecordedFastForwardRange(worktreePath: string, preMergeRef: string | null | undefined, mergeBackSha: string | null | undefined): string | null;
115
- /**
116
- * The git trailer key that attributes a commit to the delivery whose work it is.
117
- * Stamped by agents at commit time (see execution-sections / the agent CLAUDE.md
118
- * template). The value is the delivery UUID. The trailer travels with the commit
119
- * object, so it survives fast-forward and rebase exactly like the recorded commit
120
- * set -- reading it is reading a durable fact, not re-deriving from branch topology.
121
- */
122
- export declare const DELIVERY_TRAILER_KEY = "Telora-Delivery";
123
- /**
124
- * The explicit non-delivery sentinel trailer VALUE. A commit that legitimately
125
- * belongs to no delivery -- daemon housekeeping (safety commit, WIP-on-exit
126
- * capture, generated-lockfile remediation), or any genuinely delivery-less
127
- * commit -- declares that by stamping `Telora-Delivery: none` rather than
128
- * omitting the trailer or borrowing a real delivery id.
129
- *
130
- * It is a TRAILER value, not a bypass token: git's own trailer parser reads it
131
- * back, so a sentinel commit is still a LABELLED commit. That keeps the verify
132
- * gate's partition TOTAL -- a batch of sentinel commits is fully accounted for
133
- * and stays distinguishable from a legacy pre-convention batch where the
134
- * trailer is genuinely absent. The single source of truth for the literal:
135
- * both the commit-msg guard (audit-hooks) and the daemon-side stamp
136
- * (worktree/scratch-guard) import it from here, and the partition read below
137
- * classifies it as its own third state. Compared case-insensitively.
138
- */
139
- export declare const NON_DELIVERY_SENTINEL = "none";
140
- /**
141
- * Read the RAW `Telora-Delivery` trailer value of a single commit -- the trimmed
142
- * string exactly as git's trailer parser returns it. That is a delivery UUID, the
143
- * literal non-delivery sentinel {@link NON_DELIVERY_SENTINEL} (`none`), or '' when
144
- * the commit carries no such trailer. Empty on any git failure.
145
- *
146
- * NOTE: '' here collapses TWO facts (no trailer at all -- a legacy commit or a
147
- * merge) and is distinct from the sentinel string. Callers that must reason about
148
- * "deliberately non-delivery" vs "genuinely unattributed" -- the verify-gate
149
- * partition -- MUST use {@link classifyDeliveryTrailer}, which resolves the raw
150
- * value into the three states explicitly rather than overloading this string.
151
- * This raw reader is retained for the write-time round-trip (confirmDeliveryTrailer)
152
- * and the id-equality confirmation in resolveGitTrailerCommitSet.
153
- */
154
- export declare function readDeliveryTrailer(worktreePath: string, sha: string): string;
155
- /**
156
- * The three attribution states a commit's `Telora-Delivery` trailer can hold --
157
- * the partition the verify gate reasons over.
158
- *
159
- * - `delivery`: attributed to a specific delivery (a UUID). Its work belongs to
160
- * that delivery's evidence.
161
- * - `sentinel`: the explicit non-delivery marker ({@link NON_DELIVERY_SENTINEL}).
162
- * A DELIBERATELY unattributed commit -- daemon housekeeping (safety / WIP /
163
- * lockfile). Fully accounted for, but belongs to NO delivery's evidence.
164
- * - `unattributed`: no parseable trailer. A merge commit (exempt by shape at the
165
- * hook), or a legacy / genuinely-negligent commit whose attribution is missing.
166
- * This is the state the total-attribution-failure guard reacts to.
167
- *
168
- * The point of the discriminated result is that `sentinel` and `unattributed` are
169
- * NOT the same fact, even though the raw trailer read collapses both toward ''
170
- * (unattributed) vs the literal 'none' (sentinel): a batch of all-sentinel commits
171
- * is COMPLETELY attributed and the gate can render a verdict, whereas a batch with
172
- * genuinely `unattributed` commits (and no delivery anchor) is the loud
173
- * total-attribution failure that must NOT be laundered into apparent completeness.
174
- */
175
- export type TrailerAttribution = {
176
- readonly kind: 'delivery';
177
- readonly deliveryId: string;
178
- } | {
179
- readonly kind: 'sentinel';
180
- } | {
181
- readonly kind: 'unattributed';
182
- };
183
- /**
184
- * Classify a single commit's `Telora-Delivery` trailer into its three-state
185
- * attribution. Sentinel match is case-insensitive (matching the commit-msg guard
186
- * and the stamp). A merge commit carries no trailer, so it classifies as
187
- * `unattributed` -- deliberately its own-and-same as a missing-trailer commit for
188
- * the read: both are excluded from every delivery's evidence, and both only feed
189
- * the loudness check when there is no delivery anchor in the batch (so an
190
- * incidental merge among real delivery commits never trips it).
191
- */
192
- export declare function classifyDeliveryTrailer(worktreePath: string, sha: string): TrailerAttribution;
193
- /** The same rule over a trimmed value git's trailer parser already read (the batched review-window read). */
194
- export declare function classifyTrailerValue(raw: string): TrailerAttribution;
195
116
  /** Outcome of a write-time trailer confirmation (confirmDeliveryTrailer). */
196
117
  export interface TrailerConfirmation {
197
118
  /** True when the commit's Telora-Delivery trailer parses AFTER this call. */
@@ -230,6 +151,12 @@ export interface TrailerConfirmation {
230
151
  * a commit whose trailer already parses returns ok:true, amended:false untouched.
231
152
  */
232
153
  export declare function confirmDeliveryTrailer(worktreePath: string, sha: string, expectedDeliveryId?: string): TrailerConfirmation;
154
+ /**
155
+ * Recorded commit credits (commit_attributions): sha (lower-case) -> the delivery
156
+ * the commit is credited to, whatever its trailer says. Read by the verify deps
157
+ * layer and passed into the selection functions below, which stay pure over it.
158
+ */
159
+ export type CommitCredits = ReadonlyMap<string, string>;
233
160
  /**
234
161
  * Partition a RECORDED batch commit set (focus_merges.commit_shas, which spans
235
162
  * every delivery merged together) down to the commits attributable to ONE
@@ -252,7 +179,7 @@ export declare function confirmDeliveryTrailer(worktreePath: string, sha: string
252
179
  * Order is preserved (newest-first), so the result still forms the contiguous
253
180
  * chain resolveRecordedCommitRange expects.
254
181
  */
255
- export declare function filterCommitsByDelivery(worktreePath: string, commitShas: string[] | null | undefined, deliveryId: string): string[];
182
+ export declare function filterCommitsByDelivery(worktreePath: string, commitShas: string[] | null | undefined, deliveryId: string, credits?: CommitCredits): string[];
256
183
  /**
257
184
  * From a focus's WHOLE recorded merge history (every batch's commit set), return
258
185
  * exactly THIS delivery's own commits -- the commits whose `Telora-Delivery`
@@ -279,7 +206,7 @@ export declare function filterCommitsByDelivery(worktreePath: string, commitShas
279
206
  * expects; a delivery split across batches is non-contiguous and resolves to a
280
207
  * `commits` source (diffed commit-by-commit) downstream.
281
208
  */
282
- export declare function selectDeliveryCommitsAcrossBatches(worktreePath: string, batches: (string[] | null | undefined)[], deliveryId: string): string[] | null;
209
+ export declare function selectDeliveryCommitsAcrossBatches(worktreePath: string, batches: (string[] | null | undefined)[], deliveryId: string, credits?: CommitCredits): string[] | null;
283
210
  /**
284
211
  * Does ANY commit in a batch attribute to a real DELIVERY (a UUID trailer)?
285
212
  *
@@ -294,7 +221,7 @@ export declare function selectDeliveryCommitsAcrossBatches(worktreePath: string,
294
221
  * with unattributed commits and no delivery anchor is broken). The caller combines
295
222
  * these.
296
223
  */
297
- export declare function batchHasDeliveryTrailer(worktreePath: string, commitShas: string[] | null | undefined): boolean;
224
+ export declare function batchHasDeliveryTrailer(worktreePath: string, commitShas: string[] | null | undefined, credits?: CommitCredits): boolean;
298
225
  /**
299
226
  * Does ANY commit in a batch carry NO parseable attribution at all -- neither a
300
227
  * delivery trailer nor the non-delivery sentinel?
@@ -305,7 +232,7 @@ export declare function batchHasDeliveryTrailer(worktreePath: string, commitShas
305
232
  * work or an explicit sentinel. When it is true and the batch carries no delivery
306
233
  * anchor, on a multi-delivery focus, that is the loud total-attribution failure.
307
234
  */
308
- export declare function batchHasUnattributedCommit(worktreePath: string, commitShas: string[] | null | undefined): boolean;
235
+ export declare function batchHasUnattributedCommit(worktreePath: string, commitShas: string[] | null | undefined, credits?: CommitCredits): boolean;
309
236
  /**
310
237
  * The commit SHAs contained in a diff range (`git rev-list <range>`). Empty on
311
238
  * failure. Used by the verify COMPLETENESS check to prove the resolved range
@@ -1 +1 @@
1
- {"version":3,"file":"git-diff.d.ts","sourceRoot":"","sources":["../../../src/resolvers/shared/git-diff.ts"],"names":[],"mappings":"AAyBA,eAAO,MAAM,cAAc,QAAY,CAAC;AAExC;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,YAAY,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAU3E;AAED,+EAA+E;AAC/E,wBAAgB,gBAAgB,CAAC,YAAY,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAS5E;AAED,0EAA0E;AAC1E,wBAAg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,EAChC,kBAAkB,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,EACpC,mBAAmB,CAAC,EAAE,MAAM,GAAG,IAAI,GAClC,MAAM,GAAG,IAAI,CAKf;AAOD;;;;;GAKG;AACH,wBAAgB,yBAAyB,CAAC,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,kBAAkB,GAAG,MAAM,CAOlG;AAED,uFAAuF;AACvF,wBAAgB,iCAAiC,CAAC,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,kBAAkB,GAAG,MAAM,EAAE,CAO5G;AAED,kFAAkF;AAClF,wBAAgB,6BAA6B,CAAC,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,kBAAkB,GAAG,MAAM,CAOtG;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,kBAAkB,GAAG,MAAM,EAAE,CAG5F;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,YAAY,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAGhF"}
@@ -20,6 +20,8 @@
20
20
  * Git diff helpers shared across resolvers.
21
21
  */
22
22
  import { execSync } from 'node:child_process';
23
+ import { DELIVERY_TRAILER_KEY, classifyDeliveryTrailer, readDeliveryTrailer, } from './delivery-trailer.js';
24
+ export { DELIVERY_TRAILER_KEY, NON_DELIVERY_SENTINEL, UNATTRIBUTED_CAPTURE_SENTINEL, readDeliveryTrailer, classifyDeliveryTrailer, classifyTrailerValue, } from './delivery-trailer.js';
23
25
  export const MAX_DIFF_BYTES = 50 * 1024; // 50 KB truncation limit for git diffs
24
26
  /**
25
27
  * Run `git diff <range>` in a worktree. Returns the raw diff output, or empty
@@ -266,80 +268,6 @@ export function resolveRecordedFastForwardRange(worktreePath, preMergeRef, merge
266
268
  }
267
269
  return `${baseSha}...${tipSha}`;
268
270
  }
269
- /**
270
- * The git trailer key that attributes a commit to the delivery whose work it is.
271
- * Stamped by agents at commit time (see execution-sections / the agent CLAUDE.md
272
- * template). The value is the delivery UUID. The trailer travels with the commit
273
- * object, so it survives fast-forward and rebase exactly like the recorded commit
274
- * set -- reading it is reading a durable fact, not re-deriving from branch topology.
275
- */
276
- export const DELIVERY_TRAILER_KEY = 'Telora-Delivery';
277
- /**
278
- * The explicit non-delivery sentinel trailer VALUE. A commit that legitimately
279
- * belongs to no delivery -- daemon housekeeping (safety commit, WIP-on-exit
280
- * capture, generated-lockfile remediation), or any genuinely delivery-less
281
- * commit -- declares that by stamping `Telora-Delivery: none` rather than
282
- * omitting the trailer or borrowing a real delivery id.
283
- *
284
- * It is a TRAILER value, not a bypass token: git's own trailer parser reads it
285
- * back, so a sentinel commit is still a LABELLED commit. That keeps the verify
286
- * gate's partition TOTAL -- a batch of sentinel commits is fully accounted for
287
- * and stays distinguishable from a legacy pre-convention batch where the
288
- * trailer is genuinely absent. The single source of truth for the literal:
289
- * both the commit-msg guard (audit-hooks) and the daemon-side stamp
290
- * (worktree/scratch-guard) import it from here, and the partition read below
291
- * classifies it as its own third state. Compared case-insensitively.
292
- */
293
- export const NON_DELIVERY_SENTINEL = 'none';
294
- /**
295
- * Read the RAW `Telora-Delivery` trailer value of a single commit -- the trimmed
296
- * string exactly as git's trailer parser returns it. That is a delivery UUID, the
297
- * literal non-delivery sentinel {@link NON_DELIVERY_SENTINEL} (`none`), or '' when
298
- * the commit carries no such trailer. Empty on any git failure.
299
- *
300
- * NOTE: '' here collapses TWO facts (no trailer at all -- a legacy commit or a
301
- * merge) and is distinct from the sentinel string. Callers that must reason about
302
- * "deliberately non-delivery" vs "genuinely unattributed" -- the verify-gate
303
- * partition -- MUST use {@link classifyDeliveryTrailer}, which resolves the raw
304
- * value into the three states explicitly rather than overloading this string.
305
- * This raw reader is retained for the write-time round-trip (confirmDeliveryTrailer)
306
- * and the id-equality confirmation in resolveGitTrailerCommitSet.
307
- */
308
- export function readDeliveryTrailer(worktreePath, sha) {
309
- const clean = (sha ?? '').trim();
310
- if (clean === '')
311
- return '';
312
- try {
313
- // Single-quote the format: the `%(...)` parentheses are shell metacharacters.
314
- const out = execSync(`git show -s '--format=%(trailers:key=${DELIVERY_TRAILER_KEY},valueonly)' ${clean}^{commit}`, { cwd: worktreePath, maxBuffer: 1024 * 1024, encoding: 'utf-8' });
315
- // A commit can in principle carry several trailer lines; take the first
316
- // non-empty value -- attribution is single-delivery by construction.
317
- return out.split('\n').map((l) => l.trim()).find((l) => l !== '') ?? '';
318
- }
319
- catch {
320
- return '';
321
- }
322
- }
323
- /**
324
- * Classify a single commit's `Telora-Delivery` trailer into its three-state
325
- * attribution. Sentinel match is case-insensitive (matching the commit-msg guard
326
- * and the stamp). A merge commit carries no trailer, so it classifies as
327
- * `unattributed` -- deliberately its own-and-same as a missing-trailer commit for
328
- * the read: both are excluded from every delivery's evidence, and both only feed
329
- * the loudness check when there is no delivery anchor in the batch (so an
330
- * incidental merge among real delivery commits never trips it).
331
- */
332
- export function classifyDeliveryTrailer(worktreePath, sha) {
333
- return classifyTrailerValue(readDeliveryTrailer(worktreePath, sha));
334
- }
335
- /** The same rule over a trimmed value git's trailer parser already read (the batched review-window read). */
336
- export function classifyTrailerValue(raw) {
337
- if (raw === '')
338
- return { kind: 'unattributed' };
339
- if (raw.toLowerCase() === NON_DELIVERY_SENTINEL.toLowerCase())
340
- return { kind: 'sentinel' };
341
- return { kind: 'delivery', deliveryId: raw };
342
- }
343
271
  /**
344
272
  * The intended delivery id carried by a commit whose `Telora-Delivery` trailer
345
273
  * did NOT parse -- recovered from a `Telora-Delivery:` line sitting in the commit
@@ -431,6 +359,11 @@ export function confirmDeliveryTrailer(worktreePath, sha, expectedDeliveryId) {
431
359
  }
432
360
  return { ok: true, amended: true, deliveryId: reparsed };
433
361
  }
362
+ /** A commit's attribution: its recorded credit when there is one, else its trailer. */
363
+ function classifyCredited(worktreePath, sha, credits) {
364
+ const credited = credits?.get(sha.toLowerCase());
365
+ return credited ? { kind: 'delivery', deliveryId: credited } : classifyDeliveryTrailer(worktreePath, sha);
366
+ }
434
367
  /**
435
368
  * Partition a RECORDED batch commit set (focus_merges.commit_shas, which spans
436
369
  * every delivery merged together) down to the commits attributable to ONE
@@ -453,12 +386,12 @@ export function confirmDeliveryTrailer(worktreePath, sha, expectedDeliveryId) {
453
386
  * Order is preserved (newest-first), so the result still forms the contiguous
454
387
  * chain resolveRecordedCommitRange expects.
455
388
  */
456
- export function filterCommitsByDelivery(worktreePath, commitShas, deliveryId) {
389
+ export function filterCommitsByDelivery(worktreePath, commitShas, deliveryId, credits) {
457
390
  const shas = (commitShas ?? []).map((s) => s.trim()).filter((s) => s !== '');
458
391
  if (shas.length === 0)
459
392
  return [];
460
393
  const wanted = (deliveryId ?? '').trim();
461
- const classified = shas.map((sha) => ({ sha, attr: classifyDeliveryTrailer(worktreePath, sha) }));
394
+ const classified = shas.map((sha) => ({ sha, attr: classifyCredited(worktreePath, sha, credits) }));
462
395
  // Partitionable when SOME commit carries attribution -- a delivery id or the
463
396
  // sentinel. An all-`unattributed` batch is the un-partitionable legacy case.
464
397
  const anyAttributed = classified.some((c) => c.attr.kind !== 'unattributed');
@@ -496,7 +429,7 @@ export function filterCommitsByDelivery(worktreePath, commitShas, deliveryId) {
496
429
  * expects; a delivery split across batches is non-contiguous and resolves to a
497
430
  * `commits` source (diffed commit-by-commit) downstream.
498
431
  */
499
- export function selectDeliveryCommitsAcrossBatches(worktreePath, batches, deliveryId) {
432
+ export function selectDeliveryCommitsAcrossBatches(worktreePath, batches, deliveryId, credits) {
500
433
  const wanted = (deliveryId ?? '').trim();
501
434
  const seen = new Set();
502
435
  const flat = [];
@@ -511,14 +444,14 @@ export function selectDeliveryCommitsAcrossBatches(worktreePath, batches, delive
511
444
  }
512
445
  if (flat.length === 0)
513
446
  return null; // nothing recorded -> caller uses single-row fallback
514
- const classified = flat.map((sha) => ({ sha, attr: classifyDeliveryTrailer(worktreePath, sha) }));
447
+ const classified = flat.map((sha) => ({ sha, attr: classifyCredited(worktreePath, sha, credits) }));
515
448
  const anyAttributed = classified.some((c) => c.attr.kind !== 'unattributed');
516
449
  if (!anyAttributed)
517
450
  return null; // un-partitionable legacy focus -> single-row fallback
518
451
  if (wanted === '')
519
452
  return null; // no delivery to attribute by -> single-row fallback
520
- // Only this delivery's own commits: sentinel (housekeeping) and other-delivery
521
- // and untrailered commits all fall out.
453
+ // Only this delivery's own commits: sentinel (housekeeping), unattributed
454
+ // capture, other-delivery and untrailered commits all fall out.
522
455
  return classified
523
456
  .filter((c) => c.attr.kind === 'delivery' && c.attr.deliveryId === wanted)
524
457
  .map((c) => c.sha);
@@ -537,9 +470,9 @@ export function selectDeliveryCommitsAcrossBatches(worktreePath, batches, delive
537
470
  * with unattributed commits and no delivery anchor is broken). The caller combines
538
471
  * these.
539
472
  */
540
- export function batchHasDeliveryTrailer(worktreePath, commitShas) {
473
+ export function batchHasDeliveryTrailer(worktreePath, commitShas, credits) {
541
474
  const shas = (commitShas ?? []).map((s) => s.trim()).filter((s) => s !== '');
542
- return shas.some((sha) => classifyDeliveryTrailer(worktreePath, sha).kind === 'delivery');
475
+ return shas.some((sha) => classifyCredited(worktreePath, sha, credits).kind === 'delivery');
543
476
  }
544
477
  /**
545
478
  * Does ANY commit in a batch carry NO parseable attribution at all -- neither a
@@ -551,9 +484,9 @@ export function batchHasDeliveryTrailer(worktreePath, commitShas) {
551
484
  * work or an explicit sentinel. When it is true and the batch carries no delivery
552
485
  * anchor, on a multi-delivery focus, that is the loud total-attribution failure.
553
486
  */
554
- export function batchHasUnattributedCommit(worktreePath, commitShas) {
487
+ export function batchHasUnattributedCommit(worktreePath, commitShas, credits) {
555
488
  const shas = (commitShas ?? []).map((s) => s.trim()).filter((s) => s !== '');
556
- return shas.some((sha) => classifyDeliveryTrailer(worktreePath, sha).kind === 'unattributed');
489
+ return shas.some((sha) => classifyCredited(worktreePath, sha, credits).kind === 'unattributed');
557
490
  }
558
491
  /**
559
492
  * The commit SHAs contained in a diff range (`git rev-list <range>`). Empty on