@attalabs/vinaya 0.36.0 → 0.38.0

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 (292) hide show
  1. package/README.md +6 -6
  2. package/aeg-root/contracts/developer-reviewer.md +1 -1
  3. package/aeg-root/contracts/planner-operator.md +1 -1
  4. package/aeg-root/contracts/principal-operator.md +6 -6
  5. package/aeg-root/contracts/security-archivist.md +1 -1
  6. package/aeg-root/enforcement.md +14 -14
  7. package/aeg-root/process.md +3 -1
  8. package/aeg-root/roles/archivist.md +2 -2
  9. package/aeg-root/roles/developer/reference.md +36 -37
  10. package/aeg-root/roles/developer.md +9 -5
  11. package/aeg-root/roles/operator.md +18 -18
  12. package/aeg-root/roles/planner/reference.md +15 -4
  13. package/aeg-root/roles/principal.md +6 -1
  14. package/aeg-root/roles/reviewer.md +14 -6
  15. package/aeg-root/roles/security.md +22 -11
  16. package/aeg-root/roles/tranche-archivist.md +14 -2
  17. package/aeg-root/state-machine.md +12 -11
  18. package/aeg-root/templates/brief-template.md +8 -6
  19. package/aeg-root/templates/pr-report-template.md +1 -9
  20. package/aeg-root/tranche-model.md +10 -4
  21. package/dist/checks/bin/check-body-bare-digits.js +823 -595
  22. package/dist/checks/bin/check-branch-topology.js +796 -478
  23. package/dist/checks/bin/check-brief-shape.js +824 -596
  24. package/dist/checks/bin/check-changeset-coverage.js +1337 -747
  25. package/dist/checks/bin/check-closes-n.js +796 -478
  26. package/dist/checks/bin/check-coherence.js +914 -611
  27. package/dist/checks/bin/check-dead-branch-push.js +705 -462
  28. package/dist/checks/bin/check-dispatch-readiness.js +941 -624
  29. package/dist/checks/bin/check-doc-coverage-push.js +1332 -742
  30. package/dist/checks/bin/check-doc-coverage.js +1339 -742
  31. package/dist/checks/bin/check-doctrine-no-procedures.js +821 -593
  32. package/dist/checks/bin/check-doctrine-portability.js +1332 -742
  33. package/dist/checks/bin/check-evidence-fresh.js +1339 -918
  34. package/dist/checks/bin/check-exec-bits.js +1331 -741
  35. package/dist/checks/bin/check-first-push-dispatch.js +917 -614
  36. package/dist/checks/bin/check-issue-assignment.js +796 -478
  37. package/dist/checks/bin/check-issue-milestone-attach.js +705 -462
  38. package/dist/checks/bin/check-issue-objectives-numbering.js +821 -593
  39. package/dist/checks/bin/check-issue-parts-coverage.js +705 -462
  40. package/dist/checks/bin/check-issue-surface-globs.js +925 -613
  41. package/dist/checks/bin/check-issue-title-grammar.js +705 -462
  42. package/dist/checks/bin/check-issue-tranche-label.js +705 -462
  43. package/dist/checks/bin/check-main-branch-refusal.js +705 -462
  44. package/dist/checks/bin/check-no-disk-state.js +705 -462
  45. package/dist/checks/bin/check-pr-premise-reassert.js +821 -593
  46. package/dist/checks/bin/check-pr-report-density.js +705 -462
  47. package/dist/checks/bin/check-principal-test-plan-wait.js +705 -462
  48. package/dist/checks/bin/check-quoted-command.js +1816 -1228
  49. package/dist/checks/bin/check-reader-resolvable-prose.js +1835 -1235
  50. package/dist/checks/bin/check-registry-gates.js +993 -526
  51. package/dist/checks/bin/check-retired-vocabulary.js +1810 -1222
  52. package/dist/checks/bin/check-review-gate.js +832 -604
  53. package/dist/checks/bin/check-single-plan-pr.js +705 -462
  54. package/dist/checks/bin/check-surface-scope.js +796 -478
  55. package/dist/checks/bin/check-test-plan.js +705 -462
  56. package/dist/checks/bin/check-token-collection-wired.js +705 -462
  57. package/dist/checks/bin/check-workspace-escape.js +1332 -742
  58. package/dist/checks/bin/verify-dispatch.js +3849 -0
  59. package/dist/index.js +20876 -10091
  60. package/dist/lib/pre-push-cache-test-run.js +1045 -682
  61. package/dist/lib/pre-push-changed-files.js +16 -11
  62. package/dist/lib/pre-push-select-tests.js +785 -500
  63. package/package.json +2 -2
  64. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/anchored-region.ts +7 -6
  65. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/brief-render.ts +71 -15
  66. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/brief-validation.ts +51 -12
  67. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/control-store/index.ts +1 -0
  68. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/control-store/local.ts +31 -0
  69. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/control-store/records.ts +50 -2
  70. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/assess-round.ts +443 -28
  71. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/fakes.ts +18 -5
  72. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/index.ts +6 -4
  73. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/journal-reconstruction.ts +13 -13
  74. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/render-summary.ts +46 -110
  75. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/types.ts +169 -11
  76. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/doc-claim.ts +32 -6
  77. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/docs/index.ts +3 -1
  78. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/docs/published-prose.ts +30 -0
  79. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/doctrine-portability.ts +6 -2
  80. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/gate-audience.ts +0 -1
  81. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/index.ts +82 -8
  82. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/issue-validation.ts +754 -7
  83. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/leftover-detection.ts +24 -6
  84. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/custom.ts +157 -0
  85. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/envelope.ts +44 -6
  86. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/fixtures/executions.ts +493 -0
  87. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/fixtures/fact-sheets.ts +111 -0
  88. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/fixtures/generator.ts +155 -0
  89. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/fixtures/index.ts +12 -0
  90. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/index.ts +128 -0
  91. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/questions/catches.ts +63 -0
  92. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/questions/checks.ts +146 -0
  93. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/questions/common.ts +137 -0
  94. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/questions/completion.ts +137 -0
  95. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/questions/convergence.ts +420 -0
  96. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/questions/determinism.ts +65 -0
  97. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/questions/index.ts +69 -0
  98. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/questions/judgment.ts +132 -0
  99. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/questions/labels.ts +21 -0
  100. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/questions/time.ts +167 -0
  101. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/questions/usage.ts +139 -0
  102. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/schema.ts +226 -15
  103. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/store.ts +7 -7
  104. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/sync/cache-contract.ts +207 -0
  105. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/sync/contracts.ts +105 -0
  106. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/sync/engine.ts +308 -0
  107. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/sync/index.ts +34 -0
  108. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/sync/measured.ts +20 -0
  109. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/sync/memory-cache.ts +78 -0
  110. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/sync/normalize.ts +156 -0
  111. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/sync/row.ts +103 -0
  112. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/reader-resolvable-prose.ts +34 -6
  113. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/registry-checks.ts +70 -6
  114. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/review-gate.ts +52 -4
  115. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/review-input-manifest.ts +19 -14
  116. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/review-policy.ts +201 -24
  117. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/review-status.ts +5 -2
  118. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/task-phase-history.ts +46 -0
  119. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/task-tools.ts +15 -28
  120. package/studio-standalone/apps/vinaya-studio/web/.next/BUILD_ID +1 -1
  121. package/studio-standalone/apps/vinaya-studio/web/.next/app-path-routes-manifest.json +0 -1
  122. package/studio-standalone/apps/vinaya-studio/web/.next/build-manifest.json +3 -3
  123. package/studio-standalone/apps/vinaya-studio/web/.next/prerender-manifest.json +3 -3
  124. package/studio-standalone/apps/vinaya-studio/web/.next/required-server-files.json +0 -5
  125. package/studio-standalone/apps/vinaya-studio/web/.next/routes-manifest.json +0 -6
  126. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error/page.js +1 -1
  127. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error/page.js.nft.json +1 -1
  128. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  129. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.html +1 -1
  130. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.rsc +1 -1
  131. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  132. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  133. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  134. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  135. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  136. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_not-found/page/server-reference-manifest.json +2 -2
  137. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_not-found/page.js +1 -1
  138. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_not-found/page.js.nft.json +1 -1
  139. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  140. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/page/server-reference-manifest.json +2 -2
  141. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/page.js +1 -1
  142. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/page.js.nft.json +1 -1
  143. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/page_client-reference-manifest.js +1 -1
  144. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/backlog/page/server-reference-manifest.json +2 -2
  145. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/backlog/page.js +3 -3
  146. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/backlog/page.js.nft.json +1 -1
  147. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/backlog/page_client-reference-manifest.js +1 -1
  148. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/page/server-reference-manifest.json +2 -2
  149. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/page.js +3 -3
  150. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/page.js.nft.json +1 -1
  151. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/page_client-reference-manifest.js +1 -1
  152. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/page/server-reference-manifest.json +2 -2
  153. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/page.js +3 -3
  154. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/page.js.nft.json +1 -1
  155. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/page_client-reference-manifest.js +1 -1
  156. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/page/server-reference-manifest.json +3 -3
  157. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/page.js +5 -5
  158. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/page.js.nft.json +1 -1
  159. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/page_client-reference-manifest.js +1 -1
  160. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/tasks/[taskId]/page/server-reference-manifest.json +2 -2
  161. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/tasks/[taskId]/page.js +3 -3
  162. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/tasks/[taskId]/page.js.nft.json +1 -1
  163. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/tasks/[taskId]/page_client-reference-manifest.js +1 -1
  164. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/page/server-reference-manifest.json +2 -2
  165. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/page.js +3 -3
  166. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/page.js.nft.json +1 -1
  167. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/page_client-reference-manifest.js +1 -1
  168. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/tranches/page/server-reference-manifest.json +2 -2
  169. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/tranches/page.js +3 -3
  170. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/tranches/page.js.nft.json +1 -1
  171. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/tranches/page_client-reference-manifest.js +1 -1
  172. package/studio-standalone/apps/vinaya-studio/web/.next/server/app-paths-manifest.json +0 -1
  173. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/044u_vinaya-studio_web_src_app_studio_backlog__components_BacklogTable_tsx_0oha0bt._.js +3 -0
  174. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/1q96_modules_@clerk_nextjs_dist_esm_app-router_client_keyless-creator-reader_0lom2js.js +1 -1
  175. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/{[root-of-the-server]__1bh2awk._.js → [root-of-the-server]__038scsm._.js} +2 -2
  176. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/{[root-of-the-server]__1widio3._.js → [root-of-the-server]__03__s45._.js} +2 -2
  177. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/{_15gdg48._.js → [root-of-the-server]__04adkz-._.js} +3 -3
  178. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__05zwn98._.js +14 -0
  179. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__08e39jo._.js +3 -0
  180. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__0h9yhwx._.js +1 -1
  181. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/{[root-of-the-server]__1wy7w66._.js → [root-of-the-server]__0jdjsxe._.js} +2 -2
  182. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__0ls23oh._.js +1 -1
  183. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__10riywf._.js +3 -0
  184. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/{[root-of-the-server]__13znegp._.js → [root-of-the-server]__134x-65._.js} +2 -2
  185. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/{[root-of-the-server]__13eeix2._.js → [root-of-the-server]__1_l_l1u._.js} +2 -2
  186. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__1f4bb3_._.js +3 -0
  187. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__1gjqmhq._.js +1 -1
  188. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/{[root-of-the-server]__1dky4g0._.js → [root-of-the-server]__1my83lt._.js} +2 -2
  189. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__1ng2x88._.js +3 -0
  190. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/{[root-of-the-server]__040smoa._.js → [root-of-the-server]__1qpc6at._.js} +2 -2
  191. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__1snpgaw._.js +56 -0
  192. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__1wc4-ip._.js +2 -2
  193. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_06h3wbl._.js +3 -0
  194. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_08onyya._.js +1 -1
  195. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_096f46i._.js +1 -1
  196. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0af2one._.js +1 -1
  197. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0e5tkdd._.js +1 -1
  198. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0gs4gvl._.js +3 -0
  199. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0kf2g72._.js +1 -1
  200. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0zf4d27._.js +1 -1
  201. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_1-wo68i._.js +1 -1
  202. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_121lrn5._.js +3 -0
  203. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_1achbh9._.js +1 -1
  204. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_1o4v6lb._.js +3 -0
  205. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_1q7h5mz._.js +1 -1
  206. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_1ztd4i3._.js +3 -0
  207. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_209-ugd._.js +3 -0
  208. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_214d71c._.js +3 -0
  209. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/apps_vinaya-studio_web_src_app_studio_projects_[name]_tranches_[slug]_17dho0f._.js +3 -0
  210. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/node_modules_@clerk_nextjs_dist_esm_app-router_server-actions_1x7vfhn.js +2 -2
  211. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/node_modules_next_dist_1lzmr5o._.js +1 -1
  212. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/packages_ui_libraries_animate_components_index_ts_186fje1._.js +1 -1
  213. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/packages_ui_libraries_basic_components_index_ts_0xk1vda._.js +1 -1
  214. package/studio-standalone/apps/vinaya-studio/web/.next/server/middleware-build-manifest.js +3 -3
  215. package/studio-standalone/apps/vinaya-studio/web/.next/server/pages/500.html +1 -1
  216. package/studio-standalone/apps/vinaya-studio/web/.next/server/server-reference-manifest.js +1 -1
  217. package/studio-standalone/apps/vinaya-studio/web/.next/server/server-reference-manifest.json +4 -4
  218. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/09fcolor69bun.js +1 -0
  219. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/0lcwmwzxacdie.js +1 -0
  220. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/0ojry7lrbzkfd.css +1 -0
  221. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/1-acpmtfmrc35.js +1 -0
  222. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/1giu47hrbhroj.js +1 -0
  223. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/1shz6lwruld25.js +1 -0
  224. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/1ytvuy1mmnc6j.js +1 -0
  225. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/{3oxhhhm_psozq.js → 21a6_5cr956wj.js} +1 -1
  226. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/{2o9l0b7eqbr57.js → 2f2y8xxok8zph.js} +1 -1
  227. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/2g8mwnydod96u.js +1 -0
  228. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/{3li0ueedy-ozv.js → 2nrnuawd5fwpv.js} +1 -1
  229. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/2nw47832_uvfe.js +1 -0
  230. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/2qdxnj8wk2h0s.js +1 -0
  231. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/{3lqjwjrcvq481.js → 2xevgia1h8g0y.js} +2 -2
  232. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/3b9q75p-z5ma5.js +1 -0
  233. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/3cv-oe7153242.js +1 -0
  234. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/3m310lbjj4p5u.js +1 -0
  235. package/studio-standalone/apps/vinaya-studio/web/package.json +2 -2
  236. package/studio-standalone/apps/vinaya-studio/web/server.js +1 -1
  237. package/dist/checks/bin/check-token-report.js +0 -6526
  238. package/studio-standalone/_node_modules/@attalabs/vinaya/studio-standalone/_node_modules/@attalabs/vinaya/studio-standalone/_node_modules/@attalabs/vinaya/studio-standalone/_node_modules/@attalabs/vinaya/studio-standalone/_node_modules/@attalabs/vinaya/studio-standalone/_node_modules/@attalabs/vinaya/studio-standalone/_node_modules/@attalabs/vinaya/studio-standalone/_node_modules/@attalabs/vinaya/studio-standalone/_node_modules/@attalabs/aeg-core/bin/verify-coherence.ts +0 -1089
  239. package/studio-standalone/_node_modules/next/dist/compiled/next-server/app-route-turbo.runtime.prod.js +0 -6
  240. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/api/coherence/route/app-paths-manifest.json +0 -3
  241. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/api/coherence/route/build-manifest.json +0 -9
  242. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/api/coherence/route/server-reference-manifest.json +0 -4
  243. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/api/coherence/route.js +0 -6
  244. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/api/coherence/route.js.map +0 -5
  245. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/api/coherence/route.js.nft.json +0 -1
  246. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/api/coherence/route_client-reference-manifest.js +0 -3
  247. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/044u_vinaya-studio_web__next-internal_server_app_api_coherence_route_actions_1rnzea1.js +0 -3
  248. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/[externals]__0cki-x_._.js +0 -3
  249. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/[root-of-the-server]__02a-3g8._.js +0 -15
  250. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/[turbopack]_runtime.js +0 -903
  251. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__074w9nf._.js +0 -3
  252. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__0ln09ua._.js +0 -3
  253. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__0oegopp._.js +0 -3
  254. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__13yxbjd._.js +0 -51
  255. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__1duqmtm._.js +0 -3
  256. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__1z7dml9._.js +0 -9
  257. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0bfs_u4._.js +0 -3
  258. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0g8_eot._.js +0 -3
  259. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0hrh_v-._.js +0 -181
  260. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0i4-dea._.js +0 -3
  261. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0o54suy._.js +0 -3
  262. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0rxd7s0._.js +0 -3
  263. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0y1jv16._.js +0 -3
  264. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_151m4rz._.js +0 -3
  265. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_1a9dieq._.js +0 -3
  266. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_1sxsf5q._.js +0 -3
  267. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_1sy_yfr._.js +0 -3
  268. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_219v2an._.js +0 -3
  269. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/apps_vinaya-studio_web_src_app_studio_projects_[name]_tranches_[slug]_05ufo8i._.js +0 -3
  270. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/packages_ui_libraries_basic_components_form_input_tsx_0es8d8b._.js +0 -3
  271. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/packages_ui_libraries_brutal_components_index_ts_0n_lcc4._.js +0 -3
  272. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/packages_ui_libraries_retro_components_index_ts_0wvpm_z._.js +0 -3
  273. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/00z3-ljjd1gj9.js +0 -1
  274. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/0bjnj-5fy4e7l.js +0 -1
  275. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/0c8uwz_-m8s99.js +0 -165
  276. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/0ct0c-xj0baf6.js +0 -1
  277. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/0ko698wh8xx2g.css +0 -1
  278. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/0t5n_r4xm__t-.js +0 -1
  279. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/0vc2u252q5q6o.js +0 -1
  280. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/16r_o07lw0vm0.js +0 -1
  281. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/1cah7_e5a1zvu.js +0 -1
  282. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/1gjo9-6dz7nup.js +0 -1
  283. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/24tz8aro1uto4.js +0 -1
  284. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/2ef2g5fozszw7.js +0 -1
  285. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/2ka8dg687auhj.js +0 -1
  286. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/2pf3f50gbrkyv.js +0 -1
  287. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/2qq49pct3q51-.js +0 -1
  288. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/3et66z7glk65w.js +0 -1
  289. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/3y6u3prmrkea-.js +0 -1
  290. /package/studio-standalone/apps/vinaya-studio/web/.next/static/{z1fTSBP6ZlUjObzFIp-qq → yNZEFRSjP9BLUfdf96Eol}/_buildManifest.js +0 -0
  291. /package/studio-standalone/apps/vinaya-studio/web/.next/static/{z1fTSBP6ZlUjObzFIp-qq → yNZEFRSjP9BLUfdf96Eol}/_clientMiddlewareManifest.js +0 -0
  292. /package/studio-standalone/apps/vinaya-studio/web/.next/static/{z1fTSBP6ZlUjObzFIp-qq → yNZEFRSjP9BLUfdf96Eol}/_ssgManifest.js +0 -0
@@ -3,7 +3,7 @@ import { createRequire } from "node:module";
3
3
  var __require = /* @__PURE__ */ createRequire(import.meta.url);
4
4
 
5
5
  // src/checks/bin/check-dispatch-readiness.ts
6
- import { execFile as execFile5, execFileSync as execFileSync5 } from "node:child_process";
6
+ import { execFile as execFile5, execFileSync as execFileSync4 } from "node:child_process";
7
7
  import { existsSync as existsSync2, readFileSync as readFileSync3, realpathSync as realpathSync2 } from "node:fs";
8
8
  import { sep as sep2 } from "node:path";
9
9
  import { promisify as promisify5 } from "node:util";
@@ -632,6 +632,33 @@ function tasksFromIssues(issues) {
632
632
  }
