@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
@@ -626,6 +626,33 @@ function tasksFromIssues(issues) {
626
626
  }
627
627
  return tasks.sort((a, b) => compareTaskIds(a.id, b.id));
628
628
  }
629
+ function resolveDuplicateTasks(tasks, isOpen) {
630
+ const byId = new Map;
631
+ for (const t of tasks)
632
+ byId.set(t.id, [...byId.get(t.id) ?? [], t]);
633
+ const resolved = [];
634
+ const conflicts = [];
635
+ for (const [id, group] of byId) {
636
+ const first = group[0];
637
+ if (!first)
638
+ continue;
639
+ if (group.length === 1) {
640
+ resolved.push(first);
641
+ continue;
642
+ }
643
+ const number = (t) => t.issue ?? 0;
644
+ const open = group.filter((t) => t.issue !== null && isOpen(t.issue)).sort((a, b) => number(a) - number(b));
645
+ if (open.length > 1) {
646
+ conflicts.push({ id, issues: open.map(number) });
647
+ resolved.push(open[0]);
648
+ } else if (open.length === 1) {
649
+ resolved.push(open[0]);
650
+ } else {
651
+ resolved.push([...group].sort((a, b) => number(b) - number(a))[0]);
652
+ }
653
+ }
654
+ return { tasks: resolved.sort((a, b) => compareTaskIds(a.id, b.id)), conflicts };
655
+ }
629
656
  async function fetchTrancheIssuesAsync(owner, repo, slug) {
630
657
  return ghIssueListByAnyLabelAsync(owner, repo, [trancheLabel(slug)]);
631
658
  }
