@telora/daemon 0.22.169 → 0.22.187

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 (254) hide show
  1. package/build-info.json +9 -3
  2. package/dist/audit/audit-floor-policy.d.ts +188 -0
  3. package/dist/audit/audit-floor-policy.d.ts.map +1 -0
  4. package/dist/audit/audit-floor-policy.js +353 -0
  5. package/dist/audit/audit-floor-policy.js.map +1 -0
  6. package/dist/audit/audit-prompt.d.ts +4 -177
  7. package/dist/audit/audit-prompt.d.ts.map +1 -1
  8. package/dist/audit/audit-prompt.js +6 -329
  9. package/dist/audit/audit-prompt.js.map +1 -1
  10. package/dist/completion/commit-verdict-release.d.ts +37 -1
  11. package/dist/completion/commit-verdict-release.d.ts.map +1 -1
  12. package/dist/completion/commit-verdict-release.js +90 -15
  13. package/dist/completion/commit-verdict-release.js.map +1 -1
  14. package/dist/completion/escalations.d.ts.map +1 -1
  15. package/dist/completion/escalations.js +3 -1
  16. package/dist/completion/escalations.js.map +1 -1
  17. package/dist/completion/review-exit-verdict-gate.d.ts +11 -5
  18. package/dist/completion/review-exit-verdict-gate.d.ts.map +1 -1
  19. package/dist/completion/review-exit-verdict-gate.js +6 -3
  20. package/dist/completion/review-exit-verdict-gate.js.map +1 -1
  21. package/dist/delivery/commit-verdict-hold.d.ts.map +1 -1
  22. package/dist/delivery/commit-verdict-hold.js +2 -1
  23. package/dist/delivery/commit-verdict-hold.js.map +1 -1
  24. package/dist/directive/stranded-review-reroute.js +1 -1
  25. package/dist/directive/stranded-review-reroute.js.map +1 -1
  26. package/dist/focus/focus-executor.d.ts.map +1 -1
  27. package/dist/focus/focus-executor.js +2 -0
  28. package/dist/focus/focus-executor.js.map +1 -1
  29. package/dist/focus/pending-review-approved-head.d.ts +1 -1
  30. package/dist/focus/pending-review-approved-head.d.ts.map +1 -1
  31. package/dist/focus/pending-review-approved-head.js +4 -3
  32. package/dist/focus/pending-review-approved-head.js.map +1 -1
  33. package/dist/focus/session-health.d.ts.map +1 -1
  34. package/dist/focus/session-health.js +2 -1
  35. package/dist/focus/session-health.js.map +1 -1
  36. package/dist/focus-stage-lifecycle/planning-release.d.ts +52 -17
  37. package/dist/focus-stage-lifecycle/planning-release.d.ts.map +1 -1
  38. package/dist/focus-stage-lifecycle/planning-release.js +58 -70
  39. package/dist/focus-stage-lifecycle/planning-release.js.map +1 -1
  40. package/dist/focus-stage-lifecycle/ratify-bar-gate.d.ts +108 -0
  41. package/dist/focus-stage-lifecycle/ratify-bar-gate.d.ts.map +1 -0
  42. package/dist/focus-stage-lifecycle/ratify-bar-gate.js +174 -0
  43. package/dist/focus-stage-lifecycle/ratify-bar-gate.js.map +1 -0
  44. package/dist/git/merge-to-main.d.ts.map +1 -1
  45. package/dist/git/merge-to-main.js.map +1 -1
  46. package/dist/nexus/index.d.ts.map +1 -1
  47. package/dist/nexus/index.js +2 -1
  48. package/dist/nexus/index.js.map +1 -1
  49. package/dist/nexus/intake-prompt-sections.d.ts +70 -0
  50. package/dist/nexus/intake-prompt-sections.d.ts.map +1 -0
  51. package/dist/nexus/intake-prompt-sections.js +145 -0
  52. package/dist/nexus/intake-prompt-sections.js.map +1 -0
  53. package/dist/nexus/intake-spawn.d.ts +49 -13
  54. package/dist/nexus/intake-spawn.d.ts.map +1 -1
  55. package/dist/nexus/intake-spawn.js +45 -122
  56. package/dist/nexus/intake-spawn.js.map +1 -1
  57. package/dist/nexus/intake.d.ts +55 -0
  58. package/dist/nexus/intake.d.ts.map +1 -1
  59. package/dist/nexus/intake.js +62 -1
  60. package/dist/nexus/intake.js.map +1 -1
  61. package/dist/prd/arm-readiness.d.ts +93 -0
  62. package/dist/prd/arm-readiness.d.ts.map +1 -0
  63. package/dist/prd/arm-readiness.js +254 -0
  64. package/dist/prd/arm-readiness.js.map +1 -0
  65. package/dist/prd/arm-refusal.d.ts +149 -0
  66. package/dist/prd/arm-refusal.d.ts.map +1 -0
  67. package/dist/prd/arm-refusal.js +219 -0
  68. package/dist/prd/arm-refusal.js.map +1 -0
  69. package/dist/prd/controller-shared.d.ts +111 -0
  70. package/dist/prd/controller-shared.d.ts.map +1 -1
  71. package/dist/prd/controller-shared.js +3 -1
  72. package/dist/prd/controller-shared.js.map +1 -1
  73. package/dist/prd/controller.d.ts +16 -10
  74. package/dist/prd/controller.d.ts.map +1 -1
  75. package/dist/prd/controller.js +28 -35
  76. package/dist/prd/controller.js.map +1 -1
  77. package/dist/prd/frontier-arming.d.ts +151 -0
  78. package/dist/prd/frontier-arming.d.ts.map +1 -0
  79. package/dist/prd/frontier-arming.js +315 -0
  80. package/dist/prd/frontier-arming.js.map +1 -0
  81. package/dist/prd/index.d.ts +10 -1
  82. package/dist/prd/index.d.ts.map +1 -1
  83. package/dist/prd/index.js +9 -1
  84. package/dist/prd/index.js.map +1 -1
  85. package/dist/prd/scoping-prompt.d.ts +68 -0
  86. package/dist/prd/scoping-prompt.d.ts.map +1 -0
  87. package/dist/prd/scoping-prompt.js +86 -0
  88. package/dist/prd/scoping-prompt.js.map +1 -0
  89. package/dist/prompt/prompt-contradictions.d.ts +20 -1
  90. package/dist/prompt/prompt-contradictions.d.ts.map +1 -1
  91. package/dist/prompt/prompt-contradictions.js +35 -0
  92. package/dist/prompt/prompt-contradictions.js.map +1 -1
  93. package/dist/prompt/team-prompt-base.d.ts +18 -0
  94. package/dist/prompt/team-prompt-base.d.ts.map +1 -1
  95. package/dist/prompt/team-prompt-base.js +56 -11
  96. package/dist/prompt/team-prompt-base.js.map +1 -1
  97. package/dist/prompt-sections/persona-sections.d.ts +36 -13
  98. package/dist/prompt-sections/persona-sections.d.ts.map +1 -1
  99. package/dist/prompt-sections/persona-sections.js +93 -16
  100. package/dist/prompt-sections/persona-sections.js.map +1 -1
  101. package/dist/prompt-sections/scoping-sections.d.ts +19 -5
  102. package/dist/prompt-sections/scoping-sections.d.ts.map +1 -1
  103. package/dist/prompt-sections/scoping-sections.js +45 -38
  104. package/dist/prompt-sections/scoping-sections.js.map +1 -1
  105. package/dist/prompt-sections/shared.d.ts +8 -0
  106. package/dist/prompt-sections/shared.d.ts.map +1 -1
  107. package/dist/prompt-sections/shared.js.map +1 -1
  108. package/dist/queries/delivery-gate-state.js +1 -1
  109. package/dist/queries/focus-criteria-standing.d.ts +170 -7
  110. package/dist/queries/focus-criteria-standing.d.ts.map +1 -1
  111. package/dist/queries/focus-criteria-standing.js +143 -8
  112. package/dist/queries/focus-criteria-standing.js.map +1 -1
  113. package/dist/queries/focus-ratify-release.d.ts +43 -0
  114. package/dist/queries/focus-ratify-release.d.ts.map +1 -0
  115. package/dist/queries/focus-ratify-release.js +45 -0
  116. package/dist/queries/focus-ratify-release.js.map +1 -0
  117. package/dist/queries/focuses.d.ts +0 -10
  118. package/dist/queries/focuses.d.ts.map +1 -1
  119. package/dist/queries/focuses.js +2 -15
  120. package/dist/queries/focuses.js.map +1 -1
  121. package/dist/queries/prd.d.ts +31 -0
  122. package/dist/queries/prd.d.ts.map +1 -1
  123. package/dist/queries/prd.js +26 -1
  124. package/dist/queries/prd.js.map +1 -1
  125. package/dist/queries/shared.js +1 -1
  126. package/dist/resolvers/focus-criteria-standing.d.ts.map +1 -1
  127. package/dist/resolvers/focus-criteria-standing.js +324 -25
  128. package/dist/resolvers/focus-criteria-standing.js.map +1 -1
  129. package/dist/resolvers/shared/review-window-commits.d.ts.map +1 -1
  130. package/dist/resolvers/shared/review-window-commits.js +2 -1
  131. package/dist/resolvers/shared/review-window-commits.js.map +1 -1
  132. package/dist/security/security-auto-inject.d.ts +51 -0
  133. package/dist/security/security-auto-inject.d.ts.map +1 -1
  134. package/dist/security/security-auto-inject.js +101 -11
  135. package/dist/security/security-auto-inject.js.map +1 -1
  136. package/dist/security/security-scan-engine.d.ts +4 -4
  137. package/dist/security/security-scan-engine.d.ts.map +1 -1
  138. package/dist/security/security-scan-engine.js +6 -0
  139. package/dist/security/security-scan-engine.js.map +1 -1
  140. package/dist/session/session-lineage.d.ts.map +1 -1
  141. package/dist/session/session-lineage.js +2 -0
  142. package/dist/session/session-lineage.js.map +1 -1
  143. package/dist/shell/constants.d.ts +5 -0
  144. package/dist/shell/constants.d.ts.map +1 -1
  145. package/dist/shell/constants.js +5 -0
  146. package/dist/shell/constants.js.map +1 -1
  147. package/dist/shell/daemon-instance.d.ts +74 -64
  148. package/dist/shell/daemon-instance.d.ts.map +1 -1
  149. package/dist/shell/daemon-instance.js +16 -121
  150. package/dist/shell/daemon-instance.js.map +1 -1
  151. package/dist/shell/health-events.js +1 -1
  152. package/dist/shell/health-events.js.map +1 -1
  153. package/dist/shell/instance-liveness.d.ts +112 -0
  154. package/dist/shell/instance-liveness.d.ts.map +1 -0
  155. package/dist/shell/instance-liveness.js +205 -0
  156. package/dist/shell/instance-liveness.js.map +1 -0
  157. package/dist/shell/schema-version-gate.d.ts +22 -0
  158. package/dist/shell/schema-version-gate.d.ts.map +1 -1
  159. package/dist/shell/schema-version-gate.js +116 -6
  160. package/dist/shell/schema-version-gate.js.map +1 -1
  161. package/dist/shell/worker-pidfile.d.ts +21 -8
  162. package/dist/shell/worker-pidfile.d.ts.map +1 -1
  163. package/dist/shell/worker-pidfile.js +38 -9
  164. package/dist/shell/worker-pidfile.js.map +1 -1
  165. package/dist/spawn/lead-launch.d.ts.map +1 -1
  166. package/dist/spawn/lead-launch.js +2 -1
  167. package/dist/spawn/lead-launch.js.map +1 -1
  168. package/dist/spawn/one-shot-scoping-spawn.d.ts +51 -0
  169. package/dist/spawn/one-shot-scoping-spawn.d.ts.map +1 -0
  170. package/dist/spawn/one-shot-scoping-spawn.js +156 -0
  171. package/dist/spawn/one-shot-scoping-spawn.js.map +1 -0
  172. package/dist/spawn/process-spawn.d.ts +12 -0
  173. package/dist/spawn/process-spawn.d.ts.map +1 -1
  174. package/dist/spawn/process-spawn.js +1 -1
  175. package/dist/spawn/process-spawn.js.map +1 -1
  176. package/dist/spawn/prompt-assembly.d.ts +8 -0
  177. package/dist/spawn/prompt-assembly.d.ts.map +1 -1
  178. package/dist/spawn/prompt-assembly.js +15 -3
  179. package/dist/spawn/prompt-assembly.js.map +1 -1
  180. package/dist/spawn/worktree-session.d.ts +24 -6
  181. package/dist/spawn/worktree-session.d.ts.map +1 -1
  182. package/dist/spawn/worktree-session.js +37 -14
  183. package/dist/spawn/worktree-session.js.map +1 -1
  184. package/dist/testing/arm-coverage-model.d.ts +75 -0
  185. package/dist/testing/arm-coverage-model.d.ts.map +1 -0
  186. package/dist/testing/arm-coverage-model.js +114 -0
  187. package/dist/testing/arm-coverage-model.js.map +1 -0
  188. package/dist/testing/fixtures/index.js +1 -1
  189. package/dist/types/index.js +1 -1
  190. package/dist/verify/commit-gate-configured.d.ts.map +1 -1
  191. package/dist/verify/commit-gate-configured.js +1 -1
  192. package/dist/verify/commit-gate-configured.js.map +1 -1
  193. package/dist/verify/commit-verdict-pull.d.ts +48 -0
  194. package/dist/verify/commit-verdict-pull.d.ts.map +1 -0
  195. package/dist/verify/commit-verdict-pull.js +148 -0
  196. package/dist/verify/commit-verdict-pull.js.map +1 -0
  197. package/dist/verify/commit-verdict-record.js +1 -1
  198. package/dist/verify/credit-rearm.js +1 -1
  199. package/dist/verify/credit-rearm.js.map +1 -1
  200. package/dist/verify/default-on-guards.d.ts +74 -0
  201. package/dist/verify/default-on-guards.d.ts.map +1 -0
  202. package/dist/verify/default-on-guards.js +305 -0
  203. package/dist/verify/default-on-guards.js.map +1 -0
  204. package/dist/verify/explicit-rearm.d.ts.map +1 -1
  205. package/dist/verify/explicit-rearm.js +1 -0
  206. package/dist/verify/explicit-rearm.js.map +1 -1
  207. package/dist/verify/gate-run-registry.d.ts.map +1 -1
  208. package/dist/verify/gate-run-registry.js +1 -0
  209. package/dist/verify/gate-run-registry.js.map +1 -1
  210. package/dist/verify/judged-ancestor.d.ts +41 -0
  211. package/dist/verify/judged-ancestor.d.ts.map +1 -0
  212. package/dist/verify/judged-ancestor.js +101 -0
  213. package/dist/verify/judged-ancestor.js.map +1 -0
  214. package/dist/verify/no-own-delta-verdict.d.ts +7 -2
  215. package/dist/verify/no-own-delta-verdict.d.ts.map +1 -1
  216. package/dist/verify/no-own-delta-verdict.js +14 -17
  217. package/dist/verify/no-own-delta-verdict.js.map +1 -1
  218. package/dist/verify/rework-attribution.d.ts +71 -0
  219. package/dist/verify/rework-attribution.d.ts.map +1 -0
  220. package/dist/verify/rework-attribution.js +263 -0
  221. package/dist/verify/rework-attribution.js.map +1 -0
  222. package/dist/verify/shortfall-rulings.d.ts.map +1 -1
  223. package/dist/verify/shortfall-rulings.js +3 -2
  224. package/dist/verify/shortfall-rulings.js.map +1 -1
  225. package/dist/verify/verification-boundary-env.d.ts +70 -17
  226. package/dist/verify/verification-boundary-env.d.ts.map +1 -1
  227. package/dist/verify/verification-boundary-env.js +88 -14
  228. package/dist/verify/verification-boundary-env.js.map +1 -1
  229. package/dist/verify/verification-commit-sharing.d.ts.map +1 -1
  230. package/dist/verify/verification-commit-sharing.js +2 -1
  231. package/dist/verify/verification-commit-sharing.js.map +1 -1
  232. package/dist/verify/verification-config.d.ts.map +1 -1
  233. package/dist/verify/verification-config.js +1 -0
  234. package/dist/verify/verification-config.js.map +1 -1
  235. package/dist/verify/verification-default-on.d.ts +0 -32
  236. package/dist/verify/verification-default-on.d.ts.map +1 -1
  237. package/dist/verify/verification-default-on.js +10 -234
  238. package/dist/verify/verification-default-on.js.map +1 -1
  239. package/dist/verify/verification-deps-default.d.ts.map +1 -1
  240. package/dist/verify/verification-deps-default.js +9 -0
  241. package/dist/verify/verification-deps-default.js.map +1 -1
  242. package/dist/verify/verification-engine.d.ts +2 -1
  243. package/dist/verify/verification-engine.d.ts.map +1 -1
  244. package/dist/verify/verification-engine.js +12 -4
  245. package/dist/verify/verification-engine.js.map +1 -1
  246. package/dist/verify/verification-feedback.d.ts +1 -1
  247. package/dist/verify/verification-feedback.d.ts.map +1 -1
  248. package/dist/verify/verification-feedback.js +5 -0
  249. package/dist/verify/verification-feedback.js.map +1 -1
  250. package/dist/verify/verification-rework-issue.d.ts +48 -7
  251. package/dist/verify/verification-rework-issue.d.ts.map +1 -1
  252. package/dist/verify/verification-rework-issue.js +111 -9
  253. package/dist/verify/verification-rework-issue.js.map +1 -1
  254. package/package.json +2 -2