633
633
  return tasks.sort((a, b) => compareTaskIds(a.id, b.id));
634
634
  }
635
+ function resolveDuplicateTasks(tasks, isOpen) {
636
+ const byId = new Map;
637
+ for (const t of tasks)
638
+ byId.set(t.id, [...byId.get(t.id) ?? [], t]);
639
+ const resolved = [];
640
+ const conflicts = [];
641
+ for (const [id, group] of byId) {
642
+ const first = group[0];
643
+ if (!first)
644
+ continue;
645
+ if (group.length === 1) {
646
+ resolved.push(first);
647
+ continue;
648
+ }
649
+ const number = (t) => t.issue ?? 0;
650
+ const open = group.filter((t) => t.issue !== null && isOpen(t.issue)).sort((a, b) => number(a) - number(b));
651
+ if (open.length > 1) {
652
+ conflicts.push({ id, issues: open.map(number) });
653
+ resolved.push(open[0]);
654
+ } else if (open.length === 1) {
655
+ resolved.push(open[0]);
656
+ } else {
657
+ resolved.push([...group].sort((a, b) => number(b) - number(a))[0]);
658
+ }
659
+ }
660
+ return { tasks: resolved.sort((a, b) => compareTaskIds(a.id, b.id)), conflicts };
661
+ }
635
662
  async function fetchTrancheIssuesAsync(owner, repo, slug) {
636
663
  return ghIssueListByAnyLabelAsync(owner, repo, [trancheLabel(slug)]);
637
664
  }