@@ -1433,7 +1460,7 @@ function mapReviewDecision(decision) {
1433
1460
  function buildBranchName(tranche, taskId) {
1434
1461
  return `task/${tranche}/${taskId}`;
1435
1462
  }
1436
- async function fetchForgeFacts(input) {
1463
+ async function fetchForgeFactsByIssue(input) {
1437
1464
  const token = await resolveGithubToken(input.token);
1438
1465
  if (!token) {
1439
1466
  return {
@@ -1443,7 +1470,13 @@ async function fetchForgeFacts(input) {
1443
1470
  reason: "No GitHub token available (set GITHUB_TOKEN/GH_TOKEN or `gh auth login`)."
1444
1471
  };
1445
1472
  }
1446
- const queriedTasks = input.tasks.filter((t) => t.issue !== null);
1473
+ const seen = new Set;
1474
+ const queriedTasks = input.tasks.filter((t) => {
1475
+ if (t.issue === null || seen.has(t.issue))
1476
+ return false;
1477
+ seen.add(t.issue);
1478
+ return true;
1479
+ });
1447
1480
  if (queriedTasks.length === 0) {
1448
1481
  return { facts: new Map, prRefs: new Map, unavailable: false };
1449
1482
  }
@@ -1471,21 +1504,52 @@ async function fetchForgeFacts(input) {
1471
1504
  };
1472
1505
  }
1473
1506
  for (const task of queriedTasks) {
1474
- const alias = aliasFor(task.id);
1475
- const raw = extractRawFromResponse(response.repository, alias);
1507
+ const raw = extractRawFromResponse(response.repository, aliasFor(task.issue));
1476
1508
  const mapped = mapForgeFacts(raw);
1477
1509
  if (mapped)
1478
- facts.set(task.id, mapped);
1510
+ facts.set(task.issue, mapped);
1479
1511
  const pr = raw.pullRequest;
1480
1512
  if (pr && typeof pr.number === "number" && typeof pr.url === "string") {
1481
- prRefs.set(task.id, { number: pr.number, url: pr.url, state: pr.state });
1513
+ prRefs.set(task.issue, { number: pr.number, url: pr.url, state: pr.state });
1482
1514
  }
1483
1515
  }
1484
1516
  return { facts, prRefs, unavailable: false };
1485
1517
  }
1518
+ async function fetchForgeFacts(input) {
1519
+ const byIssue = await fetchForgeFactsByIssue(input);
1520
+ if (byIssue.unavailable) {
1521
+ return { facts: new Map, prRefs: new Map, unavailable: true, reason: byIssue.reason };
1522
+ }
1523
+ const facts = new Map;
1524
+ const prRefs = new Map;
1525
+ const winner = new Map;
1526
+ for (const task of input.tasks) {
1527
+ if (task.issue === null)
1528
+ continue;
1529
+ const current = winner.get(task.id);
1530
+ if (current === undefined || outranks(byIssue.facts, task.issue, current))
1531
+ winner.set(task.id, task.issue);
1532
+ }
1533
+ for (const [taskId, issue] of winner) {
1534
+ const f = byIssue.facts.get(issue);
1535
+ if (f)
1536
+ facts.set(taskId, f);
1537
+ const pr = byIssue.prRefs.get(issue);
1538
+ if (pr)
1539
+ prRefs.set(taskId, pr);
1540
+ }
1541
+ return { facts, prRefs, unavailable: false };
1542
+ }
1543
+ function outranks(facts, candidate, current) {
1544
+ const candidateOpen = facts.get(candidate)?.issueState === "open";
1545
+ const currentOpen = facts.get(current)?.issueState === "open";
1546
+ if (candidateOpen !== currentOpen)
1547
+ return candidateOpen;
1548
+ return candidate > current;
1549
+ }
1486
1550
  function buildBatchQuery(tranche, tasks) {
1487
1551
  const perTask = tasks.map((task) => {
1488
- const a = aliasFor(task.id);
1552
+ const a = aliasFor(task.issue);
1489
1553
  const branch = buildBranchName(tranche, task.id);
1490
1554
  return `
1491
1555
  ${a}_issue: issue(number: ${task.issue}) {
@@ -1527,9 +1591,8 @@ function buildBatchQuery(tranche, tasks) {
1527
1591
  }
1528
1592
  }`;
1529
1593
  }
1530
- function aliasFor(taskId) {
1531
- const sanitized = taskId.replace(/[^a-zA-Z0-9_]/g, "_");
1532
- return `t_${sanitized}`;
1594
+ function aliasFor(issue) {
1595
+ return `i_${issue}`;
1533
1596
  }
1534
1597
  function extractRawFromResponse(repository, alias) {
1535
1598
  const issue = repository[`${alias}_issue`];
@@ -1884,45 +1947,6 @@ var DERIVED_STATUSES = [
1884
1947
  "incoherent"
1885
1948
  ];
1886
1949
  var DERIVABLE_STATUSES = DERIVED_STATUSES.filter((s) => s !== "backlog");
1887
- // ../../packages/aeg-core/src/parse-ledger.ts
1888
- function rowFromCells(cells) {
1889
- if (cells.length < 7)
1890
- return null;
1891
- const phase = (cells[0] ?? "").trim();
1892
- if (!phase)
1893
- return null;
1894
- return {
1895
- phase,
1896
- role: (cells[1] ?? "").trim(),
1897
- agentModel: (cells[2] ?? "").trim(),
1898
- tokensIn: parseIntCell(cells[3] ?? ""),
1899
- tokensOut: parseIntCell(cells[4] ?? ""),
1900
- cost: parseCostCell(cells[5] ?? ""),
1901
- date: (cells[6] ?? "").trim()
1902
- };
1903
- }
1904
- function parseIntCell(cell) {
1905
- const trimmed = cell.replace(/`/g, "").trim();
1906
- if (!trimmed || isEmDashOrDash(trimmed))
1907
- return null;
1908
- const normalized = trimmed.replace(/[,_\s]/g, "");
1909
- if (!/^-?\d+$/.test(normalized))
1910
- return null;
1911
- return Number(normalized);
1912
- }
1913
- function parseCostCell(cell) {
1914
- const trimmed = cell.replace(/`/g, "").trim();
1915
- if (!trimmed || isEmDashOrDash(trimmed))
1916
- return null;
1917
- const normalized = trimmed.replace(/^\$/, "").replace(/[,_\s]/g, "");
1918
- if (!/^-?\d+(\.\d+)?$/.test(normalized))
1919
- return null;
1920
- return Number(normalized);
1921
- }
1922
- function isEmDashOrDash(s) {
1923
- const t = s.trim();
1924
- return t === "—" || t === "-" || t === "–";
1925
- }
1926
1950
  // ../../packages/aeg-core/src/waiver-label.ts
1927
1951
  var WAIVER_LABEL = label("waiver-docs");
1928
1952
  var WAIVER_LABEL_REVIEW = label("waiver-review");
@@ -1938,61 +1962,6 @@ function isWaiverLabelActorVerified(opts) {
1938
1962
  return false;
1939
1963
  return isPrincipal(opts.labelActor, opts.principalAllowlist);
1940
1964
  }
1941
-
1942
- // ../../packages/aeg-core/src/parse-token-report.ts
1943
- var TOKEN_REPORT_HEADING = /^\s*(?:#{1,6}\s*Token report\s*|\*\*Token report\*\*)\s*$/i;
1944
- 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;
1945
- function parseTokenReportEntries(body) {
1946
- const lines = body.split(/\r?\n/);
1947
- const headingIdxs = [];
1948
- lines.forEach((line, i) => {
1949
- if (TOKEN_REPORT_HEADING.test(line))
1950
- headingIdxs.push(i);
1951
- });
1952
- const out = [];
1953
- for (let h = 0;h < headingIdxs.length; h++) {
1954
- const start = headingIdxs[h] + 1;
1955
- const end = h + 1 < headingIdxs.length ? headingIdxs[h + 1] : lines.length;
1956
- const section = lines.slice(start, end).join(`
1957
- `);
1958
- const tableRows = parseTableSection(section);
1959
- if (tableRows.length > 0) {
1960
- out.push(...tableRows);
1961
- continue;
1962
- }
1963
- const inlineRow = parseInlineFieldList(section);
1964
- if (inlineRow)
1965
- out.push(inlineRow);
1966
- }
1967
- return out;
1968
- }
1969
- function parseTableSection(section) {
1970
- const lines = section.split(/\r?\n/);
1971
- let i = 0;
1972
- for (;i < lines.length; i++) {
1973
- if ((lines[i] ?? "").trim().startsWith("|"))
1974
- break;
1975
- }
1976
- if (i + 1 >= lines.length)
1977
- return [];
1978
- i += 2;
1979
- const out = [];
1980
- for (;i < lines.length; i++) {
1981
- const trimmed = (lines[i] ?? "").trim();
1982
- if (!trimmed.startsWith("|"))
1983
- break;
1984
- const row = rowFromCells(splitTableRow(trimmed));
1985
- if (row)
1986
- out.push(row);
1987
- }
1988
- return out;
1989
- }
1990
- function parseInlineFieldList(section) {
1991
- const m = section.match(INLINE_FIELD_LIST);
1992
- if (!m)
1993
- return null;
1994
- return rowFromCells([m[1], m[2], m[3], m[4], m[5], m[6], m[7]]);
1995
- }
1996
1965
  // ../../packages/aeg-core/src/verdict-extraction.ts
1997
1966
  var HEAD_SHA_PATTERN = /^[ \t]*(?:\*{1,3}|_{1,3})?Judged head:\s*([0-9a-f]{7,40})(?![A-Za-z0-9])/im;
1998
1967
  var OBJECTIVES_VERSION_PATTERN = /^[ \t]*(?:\*{1,3}|_{1,3})?Objectives version:\s*([0-9a-f]{64})(?![A-Za-z0-9])/im;
@@ -2441,10 +2410,12 @@ function evaluateC5(changed, docOwnersContent, prBody, fileExists, waiverActive,
2441
2410
  var CODE_REVIEW_SEVERITY_ORDER = ["BLOCKER", "MAJOR", "MINOR"];
2442
2411
  var SECURITY_SEVERITY_ORDER = ["CRITICAL", "HIGH", "MEDIUM", "LOW"];
2443
2412
  var DEFAULT_MAX_ROUNDS = 3;
2413
+ var DEFAULT_MAX_TASK_MINUTES = 180;
2444
2414
  var DEFAULT_REVIEW_POLICY = {
2445
2415
  codeReviewThreshold: "BLOCKER",
2446
2416
  securityThreshold: "HIGH",
2447
- maxRounds: DEFAULT_MAX_ROUNDS
2417
+ maxRounds: DEFAULT_MAX_ROUNDS,
2418
+ maxTaskMinutes: DEFAULT_MAX_TASK_MINUTES
2448
2419
  };
2449
2420
  var FILE_SHAPED_LOCATION = /\.[a-zA-Z0-9]{1,10}(:\d+)?\s*$/;
2450
2421
  var PROSE_LOCATION_PATTERNS = [/\bpr\s*body\b/i, /\bcomment\b/i];
@@ -2452,6 +2423,9 @@ var ROLE_FILE_LOCATION = /(^|\/)aeg-root\/roles\//i;
2452
2423
  function isProseLocation(location) {
2453
2424
  if (ROLE_FILE_LOCATION.test(location))
2454
2425
  return true;
2426
+ return isBodyOrCommentLocation(location);
2427
+ }
2428
+ function isBodyOrCommentLocation(location) {
2455
2429
  if (FILE_SHAPED_LOCATION.test(location))
2456
2430
  return false;
2457
2431
  return PROSE_LOCATION_PATTERNS.some((pattern) => pattern.test(location));
@@ -2478,7 +2452,7 @@ function classifyFinding(finding, scale, threshold, context = {}) {
2478
2452
  const wouldBlock = blockingSeverities(scale, threshold).includes(effectiveSeverity);
2479
2453
  if (!wouldBlock)
2480
2454
  return { outcome: "non_blocking", deferralReason: null };
2481
- const hasLocation = location !== undefined && location.length > 0;
2455
+ const hasLocation = location !== undefined && location.length > 0 && !isBodyOrCommentLocation(location);
2482
2456
  if (hasLocation && context.inSurface && !context.inSurface(location)) {
2483
2457
  return { outcome: "deferred", deferralReason: "outside-surface" };
2484
2458
  }
@@ -2845,11 +2819,13 @@ function checkDocUpdateList(prBody) {
2845
2819
  return headingCheck(prBody, "(?:documentation|doc)[- ]update(?:\\s+list)?", "Documentation-update list");
2846
2820
  }
2847
2821
  function checkWorktreeStep0(prBody) {
2848
- if (/git worktree add/.test(prBody))
2822
+ if (/git worktree add/.test(prBody) || /cd \.worktrees\//.test(prBody) || /bun install --frozen-lockfile/.test(prBody))
2849
2823
  return { status: "pass", errors: [] };
2850
2824
  return {
2851
2825
  status: "fail",
2852
- errors: ["brief-validation worktree Step 0: no `git worktree add` command found in the PR body."]
2826
+ errors: [
2827
+ "brief-validation worktree Step 0: no `git worktree add`, `cd .worktrees/`, or `bun install --frozen-lockfile` command found in the PR body."
2828
+ ]
2853
2829
  };
2854
2830
  }
2855
2831
  function checkStopConditions(prBody) {
@@ -3039,7 +3015,8 @@ function isCommandBlock(content) {
3039
3015
  return COMMAND_WORDS.includes(commandWordOf(firstNonBlankLine(content)));
3040
3016
  }
3041
3017
  function isStep0Block(content) {
3042
- return firstNonBlankLine(content).startsWith("git worktree add");
3018
+ const first = firstNonBlankLine(content);
3019
+ return first.startsWith("git worktree add") || first.startsWith("cd .worktrees/") || first.startsWith("bun install --frozen-lockfile");
3043
3020
  }
3044
3021
  function checkCommandsCarryOutput(prBody) {
3045
3022
  const errors = [];
@@ -3508,10 +3485,14 @@ function legacySlugPattern(legacySlugs) {
3508
3485
  const alternation = legacySlugs.map((s) => s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")).join("|");
3509
3486
  return new RegExp(`(^|[^a-zA-Z0-9\\n-])(${alternation})([^a-zA-Z0-9\\n-]|$)`, "g");
3510
3487
  }
3488
+ function specGrandfatherPaths(specGrandfather) {
3489
+ return Array.isArray(specGrandfather) ? [...specGrandfather] : Object.keys(specGrandfather);
3490
+ }
3511
3491
  function checkUnresolvableReferences(files, readerFacingPrefix, readerFacingSuffix, legacySlugs = [], shipsPrefix = SHIPS_PREFIX, specGrandfather = [], specPaths = DEFAULT_SPEC_PATHS) {
3512
3492
  const findings = [];
3513
3493
  const legacyPattern = legacySlugPattern(legacySlugs);
3514
- const grandfathered = new Set(specGrandfather);
3494
+ const grandfatheredWhole = new Set(Array.isArray(specGrandfather) ? specGrandfather : []);
3495
+ const limits = new Map(Array.isArray(specGrandfather) ? [] : Object.entries(specGrandfather));
3515
3496
  const patterns = [
3516
3497
  { pattern: FORGE_NUMBER_PATTERN, what: "a forge number" },
3517
3498
  { pattern: TRANCHE_SLUG_VN_PATTERN, what: "an internal tranche slug" },
@@ -3530,18 +3511,19 @@ function checkUnresolvableReferences(files, readerFacingPrefix, readerFacingSuff
3530
3511
  continue;
3531
3512
  if (cls !== "product" && cls !== "spec" && !SWEPT_CLASSES.has(cls))
3532
3513
  continue;
3533
- if (cls === "spec" && grandfathered.has(file.path))
3514
+ if (cls === "spec" && grandfatheredWhole.has(file.path))
3534
3515
  continue;
3535
3516
  const blocking = cls === "product" || cls === "spec";
3536
3517
  const scrubbed = cls === "product" ? stripNonProseForProduct(file.path, file.content) : stripNonProse(file.path, file.content);
3537
3518
  const patternsToRun = cls === "product" ? productPatterns : cls === "spec" ? specPatterns : patterns;
3519
+ const fileFindings = [];
3538
3520
  for (const { pattern, what, group } of patternsToRun) {
3539
3521
  pattern.lastIndex = 0;
3540
3522
  let match = pattern.exec(scrubbed);
3541
3523
  while (match !== null) {
3542
3524
  const cited = group !== undefined ? match[group] ?? match[0] : match[0];
3543
3525
  const citedIndex = match.index + match[0].indexOf(cited);
3544
- findings.push({
3526
+ fileFindings.push({
3545
3527
  file: file.path,
3546
3528
  line: lineAt(scrubbed, citedIndex),
3547
3529
  message: `references ${what} ("${cited}") a reader outside this repo's tracker cannot resolve`,
@@ -3550,6 +3532,15 @@ function checkUnresolvableReferences(files, readerFacingPrefix, readerFacingSuff
3550
3532
  match = pattern.exec(scrubbed);
3551
3533
  }
3552
3534
  }
3535
+ const limit = cls === "spec" ? limits.get(file.path) : undefined;
3536
+ if (limit !== undefined) {
3537
+ if (fileFindings.length <= limit)
3538
+ continue;
3539
+ for (const f of fileFindings) {
3540
+ f.message += `; ${file.path} carries ${fileFindings.length} such findings, over its proseGates.specGrandfather limit of ${limit}`;
3541
+ }
3542
+ }
3543
+ findings.push(...fileFindings);
3553
3544
  }
3554
3545
  return findings;
3555
3546
  }
@@ -4131,6 +4122,8 @@ var FILE_EXTENSIONS = new Set([
4131
4122
  "html",
4132
4123
  "css"
4133
4124
  ]);
4125
+ var CI_SHARD_DIR = "apps/cli/tests/ci-shards";
4126
+ var CI_SHARD_PROBE = `${CI_SHARD_DIR}/shard-1.txt`;
4134
4127
 
4135
4128
  // ../../packages/aeg-core/src/task-branch-identity.ts
4136
4129
  var ISSUE_BRANCH_PATTERN = /^task\/issue-(\d+)$/;
@@ -4509,8 +4502,7 @@ function briefHash(brief) {
4509
4502
  function policyDigest(policy) {
4510
4503
  return createHash4("sha256").update(JSON.stringify({
4511
4504
  codeReviewThreshold: policy.codeReviewThreshold,
4512
- securityThreshold: policy.securityThreshold,
4513
- maxRounds: policy.maxRounds
4505
+ securityThreshold: policy.securityThreshold
4514
4506
  })).digest("hex");
4515
4507
  }
4516
4508
  function isBoundToHead(echoed, headSha) {
@@ -4823,7 +4815,46 @@ function parseEnforcementRegistry(content) {
4823
4815
  return result;
4824
4816
  }
4825
4817
  // ../../packages/aeg-core/src/registry-checks.ts
4826
- function checkG1(rows, existsFn) {
4818
+ var HOOK_DIR_PREFIXES = [".claude/hooks/", ".vinaya/hooks/", ".husky/", ".git/hooks/"];
4819
+ var BARE_HOOK_NAME = /^check-[A-Za-z0-9_.-]*\.sh$/;
4820
+ function basename(path) {
4821
+ return path.slice(path.lastIndexOf("/") + 1);
4822
+ }
4823
+ function lineOf(content, index) {
4824
+ let line = 1;
4825
+ for (let i = 0;i < index; i++)
4826
+ if (content.charCodeAt(i) === 10)
4827
+ line++;
4828
+ return line;
4829
+ }
4830
+ function findUnshippedHookRefs(docs, shipped) {
4831
+ const shippedNames = new Set([...shipped].map(basename));
4832
+ const findings = [];
4833
+ const flag = (doc, token, index) => {
4834
+ findings.push({
4835
+ path: doc.path,
4836
+ reason: `${doc.path}:${lineOf(doc.content, index)} names hook "${token}", which is neither tracked in git nor emitted by \`vinaya init\``
4837
+ });
4838
+ };
4839
+ for (const doc of docs) {
4840
+ for (const { cited, index } of extractCitedPaths(doc.content)) {
4841
+ if (cited.endsWith("/") || !HOOK_DIR_PREFIXES.some((p) => cited.startsWith(p)))
4842
+ continue;
4843
+ if (!shipped.has(cited))
4844
+ flag(doc, cited, index);
4845
+ }
4846
+ const spanPattern = /`([^`\n]+)`/g;
4847
+ let match = spanPattern.exec(doc.content);
4848
+ while (match !== null) {
4849
+ const token = match[1] ?? "";
4850
+ if (BARE_HOOK_NAME.test(token) && !shippedNames.has(token))
4851
+ flag(doc, token, match.index);
4852
+ match = spanPattern.exec(doc.content);
4853
+ }
4854
+ }
4855
+ return findings;
4856
+ }
4857
+ function checkG1(rows, existsFn, hookRefs) {
4827
4858
  const findings = [];
4828
4859
  for (const row of rows) {
4829
4860
  if (row.implementation === "")
@@ -4836,6 +4867,8 @@ function checkG1(rows, existsFn) {
4836
4867
  });
4837
4868
  }
4838
4869
  }
4870
+ if (hookRefs)
4871
+ findings.push(...findUnshippedHookRefs(hookRefs.docs, hookRefs.shipped));
4839
4872
  return { check: "G1", status: findings.length > 0 ? "fail" : "pass", findings };
4840
4873
  }
4841
4874
  var SCAFFOLD_PLACEHOLDER = "[undocumented — fill in why]";
@@ -4968,6 +5001,55 @@ function checkG6(rows, registeredCheckNames) {
4968
5001
  }
4969
5002
  return { check: "G6", status: findings.length > 0 ? "fail" : "pass", findings };
4970
5003
  }
5004
+ function reachesProducer(file, producers, imports) {
5005
+ const seen = new Set([file]);
5006
+ const queue = [file];
5007
+ for (let next = queue.pop();next !== undefined; next = queue.pop()) {
5008
+ if (producers.has(next))
5009
+ return true;
5010
+ for (const dep of imports.get(next) ?? []) {
5011
+ if (!seen.has(dep)) {
5012
+ seen.add(dep);
5013
+ queue.push(dep);
5014
+ }
5015
+ }
5016
+ }
5017
+ return false;
5018
+ }
5019
+ function checkG7(input) {
5020
+ if (!input.enforcementMapPresent)
5021
+ return { check: "G7", status: "info", findings: [] };
5022
+ const subjects = new Set([...input.crossingFiles, ...input.blockingFiles]);
5023
+ const findings = [];
5024
+ for (const path of subjects) {
5025
+ if (path in input.exemptions)
5026
+ continue;
5027
+ if (!reachesProducer(path, input.producers, input.imports)) {
5028
+ findings.push({
5029
+ path,
5030
+ 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`
5031
+ });
5032
+ }
5033
+ }
5034
+ for (const [path, reason] of Object.entries(input.exemptions)) {
5035
+ if (reason.trim() === "") {
5036
+ findings.push({ path, reason: `exemption for "${path}" states no reason` });
5037
+ } else if (!input.existsFn(path)) {
5038
+ findings.push({ path, reason: `exemption names "${path}", which no longer exists` });
5039
+ } else if (!subjects.has(path)) {
5040
+ findings.push({
5041
+ path,
5042
+ reason: `exemption names "${path}", which is neither a GitHub-writing file nor a blocking gate's implementation`
5043
+ });
5044
+ } else if (reachesProducer(path, input.producers, input.imports)) {
5045
+ findings.push({
5046
+ path,
5047
+ reason: `exemption names "${path}", which does reach a log producer — remove the exemption`
5048
+ });
5049
+ }
5050
+ }
5051
+ return { check: "G7", status: findings.length > 0 ? "fail" : "pass", findings };
5052
+ }
4971
5053
  // ../../packages/aeg-core/src/dead-branch-push-guard.ts
4972
5054
  function checkDeadBranchPush(input) {
4973
5055
  const { branch, prState, prNumber } = input;
@@ -5147,6 +5229,11 @@ function checkDispatchReadiness(input) {
5147
5229
  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.`);
5148
5230
  continue;
5149
5231
  }
5232
+ if (dep.readFailed === true) {
5233
+ const issueStr = dep.issue !== null ? ` (#${dep.issue})` : "";
5234
+ 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.`);
5235
+ continue;
5236
+ }
5150
5237
  if (!dep.merged && !isHandClosedByRecognizedPrincipal(dep, principalAllowlist)) {
5151
5238
  const issueStr = dep.issue !== null ? ` (#${dep.issue})` : "";
5152
5239
  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.`);
@@ -5389,7 +5476,6 @@ var TaskPrPauseSchema = z.object({
5389
5476
  var TaskPrReviewRecordSchema = z.object({
5390
5477
  verdicts: z.array(TaskPrVerdictSchema),
5391
5478
  roundMarkers: z.array(z.number().int().nonnegative()),
5392
- summaryTable: z.string().nullable(),
5393
5479
  pause: TaskPrPauseSchema.nullable()
5394
5480
  });
5395
5481
  var TaskPrReadInputSchema = z.object({
@@ -5436,16 +5522,6 @@ var TaskCancelResultSchema = z.object({
5436
5522
  authenticatedFrom: z.string().min(1),
5437
5523
  fencedEffectKeys: z.array(z.string())
5438
5524
  });
5439
- var TASK_TOOL_NAMES = [
5440
- "task_start",
5441
- "task_status",
5442
- "task_escalation_read",
5443
- "task_pr_read",
5444
- "task_resume",
5445
- "task_cancel"
5446
- ];
5447
- var OPERATOR_STATUS_FOLLOW = "task_status_follow";
5448
- var OPERATOR_TOOL_GRANT = [...TASK_TOOL_NAMES, OPERATOR_STATUS_FOLLOW];
5449
5525
  // ../../packages/aeg-core/src/first-push-dispatch-gate.ts
5450
5526
  function parseTaskBranch(branch) {
5451
5527
  const m = /^task\/([^/]+)\/([^/]+)$/.exec(branch);
@@ -5676,16 +5752,71 @@ var NO_GATE_CUTOVERS = {
5676
5752
  briefRulesSincePr: null,
5677
5753
  agentBoxesRefusedSincePr: null
5678
5754
  };
5679
- // ../../packages/aeg-core/src/dev-review-loop/types.ts
5680
- var SEVERITY_COLUMNS = ["blocker", "major", "minor", "critical", "high", "medium", "low"];
5681
- // ../../packages/aeg-core/src/dev-review-loop/journal-reconstruction.ts
5682
- var SUMMARY_TABLE_HEADER = `| round | ${SEVERITY_COLUMNS.join(" | ")} | confidence | outcome |`;
5683
- // ../../packages/aeg-core/src/log/envelope.ts
5684
- import { createHash as createHash5 } from "node:crypto";
5685
-
5686
5755
  // ../../packages/aeg-core/src/log/schema.ts
5756
+ import { z as z3 } from "zod";
5757
+
5758
+ // ../../packages/aeg-core/src/log/custom.ts
5687
5759
  import { z as z2 } from "zod";
5760
+ var CUSTOM_EVENT_NAME_PATTERN = /^[a-z][a-z0-9_]*\.[a-z][a-z0-9_.]*$/;
5761
+ var CUSTOM_EVENT_NAME_MAX_LENGTH = 64;
5762
+ var CUSTOM_EVENT_RESERVED_NAMESPACE = "vinaya";
5763
+ var CUSTOM_EVENT_MAX_FIELDS = 20;
5764
+ var CUSTOM_FIELD_NAME_PATTERN = /^[a-z][a-z0-9_]*$/;
5765
+ var CUSTOM_FIELD_NAME_MAX_LENGTH = 64;
5766
+ var CUSTOM_TEXT_MAX_LENGTH = 500;
5767
+ var CUSTOM_WORD_PATTERN = /^[a-z0-9][a-z0-9_-]*$/;
5768
+ var CUSTOM_WORD_MAX_LENGTH = 64;
5769
+ var CUSTOM_FIELD_MAX_WORDS = 50;
5770
+ var CustomFieldTypeSchema = z2.union([z2.enum(["text", "number", "boolean"]), z2.array(z2.string())]);
5771
+ var CustomEventDeclarationsSchema = z2.record(z2.string(), z2.object({
5772
+ fields: z2.record(z2.string(), CustomFieldTypeSchema)
5773
+ }).strict()).superRefine((events, ctx) => {
5774
+ for (const [name, declaration] of Object.entries(events)) {
5775
+ const refuse = (message, path = []) => {
5776
+ ctx.addIssue({
5777
+ code: z2.ZodIssueCode.custom,
5778
+ path: [name, ...path],
5779
+ message: `logs.events "${name}": ${message}`
5780
+ });
5781
+ };
5782
+ if (name.length > CUSTOM_EVENT_NAME_MAX_LENGTH) {
5783
+ refuse(`the name must be at most ${CUSTOM_EVENT_NAME_MAX_LENGTH} characters`);
5784
+ }
5785
+ if (!CUSTOM_EVENT_NAME_PATTERN.test(name)) {
5786
+ refuse("the name must be `<namespace>.<event>` — lowercase letters, digits and `_`, a dot between them");
5787
+ } else if (name.split(".")[0] === CUSTOM_EVENT_RESERVED_NAMESPACE) {
5788
+ refuse(`the \`${CUSTOM_EVENT_RESERVED_NAMESPACE}.\` namespace is reserved for Vinaya's own events`);
5789
+ }
5790
+ const fieldEntries = Object.entries(declaration.fields);
5791
+ if (fieldEntries.length > CUSTOM_EVENT_MAX_FIELDS) {
5792
+ refuse(`at most ${CUSTOM_EVENT_MAX_FIELDS} fields may be declared (found ${fieldEntries.length})`, ["fields"]);
5793
+ }
5794
+ for (const [field, type] of fieldEntries) {
5795
+ if (field.length > CUSTOM_FIELD_NAME_MAX_LENGTH || !CUSTOM_FIELD_NAME_PATTERN.test(field)) {
5796
+ 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]);
5797
+ }
5798
+ if (typeof type === "string")
5799
+ continue;
5800
+ if (type.length === 0) {
5801
+ refuse(`field "${field}": a list of words must name at least one word`, ["fields", field]);
5802
+ }
5803
+ if (type.length > CUSTOM_FIELD_MAX_WORDS) {
5804
+ refuse(`field "${field}": a list of words may name at most ${CUSTOM_FIELD_MAX_WORDS}`, ["fields", field]);
5805
+ }
5806
+ const bad = type.filter((w) => w.length > CUSTOM_WORD_MAX_LENGTH || !CUSTOM_WORD_PATTERN.test(w));
5807
+ if (bad.length > 0) {
5808
+ refuse(`field "${field}": a listed word is lowercase letters, digits, \`_\` and \`-\`, at most ${CUSTOM_WORD_MAX_LENGTH} characters`, ["fields", field]);
5809
+ }
5810
+ if (new Set(type).size !== type.length) {
5811
+ refuse(`field "${field}": a list of words names a word twice`, ["fields", field]);
5812
+ }
5813
+ }
5814
+ }
5815
+ });
5816
+
5817
+ // ../../packages/aeg-core/src/log/schema.ts
5688
5818
  var CONFIDENCE_REASON_MAX_LENGTH = 280;
5819
+ var REVIEW_FINDING_DESCRIPTION_MAX_LENGTH = 1000;
5689
5820
  var ROLE_VALUES = [
5690
5821
  "planner",
5691
5822
  "developer",
@@ -5695,178 +5826,214 @@ var ROLE_VALUES = [
5695
5826
  "archivist",
5696
5827
  "architect"
5697
5828
  ];
5698
- var RoleSchema = z2.enum(ROLE_VALUES);
5829
+ var RoleSchema = z3.enum(ROLE_VALUES);
5699
5830
  var HOST_VALUES = ["hook", "ci", "cli", "loop"];
5700
- var HostSchema = z2.enum(HOST_VALUES);
5831
+ var HostSchema = z3.enum(HOST_VALUES);
5701
5832
  var RUN_ID_PATTERN = /^[A-Za-z0-9_.-]{1,128}$/;
5702
5833
  var headerMetaCore = {
5703
- ts: z2.string(),
5704
- run_id: z2.string().regex(RUN_ID_PATTERN),
5705
- seq: z2.number().int().nonnegative(),
5706
- repo: z2.string().nullable(),
5707
- vinaya: z2.string(),
5708
- doctrine: z2.string(),
5834
+ ts: z3.string(),
5835
+ run_id: z3.string().regex(RUN_ID_PATTERN),
5836
+ seq: z3.number().int().nonnegative(),
5837
+ repo: z3.string().nullable(),
5838
+ vinaya: z3.string(),
5839
+ doctrine: z3.string(),
5709
5840
  host: HostSchema,
5710
- machine: z2.string()
5841
+ machine: z3.string()
5711
5842
  };
5712
- var HeaderMetaV1Schema = z2.object({
5713
- schema: z2.literal(1),
5843
+ var HeaderMetaV1Schema = z3.object({
5844
+ schema: z3.literal(1),
5714
5845
  ...headerMetaCore
5715
5846
  }).strict();
5716
- var LineageSchema = z2.object({
5717
- run: z2.string().nullable(),
5718
- attempt: z2.number().int().nullable(),
5719
- parent: z2.string().nullable()
5847
+ var LineageSchema = z3.object({
5848
+ run: z3.string().nullable(),
5849
+ attempt: z3.number().int().nullable(),
5850
+ parent: z3.string().nullable()
5720
5851
  }).strict();
5721
- var InputVersionsSchema = z2.object({
5722
- objectives_version: z2.string().nullable(),
5723
- brief_hash: z2.string().nullable(),
5724
- ruling_ordinal: z2.number().int().nullable(),
5725
- policy_digest: z2.string().nullable()
5852
+ var InputVersionsSchema = z3.object({
5853
+ objectives_version: z3.string().nullable(),
5854
+ brief_hash: z3.string().nullable(),
5855
+ ruling_ordinal: z3.number().int().nullable(),
5856
+ policy_digest: z3.string().nullable()
5726
5857
  }).strict();
5727
- var ProvenanceSchema = z2.enum(["parent_attributed", "env_correlated", "self_reported", "unavailable"]);
5728
- var HeaderMetaV2Schema = z2.object({
5729
- schema: z2.literal(2),
5858
+ var ProvenanceSchema = z3.enum(["parent_attributed", "env_correlated", "self_reported", "unavailable"]);
5859
+ var HeaderMetaV2Schema = z3.object({
5860
+ schema: z3.literal(2),
5730
5861
  ...headerMetaCore,
5731
- event_id: z2.string().min(1),
5732
- process_id: z2.string().min(1),
5733
- actor_id: z2.string().nullable(),
5862
+ event_id: z3.string().min(1),
5863
+ process_id: z3.string().min(1),
5864
+ actor_id: z3.string().nullable(),
5734
5865
  lineage: LineageSchema,
5735
5866
  input_versions: InputVersionsSchema,
5736
5867
  provenance: ProvenanceSchema
5737
5868
  }).strict();
5738
- var HeaderMetaSchema = z2.discriminatedUnion("schema", [HeaderMetaV1Schema, HeaderMetaV2Schema]);
5739
- var SubjectSchema = z2.object({
5740
- issue: z2.number().int().nullable(),
5741
- pr: z2.number().int().optional(),
5742
- sha: z2.string().optional(),
5743
- role: z2.union([RoleSchema, z2.literal("unattributed")]),
5744
- round: z2.number().int().optional(),
5745
- objectives_version: z2.string().optional()
5869
+ var WorkSchema = z3.object({
5870
+ ref: z3.string().nullable(),
5871
+ repo: z3.string().nullable(),
5872
+ change: z3.string().nullable(),
5873
+ revision: z3.string().nullable()
5746
5874
  }).strict();
5747
- var HeaderSchema = z2.object({
5875
+ var FlowSchema = z3.object({
5876
+ id: z3.string().nullable(),
5877
+ version: z3.string().nullable()
5878
+ }).strict();
5879
+ var HeaderMetaV3Schema = z3.object({
5880
+ schema: z3.literal(3),
5881
+ ...headerMetaCore,
5882
+ event_id: z3.string().min(1),
5883
+ process_id: z3.string().min(1),
5884
+ actor_id: z3.string().nullable(),
5885
+ lineage: LineageSchema,
5886
+ input_versions: InputVersionsSchema,
5887
+ provenance: ProvenanceSchema,
5888
+ work: WorkSchema,
5889
+ flow: FlowSchema,
5890
+ runtime: z3.string().nullable(),
5891
+ source: z3.string().nullable()
5892
+ }).strict();
5893
+ var HeaderMetaSchema = z3.discriminatedUnion("schema", [HeaderMetaV1Schema, HeaderMetaV2Schema, HeaderMetaV3Schema]);
5894
+ var SubjectSchema = z3.object({
5895
+ issue: z3.number().int().nullable(),
5896
+ pr: z3.number().int().optional(),
5897
+ sha: z3.string().optional(),
5898
+ role: z3.union([RoleSchema, z3.literal("unattributed")]),
5899
+ round: z3.number().int().optional(),
5900
+ objectives_version: z3.string().optional()
5901
+ }).strict();
5902
+ var HeaderSchema = z3.object({
5748
5903
  meta: HeaderMetaSchema,
5749
5904
  subject: SubjectSchema
5750
5905
  }).strict();
5751
5906
  var envelopeTail = {
5752
- duration_ms: z2.number().nonnegative().optional(),
5753
- payload: z2.object({}).strict()
5907
+ duration_ms: z3.number().nonnegative().optional(),
5908
+ payload: z3.object({}).strict()
5754
5909
  };
5755
- var ReviewFindingSchema = z2.object({
5756
- id: z2.string(),
5757
- severity: z2.string(),
5758
- state: z2.string().optional(),
5759
- severity_scale: z2.string().optional(),
5760
- policy_treatment: z2.enum(["blocking", "non_blocking", "unavailable"]).optional(),
5761
- confidence: z2.number().min(0).max(1).optional(),
5762
- confidence_scale: z2.string().optional(),
5763
- confidence_source: z2.string().optional()
5910
+ var ReviewFindingSchema = z3.object({
5911
+ id: z3.string(),
5912
+ severity: z3.string(),
5913
+ location: z3.string().optional(),
5914
+ deferral_reason: z3.enum(["outside-surface", "unchanged-line"]).optional(),
5915
+ description: z3.string().max(REVIEW_FINDING_DESCRIPTION_MAX_LENGTH).optional(),
5916
+ state: z3.string().optional(),
5917
+ severity_scale: z3.string().optional(),
5918
+ policy_treatment: z3.enum(["blocking", "non_blocking", "unavailable"]).optional(),
5919
+ confidence: z3.number().min(0).max(1).optional(),
5920
+ confidence_scale: z3.string().optional(),
5921
+ confidence_source: z3.string().optional()
5764
5922
  }).strict();
5765
- var DispatchOutcomeSchema = z2.discriminatedUnion("type", [
5766
- z2.object({ type: z2.literal("pr_opened"), pr: z2.number().int(), head: z2.string() }).strict(),
5767
- z2.object({
5768
- type: z2.literal("round_pushed"),
5769
- pr: z2.number().int(),
5770
- head: z2.string(),
5771
- comment_id: z2.number().int()
5923
+ var DispatchOutcomeSchema = z3.discriminatedUnion("type", [
5924
+ z3.object({ type: z3.literal("pr_opened"), pr: z3.number().int(), head: z3.string() }).strict(),
5925
+ z3.object({
5926
+ type: z3.literal("round_pushed"),
5927
+ pr: z3.number().int(),
5928
+ head: z3.string(),
5929
+ comment_id: z3.number().int()
5772
5930
  }).strict(),
5773
- z2.object({
5774
- type: z2.literal("verdict"),
5775
- verdict: z2.enum(["APPROVE", "REQUEST CHANGES", "PASS", "FAIL"]),
5776
- head: z2.string(),
5777
- comment_id: z2.number().int(),
5778
- objectives: z2.array(z2.object({ id: z2.string(), met: z2.boolean() }).strict()),
5779
- findings: z2.array(ReviewFindingSchema)
5931
+ z3.object({
5932
+ type: z3.literal("verdict"),
5933
+ verdict: z3.enum(["APPROVE", "REQUEST CHANGES", "PASS", "FAIL"]),
5934
+ head: z3.string(),
5935
+ comment_id: z3.number().int(),
5936
+ objectives: z3.array(z3.object({ id: z3.string(), met: z3.boolean() }).strict()),
5937
+ findings: z3.array(ReviewFindingSchema)
5780
5938
  }).strict(),
5781
- z2.object({
5782
- type: z2.literal("escalation"),
5783
- class: z2.enum(["authority", "strategy", "product"]),
5784
- comment_id: z2.number().int()
5939
+ z3.object({
5940
+ type: z3.literal("escalation"),
5941
+ class: z3.enum(["authority", "strategy", "product"]),
5942
+ comment_id: z3.number().int()
5785
5943
  }).strict(),
5786
- z2.object({ type: z2.literal("brief"), comment_id: z2.number().int(), hash: z2.string() }).strict(),
5787
- z2.object({ type: z2.literal("plan"), issues: z2.array(z2.number().int()) }).strict(),
5788
- z2.object({ type: z2.literal("archive"), provenance_comment_id: z2.number().int() }).strict(),
5789
- z2.object({ type: z2.literal("completed") }).strict()
5944
+ z3.object({ type: z3.literal("brief"), comment_id: z3.number().int(), hash: z3.string() }).strict(),
5945
+ z3.object({ type: z3.literal("plan"), issues: z3.array(z3.number().int()) }).strict(),
5946
+ z3.object({ type: z3.literal("archive"), provenance_comment_id: z3.number().int() }).strict(),
5947
+ z3.object({ type: z3.literal("completed") }).strict()
5790
5948
  ]);
5791
5949
  var dispatchShared = {
5792
5950
  meta: HeaderMetaSchema,
5793
5951
  subject: SubjectSchema,
5794
- kind: z2.literal("dispatch"),
5952
+ kind: z3.literal("dispatch"),
5795
5953
  ...envelopeTail,
5796
5954
  target_role: RoleSchema,
5797
- model: z2.string(),
5798
- round: z2.number().int().optional(),
5799
- effect_id: z2.string()
5955
+ model: z3.string(),
5956
+ round: z3.number().int().optional(),
5957
+ effect_id: z3.string()
5800
5958
  };
5801
- var dispatchUsageField = z2.object({ input: z2.number().nonnegative(), output: z2.number().nonnegative() }).strict().nullable();
5802
- var DispatchEventSchema = z2.discriminatedUnion("event", [
5803
- z2.object({ ...dispatchShared, event: z2.literal("dispatched"), prompt_hash: z2.string() }).strict(),
5804
- z2.object({
5959
+ var dispatchUsageField = z3.object({ input: z3.number().nonnegative(), output: z3.number().nonnegative() }).strict().nullable();
5960
+ var DispatchEventSchema = z3.discriminatedUnion("event", [
5961
+ z3.object({ ...dispatchShared, event: z3.literal("dispatched"), prompt_hash: z3.string() }).strict(),
5962
+ z3.object({
5805
5963
  ...dispatchShared,
5806
- event: z2.literal("outcome_received"),
5964
+ event: z3.literal("outcome_received"),
5807
5965
  outcome: DispatchOutcomeSchema,
5808
5966
  usage: dispatchUsageField
5809
5967
  }).strict(),
5810
- z2.object({
5968
+ z3.object({
5811
5969
  ...dispatchShared,
5812
- event: z2.literal("dispatch_failed"),
5813
- reason: z2.enum(["timeout", "crash", "refused", "unattributed_write"]),
5970
+ event: z3.literal("dispatch_failed"),
5971
+ reason: z3.enum(["timeout", "crash", "refused", "unattributed_write", "usage_limit"]),
5972
+ usage_limit: z3.object({ agent: z3.string().min(1), reset_at: z3.string().nullable() }).strict().optional(),
5814
5973
  usage: dispatchUsageField
5815
5974
  }).strict()
5816
5975
  ]);
5976
+ var CODE_TOKEN_PATTERN = /^[A-Za-z0-9._-]{1,64}$/;
5977
+ var CodeTokenSchema = z3.string().regex(CODE_TOKEN_PATTERN);
5978
+ var ReviewerVerdictSchema = z3.object({
5979
+ role: RoleSchema,
5980
+ outcome: z3.enum(["approve", "changes_requested", "not_reviewed"]),
5981
+ blockers: z3.number().int().nonnegative()
5982
+ }).strict();
5817
5983
  var loopShared = {
5818
5984
  meta: HeaderMetaSchema,
5819
5985
  subject: SubjectSchema,
5820
- kind: z2.literal("dev_review_loop"),
5986
+ kind: z3.literal("dev_review_loop"),
5821
5987
  ...envelopeTail,
5822
- loop_id: z2.string()
5988
+ loop_id: z3.string()
5823
5989
  };
5824
- var DevReviewLoopEventSchema = z2.discriminatedUnion("event", [
5825
- z2.object({
5990
+ var DevReviewLoopEventSchema = z3.discriminatedUnion("event", [
5991
+ z3.object({
5826
5992
  ...loopShared,
5827
- event: z2.literal("loop_started"),
5828
- task: z2.number().int(),
5829
- policy: z2.object({
5830
- max_rounds: z2.number().int().nonnegative(),
5831
- reviewers: z2.array(RoleSchema),
5832
- models: z2.record(RoleSchema, z2.string())
5993
+ event: z3.literal("loop_started"),
5994
+ task: z3.number().int(),
5995
+ policy: z3.object({
5996
+ max_rounds: z3.number().int().nonnegative(),
5997
+ reviewers: z3.array(RoleSchema),
5998
+ models: z3.record(RoleSchema, z3.string())
5833
5999
  }).strict()
5834
6000
  }).strict(),
5835
- z2.object({ ...loopShared, event: z2.literal("round_started"), round: z2.number().int(), base_head: z2.string() }).strict(),
5836
- z2.object({
6001
+ z3.object({ ...loopShared, event: z3.literal("round_started"), round: z3.number().int(), base_head: z3.string() }).strict(),
6002
+ z3.object({
5837
6003
  ...loopShared,
5838
- event: z2.literal("gate_result_read"),
5839
- round: z2.number().int(),
5840
- head: z2.string(),
5841
- green: z2.boolean(),
5842
- confidence_value: z2.number().int().min(0).max(100).optional(),
5843
- confidence_reason: z2.string().max(CONFIDENCE_REASON_MAX_LENGTH).optional(),
5844
- confidence_unavailable: z2.boolean().optional(),
5845
- extra_turn_spent: z2.boolean().optional()
6004
+ event: z3.literal("gate_result_read"),
6005
+ round: z3.number().int(),
6006
+ head: z3.string(),
6007
+ green: z3.boolean(),
6008
+ confidence_value: z3.number().int().min(0).max(100).optional(),
6009
+ confidence_reason: z3.string().max(CONFIDENCE_REASON_MAX_LENGTH).optional(),
6010
+ confidence_unavailable: z3.boolean().optional(),
6011
+ extra_turn_spent: z3.boolean().optional()
5846
6012
  }).strict(),
5847
- z2.object({
6013
+ z3.object({
5848
6014
  ...loopShared,
5849
- event: z2.literal("verdicts_read"),
5850
- round: z2.number().int(),
5851
- head: z2.string(),
5852
- all_approve: z2.boolean(),
5853
- blockers: z2.number().int().nonnegative(),
5854
- findings: z2.array(ReviewFindingSchema).optional()
6015
+ event: z3.literal("verdicts_read"),
6016
+ round: z3.number().int(),
6017
+ head: z3.string(),
6018
+ all_approve: z3.boolean(),
6019
+ blockers: z3.number().int().nonnegative(),
6020
+ findings: z3.array(ReviewFindingSchema).optional(),
6021
+ reviewers: z3.array(ReviewerVerdictSchema).optional()
5855
6022
  }).strict(),
5856
- z2.object({
6023
+ z3.object({
5857
6024
  ...loopShared,
5858
- event: z2.literal("findings_compared"),
5859
- round: z2.number().int(),
5860
- open: z2.array(z2.string()),
5861
- resolved: z2.array(z2.string()),
5862
- new: z2.array(z2.string()),
5863
- recurring: z2.array(z2.string())
6025
+ event: z3.literal("findings_compared"),
6026
+ round: z3.number().int(),
6027
+ open: z3.array(z3.string()),
6028
+ resolved: z3.array(z3.string()),
6029
+ new: z3.array(z3.string()),
6030
+ recurring: z3.array(z3.string())
5864
6031
  }).strict(),
5865
- z2.object({
6032
+ z3.object({
5866
6033
  ...loopShared,
5867
- event: z2.literal("stop_condition_met"),
5868
- round: z2.number().int(),
5869
- condition: z2.enum([
6034
+ event: z3.literal("stop_condition_met"),
6035
+ round: z3.number().int(),
6036
+ condition: z3.enum([
5870
6037
  "green",
5871
6038
  "max_rounds",
5872
6039
  "no_progress",
@@ -5875,66 +6042,85 @@ var DevReviewLoopEventSchema = z2.discriminatedUnion("event", [
5875
6042
  "confidence",
5876
6043
  "reappearance",
5877
6044
  "repeat_finding",
5878
- "repeat_failure"
6045
+ "repeat_failure",
6046
+ "time_budget"
5879
6047
  ])
5880
6048
  }).strict(),
5881
- z2.object({
6049
+ z3.object({
6050
+ ...loopShared,
6051
+ event: z3.literal("paused"),
6052
+ round: z3.number().int(),
6053
+ reason: z3.enum(["escalation", "principal_item", "refreeze_needed"]),
6054
+ reason_code: CodeTokenSchema.optional()
6055
+ }).strict(),
6056
+ z3.object({
5882
6057
  ...loopShared,
5883
- event: z2.literal("paused"),
5884
- round: z2.number().int(),
5885
- reason: z2.enum(["escalation", "principal_item", "refreeze_needed"])
6058
+ event: z3.literal("resumed"),
6059
+ round: z3.number().int(),
6060
+ by: z3.enum(["principal", "driver"])
5886
6061
  }).strict(),
5887
- z2.object({
6062
+ z3.object({
5888
6063
  ...loopShared,
5889
- event: z2.literal("resumed"),
5890
- round: z2.number().int(),
5891
- by: z2.enum(["principal", "driver"])
6064
+ event: z3.literal("cancelled"),
6065
+ round: z3.number().int(),
6066
+ by: z3.literal("principal")
5892
6067
  }).strict(),
5893
- z2.object({
6068
+ z3.object({
5894
6069
  ...loopShared,
5895
- event: z2.literal("cancelled"),
5896
- round: z2.number().int(),
5897
- by: z2.literal("principal")
6070
+ event: z3.literal("unpushed_work_resume"),
6071
+ round: z3.number().int(),
6072
+ branch: z3.string(),
6073
+ detail: z3.string()
5898
6074
  }).strict(),
5899
- z2.object({
6075
+ z3.object({
5900
6076
  ...loopShared,
5901
- event: z2.literal("unpushed_work_resume"),
5902
- round: z2.number().int(),
5903
- branch: z2.string(),
5904
- detail: z2.string()
6077
+ event: z3.literal("round_ended"),
6078
+ round: z3.number().int(),
6079
+ base_head: z3.string(),
6080
+ head: z3.string(),
6081
+ files_changed: z3.number().int().nonnegative(),
6082
+ insertions: z3.number().int().nonnegative(),
6083
+ deletions: z3.number().int().nonnegative(),
6084
+ wall_ms: z3.number().nonnegative(),
6085
+ outcome: z3.enum(["green", "changes_requested", "escalated"])
5905
6086
  }).strict(),
5906
- z2.object({
6087
+ z3.object({
5907
6088
  ...loopShared,
5908
- event: z2.literal("round_ended"),
5909
- round: z2.number().int(),
5910
- base_head: z2.string(),
5911
- head: z2.string(),
5912
- files_changed: z2.number().int().nonnegative(),
5913
- insertions: z2.number().int().nonnegative(),
5914
- deletions: z2.number().int().nonnegative(),
5915
- wall_ms: z2.number().nonnegative(),
5916
- outcome: z2.enum(["green", "changes_requested", "escalated"])
6089
+ event: z3.literal("journal_finalized"),
6090
+ rounds: z3.number().int().nonnegative(),
6091
+ total_wall_ms: z3.number().nonnegative(),
6092
+ time_to_green_ms: z3.number().nonnegative().nullable(),
6093
+ files_changed_total: z3.number().int().nonnegative(),
6094
+ final_head: z3.string(),
6095
+ result: z3.enum(["merged_ready", "stopped"])
5917
6096
  }).strict(),
5918
- z2.object({
6097
+ z3.object({
5919
6098
  ...loopShared,
5920
- event: z2.literal("journal_finalized"),
5921
- rounds: z2.number().int().nonnegative(),
5922
- total_wall_ms: z2.number().nonnegative(),
5923
- time_to_green_ms: z2.number().nonnegative().nullable(),
5924
- files_changed_total: z2.number().int().nonnegative(),
5925
- final_head: z2.string(),
5926
- result: z2.enum(["merged_ready", "stopped"])
6099
+ event: z3.literal("infrastructure_retry"),
6100
+ round: z3.number().int(),
6101
+ failure_kind: z3.enum(["pause_comment_post", "developer_connection"]),
6102
+ attempts: z3.number().int().positive(),
6103
+ outcome: z3.enum(["recovered", "exhausted"])
5927
6104
  }).strict(),
5928
- z2.object({
6105
+ z3.object({
5929
6106
  ...loopShared,
5930
- event: z2.literal("infrastructure_retry"),
5931
- round: z2.number().int(),
5932
- failure_kind: z2.enum(["pause_comment_post", "developer_connection"]),
5933
- attempts: z2.number().int().positive(),
5934
- outcome: z2.enum(["recovered", "exhausted"])
6107
+ event: z3.literal("driver_heartbeat"),
6108
+ task: z3.number().int(),
6109
+ pr: z3.number().int().positive().optional(),
6110
+ round: z3.number().int(),
6111
+ phase: z3.string()
6112
+ }).strict(),
6113
+ z3.object({
6114
+ ...loopShared,
6115
+ event: z3.literal("driver_exited"),
6116
+ task: z3.number().int(),
6117
+ reason: z3.enum(["finished", "paused", "reexec", "error", "signal"]),
6118
+ last_decision: z3.string(),
6119
+ exit_code: z3.number().int().optional(),
6120
+ error_class: CodeTokenSchema.optional()
5935
6121
  }).strict()
5936
6122
  ]);
5937
- var ForgeOpSchema = z2.enum([
6123
+ var ForgeOpSchema = z3.enum([
5938
6124
  "pr.create",
5939
6125
  "pr.comment",
5940
6126
  "pr.body.replace",
@@ -5948,24 +6134,24 @@ var ForgeOpSchema = z2.enum([
5948
6134
  "label.add",
5949
6135
  "label.remove"
5950
6136
  ]);
5951
- var ForgeWriteTargetSchema = z2.object({
5952
- issue: z2.number().int().optional(),
5953
- pr: z2.number().int().optional()
6137
+ var ForgeWriteTargetSchema = z3.object({
6138
+ issue: z3.number().int().optional(),
6139
+ pr: z3.number().int().optional()
5954
6140
  }).strict();
5955
6141
  var forgeWriteShared = {
5956
6142
  meta: HeaderMetaSchema,
5957
6143
  subject: SubjectSchema,
5958
- kind: z2.literal("forge_write"),
6144
+ kind: z3.literal("forge_write"),
5959
6145
  ...envelopeTail,
5960
6146
  op: ForgeOpSchema,
5961
6147
  target: ForgeWriteTargetSchema
5962
6148
  };
5963
- var ForgeWriteEventSchema = z2.discriminatedUnion("event", [
5964
- z2.object({ ...forgeWriteShared, event: z2.literal("validated") }).strict(),
5965
- z2.object({ ...forgeWriteShared, event: z2.literal("refused"), reason: z2.string() }).strict(),
5966
- z2.object({ ...forgeWriteShared, event: z2.literal("written"), comment_ids: z2.array(z2.string()) }).strict()
6149
+ var ForgeWriteEventSchema = z3.discriminatedUnion("event", [
6150
+ z3.object({ ...forgeWriteShared, event: z3.literal("validated") }).strict(),
6151
+ z3.object({ ...forgeWriteShared, event: z3.literal("refused"), reason: z3.string() }).strict(),
6152
+ z3.object({ ...forgeWriteShared, event: z3.literal("written"), comment_ids: z3.array(z3.string()) }).strict()
5967
6153
  ]);
5968
- var GateOutcomeSchema = z2.enum([
6154
+ var GateOutcomeSchema = z3.enum([
5969
6155
  "pass",
5970
6156
  "fail",
5971
6157
  "wait",
@@ -5978,61 +6164,74 @@ var GateOutcomeSchema = z2.enum([
5978
6164
  var gateShared = {
5979
6165
  meta: HeaderMetaSchema,
5980
6166
  subject: SubjectSchema,
5981
- kind: z2.literal("gate"),
6167
+ kind: z3.literal("gate"),
5982
6168
  ...envelopeTail,
5983
- check: z2.string(),
5984
- check_version: z2.string().nullable(),
5985
- policy_version: z2.string().nullable(),
5986
- input_fingerprint: z2.string().nullable()
6169
+ check: z3.string(),
6170
+ check_version: z3.string().nullable(),
6171
+ policy_version: z3.string().nullable(),
6172
+ input_fingerprint: z3.string().nullable()
5987
6173
  };
5988
- var GateEventSchema = z2.discriminatedUnion("event", [
5989
- z2.object({
6174
+ var GateEventSchema = z3.discriminatedUnion("event", [
6175
+ z3.object({
5990
6176
  ...gateShared,
5991
- event: z2.literal("checked"),
6177
+ event: z3.literal("checked"),
5992
6178
  outcome: GateOutcomeSchema,
5993
- reason: z2.string().optional()
6179
+ reason: z3.string().optional()
6180
+ }).strict(),
6181
+ z3.object({
6182
+ meta: HeaderMetaSchema,
6183
+ subject: SubjectSchema,
6184
+ kind: z3.literal("gate"),
6185
+ ...envelopeTail,
6186
+ event: z3.literal("summary"),
6187
+ ran: z3.number().int().nonnegative(),
6188
+ passed: z3.number().int().nonnegative(),
6189
+ failed: z3.number().int().nonnegative(),
6190
+ skipped: z3.number().int().nonnegative(),
6191
+ failed_checks: z3.array(z3.string())
5994
6192
  }).strict()
5995
6193
  ]);
5996
- var OperationResultSchema = z2.enum(["ok", "error", "refused", "timeout", "cancelled", "unavailable"]);
6194
+ var OperationResultSchema = z3.enum(["ok", "error", "refused", "timeout", "cancelled", "unavailable"]);
5997
6195
  var operationShared = {
5998
6196
  meta: HeaderMetaSchema,
5999
6197
  subject: SubjectSchema,
6000
- kind: z2.literal("operation"),
6198
+ kind: z3.literal("operation"),
6001
6199
  ...envelopeTail,
6002
- operation: z2.string(),
6003
- target: z2.string().nullable()
6200
+ operation: z3.string(),
6201
+ target: z3.string().nullable()
6004
6202
  };
6005
- var OperationEventSchema = z2.discriminatedUnion("event", [
6006
- z2.object({
6203
+ var OperationEventSchema = z3.discriminatedUnion("event", [
6204
+ z3.object({
6007
6205
  ...operationShared,
6008
- event: z2.literal("completed"),
6206
+ event: z3.literal("completed"),
6009
6207
  result: OperationResultSchema,
6010
- error_class: z2.string().nullable()
6208
+ error_class: z3.string().nullable(),
6209
+ field_names: z3.array(z3.string().max(CUSTOM_FIELD_NAME_MAX_LENGTH)).max(CUSTOM_EVENT_MAX_FIELDS).optional()
6011
6210
  }).strict()
6012
6211
  ]);
6013
- var UsageUnitsSchema = z2.object({
6014
- input: z2.number().nonnegative().nullable(),
6015
- output: z2.number().nonnegative().nullable(),
6016
- cache: z2.number().nonnegative().nullable()
6212
+ var UsageUnitsSchema = z3.object({
6213
+ input: z3.number().nonnegative().nullable(),
6214
+ output: z3.number().nonnegative().nullable(),
6215
+ cache: z3.number().nonnegative().nullable()
6017
6216
  }).strict();
6018
6217
  var usageShared = {
6019
6218
  meta: HeaderMetaSchema,
6020
6219
  subject: SubjectSchema,
6021
- kind: z2.literal("usage"),
6220
+ kind: z3.literal("usage"),
6022
6221
  ...envelopeTail,
6023
- model: z2.string().nullable(),
6024
- source: z2.string(),
6025
- semantics: z2.enum(["cumulative", "delta"])
6222
+ model: z3.string().nullable(),
6223
+ source: z3.string(),
6224
+ semantics: z3.enum(["cumulative", "delta"])
6026
6225
  };
6027
- var UsageEventSchema = z2.discriminatedUnion("event", [
6028
- z2.object({
6226
+ var UsageEventSchema = z3.discriminatedUnion("event", [
6227
+ z3.object({
6029
6228
  ...usageShared,
6030
- event: z2.literal("observed"),
6229
+ event: z3.literal("observed"),
6031
6230
  units: UsageUnitsSchema,
6032
- unknown_reason: z2.string().nullable()
6231
+ unknown_reason: z3.string().nullable()
6033
6232
  }).strict()
6034
6233
  ]);
6035
- var RoleAttemptOutcomeSchema = z2.enum([
6234
+ var RoleAttemptOutcomeSchema = z3.enum([
6036
6235
  "completed",
6037
6236
  "incomplete",
6038
6237
  "infrastructure_failed",
@@ -6043,17 +6242,17 @@ var RoleAttemptOutcomeSchema = z2.enum([
6043
6242
  var roleAttemptShared = {
6044
6243
  meta: HeaderMetaSchema,
6045
6244
  subject: SubjectSchema,
6046
- kind: z2.literal("role_attempt"),
6245
+ kind: z3.literal("role_attempt"),
6047
6246
  ...envelopeTail,
6048
- actor: z2.string().nullable(),
6049
- attempt: z2.number().int().nullable(),
6050
- effect_id: z2.string(),
6051
- model: z2.string().nullable()
6247
+ actor: z3.string().nullable(),
6248
+ attempt: z3.number().int().nullable(),
6249
+ effect_id: z3.string(),
6250
+ model: z3.string().nullable()
6052
6251
  };
6053
- var RoleAttemptEventSchema = z2.discriminatedUnion("event", [
6054
- z2.object({
6252
+ var RoleAttemptEventSchema = z3.discriminatedUnion("event", [
6253
+ z3.object({
6055
6254
  ...roleAttemptShared,
6056
- event: z2.literal("attempted"),
6255
+ event: z3.literal("attempted"),
6057
6256
  outcome: RoleAttemptOutcomeSchema,
6058
6257
  usage: dispatchUsageField
6059
6258
  }).strict()
@@ -6061,42 +6260,59 @@ var RoleAttemptEventSchema = z2.discriminatedUnion("event", [
6061
6260
  var handoffShared = {
6062
6261
  meta: HeaderMetaSchema,
6063
6262
  subject: SubjectSchema,
6064
- kind: z2.literal("handoff"),
6263
+ kind: z3.literal("handoff"),
6065
6264
  ...envelopeTail,
6066
- class: z2.enum(["authority", "strategy", "product"]),
6067
- reason: z2.string()
6265
+ class: z3.enum(["authority", "strategy", "product"]),
6266
+ reason: z3.string()
6068
6267
  };
6069
- var HandoffEventSchema = z2.discriminatedUnion("event", [
6070
- z2.object({
6268
+ var HandoffEventSchema = z3.discriminatedUnion("event", [
6269
+ z3.object({
6071
6270
  ...handoffShared,
6072
- event: z2.literal("raised"),
6073
- requested_decision: z2.string().nullable()
6271
+ event: z3.literal("raised"),
6272
+ requested_decision: z3.string().nullable()
6074
6273
  }).strict(),
6075
- z2.object({
6274
+ z3.object({
6076
6275
  ...handoffShared,
6077
- event: z2.literal("resolved"),
6078
- resolution: z2.string().nullable(),
6079
- resolved_by: z2.string().nullable()
6276
+ event: z3.literal("resolved"),
6277
+ resolution: z3.string().nullable(),
6278
+ resolved_by: z3.string().nullable()
6080
6279
  }).strict()
6081
6280
  ]);
6082
- var EffectTargetSchema = z2.object({
6083
- kind: z2.string(),
6084
- ref: z2.string()
6281
+ var EffectTargetSchema = z3.object({
6282
+ kind: z3.string(),
6283
+ ref: z3.string()
6085
6284
  }).strict();
6086
6285
  var effectShared = {
6087
6286
  meta: HeaderMetaSchema,
6088
6287
  subject: SubjectSchema,
6089
- kind: z2.literal("effect"),
6288
+ kind: z3.literal("effect"),
6090
6289
  ...envelopeTail,
6091
- effect_id: z2.string(),
6290
+ effect_id: z3.string(),
6092
6291
  target: EffectTargetSchema
6093
6292
  };
6094
- var EffectEventSchema = z2.discriminatedUnion("event", [
6095
- z2.object({ ...effectShared, event: z2.literal("attempted") }).strict(),
6096
- z2.object({ ...effectShared, event: z2.literal("observed"), outcome: z2.enum(["success", "failure", "uncertain"]) }).strict(),
6097
- z2.object({ ...effectShared, event: z2.literal("verified"), outcome: z2.enum(["success", "failure", "uncertain"]) }).strict()
6293
+ var EffectEventSchema = z3.discriminatedUnion("event", [
6294
+ z3.object({ ...effectShared, event: z3.literal("attempted") }).strict(),
6295
+ z3.object({ ...effectShared, event: z3.literal("observed"), outcome: z3.enum(["success", "failure", "uncertain"]) }).strict(),
6296
+ z3.object({ ...effectShared, event: z3.literal("verified"), outcome: z3.enum(["success", "failure", "uncertain"]) }).strict()
6297
+ ]);
6298
+ var CustomFieldValueSchema = z3.union([z3.string().max(CUSTOM_TEXT_MAX_LENGTH), z3.number().finite(), z3.boolean()]);
6299
+ var customShared = {
6300
+ meta: HeaderMetaV3Schema,
6301
+ subject: SubjectSchema,
6302
+ kind: z3.literal("custom"),
6303
+ ...envelopeTail
6304
+ };
6305
+ var CustomEventSchema = z3.discriminatedUnion("event", [
6306
+ z3.object({
6307
+ ...customShared,
6308
+ event: z3.literal("recorded"),
6309
+ name: z3.string().max(CUSTOM_EVENT_NAME_MAX_LENGTH).regex(CUSTOM_EVENT_NAME_PATTERN),
6310
+ 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, {
6311
+ message: `custom: at most ${CUSTOM_EVENT_MAX_FIELDS} fields`
6312
+ })
6313
+ }).strict()
6098
6314
  ]);
6099
- var LogEventSchema = z2.union([
6315
+ var LogEventSchema = z3.union([
6100
6316
  DispatchEventSchema,
6101
6317
  DevReviewLoopEventSchema,
6102
6318
  ForgeWriteEventSchema,
@@ -6105,10 +6321,11 @@ var LogEventSchema = z2.union([
6105
6321
  UsageEventSchema,
6106
6322
  RoleAttemptEventSchema,
6107
6323
  HandoffEventSchema,
6108
- EffectEventSchema
6324
+ EffectEventSchema,
6325
+ CustomEventSchema
6109
6326
  ]);
6110
-
6111
6327
  // ../../packages/aeg-core/src/log/envelope.ts
6328
+ import { createHash as createHash5 } from "node:crypto";
6112
6329
  function isRole(value) {
6113
6330
  return value !== undefined && ROLE_VALUES.includes(value);
6114
6331
  }
@@ -6145,18 +6362,27 @@ function roundFromEnv(round) {
6145
6362
  const n = Number(round);
6146
6363
  return Number.isInteger(n) ? n : undefined;
6147
6364
  }
6365
+ function prFromEnv(pr) {
6366
+ if (pr === undefined || pr === "")
6367
+ return;
6368
+ const n = Number(pr);
6369
+ return Number.isInteger(n) && n > 0 ? n : undefined;
6370
+ }
6148
6371
  function buildHeader(input) {
6149
6372
  const role = isRole(input.env.role) ? input.env.role : "unattributed";
6150
6373
  const round = roundFromEnv(input.env.round);
6374
+ const pr = prFromEnv(input.env.pr);
6151
6375
  const subject = {
6152
6376
  issue: issueFromTask(input.env.task) ?? input.branchIssue ?? null,
6153
6377
  role,
6154
6378
  ...round !== undefined ? { round } : {},
6379
+ ...pr !== undefined ? { pr } : {},
6155
6380
  ...input.subject ?? {}
6156
6381
  };
6382
+ const issue = subject.issue;
6157
6383
  return {
6158
6384
  meta: {
6159
- schema: 2,
6385
+ schema: 3,
6160
6386
  ts: input.now.toISOString(),
6161
6387
  run_id: input.runId,
6162
6388
  seq: input.seq,
@@ -6179,7 +6405,19 @@ function buildHeader(input) {
6179
6405
  ruling_ordinal: input.inputVersions?.rulingOrdinal ?? null,
6180
6406
  policy_digest: input.inputVersions?.policyDigest ?? null
6181
6407
  },
6182
- provenance: provenanceFor(input)
6408
+ provenance: provenanceFor(input),
6409
+ work: {
6410
+ ref: lineageFieldFromEnv(input.env.workRef) ?? (issue === null ? null : String(issue)),
6411
+ repo: input.repo,
6412
+ change: null,
6413
+ revision: null
6414
+ },
6415
+ flow: {
6416
+ id: lineageFieldFromEnv(input.env.flow) ?? "vinaya",
6417
+ version: lineageFieldFromEnv(input.env.flowVersion)
6418
+ },
6419
+ runtime: lineageFieldFromEnv(input.env.runtime),
6420
+ source: lineageFieldFromEnv(input.env.source)
6183
6421
  },
6184
6422
  subject
6185
6423
  };
@@ -6222,7 +6460,7 @@ function redact(value, home) {
6222
6460
  return value;
6223
6461
  }
6224
6462
  // ../../packages/aeg-core/src/log/store.ts
6225
- var KNOWN_SCHEMA_VERSIONS = [1, 2];
6463
+ var KNOWN_SCHEMA_VERSIONS = [1, 2, 3];
6226
6464
  function metaOf(obj) {
6227
6465
  if (obj === null || typeof obj !== "object")
6228
6466
  return null;
@@ -6288,7 +6526,7 @@ function classifyStoredLine(raw, home) {
6288
6526
  return { status: "invalid", identity: null, raw, reason: "valid event with no derivable identity" };
6289
6527
  }
6290
6528
  const redacted = redact(event, home);
6291
- const provenance = version === 2 ? event.meta.provenance ?? null : null;
6529
+ const provenance = version >= 2 ? event.meta.provenance ?? null : null;
6292
6530
  return {
6293
6531
  status: "ok",
6294
6532
  identity,
@@ -6301,138 +6539,143 @@ function classifyStoredLine(raw, home) {
6301
6539
  };
6302
6540
  }
6303
6541
  // ../../packages/aeg-core/src/control-store/records.ts
6304
- import { z as z3 } from "zod";
6305
- var isoTimestamp = z3.string().min(1);
6306
- var taskId = z3.number().int().positive();
6307
- var epochNumber = z3.number().int().nonnegative();
6308
- var RunRecordSchema = z3.object({
6309
- version: z3.literal(1),
6310
- kind: z3.literal("run"),
6542
+ import { z as z4 } from "zod";
6543
+ var isoTimestamp = z4.string().min(1);
6544
+ var taskId = z4.number().int().positive();
6545
+ var epochNumber = z4.number().int().nonnegative();
6546
+ var RunRecordSchema = z4.object({
6547
+ version: z4.literal(1),
6548
+ kind: z4.literal("run"),
6311
6549
  task: taskId,
6312
- runId: z3.string().min(1),
6313
- pid: z3.number().int().positive(),
6314
- host: z3.string().min(1),
6550
+ runId: z4.string().min(1),
6551
+ pid: z4.number().int().positive(),
6552
+ host: z4.string().min(1),
6315
6553
  startedAt: isoTimestamp,
6316
- childStartedAt: z3.string().min(1).nullable().optional(),
6317
- childCommand: z3.string().min(1).nullable().optional()
6554
+ childStartedAt: z4.string().min(1).nullable().optional(),
6555
+ childCommand: z4.string().min(1).nullable().optional()
6318
6556
  }).strict();
6319
- var InputRecordSchema = z3.object({
6320
- version: z3.literal(1),
6321
- kind: z3.literal("input"),
6557
+ var InputRecordSchema = z4.object({
6558
+ version: z4.literal(1),
6559
+ kind: z4.literal("input"),
6322
6560
  task: taskId,
6323
- runId: z3.string().min(1),
6324
- source: z3.union([z3.literal("fresh"), z3.literal("resume")]),
6325
- pr: z3.number().int().positive().nullable(),
6326
- round: z3.number().int().nonnegative(),
6561
+ runId: z4.string().min(1),
6562
+ source: z4.union([z4.literal("fresh"), z4.literal("resume")]),
6563
+ pr: z4.number().int().positive().nullable(),
6564
+ round: z4.number().int().nonnegative(),
6327
6565
  recordedAt: isoTimestamp
6328
6566
  }).strict();
6329
- var OwnershipRecordSchema = z3.object({
6330
- version: z3.literal(1),
6331
- kind: z3.literal("ownership"),
6567
+ var OwnershipRecordSchema = z4.object({
6568
+ version: z4.literal(1),
6569
+ kind: z4.literal("ownership"),
6332
6570
  task: taskId,
6333
6571
  epoch: epochNumber,
6334
- ownerId: z3.string().min(1),
6335
- pid: z3.number().int().positive(),
6336
- host: z3.string().min(1),
6572
+ ownerId: z4.string().min(1),
6573
+ pid: z4.number().int().positive(),
6574
+ host: z4.string().min(1),
6337
6575
  acquiredAt: isoTimestamp
6338
6576
  }).strict();
6339
- var TransitionRecordSchema = z3.object({
6340
- version: z3.literal(1),
6341
- kind: z3.literal("transition"),
6577
+ var TransitionRecordSchema = z4.object({
6578
+ version: z4.literal(1),
6579
+ kind: z4.literal("transition"),
6342
6580
  task: taskId,
6343
6581
  epoch: epochNumber,
6344
- seq: z3.number().int().nonnegative(),
6345
- from: z3.string().min(1),
6346
- to: z3.string().min(1),
6347
- detail: z3.string().optional(),
6582
+ seq: z4.number().int().nonnegative(),
6583
+ from: z4.string().min(1),
6584
+ to: z4.string().min(1),
6585
+ detail: z4.string().optional(),
6348
6586
  at: isoTimestamp
6349
6587
  }).strict();
6350
- var ManifestRecordSchema = z3.object({
6351
- version: z3.literal(1),
6352
- kind: z3.literal("manifest"),
6588
+ var ManifestRecordSchema = z4.object({
6589
+ version: z4.literal(1),
6590
+ kind: z4.literal("manifest"),
6353
6591
  task: taskId,
6354
6592
  round: epochNumber,
6355
- repository: z3.string().min(1),
6356
- pr: z3.number().int().positive(),
6357
- branch: z3.string().min(1),
6358
- baseSha: z3.string().min(1).nullable(),
6359
- headSha: z3.string().min(1),
6360
- briefHash: z3.string().min(1).nullable(),
6361
- objectivesVersion: z3.string().min(1).nullable(),
6593
+ repository: z4.string().min(1),
6594
+ pr: z4.number().int().positive(),
6595
+ branch: z4.string().min(1),
6596
+ baseSha: z4.string().min(1).nullable(),
6597
+ headSha: z4.string().min(1),
6598
+ briefHash: z4.string().min(1).nullable(),
6599
+ objectivesVersion: z4.string().min(1).nullable(),
6362
6600
  rulingOrdinal: epochNumber,
6363
- policyDigest: z3.string().min(1),
6601
+ policyDigest: z4.string().min(1),
6364
6602
  recordedAt: isoTimestamp
6365
6603
  }).strict();
6366
- var roundHeadIdentity = z3.object({ round: z3.number().int().positive(), head: z3.string().min(1) }).strict();
6367
- var LoopBudgetsSchema = z3.object({
6368
- mechanicalRetries: z3.number().int().nonnegative(),
6369
- reviewRounds: z3.number().int().nonnegative(),
6370
- infrastructureRetries: z3.number().int().nonnegative()
6604
+ var roundHeadIdentity = z4.object({ round: z4.number().int().positive(), head: z4.string().min(1) }).strict();
6605
+ var LoopBudgetsSchema = z4.object({
6606
+ mechanicalRetries: z4.number().int().nonnegative(),
6607
+ reviewRounds: z4.number().int().nonnegative(),
6608
+ infrastructureRetries: z4.number().int().nonnegative()
6371
6609
  }).strict();
6372
- var LoopStateRecordSchema = z3.object({
6373
- version: z3.literal(1),
6374
- kind: z3.literal("loop_state"),
6610
+ var LoopStateRecordSchema = z4.object({
6611
+ version: z4.literal(1),
6612
+ kind: z4.literal("loop_state"),
6375
6613
  task: taskId,
6376
- round: z3.number().int().positive(),
6377
- phase: z3.string().min(1),
6378
- pauseReason: z3.string().min(1).nullable(),
6614
+ round: z4.number().int().positive(),
6615
+ phase: z4.string().min(1),
6616
+ pauseReason: z4.string().min(1).nullable(),
6379
6617
  budgets: LoopBudgetsSchema,
6380
6618
  heldResult: roundHeadIdentity.nullable(),
6381
6619
  deliveredFindings: roundHeadIdentity.nullable(),
6382
- repeatMemory: z3.object({
6383
- blockingFindings: z3.array(z3.string()),
6384
- lastFailure: z3.object({ signature: z3.string(), message: z3.string() }).nullable()
6620
+ repeatMemory: z4.object({
6621
+ blockingFindings: z4.array(z4.string()),
6622
+ lastFailure: z4.object({ signature: z4.string(), message: z4.string() }).nullable()
6385
6623
  }).strict().optional(),
6624
+ publicationExpectedBase: z4.string().regex(/^[0-9a-f]{40}$/).nullable().optional(),
6625
+ taskStartedAt: isoTimestamp.optional(),
6626
+ phaseMs: z4.record(z4.string(), z4.number().nonnegative()).optional(),
6386
6627
  recordedAt: isoTimestamp
6387
6628
  }).strict();
6388
- var EffectRecordSchema = z3.object({
6389
- version: z3.literal(1),
6390
- kind: z3.literal("effect"),
6629
+ var EffectRecordSchema = z4.object({
6630
+ version: z4.literal(1),
6631
+ kind: z4.literal("effect"),
6391
6632
  task: taskId,
6392
- key: z3.string().min(1),
6393
- operation: z3.string().min(1),
6394
- target: z3.string().min(1),
6395
- inputVersion: z3.number().int().nonnegative(),
6396
- payloadDigest: z3.string().min(1),
6397
- status: z3.union([z3.literal("started"), z3.literal("verified"), z3.literal("uncertain")]),
6398
- url: z3.string().optional(),
6633
+ key: z4.string().min(1),
6634
+ operation: z4.string().min(1),
6635
+ target: z4.string().min(1),
6636
+ inputVersion: z4.number().int().nonnegative(),
6637
+ payloadDigest: z4.string().min(1),
6638
+ status: z4.union([z4.literal("started"), z4.literal("verified"), z4.literal("uncertain")]),
6639
+ url: z4.string().optional(),
6399
6640
  recordedAt: isoTimestamp
6400
6641
  }).strict();
6401
- var EscalationRecordSchema = z3.object({
6402
- version: z3.literal(1),
6403
- kind: z3.literal("escalation"),
6642
+ var EscalationRecordSchema = z4.object({
6643
+ version: z4.literal(1),
6644
+ kind: z4.literal("escalation"),
6404
6645
  task: taskId,
6405
- escalationId: z3.string().min(1),
6646
+ escalationId: z4.string().min(1),
6406
6647
  round: epochNumber,
6407
- head: z3.string().min(1),
6408
- branch: z3.string().min(1),
6409
- pr: z3.number().int().positive().nullable(),
6410
- runId: z3.string().min(1),
6411
- pid: z3.number().int().positive(),
6412
- host: z3.string().min(1),
6413
- agent: z3.string().min(1).optional(),
6414
- reason: z3.string().min(1),
6415
- detail: z3.string().optional(),
6416
- evidence: z3.string().optional(),
6417
- attemptedRecovery: z3.string().min(1),
6418
- requestedDecision: z3.string().min(1),
6419
- recipient: z3.string().min(1),
6420
- briefHash: z3.string().min(1).nullable(),
6421
- objectivesVersion: z3.string().min(1).nullable(),
6648
+ head: z4.string().min(1),
6649
+ branch: z4.string().min(1),
6650
+ pr: z4.number().int().positive().nullable(),
6651
+ runId: z4.string().min(1),
6652
+ pid: z4.number().int().positive(),
6653
+ host: z4.string().min(1),
6654
+ agent: z4.string().min(1).optional(),
6655
+ reason: z4.string().min(1),
6656
+ detail: z4.string().optional(),
6657
+ evidence: z4.string().optional(),
6658
+ attemptedRecovery: z4.string().min(1),
6659
+ requestedDecision: z4.string().min(1),
6660
+ recipient: z4.string().min(1),
6661
+ briefHash: z4.string().min(1).nullable(),
6662
+ objectivesVersion: z4.string().min(1).nullable(),
6422
6663
  rulingOrdinal: epochNumber,
6423
- policyDigest: z3.string().min(1),
6664
+ policyDigest: z4.string().min(1),
6424
6665
  recordedAt: isoTimestamp
6425
6666
  }).strict();
6426
- var ResolutionRecordSchema = z3.object({
6427
- version: z3.literal(1),
6428
- kind: z3.literal("resolution"),
6667
+ var ResolutionRecordSchema = z4.object({
6668
+ version: z4.literal(1),
6669
+ kind: z4.literal("resolution"),
6429
6670
  task: taskId,
6430
- escalationId: z3.string().min(1),
6431
- decision: z3.union([z3.literal("resume"), z3.literal("cancel")]),
6432
- authenticatedBy: z3.string().min(1),
6433
- authenticatedFrom: z3.string().min(1),
6671
+ escalationId: z4.string().min(1),
6672
+ decision: z4.union([z4.literal("resume"), z4.literal("cancel")]),
6673
+ authenticatedBy: z4.string().min(1),
6674
+ authenticatedFrom: z4.string().min(1),
6434
6675
  consumedAt: isoTimestamp
6435
6676
  }).strict();
6677
+ // ../../packages/aeg-core/src/control-store/local.ts
6678
+ var CONTROL_AREA_DIRNAME = "control";
6436
6679
  // src/checks/contract.ts
6437
6680
  var CHECK_SCHEMA_VERSION = 1;
6438
6681
  function emitCheckError(error) {
@@ -6441,59 +6684,37 @@ function emitCheckError(error) {
6441
6684
  }
6442
6685
 
6443
6686
  // src/lib/review-gate-input.ts
6444
- import { execFileSync as execFileSync5 } from "node:child_process";
6687
+ import { execFileSync as execFileSync4 } from "node:child_process";
6445
6688
 
6446
6689
  // src/lib/config.ts
6447
- import { execFile as execFile4, execFileSync as execFileSync3 } from "node:child_process";
6690
+ import { execFile as execFile4, execFileSync as execFileSync2 } from "node:child_process";
6448
6691
  import { promisify as promisify4 } from "node:util";
6449
6692
  import { existsSync, mkdirSync, readFileSync as readFileSync2, realpathSync, writeFileSync } from "node:fs";
6450
6693
  import { homedir } from "node:os";
6451
6694
  import { dirname, isAbsolute, join, resolve } from "node:path";
6452
- import { z as z4 } from "zod";
6695
+ import { z as z5 } from "zod";
6453
6696
 
6454
6697
  // src/lib/agent-vendors.ts
6455
6698
  var AGENT_VENDORS = ["skills", "claude", "gemini"];
6456
6699
 
6457
- // src/lib/worker-boundary.ts
6458
- import { execFileSync as execFileSync2 } from "node:child_process";
6459
- var LOG_HEADER_KEYCHAIN_SERVICE = "Vinaya Log";
6460
- var logHeaderKeychainCache = new Map;
6461
- function readRealLogHeaderKeychainCredential(variable) {
6462
- if (process.platform !== "darwin")
6463
- return null;
6464
- try {
6465
- 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$/, "");
6466
- } catch {
6467
- return null;
6468
- }
6469
- }
6470
- function readLogHeaderKeychainCredential(variable) {
6471
- const cached = logHeaderKeychainCache.get(variable);
6472
- if (cached !== undefined)
6473
- return cached;
6474
- const value = readRealLogHeaderKeychainCredential(variable);
6475
- logHeaderKeychainCache.set(variable, value);
6476
- return value;
6477
- }
6478
-
6479
6700
  // src/lib/config.ts
6480
- var EnvEntrySchema = z4.union([
6481
- z4.literal(true),
6482
- z4.object({ optional: z4.literal(true) }),
6483
- z4.object({ anyOf: z4.array(z4.string()).min(2) }),
6484
- z4.string()
6701
+ var EnvEntrySchema = z5.union([
6702
+ z5.literal(true),
6703
+ z5.object({ optional: z5.literal(true) }),
6704
+ z5.object({ anyOf: z5.array(z5.string()).min(2) }),
6705
+ z5.string()
6485
6706
  ]);
6486
- var CheckEntrySchema = z4.object({
6487
- run: z4.string(),
6488
- scope: z4.enum(["diff", "full"]),
6489
- include: z4.array(z4.string()).optional(),
6490
- args: z4.array(z4.string()).optional(),
6491
- timeoutMs: z4.number().optional(),
6492
- env: z4.record(z4.string(), EnvEntrySchema).optional(),
6493
- requiresOpenPr: z4.boolean().optional(),
6494
- ownWorkflow: z4.boolean().optional(),
6495
- principalOwed: z4.literal(true).optional(),
6496
- validates: z4.enum(["body", "issue"]).optional()
6707
+ var CheckEntrySchema = z5.object({
6708
+ run: z5.string(),
6709
+ scope: z5.enum(["diff", "full"]),
6710
+ include: z5.array(z5.string()).optional(),
6711
+ args: z5.array(z5.string()).optional(),
6712
+ timeoutMs: z5.number().optional(),
6713
+ env: z5.record(z5.string(), EnvEntrySchema).optional(),
6714
+ requiresOpenPr: z5.boolean().optional(),
6715
+ ownWorkflow: z5.boolean().optional(),
6716
+ principalOwed: z5.literal(true).optional(),
6717
+ validates: z5.enum(["body", "issue"]).optional()
6497
6718
  }).superRefine((entry, ctx) => {
6498
6719
  if (!entry.env)
6499
6720
  return;
@@ -6503,22 +6724,22 @@ var CheckEntrySchema = z4.object({
6503
6724
  const members = value.anyOf;
6504
6725
  if (new Set(members).size !== members.length) {
6505
6726
  ctx.addIssue({
6506
- code: z4.ZodIssueCode.custom,
6727
+ code: z5.ZodIssueCode.custom,
6507
6728
  message: `env.${key}.anyOf has duplicate members`,
6508
6729
  path: ["env", key, "anyOf"]
6509
6730
  });
6510
6731
  }
6511
6732
  if (!members.includes(key)) {
6512
6733
  ctx.addIssue({
6513
- code: z4.ZodIssueCode.custom,
6734
+ code: z5.ZodIssueCode.custom,
6514
6735
  message: `env.${key}.anyOf must include "${key}" itself as a member`,
6515
6736
  path: ["env", key, "anyOf"]
6516
6737
  });
6517
6738
  }
6518
6739
  }
6519
6740
  });
6520
- var RoleEntrySchema = z4.object({
6521
- contract: z4.string().refine((p) => p.includes("/"), {
6741
+ var RoleEntrySchema = z5.object({
6742
+ contract: z5.string().refine((p) => p.includes("/"), {
6522
6743
  message: 'must be a path (contain at least one "/"), not a bare filename'
6523
6744
  })
6524
6745
  });
@@ -6542,17 +6763,17 @@ var BRIEF_BUILTINS = [
6542
6763
  "briefSections",
6543
6764
  "milestoneShape"
6544
6765
  ];
6545
- var BriefSectionSchema = z4.union([
6546
- z4.object({ builtin: z4.enum(BRIEF_BUILTINS) }),
6547
- z4.object({ heading: z4.string().min(1), name: z4.string().optional() }),
6548
- z4.object({ field: z4.string().min(1), name: z4.string().optional() }),
6549
- z4.object({ phrase: z4.string().min(1), name: z4.string().optional() })
6766
+ var BriefSectionSchema = z5.union([
6767
+ z5.object({ builtin: z5.enum(BRIEF_BUILTINS) }),
6768
+ z5.object({ heading: z5.string().min(1), name: z5.string().optional() }),
6769
+ z5.object({ field: z5.string().min(1), name: z5.string().optional() }),
6770
+ z5.object({ phrase: z5.string().min(1), name: z5.string().optional() })
6550
6771
  ]);
6551
- var BriefSchemaSchema = z4.object({
6552
- pr: z4.object({ sections: z4.array(BriefSectionSchema) }).optional(),
6553
- issue: z4.object({ sections: z4.array(BriefSectionSchema) }).optional(),
6554
- milestone: z4.object({ sections: z4.array(BriefSectionSchema) }).optional(),
6555
- ack: z4.array(z4.enum(BRIEF_BUILTINS)).optional()
6772
+ var BriefSchemaSchema = z5.object({
6773
+ pr: z5.object({ sections: z5.array(BriefSectionSchema) }).optional(),
6774
+ issue: z5.object({ sections: z5.array(BriefSectionSchema) }).optional(),
6775
+ milestone: z5.object({ sections: z5.array(BriefSectionSchema) }).optional(),
6776
+ ack: z5.array(z5.enum(BRIEF_BUILTINS)).optional()
6556
6777
  });
6557
6778
  function isSafeRepoRelPath(p) {
6558
6779
  if (p.length === 0)
@@ -6561,7 +6782,7 @@ function isSafeRepoRelPath(p) {
6561
6782
  return false;
6562
6783
  return p.split(/[\\/]/).every((seg) => seg !== ".." && seg !== "");
6563
6784
  }
6564
- var SafeRepoRelPath = z4.string().refine(isSafeRepoRelPath, {
6785
+ var SafeRepoRelPath = z5.string().refine(isSafeRepoRelPath, {
6565
6786
  message: "must be a repo-root-relative path with no `..` segment or absolute root"
6566
6787
  });
6567
6788
  var CANONICAL_HOOK_BLOCK_PREFIXES = [".git/", ".husky/", ".vinaya/hooks/", ".claude/hooks/"];
@@ -6571,22 +6792,22 @@ function isCanonicalHookBlockPath(p) {
6571
6792
  var ManagedHookBlockPath = SafeRepoRelPath.refine(isCanonicalHookBlockPath, {
6572
6793
  message: `must start with one of ${CANONICAL_HOOK_BLOCK_PREFIXES.join(", ")} (byte-exact, case-sensitive)`
6573
6794
  });
6574
- var ManagedBlockRecordSchema = z4.object({
6795
+ var ManagedBlockRecordSchema = z5.object({
6575
6796
  path: ManagedHookBlockPath,
6576
- marker: z4.string(),
6577
- comment: z4.enum(["hash", "html"])
6797
+ marker: z5.string(),
6798
+ comment: z5.enum(["hash", "html"])
6578
6799
  });
6579
- var ManagedManifestSchema = z4.object({
6580
- version: z4.number().int().positive(),
6581
- files: z4.array(SafeRepoRelPath),
6582
- blocks: z4.array(ManagedBlockRecordSchema),
6583
- labels: z4.array(z4.string()),
6584
- agents: z4.array(z4.enum(AGENT_VENDORS)).optional()
6800
+ var ManagedManifestSchema = z5.object({
6801
+ version: z5.number().int().positive(),
6802
+ files: z5.array(SafeRepoRelPath),
6803
+ blocks: z5.array(ManagedBlockRecordSchema),
6804
+ labels: z5.array(z5.string()),
6805
+ agents: z5.array(z5.enum(AGENT_VENDORS)).optional()
6585
6806
  });
6586
- var ProjectEntrySchema = z4.object({
6587
- name: z4.string().min(1),
6588
- description: z4.string().min(1).optional(),
6589
- path: z4.string().min(1).optional()
6807
+ var ProjectEntrySchema = z5.object({
6808
+ name: z5.string().min(1),
6809
+ description: z5.string().min(1).optional(),
6810
+ path: z5.string().min(1).optional()
6590
6811
  });
6591
6812
  function parseTokensCollectDeclaration(value) {
6592
6813
  const m = value.trim().match(/^(\S+)\s+(\S+)$/);
@@ -6597,90 +6818,97 @@ function parseTokensCollectDeclaration(value) {
6597
6818
  return null;
6598
6819
  return { interpreter, script };
6599
6820
  }
6600
- var VinayaConfigSchema = z4.object({
6601
- rings: z4.object({
6602
- ring1_forgeWriteInterception: z4.boolean(),
6603
- ring2_asyncAudits: z4.boolean()
6821
+ var VinayaConfigSchema = z5.object({
6822
+ rings: z5.object({
6823
+ ring1_forgeWriteInterception: z5.boolean(),
6824
+ ring2_asyncAudits: z5.boolean()
6604
6825
  }).optional(),
6605
- checks: z4.record(z4.string(), CheckEntrySchema).optional(),
6606
- roles: z4.record(z4.string(), RoleEntrySchema).optional(),
6826
+ checks: z5.record(z5.string(), CheckEntrySchema).optional(),
6827
+ roles: z5.record(z5.string(), RoleEntrySchema).optional(),
6607
6828
  briefSchema: BriefSchemaSchema.optional(),
6608
6829
  managed: ManagedManifestSchema.optional(),
6609
- principals: z4.array(z4.string()).min(1).optional(),
6610
- releaseActor: z4.string().min(1).optional(),
6611
- ci: z4.object({ setup: z4.string().min(1) }).optional(),
6612
- tokens: z4.object({
6613
- collect: z4.string().min(1).refine((v) => parseTokensCollectDeclaration(v) !== null, {
6830
+ principals: z5.array(z5.string()).min(1).optional(),
6831
+ releaseActor: z5.string().min(1).optional(),
6832
+ ci: z5.object({ setup: z5.string().min(1) }).optional(),
6833
+ tokens: z5.object({
6834
+ collect: z5.string().min(1).refine((v) => parseTokensCollectDeclaration(v) !== null, {
6614
6835
  message: 'tokens.collect must be exactly "<interpreter> <repo-relative-script-path>" — two whitespace-separated tokens, no flags, no shell syntax, no quoting'
6615
6836
  })
6616
6837
  }).optional(),
6617
- blastRadius: z4.object({ extraDomains: z4.array(z4.string()).optional() }).optional(),
6618
- proseGates: z4.object({
6619
- doctrineRoot: z4.string().min(1).optional(),
6620
- readerFacingPrefix: z4.string().min(1).optional(),
6621
- readerFacingSuffix: z4.string().min(1).optional(),
6622
- legacySlugDir: z4.string().min(1).optional(),
6623
- sourceComments: z4.object({
6624
- globs: z4.array(z4.string().min(1)).optional(),
6625
- allowlist: z4.array(z4.string().min(1)).optional(),
6626
- severity: z4.enum(["warning", "error"]).optional()
6838
+ blastRadius: z5.object({ extraDomains: z5.array(z5.string()).optional() }).optional(),
6839
+ proseGates: z5.object({
6840
+ doctrineRoot: z5.string().min(1).optional(),
6841
+ readerFacingPrefix: z5.string().min(1).optional(),
6842
+ readerFacingSuffix: z5.string().min(1).optional(),
6843
+ legacySlugDir: z5.string().min(1).optional(),
6844
+ sourceComments: z5.object({
6845
+ globs: z5.array(z5.string().min(1)).optional(),
6846
+ allowlist: z5.array(z5.string().min(1)).optional(),
6847
+ severity: z5.enum(["warning", "error"]).optional()
6627
6848
  }).optional(),
6628
- specGrandfather: z4.array(z4.string().min(1)).optional(),
6629
- specPaths: z4.array(z4.string().min(1).refine((entry) => !entry.startsWith("/") && !/^[A-Za-z]:/.test(entry), {
6849
+ specGrandfather: z5.union([z5.array(z5.string().min(1)), z5.record(z5.string().min(1), z5.number().int().min(0))]).optional(),
6850
+ specPaths: z5.array(z5.string().min(1).refine((entry) => !entry.startsWith("/") && !/^[A-Za-z]:/.test(entry), {
6630
6851
  message: "must be a repository-relative path, not an absolute one"
6631
6852
  }).refine((entry) => !entry.split(/[\\/]/).includes(".."), {
6632
6853
  message: "must stay inside the repository — no `..` segment"
6633
6854
  })).optional()
6634
6855
  }).optional(),
6635
- projects: z4.array(ProjectEntrySchema).optional(),
6636
- dispatch: z4.object({
6637
- timeoutMs: z4.number().int().positive().optional(),
6638
- killGraceMs: z4.number().int().positive().optional(),
6639
- agent: z4.enum(["claude", "codex", "gemini"]).optional(),
6640
- requireWorkerIsolation: z4.boolean().optional()
6856
+ projects: z5.array(ProjectEntrySchema).optional(),
6857
+ dispatch: z5.object({
6858
+ timeoutMs: z5.number().int().positive().optional(),
6859
+ killGraceMs: z5.number().int().positive().optional(),
6860
+ agent: z5.enum(["claude", "codex", "gemini"]).optional()
6861
+ }).optional(),
6862
+ reviewPolicy: z5.object({
6863
+ codeReviewThreshold: z5.string().min(1).optional(),
6864
+ securityThreshold: z5.string().min(1).optional(),
6865
+ maxRounds: z5.number().optional(),
6866
+ maxTaskMinutes: z5.number().optional()
6641
6867
  }).optional(),
6642
- reviewPolicy: z4.object({
6643
- codeReviewThreshold: z4.string().min(1).optional(),
6644
- securityThreshold: z4.string().min(1).optional(),
6645
- maxRounds: z4.number().optional()
6868
+ securityScan: z5.object({
6869
+ command: z5.array(z5.string().min(1)).min(1)
6646
6870
  }).optional(),
6647
- gateCutovers: z4.object({
6648
- objectivesSinceIssue: z4.number().int().nonnegative().optional(),
6649
- briefSectionsSinceIssue: z4.number().int().nonnegative().optional(),
6650
- documentationSinceIssue: z4.number().int().nonnegative().optional(),
6651
- briefRulesSincePr: z4.number().int().nonnegative().optional(),
6652
- agentBoxesRefusedSincePr: z4.number().int().nonnegative().optional()
6871
+ gateCutovers: z5.object({
6872
+ objectivesSinceIssue: z5.number().int().nonnegative().optional(),
6873
+ briefSectionsSinceIssue: z5.number().int().nonnegative().optional(),
6874
+ documentationSinceIssue: z5.number().int().nonnegative().optional(),
6875
+ briefRulesSincePr: z5.number().int().nonnegative().optional(),
6876
+ agentBoxesRefusedSincePr: z5.number().int().nonnegative().optional()
6653
6877
  }).optional(),
6654
- planning: z4.object({
6655
- collisionThreshold: z4.number().int().nonnegative().optional()
6878
+ planning: z5.object({
6879
+ collisionThreshold: z5.number().int().nonnegative().optional()
6656
6880
  }).optional(),
6657
- prePush: z4.object({
6658
- alwaysRun: z4.array(z4.string()).optional()
6881
+ prePush: z5.object({
6882
+ alwaysRun: z5.array(z5.string()).optional()
6659
6883
  }).optional(),
6660
- report: z4.object({
6661
- commandTimeoutMs: z4.number().int().positive().optional()
6884
+ report: z5.object({
6885
+ commandTimeoutMs: z5.number().int().positive().optional()
6662
6886
  }).superRefine((report, ctx) => {
6663
6887
  const commandTimeoutMs = report.commandTimeoutMs;
6664
6888
  if (commandTimeoutMs !== undefined && commandTimeoutMs > MAX_REPORT_COMMAND_TIMEOUT_MS) {
6665
6889
  ctx.addIssue({
6666
- code: z4.ZodIssueCode.custom,
6890
+ code: z5.ZodIssueCode.custom,
6667
6891
  path: ["commandTimeoutMs"],
6668
6892
  message: "must be at most 3600000 (1 hour)"
6669
6893
  });
6670
6894
  }
6671
6895
  }).optional(),
6672
- logPublish: z4.unknown().refine((v) => v === undefined, {
6896
+ logPublish: z5.unknown().refine((v) => v === undefined, {
6673
6897
  message: "logPublish is removed — telemetry is never posted to a tracker or a code host; configure `logs` instead (a folder or a server destination)"
6674
6898
  }),
6675
- runtimeDir: z4.string().min(1).refine((v) => isAbsolute(v), { message: "runtimeDir: must be an absolute path" }).optional(),
6676
- logs: z4.object({
6677
- folder: z4.string().min(1).refine((v) => isAbsolute(v), { message: "logs.folder: must be an absolute path" }).optional(),
6678
- url: z4.string().url().optional(),
6679
- headers: z4.record(z4.string()).optional()
6899
+ runtimeDir: z5.string().min(1).refine((v) => isAbsolute(v), { message: "runtimeDir: must be an absolute path" }).optional(),
6900
+ logs: z5.object({
6901
+ folder: z5.string().min(1).refine((v) => isAbsolute(v), { message: "logs.folder: must be an absolute path" }).optional(),
6902
+ url: z5.string().url().optional(),
6903
+ headers: z5.record(z5.string()).optional(),
6904
+ readHeaders: z5.record(z5.string()).optional(),
6905
+ events: CustomEventDeclarationsSchema.optional()
6680
6906
  }).refine((v) => [v.folder, v.url].filter((x) => x !== undefined).length <= 1, {
6681
6907
  message: "logs: set at most one of folder/url"
6682
6908
  }).refine((v) => v.headers === undefined || v.url !== undefined, {
6683
6909
  message: "logs: headers requires url"
6910
+ }).refine((v) => v.readHeaders === undefined || v.url !== undefined, {
6911
+ message: "logs: readHeaders requires url"
6684
6912
  }).optional()
6685
6913
  });
6686
6914
  var GLOBAL_VINAYA_HOME = join(homedir(), ".vinaya");
@@ -6785,10 +7013,15 @@ function resolveReviewPolicy(config) {
6785
7013
  if (!Number.isInteger(maxRounds) || maxRounds < 1) {
6786
7014
  throw new Error(`vinaya.config.json: reviewPolicy.maxRounds "${maxRounds}" is not a positive integer — fix the config, this never falls back to a default.`);
6787
7015
  }
7016
+ const maxTaskMinutes = raw.maxTaskMinutes ?? DEFAULT_REVIEW_POLICY.maxTaskMinutes;
7017
+ if (!Number.isInteger(maxTaskMinutes) || maxTaskMinutes < 0) {
7018
+ 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.`);
7019
+ }
6788
7020
  return {
6789
7021
  codeReviewThreshold,
6790
7022
  securityThreshold,
6791
- maxRounds
7023
+ maxRounds,
7024
+ maxTaskMinutes
6792
7025
  };
6793
7026
  }
6794
7027
  function resolveGateCutovers(config) {
@@ -6828,17 +7061,12 @@ function resolveTrustAnchorLogsDestination(local, trustAnchorConfig) {
6828
7061
  return "url" in anchored && anchored.url === local.url ? anchored : null;
6829
7062
  return "folder" in anchored && anchored.folder === local.folder ? anchored : null;
6830
7063
  }
6831
- function resolveLogsHeaderValues(headers, env, readKeychain = readLogHeaderKeychainCredential) {
7064
+ function resolveLogsHeaderValues(headers, env) {
6832
7065
  if (!headers)
6833
7066
  return;
6834
7067
  const resolved = {};
6835
7068
  for (const [key, value] of Object.entries(headers)) {
6836
- resolved[key] = value.replace(/\$\{([A-Za-z_][A-Za-z0-9_]*)\}/g, (_match, name) => {
6837
- const fromEnv = env[name];
6838
- if (fromEnv !== undefined)
6839
- return fromEnv;
6840
- return readKeychain(name) ?? "";
6841
- });
7069
+ resolved[key] = value.replace(/\$\{([A-Za-z_][A-Za-z0-9_]*)\}/g, (_match, name) => env[name] ?? "");
6842
7070
  }
6843
7071
  return resolved;
6844
7072
  }
@@ -6847,7 +7075,7 @@ function trustAnchorRepo() {
6847
7075
  if (fromRunner)
6848
7076
  return fromRunner;
6849
7077
  try {
6850
- const url = execFileSync3("git", ["remote", "get-url", "origin"], {
7078
+ const url = execFileSync2("git", ["remote", "get-url", "origin"], {
6851
7079
  encoding: "utf-8",
6852
7080
  stdio: ["ignore", "pipe", "pipe"]
6853
7081
  });
@@ -6894,7 +7122,7 @@ function resolveCiTrustAnchorProbeRef(env = process.env) {
6894
7122
  return ref;
6895
7123
  }
6896
7124
  function readTrustAnchorConfigAtRef(ref) {
6897
- const raw = execFileSync3("git", ["show", `${ref}:${LOCAL_CONFIG_FILENAME}`], {
7125
+ const raw = execFileSync2("git", ["show", `${ref}:${LOCAL_CONFIG_FILENAME}`], {
6898
7126
  encoding: "utf-8",
6899
7127
  stdio: ["ignore", "pipe", "pipe"],
6900
7128
  timeout: 1e4
@@ -6908,7 +7136,7 @@ function ghFetchTrustAnchorConfig() {
6908
7136
  const repo = trustAnchorRepo();
6909
7137
  if (!repo)
6910
7138
  throw new Error("could not resolve repo identity for the trust-anchor read");
6911
- return execFileSync3("gh", ["api", `repos/${repo}/contents/${LOCAL_CONFIG_FILENAME}`, "--jq", ".content"], {
7139
+ return execFileSync2("gh", ["api", `repos/${repo}/contents/${LOCAL_CONFIG_FILENAME}`, "--jq", ".content"], {
6912
7140
  encoding: "utf-8",
6913
7141
  stdio: ["ignore", "pipe", "pipe"]
6914
7142
  });
@@ -6999,20 +7227,20 @@ function loadConfig() {
6999
7227
  var TOKENS_COLLECT_TRUST_PATH = join(GLOBAL_VINAYA_HOME, "tokens-collect-trust.json");
7000
7228
 
7001
7229
  // src/lib/patch-id.ts
7002
- import { execFileSync as execFileSync4 } from "node:child_process";
7230
+ import { execFileSync as execFileSync3 } from "node:child_process";
7003
7231
  function patchIdAt(base, sha) {
7004
7232
  try {
7005
- execFileSync4("git", ["fetch", "--quiet", "origin", sha], { stdio: ["ignore", "ignore", "ignore"] });
7233
+ execFileSync3("git", ["fetch", "--quiet", "origin", sha], { stdio: ["ignore", "ignore", "ignore"] });
7006
7234
  } catch {}
7007
7235
  try {
7008
- const diff = execFileSync4("git", ["diff", `origin/${base}...${sha}`], {
7236
+ const diff = execFileSync3("git", ["diff", `origin/${base}...${sha}`], {
7009
7237
  encoding: "utf8",
7010
7238
  maxBuffer: 64 * 1024 * 1024,
7011
7239
  stdio: ["ignore", "pipe", "pipe"]
7012
7240
  });
7013
7241
  if (diff === "")
7014
7242
  return null;
7015
- const out = execFileSync4("git", ["patch-id", "--stable"], {
7243
+ const out = execFileSync3("git", ["patch-id", "--stable"], {
7016
7244
  input: diff,
7017
7245
  encoding: "utf8",
7018
7246
  stdio: ["pipe", "pipe", "pipe"]
@@ -7030,7 +7258,7 @@ function failure(message, agentRecoveryPrompt) {
7030
7258
  }
7031
7259
  function fetchPr(prNumber) {
7032
7260
  try {
7033
- const out = execFileSync5("gh", ["pr", "view", String(prNumber), "--json", "number,comments,labels,headRefName,headRefOid,baseRefName,body"], {
7261
+ const out = execFileSync4("gh", ["pr", "view", String(prNumber), "--json", "number,comments,labels,headRefName,headRefOid,baseRefName,body"], {
7034
7262
  encoding: "utf8",
7035
7263
  stdio: ["ignore", "pipe", "pipe"]
7036
7264
  });
@@ -7040,13 +7268,13 @@ function fetchPr(prNumber) {
7040
7268
  }
7041
7269
  }
7042
7270
  function fetchIssueBodyForObjectives(issueNumber) {
7043
- return execFileSync5("gh", ["issue", "view", String(issueNumber), "--json", "body", "--jq", ".body"], {
7271
+ return execFileSync4("gh", ["issue", "view", String(issueNumber), "--json", "body", "--jq", ".body"], {
7044
7272
  encoding: "utf8",
7045
7273
  stdio: ["ignore", "pipe", "pipe"]
7046
7274
  });
7047
7275
  }
7048
7276
  function fetchIssueCommentsForBrief(issueNumber) {
7049
- const out = execFileSync5("gh", ["issue", "view", String(issueNumber), "--json", "comments"], {
7277
+ const out = execFileSync4("gh", ["issue", "view", String(issueNumber), "--json", "comments"], {
7050
7278
  encoding: "utf8",
7051
7279
  stdio: ["ignore", "pipe", "pipe"]
7052
7280
  });
@@ -7098,7 +7326,7 @@ function resolveObjectivesVersion(pr, objectivesSinceIssue) {
7098
7326
  }
7099
7327
  function shaFromLsRemote(branch) {
7100
7328
  try {
7101
- const out = execFileSync5("git", ["ls-remote", "origin", `refs/heads/${branch}`], {
7329
+ const out = execFileSync4("git", ["ls-remote", "origin", `refs/heads/${branch}`], {
7102
7330
  encoding: "utf8",
7103
7331
  stdio: ["ignore", "pipe", "pipe"]
7104
7332
  }).trim();
@@ -7110,7 +7338,7 @@ function shaFromLsRemote(branch) {
7110
7338
  }
7111
7339
  function shaFromGhApi(branch) {
7112
7340
  try {
7113
- const out = execFileSync5("gh", ["api", `repos/{owner}/{repo}/git/ref/heads/${branch}`, "--jq", ".object.sha"], {
7341
+ const out = execFileSync4("gh", ["api", `repos/{owner}/{repo}/git/ref/heads/${branch}`, "--jq", ".object.sha"], {
7114
7342
  encoding: "utf8",
7115
7343
  stdio: ["ignore", "pipe", "pipe"]
7116
7344
  }).trim();
@@ -7132,7 +7360,7 @@ function resolveTrueHeadSha(pr) {
7132
7360
  }
7133
7361
  function fetchWaiverLabelActor(prNumber, label) {
7134
7362
  try {
7135
- const out = execFileSync5("gh", ["api", `repos/{owner}/{repo}/issues/${prNumber}/timeline`, "--paginate"], {
7363
+ const out = execFileSync4("gh", ["api", `repos/{owner}/{repo}/issues/${prNumber}/timeline`, "--paginate"], {
7136
7364
  encoding: "utf8",
7137
7365
  stdio: ["ignore", "pipe", "pipe"]
7138
7366
  });