@@ -19,8 +19,13 @@
19
19
  * @module verify/no-own-delta-verdict
20
20
  */
21
21
  import { isForeignOnlyExtension } from '../git/focus-own-delta.js';
22
+ import { type AncestorLister } from './judged-ancestor.js';
22
23
  import type { CommitVerdict, CommitVerdictGate, CommitVerdictReader } from './commit-verdict-record.js';
23
- /** How many ancestors of the tip are searched for the newest judged one. */
24
+ /**
25
+ * How many ancestors of the tip are searched for the newest judged one. Kept as
26
+ * this module's name for the walk's depth, which now lives in
27
+ * verify/judged-ancestor.ts beside the walk itself.
28
+ */
24
29
  export declare const CARRIED_VERDICT_SEARCH_DEPTH = 200;
25
30
  /** The reads a carried verdict is resolved from. */
26
31
  export interface CarriedVerdictDeps {
@@ -31,7 +36,7 @@ export interface CarriedVerdictDeps {
31
36
  listFocusDeliveryIds: (focusId: string) => Promise<readonly string[]>;
32
37
  readCommitVerdict: CommitVerdictReader;
33
38
  /** Ancestors of `tip`, newest first, excluding `tip`; null when unreadable. */
34
- listAncestors?: (worktreePath: string, tip: string, depth: number) => string[] | null;
39
+ listAncestors?: AncestorLister;
35
40
  isForeignOnlyExtension?: typeof isForeignOnlyExtension;
36
41
  }
37
42
  /** A verdict carried to `head`, and the judged commit it came from. */
@@ -1 +1 @@
1
- {"version":3,"file":"no-own-delta-verdict.d.ts","sourceRoot":"","sources":["../../src/verify/no-own-delta-verdict.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AAEnE,OAAO,KAAK,EAAE,aAAa,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAExG,4EAA4E;AAC5E,eAAO,MAAM,4BAA4B,MAAM,CAAC;AAEhD,oDAAoD;AACpD,MAA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,EAAE,MAAM,CAAC;IAC1B,6DAA6D;IAC7D,mBAAmB,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,MAAM,GAAG,IAAI,CAAC;IACxD,qEAAqE;IACrE,oBAAoB,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,SAAS,MAAM,EAAE,CAAC,CAAC;IACtE,iBAAiB,EAAE,mBAAmB,CAAC;IACvC,+EAA+E;IAC/E,aAAa,CAAC,EAAE,cAAc,CAAC;IAC/B,sBAAsB,CAAC,EAAE,OAAO,sBAAsB,CAAC;CACxD;AAED,uEAAuE;AACvE,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,aAAa,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;;GAGG;AACH,wBAAsB,qBAAqB,CACzC,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,iBAAiB,EACvB,IAAI,EAAE,kBAAkB,GACvB,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC,CA+BhC"}
@@ -23,15 +23,13 @@
23
23
  * @module verify/no-own-delta-verdict
24
24
  */
25
25
  import { isForeignOnlyExtension } from '../git/focus-own-delta.js';
26
- import { runGitSync } from '../git/types.js';
27
- /** How many ancestors of the tip are searched for the newest judged one. */
28
- export const CARRIED_VERDICT_SEARCH_DEPTH = 200;
29
- function defaultListAncestors(worktreePath, tip, depth) {
30
- const r = runGitSync(['rev-list', '--topo-order', `--max-count=${depth}`, '--skip=1', tip], worktreePath);
31
- if (!r.success)
32
- return null;
33
- return r.output.split('\n').map((l) => l.trim()).filter((l) => l !== '');
34
- }
26
+ import { ANCESTOR_SEARCH_DEPTH, findJudgedAncestor } from './judged-ancestor.js';
27
+ /**
28
+ * How many ancestors of the tip are searched for the newest judged one. Kept as
29
+ * this module's name for the walk's depth, which now lives in
30
+ * verify/judged-ancestor.ts beside the walk itself.
31
+ */
32
+ export const CARRIED_VERDICT_SEARCH_DEPTH = ANCESTOR_SEARCH_DEPTH;
35
33
  /**
36
34
  * The verdict `head` carries from its newest judged ancestor when it adds nothing
37
35
  * of the focus's own (module doc), or null.
@@ -40,15 +38,14 @@ export async function resolveCarriedVerdict(productId, focusId, head, gate, deps
40
38
  const worktreePath = deps.resolveWorktreePath(focusId);
41
39
  if (!worktreePath)
42
40
  return null;
43
- const ancestors = (deps.listAncestors ?? defaultListAncestors)(worktreePath, head, CARRIED_VERDICT_SEARCH_DEPTH);
44
- if (!ancestors)
45
- return null;
46
- const judged = ancestors.find((sha) => deps.readCommitVerdict(productId, focusId, sha, gate) !== null);
47
- if (!judged)
48
- return null;
49
- const recorded = deps.readCommitVerdict(productId, focusId, judged, gate);
50
- if (!recorded)
41
+ const found = findJudgedAncestor(productId, focusId, head, gate, {
42
+ worktreePath,
43
+ readCommitVerdict: deps.readCommitVerdict,
44
+ ...(deps.listAncestors ? { listAncestors: deps.listAncestors } : {}),
45
+ });
46
+ if (!found)
51
47
  return null;
48
+ const { sha: judged, verdict: recorded } = found;
52
49
  let ids;
53
50
  try {
54
51
  ids = await deps.listFocusDeliveryIds(focusId);
@@ -1 +1 @@
1
- {"version":3,"file":"no-own-delta-verdict.js","sourceRoot":"","sources":["../../src/verify/no-own-delta-verdict.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,8FAA8F;AAC9F,mEAAmE;AACnE,gBAAgB;AAEhB;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AACnE,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAG7C,4EAA4E;AAC5E,MAAM,CAAC,MAAM,4BAA4B,GAAG,GAAG,CAAC;AAehD,SAAS,oBAAoB,CAAC,YAAoB,EAAE,GAAW,EAAE,KAAa;IAC5E,MAAM,CAAC,GAAG,UAAU,CAAC,CAAC,UAAU,EAAE,cAAc,EAAE,eAAe,KAAK,EAAE,EAAE,UAAU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AQ,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,UAAU;SACpF;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,71 @@
1
+ import { type ReviewWindowCommit } from '../resolvers/shared/review-window-commits.js';
2
+ import { findGreenAncestor } from './judged-ancestor.js';
3
+ import { type CommitVerdict, type CommitVerdictGate } from './commit-verdict-record.js';
4
+ /** Injectable seams; each defaults to the real read. */
5
+ export interface ReworkAttributionDeps {
6
+ /** The focus worktree the failed commit was judged in; null when the daemon holds none. */
7
+ resolveWorktreePath: (focusId: string) => string | null;
8
+ /** The verdict recorded for a commit; without a gate, the newest under any gate (which carries its own). */
9
+ readCommitVerdict: (productId: string, focusId: string, sha: string, gate?: CommitVerdictGate) => CommitVerdict | null;
10
+ /** The newest ancestor of `tip` this gate judged PASSING (verify/judged-ancestor.ts). */
11
+ findGreenAncestor: typeof findGreenAncestor;
12
+ /** The non-merge commits in base..tip with their trailer attribution; null when git could not answer. */
13
+ listWindow: (worktreePath: string, base: string, tip: string) => readonly ReviewWindowCommit[] | null;
14
+ /**
15
+ * The focus's deliveries sitting in verify -- the candidate set an unattributable
16
+ * failure is settled over, so a pass that was handed one delivery can still ask the
17
+ * focus-wide question (module doc).
18
+ */
19
+ listVerifyCandidates: (focusId: string) => Promise<readonly string[]>;
20
+ }
21
+ export declare const defaultReworkAttributionDeps: () => ReworkAttributionDeps;
22
+ /** The focus commit whose failure is being attributed. */
23
+ export interface FailedCommit {
24
+ productId: string;
25
+ focusId: string;
26
+ /** The commit the gate failed on. */
27
+ sha: string;
28
+ }
29
+ /** Who owns a failed verdict, and how that was decided. */
30
+ export interface FailureOwnership {
31
+ /** The deliveries whose own commits are in the judged range; empty when none is attributable. */
32
+ causingDeliveryIds: ReadonlySet<string>;
33
+ /** Those deliveries in range order, NEWEST COMMIT FIRST -- the ranking the owner is taken from. */
34
+ causingNewestFirst: readonly string[];
35
+ /** The delivery whose dispatch ran the gate -- the owner when nothing is attributable. */
36
+ judgedDeliveryId: string;
37
+ /** The ONE delivery this failure's rework belongs on: the newest causing commit's, else the judged one. */
38
+ owningDeliveryId: string;
39
+ /** False when the range could not be read at all (git or the green ancestor); the fallback then decides alone. */
40
+ rangeRead: boolean;
41
+ }
42
+ /**
43
+ * Who a failed verdict belongs to (module doc), or null when its verdict cannot be
44
+ * read -- the one answer that means "cannot tell". Never throws.
45
+ */
46
+ export declare function resolveFailureOwnership(at: FailedCommit, deps?: ReworkAttributionDeps): FailureOwnership | null;
47
+ /**
48
+ * The ONE delivery a failed verdict's rework belongs on, chosen from the
49
+ * `candidates` a filing pass would otherwise fan out over (module doc). Null means
50
+ * "cannot tell" -- the verdict itself was unreadable or is not a failure -- and the
51
+ * caller files as it did before. Never throws.
52
+ */
53
+ export declare function selectReworkOwner(candidates: readonly string[], at: FailedCommit, deps?: ReworkAttributionDeps): string | null;
54
+ /**
55
+ * Rung 3: the owner of a failure NOTHING attributes, over the candidates that could
56
+ * carry it. The lowest id -- arbitrary on purpose, and a pure function of the set, so
57
+ * a sibling, a later poll, a restarted daemon and the per-focus filer all name the
58
+ * same one delivery. Null only when there is no candidate at all.
59
+ */
60
+ export declare function unattributableOwner(candidates: readonly string[]): string | null;
61
+ /**
62
+ * Whether the rework Bug for `failedSha` belongs on `deliveryId` (module doc): it is
63
+ * the ONE owner the range names -- the delivery of the newest commit in it, or, with
64
+ * nothing attributable there, the delivery whose dispatch ran the gate. An unreadable
65
+ * verdict names no owner from the commit, so the question is asked of the FOCUS
66
+ * instead: the candidate set settles it by rung 3, identically for every asker and
67
+ * across a restart. A candidate read that fails files nothing this poll (the retry
68
+ * owns that case). Never throws.
69
+ */
70
+ export declare function deliveryOwnsFailure(deliveryId: string, at: FailedCommit, deps?: ReworkAttributionDeps): Promise<boolean>;
71
+ //# sourceMappingURL=rework-attribution.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rework-attribution.d.ts","sourceRoot":"","sources":["../../src/verify/rework-attribution.ts"],"names":[],"mappings":"AAsGA,OA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AC3G,gBAAgB,EAAE,MAAM,CAAC;IACzB,kHAAkH;IAClH,SAAS,EAAE,OAAO,CAAC;CACpB;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CACrC,EAAE,EAAE,YAAY,EAChB,IAAI,GAAE,qBAAsD,GAC3D,gBAAgB,GAAG,IAAI,CAkBzB;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAC/B,UAAU,EAAE,SAAS,MAAM,EAAE,EAC7B,EAAE,EAAE,YAAY,EAChB,IAAI,GAAE,qBAAsD,GAC3D,MAAM,GAAG,IAAI,CAoBf;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,GAAG,IAAI,CAIhF;AA4BD;;;;;;;;GAQG;AACH,wBAAsB,mBAAmB,CACvC,UAAU,EAAE,MAAM,EAClB,EAAE,EAAE,YAAY,EAChB,IAAI,GAAE,qBAAsD,GAC3D,OAAO,CAAC,OAAO,CAAC,CAiBlB"}
@@ -0,0 +1,263 @@
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/failed-verdict-review-exit-respawn-regression.test.ts,
3
+ // packages/daemon/src/verify/rework-attribution.test.ts,
4
+ // packages/daemon/src/verify/verification-rework-issue.test.ts
5
+ // PINNED-BY-END
6
+ /**
7
+ * Whose commits caused a failed gate verdict -- the delivery a rework Bug belongs on.
8
+ *
9
+ * Every delivery on a focus is judged on the same focus-branch HEAD, and one gate
10
+ * run's verdict is SHARED by all of them (verify/verification-commit-sharing.ts).
11
+ * Sharing the verdict is sound: the gate ran on one tree and would render the same
12
+ * answer for each. Fanning out the REWORK is not. A failed verdict used to become
13
+ * one rework Bug PER delivery sitting in verify -- measured on mars 2026-09-21
14
+ * 19:04-19:07, commit 03a511e12d00's single failed run filed three Bugs all titled
15
+ * `fix stage "lint:all > lint --prefix packages/daemon"`, two of them on deliveries
16
+ * the log itself recorded as taking the verdict with "no gate run". Each of those
17
+ * names a gate run its delivery never made, costs that delivery a verify_failed
18
+ * re-entry, and spends a review cycle out of the focus's arm budget
19
+ * (completion/review-cycle-cap.ts) on a delivery that carries no defect of its own.
20
+ *
21
+ * ONE branch-level red is ONE piece of open work. This module names its owner.
22
+ *
23
+ * THE RANGE. The suspects are the commits the failure could have come from: those
24
+ * between the newest ancestor this gate judged GREEN (verify/judged-ancestor.ts --
25
+ * the same bound the gate's own stages diff against) and the failed commit.
26
+ * Everything at or before the green ancestor was covered by a run that PASSED on a
27
+ * tree containing it. The gate that judged the failure is read off the failure's own
28
+ * recorded verdict, so no caller has to resolve it.
29
+ *
30
+ * THE OWNER. Each commit in that range is attributed by its `Telora-Delivery`
31
+ * trailer, through git's own trailer parse (resolvers/shared/review-window-commits.ts),
32
+ * the same read the verify gate partitions evidence with. A sentinel, an
33
+ * unattributed capture and a commit naming a delivery outside the focus own nothing.
34
+ *
35
+ * SEVERAL DELIVERIES MAY HAVE COMMITTED IN THAT RANGE, and one red is still one
36
+ * work item, so the range names ONE owner: the delivery of the NEWEST commit in it.
37
+ *
38
+ * SAY WHAT THAT IS AND IS NOT. It is the newest SUSPECT, not a proof of cause. The
39
+ * gate was GREEN at the base and the red is rendered at the tip, so every commit
40
+ * between them is a candidate and the newest is the last change that could have
41
+ * introduced it -- but nothing here reads the failing stage's output, so an older
42
+ * commit in the range may well be the culprit. What the rule buys is that the choice
43
+ * is DETERMINISTIC (git's own topological order, one read) and SINGLE. Two
44
+ * alternatives lost: the failing stage's own files would be a stronger ground, but a
45
+ * verdict records a stage NAME (`lint:all > lint --prefix packages/daemon`) and test
46
+ * ids, which do not resolve to files in general; and "every delivery in the range" is
47
+ * what this module exists to stop -- it re-creates the N-Bugs fan-out one bound later.
48
+ * Being wrong here costs one delivery a re-entry it did not earn, while the branch is
49
+ * red for all of them either way; being wrong by filing on all of them costs every
50
+ * delivery one, plus a review cycle each out of the arm's budget.
51
+ *
52
+ * EVERY PATH ENDS AT EXACTLY ONE OWNER, including the ones that know least. The
53
+ * acceptance rule is unconditional -- one failed verdict, one piece of open work --
54
+ * so "we could not attribute this" is not licence to fan out again. The ladder, in
55
+ * {@link selectReworkOwner} for a pass that knows its candidate set:
56
+ *
57
+ * 1. the newest commit in the range whose delivery is a candidate;
58
+ * 2. the delivery whose dispatch RAN the gate (CommitVerdict.judgedDeliveryId) --
59
+ * one delivery, and the one that actually paid for the run;
60
+ * 3. {@link unattributableOwner} of the candidates -- the lowest id, logged.
61
+ *
62
+ * Rung 3 is what makes the rule unconditional: an unreadable verdict, an unreadable
63
+ * range, a focus whose worktree the daemon no longer holds -- each still names one
64
+ * routable delivery, because a red must reach someone and every candidate is a
65
+ * delivery sitting in verify on the red branch. It is a PURE FUNCTION OF THE
66
+ * CANDIDATE SET, deliberately: an arbitrary owner is fine, an owner that depends on
67
+ * who asked first is not.
68
+ *
69
+ * A PASS THAT ASKS ONE DELIVERY AT A TIME (verify/verification-feedback.ts routes each
70
+ * dispatch separately) therefore asks the SAME question rather than a weaker one: it
71
+ * reads the focus's verify deliveries and applies rung 3 to that set, so every asker
72
+ * -- this delivery, its siblings, the next poll, the first poll after a daemon
73
+ * restart, and the per-focus filer acting on the same commit -- computes the same
74
+ * single owner. It used to keep a first-claim ledger in memory instead, which agreed
75
+ * with nothing after a restart and with the per-focus filer never. When the candidate
76
+ * read itself fails, NOBODY files this poll: the filing is left owed and retried from
77
+ * the commit's record (verify/verification-rework-issue.ts retryOwedReworkIssue)
78
+ * rather than guessed at, because a guess here is how one red becomes N Bugs.
79
+ *
80
+ * Direction of error: this module decides who is TOLD about a red, never whether the
81
+ * red gates. A delivery that shares a failed verdict still takes that verdict, still
82
+ * routes verify -> verify_failed, and still carries the failure on its gate_state.
83
+ * What it no longer carries is a work item describing a run it never made.
84
+ *
85
+ * WHAT THIS MODULE DOES NOT PROMISE. Its answer is a function of LIVE state -- the
86
+ * focus's deliveries currently in verify -- and that set moves as deliveries are
87
+ * routed, so the same failed commit can name a different owner at a later poll. That
88
+ * is deliberate: a red whose first-named owner has already moved on must still reach
89
+ * someone. It does mean "one red, one Bug" cannot rest on this module alone, and it
90
+ * does not: the filing dedupes per COMMIT across the whole focus
91
+ * (verify/verification-rework-issue.ts), so a re-selection RE-ROUTES a red rather
92
+ * than duplicating one.
93
+ *
94
+ * A leaf: git, the verdict record and the focus worktree map, nothing else.
95
+ *
96
+ * @module verify/rework-attribution
97
+ */
98
+ import { DELIVERY_STATUS } from '@telora/daemon-core';
99
+ import { getFocusWorktree } from '../focus/focus-worktree-state.js';
100
+ import { getFocusDeliveries } from '../queries/focuses.js';
101
+ import { listReviewWindowCommits } from '../resolvers/shared/review-window-commits.js';
102
+ import { findGreenAncestor } from './judged-ancestor.js';
103
+ import { readCommitVerdict } from './commit-verdict-record.js';
104
+ import { createLogger } from '../shell/log.js';
105
+ const log = createLogger({ module: 'verification' });
106
+ export const defaultReworkAttributionDeps = () => ({
107
+ resolveWorktreePath: (focusId) => getFocusWorktree(focusId)?.worktreePath ?? null,
108
+ readCommitVerdict: (productId, focusId, sha, gate) => readCommitVerdict(productId, focusId, sha, gate ? { gate } : {}),
109
+ findGreenAncestor,
110
+ listWindow: (worktreePath, base, tip) => listReviewWindowCommits(worktreePath, base, tip),
111
+ listVerifyCandidates: async (focusId) => (await getFocusDeliveries(focusId))
112
+ .filter((d) => d.executionStatus === DELIVERY_STATUS.VERIFY)
113
+ .map((d) => d.id),
114
+ });
115
+ /**
116
+ * Who a failed verdict belongs to (module doc), or null when its verdict cannot be
117
+ * read -- the one answer that means "cannot tell". Never throws.
118
+ */
119
+ export function resolveFailureOwnership(at, deps = defaultReworkAttributionDeps()) {
120
+ let verdict;
121
+ try {
122
+ verdict = deps.readCommitVerdict(at.productId, at.focusId, at.sha);
123
+ }
124
+ catch {
125
+ return null;
126
+ }
127
+ if (!verdict || verdict.outcome !== 'failed')
128
+ return null;
129
+ const causing = readCausingSet(at, verdict.gate, deps);
130
+ const newestFirst = causing ?? [];
131
+ return {
132
+ causingDeliveryIds: new Set(newestFirst),
133
+ causingNewestFirst: newestFirst,
134
+ judgedDeliveryId: verdict.judgedDeliveryId,
135
+ // ONE red, ONE work item: the newest commit in the range names the owner.
136
+ owningDeliveryId: newestFirst[0] ?? verdict.judgedDeliveryId,
137
+ rangeRead: causing !== null,
138
+ };
139
+ }
140
+ /**
141
+ * The ONE delivery a failed verdict's rework belongs on, chosen from the
142
+ * `candidates` a filing pass would otherwise fan out over (module doc). Null means
143
+ * "cannot tell" -- the verdict itself was unreadable or is not a failure -- and the
144
+ * caller files as it did before. Never throws.
145
+ */
146
+ export function selectReworkOwner(candidates, at, deps = defaultReworkAttributionDeps()) {
147
+ const fallback = unattributableOwner(candidates);
148
+ // Nobody to tell: this pass has no verify delivery to carry the red.
149
+ if (fallback === null)
150
+ return null;
151
+ const eligible = new Set(candidates);
152
+ const ownership = resolveFailureOwnership(at, deps);
153
+ if (ownership !== null) {
154
+ // Rung 1 -- the newest suspect this pass can actually tell.
155
+ const attributed = ownership.causingNewestFirst.find((id) => eligible.has(id));
156
+ if (attributed !== undefined)
157
+ return attributed;
158
+ // Rung 2 -- the delivery that paid for the run.
159
+ if (eligible.has(ownership.judgedDeliveryId))
160
+ return ownership.judgedDeliveryId;
161
+ }
162
+ // Rung 3 -- unattributable, and still ONE owner: the rule does not relax here.
163
+ log.info(`[verification] rework issue: the failed verdict for ${at.sha.slice(0, 12)} could not be attributed`
164
+ + `${ownership === null ? ' (its verdict was unreadable)' : ` to a delivery this pass can tell (owner: ${ownership.owningDeliveryId})`}`
165
+ + ` -- it is carried by ${fallback} alone, not by every delivery on the red branch`);
166
+ return fallback;
167
+ }
168
+ /**
169
+ * Rung 3: the owner of a failure NOTHING attributes, over the candidates that could
170
+ * carry it. The lowest id -- arbitrary on purpose, and a pure function of the set, so
171
+ * a sibling, a later poll, a restarted daemon and the per-focus filer all name the
172
+ * same one delivery. Null only when there is no candidate at all.
173
+ */
174
+ export function unattributableOwner(candidates) {
175
+ let lowest = null;
176
+ for (const id of candidates)
177
+ if (lowest === null || id < lowest)
178
+ lowest = id;
179
+ return lowest;
180
+ }
181
+ /** The deliveries with a trailered commit in greenAncestor..failedSha, NEWEST FIRST; null when the range is unreadable. */
182
+ function readCausingSet(at, gate, deps) {
183
+ try {
184
+ const worktreePath = deps.resolveWorktreePath(at.focusId);
185
+ if (worktreePath === null)
186
+ return null;
187
+ const base = deps.findGreenAncestor(at.productId, at.focusId, at.sha, gate, {
188
+ worktreePath,
189
+ readCommitVerdict: (productId, focusId, sha, g) => deps.readCommitVerdict(productId, focusId, sha, g),
190
+ });
191
+ // No green ancestor in reach: nothing bounds the suspects, so the range says nothing.
192
+ if (base === null)
193
+ return null;
194
+ const commits = deps.listWindow(worktreePath, base, at.sha);
195
+ if (commits === null)
196
+ return null;
197
+ // listReviewWindowCommits answers newest first; the order IS the ranking.
198
+ const causing = [];
199
+ for (const c of commits) {
200
+ if (c.attribution.kind === 'delivery' && !causing.includes(c.attribution.deliveryId)) {
201
+ causing.push(c.attribution.deliveryId);
202
+ }
203
+ }
204
+ return causing;
205
+ }
206
+ catch {
207
+ return null;
208
+ }
209
+ }
210
+ /**
211
+ * Whether the rework Bug for `failedSha` belongs on `deliveryId` (module doc): it is
212
+ * the ONE owner the range names -- the delivery of the newest commit in it, or, with
213
+ * nothing attributable there, the delivery whose dispatch ran the gate. An unreadable
214
+ * verdict names no owner from the commit, so the question is asked of the FOCUS
215
+ * instead: the candidate set settles it by rung 3, identically for every asker and
216
+ * across a restart. A candidate read that fails files nothing this poll (the retry
217
+ * owns that case). Never throws.
218
+ */
219
+ export async function deliveryOwnsFailure(deliveryId, at, deps = defaultReworkAttributionDeps()) {
220
+ const ownership = resolveFailureOwnership(at, deps);
221
+ if (ownership === null)
222
+ return await ownsUnattributable(deliveryId, at, deps);
223
+ const owns = deliveryId === ownership.owningDeliveryId;
224
+ if (!owns) {
225
+ const why = ownership.causingNewestFirst.length > 0
226
+ ? `the newest commit in the judged range is ${ownership.owningDeliveryId}'s`
227
+ : `${ownership.rangeRead ? 'no delivery\'s commits explain it' : 'it could not be attributed'}, so it stays with the `
228
+ + `delivery whose run rendered it (${ownership.judgedDeliveryId})`;
229
+ const alsoIn = ownership.causingNewestFirst.filter((id) => id !== ownership.owningDeliveryId);
230
+ log.info(`[verification] rework issue: delivery ${deliveryId} shares the failed verdict for ${at.sha.slice(0, 12)} but does not `
231
+ + `carry it -- ${why}`
232
+ + (alsoIn.length > 0 ? ` (also committed in that range: ${alsoIn.join(', ')})` : ''));
233
+ }
234
+ return owns;
235
+ }
236
+ /**
237
+ * Rung 3 for a caller holding ONE delivery: read the focus's candidates and settle the
238
+ * failure over them, so the answer is the set's, not the asker's (module doc). A read
239
+ * that fails, or that does not list this delivery, DECLINES -- one poll of nobody,
240
+ * which retryOwedReworkIssue retries -- rather than letting a sibling reading a
241
+ * different set assume it owns the red too.
242
+ */
243
+ async function ownsUnattributable(deliveryId, at, deps) {
244
+ let candidates;
245
+ try {
246
+ candidates = await deps.listVerifyCandidates(at.focusId);
247
+ }
248
+ catch (err) {
249
+ log.warn(`[verification] rework issue: the failed verdict for ${at.sha.slice(0, 12)} is unattributable and the focus's verify `
250
+ + `deliveries could not be read -- ${deliveryId} files nothing this poll (the owed filing is retried):`, err.message);
251
+ return false;
252
+ }
253
+ const owner = unattributableOwner(candidates);
254
+ if (owner !== deliveryId) {
255
+ log.info(`[verification] rework issue: delivery ${deliveryId} shares the failed verdict for ${at.sha.slice(0, 12)}, which `
256
+ + `nothing attributes -- the focus's verify set settles it on ${owner}`);
257
+ return false;
258
+ }
259
+ log.info(`[verification] rework issue: the failed verdict for ${at.sha.slice(0, 12)} is unattributable -- of the focus's verify `
260
+ + `deliveries (${candidates.join(', ')}) it is carried by ${deliveryId} alone`);
261
+ return true;
262
+ }
263
+ //# sourceMappingURL=rework-attribution.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rework-attribution.js","sourceRoot":"","sources":["../../src/verify/rework-attribution.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zC,CAAC,EAAE,IAAI,CAAC,mBAAmB,EAAE,YAAY,GAAG,cAAc,CAAC,EAC3D,UAAU,EAAE;IAAE,YAAY,EAAE,SAAS,iBAAiB,EAAE,CAAC;IAAC,UAAU,EAAE,SAAS,eAAe,EAAE,CAAA;CAAE,EAClG,IAAI,EAAE,sBAAsB,GAAG,SAAS,GACvC,OAAO,CAAC,mBAAmB,CAAC,CA0C9B;AAED,yGAAyG;AACzG,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,aAAa,EAAE,GAAG,MAAM,CAK9F;AAMD,4CAA4C;AAC5C,KAAK,eAAe,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,OAAO,kBAAkB,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,IAAI,GAAG,MAAM,GAAG,iBAAiB,GAAG,WAAW,GAAG,oBAAoB,CAAC,CAAC;AAK5J;;;;GAIG;AACH,wBAAsB,wBAAwB,CAC5C,UAAU,EAAE,SAAS,eAAe,EAAE,EACtC,IAAI,EAAE,sBAAsB,GAC3B,OAAO,CAAC,MAAM,EAAE,CAAC,CAuBnB;AAED;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,CAAC,SAAS;IAAE,kBAAkB,EAAE,OAAO,kBAAkB,CAAC;IAAC,oBAAoB,CAAC,EAAE,sBAAsB,CAAA;CAAE,EAAE,IAAI,EAAE,CAAC,GAAG,CAAC,CAS/J;AAED,wDAAwD;AACxD,wBAAgB,mCAAmC,IAAI,IAAI,CAE1D"}
@@ -1,10 +1,11 @@
1
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/shortfall-ruling-disposes-proposals-regression.test.ts,
2
+ // Pinned by: packages/daemon/src/integration/held-route-pull-dispatch.test.ts,
3
+ // packages/daemon/src/integration/shortfall-ruling-disposes-proposals-regression.test.ts,
3
4
  // packages/daemon/src/integration/shortfall-ruling-release.test.ts,
4
5
  // packages/daemon/src/verify/shortfall-rulings.test.ts
5
6
  // PINNED-BY-END
6
7
  import { isShortfallParkReleased, shortfallParkRefusingRework } from './shortfall-park.js';
7
- import { releaseDefaultOnMark } from './verification-default-on.js';
8
+ import { releaseDefaultOnMark } from './default-on-guards.js';
8
9
  import { isGateRunSelected } from './gate-run-registry.js';
9
10
  import { createLogger } from '../shell/log.js';
10
11
  const log = createLogger({ module: 'verification' });
@@ -1 +1 @@
1
- {"version":3,"file":"shortfall-rulings.js","sourceRoot":"","sources":["../../src/verify/shortfall-rulings.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,qGAAqG;AACrG,sEAAsE;AACtE,yDAAyD;AACzD,gBAAgB;AA8DhB,OAAO,EAAE,uBAAuB,EAAE,2BAA2B,EAAE,MAAM,qBAAqB,CAAC;AAC3F,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,MAAM,GAAG,GAAG,YAAY,CAAC,EAAE,MAAM,EAAE,cAAc,EAAE,CAAC,CAAC;AAqBrD;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,qBAAqB,CACzC,CAA2D,EAC3D,UAAkG,EAClG,IAAwC;IAExC,MAAM,OAAO,GAAwB;QACnC,YAAY,EAAE,CAAC,GAAG,UAAU,CAAC,YAAY,CAAC;QAC1C,UAAU,EAAE,CAAC,GAAG,UAAU,CAAC,UAAU,CAAC;QACtC,kBAAkB,EAAE,IAAI;QACxB,eAAe,EAAE,EAAE;QACnB,OAAO,EAAE,EAAE;KACZ,CAAC;IACF,IAAI,UAAU,CAAC,UAAU,CAAC,MAAM,KAAK,CAAC,IAAI,CAAC,IAAI;QAAE,OAAO,OAAO,CAAC;IAChE,IAAI,OAAiC,CAAC;IACtC,IAAI,CAAC;QACH,OAAO,GA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EAAE,SAAS,EAAE,IAAI,EAAE,kBAAkB,EAAE,WAAW,EAAE,CAAC,IAAI,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,WAAW;YAAE,SAAS;QAC1I,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,WAAW,CAAC,CAAC;QACjC,oBAAoB,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;QAC3B,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;QACnB,GAAG,CAAC,IAAI,CACN,yDAAyD,CAAC,CAAC,IAAI,MAAM,CAAC,CAAC,EAAE,mCAAmC;cAC1G,yDAAyD,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,wBAAwB,CAC3G,CAAC;IACJ,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,wBAAwB,CAA6G,IAAO;IAC1J,MAAM,IAAI,GAAG,IAAI,CAAC,oBAAoB,CAAC;IACvC,IAAI,CAAC,IAAI;QAAE,OAAO,IAAI,CAAC;IACvB,MAAM,0BAA0B,GAA8B,KAAK,EAAE,OAAO,EAAE,EAAE;QAC9E,MAAM,UAAU,GAAG,MAAM,IAAI,CAAC,kBAAkB,CAAC,OAAO,CAAC,CAAC;QAC1D,MAAM,wBAAwB,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;QACjD,OAAO,UAAU,CAAC;IACpB,CAAC,CAAC;IACF,OAAO,EAAE,GAAG,IAAI,EAAE,kBAAkB,EAAE,0BAA0B,EAAE,CAAC;AACrE,CAAC;AAED,wDAAwD;AACxD,MAAM,UAAU,mCAAmC;IACjD,SAAS,CAAC,KAAK,EAAE,CAAC;AACpB,CAAC"}
@@ -1,15 +1,62 @@
1
1
  /**
2
2
  * The verify BOUNDARY the daemon resolves before a deterministic run and hands
3
- * to the command as environment, so the command's targeted-test selector diffs
4
- * against the delivery's recorded PRE-MERGE BOUNDARY rather than
5
- * merge-base(HEAD, integration).
3
+ * to the command as environment, so the gate's own stages diff against the
4
+ * commits in front of the gate rather than against merge-base(HEAD, integration).
6
5
  *
7
- * On a merged-back delivery that merge-base equals HEAD: the changed-file set is
8
- * empty and the gate passes as a "clean no-op" having run none of the delivery's
9
- * own tests. Handing the recorded boundary makes the selection see the
10
- * delivery's real changes. A delivery still on its branch has no recorded
11
- * boundary, so nothing is handed and the selector's merge-base auto-derivation
12
- * is used unchanged.
6
+ * ONE env var, TWO concerns, and they combine by taking the OLDER base.
7
+ *
8
+ * 1. The recorded PRE-MERGE BOUNDARY (a floor). On a merged-back delivery
9
+ * merge-base(HEAD, integration) equals HEAD: the changed-file set is empty and
10
+ * the gate passes as a "clean no-op" having run none of the delivery's own
11
+ * tests. Handing the recorded boundary makes the selection see the delivery's
12
+ * real changes, and the recorded commit count rides with it so the selector can
13
+ * FAIL rather than no-op on an empty diff (the laundered-pass guard).
14
+ *
15
+ * 2. The newest GREEN ANCESTOR (a ceiling on how far back to look). Both
16
+ * expensive stages of verify:gate -- the conditional check:types-drift and the
17
+ * test:targeted selection -- scope themselves from this base, so taking it from
18
+ * merge-base(HEAD, integration) makes it the branch's CUMULATIVE delta, which
19
+ * only grows: every area eventually crosses the "no precise pin map" line and
20
+ * widens to its whole suite. Measured on mars 2026-09-20, one delivery: 76
21
+ * files/22 min, 102/42, 101/28, 115/30, against 5 min for an empty delta.
22
+ * Everything up to a commit this gate judged PASSING was covered by that run,
23
+ * so the delta from there is what no green gate has covered
24
+ * (verify/judged-ancestor.ts).
25
+ *
26
+ * WHY NOT THE JUDGED DELIVERY'S OWN COMMITS, which is the narrower base the
27
+ * delivery's acceptance criteria name. A gate run's verdict belongs to the
28
+ * COMMIT, not to the delivery that happened to trigger it: it is written once per
29
+ * (product, focus, sha, gate) and TAKEN by every delivery judged on that commit
30
+ * with no second run (verify/verification-commit-sharing.ts) -- the saving this
31
+ * focus exists to make. Basing the selection on the judged delivery's own
32
+ * Telora-Delivery commits would therefore mean a sibling's intervening commit is
33
+ * selected by NO run: the sibling's own dispatch takes the recorded verdict
34
+ * instead of running, so its changed files would reach integration judged by
35
+ * nothing. Restoring the cover would cost one run per delivery per commit, which
36
+ * is the 5.7h/day this focus removed. So the range stays the union -- every
37
+ * commit since the last green -- and it is the right one: those commits ARE the
38
+ * work in front of the gate, and no green gate has covered them.
39
+ *
40
+ * What that leaves is a cost question, not a coverage one, and it is bounded by
41
+ * the green ancestor: a sibling's commit adds only its own changed files, and
42
+ * only until the next passing verdict anchors a newer base. The OTHER half of
43
+ * the concern -- that a delivery is told to fix a red its commits did not cause
44
+ * -- is real and is answered where it belongs, by naming the owner of the
45
+ * failure rather than by narrowing what the gate reads
46
+ * (verify/rework-attribution.ts).
47
+ *
48
+ * WHY THE OLDER WINS when both resolve: it is never fewer files than either
49
+ * concern requires. A green ancestor NEWER than the pre-merge boundary would put
50
+ * the delivery's own recorded commits behind the base, empty the diff, and fire
51
+ * the laundered-pass guard on honest work. Older by ANCESTRY, never by date --
52
+ * every coding spawn rebases the focus worktree, so commit dates are shuffled
53
+ * relative to branch order. An undetermined comparison hands the pre-merge
54
+ * boundary: that is the base whose absence causes a laundered pass rather than
55
+ * merely a slow run.
56
+ *
57
+ * Every resolution failure falls back to what was handed before it, and handing
58
+ * nothing leaves the selector's own merge-base auto-derivation unchanged. A base
59
+ * that is too old costs time; one that is too new launders a pass.
13
60
  *
14
61
  * Sliced out of verification-engine.ts to keep that file under the daemon
15
62
  * 800-line limit; the engine's STRATEGIES dispatch calls resolveVerifyBoundaryEnv
@@ -25,8 +72,13 @@ import type { VerificationDeps } from './verification-deps.js';
25
72
  * TELORA_VERIFY_BASE_REF the recorded pre-merge boundary ref.
26
73
  * TELORA_VERIFY_RECORDED_COMMIT_COUNT the delivery's own recorded commit count,
27
74
  * so the selector can FAIL (never no-op)
28
- * when the diff against the handed base is
29
- * empty yet the delivery recorded commits.
75
+ * when the handed base..HEAD range is too
76
+ * SHORT to hold the delivery's recorded
77
+ * commits. The selector compares commits,
78
+ * not paths: a path count is perturbed by
79
+ * untracked files in the checkout, and a
80
+ * docs-only delivery legitimately selects
81
+ * no test at all.
30
82
  *
31
83
  * Consumed by scripts/select-targeted-tests.mjs (mirrored there by string, as
32
84
  * that script cannot import this TS); pinned together by
@@ -36,12 +88,13 @@ export declare const VERIFY_BASE_REF_ENV = "TELORA_VERIFY_BASE_REF";
36
88
  export declare const VERIFY_RECORDED_COMMIT_COUNT_ENV = "TELORA_VERIFY_RECORDED_COMMIT_COUNT";
37
89
  /**
38
90
  * Resolve the verify boundary env for the deterministic command, BEFORE the run.
39
- * Best-effort: a resolution failure or an unmerged delivery (no recorded
40
- * boundary) yields {} so the command inherits the process env and the selector's
41
- * merge-base auto-derivation is used unchanged. Only when a recorded pre-merge
42
- * boundary exists is a base handed -- alongside the delivery's own recorded
43
- * commit count, so the selector can distinguish an honest empty diff (no
44
- * recorded commits) from a laundered no-op (recorded commits, empty diff).
91
+ * Best-effort: every resolution failure narrows nothing, so the command inherits
92
+ * the process env and the selector's merge-base auto-derivation is used
93
+ * unchanged. A recorded pre-merge boundary is handed alongside the delivery's own
94
+ * recorded commit count, so the selector can distinguish an honest empty diff (no
95
+ * recorded commits) from a laundered no-op (recorded commits, empty diff); the
96
+ * count rides with the boundary and only with it, so that guard's precondition is
97
+ * exactly what it was.
45
98
  *
46
99
  * The FAST-FORWARD merge-back case (no merge commit) resolves its boundary from
47
100
  * the recorded pre-merge ref (deps.resolveRecordedPreMergeRef is the
@@ -1 +1 @@
1
- {"version":3,"file":"verification-boundary-env.d.ts","sourceRoot":"","sources":["../../src/verify/verification-boundary-env.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAK/D;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,mBAAmB,2BAA2B,CAAC;AAC5D,eAAO,MAAM,gCAAgC,wCAAwC,CAAC;AAEtF;;;;;;;;;;;;GAYG;AACH,wBAAsB,wBAAwB,CAC5C,IAAI,EAAE,gBAAgB,EACtB,CAAC,EAAE,mBAAmB,GACrB,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAgCjC"}
1
+ {"version":3,"file":"verification-boundary-env.d.ts","sourceRoot":"","sources":["../../src/verify/verification-boundary-env.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiEG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAO/D;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,mBAAmB,2BAA2B,CAAC;AAC5D,eAAO,MAAM,gCAAgC,wCAAwC,CAAC;AAwDtF;;;;;;;;;;;;;GAaG;AACH,wBAAsB,wBAAwB,CAC5C,IAAI,EAAE,gBAAgB,EACtB,CAAC,EAAE,mBAAmB,GACrB,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CA2CjC"}