@@ -1439,7 +1466,7 @@ function mapReviewDecision(decision) {
1439
1466
  function buildBranchName(tranche, taskId) {
1440
1467
  return `task/${tranche}/${taskId}`;
1441
1468
  }
1442
- async function fetchForgeFacts(input) {
1469
+ async function fetchForgeFactsByIssue(input) {
1443
1470
  const token = await resolveGithubToken(input.token);
1444
1471
  if (!token) {
1445
1472
  return {
@@ -1449,7 +1476,13 @@ async function fetchForgeFacts(input) {
1449
1476
  reason: "No GitHub token available (set GITHUB_TOKEN/GH_TOKEN or `gh auth login`)."
1450
1477
  };
1451
1478
  }
1452
- const queriedTasks = input.tasks.filter((t) => t.issue !== null);
1479
+ const seen = new Set;
1480
+ const queriedTasks = input.tasks.filter((t) => {
1481
+ if (t.issue === null || seen.has(t.issue))
1482
+ return false;
1483
+ seen.add(t.issue);
1484
+ return true;
1485
+ });
1453
1486
  if (queriedTasks.length === 0) {
1454
1487
  return { facts: new Map, prRefs: new Map, unavailable: false };
1455
1488
  }
@@ -1477,21 +1510,52 @@ async function fetchForgeFacts(input) {
1477
1510
  };
1478
1511
  }
1479
1512
  for (const task of queriedTasks) {
1480
- const alias = aliasFor(task.id);
1481
- const raw = extractRawFromResponse(response.repository, alias);
1513
+ const raw = extractRawFromResponse(response.repository, aliasFor(task.issue));
1482
1514
  const mapped = mapForgeFacts(raw);
1483
1515
  if (mapped)
1484
- facts.set(task.id, mapped);
1516
+ facts.set(task.issue, mapped);
1485
1517
  const pr = raw.pullRequest;
1486
1518
  if (pr && typeof pr.number === "number" && typeof pr.url === "string") {
1487
- prRefs.set(task.id, { number: pr.number, url: pr.url, state: pr.state });
1519
+ prRefs.set(task.issue, { number: pr.number, url: pr.url, state: pr.state });
1488
1520
  }
1489
1521
  }
1490
1522
  return { facts, prRefs, unavailable: false };
1491
1523
  }
1524
+ async function fetchForgeFacts(input) {
1525
+ const byIssue = await fetchForgeFactsByIssue(input);
1526
+ if (byIssue.unavailable) {
1527
+ return { facts: new Map, prRefs: new Map, unavailable: true, reason: byIssue.reason };
1528
+ }
1529
+ const facts = new Map;
1530
+ const prRefs = new Map;
1531
+ const winner = new Map;
1532
+ for (const task of input.tasks) {
1533
+ if (task.issue === null)
1534
+ continue;
1535
+ const current = winner.get(task.id);
1536
+ if (current === undefined || outranks(byIssue.facts, task.issue, current))
1537
+ winner.set(task.id, task.issue);
1538
+ }
1539
+ for (const [taskId, issue] of winner) {
1540
+ const f = byIssue.facts.get(issue);
1541
+ if (f)
1542
+ facts.set(taskId, f);
1543
+ const pr = byIssue.prRefs.get(issue);
1544
+ if (pr)
1545
+ prRefs.set(taskId, pr);
1546
+ }
1547
+ return { facts, prRefs, unavailable: false };
1548
+ }
1549
+ function outranks(facts, candidate, current) {
1550
+ const candidateOpen = facts.get(candidate)?.issueState === "open";
1551
+ const currentOpen = facts.get(current)?.issueState === "open";
1552
+ if (candidateOpen !== currentOpen)
1553
+ return candidateOpen;
1554
+ return candidate > current;
1555
+ }
1492
1556
  function buildBatchQuery(tranche, tasks) {
1493
1557
  const perTask = tasks.map((task) => {
1494
- const a = aliasFor(task.id);
1558
+ const a = aliasFor(task.issue);
1495
1559
  const branch = buildBranchName(tranche, task.id);
1496
1560
  return `
1497
1561
  ${a}_issue: issue(number: ${task.issue}) {
@@ -1533,9 +1597,8 @@ function buildBatchQuery(tranche, tasks) {
1533
1597
  }
1534
1598
  }`;
1535
1599
  }
1536
- function aliasFor(taskId) {
1537
- const sanitized = taskId.replace(/[^a-zA-Z0-9_]/g, "_");
1538
- return `t_${sanitized}`;
1600
+ function aliasFor(issue) {
1601
+ return `i_${issue}`;
1539
1602
  }
1540
1603
  function extractRawFromResponse(repository, alias) {
1541
1604
  const issue = repository[`${alias}_issue`];
@@ -1890,45 +1953,6 @@ var DERIVED_STATUSES = [
1890
1953
  "incoherent"
1891
1954
  ];
1892
1955
  var DERIVABLE_STATUSES = DERIVED_STATUSES.filter((s) => s !== "backlog");
1893
- // ../../packages/aeg-core/src/parse-ledger.ts
1894
- function rowFromCells(cells) {
1895
- if (cells.length < 7)
1896
- return null;
1897
- const phase = (cells[0] ?? "").trim();
1898
- if (!phase)
1899
- return null;
1900
- return {
1901
- phase,
1902
- role: (cells[1] ?? "").trim(),
1903
- agentModel: (cells[2] ?? "").trim(),
1904
- tokensIn: parseIntCell(cells[3] ?? ""),
1905
- tokensOut: parseIntCell(cells[4] ?? ""),
1906
- cost: parseCostCell(cells[5] ?? ""),
1907
- date: (cells[6] ?? "").trim()
1908
- };
1909
- }
1910
- function parseIntCell(cell) {
1911
- const trimmed = cell.replace(/`/g, "").trim();
1912
- if (!trimmed || isEmDashOrDash(trimmed))
1913
- return null;
1914
- const normalized = trimmed.replace(/[,_\s]/g, "");
1915
- if (!/^-?\d+$/.test(normalized))
1916
- return null;
1917
- return Number(normalized);
1918
- }
1919
- function parseCostCell(cell) {
1920
- const trimmed = cell.replace(/`/g, "").trim();
1921
- if (!trimmed || isEmDashOrDash(trimmed))
1922
- return null;
1923
- const normalized = trimmed.replace(/^\$/, "").replace(/[,_\s]/g, "");
1924
- if (!/^-?\d+(\.\d+)?$/.test(normalized))
1925
- return null;
1926
- return Number(normalized);
1927
- }
1928
- function isEmDashOrDash(s) {
1929
- const t = s.trim();
1930
- return t === "—" || t === "-" || t === "–";
1931
- }
1932
1956
  // ../../packages/aeg-core/src/waiver-label.ts
1933
1957
  var WAIVER_LABEL = label("waiver-docs");
1934
1958
  var WAIVER_LABEL_REVIEW = label("waiver-review");
@@ -1944,61 +1968,6 @@ function isWaiverLabelActorVerified(opts) {
1944
1968
  return false;
1945
1969
  return isPrincipal(opts.labelActor, opts.principalAllowlist);
1946
1970
  }
1947
-
1948
- // ../../packages/aeg-core/src/parse-token-report.ts
1949
- var TOKEN_REPORT_HEADING = /^\s*(?:#{1,6}\s*Token report\s*|\*\*Token report\*\*)\s*$/i;
1950
- var INLINE_FIELD_LIST = /Phase:\s*([^|]+?)\s*\|\s*Role:\s*([^|]+?)\s*\|\s*Agent\/Model:\s*([^|]+?)\s*\|\s*Tokens in:\s*([^|]+?)\s*\|\s*Tokens out:\s*([^|]+?)\s*\|\s*Cost:\s*([^|]+?)\s*\|\s*Date:\s*(.+?)\s*$/im;
1951
- function parseTokenReportEntries(body) {
1952
- const lines = body.split(/\r?\n/);
1953
- const headingIdxs = [];
1954
- lines.forEach((line, i) => {
1955
- if (TOKEN_REPORT_HEADING.test(line))
1956
- headingIdxs.push(i);
1957
- });
1958
- const out = [];
1959
- for (let h = 0;h < headingIdxs.length; h++) {
1960
- const start = headingIdxs[h] + 1;
1961
- const end = h + 1 < headingIdxs.length ? headingIdxs[h + 1] : lines.length;
1962
- const section = lines.slice(start, end).join(`
1963
- `);
1964
- const tableRows = parseTableSection(section);
1965
- if (tableRows.length > 0) {
1966
- out.push(...tableRows);
1967
- continue;
1968
- }
1969
- const inlineRow = parseInlineFieldList(section);
1970
- if (inlineRow)
1971
- out.push(inlineRow);
1972
- }
1973
- return out;
1974
- }
1975
- function parseTableSection(section) {
1976
- const lines = section.split(/\r?\n/);
1977
- let i = 0;
1978
- for (;i < lines.length; i++) {
1979
- if ((lines[i] ?? "").trim().startsWith("|"))
1980
- break;
1981
- }
1982
- if (i + 1 >= lines.length)
1983
- return [];
1984
- i += 2;
1985
- const out = [];
1986
- for (;i < lines.length; i++) {
1987
- const trimmed = (lines[i] ?? "").trim();
1988
- if (!trimmed.startsWith("|"))
1989
- break;
1990
- const row = rowFromCells(splitTableRow(trimmed));
1991
- if (row)
1992
- out.push(row);
1993
- }
1994
- return out;
1995
- }
1996
- function parseInlineFieldList(section) {
1997
- const m = section.match(INLINE_FIELD_LIST);
1998
- if (!m)
1999
- return null;
2000
- return rowFromCells([m[1], m[2], m[3], m[4], m[5], m[6], m[7]]);
2001
- }
2002
1971
  // ../../packages/aeg-core/src/verdict-extraction.ts
2003
1972
  var HEAD_SHA_PATTERN = /^[ \t]*(?:\*{1,3}|_{1,3})?Judged head:\s*([0-9a-f]{7,40})(?![A-Za-z0-9])/im;
2004
1973
  var OBJECTIVES_VERSION_PATTERN = /^[ \t]*(?:\*{1,3}|_{1,3})?Objectives version:\s*([0-9a-f]{64})(?![A-Za-z0-9])/im;
@@ -2447,10 +2416,12 @@ function evaluateC5(changed, docOwnersContent, prBody, fileExists, waiverActive,
2447
2416
  var CODE_REVIEW_SEVERITY_ORDER = ["BLOCKER", "MAJOR", "MINOR"];
2448
2417
  var SECURITY_SEVERITY_ORDER = ["CRITICAL", "HIGH", "MEDIUM", "LOW"];
2449
2418
  var DEFAULT_MAX_ROUNDS = 3;
2419
+ var DEFAULT_MAX_TASK_MINUTES = 180;
2450
2420
  var DEFAULT_REVIEW_POLICY = {
2451
2421
  codeReviewThreshold: "BLOCKER",
2452
2422
  securityThreshold: "HIGH",
2453
- maxRounds: DEFAULT_MAX_ROUNDS
2423
+ maxRounds: DEFAULT_MAX_ROUNDS,
2424
+ maxTaskMinutes: DEFAULT_MAX_TASK_MINUTES
2454
2425
  };
2455
2426
  var FILE_SHAPED_LOCATION = /\.[a-zA-Z0-9]{1,10}(:\d+)?\s*$/;
2456
2427
  var PROSE_LOCATION_PATTERNS = [/\bpr\s*body\b/i, /\bcomment\b/i];
@@ -2458,6 +2429,9 @@ var ROLE_FILE_LOCATION = /(^|\/)aeg-root\/roles\//i;
2458
2429
  function isProseLocation(location) {
2459
2430
  if (ROLE_FILE_LOCATION.test(location))
2460
2431
  return true;
2432
+ return isBodyOrCommentLocation(location);
2433
+ }
2434
+ function isBodyOrCommentLocation(location) {
2461
2435
  if (FILE_SHAPED_LOCATION.test(location))
2462
2436
  return false;
2463
2437
  return PROSE_LOCATION_PATTERNS.some((pattern) => pattern.test(location));
@@ -2484,7 +2458,7 @@ function classifyFinding(finding, scale, threshold, context = {}) {
2484
2458
  const wouldBlock = blockingSeverities(scale, threshold).includes(effectiveSeverity);
2485
2459
  if (!wouldBlock)
2486
2460
  return { outcome: "non_blocking", deferralReason: null };
2487
- const hasLocation = location !== undefined && location.length > 0;
2461
+ const hasLocation = location !== undefined && location.length > 0 && !isBodyOrCommentLocation(location);
2488
2462
  if (hasLocation && context.inSurface && !context.inSurface(location)) {
2489
2463
  return { outcome: "deferred", deferralReason: "outside-surface" };
2490
2464
  }
@@ -2851,11 +2825,13 @@ function checkDocUpdateList(prBody) {
2851
2825
  return headingCheck(prBody, "(?:documentation|doc)[- ]update(?:\\s+list)?", "Documentation-update list");
2852
2826
  }
2853
2827
  function checkWorktreeStep0(prBody) {
2854
- if (/git worktree add/.test(prBody))
2828
+ if (/git worktree add/.test(prBody) || /cd \.worktrees\//.test(prBody) || /bun install --frozen-lockfile/.test(prBody))
2855
2829
  return { status: "pass", errors: [] };
2856
2830
  return {
2857
2831
  status: "fail",
2858
- errors: ["brief-validation worktree Step 0: no `git worktree add` command found in the PR body."]
2832
+ errors: [
2833
+ "brief-validation worktree Step 0: no `git worktree add`, `cd .worktrees/`, or `bun install --frozen-lockfile` command found in the PR body."
2834
+ ]
2859
2835
  };
2860
2836
  }
2861
2837
  function checkStopConditions(prBody) {
@@ -3045,7 +3021,8 @@ function isCommandBlock(content) {
3045
3021
  return COMMAND_WORDS.includes(commandWordOf(firstNonBlankLine(content)));
3046
3022
  }
3047
3023
  function isStep0Block(content) {
3048
- return firstNonBlankLine(content).startsWith("git worktree add");
3024
+ const first = firstNonBlankLine(content);
3025
+ return first.startsWith("git worktree add") || first.startsWith("cd .worktrees/") || first.startsWith("bun install --frozen-lockfile");
3049
3026
  }
3050
3027
  function checkCommandsCarryOutput(prBody) {
3051
3028
  const errors = [];
@@ -3514,10 +3491,14 @@ function legacySlugPattern(legacySlugs) {
3514
3491
  const alternation = legacySlugs.map((s) => s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")).join("|");
3515
3492
  return new RegExp(`(^|[^a-zA-Z0-9\\n-])(${alternation})([^a-zA-Z0-9\\n-]|$)`, "g");
3516
3493
  }
3494
+ function specGrandfatherPaths(specGrandfather) {
3495
+ return Array.isArray(specGrandfather) ? [...specGrandfather] : Object.keys(specGrandfather);
3496
+ }
3517
3497
  function checkUnresolvableReferences(files, readerFacingPrefix, readerFacingSuffix, legacySlugs = [], shipsPrefix = SHIPS_PREFIX, specGrandfather = [], specPaths = DEFAULT_SPEC_PATHS) {
3518
3498
  const findings = [];
3519
3499
  const legacyPattern = legacySlugPattern(legacySlugs);
3520
- const grandfathered = new Set(specGrandfather);
3500
+ const grandfatheredWhole = new Set(Array.isArray(specGrandfather) ? specGrandfather : []);
3501
+ const limits = new Map(Array.isArray(specGrandfather) ? [] : Object.entries(specGrandfather));
3521
3502
  const patterns = [
3522
3503
  { pattern: FORGE_NUMBER_PATTERN, what: "a forge number" },
3523
3504
  { pattern: TRANCHE_SLUG_VN_PATTERN, what: "an internal tranche slug" },
@@ -3536,18 +3517,19 @@ function checkUnresolvableReferences(files, readerFacingPrefix, readerFacingSuff
3536
3517
  continue;
3537
3518
  if (cls !== "product" && cls !== "spec" && !SWEPT_CLASSES.has(cls))
3538
3519
  continue;
3539
- if (cls === "spec" && grandfathered.has(file.path))
3520
+ if (cls === "spec" && grandfatheredWhole.has(file.path))
3540
3521
  continue;
3541
3522
  const blocking = cls === "product" || cls === "spec";
3542
3523
  const scrubbed = cls === "product" ? stripNonProseForProduct(file.path, file.content) : stripNonProse(file.path, file.content);
3543
3524
  const patternsToRun = cls === "product" ? productPatterns : cls === "spec" ? specPatterns : patterns;
3525
+ const fileFindings = [];
3544
3526
  for (const { pattern, what, group } of patternsToRun) {
3545
3527
  pattern.lastIndex = 0;
3546
3528
  let match = pattern.exec(scrubbed);
3547
3529
  while (match !== null) {
3548
3530
  const cited = group !== undefined ? match[group] ?? match[0] : match[0];
3549
3531
  const citedIndex = match.index + match[0].indexOf(cited);
3550
- findings.push({
3532
+ fileFindings.push({
3551
3533
  file: file.path,
3552
3534
  line: lineAt(scrubbed, citedIndex),
3553
3535
  message: `references ${what} ("${cited}") a reader outside this repo's tracker cannot resolve`,
@@ -3556,6 +3538,15 @@ function checkUnresolvableReferences(files, readerFacingPrefix, readerFacingSuff
3556
3538
  match = pattern.exec(scrubbed);
3557
3539
  }
3558
3540
  }
3541
+ const limit = cls === "spec" ? limits.get(file.path) : undefined;
3542
+ if (limit !== undefined) {
3543
+ if (fileFindings.length <= limit)
3544
+ continue;
3545
+ for (const f of fileFindings) {
3546
+ f.message += `; ${file.path} carries ${fileFindings.length} such findings, over its proseGates.specGrandfather limit of ${limit}`;
3547
+ }
3548
+ }
3549
+ findings.push(...fileFindings);
3559
3550
  }
3560
3551
  return findings;
3561
3552
  }
@@ -4137,6 +4128,8 @@ var FILE_EXTENSIONS = new Set([
4137
4128
  "html",
4138
4129
  "css"
4139
4130
  ]);
4131
+ var CI_SHARD_DIR = "apps/cli/tests/ci-shards";
4132
+ var CI_SHARD_PROBE = `${CI_SHARD_DIR}/shard-1.txt`;
4140
4133
 
4141
4134
  // ../../packages/aeg-core/src/task-branch-identity.ts
4142
4135
  var ISSUE_BRANCH_PATTERN = /^task\/issue-(\d+)$/;
@@ -4515,8 +4508,7 @@ function briefHash(brief) {
4515
4508
  function policyDigest(policy) {
4516
4509
  return createHash4("sha256").update(JSON.stringify({
4517
4510
  codeReviewThreshold: policy.codeReviewThreshold,
4518
- securityThreshold: policy.securityThreshold,
4519
- maxRounds: policy.maxRounds
4511
+ securityThreshold: policy.securityThreshold
4520
4512
  })).digest("hex");
4521
4513
  }
4522
4514
  function isBoundToHead(echoed, headSha) {
@@ -4829,7 +4821,46 @@ function parseEnforcementRegistry(content) {
4829
4821
  return result;
4830
4822
  }
4831
4823
  // ../../packages/aeg-core/src/registry-checks.ts
4832
- function checkG1(rows, existsFn) {
4824
+ var HOOK_DIR_PREFIXES = [".claude/hooks/", ".vinaya/hooks/", ".husky/", ".git/hooks/"];
4825
+ var BARE_HOOK_NAME = /^check-[A-Za-z0-9_.-]*\.sh$/;
4826
+ function basename(path) {
4827
+ return path.slice(path.lastIndexOf("/") + 1);
4828
+ }
4829
+ function lineOf(content, index) {
4830
+ let line = 1;
4831
+ for (let i = 0;i < index; i++)
4832
+ if (content.charCodeAt(i) === 10)
4833
+ line++;
4834
+ return line;
4835
+ }
4836
+ function findUnshippedHookRefs(docs, shipped) {
4837
+ const shippedNames = new Set([...shipped].map(basename));
4838
+ const findings = [];
4839
+ const flag = (doc, token, index) => {
4840
+ findings.push({
4841
+ path: doc.path,
4842
+ reason: `${doc.path}:${lineOf(doc.content, index)} names hook "${token}", which is neither tracked in git nor emitted by \`vinaya init\``
4843
+ });
4844
+ };
4845
+ for (const doc of docs) {
4846
+ for (const { cited, index } of extractCitedPaths(doc.content)) {
4847
+ if (cited.endsWith("/") || !HOOK_DIR_PREFIXES.some((p) => cited.startsWith(p)))
4848
+ continue;
4849
+ if (!shipped.has(cited))
4850
+ flag(doc, cited, index);
4851
+ }
4852
+ const spanPattern = /`([^`\n]+)`/g;
4853
+ let match = spanPattern.exec(doc.content);
4854
+ while (match !== null) {
4855
+ const token = match[1] ?? "";
4856
+ if (BARE_HOOK_NAME.test(token) && !shippedNames.has(token))
4857
+ flag(doc, token, match.index);
4858
+ match = spanPattern.exec(doc.content);
4859
+ }
4860
+ }
4861
+ return findings;
4862
+ }
4863
+ function checkG1(rows, existsFn, hookRefs) {
4833
4864
  const findings = [];
4834
4865
  for (const row of rows) {
4835
4866
  if (row.implementation === "")
@@ -4842,6 +4873,8 @@ function checkG1(rows, existsFn) {
4842
4873
  });
4843
4874
  }
4844
4875
  }
4876
+ if (hookRefs)
4877
+ findings.push(...findUnshippedHookRefs(hookRefs.docs, hookRefs.shipped));
4845
4878
  return { check: "G1", status: findings.length > 0 ? "fail" : "pass", findings };
4846
4879
  }
4847
4880
  var SCAFFOLD_PLACEHOLDER = "[undocumented — fill in why]";
@@ -4974,6 +5007,55 @@ function checkG6(rows, registeredCheckNames) {
4974
5007
  }
4975
5008
  return { check: "G6", status: findings.length > 0 ? "fail" : "pass", findings };
4976
5009
  }
5010
+ function reachesProducer(file, producers, imports) {
5011
+ const seen = new Set([file]);
5012
+ const queue = [file];
5013
+ for (let next = queue.pop();next !== undefined; next = queue.pop()) {
5014
+ if (producers.has(next))
5015
+ return true;
5016
+ for (const dep of imports.get(next) ?? []) {
5017
+ if (!seen.has(dep)) {
5018
+ seen.add(dep);
5019
+ queue.push(dep);
5020
+ }
5021
+ }
5022
+ }
5023
+ return false;
5024
+ }
5025
+ function checkG7(input) {
5026
+ if (!input.enforcementMapPresent)
5027
+ return { check: "G7", status: "info", findings: [] };
5028
+ const subjects = new Set([...input.crossingFiles, ...input.blockingFiles]);
5029
+ const findings = [];
5030
+ for (const path of subjects) {
5031
+ if (path in input.exemptions)
5032
+ continue;
5033
+ if (!reachesProducer(path, input.producers, input.imports)) {
5034
+ findings.push({
5035
+ path,
5036
+ reason: `"${path}" ${input.crossingFiles.includes(path) ? "makes a GitHub-writing call" : "implements a blocking gate"} but neither is a log producer nor imports one, and it is not exempted with a reason`
5037
+ });
5038
+ }
5039
+ }
5040
+ for (const [path, reason] of Object.entries(input.exemptions)) {
5041
+ if (reason.trim() === "") {
5042
+ findings.push({ path, reason: `exemption for "${path}" states no reason` });
5043
+ } else if (!input.existsFn(path)) {
5044
+ findings.push({ path, reason: `exemption names "${path}", which no longer exists` });
5045
+ } else if (!subjects.has(path)) {
5046
+ findings.push({
5047
+ path,
5048
+ reason: `exemption names "${path}", which is neither a GitHub-writing file nor a blocking gate's implementation`
5049
+ });
5050
+ } else if (reachesProducer(path, input.producers, input.imports)) {
5051
+ findings.push({
5052
+ path,
5053
+ reason: `exemption names "${path}", which does reach a log producer — remove the exemption`
5054
+ });
5055
+ }
5056
+ }
5057
+ return { check: "G7", status: findings.length > 0 ? "fail" : "pass", findings };
5058
+ }
4977
5059
  // ../../packages/aeg-core/src/dead-branch-push-guard.ts
4978
5060
  function checkDeadBranchPush(input) {
4979
5061
  const { branch, prState, prNumber } = input;
@@ -5153,6 +5235,11 @@ function checkDispatchReadiness(input) {
5153
5235
  push("depends-on-unresolvable", `dispatch-gate depends-on: ${taskLabel} depends on "${dep.id}", which is UNRESOLVABLE — the resolver could not find a matching tranche/task/Issue for this edge (not a claim about merge status). Not dispatchable until the edge is corrected.`);
5154
5236
  continue;
5155
5237
  }
5238
+ if (dep.readFailed === true) {
5239
+ const issueStr = dep.issue !== null ? ` (#${dep.issue})` : "";
5240
+ push("depends-on-read-failed", `dispatch-gate depends-on: ${taskLabel} depends on ${dep.id}${issueStr}, but the forge could not be read for that dependency — not a claim about its merge status. Retry the check.`);
5241
+ continue;
5242
+ }
5156
5243
  if (!dep.merged && !isHandClosedByRecognizedPrincipal(dep, principalAllowlist)) {
5157
5244
  const issueStr = dep.issue !== null ? ` (#${dep.issue})` : "";
5158
5245
  push("depends-on-not-merged", `dispatch-gate depends-on: ${taskLabel} depends on ${dep.id}${issueStr}, whose PR is not merged yet — not dispatchable, it serializes behind it.`);
@@ -5395,7 +5482,6 @@ var TaskPrPauseSchema = z.object({
5395
5482
  var TaskPrReviewRecordSchema = z.object({
5396
5483
  verdicts: z.array(TaskPrVerdictSchema),
5397
5484
  roundMarkers: z.array(z.number().int().nonnegative()),
5398
- summaryTable: z.string().nullable(),
5399
5485
  pause: TaskPrPauseSchema.nullable()
5400
5486
  });
5401
5487
  var TaskPrReadInputSchema = z.object({
@@ -5442,16 +5528,6 @@ var TaskCancelResultSchema = z.object({
5442
5528
  authenticatedFrom: z.string().min(1),
5443
5529
  fencedEffectKeys: z.array(z.string())
5444
5530
  });
5445
- var TASK_TOOL_NAMES = [
5446
- "task_start",
5447
- "task_status",
5448
- "task_escalation_read",
5449
- "task_pr_read",
5450
- "task_resume",
5451
- "task_cancel"
5452
- ];
5453
- var OPERATOR_STATUS_FOLLOW = "task_status_follow";
5454
- var OPERATOR_TOOL_GRANT = [...TASK_TOOL_NAMES, OPERATOR_STATUS_FOLLOW];
5455
5531
  // ../../packages/aeg-core/src/first-push-dispatch-gate.ts
5456
5532
  function parseTaskBranch(branch) {
5457
5533
  const m = /^task\/([^/]+)\/([^/]+)$/.exec(branch);
@@ -5682,16 +5758,71 @@ var NO_GATE_CUTOVERS = {
5682
5758
  briefRulesSincePr: null,
5683
5759
  agentBoxesRefusedSincePr: null
5684
5760
  };
5685
- // ../../packages/aeg-core/src/dev-review-loop/types.ts
5686
- var SEVERITY_COLUMNS = ["blocker", "major", "minor", "critical", "high", "medium", "low"];
5687
- // ../../packages/aeg-core/src/dev-review-loop/journal-reconstruction.ts
5688
- var SUMMARY_TABLE_HEADER = `| round | ${SEVERITY_COLUMNS.join(" | ")} | confidence | outcome |`;
5689
- // ../../packages/aeg-core/src/log/envelope.ts
5690
- import { createHash as createHash5 } from "node:crypto";
5691
-
5692
5761
  // ../../packages/aeg-core/src/log/schema.ts
5762
+ import { z as z3 } from "zod";
5763
+
5764
+ // ../../packages/aeg-core/src/log/custom.ts
5693
5765
  import { z as z2 } from "zod";
5766
+ var CUSTOM_EVENT_NAME_PATTERN = /^[a-z][a-z0-9_]*\.[a-z][a-z0-9_.]*$/;
5767
+ var CUSTOM_EVENT_NAME_MAX_LENGTH = 64;
5768
+ var CUSTOM_EVENT_RESERVED_NAMESPACE = "vinaya";
5769
+ var CUSTOM_EVENT_MAX_FIELDS = 20;
5770
+ var CUSTOM_FIELD_NAME_PATTERN = /^[a-z][a-z0-9_]*$/;
5771
+ var CUSTOM_FIELD_NAME_MAX_LENGTH = 64;
5772
+ var CUSTOM_TEXT_MAX_LENGTH = 500;
5773
+ var CUSTOM_WORD_PATTERN = /^[a-z0-9][a-z0-9_-]*$/;
5774
+ var CUSTOM_WORD_MAX_LENGTH = 64;
5775
+ var CUSTOM_FIELD_MAX_WORDS = 50;
5776
+ var CustomFieldTypeSchema = z2.union([z2.enum(["text", "number", "boolean"]), z2.array(z2.string())]);
5777
+ var CustomEventDeclarationsSchema = z2.record(z2.string(), z2.object({
5778
+ fields: z2.record(z2.string(), CustomFieldTypeSchema)
5779
+ }).strict()).superRefine((events, ctx) => {
5780
+ for (const [name, declaration] of Object.entries(events)) {
5781
+ const refuse = (message, path = []) => {
5782
+ ctx.addIssue({
5783
+ code: z2.ZodIssueCode.custom,
5784
+ path: [name, ...path],
5785
+ message: `logs.events "${name}": ${message}`
5786
+ });
5787
+ };
5788
+ if (name.length > CUSTOM_EVENT_NAME_MAX_LENGTH) {
5789
+ refuse(`the name must be at most ${CUSTOM_EVENT_NAME_MAX_LENGTH} characters`);
5790
+ }
5791
+ if (!CUSTOM_EVENT_NAME_PATTERN.test(name)) {
5792
+ refuse("the name must be `<namespace>.<event>` — lowercase letters, digits and `_`, a dot between them");
5793
+ } else if (name.split(".")[0] === CUSTOM_EVENT_RESERVED_NAMESPACE) {
5794
+ refuse(`the \`${CUSTOM_EVENT_RESERVED_NAMESPACE}.\` namespace is reserved for Vinaya's own events`);
5795
+ }
5796
+ const fieldEntries = Object.entries(declaration.fields);
5797
+ if (fieldEntries.length > CUSTOM_EVENT_MAX_FIELDS) {
5798
+ refuse(`at most ${CUSTOM_EVENT_MAX_FIELDS} fields may be declared (found ${fieldEntries.length})`, ["fields"]);
5799
+ }
5800
+ for (const [field, type] of fieldEntries) {
5801
+ if (field.length > CUSTOM_FIELD_NAME_MAX_LENGTH || !CUSTOM_FIELD_NAME_PATTERN.test(field)) {
5802
+ refuse(`field "${field}": a field name is lowercase letters, digits and \`_\`, starting with a letter, at most ${CUSTOM_FIELD_NAME_MAX_LENGTH} characters`, ["fields", field]);
5803
+ }
5804
+ if (typeof type === "string")
5805
+ continue;
5806
+ if (type.length === 0) {
5807
+ refuse(`field "${field}": a list of words must name at least one word`, ["fields", field]);
5808
+ }
5809
+ if (type.length > CUSTOM_FIELD_MAX_WORDS) {
5810
+ refuse(`field "${field}": a list of words may name at most ${CUSTOM_FIELD_MAX_WORDS}`, ["fields", field]);
5811
+ }
5812
+ const bad = type.filter((w) => w.length > CUSTOM_WORD_MAX_LENGTH || !CUSTOM_WORD_PATTERN.test(w));
5813
+ if (bad.length > 0) {
5814
+ refuse(`field "${field}": a listed word is lowercase letters, digits, \`_\` and \`-\`, at most ${CUSTOM_WORD_MAX_LENGTH} characters`, ["fields", field]);
5815
+ }
5816
+ if (new Set(type).size !== type.length) {
5817
+ refuse(`field "${field}": a list of words names a word twice`, ["fields", field]);
5818
+ }
5819
+ }
5820
+ }
5821
+ });
5822
+
5823
+ // ../../packages/aeg-core/src/log/schema.ts
5694
5824
  var CONFIDENCE_REASON_MAX_LENGTH = 280;
5825
+ var REVIEW_FINDING_DESCRIPTION_MAX_LENGTH = 1000;
5695
5826
  var ROLE_VALUES = [
5696
5827
  "planner",
5697
5828
  "developer",
@@ -5701,178 +5832,214 @@ var ROLE_VALUES = [
5701
5832
  "archivist",
5702
5833
  "architect"
5703
5834
  ];
5704
- var RoleSchema = z2.enum(ROLE_VALUES);
5835
+ var RoleSchema = z3.enum(ROLE_VALUES);
5705
5836
  var HOST_VALUES = ["hook", "ci", "cli", "loop"];
5706
- var HostSchema = z2.enum(HOST_VALUES);
5837
+ var HostSchema = z3.enum(HOST_VALUES);
5707
5838
  var RUN_ID_PATTERN = /^[A-Za-z0-9_.-]{1,128}$/;
5708
5839
  var headerMetaCore = {
5709
- ts: z2.string(),
5710
- run_id: z2.string().regex(RUN_ID_PATTERN),
5711
- seq: z2.number().int().nonnegative(),
5712
- repo: z2.string().nullable(),
5713
- vinaya: z2.string(),
5714
- doctrine: z2.string(),
5840
+ ts: z3.string(),
5841
+ run_id: z3.string().regex(RUN_ID_PATTERN),
5842
+ seq: z3.number().int().nonnegative(),
5843
+ repo: z3.string().nullable(),
5844
+ vinaya: z3.string(),
5845
+ doctrine: z3.string(),
5715
5846
  host: HostSchema,
5716
- machine: z2.string()
5847
+ machine: z3.string()
5717
5848
  };
5718
- var HeaderMetaV1Schema = z2.object({
5719
- schema: z2.literal(1),
5849
+ var HeaderMetaV1Schema = z3.object({
5850
+ schema: z3.literal(1),
5720
5851
  ...headerMetaCore
5721
5852
  }).strict();
5722
- var LineageSchema = z2.object({
5723
- run: z2.string().nullable(),
5724
- attempt: z2.number().int().nullable(),
5725
- parent: z2.string().nullable()
5853
+ var LineageSchema = z3.object({
5854
+ run: z3.string().nullable(),
5855
+ attempt: z3.number().int().nullable(),
5856
+ parent: z3.string().nullable()
5726
5857
  }).strict();
5727
- var InputVersionsSchema = z2.object({
5728
- objectives_version: z2.string().nullable(),
5729
- brief_hash: z2.string().nullable(),
5730
- ruling_ordinal: z2.number().int().nullable(),
5731
- policy_digest: z2.string().nullable()
5858
+ var InputVersionsSchema = z3.object({
5859
+ objectives_version: z3.string().nullable(),
5860
+ brief_hash: z3.string().nullable(),
5861
+ ruling_ordinal: z3.number().int().nullable(),
5862
+ policy_digest: z3.string().nullable()
5732
5863
  }).strict();
5733
- var ProvenanceSchema = z2.enum(["parent_attributed", "env_correlated", "self_reported", "unavailable"]);
5734
- var HeaderMetaV2Schema = z2.object({
5735
- schema: z2.literal(2),
5864
+ var ProvenanceSchema = z3.enum(["parent_attributed", "env_correlated", "self_reported", "unavailable"]);
5865
+ var HeaderMetaV2Schema = z3.object({
5866
+ schema: z3.literal(2),
5736
5867
  ...headerMetaCore,
5737
- event_id: z2.string().min(1),
5738
- process_id: z2.string().min(1),
5739
- actor_id: z2.string().nullable(),
5868
+ event_id: z3.string().min(1),
5869
+ process_id: z3.string().min(1),
5870
+ actor_id: z3.string().nullable(),
5740
5871
  lineage: LineageSchema,
5741
5872
  input_versions: InputVersionsSchema,
5742
5873
  provenance: ProvenanceSchema
5743
5874
  }).strict();
5744
- var HeaderMetaSchema = z2.discriminatedUnion("schema", [HeaderMetaV1Schema, HeaderMetaV2Schema]);
5745
- var SubjectSchema = z2.object({
5746
- issue: z2.number().int().nullable(),
5747
- pr: z2.number().int().optional(),
5748
- sha: z2.string().optional(),
5749
- role: z2.union([RoleSchema, z2.literal("unattributed")]),
5750
- round: z2.number().int().optional(),
5751
- objectives_version: z2.string().optional()
5875
+ var WorkSchema = z3.object({
5876
+ ref: z3.string().nullable(),
5877
+ repo: z3.string().nullable(),
5878
+ change: z3.string().nullable(),
5879
+ revision: z3.string().nullable()
5880
+ }).strict();
5881
+ var FlowSchema = z3.object({
5882
+ id: z3.string().nullable(),
5883
+ version: z3.string().nullable()
5884
+ }).strict();
5885
+ var HeaderMetaV3Schema = z3.object({
5886
+ schema: z3.literal(3),
5887
+ ...headerMetaCore,
5888
+ event_id: z3.string().min(1),
5889
+ process_id: z3.string().min(1),
5890
+ actor_id: z3.string().nullable(),
5891
+ lineage: LineageSchema,
5892
+ input_versions: InputVersionsSchema,
5893
+ provenance: ProvenanceSchema,
5894
+ work: WorkSchema,
5895
+ flow: FlowSchema,
5896
+ runtime: z3.string().nullable(),
5897
+ source: z3.string().nullable()
5898
+ }).strict();
5899
+ var HeaderMetaSchema = z3.discriminatedUnion("schema", [HeaderMetaV1Schema, HeaderMetaV2Schema, HeaderMetaV3Schema]);
5900
+ var SubjectSchema = z3.object({
5901
+ issue: z3.number().int().nullable(),
5902
+ pr: z3.number().int().optional(),
5903
+ sha: z3.string().optional(),
5904
+ role: z3.union([RoleSchema, z3.literal("unattributed")]),
5905
+ round: z3.number().int().optional(),
5906
+ objectives_version: z3.string().optional()
5752
5907
  }).strict();
5753
- var HeaderSchema = z2.object({
5908
+ var HeaderSchema = z3.object({
5754
5909
  meta: HeaderMetaSchema,
5755
5910
  subject: SubjectSchema
5756
5911
  }).strict();
5757
5912
  var envelopeTail = {
5758
- duration_ms: z2.number().nonnegative().optional(),
5759
- payload: z2.object({}).strict()
5913
+ duration_ms: z3.number().nonnegative().optional(),
5914
+ payload: z3.object({}).strict()
5760
5915
  };
5761
- var ReviewFindingSchema = z2.object({
5762
- id: z2.string(),
5763
- severity: z2.string(),
5764
- state: z2.string().optional(),
5765
- severity_scale: z2.string().optional(),
5766
- policy_treatment: z2.enum(["blocking", "non_blocking", "unavailable"]).optional(),
5767
- confidence: z2.number().min(0).max(1).optional(),
5768
- confidence_scale: z2.string().optional(),
5769
- confidence_source: z2.string().optional()
5916
+ var ReviewFindingSchema = z3.object({
5917
+ id: z3.string(),
5918
+ severity: z3.string(),
5919
+ location: z3.string().optional(),
5920
+ deferral_reason: z3.enum(["outside-surface", "unchanged-line"]).optional(),
5921
+ description: z3.string().max(REVIEW_FINDING_DESCRIPTION_MAX_LENGTH).optional(),
5922
+ state: z3.string().optional(),
5923
+ severity_scale: z3.string().optional(),
5924
+ policy_treatment: z3.enum(["blocking", "non_blocking", "unavailable"]).optional(),
5925
+ confidence: z3.number().min(0).max(1).optional(),
5926
+ confidence_scale: z3.string().optional(),
5927
+ confidence_source: z3.string().optional()
5770
5928
  }).strict();
5771
- var DispatchOutcomeSchema = z2.discriminatedUnion("type", [
5772
- z2.object({ type: z2.literal("pr_opened"), pr: z2.number().int(), head: z2.string() }).strict(),
5773
- z2.object({
5774
- type: z2.literal("round_pushed"),
5775
- pr: z2.number().int(),
5776
- head: z2.string(),
5777
- comment_id: z2.number().int()
5929
+ var DispatchOutcomeSchema = z3.discriminatedUnion("type", [
5930
+ z3.object({ type: z3.literal("pr_opened"), pr: z3.number().int(), head: z3.string() }).strict(),
5931
+ z3.object({
5932
+ type: z3.literal("round_pushed"),
5933
+ pr: z3.number().int(),
5934
+ head: z3.string(),
5935
+ comment_id: z3.number().int()
5778
5936
  }).strict(),
5779
- z2.object({
5780
- type: z2.literal("verdict"),
5781
- verdict: z2.enum(["APPROVE", "REQUEST CHANGES", "PASS", "FAIL"]),
5782
- head: z2.string(),
5783
- comment_id: z2.number().int(),
5784
- objectives: z2.array(z2.object({ id: z2.string(), met: z2.boolean() }).strict()),
5785
- findings: z2.array(ReviewFindingSchema)
5937
+ z3.object({
5938
+ type: z3.literal("verdict"),
5939
+ verdict: z3.enum(["APPROVE", "REQUEST CHANGES", "PASS", "FAIL"]),
5940
+ head: z3.string(),
5941
+ comment_id: z3.number().int(),
5942
+ objectives: z3.array(z3.object({ id: z3.string(), met: z3.boolean() }).strict()),
5943
+ findings: z3.array(ReviewFindingSchema)
5786
5944
  }).strict(),
5787
- z2.object({
5788
- type: z2.literal("escalation"),
5789
- class: z2.enum(["authority", "strategy", "product"]),
5790
- comment_id: z2.number().int()
5945
+ z3.object({
5946
+ type: z3.literal("escalation"),
5947
+ class: z3.enum(["authority", "strategy", "product"]),
5948
+ comment_id: z3.number().int()
5791
5949
  }).strict(),
5792
- z2.object({ type: z2.literal("brief"), comment_id: z2.number().int(), hash: z2.string() }).strict(),
5793
- z2.object({ type: z2.literal("plan"), issues: z2.array(z2.number().int()) }).strict(),
5794
- z2.object({ type: z2.literal("archive"), provenance_comment_id: z2.number().int() }).strict(),
5795
- z2.object({ type: z2.literal("completed") }).strict()
5950
+ z3.object({ type: z3.literal("brief"), comment_id: z3.number().int(), hash: z3.string() }).strict(),
5951
+ z3.object({ type: z3.literal("plan"), issues: z3.array(z3.number().int()) }).strict(),
5952
+ z3.object({ type: z3.literal("archive"), provenance_comment_id: z3.number().int() }).strict(),
5953
+ z3.object({ type: z3.literal("completed") }).strict()
5796
5954
  ]);
5797
5955
  var dispatchShared = {
5798
5956
  meta: HeaderMetaSchema,
5799
5957
  subject: SubjectSchema,
5800
- kind: z2.literal("dispatch"),
5958
+ kind: z3.literal("dispatch"),
5801
5959
  ...envelopeTail,
5802
5960
  target_role: RoleSchema,
5803
- model: z2.string(),
5804
- round: z2.number().int().optional(),
5805
- effect_id: z2.string()
5961
+ model: z3.string(),
5962
+ round: z3.number().int().optional(),
5963
+ effect_id: z3.string()
5806
5964
  };
5807
- var dispatchUsageField = z2.object({ input: z2.number().nonnegative(), output: z2.number().nonnegative() }).strict().nullable();
5808
- var DispatchEventSchema = z2.discriminatedUnion("event", [
5809
- z2.object({ ...dispatchShared, event: z2.literal("dispatched"), prompt_hash: z2.string() }).strict(),
5810
- z2.object({
5965
+ var dispatchUsageField = z3.object({ input: z3.number().nonnegative(), output: z3.number().nonnegative() }).strict().nullable();
5966
+ var DispatchEventSchema = z3.discriminatedUnion("event", [
5967
+ z3.object({ ...dispatchShared, event: z3.literal("dispatched"), prompt_hash: z3.string() }).strict(),
5968
+ z3.object({
5811
5969
  ...dispatchShared,
5812
- event: z2.literal("outcome_received"),
5970
+ event: z3.literal("outcome_received"),
5813
5971
  outcome: DispatchOutcomeSchema,
5814
5972
  usage: dispatchUsageField
5815
5973
  }).strict(),
5816
- z2.object({
5974
+ z3.object({
5817
5975
  ...dispatchShared,
5818
- event: z2.literal("dispatch_failed"),
5819
- reason: z2.enum(["timeout", "crash", "refused", "unattributed_write"]),
5976
+ event: z3.literal("dispatch_failed"),
5977
+ reason: z3.enum(["timeout", "crash", "refused", "unattributed_write", "usage_limit"]),
5978
+ usage_limit: z3.object({ agent: z3.string().min(1), reset_at: z3.string().nullable() }).strict().optional(),
5820
5979
  usage: dispatchUsageField
5821
5980
  }).strict()
5822
5981
  ]);
5982
+ var CODE_TOKEN_PATTERN = /^[A-Za-z0-9._-]{1,64}$/;
5983
+ var CodeTokenSchema = z3.string().regex(CODE_TOKEN_PATTERN);
5984
+ var ReviewerVerdictSchema = z3.object({
5985
+ role: RoleSchema,
5986
+ outcome: z3.enum(["approve", "changes_requested", "not_reviewed"]),
5987
+ blockers: z3.number().int().nonnegative()
5988
+ }).strict();
5823
5989
  var loopShared = {
5824
5990
  meta: HeaderMetaSchema,
5825
5991
  subject: SubjectSchema,
5826
- kind: z2.literal("dev_review_loop"),
5992
+ kind: z3.literal("dev_review_loop"),
5827
5993
  ...envelopeTail,
5828
- loop_id: z2.string()
5994
+ loop_id: z3.string()
5829
5995
  };
5830
- var DevReviewLoopEventSchema = z2.discriminatedUnion("event", [
5831
- z2.object({
5996
+ var DevReviewLoopEventSchema = z3.discriminatedUnion("event", [
5997
+ z3.object({
5832
5998
  ...loopShared,
5833
- event: z2.literal("loop_started"),
5834
- task: z2.number().int(),
5835
- policy: z2.object({
5836
- max_rounds: z2.number().int().nonnegative(),
5837
- reviewers: z2.array(RoleSchema),
5838
- models: z2.record(RoleSchema, z2.string())
5999
+ event: z3.literal("loop_started"),
6000
+ task: z3.number().int(),
6001
+ policy: z3.object({
6002
+ max_rounds: z3.number().int().nonnegative(),
6003
+ reviewers: z3.array(RoleSchema),
6004
+ models: z3.record(RoleSchema, z3.string())
5839
6005
  }).strict()
5840
6006
  }).strict(),
5841
- z2.object({ ...loopShared, event: z2.literal("round_started"), round: z2.number().int(), base_head: z2.string() }).strict(),
5842
- z2.object({
6007
+ z3.object({ ...loopShared, event: z3.literal("round_started"), round: z3.number().int(), base_head: z3.string() }).strict(),
6008
+ z3.object({
5843
6009
  ...loopShared,
5844
- event: z2.literal("gate_result_read"),
5845
- round: z2.number().int(),
5846
- head: z2.string(),
5847
- green: z2.boolean(),
5848
- confidence_value: z2.number().int().min(0).max(100).optional(),
5849
- confidence_reason: z2.string().max(CONFIDENCE_REASON_MAX_LENGTH).optional(),
5850
- confidence_unavailable: z2.boolean().optional(),
5851
- extra_turn_spent: z2.boolean().optional()
6010
+ event: z3.literal("gate_result_read"),
6011
+ round: z3.number().int(),
6012
+ head: z3.string(),
6013
+ green: z3.boolean(),
6014
+ confidence_value: z3.number().int().min(0).max(100).optional(),
6015
+ confidence_reason: z3.string().max(CONFIDENCE_REASON_MAX_LENGTH).optional(),
6016
+ confidence_unavailable: z3.boolean().optional(),
6017
+ extra_turn_spent: z3.boolean().optional()
5852
6018
  }).strict(),
5853
- z2.object({
6019
+ z3.object({
5854
6020
  ...loopShared,
5855
- event: z2.literal("verdicts_read"),
5856
- round: z2.number().int(),
5857
- head: z2.string(),
5858
- all_approve: z2.boolean(),
5859
- blockers: z2.number().int().nonnegative(),
5860
- findings: z2.array(ReviewFindingSchema).optional()
6021
+ event: z3.literal("verdicts_read"),
6022
+ round: z3.number().int(),
6023
+ head: z3.string(),
6024
+ all_approve: z3.boolean(),
6025
+ blockers: z3.number().int().nonnegative(),
6026
+ findings: z3.array(ReviewFindingSchema).optional(),
6027
+ reviewers: z3.array(ReviewerVerdictSchema).optional()
5861
6028
  }).strict(),
5862
- z2.object({
6029
+ z3.object({
5863
6030
  ...loopShared,
5864
- event: z2.literal("findings_compared"),
5865
- round: z2.number().int(),
5866
- open: z2.array(z2.string()),
5867
- resolved: z2.array(z2.string()),
5868
- new: z2.array(z2.string()),
5869
- recurring: z2.array(z2.string())
6031
+ event: z3.literal("findings_compared"),
6032
+ round: z3.number().int(),
6033
+ open: z3.array(z3.string()),
6034
+ resolved: z3.array(z3.string()),
6035
+ new: z3.array(z3.string()),
6036
+ recurring: z3.array(z3.string())
5870
6037
  }).strict(),
5871
- z2.object({
6038
+ z3.object({
5872
6039
  ...loopShared,
5873
- event: z2.literal("stop_condition_met"),
5874
- round: z2.number().int(),
5875
- condition: z2.enum([
6040
+ event: z3.literal("stop_condition_met"),
6041
+ round: z3.number().int(),
6042
+ condition: z3.enum([
5876
6043
  "green",
5877
6044
  "max_rounds",
5878
6045
  "no_progress",
@@ -5881,66 +6048,85 @@ var DevReviewLoopEventSchema = z2.discriminatedUnion("event", [
5881
6048
  "confidence",
5882
6049
  "reappearance",
5883
6050
  "repeat_finding",
5884
- "repeat_failure"
6051
+ "repeat_failure",
6052
+ "time_budget"
5885
6053
  ])
5886
6054
  }).strict(),
5887
- z2.object({
6055
+ z3.object({
6056
+ ...loopShared,
6057
+ event: z3.literal("paused"),
6058
+ round: z3.number().int(),
6059
+ reason: z3.enum(["escalation", "principal_item", "refreeze_needed"]),
6060
+ reason_code: CodeTokenSchema.optional()
6061
+ }).strict(),
6062
+ z3.object({
6063
+ ...loopShared,
6064
+ event: z3.literal("resumed"),
6065
+ round: z3.number().int(),
6066
+ by: z3.enum(["principal", "driver"])
6067
+ }).strict(),
6068
+ z3.object({
5888
6069
  ...loopShared,
5889
- event: z2.literal("paused"),
5890
- round: z2.number().int(),
5891
- reason: z2.enum(["escalation", "principal_item", "refreeze_needed"])
6070
+ event: z3.literal("cancelled"),
6071
+ round: z3.number().int(),
6072
+ by: z3.literal("principal")
5892
6073
  }).strict(),
5893
- z2.object({
6074
+ z3.object({
5894
6075
  ...loopShared,
5895
- event: z2.literal("resumed"),
5896
- round: z2.number().int(),
5897
- by: z2.enum(["principal", "driver"])
6076
+ event: z3.literal("unpushed_work_resume"),
6077
+ round: z3.number().int(),
6078
+ branch: z3.string(),
6079
+ detail: z3.string()
5898
6080
  }).strict(),
5899
- z2.object({
6081
+ z3.object({
5900
6082
  ...loopShared,
5901
- event: z2.literal("cancelled"),
5902
- round: z2.number().int(),
5903
- by: z2.literal("principal")
6083
+ event: z3.literal("round_ended"),
6084
+ round: z3.number().int(),
6085
+ base_head: z3.string(),
6086
+ head: z3.string(),
6087
+ files_changed: z3.number().int().nonnegative(),
6088
+ insertions: z3.number().int().nonnegative(),
6089
+ deletions: z3.number().int().nonnegative(),
6090
+ wall_ms: z3.number().nonnegative(),
6091
+ outcome: z3.enum(["green", "changes_requested", "escalated"])
5904
6092
  }).strict(),
5905
- z2.object({
6093
+ z3.object({
5906
6094
  ...loopShared,
5907
- event: z2.literal("unpushed_work_resume"),
5908
- round: z2.number().int(),
5909
- branch: z2.string(),
5910
- detail: z2.string()
6095
+ event: z3.literal("journal_finalized"),
6096
+ rounds: z3.number().int().nonnegative(),
6097
+ total_wall_ms: z3.number().nonnegative(),
6098
+ time_to_green_ms: z3.number().nonnegative().nullable(),
6099
+ files_changed_total: z3.number().int().nonnegative(),
6100
+ final_head: z3.string(),
6101
+ result: z3.enum(["merged_ready", "stopped"])
5911
6102
  }).strict(),
5912
- z2.object({
6103
+ z3.object({
5913
6104
  ...loopShared,
5914
- event: z2.literal("round_ended"),
5915
- round: z2.number().int(),
5916
- base_head: z2.string(),
5917
- head: z2.string(),
5918
- files_changed: z2.number().int().nonnegative(),
5919
- insertions: z2.number().int().nonnegative(),
5920
- deletions: z2.number().int().nonnegative(),
5921
- wall_ms: z2.number().nonnegative(),
5922
- outcome: z2.enum(["green", "changes_requested", "escalated"])
6105
+ event: z3.literal("infrastructure_retry"),
6106
+ round: z3.number().int(),
6107
+ failure_kind: z3.enum(["pause_comment_post", "developer_connection"]),
6108
+ attempts: z3.number().int().positive(),
6109
+ outcome: z3.enum(["recovered", "exhausted"])
5923
6110
  }).strict(),
5924
- z2.object({
6111
+ z3.object({
5925
6112
  ...loopShared,
5926
- event: z2.literal("journal_finalized"),
5927
- rounds: z2.number().int().nonnegative(),
5928
- total_wall_ms: z2.number().nonnegative(),
5929
- time_to_green_ms: z2.number().nonnegative().nullable(),
5930
- files_changed_total: z2.number().int().nonnegative(),
5931
- final_head: z2.string(),
5932
- result: z2.enum(["merged_ready", "stopped"])
6113
+ event: z3.literal("driver_heartbeat"),
6114
+ task: z3.number().int(),
6115
+ pr: z3.number().int().positive().optional(),
6116
+ round: z3.number().int(),
6117
+ phase: z3.string()
5933
6118
  }).strict(),
5934
- z2.object({
6119
+ z3.object({
5935
6120
  ...loopShared,
5936
- event: z2.literal("infrastructure_retry"),
5937
- round: z2.number().int(),
5938
- failure_kind: z2.enum(["pause_comment_post", "developer_connection"]),
5939
- attempts: z2.number().int().positive(),
5940
- outcome: z2.enum(["recovered", "exhausted"])
6121
+ event: z3.literal("driver_exited"),
6122
+ task: z3.number().int(),
6123
+ reason: z3.enum(["finished", "paused", "reexec", "error", "signal"]),
6124
+ last_decision: z3.string(),
6125
+ exit_code: z3.number().int().optional(),
6126
+ error_class: CodeTokenSchema.optional()
5941
6127
  }).strict()
5942
6128
  ]);
5943
- var ForgeOpSchema = z2.enum([
6129
+ var ForgeOpSchema = z3.enum([
5944
6130
  "pr.create",
5945
6131
  "pr.comment",
5946
6132
  "pr.body.replace",
@@ -5954,24 +6140,24 @@ var ForgeOpSchema = z2.enum([
5954
6140
  "label.add",
5955
6141
  "label.remove"
5956
6142
  ]);
5957
- var ForgeWriteTargetSchema = z2.object({
5958
- issue: z2.number().int().optional(),
5959
- pr: z2.number().int().optional()
6143
+ var ForgeWriteTargetSchema = z3.object({
6144
+ issue: z3.number().int().optional(),
6145
+ pr: z3.number().int().optional()
5960
6146
  }).strict();
5961
6147
  var forgeWriteShared = {
5962
6148
  meta: HeaderMetaSchema,
5963
6149
  subject: SubjectSchema,
5964
- kind: z2.literal("forge_write"),
6150
+ kind: z3.literal("forge_write"),
5965
6151
  ...envelopeTail,
5966
6152
  op: ForgeOpSchema,
5967
6153
  target: ForgeWriteTargetSchema
5968
6154
  };
5969
- var ForgeWriteEventSchema = z2.discriminatedUnion("event", [
5970
- z2.object({ ...forgeWriteShared, event: z2.literal("validated") }).strict(),
5971
- z2.object({ ...forgeWriteShared, event: z2.literal("refused"), reason: z2.string() }).strict(),
5972
- z2.object({ ...forgeWriteShared, event: z2.literal("written"), comment_ids: z2.array(z2.string()) }).strict()
6155
+ var ForgeWriteEventSchema = z3.discriminatedUnion("event", [
6156
+ z3.object({ ...forgeWriteShared, event: z3.literal("validated") }).strict(),
6157
+ z3.object({ ...forgeWriteShared, event: z3.literal("refused"), reason: z3.string() }).strict(),
6158
+ z3.object({ ...forgeWriteShared, event: z3.literal("written"), comment_ids: z3.array(z3.string()) }).strict()
5973
6159
  ]);
5974
- var GateOutcomeSchema = z2.enum([
6160
+ var GateOutcomeSchema = z3.enum([
5975
6161
  "pass",
5976
6162
  "fail",
5977
6163
  "wait",
@@ -5984,61 +6170,74 @@ var GateOutcomeSchema = z2.enum([
5984
6170
  var gateShared = {
5985
6171
  meta: HeaderMetaSchema,
5986
6172
  subject: SubjectSchema,
5987
- kind: z2.literal("gate"),
6173
+ kind: z3.literal("gate"),
5988
6174
  ...envelopeTail,
5989
- check: z2.string(),
5990
- check_version: z2.string().nullable(),
5991
- policy_version: z2.string().nullable(),
5992
- input_fingerprint: z2.string().nullable()
6175
+ check: z3.string(),
6176
+ check_version: z3.string().nullable(),
6177
+ policy_version: z3.string().nullable(),
6178
+ input_fingerprint: z3.string().nullable()
5993
6179
  };
5994
- var GateEventSchema = z2.discriminatedUnion("event", [
5995
- z2.object({
6180
+ var GateEventSchema = z3.discriminatedUnion("event", [
6181
+ z3.object({
5996
6182
  ...gateShared,
5997
- event: z2.literal("checked"),
6183
+ event: z3.literal("checked"),
5998
6184
  outcome: GateOutcomeSchema,
5999
- reason: z2.string().optional()
6185
+ reason: z3.string().optional()
6186
+ }).strict(),
6187
+ z3.object({
6188
+ meta: HeaderMetaSchema,
6189
+ subject: SubjectSchema,
6190
+ kind: z3.literal("gate"),
6191
+ ...envelopeTail,
6192
+ event: z3.literal("summary"),
6193
+ ran: z3.number().int().nonnegative(),
6194
+ passed: z3.number().int().nonnegative(),
6195
+ failed: z3.number().int().nonnegative(),
6196
+ skipped: z3.number().int().nonnegative(),
6197
+ failed_checks: z3.array(z3.string())
6000
6198
  }).strict()
6001
6199
  ]);
6002
- var OperationResultSchema = z2.enum(["ok", "error", "refused", "timeout", "cancelled", "unavailable"]);
6200
+ var OperationResultSchema = z3.enum(["ok", "error", "refused", "timeout", "cancelled", "unavailable"]);
6003
6201
  var operationShared = {
6004
6202
  meta: HeaderMetaSchema,
6005
6203
  subject: SubjectSchema,
6006
- kind: z2.literal("operation"),
6204
+ kind: z3.literal("operation"),
6007
6205
  ...envelopeTail,
6008
- operation: z2.string(),
6009
- target: z2.string().nullable()
6206
+ operation: z3.string(),
6207
+ target: z3.string().nullable()
6010
6208
  };
6011
- var OperationEventSchema = z2.discriminatedUnion("event", [
6012
- z2.object({
6209
+ var OperationEventSchema = z3.discriminatedUnion("event", [
6210
+ z3.object({
6013
6211
  ...operationShared,
6014
- event: z2.literal("completed"),
6212
+ event: z3.literal("completed"),
6015
6213
  result: OperationResultSchema,
6016
- error_class: z2.string().nullable()
6214
+ error_class: z3.string().nullable(),
6215
+ field_names: z3.array(z3.string().max(CUSTOM_FIELD_NAME_MAX_LENGTH)).max(CUSTOM_EVENT_MAX_FIELDS).optional()
6017
6216
  }).strict()
6018
6217
  ]);
6019
- var UsageUnitsSchema = z2.object({
6020
- input: z2.number().nonnegative().nullable(),
6021
- output: z2.number().nonnegative().nullable(),
6022
- cache: z2.number().nonnegative().nullable()
6218
+ var UsageUnitsSchema = z3.object({
6219
+ input: z3.number().nonnegative().nullable(),
6220
+ output: z3.number().nonnegative().nullable(),
6221
+ cache: z3.number().nonnegative().nullable()
6023
6222
  }).strict();
6024
6223
  var usageShared = {
6025
6224
  meta: HeaderMetaSchema,
6026
6225
  subject: SubjectSchema,
6027
- kind: z2.literal("usage"),
6226
+ kind: z3.literal("usage"),
6028
6227
  ...envelopeTail,
6029
- model: z2.string().nullable(),
6030
- source: z2.string(),
6031
- semantics: z2.enum(["cumulative", "delta"])
6228
+ model: z3.string().nullable(),
6229
+ source: z3.string(),
6230
+ semantics: z3.enum(["cumulative", "delta"])
6032
6231
  };
6033
- var UsageEventSchema = z2.discriminatedUnion("event", [
6034
- z2.object({
6232
+ var UsageEventSchema = z3.discriminatedUnion("event", [
6233
+ z3.object({
6035
6234
  ...usageShared,
6036
- event: z2.literal("observed"),
6235
+ event: z3.literal("observed"),
6037
6236
  units: UsageUnitsSchema,
6038
- unknown_reason: z2.string().nullable()
6237
+ unknown_reason: z3.string().nullable()
6039
6238
  }).strict()
6040
6239
  ]);
6041
- var RoleAttemptOutcomeSchema = z2.enum([
6240
+ var RoleAttemptOutcomeSchema = z3.enum([
6042
6241
  "completed",
6043
6242
  "incomplete",
6044
6243
  "infrastructure_failed",
@@ -6049,17 +6248,17 @@ var RoleAttemptOutcomeSchema = z2.enum([
6049
6248
  var roleAttemptShared = {
6050
6249
  meta: HeaderMetaSchema,
6051
6250
  subject: SubjectSchema,
6052
- kind: z2.literal("role_attempt"),
6251
+ kind: z3.literal("role_attempt"),
6053
6252
  ...envelopeTail,
6054
- actor: z2.string().nullable(),
6055
- attempt: z2.number().int().nullable(),
6056
- effect_id: z2.string(),
6057
- model: z2.string().nullable()
6253
+ actor: z3.string().nullable(),
6254
+ attempt: z3.number().int().nullable(),
6255
+ effect_id: z3.string(),
6256
+ model: z3.string().nullable()
6058
6257
  };
6059
- var RoleAttemptEventSchema = z2.discriminatedUnion("event", [
6060
- z2.object({
6258
+ var RoleAttemptEventSchema = z3.discriminatedUnion("event", [
6259
+ z3.object({
6061
6260
  ...roleAttemptShared,
6062
- event: z2.literal("attempted"),
6261
+ event: z3.literal("attempted"),
6063
6262
  outcome: RoleAttemptOutcomeSchema,
6064
6263
  usage: dispatchUsageField
6065
6264
  }).strict()
@@ -6067,42 +6266,59 @@ var RoleAttemptEventSchema = z2.discriminatedUnion("event", [
6067
6266
  var handoffShared = {
6068
6267
  meta: HeaderMetaSchema,
6069
6268
  subject: SubjectSchema,
6070
- kind: z2.literal("handoff"),
6269
+ kind: z3.literal("handoff"),
6071
6270
  ...envelopeTail,
6072
- class: z2.enum(["authority", "strategy", "product"]),
6073
- reason: z2.string()
6271
+ class: z3.enum(["authority", "strategy", "product"]),
6272
+ reason: z3.string()
6074
6273
  };
6075
- var HandoffEventSchema = z2.discriminatedUnion("event", [
6076
- z2.object({
6274
+ var HandoffEventSchema = z3.discriminatedUnion("event", [
6275
+ z3.object({
6077
6276
  ...handoffShared,
6078
- event: z2.literal("raised"),
6079
- requested_decision: z2.string().nullable()
6277
+ event: z3.literal("raised"),
6278
+ requested_decision: z3.string().nullable()
6080
6279
  }).strict(),
6081
- z2.object({
6280
+ z3.object({
6082
6281
  ...handoffShared,
6083
- event: z2.literal("resolved"),
6084
- resolution: z2.string().nullable(),
6085
- resolved_by: z2.string().nullable()
6282
+ event: z3.literal("resolved"),
6283
+ resolution: z3.string().nullable(),
6284
+ resolved_by: z3.string().nullable()
6086
6285
  }).strict()
6087
6286
  ]);
6088
- var EffectTargetSchema = z2.object({
6089
- kind: z2.string(),
6090
- ref: z2.string()
6287
+ var EffectTargetSchema = z3.object({
6288
+ kind: z3.string(),
6289
+ ref: z3.string()
6091
6290
  }).strict();
6092
6291
  var effectShared = {
6093
6292
  meta: HeaderMetaSchema,
6094
6293
  subject: SubjectSchema,
6095
- kind: z2.literal("effect"),
6294
+ kind: z3.literal("effect"),
6096
6295
  ...envelopeTail,
6097
- effect_id: z2.string(),
6296
+ effect_id: z3.string(),
6098
6297
  target: EffectTargetSchema
6099
6298
  };
6100
- var EffectEventSchema = z2.discriminatedUnion("event", [
6101
- z2.object({ ...effectShared, event: z2.literal("attempted") }).strict(),
6102
- z2.object({ ...effectShared, event: z2.literal("observed"), outcome: z2.enum(["success", "failure", "uncertain"]) }).strict(),
6103
- z2.object({ ...effectShared, event: z2.literal("verified"), outcome: z2.enum(["success", "failure", "uncertain"]) }).strict()
6299
+ var EffectEventSchema = z3.discriminatedUnion("event", [
6300
+ z3.object({ ...effectShared, event: z3.literal("attempted") }).strict(),
6301
+ z3.object({ ...effectShared, event: z3.literal("observed"), outcome: z3.enum(["success", "failure", "uncertain"]) }).strict(),
6302
+ z3.object({ ...effectShared, event: z3.literal("verified"), outcome: z3.enum(["success", "failure", "uncertain"]) }).strict()
6303
+ ]);
6304
+ var CustomFieldValueSchema = z3.union([z3.string().max(CUSTOM_TEXT_MAX_LENGTH), z3.number().finite(), z3.boolean()]);
6305
+ var customShared = {
6306
+ meta: HeaderMetaV3Schema,
6307
+ subject: SubjectSchema,
6308
+ kind: z3.literal("custom"),
6309
+ ...envelopeTail
6310
+ };
6311
+ var CustomEventSchema = z3.discriminatedUnion("event", [
6312
+ z3.object({
6313
+ ...customShared,
6314
+ event: z3.literal("recorded"),
6315
+ name: z3.string().max(CUSTOM_EVENT_NAME_MAX_LENGTH).regex(CUSTOM_EVENT_NAME_PATTERN),
6316
+ fields: z3.record(z3.string().max(CUSTOM_FIELD_NAME_MAX_LENGTH).regex(CUSTOM_FIELD_NAME_PATTERN), CustomFieldValueSchema).refine((f) => Object.keys(f).length <= CUSTOM_EVENT_MAX_FIELDS, {
6317
+ message: `custom: at most ${CUSTOM_EVENT_MAX_FIELDS} fields`
6318
+ })
6319
+ }).strict()
6104
6320
  ]);
6105
- var LogEventSchema = z2.union([
6321
+ var LogEventSchema = z3.union([
6106
6322
  DispatchEventSchema,
6107
6323
  DevReviewLoopEventSchema,
6108
6324
  ForgeWriteEventSchema,
@@ -6111,10 +6327,11 @@ var LogEventSchema = z2.union([
6111
6327
  UsageEventSchema,
6112
6328
  RoleAttemptEventSchema,
6113
6329
  HandoffEventSchema,
6114
- EffectEventSchema
6330
+ EffectEventSchema,
6331
+ CustomEventSchema
6115
6332
  ]);
6116
-
6117
6333
  // ../../packages/aeg-core/src/log/envelope.ts
6334
+ import { createHash as createHash5 } from "node:crypto";
6118
6335
  function isRole(value) {
6119
6336
  return value !== undefined && ROLE_VALUES.includes(value);
6120
6337
  }
@@ -6151,18 +6368,27 @@ function roundFromEnv(round) {
6151
6368
  const n = Number(round);
6152
6369
  return Number.isInteger(n) ? n : undefined;
6153
6370
  }
6371
+ function prFromEnv(pr) {
6372
+ if (pr === undefined || pr === "")
6373
+ return;
6374
+ const n = Number(pr);
6375
+ return Number.isInteger(n) && n > 0 ? n : undefined;
6376
+ }
6154
6377
  function buildHeader(input) {
6155
6378
  const role = isRole(input.env.role) ? input.env.role : "unattributed";
6156
6379
  const round = roundFromEnv(input.env.round);
6380
+ const pr = prFromEnv(input.env.pr);
6157
6381
  const subject = {
6158
6382
  issue: issueFromTask(input.env.task) ?? input.branchIssue ?? null,
6159
6383
  role,
6160
6384
  ...round !== undefined ? { round } : {},
6385
+ ...pr !== undefined ? { pr } : {},
6161
6386
  ...input.subject ?? {}
6162
6387
  };
6388
+ const issue = subject.issue;
6163
6389
  return {
6164
6390
  meta: {
6165
- schema: 2,
6391
+ schema: 3,
6166
6392
  ts: input.now.toISOString(),
6167
6393
  run_id: input.runId,
6168
6394
  seq: input.seq,
@@ -6185,7 +6411,19 @@ function buildHeader(input) {
6185
6411
  ruling_ordinal: input.inputVersions?.rulingOrdinal ?? null,
6186
6412
  policy_digest: input.inputVersions?.policyDigest ?? null
6187
6413
  },
6188
- provenance: provenanceFor(input)
6414
+ provenance: provenanceFor(input),
6415
+ work: {
6416
+ ref: lineageFieldFromEnv(input.env.workRef) ?? (issue === null ? null : String(issue)),
6417
+ repo: input.repo,
6418
+ change: null,
6419
+ revision: null
6420
+ },
6421
+ flow: {
6422
+ id: lineageFieldFromEnv(input.env.flow) ?? "vinaya",
6423
+ version: lineageFieldFromEnv(input.env.flowVersion)
6424
+ },
6425
+ runtime: lineageFieldFromEnv(input.env.runtime),
6426
+ source: lineageFieldFromEnv(input.env.source)
6189
6427
  },
6190
6428
  subject
6191
6429
  };
@@ -6228,7 +6466,7 @@ function redact(value, home) {
6228
6466
  return value;
6229
6467
  }
6230
6468
  // ../../packages/aeg-core/src/log/store.ts
6231
- var KNOWN_SCHEMA_VERSIONS = [1, 2];
6469
+ var KNOWN_SCHEMA_VERSIONS = [1, 2, 3];
6232
6470
  function metaOf(obj) {
6233
6471
  if (obj === null || typeof obj !== "object")
6234
6472
  return null;
@@ -6294,7 +6532,7 @@ function classifyStoredLine(raw, home) {
6294
6532
  return { status: "invalid", identity: null, raw, reason: "valid event with no derivable identity" };
6295
6533
  }
6296
6534
  const redacted = redact(event, home);
6297
- const provenance = version === 2 ? event.meta.provenance ?? null : null;
6535
+ const provenance = version >= 2 ? event.meta.provenance ?? null : null;
6298
6536
  return {
6299
6537
  status: "ok",
6300
6538
  identity,
@@ -6307,138 +6545,143 @@ function classifyStoredLine(raw, home) {
6307
6545
  };
6308
6546
  }
6309
6547
  // ../../packages/aeg-core/src/control-store/records.ts
6310
- import { z as z3 } from "zod";
6311
- var isoTimestamp = z3.string().min(1);
6312
- var taskId = z3.number().int().positive();
6313
- var epochNumber = z3.number().int().nonnegative();
6314
- var RunRecordSchema = z3.object({
6315
- version: z3.literal(1),
6316
- kind: z3.literal("run"),
6548
+ import { z as z4 } from "zod";
6549
+ var isoTimestamp = z4.string().min(1);
6550
+ var taskId = z4.number().int().positive();
6551
+ var epochNumber = z4.number().int().nonnegative();
6552
+ var RunRecordSchema = z4.object({
6553
+ version: z4.literal(1),
6554
+ kind: z4.literal("run"),
6317
6555
  task: taskId,
6318
- runId: z3.string().min(1),
6319
- pid: z3.number().int().positive(),
6320
- host: z3.string().min(1),
6556
+ runId: z4.string().min(1),
6557
+ pid: z4.number().int().positive(),
6558
+ host: z4.string().min(1),
6321
6559
  startedAt: isoTimestamp,
6322
- childStartedAt: z3.string().min(1).nullable().optional(),
6323
- childCommand: z3.string().min(1).nullable().optional()
6560
+ childStartedAt: z4.string().min(1).nullable().optional(),
6561
+ childCommand: z4.string().min(1).nullable().optional()
6324
6562
  }).strict();
6325
- var InputRecordSchema = z3.object({
6326
- version: z3.literal(1),
6327
- kind: z3.literal("input"),
6563
+ var InputRecordSchema = z4.object({
6564
+ version: z4.literal(1),
6565
+ kind: z4.literal("input"),
6328
6566
  task: taskId,
6329
- runId: z3.string().min(1),
6330
- source: z3.union([z3.literal("fresh"), z3.literal("resume")]),
6331
- pr: z3.number().int().positive().nullable(),
6332
- round: z3.number().int().nonnegative(),
6567
+ runId: z4.string().min(1),
6568
+ source: z4.union([z4.literal("fresh"), z4.literal("resume")]),
6569
+ pr: z4.number().int().positive().nullable(),
6570
+ round: z4.number().int().nonnegative(),
6333
6571
  recordedAt: isoTimestamp
6334
6572
  }).strict();
6335
- var OwnershipRecordSchema = z3.object({
6336
- version: z3.literal(1),
6337
- kind: z3.literal("ownership"),
6573
+ var OwnershipRecordSchema = z4.object({
6574
+ version: z4.literal(1),
6575
+ kind: z4.literal("ownership"),
6338
6576
  task: taskId,
6339
6577
  epoch: epochNumber,
6340
- ownerId: z3.string().min(1),
6341
- pid: z3.number().int().positive(),
6342
- host: z3.string().min(1),
6578
+ ownerId: z4.string().min(1),
6579
+ pid: z4.number().int().positive(),
6580
+ host: z4.string().min(1),
6343
6581
  acquiredAt: isoTimestamp
6344
6582
  }).strict();
6345
- var TransitionRecordSchema = z3.object({
6346
- version: z3.literal(1),
6347
- kind: z3.literal("transition"),
6583
+ var TransitionRecordSchema = z4.object({
6584
+ version: z4.literal(1),
6585
+ kind: z4.literal("transition"),
6348
6586
  task: taskId,
6349
6587
  epoch: epochNumber,
6350
- seq: z3.number().int().nonnegative(),
6351
- from: z3.string().min(1),
6352
- to: z3.string().min(1),
6353
- detail: z3.string().optional(),
6588
+ seq: z4.number().int().nonnegative(),
6589
+ from: z4.string().min(1),
6590
+ to: z4.string().min(1),
6591
+ detail: z4.string().optional(),
6354
6592
  at: isoTimestamp
6355
6593
  }).strict();
6356
- var ManifestRecordSchema = z3.object({
6357
- version: z3.literal(1),
6358
- kind: z3.literal("manifest"),
6594
+ var ManifestRecordSchema = z4.object({
6595
+ version: z4.literal(1),
6596
+ kind: z4.literal("manifest"),
6359
6597
  task: taskId,
6360
6598
  round: epochNumber,
6361
- repository: z3.string().min(1),
6362
- pr: z3.number().int().positive(),
6363
- branch: z3.string().min(1),
6364
- baseSha: z3.string().min(1).nullable(),
6365
- headSha: z3.string().min(1),
6366
- briefHash: z3.string().min(1).nullable(),
6367
- objectivesVersion: z3.string().min(1).nullable(),
6599
+ repository: z4.string().min(1),
6600
+ pr: z4.number().int().positive(),
6601
+ branch: z4.string().min(1),
6602
+ baseSha: z4.string().min(1).nullable(),
6603
+ headSha: z4.string().min(1),
6604
+ briefHash: z4.string().min(1).nullable(),
6605
+ objectivesVersion: z4.string().min(1).nullable(),
6368
6606
  rulingOrdinal: epochNumber,
6369
- policyDigest: z3.string().min(1),
6607
+ policyDigest: z4.string().min(1),
6370
6608
  recordedAt: isoTimestamp
6371
6609
  }).strict();
6372
- var roundHeadIdentity = z3.object({ round: z3.number().int().positive(), head: z3.string().min(1) }).strict();
6373
- var LoopBudgetsSchema = z3.object({
6374
- mechanicalRetries: z3.number().int().nonnegative(),
6375
- reviewRounds: z3.number().int().nonnegative(),
6376
- infrastructureRetries: z3.number().int().nonnegative()
6610
+ var roundHeadIdentity = z4.object({ round: z4.number().int().positive(), head: z4.string().min(1) }).strict();
6611
+ var LoopBudgetsSchema = z4.object({
6612
+ mechanicalRetries: z4.number().int().nonnegative(),
6613
+ reviewRounds: z4.number().int().nonnegative(),
6614
+ infrastructureRetries: z4.number().int().nonnegative()
6377
6615
  }).strict();
6378
- var LoopStateRecordSchema = z3.object({
6379
- version: z3.literal(1),
6380
- kind: z3.literal("loop_state"),
6616
+ var LoopStateRecordSchema = z4.object({
6617
+ version: z4.literal(1),
6618
+ kind: z4.literal("loop_state"),
6381
6619
  task: taskId,
6382
- round: z3.number().int().positive(),
6383
- phase: z3.string().min(1),
6384
- pauseReason: z3.string().min(1).nullable(),
6620
+ round: z4.number().int().positive(),
6621
+ phase: z4.string().min(1),
6622
+ pauseReason: z4.string().min(1).nullable(),
6385
6623
  budgets: LoopBudgetsSchema,
6386
6624
  heldResult: roundHeadIdentity.nullable(),
6387
6625
  deliveredFindings: roundHeadIdentity.nullable(),
6388
- repeatMemory: z3.object({
6389
- blockingFindings: z3.array(z3.string()),
6390
- lastFailure: z3.object({ signature: z3.string(), message: z3.string() }).nullable()
6626
+ repeatMemory: z4.object({
6627
+ blockingFindings: z4.array(z4.string()),
6628
+ lastFailure: z4.object({ signature: z4.string(), message: z4.string() }).nullable()
6391
6629
  }).strict().optional(),
6630
+ publicationExpectedBase: z4.string().regex(/^[0-9a-f]{40}$/).nullable().optional(),
6631
+ taskStartedAt: isoTimestamp.optional(),
6632
+ phaseMs: z4.record(z4.string(), z4.number().nonnegative()).optional(),
6392
6633
  recordedAt: isoTimestamp
6393
6634
  }).strict();
6394
- var EffectRecordSchema = z3.object({
6395
- version: z3.literal(1),
6396
- kind: z3.literal("effect"),
6635
+ var EffectRecordSchema = z4.object({
6636
+ version: z4.literal(1),
6637
+ kind: z4.literal("effect"),
6397
6638
  task: taskId,
6398
- key: z3.string().min(1),
6399
- operation: z3.string().min(1),
6400
- target: z3.string().min(1),
6401
- inputVersion: z3.number().int().nonnegative(),
6402
- payloadDigest: z3.string().min(1),
6403
- status: z3.union([z3.literal("started"), z3.literal("verified"), z3.literal("uncertain")]),
6404
- url: z3.string().optional(),
6639
+ key: z4.string().min(1),
6640
+ operation: z4.string().min(1),
6641
+ target: z4.string().min(1),
6642
+ inputVersion: z4.number().int().nonnegative(),
6643
+ payloadDigest: z4.string().min(1),
6644
+ status: z4.union([z4.literal("started"), z4.literal("verified"), z4.literal("uncertain")]),
6645
+ url: z4.string().optional(),
6405
6646
  recordedAt: isoTimestamp
6406
6647
  }).strict();
6407
- var EscalationRecordSchema = z3.object({
6408
- version: z3.literal(1),
6409
- kind: z3.literal("escalation"),
6648
+ var EscalationRecordSchema = z4.object({
6649
+ version: z4.literal(1),
6650
+ kind: z4.literal("escalation"),
6410
6651
  task: taskId,
6411
- escalationId: z3.string().min(1),
6652
+ escalationId: z4.string().min(1),
6412
6653
  round: epochNumber,
6413
- head: z3.string().min(1),
6414
- branch: z3.string().min(1),
6415
- pr: z3.number().int().positive().nullable(),
6416
- runId: z3.string().min(1),
6417
- pid: z3.number().int().positive(),
6418
- host: z3.string().min(1),
6419
- agent: z3.string().min(1).optional(),
6420
- reason: z3.string().min(1),
6421
- detail: z3.string().optional(),
6422
- evidence: z3.string().optional(),
6423
- attemptedRecovery: z3.string().min(1),
6424
- requestedDecision: z3.string().min(1),
6425
- recipient: z3.string().min(1),
6426
- briefHash: z3.string().min(1).nullable(),
6427
- objectivesVersion: z3.string().min(1).nullable(),
6654
+ head: z4.string().min(1),
6655
+ branch: z4.string().min(1),
6656
+ pr: z4.number().int().positive().nullable(),
6657
+ runId: z4.string().min(1),
6658
+ pid: z4.number().int().positive(),
6659
+ host: z4.string().min(1),
6660
+ agent: z4.string().min(1).optional(),
6661
+ reason: z4.string().min(1),
6662
+ detail: z4.string().optional(),
6663
+ evidence: z4.string().optional(),
6664
+ attemptedRecovery: z4.string().min(1),
6665
+ requestedDecision: z4.string().min(1),
6666
+ recipient: z4.string().min(1),
6667
+ briefHash: z4.string().min(1).nullable(),
6668
+ objectivesVersion: z4.string().min(1).nullable(),
6428
6669
  rulingOrdinal: epochNumber,
6429
- policyDigest: z3.string().min(1),
6670
+ policyDigest: z4.string().min(1),
6430
6671
  recordedAt: isoTimestamp
6431
6672
  }).strict();
6432
- var ResolutionRecordSchema = z3.object({
6433
- version: z3.literal(1),
6434
- kind: z3.literal("resolution"),
6673
+ var ResolutionRecordSchema = z4.object({
6674
+ version: z4.literal(1),
6675
+ kind: z4.literal("resolution"),
6435
6676
  task: taskId,
6436
- escalationId: z3.string().min(1),
6437
- decision: z3.union([z3.literal("resume"), z3.literal("cancel")]),
6438
- authenticatedBy: z3.string().min(1),
6439
- authenticatedFrom: z3.string().min(1),
6677
+ escalationId: z4.string().min(1),
6678
+ decision: z4.union([z4.literal("resume"), z4.literal("cancel")]),
6679
+ authenticatedBy: z4.string().min(1),
6680
+ authenticatedFrom: z4.string().min(1),
6440
6681
  consumedAt: isoTimestamp
6441
6682
  }).strict();
6683
+ // ../../packages/aeg-core/src/control-store/local.ts
6684
+ var CONTROL_AREA_DIRNAME = "control";
6442
6685
  // ../../packages/sources/src/commands.ts
6443
6686
  var COMMANDS = [
6444
6687
  {
@@ -6587,20 +6830,31 @@ var COMMANDS = [
6587
6830
  {
6588
6831
  flag: "--agent <claude|codex|gemini>",
6589
6832
  description: "Vendor for the developer and both reviewers this run dispatches"
6833
+ },
6834
+ {
6835
+ flag: "--quiet",
6836
+ description: "Hide the detail lines (an agent's prose, full commands, failed-result tails) on the live terminal; the driver log file keeps them"
6590
6837
  }
6591
6838
  ],
6592
6839
  details: [
6593
6840
  "Composes `task brief`'s own preparation (`prepareTask`) with the watching driver (`runDriverLoop`, `dev-review-loop.ts`) — nothing else. Preparation starts no agent; the loop's own round 1 reads the frozen brief off the Issue and is the only place a developer is ever dispatched from a fresh task, so exactly one developer is started by construction.",
6594
6841
  "A brief already frozen on the Issue is reused, never re-posted — the second `task dispatch`/`task brief` call this composes around does not fail the whole run, it just skips straight to running the loop. A task whose Issue refuses preparation (a missing brief section, an unmet dispatch gate) is refused before any agent starts, with nothing posted.",
6595
6842
  "Refuses when the frozen brief's developer branch already has an open pull request AND a driver is still live for it — a driver that crashed or was killed leaves its PR behind, and this command is the one that revives it, in any state, pause held or not.",
6596
- "issue-711 O4: a pause never ends this process — it keeps running and watches the pull request, continuing on its own once a newer Principal ruling appears (or, for an `'infrastructure'`/`'stale_driver'` pause, after a bounded backoff), with no `--resume` command needed for the ordinary case. Exit and printed summary distinguish a published pull request OR a watched pause's own genuine end — merged, closed, or an operator's own `--cancel` (exit `0` either way, the PR URL) — from the one pause this process can never watch (no pull request exists yet — exit `1`, with the exact `vinaya task run <tranche> <n>` command to continue by hand), a usage/argv error (exit `2`), and any other failure (exit `3`)."
6843
+ "issue-711 O4: a pause never ends this process — it keeps running and watches the pull request, continuing on its own once a newer Principal ruling appears (or, for an `'infrastructure'`/`'stale_driver'` pause, after a bounded backoff), with no `--resume` command needed for the ordinary case. Exit and printed summary distinguish a published pull request OR a watched pause's own genuine end — merged, closed, or an operator's own `--cancel` (exit `0` either way, the PR URL) — from the one pause this process can never watch (no pull request exists yet — exit `1`, with the working `vinaya task run` command for this task's own branch to continue by hand — `<tranche> <n>` for a tranche task, `--issue <n>` for a backlog one — never a `dev-review-loop --resume` line naming a pull-request number this pause does not have), a usage/argv error (exit `2`), and any other failure (exit `3`)."
6597
6844
  ],
6598
6845
  status: "shipped"
6599
6846
  },
6600
6847
  {
6601
6848
  name: "task status",
6602
6849
  description: "Every open task with a frozen brief, its pull request, and whether its loop is running, paused, or published",
6603
- flags: [{ flag: "--json", description: "Enveloped JSON output (schema: 1)" }],
6850
+ flags: [
6851
+ { flag: "--json", description: "Enveloped JSON output (schema: 1)" },
6852
+ {
6853
+ flag: "--follow",
6854
+ description: "Tail the task's driver log live, with its detail lines, on either the `<tranche> <n>` form or `--issue <n>`"
6855
+ },
6856
+ { flag: "--quiet", description: "With `--follow`, hide the detail lines; the log file is unchanged" }
6857
+ ],
6604
6858
  details: [
6605
6859
  "Read-only: one `gh issue list` for every open task Issue across every tranche (title/label resolved through the same `resolveTaskIssueRef` `list-tasks.ts` already uses), the open pull request per branch, and the driver pid record / pause record / publish effect markers under `<outboxRoot>/dev-review-loop/<task>/` — never a `ps` scan, never a re-parse of posted verdict comments to decide `published`.",
6606
6860
  "`running` names the driver's pid (`review-validity-v1` task 7's pid record); `paused` names the reason from the pause record; `published` means the newest round's reviewer and security verdict effect markers both read `posted`; `no driver` is the fallback when none of the above holds.",
@@ -6636,6 +6890,26 @@ var COMMANDS = [
6636
6890
  ],
6637
6891
  status: "shipped"
6638
6892
  },
6893
+ {
6894
+ name: "task-tools result-proof",
6895
+ description: "Prove, live on this host, that a CLI delivers the Developer's turn result as its own structured final output",
6896
+ flags: [{ flag: "--agent <claude|codex>", description: "The CLI to prove" }],
6897
+ details: [
6898
+ "Runs real Developer-shaped dispatches on this host — the driver-run dev-tools registered and called, the agent's own sandbox where the host supports it, the subscription login, and the dispatch's own argv — and asks for the versioned `DeveloperTurnResult` (`completed`, `blocked` or `needs_ruling`) through the CLI's native structured output: Claude Code `--json-schema` under `--output-format stream-json`, with the dispatch's Stop hook plus one that rejects the first stop; Codex `--output-schema` under `exec --json` and `exec resume --json`.",
6899
+ "Cases: a first and a resumed session (the same provider session, a fresh result, exactly one accepted); a schema-valid but semantically invalid result (an unknown finding id, a ruling request naming no permissible decision), which the driver rejects; malformed output, which never reaches the driver; and a cancelled run, a provider error and context exhaustion, each ending with no accepted result. Each case prints whether a schema-valid result reached the driver, the result, and the event it was read from; exits 1 when any case fails. Never publishes, opens a pull request or writes the forge."
6900
+ ],
6901
+ status: "shipped"
6902
+ },
6903
+ {
6904
+ name: "task-tools review-result-proof",
6905
+ description: "Prove, live on this host, that a CLI delivers a reviewer's result as its own structured final output, concurrent and fresh",
6906
+ flags: [{ flag: "--agent <claude|codex>", description: "The CLI to prove" }],
6907
+ details: [
6908
+ "Runs real reviewer-shaped dispatches on this host — fresh, non-resumed sessions, the agent's own sandbox where the host supports it, the subscription login, read-only grants, and the staged diff and review-input manifest — and asks for the versioned `ReviewResult` (`completed` or `blocked`, bound to the controller's role, head and manifest digest) through the CLI's native structured output: Claude Code `--json-schema` under `--output-format stream-json`; Codex `--output-schema` under `exec --json`. Both the code-reviewer and the security-reviewer role run, concurrently against one manifest, each accepted result attributed to its own role.",
6909
+ "Cases: a role mismatch, a wrong head and a wrong manifest digest; an objective id outside the brief, a severity outside the role's scale and a finding without a file (all refused) and a finding without a line (accepted); and a blocked, malformed, missing, cancelled, provider-error and context-exhausted outcome, each recorded as no review, never approval. Each case prints whether a schema-valid result reached the driver and what the controller made of it; exits 1 when any case fails. Never writes the forge and leaves the loop's reviewer dispatch and result files untouched."
6910
+ ],
6911
+ status: "shipped"
6912
+ },
6639
6913
  {
6640
6914
  name: "pr create",
6641
6915
  description: "Open a pull request after full brief-schema validation",
@@ -6678,13 +6952,14 @@ var COMMANDS = [
6678
6952
  },
6679
6953
  {
6680
6954
  flag: "--push",
6681
- description: "PR number; splices the same content into that PR's LIVE body (fetched from the forge) and pushes it via `gh pr edit`, self-verifying nothing outside the AEG:EVIDENCE/AEG:TOKENS regions changed. Mutually exclusive with --write."
6955
+ description: "PR number; splices the same content into that PR's LIVE body (fetched from the forge) and pushes it via `gh pr edit`, self-verifying nothing outside the AEG:EVIDENCE region changed. Mutually exclusive with --write."
6682
6956
  }
6683
6957
  ],
6684
6958
  details: [
6685
6959
  "Two groups: Group A (recomputable) is the head sha and a width-invariant `git diff --numstat` against the merge-base with `BASE_SHA` (else `origin/main`, then `main`) — `check-evidence-fresh` recomputes and byte-compares this exactly. Group B (attested) is the result of `vinaya check --all --diff-only`, this CLI's own portable gate suite — `check-evidence-fresh` can only check it for staleness (the block's recorded head still matches the PR's real head), never re-run it.",
6686
6960
  "With no `--write`/`--push`, prints the block to stdout instead of writing a file. Exits non-zero whenever the gate run failed, whether or not `--write`/`--push` was given — the block records a failing result rather than hiding one, and a non-zero exit stops a scripted `--write && open-pr` (or `--push`) from carrying a failing suite onto the forge.",
6687
- "`--push` refuses before writing anything when the live body carries no real `AEG:EVIDENCE` pair (it never appends one, unlike `--write`), when the anchor resolves differently before and after normalisation, or when `<pr>` isn't a bare number. When the live body has no real `AEG:TOKENS` pair, the token splice is skipped (same reasoning, softer outcome) rather than creating one. After pushing, it re-reads the live body and restores the pre-edit body — exiting non-zero — if anything outside the two anchored regions changed."
6961
+ "`--push` refuses before writing anything when the live body carries no real `AEG:EVIDENCE` pair (it never appends one, unlike `--write`), when the anchor resolves differently before and after normalisation, or when `<pr>` isn't a bare number. After pushing, it re-reads the live body and restores the pre-edit body — exiting non-zero — if anything outside that one anchored region changed.",
6962
+ "A pull-request body carries no token table, and this command writes none: a dispatched turn's token use is recorded as the Vinaya log's own `usage` event instead. A body that still carries an older run's table keeps it byte for byte — it is prose this command does not own, and a change inside it reads as real drift."
6688
6963
  ],
6689
6964
  status: "shipped"
6690
6965
  },
@@ -6709,7 +6984,7 @@ var COMMANDS = [
6709
6984
  "Deliberately a command, not a check: `evidence-fresh` runs inside `vinaya check --all`, and `pr report` runs `vinaya check --all --diff-only`, so a check that regenerated the block would run the suite containing itself. That recursion is why `evidence-fresh` verifies Group A only and leaves Group B attested.",
6710
6985
  "Must be run from the repository ROOT of a CLEAN checkout at the pull request's head, and refuses otherwise. The regeneration inherits the working directory and several gates resolve their scan root from it, so a subdirectory silently narrows what the fresh run inspects. On cleanliness: Group B is regenerated by diff-scoped checks, so uncommitted or untracked files change which files are scanned and can produce a MATCH a clean checkout would not. Ignored paths are deliberately NOT inspected — `git diff` never reports one, so they cannot change the scope, and including them would refuse in every real checkout since `node_modules` is ignored and always present. The head is read from the forge and both a mismatch AND an unreadable head refuse — the verdict is bound to a commit, never merely attested. `BASE_SHA` is refused as well, since it steers the regeneration's merge-base.",
6711
6986
  "Exits 0 on MATCH; 1 on DIFFERS, HIDDEN, or no block; 2 on a refusal (dirty worktree, wrong head, usage error). HIDDEN means the anchor pair sits inside a collapsed `<details>` block, where `body-bare-digits` blanks every digit and nothing can verify what it claims.",
6712
- "Comparison is a multiset of repo-relative, control-stripped lines: absolute paths (local AND foreign, so a block generated in CI compares against one generated on a laptop) and line order are ignored — a reorder is not a fabrication. Only the AEG:EVIDENCE region is read, since AEG:TOKENS appends by design. A moved merge-base is reported ALONGSIDE the differing lines, never instead of them."
6987
+ "Comparison is a multiset of repo-relative, control-stripped lines: absolute paths (local AND foreign, so a block generated in CI compares against one generated on a laptop) and line order are ignored — a reorder is not a fabrication. Only the AEG:EVIDENCE region is read: every other section of the body is prose no regeneration reproduces. A moved merge-base is reported ALONGSIDE the differing lines, never instead of them."
6713
6988
  ],
6714
6989
  status: "shipped"
6715
6990
  },
@@ -6880,7 +7155,7 @@ var COMMANDS = [
6880
7155
  { flag: "--secrets", description: "security only: the SECRETS line" },
6881
7156
  {
6882
7157
  flag: "--secrets-evidence-file",
6883
- description: 'security only: required whenever `--secrets` claims "none found" — the pasted scanner output backing that claim'
7158
+ description: 'security only: required whenever `--secrets` claims "none found" — the passing `atta-labs/secret-scan` check result on the judged head that backs it; never run or paste the scanner'
6884
7159
  },
6885
7160
  { flag: "--task-id", description: "the closing `Tokens:` line's task id" },
6886
7161
  { flag: "--model", description: "the closing `Tokens:` line's model name" },
@@ -6988,7 +7263,20 @@ var COMMANDS = [
6988
7263
  flags: [{ flag: "--yes", description: "Skip the confirmation prompt" }],
6989
7264
  details: [
6990
7265
  "Refuses if any task Issue attached to the named tranche is still open, naming each one — closing a tranche with unresolved work is never silently allowed.",
6991
- "Once every task Issue is closed, prompts for confirmation (unless `--yes`) and closes the GitHub Milestone."
7266
+ "Once every task Issue is closed, prompts for confirmation (unless `--yes`), records the tranche's retrospective in the Milestone its task Issues are attached to, and closes that Milestone once nothing else in it is still open.",
7267
+ "A tranche none of whose task Issues carry a Milestone gets one: a Milestone titled with the tranche's slug is created, the tranche's closed task Issues are attached to it, the retrospective is recorded, and it is closed — so the tranche reads as archived. An Issue already on a Milestone is never moved.",
7268
+ "Idempotent: on a tranche whose Milestone is already closed and carries its retrospective, changes nothing and says it is already archived.",
7269
+ "The generated `vinaya-archivist.yml` workflow runs it after a task pull request merges, and again when an Issue labeled with the tranche closes without a merge (dropped, replaced or closed by hand) — the tranche's slug read from that Issue's own label."
7270
+ ],
7271
+ status: "shipped"
7272
+ },
7273
+ {
7274
+ name: "archive tranches",
7275
+ description: "Archive every finished tranche that has no closed Milestone carrying its retrospective",
7276
+ flags: [{ flag: "--yes", description: "Skip the confirmation prompt" }],
7277
+ details: [
7278
+ "Walks every `vinaya/tranche:<slug>` label, skips each tranche that still has an open task Issue, and runs `archive tranche` for each finished one whose Milestone is not already closed with its retrospective. One tranche failing does not stop the others; the exit code reports it.",
7279
+ "The generated `vinaya-archivist.yml` workflow calls it on its daily scheduled run, so a tranche that finished before the workflow could see it is archived within a day. Running it again when every finished tranche is archived changes nothing and says so."
6992
7280
  ],
6993
7281
  status: "shipped"
6994
7282
  },
@@ -7132,6 +7420,29 @@ var COMMANDS = [
7132
7420
  ],
7133
7421
  status: "shipped"
7134
7422
  },
7423
+ {
7424
+ name: "log selftest",
7425
+ description: "Prove log delivery works end to end: send one marked test event and read it back — PASS (exit 0) or FAIL with the one reason (exit 1)",
7426
+ details: [
7427
+ "Resolves the destination exactly as an UNATTENDED review-loop run does in this repository — the same trust-anchor read and credential lookup, forced unattended so running it by hand proves the launch path's own resolution, not a human's. It sends one test event to the configured `logs.url` server, then reads it back from the server by the event's own id through the server's cursor read.",
7428
+ "PASS (exit 0) only when the event round-trips. Otherwise FAIL (exit 1) with the ONE reason that stopped it: no server is configured, the default branch's config could not be read to confirm the url (and why), this host holds no ingest or read credential, the server refused with its status, or the event could not be read back. It never prints a credential value.",
7429
+ "The read-back needs a READ credential distinct from the write-only ingest one the server refuses on a read route: set `logs.readHeaders` in vinaya.config.json to the server's read token (referenced by variable name, resolved from the environment exactly as `logs.headers` is). The test event is marked `operation: 'log.selftest'` so a reader can exclude it from real telemetry."
7430
+ ],
7431
+ status: "shipped"
7432
+ },
7433
+ {
7434
+ name: "log emit",
7435
+ description: "Record a consumer-declared event (`logs.events` in vinaya.config.json) from a script or agent outside Vinaya",
7436
+ flags: [
7437
+ { flag: "--json '<json>'", description: "The field values as one JSON object (else read from standard input)" }
7438
+ ],
7439
+ details: [
7440
+ "Reads the field values as ONE JSON object — `--json '<json>'` or piped on standard input, never positional arguments — and records them through `emitCustomEvent`, the same chokepoint every custom event goes through, so the refusal event and the redaction stay in one place.",
7441
+ "A declared event with every field present and of its declared type exits 0 and prints the event name and the kind of destination it was recorded toward (`folder`, `server`, or `none`) — never a field value. A refused event (an undeclared name, or a missing, extra, wrong-typed or too-long field) exits 1 and prints the reason class and the field names — never a value, since a rejected value may be the secret. A missing event name, unreadable JSON, or JSON that is not a flat object is a usage error: exit 2, before anything is recorded.",
7442
+ "A process with only `VINAYA_WORK_REF` and `VINAYA_FLOW` set, and no Vinaya role or task, still gets a header carrying that work reference and way-of-working id — the same environment read every event already honours (`apps/cli/specs/log.md` § Attribution)."
7443
+ ],
7444
+ status: "shipped"
7445
+ },
7135
7446
  {
7136
7447
  name: "log send",
7137
7448
  description: "Deliver this repository's locally-held log events to the configured `logs.url` server, once",
@@ -7144,12 +7455,19 @@ var COMMANDS = [
7144
7455
  status: "shipped"
7145
7456
  },
7146
7457
  {
7147
- name: "log set-credential",
7148
- description: "Store a `logs.headers` delivery credential in the macOS login Keychain, read from standard input",
7458
+ name: "sync",
7459
+ description: "Fill, resume and rebuild the local log cache from this repository's configured destination (read-only)",
7460
+ flags: [
7461
+ {
7462
+ flag: "--rebuild",
7463
+ description: "Delete the cache file and sync from the beginning of what the destination still retains"
7464
+ },
7465
+ { flag: "--json", description: "Enveloped JSON output (schema: 1)" }
7466
+ ],
7149
7467
  details: [
7150
- 'For a `logs.url` server whose `headers` reference a credential by variable name (`{ "authorization": "Bearer ${VINAYA_LOG_TOKEN}" }`) on a host where that variable is not in the process environment — the case an Operator the Claude desktop app starts on macOS hits, since the token lives in an interactive shell file the app never reads. It stores the value so header resolution finds it in the Keychain when the environment does not, with no token copied into any settings file.',
7151
- 'The value is read from STANDARD INPUT, never a command-line argument a `ps` listing could show — `printf %s "$TOKEN" | vinaya log set-credential VINAYA_LOG_TOKEN`. Only the variable NAME, which is not a secret, sits on the command line; the value is stored under the Keychain service `Vinaya Log` keyed by that name. The command prints a confirmation naming the variable and never echoes, returns, or logs the value.',
7152
- "macOS only (Linux keyrings are out of scope); it refuses with a clear message elsewhere. The environment still wins over the Keychain wherever the variable is set, so this changes nothing for a host that already exports it."
7468
+ "Resolves the destination exactly the way a normal event does — the sink's own decision over `vinaya.config.json`'s `logs` setting, trust-anchor-gated for an unattended caller — then reads a folder destination through the folder source or a server destination through the server source (with the configured `logs.readHeaders`, substituted from the environment), and runs the bounded sync engine against the durable cache this repository holds under its runtime directory. Prints pages read, rows stored, duplicates, edits, deletions, gaps, quarantined lines and, for a server destination, its lost-event diagnostic. Reads the destination and writes only its own cache directory — never the folder, the server, or the forge.",
7469
+ "Exits 0 when the run completed or stopped cleanly on its page bound (and says more is available), 1 when it failed part way (the progress made is kept — a second run resumes from the stored cursor), and 2 for a usage or configuration problem: no destination is configured, or a server destination is configured with no usable read credential. A missing credential names the environment variable to set and never prints its value.",
7470
+ "`--rebuild` deletes the cache file ALONE — never anything else under the cache directory — and syncs again from the beginning of what the destination still retains; an event already rotated out of a folder's single backup slot, or no longer retained by the destination, cannot be recovered and shows up as a gap, never silently."
7153
7471
  ],
7154
7472
  status: "shipped"
7155
7473
  }
@@ -7163,10 +7481,10 @@ function createForgeSource(config) {
7163
7481
  };
7164
7482
  }
7165
7483
  // ../../packages/sources/src/select-source.ts
7166
- import { z as z4 } from "zod";
7167
- var StateSourceConfigSchema = z4.discriminatedUnion("kind", [
7168
- z4.object({ kind: z4.literal("forge"), owner: z4.string(), repo: z4.string() }),
7169
- z4.object({ kind: z4.literal("file"), root: z4.string().optional() })
7484
+ import { z as z5 } from "zod";
7485
+ var StateSourceConfigSchema = z5.discriminatedUnion("kind", [
7486
+ z5.object({ kind: z5.literal("forge"), owner: z5.string(), repo: z5.string() }),
7487
+ z5.object({ kind: z5.literal("file"), root: z5.string().optional() })
7170
7488
  ]);
7171
7489
  // src/checks/contract.ts
7172
7490
  var CHECK_SCHEMA_VERSION = 1;
@@ -7176,56 +7494,34 @@ function emitCheckError(error) {
7176
7494
  }
7177
7495
 
7178
7496
  // src/lib/config.ts
7179
- import { execFile as execFile4, execFileSync as execFileSync3 } from "node:child_process";
7497
+ import { execFile as execFile4, execFileSync as execFileSync2 } from "node:child_process";
7180
7498
  import { promisify as promisify4 } from "node:util";
7181
7499
  import { existsSync, mkdirSync, readFileSync as readFileSync2, realpathSync, writeFileSync } from "node:fs";
7182
7500
  import { homedir } from "node:os";
7183
7501
  import { dirname, isAbsolute, join, resolve } from "node:path";
7184
- import { z as z5 } from "zod";
7502
+ import { z as z6 } from "zod";
7185
7503
 
7186
7504
  // src/lib/agent-vendors.ts
7187
7505
  var AGENT_VENDORS = ["skills", "claude", "gemini"];
7188
7506
 
7189
- // src/lib/worker-boundary.ts
7190
- import { execFileSync as execFileSync2 } from "node:child_process";
7191
- var LOG_HEADER_KEYCHAIN_SERVICE = "Vinaya Log";
7192
- var logHeaderKeychainCache = new Map;
7193
- function readRealLogHeaderKeychainCredential(variable) {
7194
- if (process.platform !== "darwin")
7195
- return null;
7196
- try {
7197
- return execFileSync2("/usr/bin/security", ["find-generic-password", "-s", LOG_HEADER_KEYCHAIN_SERVICE, "-a", variable, "-w"], { encoding: "utf8", stdio: ["ignore", "pipe", "ignore"], timeout: 5000, maxBuffer: 1024 * 1024 }).replace(/\n$/, "");
7198
- } catch {
7199
- return null;
7200
- }
7201
- }
7202
- function readLogHeaderKeychainCredential(variable) {
7203
- const cached = logHeaderKeychainCache.get(variable);
7204
- if (cached !== undefined)
7205
- return cached;
7206
- const value = readRealLogHeaderKeychainCredential(variable);
7207
- logHeaderKeychainCache.set(variable, value);
7208
- return value;
7209
- }
7210
-
7211
7507
  // src/lib/config.ts
7212
- var EnvEntrySchema = z5.union([
7213
- z5.literal(true),
7214
- z5.object({ optional: z5.literal(true) }),
7215
- z5.object({ anyOf: z5.array(z5.string()).min(2) }),
7216
- z5.string()
7508
+ var EnvEntrySchema = z6.union([
7509
+ z6.literal(true),
7510
+ z6.object({ optional: z6.literal(true) }),
7511
+ z6.object({ anyOf: z6.array(z6.string()).min(2) }),
7512
+ z6.string()
7217
7513
  ]);
7218
- var CheckEntrySchema = z5.object({
7219
- run: z5.string(),
7220
- scope: z5.enum(["diff", "full"]),
7221
- include: z5.array(z5.string()).optional(),
7222
- args: z5.array(z5.string()).optional(),
7223
- timeoutMs: z5.number().optional(),
7224
- env: z5.record(z5.string(), EnvEntrySchema).optional(),
7225
- requiresOpenPr: z5.boolean().optional(),
7226
- ownWorkflow: z5.boolean().optional(),
7227
- principalOwed: z5.literal(true).optional(),
7228
- validates: z5.enum(["body", "issue"]).optional()
7514
+ var CheckEntrySchema = z6.object({
7515
+ run: z6.string(),
7516
+ scope: z6.enum(["diff", "full"]),
7517
+ include: z6.array(z6.string()).optional(),
7518
+ args: z6.array(z6.string()).optional(),
7519
+ timeoutMs: z6.number().optional(),
7520
+ env: z6.record(z6.string(), EnvEntrySchema).optional(),
7521
+ requiresOpenPr: z6.boolean().optional(),
7522
+ ownWorkflow: z6.boolean().optional(),
7523
+ principalOwed: z6.literal(true).optional(),
7524
+ validates: z6.enum(["body", "issue"]).optional()
7229
7525
  }).superRefine((entry, ctx) => {
7230
7526
  if (!entry.env)
7231
7527
  return;
@@ -7235,22 +7531,22 @@ var CheckEntrySchema = z5.object({
7235
7531
  const members = value.anyOf;
7236
7532
  if (new Set(members).size !== members.length) {
7237
7533
  ctx.addIssue({
7238
- code: z5.ZodIssueCode.custom,
7534
+ code: z6.ZodIssueCode.custom,
7239
7535
  message: `env.${key}.anyOf has duplicate members`,
7240
7536
  path: ["env", key, "anyOf"]
7241
7537
  });
7242
7538
  }
7243
7539
  if (!members.includes(key)) {
7244
7540
  ctx.addIssue({
7245
- code: z5.ZodIssueCode.custom,
7541
+ code: z6.ZodIssueCode.custom,
7246
7542
  message: `env.${key}.anyOf must include "${key}" itself as a member`,
7247
7543
  path: ["env", key, "anyOf"]
7248
7544
  });
7249
7545
  }
7250
7546
  }
7251
7547
  });
7252
- var RoleEntrySchema = z5.object({
7253
- contract: z5.string().refine((p) => p.includes("/"), {
7548
+ var RoleEntrySchema = z6.object({
7549
+ contract: z6.string().refine((p) => p.includes("/"), {
7254
7550
  message: 'must be a path (contain at least one "/"), not a bare filename'
7255
7551
  })
7256
7552
  });
@@ -7274,17 +7570,17 @@ var BRIEF_BUILTINS = [
7274
7570
  "briefSections",
7275
7571
  "milestoneShape"
7276
7572
  ];
7277
- var BriefSectionSchema = z5.union([
7278
- z5.object({ builtin: z5.enum(BRIEF_BUILTINS) }),
7279
- z5.object({ heading: z5.string().min(1), name: z5.string().optional() }),
7280
- z5.object({ field: z5.string().min(1), name: z5.string().optional() }),
7281
- z5.object({ phrase: z5.string().min(1), name: z5.string().optional() })
7573
+ var BriefSectionSchema = z6.union([
7574
+ z6.object({ builtin: z6.enum(BRIEF_BUILTINS) }),
7575
+ z6.object({ heading: z6.string().min(1), name: z6.string().optional() }),
7576
+ z6.object({ field: z6.string().min(1), name: z6.string().optional() }),
7577
+ z6.object({ phrase: z6.string().min(1), name: z6.string().optional() })
7282
7578
  ]);
7283
- var BriefSchemaSchema = z5.object({
7284
- pr: z5.object({ sections: z5.array(BriefSectionSchema) }).optional(),
7285
- issue: z5.object({ sections: z5.array(BriefSectionSchema) }).optional(),
7286
- milestone: z5.object({ sections: z5.array(BriefSectionSchema) }).optional(),
7287
- ack: z5.array(z5.enum(BRIEF_BUILTINS)).optional()
7579
+ var BriefSchemaSchema = z6.object({
7580
+ pr: z6.object({ sections: z6.array(BriefSectionSchema) }).optional(),
7581
+ issue: z6.object({ sections: z6.array(BriefSectionSchema) }).optional(),
7582
+ milestone: z6.object({ sections: z6.array(BriefSectionSchema) }).optional(),
7583
+ ack: z6.array(z6.enum(BRIEF_BUILTINS)).optional()
7288
7584
  });
7289
7585
  function isSafeRepoRelPath(p) {
7290
7586
  if (p.length === 0)
@@ -7293,7 +7589,7 @@ function isSafeRepoRelPath(p) {
7293
7589
  return false;
7294
7590
  return p.split(/[\\/]/).every((seg) => seg !== ".." && seg !== "");
7295
7591
  }
7296
- var SafeRepoRelPath = z5.string().refine(isSafeRepoRelPath, {
7592
+ var SafeRepoRelPath = z6.string().refine(isSafeRepoRelPath, {
7297
7593
  message: "must be a repo-root-relative path with no `..` segment or absolute root"
7298
7594
  });
7299
7595
  var CANONICAL_HOOK_BLOCK_PREFIXES = [".git/", ".husky/", ".vinaya/hooks/", ".claude/hooks/"];
@@ -7303,22 +7599,22 @@ function isCanonicalHookBlockPath(p) {
7303
7599
  var ManagedHookBlockPath = SafeRepoRelPath.refine(isCanonicalHookBlockPath, {
7304
7600
  message: `must start with one of ${CANONICAL_HOOK_BLOCK_PREFIXES.join(", ")} (byte-exact, case-sensitive)`
7305
7601
  });
7306
- var ManagedBlockRecordSchema = z5.object({
7602
+ var ManagedBlockRecordSchema = z6.object({
7307
7603
  path: ManagedHookBlockPath,
7308
- marker: z5.string(),
7309
- comment: z5.enum(["hash", "html"])
7604
+ marker: z6.string(),
7605
+ comment: z6.enum(["hash", "html"])
7310
7606
  });
7311
- var ManagedManifestSchema = z5.object({
7312
- version: z5.number().int().positive(),
7313
- files: z5.array(SafeRepoRelPath),
7314
- blocks: z5.array(ManagedBlockRecordSchema),
7315
- labels: z5.array(z5.string()),
7316
- agents: z5.array(z5.enum(AGENT_VENDORS)).optional()
7607
+ var ManagedManifestSchema = z6.object({
7608
+ version: z6.number().int().positive(),
7609
+ files: z6.array(SafeRepoRelPath),
7610
+ blocks: z6.array(ManagedBlockRecordSchema),
7611
+ labels: z6.array(z6.string()),
7612
+ agents: z6.array(z6.enum(AGENT_VENDORS)).optional()
7317
7613
  });
7318
- var ProjectEntrySchema = z5.object({
7319
- name: z5.string().min(1),
7320
- description: z5.string().min(1).optional(),
7321
- path: z5.string().min(1).optional()
7614
+ var ProjectEntrySchema = z6.object({
7615
+ name: z6.string().min(1),
7616
+ description: z6.string().min(1).optional(),
7617
+ path: z6.string().min(1).optional()
7322
7618
  });
7323
7619
  function parseTokensCollectDeclaration(value) {
7324
7620
  const m = value.trim().match(/^(\S+)\s+(\S+)$/);
@@ -7329,90 +7625,97 @@ function parseTokensCollectDeclaration(value) {
7329
7625
  return null;
7330
7626
  return { interpreter, script };
7331
7627
  }
7332
- var VinayaConfigSchema = z5.object({
7333
- rings: z5.object({
7334
- ring1_forgeWriteInterception: z5.boolean(),
7335
- ring2_asyncAudits: z5.boolean()
7628
+ var VinayaConfigSchema = z6.object({
7629
+ rings: z6.object({
7630
+ ring1_forgeWriteInterception: z6.boolean(),
7631
+ ring2_asyncAudits: z6.boolean()
7336
7632
  }).optional(),
7337
- checks: z5.record(z5.string(), CheckEntrySchema).optional(),
7338
- roles: z5.record(z5.string(), RoleEntrySchema).optional(),
7633
+ checks: z6.record(z6.string(), CheckEntrySchema).optional(),
7634
+ roles: z6.record(z6.string(), RoleEntrySchema).optional(),
7339
7635
  briefSchema: BriefSchemaSchema.optional(),
7340
7636
  managed: ManagedManifestSchema.optional(),
7341
- principals: z5.array(z5.string()).min(1).optional(),
7342
- releaseActor: z5.string().min(1).optional(),
7343
- ci: z5.object({ setup: z5.string().min(1) }).optional(),
7344
- tokens: z5.object({
7345
- collect: z5.string().min(1).refine((v) => parseTokensCollectDeclaration(v) !== null, {
7637
+ principals: z6.array(z6.string()).min(1).optional(),
7638
+ releaseActor: z6.string().min(1).optional(),
7639
+ ci: z6.object({ setup: z6.string().min(1) }).optional(),
7640
+ tokens: z6.object({
7641
+ collect: z6.string().min(1).refine((v) => parseTokensCollectDeclaration(v) !== null, {
7346
7642
  message: 'tokens.collect must be exactly "<interpreter> <repo-relative-script-path>" — two whitespace-separated tokens, no flags, no shell syntax, no quoting'
7347
7643
  })
7348
7644
  }).optional(),
7349
- blastRadius: z5.object({ extraDomains: z5.array(z5.string()).optional() }).optional(),
7350
- proseGates: z5.object({
7351
- doctrineRoot: z5.string().min(1).optional(),
7352
- readerFacingPrefix: z5.string().min(1).optional(),
7353
- readerFacingSuffix: z5.string().min(1).optional(),
7354
- legacySlugDir: z5.string().min(1).optional(),
7355
- sourceComments: z5.object({
7356
- globs: z5.array(z5.string().min(1)).optional(),
7357
- allowlist: z5.array(z5.string().min(1)).optional(),
7358
- severity: z5.enum(["warning", "error"]).optional()
7645
+ blastRadius: z6.object({ extraDomains: z6.array(z6.string()).optional() }).optional(),
7646
+ proseGates: z6.object({
7647
+ doctrineRoot: z6.string().min(1).optional(),
7648
+ readerFacingPrefix: z6.string().min(1).optional(),
7649
+ readerFacingSuffix: z6.string().min(1).optional(),
7650
+ legacySlugDir: z6.string().min(1).optional(),
7651
+ sourceComments: z6.object({
7652
+ globs: z6.array(z6.string().min(1)).optional(),
7653
+ allowlist: z6.array(z6.string().min(1)).optional(),
7654
+ severity: z6.enum(["warning", "error"]).optional()
7359
7655
  }).optional(),
7360
- specGrandfather: z5.array(z5.string().min(1)).optional(),
7361
- specPaths: z5.array(z5.string().min(1).refine((entry) => !entry.startsWith("/") && !/^[A-Za-z]:/.test(entry), {
7656
+ specGrandfather: z6.union([z6.array(z6.string().min(1)), z6.record(z6.string().min(1), z6.number().int().min(0))]).optional(),
7657
+ specPaths: z6.array(z6.string().min(1).refine((entry) => !entry.startsWith("/") && !/^[A-Za-z]:/.test(entry), {
7362
7658
  message: "must be a repository-relative path, not an absolute one"
7363
7659
  }).refine((entry) => !entry.split(/[\\/]/).includes(".."), {
7364
7660
  message: "must stay inside the repository — no `..` segment"
7365
7661
  })).optional()
7366
7662
  }).optional(),
7367
- projects: z5.array(ProjectEntrySchema).optional(),
7368
- dispatch: z5.object({
7369
- timeoutMs: z5.number().int().positive().optional(),
7370
- killGraceMs: z5.number().int().positive().optional(),
7371
- agent: z5.enum(["claude", "codex", "gemini"]).optional(),
7372
- requireWorkerIsolation: z5.boolean().optional()
7663
+ projects: z6.array(ProjectEntrySchema).optional(),
7664
+ dispatch: z6.object({
7665
+ timeoutMs: z6.number().int().positive().optional(),
7666
+ killGraceMs: z6.number().int().positive().optional(),
7667
+ agent: z6.enum(["claude", "codex", "gemini"]).optional()
7373
7668
  }).optional(),
7374
- reviewPolicy: z5.object({
7375
- codeReviewThreshold: z5.string().min(1).optional(),
7376
- securityThreshold: z5.string().min(1).optional(),
7377
- maxRounds: z5.number().optional()
7669
+ reviewPolicy: z6.object({
7670
+ codeReviewThreshold: z6.string().min(1).optional(),
7671
+ securityThreshold: z6.string().min(1).optional(),
7672
+ maxRounds: z6.number().optional(),
7673
+ maxTaskMinutes: z6.number().optional()
7378
7674
  }).optional(),
7379
- gateCutovers: z5.object({
7380
- objectivesSinceIssue: z5.number().int().nonnegative().optional(),
7381
- briefSectionsSinceIssue: z5.number().int().nonnegative().optional(),
7382
- documentationSinceIssue: z5.number().int().nonnegative().optional(),
7383
- briefRulesSincePr: z5.number().int().nonnegative().optional(),
7384
- agentBoxesRefusedSincePr: z5.number().int().nonnegative().optional()
7675
+ securityScan: z6.object({
7676
+ command: z6.array(z6.string().min(1)).min(1)
7385
7677
  }).optional(),
7386
- planning: z5.object({
7387
- collisionThreshold: z5.number().int().nonnegative().optional()
7678
+ gateCutovers: z6.object({
7679
+ objectivesSinceIssue: z6.number().int().nonnegative().optional(),
7680
+ briefSectionsSinceIssue: z6.number().int().nonnegative().optional(),
7681
+ documentationSinceIssue: z6.number().int().nonnegative().optional(),
7682
+ briefRulesSincePr: z6.number().int().nonnegative().optional(),
7683
+ agentBoxesRefusedSincePr: z6.number().int().nonnegative().optional()
7388
7684
  }).optional(),
7389
- prePush: z5.object({
7390
- alwaysRun: z5.array(z5.string()).optional()
7685
+ planning: z6.object({
7686
+ collisionThreshold: z6.number().int().nonnegative().optional()
7391
7687
  }).optional(),
7392
- report: z5.object({
7393
- commandTimeoutMs: z5.number().int().positive().optional()
7688
+ prePush: z6.object({
7689
+ alwaysRun: z6.array(z6.string()).optional()
7690
+ }).optional(),
7691
+ report: z6.object({
7692
+ commandTimeoutMs: z6.number().int().positive().optional()
7394
7693
  }).superRefine((report, ctx) => {
7395
7694
  const commandTimeoutMs = report.commandTimeoutMs;
7396
7695
  if (commandTimeoutMs !== undefined && commandTimeoutMs > MAX_REPORT_COMMAND_TIMEOUT_MS) {
7397
7696
  ctx.addIssue({
7398
- code: z5.ZodIssueCode.custom,
7697
+ code: z6.ZodIssueCode.custom,
7399
7698
  path: ["commandTimeoutMs"],
7400
7699
  message: "must be at most 3600000 (1 hour)"
7401
7700
  });
7402
7701
  }
7403
7702
  }).optional(),
7404
- logPublish: z5.unknown().refine((v) => v === undefined, {
7703
+ logPublish: z6.unknown().refine((v) => v === undefined, {
7405
7704
  message: "logPublish is removed — telemetry is never posted to a tracker or a code host; configure `logs` instead (a folder or a server destination)"
7406
7705
  }),
7407
- runtimeDir: z5.string().min(1).refine((v) => isAbsolute(v), { message: "runtimeDir: must be an absolute path" }).optional(),
7408
- logs: z5.object({
7409
- folder: z5.string().min(1).refine((v) => isAbsolute(v), { message: "logs.folder: must be an absolute path" }).optional(),
7410
- url: z5.string().url().optional(),
7411
- headers: z5.record(z5.string()).optional()
7706
+ runtimeDir: z6.string().min(1).refine((v) => isAbsolute(v), { message: "runtimeDir: must be an absolute path" }).optional(),
7707
+ logs: z6.object({
7708
+ folder: z6.string().min(1).refine((v) => isAbsolute(v), { message: "logs.folder: must be an absolute path" }).optional(),
7709
+ url: z6.string().url().optional(),
7710
+ headers: z6.record(z6.string()).optional(),
7711
+ readHeaders: z6.record(z6.string()).optional(),
7712
+ events: CustomEventDeclarationsSchema.optional()
7412
7713
  }).refine((v) => [v.folder, v.url].filter((x) => x !== undefined).length <= 1, {
7413
7714
  message: "logs: set at most one of folder/url"
7414
7715
  }).refine((v) => v.headers === undefined || v.url !== undefined, {
7415
7716
  message: "logs: headers requires url"
7717
+ }).refine((v) => v.readHeaders === undefined || v.url !== undefined, {
7718
+ message: "logs: readHeaders requires url"
7416
7719
  }).optional()
7417
7720
  });
7418
7721
  var GLOBAL_VINAYA_HOME = join(homedir(), ".vinaya");
@@ -7517,10 +7820,15 @@ function resolveReviewPolicy(config) {
7517
7820
  if (!Number.isInteger(maxRounds) || maxRounds < 1) {
7518
7821
  throw new Error(`vinaya.config.json: reviewPolicy.maxRounds "${maxRounds}" is not a positive integer — fix the config, this never falls back to a default.`);
7519
7822
  }
7823
+ const maxTaskMinutes = raw.maxTaskMinutes ?? DEFAULT_REVIEW_POLICY.maxTaskMinutes;
7824
+ if (!Number.isInteger(maxTaskMinutes) || maxTaskMinutes < 0) {
7825
+ throw new Error(`vinaya.config.json: reviewPolicy.maxTaskMinutes "${maxTaskMinutes}" is not a non-negative integer (0 turns the budget off) — fix the config, this never falls back to a default.`);
7826
+ }
7520
7827
  return {
7521
7828
  codeReviewThreshold,
7522
7829
  securityThreshold,
7523
- maxRounds
7830
+ maxRounds,
7831
+ maxTaskMinutes
7524
7832
  };
7525
7833
  }
7526
7834
  function resolveGateCutovers(config) {
@@ -7560,17 +7868,12 @@ function resolveTrustAnchorLogsDestination(local, trustAnchorConfig) {
7560
7868
  return "url" in anchored && anchored.url === local.url ? anchored : null;
7561
7869
  return "folder" in anchored && anchored.folder === local.folder ? anchored : null;
7562
7870
  }
7563
- function resolveLogsHeaderValues(headers, env, readKeychain = readLogHeaderKeychainCredential) {
7871
+ function resolveLogsHeaderValues(headers, env) {
7564
7872
  if (!headers)
7565
7873
  return;
7566
7874
  const resolved = {};
7567
7875
  for (const [key, value] of Object.entries(headers)) {
7568
- resolved[key] = value.replace(/\$\{([A-Za-z_][A-Za-z0-9_]*)\}/g, (_match, name) => {
7569
- const fromEnv = env[name];
7570
- if (fromEnv !== undefined)
7571
- return fromEnv;
7572
- return readKeychain(name) ?? "";
7573
- });
7876
+ resolved[key] = value.replace(/\$\{([A-Za-z_][A-Za-z0-9_]*)\}/g, (_match, name) => env[name] ?? "");
7574
7877
  }
7575
7878
  return resolved;
7576
7879
  }
@@ -7579,7 +7882,7 @@ function trustAnchorRepo() {
7579
7882
  if (fromRunner)
7580
7883
  return fromRunner;
7581
7884
  try {
7582
- const url = execFileSync3("git", ["remote", "get-url", "origin"], {
7885
+ const url = execFileSync2("git", ["remote", "get-url", "origin"], {
7583
7886
  encoding: "utf-8",
7584
7887
  stdio: ["ignore", "pipe", "pipe"]
7585
7888
  });
@@ -7626,7 +7929,7 @@ function resolveCiTrustAnchorProbeRef(env = process.env) {
7626
7929
  return ref;
7627
7930
  }
7628
7931
  function readTrustAnchorConfigAtRef(ref) {
7629
- const raw = execFileSync3("git", ["show", `${ref}:${LOCAL_CONFIG_FILENAME}`], {
7932
+ const raw = execFileSync2("git", ["show", `${ref}:${LOCAL_CONFIG_FILENAME}`], {
7630
7933
  encoding: "utf-8",
7631
7934
  stdio: ["ignore", "pipe", "pipe"],
7632
7935
  timeout: 1e4
@@ -7640,7 +7943,7 @@ function ghFetchTrustAnchorConfig() {
7640
7943
  const repo = trustAnchorRepo();
7641
7944
  if (!repo)
7642
7945
  throw new Error("could not resolve repo identity for the trust-anchor read");
7643
- return execFileSync3("gh", ["api", `repos/${repo}/contents/${LOCAL_CONFIG_FILENAME}`, "--jq", ".content"], {
7946
+ return execFileSync2("gh", ["api", `repos/${repo}/contents/${LOCAL_CONFIG_FILENAME}`, "--jq", ".content"], {
7644
7947
  encoding: "utf-8",
7645
7948
  stdio: ["ignore", "pipe", "pipe"]
7646
7949
  });
@@ -7741,7 +8044,7 @@ function containedAbs(repoRoot, relPath) {
7741
8044
  }
7742
8045
 
7743
8046
  // src/checks/edge-resolve.ts
7744
- import { execFileSync as execFileSync4 } from "node:child_process";
8047
+ import { execFileSync as execFileSync3 } from "node:child_process";
7745
8048
  var DIRECT_ISSUE_REF = /#(\d+)/;
7746
8049
  var issueCache = new Map;
7747
8050
  function fetchIssueState(num, repo) {
@@ -7750,7 +8053,7 @@ function fetchIssueState(num, repo) {
7750
8053
  return issueCache.get(key) ?? null;
7751
8054
  let out = null;
7752
8055
  try {
7753
- const raw = execFileSync4("gh", [
8056
+ const raw = execFileSync3("gh", [
7754
8057
  "issue",
7755
8058
  "view",
7756
8059
  String(num),
@@ -7910,7 +8213,7 @@ var CHECK_NAME = "dispatch-readiness";
7910
8213
  var execFileAsync5 = promisify5(execFile5);
7911
8214
  function git(args) {
7912
8215
  try {
7913
- return execFileSync5("git", args, { encoding: "utf8", stdio: ["ignore", "pipe", "pipe"] }).trim();
8216
+ return execFileSync4("git", args, { encoding: "utf8", stdio: ["ignore", "pipe", "pipe"] }).trim();
7914
8217
  } catch {
7915
8218
  return "";
7916
8219
  }
@@ -7990,7 +8293,7 @@ function containedRealPath(root, p) {
7990
8293
  }
7991
8294
  function fetchIssueJson(issueNumber) {
7992
8295
  try {
7993
- const out = execFileSync5("gh", ["issue", "view", String(issueNumber), "--json", "number,state,body,labels"], {
8296
+ const out = execFileSync4("gh", ["issue", "view", String(issueNumber), "--json", "number,state,body,labels"], {
7994
8297
  encoding: "utf8",
7995
8298
  stdio: ["ignore", "pipe", "pipe"]
7996
8299
  });
@@ -8081,26 +8384,38 @@ async function runTrancheMode(trancheSlug, taskId) {
8081
8384
  } catch (err) {
8082
8385
  fail(`dispatch-gate severity:infra — could not derive tranche "${trancheSlug}" from the forge: ${err.message}`, "Confirm `gh auth status` passes and the tranche has a Milestone + labeled Issues on the forge, then re-run this check.");
8083
8386
  }
8084
- const task = tranche.tasks.find((t) => t.id === taskId);
8085
- if (!task) {
8086
- fail(`dispatch-gate row-existence: task "${taskId}" is not present in tranche "${trancheSlug}"'s forge-derived task list.`, "Confirm the branch name matches a real, forge-registered task id, or wait for the Planner to open the task Issue before re-running.");
8087
- }
8088
- const taskRefs = tranche.tasks.map((t) => ({ id: t.id, issue: t.issue }));
8089
- const snapshot = await fetchForgeFacts({
8387
+ const byIssue = await fetchForgeFactsByIssue({
8090
8388
  owner: repo.owner,
8091
8389
  repo: repo.repo,
8092
8390
  tranche: trancheSlug,
8093
- tasks: taskRefs
8391
+ tasks: tranche.tasks.map((t) => ({ id: t.id, issue: t.issue }))
8094
8392
  });
8393
+ if (byIssue.unavailable) {
8394
+ fail(`dispatch-gate severity:infra — the forge facts query for tranche "${trancheSlug}" failed: ${byIssue.reason ?? "no reason given"}`, "Confirm `gh auth status` passes and the forge is reachable, then re-run this check. This is a read failure, not a missing Issue.");
8395
+ }
8396
+ const { tasks: resolvedTasks, conflicts } = resolveDuplicateTasks(tranche.tasks, (n) => byIssue.facts.get(n)?.issueState === "open");
8397
+ const duplicate = conflicts.find((c) => c.id === taskId);
8398
+ if (duplicate) {
8399
+ fail(`dispatch-gate row-existence: task number "${taskId}" is claimed by ${duplicate.issues.length} open Issues in tranche "${trancheSlug}": ${duplicate.issues.map((n) => `#${n}`).join(", ")}.`, `Ask the Planner to close the superseded Issue as not planned (or re-number it) so task ${taskId} has exactly one open Issue, then re-run this check.`);
8400
+ }
8401
+ const task = resolvedTasks.find((t) => t.id === taskId);
8402
+ if (!task) {
8403
+ fail(`dispatch-gate row-existence: task "${taskId}" is not present in tranche "${trancheSlug}"'s forge-derived task list.`, "Confirm the branch name matches a real, forge-registered task id, or wait for the Planner to open the task Issue before re-running.");
8404
+ }
8405
+ const factsByTaskId = new Map;
8406
+ for (const t of resolvedTasks) {
8407
+ const f = t.issue !== null ? byIssue.facts.get(t.issue) : undefined;
8408
+ if (f)
8409
+ factsByTaskId.set(t.id, f);
8410
+ }
8095
8411
  const token = await resolveToken() ?? "";
8096
8412
  const openIssuesBySlug = await fetchOpenIssuesByLabel([trancheSlug], repo.owner, repo.repo, token);
8097
8413
  const openIssues = openIssuesBySlug.get(trancheSlug) ?? [];
8098
- const issueFacts = task.issue !== null ? snapshot.facts.get(task.id) : undefined;
8414
+ const issueFacts = task.issue !== null ? byIssue.facts.get(task.issue) : undefined;
8099
8415
  const issue = task.issue !== null && issueFacts ? { number: task.issue, state: issueFacts.issueState === "closed" ? "closed" : "open" } : null;
8100
8416
  const openIssueMatch = task.issue !== null ? openIssues.find((i) => i.number === task.issue) : undefined;
8101
8417
  const issueRationalePass = openIssueMatch ? checkIssueRationale(openIssueMatch.body).status !== "fail" : true;
8102
- const taskById = new Map(tranche.tasks.map((t) => [t.id, t]));
8103
- const factsByTaskId = snapshot.facts;
8418
+ const taskById = new Map(resolvedTasks.map((t) => [t.id, t]));
8104
8419
  const dependsOn = await Promise.all(task.dependsOn.map(async (dep) => {
8105
8420
  const r = await resolveEdge(dep, taskById, factsByTaskId, repo);
8106
8421
  return {
@@ -8187,6 +8502,8 @@ function recoveryPromptFor(blockerClass) {
8187
8502
  return "A declared dependency edge could not be resolved to any tranche/task/Issue — check the tranche slug and task id in the edge text, then re-run `vinaya check dispatch-readiness`.";
8188
8503
  case "depends-on-not-merged":
8189
8504
  return "A declared dependency is not merged yet. Do not start this task — wait for the named dependency PR to merge, then re-run `vinaya check dispatch-readiness`.";
8505
+ case "depends-on-read-failed":
8506
+ return "The forge could not be read for a declared dependency, so its merge status is unknown — this is a transient read failure, not a claim that the dependency is unmerged. Retry `vinaya check dispatch-readiness`; if it keeps failing, check forge access (network, rate limit, credentials) rather than waiting on the dependency.";
8190
8507
  case "conflicts-with":
8191
8508
  return "A declared conflicting task has an open or in-flight PR. Wait for it to merge before continuing, then re-run `vinaya check dispatch-readiness`.";
8192
8509
  case "prior-tranche-archival":