@attalabs/vinaya 0.36.0 → 0.37.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 (243) 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 +9 -10
  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 +13 -16
  10. package/aeg-root/roles/developer.md +7 -3
  11. package/aeg-root/roles/operator.md +18 -18
  12. package/aeg-root/roles/planner/reference.md +4 -4
  13. package/aeg-root/roles/principal.md +6 -1
  14. package/aeg-root/roles/reviewer.md +9 -3
  15. package/aeg-root/roles/security.md +19 -9
  16. package/aeg-root/roles/tranche-archivist.md +14 -2
  17. package/aeg-root/state-machine.md +11 -10
  18. package/aeg-root/templates/brief-template.md +6 -4
  19. package/aeg-root/templates/pr-report-template.md +1 -9
  20. package/aeg-root/tranche-model.md +4 -4
  21. package/dist/checks/bin/check-body-bare-digits.js +685 -584
  22. package/dist/checks/bin/check-branch-topology.js +626 -466
  23. package/dist/checks/bin/check-brief-shape.js +686 -585
  24. package/dist/checks/bin/check-changeset-coverage.js +1161 -731
  25. package/dist/checks/bin/check-closes-n.js +626 -466
  26. package/dist/checks/bin/check-coherence.js +744 -599
  27. package/dist/checks/bin/check-dead-branch-push.js +567 -451
  28. package/dist/checks/bin/check-dispatch-readiness.js +747 -602
  29. package/dist/checks/bin/check-doc-coverage-push.js +1160 -730
  30. package/dist/checks/bin/check-doc-coverage.js +1160 -730
  31. package/dist/checks/bin/check-doctrine-no-procedures.js +683 -582
  32. package/dist/checks/bin/check-doctrine-portability.js +1160 -730
  33. package/dist/checks/bin/check-evidence-fresh.js +1167 -906
  34. package/dist/checks/bin/check-exec-bits.js +1159 -729
  35. package/dist/checks/bin/check-first-push-dispatch.js +747 -602
  36. package/dist/checks/bin/check-issue-assignment.js +626 -466
  37. package/dist/checks/bin/check-issue-milestone-attach.js +567 -451
  38. package/dist/checks/bin/check-issue-objectives-numbering.js +683 -582
  39. package/dist/checks/bin/check-issue-parts-coverage.js +567 -451
  40. package/dist/checks/bin/check-issue-surface-globs.js +755 -601
  41. package/dist/checks/bin/check-issue-title-grammar.js +567 -451
  42. package/dist/checks/bin/check-issue-tranche-label.js +567 -451
  43. package/dist/checks/bin/check-main-branch-refusal.js +567 -451
  44. package/dist/checks/bin/check-no-disk-state.js +567 -451
  45. package/dist/checks/bin/check-pr-premise-reassert.js +683 -582
  46. package/dist/checks/bin/check-pr-report-density.js +567 -451
  47. package/dist/checks/bin/check-principal-test-plan-wait.js +567 -451
  48. package/dist/checks/bin/check-quoted-command.js +1644 -1216
  49. package/dist/checks/bin/check-reader-resolvable-prose.js +1663 -1223
  50. package/dist/checks/bin/check-registry-gates.js +610 -481
  51. package/dist/checks/bin/check-retired-vocabulary.js +1638 -1210
  52. package/dist/checks/bin/check-review-gate.js +694 -593
  53. package/dist/checks/bin/check-single-plan-pr.js +567 -451
  54. package/dist/checks/bin/check-surface-scope.js +626 -466
  55. package/dist/checks/bin/check-test-plan.js +567 -451
  56. package/dist/checks/bin/check-token-collection-wired.js +567 -451
  57. package/dist/checks/bin/check-workspace-escape.js +1160 -730
  58. package/dist/index.js +13507 -7975
  59. package/dist/lib/pre-push-cache-test-run.js +1004 -681
  60. package/dist/lib/pre-push-select-tests.js +609 -480
  61. package/package.json +2 -2
  62. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/brief-render.ts +38 -0
  63. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/control-store/records.ts +19 -0
  64. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/assess-round.ts +233 -8
  65. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/fakes.ts +7 -2
  66. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/index.ts +1 -0
  67. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/render-summary.ts +38 -3
  68. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/types.ts +113 -4
  69. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/doc-claim.ts +32 -6
  70. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/index.ts +26 -1
  71. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/issue-validation.ts +747 -0
  72. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/schema.ts +8 -1
  73. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/review-gate.ts +52 -4
  74. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/review-policy.ts +163 -21
  75. package/studio-standalone/apps/vinaya-studio/web/.next/BUILD_ID +1 -1
  76. package/studio-standalone/apps/vinaya-studio/web/.next/app-path-routes-manifest.json +0 -1
  77. package/studio-standalone/apps/vinaya-studio/web/.next/build-manifest.json +3 -3
  78. package/studio-standalone/apps/vinaya-studio/web/.next/prerender-manifest.json +3 -3
  79. package/studio-standalone/apps/vinaya-studio/web/.next/required-server-files.json +0 -5
  80. package/studio-standalone/apps/vinaya-studio/web/.next/routes-manifest.json +0 -6
  81. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error/page.js +1 -1
  82. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error/page.js.nft.json +1 -1
  83. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.html +1 -1
  84. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.rsc +1 -1
  85. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  86. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  87. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  88. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  89. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  90. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_not-found/page/server-reference-manifest.json +2 -2
  91. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_not-found/page.js +1 -1
  92. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_not-found/page.js.nft.json +1 -1
  93. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  94. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/page/server-reference-manifest.json +2 -2
  95. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/page.js +1 -1
  96. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/page.js.nft.json +1 -1
  97. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/page_client-reference-manifest.js +1 -1
  98. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/backlog/page/server-reference-manifest.json +2 -2
  99. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/backlog/page.js +3 -3
  100. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/backlog/page.js.nft.json +1 -1
  101. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/backlog/page_client-reference-manifest.js +1 -1
  102. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/page/server-reference-manifest.json +2 -2
  103. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/page.js +3 -3
  104. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/page.js.nft.json +1 -1
  105. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/page_client-reference-manifest.js +1 -1
  106. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/page/server-reference-manifest.json +2 -2
  107. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/page.js +3 -3
  108. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/page.js.nft.json +1 -1
  109. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/page_client-reference-manifest.js +1 -1
  110. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/page/server-reference-manifest.json +3 -3
  111. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/page.js +5 -5
  112. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/page.js.nft.json +1 -1
  113. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/page_client-reference-manifest.js +1 -1
  114. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/tasks/[taskId]/page/server-reference-manifest.json +2 -2
  115. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/tasks/[taskId]/page.js +3 -3
  116. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/tasks/[taskId]/page.js.nft.json +1 -1
  117. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/tasks/[taskId]/page_client-reference-manifest.js +1 -1
  118. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/page/server-reference-manifest.json +2 -2
  119. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/page.js +3 -3
  120. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/page.js.nft.json +1 -1
  121. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/page_client-reference-manifest.js +1 -1
  122. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/tranches/page/server-reference-manifest.json +2 -2
  123. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/tranches/page.js +3 -3
  124. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/tranches/page.js.nft.json +1 -1
  125. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/tranches/page_client-reference-manifest.js +1 -1
  126. package/studio-standalone/apps/vinaya-studio/web/.next/server/app-paths-manifest.json +0 -1
  127. 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
  128. 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
  129. 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
  130. 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
  131. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/{_15gdg48._.js → [root-of-the-server]__04adkz-._.js} +3 -3
  132. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__05zwn98._.js +14 -0
  133. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__08e39jo._.js +3 -0
  134. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__0ls23oh._.js +1 -1
  135. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__10riywf._.js +3 -0
  136. 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
  137. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/{[root-of-the-server]__1wy7w66._.js → [root-of-the-server]__14ui9sz._.js} +2 -2
  138. 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
  139. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__1f4bb3_._.js +3 -0
  140. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__1gjqmhq._.js +1 -1
  141. 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
  142. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__1ng2x88._.js +3 -0
  143. 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
  144. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__1snpgaw._.js +56 -0
  145. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__1wc4-ip._.js +2 -2
  146. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_06h3wbl._.js +3 -0
  147. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_08onyya._.js +1 -1
  148. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_096f46i._.js +1 -1
  149. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0af2one._.js +1 -1
  150. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0e5tkdd._.js +1 -1
  151. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0gs4gvl._.js +3 -0
  152. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0kf2g72._.js +1 -1
  153. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0zf4d27._.js +1 -1
  154. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_1-wo68i._.js +1 -1
  155. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_121lrn5._.js +3 -0
  156. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_1achbh9._.js +1 -1
  157. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_1o4v6lb._.js +3 -0
  158. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_1q7h5mz._.js +1 -1
  159. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_1ztd4i3._.js +3 -0
  160. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_209-ugd._.js +3 -0
  161. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_214d71c._.js +3 -0
  162. 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
  163. 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
  164. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/node_modules_next_dist_1lzmr5o._.js +1 -1
  165. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/packages_ui_libraries_animate_components_index_ts_186fje1._.js +1 -1
  166. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/packages_ui_libraries_basic_components_index_ts_0xk1vda._.js +1 -1
  167. package/studio-standalone/apps/vinaya-studio/web/.next/server/middleware-build-manifest.js +3 -3
  168. package/studio-standalone/apps/vinaya-studio/web/.next/server/pages/500.html +1 -1
  169. package/studio-standalone/apps/vinaya-studio/web/.next/server/server-reference-manifest.js +1 -1
  170. package/studio-standalone/apps/vinaya-studio/web/.next/server/server-reference-manifest.json +4 -4
  171. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/09fcolor69bun.js +1 -0
  172. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/0lcwmwzxacdie.js +1 -0
  173. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/0ojry7lrbzkfd.css +1 -0
  174. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/{00z3-ljjd1gj9.js → 0vtfb0g813gki.js} +1 -1
  175. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/1giu47hrbhroj.js +1 -0
  176. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/1shz6lwruld25.js +1 -0
  177. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/1ytvuy1mmnc6j.js +1 -0
  178. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/{3oxhhhm_psozq.js → 21a6_5cr956wj.js} +1 -1
  179. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/2g8mwnydod96u.js +1 -0
  180. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/{3li0ueedy-ozv.js → 2nrnuawd5fwpv.js} +1 -1
  181. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/2nw47832_uvfe.js +1 -0
  182. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/2qdxnj8wk2h0s.js +1 -0
  183. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/3b9q75p-z5ma5.js +1 -0
  184. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/3cv-oe7153242.js +1 -0
  185. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/{3lqjwjrcvq481.js → 3l56x8wjdzvaw.js} +5 -5
  186. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/3m310lbjj4p5u.js +1 -0
  187. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/{2o9l0b7eqbr57.js → 3qtt1v3ya-ofe.js} +1 -1
  188. package/studio-standalone/apps/vinaya-studio/web/package.json +2 -2
  189. package/studio-standalone/apps/vinaya-studio/web/server.js +1 -1
  190. 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
  191. package/studio-standalone/_node_modules/next/dist/compiled/next-server/app-route-turbo.runtime.prod.js +0 -6
  192. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/api/coherence/route/app-paths-manifest.json +0 -3
  193. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/api/coherence/route/build-manifest.json +0 -9
  194. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/api/coherence/route/server-reference-manifest.json +0 -4
  195. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/api/coherence/route.js +0 -6
  196. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/api/coherence/route.js.map +0 -5
  197. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/api/coherence/route.js.nft.json +0 -1
  198. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/api/coherence/route_client-reference-manifest.js +0 -3
  199. 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
  200. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/[externals]__0cki-x_._.js +0 -3
  201. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/[root-of-the-server]__02a-3g8._.js +0 -15
  202. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/[turbopack]_runtime.js +0 -903
  203. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__074w9nf._.js +0 -3
  204. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__0ln09ua._.js +0 -3
  205. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__0oegopp._.js +0 -3
  206. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__13yxbjd._.js +0 -51
  207. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__1duqmtm._.js +0 -3
  208. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__1z7dml9._.js +0 -9
  209. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0bfs_u4._.js +0 -3
  210. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0g8_eot._.js +0 -3
  211. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0hrh_v-._.js +0 -181
  212. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0i4-dea._.js +0 -3
  213. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0o54suy._.js +0 -3
  214. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0rxd7s0._.js +0 -3
  215. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0y1jv16._.js +0 -3
  216. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_151m4rz._.js +0 -3
  217. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_1a9dieq._.js +0 -3
  218. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_1sxsf5q._.js +0 -3
  219. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_1sy_yfr._.js +0 -3
  220. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_219v2an._.js +0 -3
  221. 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
  222. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/packages_ui_libraries_basic_components_form_input_tsx_0es8d8b._.js +0 -3
  223. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/packages_ui_libraries_brutal_components_index_ts_0n_lcc4._.js +0 -3
  224. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/packages_ui_libraries_retro_components_index_ts_0wvpm_z._.js +0 -3
  225. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/0bjnj-5fy4e7l.js +0 -1
  226. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/0c8uwz_-m8s99.js +0 -165
  227. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/0ct0c-xj0baf6.js +0 -1
  228. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/0ko698wh8xx2g.css +0 -1
  229. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/0t5n_r4xm__t-.js +0 -1
  230. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/0vc2u252q5q6o.js +0 -1
  231. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/16r_o07lw0vm0.js +0 -1
  232. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/1cah7_e5a1zvu.js +0 -1
  233. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/1gjo9-6dz7nup.js +0 -1
  234. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/24tz8aro1uto4.js +0 -1
  235. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/2ef2g5fozszw7.js +0 -1
  236. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/2ka8dg687auhj.js +0 -1
  237. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/2pf3f50gbrkyv.js +0 -1
  238. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/2qq49pct3q51-.js +0 -1
  239. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/3et66z7glk65w.js +0 -1
  240. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/3y6u3prmrkea-.js +0 -1
  241. /package/studio-standalone/apps/vinaya-studio/web/.next/static/{z1fTSBP6ZlUjObzFIp-qq → yR5RsCxb1OGnYggiaO09S}/_buildManifest.js +0 -0
  242. /package/studio-standalone/apps/vinaya-studio/web/.next/static/{z1fTSBP6ZlUjObzFIp-qq → yR5RsCxb1OGnYggiaO09S}/_clientMiddlewareManifest.js +0 -0
  243. /package/studio-standalone/apps/vinaya-studio/web/.next/static/{z1fTSBP6ZlUjObzFIp-qq → yR5RsCxb1OGnYggiaO09S}/_ssgManifest.js +0 -0
@@ -1884,45 +1884,6 @@ var DERIVED_STATUSES = [
1884
1884
  "incoherent"
1885
1885
  ];
1886
1886
  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
1887
  // ../../packages/aeg-core/src/waiver-label.ts
1927
1888
  var WAIVER_LABEL = label("waiver-docs");
1928
1889
  var WAIVER_LABEL_REVIEW = label("waiver-review");
@@ -1938,61 +1899,6 @@ function isWaiverLabelActorVerified(opts) {
1938
1899
  return false;
1939
1900
  return isPrincipal(opts.labelActor, opts.principalAllowlist);
1940
1901
  }
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
1902
  // ../../packages/aeg-core/src/verdict-extraction.ts
1997
1903
  var HEAD_SHA_PATTERN = /^[ \t]*(?:\*{1,3}|_{1,3})?Judged head:\s*([0-9a-f]{7,40})(?![A-Za-z0-9])/im;
1998
1904
  var OBJECTIVES_VERSION_PATTERN = /^[ \t]*(?:\*{1,3}|_{1,3})?Objectives version:\s*([0-9a-f]{64})(?![A-Za-z0-9])/im;
@@ -2441,10 +2347,12 @@ function evaluateC5(changed, docOwnersContent, prBody, fileExists, waiverActive,
2441
2347
  var CODE_REVIEW_SEVERITY_ORDER = ["BLOCKER", "MAJOR", "MINOR"];
2442
2348
  var SECURITY_SEVERITY_ORDER = ["CRITICAL", "HIGH", "MEDIUM", "LOW"];
2443
2349
  var DEFAULT_MAX_ROUNDS = 3;
2350
+ var DEFAULT_MAX_TASK_MINUTES = 180;
2444
2351
  var DEFAULT_REVIEW_POLICY = {
2445
2352
  codeReviewThreshold: "BLOCKER",
2446
2353
  securityThreshold: "HIGH",
2447
- maxRounds: DEFAULT_MAX_ROUNDS
2354
+ maxRounds: DEFAULT_MAX_ROUNDS,
2355
+ maxTaskMinutes: DEFAULT_MAX_TASK_MINUTES
2448
2356
  };
2449
2357
  var FILE_SHAPED_LOCATION = /\.[a-zA-Z0-9]{1,10}(:\d+)?\s*$/;
2450
2358
  var PROSE_LOCATION_PATTERNS = [/\bpr\s*body\b/i, /\bcomment\b/i];
@@ -2845,11 +2753,13 @@ function checkDocUpdateList(prBody) {
2845
2753
  return headingCheck(prBody, "(?:documentation|doc)[- ]update(?:\\s+list)?", "Documentation-update list");
2846
2754
  }
2847
2755
  function checkWorktreeStep0(prBody) {
2848
- if (/git worktree add/.test(prBody))
2756
+ if (/git worktree add/.test(prBody) || /cd \.worktrees\//.test(prBody) || /bun install --frozen-lockfile/.test(prBody))
2849
2757
  return { status: "pass", errors: [] };
2850
2758
  return {
2851
2759
  status: "fail",
2852
- errors: ["brief-validation worktree Step 0: no `git worktree add` command found in the PR body."]
2760
+ errors: [
2761
+ "brief-validation worktree Step 0: no `git worktree add`, `cd .worktrees/`, or `bun install --frozen-lockfile` command found in the PR body."
2762
+ ]
2853
2763
  };
2854
2764
  }
2855
2765
  function checkStopConditions(prBody) {
@@ -3039,7 +2949,8 @@ function isCommandBlock(content) {
3039
2949
  return COMMAND_WORDS.includes(commandWordOf(firstNonBlankLine(content)));
3040
2950
  }
3041
2951
  function isStep0Block(content) {
3042
- return firstNonBlankLine(content).startsWith("git worktree add");
2952
+ const first = firstNonBlankLine(content);
2953
+ return first.startsWith("git worktree add") || first.startsWith("cd .worktrees/") || first.startsWith("bun install --frozen-lockfile");
3043
2954
  }
3044
2955
  function checkCommandsCarryOutput(prBody) {
3045
2956
  const errors = [];
@@ -3508,10 +3419,14 @@ function legacySlugPattern(legacySlugs) {
3508
3419
  const alternation = legacySlugs.map((s) => s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")).join("|");
3509
3420
  return new RegExp(`(^|[^a-zA-Z0-9\\n-])(${alternation})([^a-zA-Z0-9\\n-]|$)`, "g");
3510
3421
  }
3422
+ function specGrandfatherPaths(specGrandfather) {
3423
+ return Array.isArray(specGrandfather) ? [...specGrandfather] : Object.keys(specGrandfather);
3424
+ }
3511
3425
  function checkUnresolvableReferences(files, readerFacingPrefix, readerFacingSuffix, legacySlugs = [], shipsPrefix = SHIPS_PREFIX, specGrandfather = [], specPaths = DEFAULT_SPEC_PATHS) {
3512
3426
  const findings = [];
3513
3427
  const legacyPattern = legacySlugPattern(legacySlugs);
3514
- const grandfathered = new Set(specGrandfather);
3428
+ const grandfatheredWhole = new Set(Array.isArray(specGrandfather) ? specGrandfather : []);
3429
+ const limits = new Map(Array.isArray(specGrandfather) ? [] : Object.entries(specGrandfather));
3515
3430
  const patterns = [
3516
3431
  { pattern: FORGE_NUMBER_PATTERN, what: "a forge number" },
3517
3432
  { pattern: TRANCHE_SLUG_VN_PATTERN, what: "an internal tranche slug" },
@@ -3530,18 +3445,19 @@ function checkUnresolvableReferences(files, readerFacingPrefix, readerFacingSuff
3530
3445
  continue;
3531
3446
  if (cls !== "product" && cls !== "spec" && !SWEPT_CLASSES.has(cls))
3532
3447
  continue;
3533
- if (cls === "spec" && grandfathered.has(file.path))
3448
+ if (cls === "spec" && grandfatheredWhole.has(file.path))
3534
3449
  continue;
3535
3450
  const blocking = cls === "product" || cls === "spec";
3536
3451
  const scrubbed = cls === "product" ? stripNonProseForProduct(file.path, file.content) : stripNonProse(file.path, file.content);
3537
3452
  const patternsToRun = cls === "product" ? productPatterns : cls === "spec" ? specPatterns : patterns;
3453
+ const fileFindings = [];
3538
3454
  for (const { pattern, what, group } of patternsToRun) {
3539
3455
  pattern.lastIndex = 0;
3540
3456
  let match = pattern.exec(scrubbed);
3541
3457
  while (match !== null) {
3542
3458
  const cited = group !== undefined ? match[group] ?? match[0] : match[0];
3543
3459
  const citedIndex = match.index + match[0].indexOf(cited);
3544
- findings.push({
3460
+ fileFindings.push({
3545
3461
  file: file.path,
3546
3462
  line: lineAt(scrubbed, citedIndex),
3547
3463
  message: `references ${what} ("${cited}") a reader outside this repo's tracker cannot resolve`,
@@ -3550,6 +3466,15 @@ function checkUnresolvableReferences(files, readerFacingPrefix, readerFacingSuff
3550
3466
  match = pattern.exec(scrubbed);
3551
3467
  }
3552
3468
  }
3469
+ const limit = cls === "spec" ? limits.get(file.path) : undefined;
3470
+ if (limit !== undefined) {
3471
+ if (fileFindings.length <= limit)
3472
+ continue;
3473
+ for (const f of fileFindings) {
3474
+ f.message += `; ${file.path} carries ${fileFindings.length} such findings, over its proseGates.specGrandfather limit of ${limit}`;
3475
+ }
3476
+ }
3477
+ findings.push(...fileFindings);
3553
3478
  }
3554
3479
  return findings;
3555
3480
  }
@@ -4509,8 +4434,7 @@ function briefHash(brief) {
4509
4434
  function policyDigest(policy) {
4510
4435
  return createHash4("sha256").update(JSON.stringify({
4511
4436
  codeReviewThreshold: policy.codeReviewThreshold,
4512
- securityThreshold: policy.securityThreshold,
4513
- maxRounds: policy.maxRounds
4437
+ securityThreshold: policy.securityThreshold
4514
4438
  })).digest("hex");
4515
4439
  }
4516
4440
  function isBoundToHead(echoed, headSha) {
@@ -4823,7 +4747,46 @@ function parseEnforcementRegistry(content) {
4823
4747
  return result;
4824
4748
  }
4825
4749
  // ../../packages/aeg-core/src/registry-checks.ts
4826
- function checkG1(rows, existsFn) {
4750
+ var HOOK_DIR_PREFIXES = [".claude/hooks/", ".vinaya/hooks/", ".husky/", ".git/hooks/"];
4751
+ var BARE_HOOK_NAME = /^check-[A-Za-z0-9_.-]*\.sh$/;
4752
+ function basename(path) {
4753
+ return path.slice(path.lastIndexOf("/") + 1);
4754
+ }
4755
+ function lineOf(content, index) {
4756
+ let line = 1;
4757
+ for (let i = 0;i < index; i++)
4758
+ if (content.charCodeAt(i) === 10)
4759
+ line++;
4760
+ return line;
4761
+ }
4762
+ function findUnshippedHookRefs(docs, shipped) {
4763
+ const shippedNames = new Set([...shipped].map(basename));
4764
+ const findings = [];
4765
+ const flag = (doc, token, index) => {
4766
+ findings.push({
4767
+ path: doc.path,
4768
+ reason: `${doc.path}:${lineOf(doc.content, index)} names hook "${token}", which is neither tracked in git nor emitted by \`vinaya init\``
4769
+ });
4770
+ };
4771
+ for (const doc of docs) {
4772
+ for (const { cited, index } of extractCitedPaths(doc.content)) {
4773
+ if (cited.endsWith("/") || !HOOK_DIR_PREFIXES.some((p) => cited.startsWith(p)))
4774
+ continue;
4775
+ if (!shipped.has(cited))
4776
+ flag(doc, cited, index);
4777
+ }
4778
+ const spanPattern = /`([^`\n]+)`/g;
4779
+ let match = spanPattern.exec(doc.content);
4780
+ while (match !== null) {
4781
+ const token = match[1] ?? "";
4782
+ if (BARE_HOOK_NAME.test(token) && !shippedNames.has(token))
4783
+ flag(doc, token, match.index);
4784
+ match = spanPattern.exec(doc.content);
4785
+ }
4786
+ }
4787
+ return findings;
4788
+ }
4789
+ function checkG1(rows, existsFn, hookRefs) {
4827
4790
  const findings = [];
4828
4791
  for (const row of rows) {
4829
4792
  if (row.implementation === "")
@@ -4836,6 +4799,8 @@ function checkG1(rows, existsFn) {
4836
4799
  });
4837
4800
  }
4838
4801
  }
4802
+ if (hookRefs)
4803
+ findings.push(...findUnshippedHookRefs(hookRefs.docs, hookRefs.shipped));
4839
4804
  return { check: "G1", status: findings.length > 0 ? "fail" : "pass", findings };
4840
4805
  }
4841
4806
  var SCAFFOLD_PLACEHOLDER = "[undocumented — fill in why]";
@@ -5389,7 +5354,6 @@ var TaskPrPauseSchema = z.object({
5389
5354
  var TaskPrReviewRecordSchema = z.object({
5390
5355
  verdicts: z.array(TaskPrVerdictSchema),
5391
5356
  roundMarkers: z.array(z.number().int().nonnegative()),
5392
- summaryTable: z.string().nullable(),
5393
5357
  pause: TaskPrPauseSchema.nullable()
5394
5358
  });
5395
5359
  var TaskPrReadInputSchema = z.object({
@@ -5436,16 +5400,6 @@ var TaskCancelResultSchema = z.object({
5436
5400
  authenticatedFrom: z.string().min(1),
5437
5401
  fencedEffectKeys: z.array(z.string())
5438
5402
  });
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
5403
  // ../../packages/aeg-core/src/first-push-dispatch-gate.ts
5450
5404
  function parseTaskBranch(branch) {
5451
5405
  const m = /^task\/([^/]+)\/([^/]+)$/.exec(branch);
@@ -5676,15 +5630,69 @@ var NO_GATE_CUTOVERS = {
5676
5630
  briefRulesSincePr: null,
5677
5631
  agentBoxesRefusedSincePr: null
5678
5632
  };
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
5633
  // ../../packages/aeg-core/src/log/schema.ts
5634
+ import { z as z3 } from "zod";
5635
+
5636
+ // ../../packages/aeg-core/src/log/custom.ts
5687
5637
  import { z as z2 } from "zod";
5638
+ var CUSTOM_EVENT_NAME_PATTERN = /^[a-z][a-z0-9_]*\.[a-z][a-z0-9_.]*$/;
5639
+ var CUSTOM_EVENT_NAME_MAX_LENGTH = 64;
5640
+ var CUSTOM_EVENT_RESERVED_NAMESPACE = "vinaya";
5641
+ var CUSTOM_EVENT_MAX_FIELDS = 20;
5642
+ var CUSTOM_FIELD_NAME_PATTERN = /^[a-z][a-z0-9_]*$/;
5643
+ var CUSTOM_FIELD_NAME_MAX_LENGTH = 64;
5644
+ var CUSTOM_TEXT_MAX_LENGTH = 500;
5645
+ var CUSTOM_WORD_PATTERN = /^[a-z0-9][a-z0-9_-]*$/;
5646
+ var CUSTOM_WORD_MAX_LENGTH = 64;
5647
+ var CUSTOM_FIELD_MAX_WORDS = 50;
5648
+ var CustomFieldTypeSchema = z2.union([z2.enum(["text", "number", "boolean"]), z2.array(z2.string())]);
5649
+ var CustomEventDeclarationsSchema = z2.record(z2.string(), z2.object({
5650
+ fields: z2.record(z2.string(), CustomFieldTypeSchema)
5651
+ }).strict()).superRefine((events, ctx) => {
5652
+ for (const [name, declaration] of Object.entries(events)) {
5653
+ const refuse = (message, path = []) => {
5654
+ ctx.addIssue({
5655
+ code: z2.ZodIssueCode.custom,
5656
+ path: [name, ...path],
5657
+ message: `logs.events "${name}": ${message}`
5658
+ });
5659
+ };
5660
+ if (name.length > CUSTOM_EVENT_NAME_MAX_LENGTH) {
5661
+ refuse(`the name must be at most ${CUSTOM_EVENT_NAME_MAX_LENGTH} characters`);
5662
+ }
5663
+ if (!CUSTOM_EVENT_NAME_PATTERN.test(name)) {
5664
+ refuse("the name must be `<namespace>.<event>` — lowercase letters, digits and `_`, a dot between them");
5665
+ } else if (name.split(".")[0] === CUSTOM_EVENT_RESERVED_NAMESPACE) {
5666
+ refuse(`the \`${CUSTOM_EVENT_RESERVED_NAMESPACE}.\` namespace is reserved for Vinaya's own events`);
5667
+ }
5668
+ const fieldEntries = Object.entries(declaration.fields);
5669
+ if (fieldEntries.length > CUSTOM_EVENT_MAX_FIELDS) {
5670
+ refuse(`at most ${CUSTOM_EVENT_MAX_FIELDS} fields may be declared (found ${fieldEntries.length})`, ["fields"]);
5671
+ }
5672
+ for (const [field, type] of fieldEntries) {
5673
+ if (field.length > CUSTOM_FIELD_NAME_MAX_LENGTH || !CUSTOM_FIELD_NAME_PATTERN.test(field)) {
5674
+ 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]);
5675
+ }
5676
+ if (typeof type === "string")
5677
+ continue;
5678
+ if (type.length === 0) {
5679
+ refuse(`field "${field}": a list of words must name at least one word`, ["fields", field]);
5680
+ }
5681
+ if (type.length > CUSTOM_FIELD_MAX_WORDS) {
5682
+ refuse(`field "${field}": a list of words may name at most ${CUSTOM_FIELD_MAX_WORDS}`, ["fields", field]);
5683
+ }
5684
+ const bad = type.filter((w) => w.length > CUSTOM_WORD_MAX_LENGTH || !CUSTOM_WORD_PATTERN.test(w));
5685
+ if (bad.length > 0) {
5686
+ refuse(`field "${field}": a listed word is lowercase letters, digits, \`_\` and \`-\`, at most ${CUSTOM_WORD_MAX_LENGTH} characters`, ["fields", field]);
5687
+ }
5688
+ if (new Set(type).size !== type.length) {
5689
+ refuse(`field "${field}": a list of words names a word twice`, ["fields", field]);
5690
+ }
5691
+ }
5692
+ }
5693
+ });
5694
+
5695
+ // ../../packages/aeg-core/src/log/schema.ts
5688
5696
  var CONFIDENCE_REASON_MAX_LENGTH = 280;
5689
5697
  var ROLE_VALUES = [
5690
5698
  "planner",
@@ -5695,178 +5703,210 @@ var ROLE_VALUES = [
5695
5703
  "archivist",
5696
5704
  "architect"
5697
5705
  ];
5698
- var RoleSchema = z2.enum(ROLE_VALUES);
5706
+ var RoleSchema = z3.enum(ROLE_VALUES);
5699
5707
  var HOST_VALUES = ["hook", "ci", "cli", "loop"];
5700
- var HostSchema = z2.enum(HOST_VALUES);
5708
+ var HostSchema = z3.enum(HOST_VALUES);
5701
5709
  var RUN_ID_PATTERN = /^[A-Za-z0-9_.-]{1,128}$/;
5702
5710
  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(),
5711
+ ts: z3.string(),
5712
+ run_id: z3.string().regex(RUN_ID_PATTERN),
5713
+ seq: z3.number().int().nonnegative(),
5714
+ repo: z3.string().nullable(),
5715
+ vinaya: z3.string(),
5716
+ doctrine: z3.string(),
5709
5717
  host: HostSchema,
5710
- machine: z2.string()
5718
+ machine: z3.string()
5711
5719
  };
5712
- var HeaderMetaV1Schema = z2.object({
5713
- schema: z2.literal(1),
5720
+ var HeaderMetaV1Schema = z3.object({
5721
+ schema: z3.literal(1),
5714
5722
  ...headerMetaCore
5715
5723
  }).strict();
5716
- var LineageSchema = z2.object({
5717
- run: z2.string().nullable(),
5718
- attempt: z2.number().int().nullable(),
5719
- parent: z2.string().nullable()
5724
+ var LineageSchema = z3.object({
5725
+ run: z3.string().nullable(),
5726
+ attempt: z3.number().int().nullable(),
5727
+ parent: z3.string().nullable()
5720
5728
  }).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()
5729
+ var InputVersionsSchema = z3.object({
5730
+ objectives_version: z3.string().nullable(),
5731
+ brief_hash: z3.string().nullable(),
5732
+ ruling_ordinal: z3.number().int().nullable(),
5733
+ policy_digest: z3.string().nullable()
5726
5734
  }).strict();
5727
- var ProvenanceSchema = z2.enum(["parent_attributed", "env_correlated", "self_reported", "unavailable"]);
5728
- var HeaderMetaV2Schema = z2.object({
5729
- schema: z2.literal(2),
5735
+ var ProvenanceSchema = z3.enum(["parent_attributed", "env_correlated", "self_reported", "unavailable"]);
5736
+ var HeaderMetaV2Schema = z3.object({
5737
+ schema: z3.literal(2),
5730
5738
  ...headerMetaCore,
5731
- event_id: z2.string().min(1),
5732
- process_id: z2.string().min(1),
5733
- actor_id: z2.string().nullable(),
5739
+ event_id: z3.string().min(1),
5740
+ process_id: z3.string().min(1),
5741
+ actor_id: z3.string().nullable(),
5734
5742
  lineage: LineageSchema,
5735
5743
  input_versions: InputVersionsSchema,
5736
5744
  provenance: ProvenanceSchema
5737
5745
  }).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()
5746
+ var WorkSchema = z3.object({
5747
+ ref: z3.string().nullable(),
5748
+ repo: z3.string().nullable(),
5749
+ change: z3.string().nullable(),
5750
+ revision: z3.string().nullable()
5751
+ }).strict();
5752
+ var FlowSchema = z3.object({
5753
+ id: z3.string().nullable(),
5754
+ version: z3.string().nullable()
5755
+ }).strict();
5756
+ var HeaderMetaV3Schema = z3.object({
5757
+ schema: z3.literal(3),
5758
+ ...headerMetaCore,
5759
+ event_id: z3.string().min(1),
5760
+ process_id: z3.string().min(1),
5761
+ actor_id: z3.string().nullable(),
5762
+ lineage: LineageSchema,
5763
+ input_versions: InputVersionsSchema,
5764
+ provenance: ProvenanceSchema,
5765
+ work: WorkSchema,
5766
+ flow: FlowSchema,
5767
+ runtime: z3.string().nullable(),
5768
+ source: z3.string().nullable()
5769
+ }).strict();
5770
+ var HeaderMetaSchema = z3.discriminatedUnion("schema", [HeaderMetaV1Schema, HeaderMetaV2Schema, HeaderMetaV3Schema]);
5771
+ var SubjectSchema = z3.object({
5772
+ issue: z3.number().int().nullable(),
5773
+ pr: z3.number().int().optional(),
5774
+ sha: z3.string().optional(),
5775
+ role: z3.union([RoleSchema, z3.literal("unattributed")]),
5776
+ round: z3.number().int().optional(),
5777
+ objectives_version: z3.string().optional()
5746
5778
  }).strict();
5747
- var HeaderSchema = z2.object({
5779
+ var HeaderSchema = z3.object({
5748
5780
  meta: HeaderMetaSchema,
5749
5781
  subject: SubjectSchema
5750
5782
  }).strict();
5751
5783
  var envelopeTail = {
5752
- duration_ms: z2.number().nonnegative().optional(),
5753
- payload: z2.object({}).strict()
5784
+ duration_ms: z3.number().nonnegative().optional(),
5785
+ payload: z3.object({}).strict()
5754
5786
  };
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()
5787
+ var ReviewFindingSchema = z3.object({
5788
+ id: z3.string(),
5789
+ severity: z3.string(),
5790
+ state: z3.string().optional(),
5791
+ severity_scale: z3.string().optional(),
5792
+ policy_treatment: z3.enum(["blocking", "non_blocking", "unavailable"]).optional(),
5793
+ confidence: z3.number().min(0).max(1).optional(),
5794
+ confidence_scale: z3.string().optional(),
5795
+ confidence_source: z3.string().optional()
5764
5796
  }).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()
5797
+ var DispatchOutcomeSchema = z3.discriminatedUnion("type", [
5798
+ z3.object({ type: z3.literal("pr_opened"), pr: z3.number().int(), head: z3.string() }).strict(),
5799
+ z3.object({
5800
+ type: z3.literal("round_pushed"),
5801
+ pr: z3.number().int(),
5802
+ head: z3.string(),
5803
+ comment_id: z3.number().int()
5772
5804
  }).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)
5805
+ z3.object({
5806
+ type: z3.literal("verdict"),
5807
+ verdict: z3.enum(["APPROVE", "REQUEST CHANGES", "PASS", "FAIL"]),
5808
+ head: z3.string(),
5809
+ comment_id: z3.number().int(),
5810
+ objectives: z3.array(z3.object({ id: z3.string(), met: z3.boolean() }).strict()),
5811
+ findings: z3.array(ReviewFindingSchema)
5780
5812
  }).strict(),
5781
- z2.object({
5782
- type: z2.literal("escalation"),
5783
- class: z2.enum(["authority", "strategy", "product"]),
5784
- comment_id: z2.number().int()
5813
+ z3.object({
5814
+ type: z3.literal("escalation"),
5815
+ class: z3.enum(["authority", "strategy", "product"]),
5816
+ comment_id: z3.number().int()
5785
5817
  }).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()
5818
+ z3.object({ type: z3.literal("brief"), comment_id: z3.number().int(), hash: z3.string() }).strict(),
5819
+ z3.object({ type: z3.literal("plan"), issues: z3.array(z3.number().int()) }).strict(),
5820
+ z3.object({ type: z3.literal("archive"), provenance_comment_id: z3.number().int() }).strict(),
5821
+ z3.object({ type: z3.literal("completed") }).strict()
5790
5822
  ]);
5791
5823
  var dispatchShared = {
5792
5824
  meta: HeaderMetaSchema,
5793
5825
  subject: SubjectSchema,
5794
- kind: z2.literal("dispatch"),
5826
+ kind: z3.literal("dispatch"),
5795
5827
  ...envelopeTail,
5796
5828
  target_role: RoleSchema,
5797
- model: z2.string(),
5798
- round: z2.number().int().optional(),
5799
- effect_id: z2.string()
5829
+ model: z3.string(),
5830
+ round: z3.number().int().optional(),
5831
+ effect_id: z3.string()
5800
5832
  };
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({
5833
+ var dispatchUsageField = z3.object({ input: z3.number().nonnegative(), output: z3.number().nonnegative() }).strict().nullable();
5834
+ var DispatchEventSchema = z3.discriminatedUnion("event", [
5835
+ z3.object({ ...dispatchShared, event: z3.literal("dispatched"), prompt_hash: z3.string() }).strict(),
5836
+ z3.object({
5805
5837
  ...dispatchShared,
5806
- event: z2.literal("outcome_received"),
5838
+ event: z3.literal("outcome_received"),
5807
5839
  outcome: DispatchOutcomeSchema,
5808
5840
  usage: dispatchUsageField
5809
5841
  }).strict(),
5810
- z2.object({
5842
+ z3.object({
5811
5843
  ...dispatchShared,
5812
- event: z2.literal("dispatch_failed"),
5813
- reason: z2.enum(["timeout", "crash", "refused", "unattributed_write"]),
5844
+ event: z3.literal("dispatch_failed"),
5845
+ reason: z3.enum(["timeout", "crash", "refused", "unattributed_write"]),
5814
5846
  usage: dispatchUsageField
5815
5847
  }).strict()
5816
5848
  ]);
5849
+ var CODE_TOKEN_PATTERN = /^[A-Za-z0-9._-]{1,64}$/;
5850
+ var CodeTokenSchema = z3.string().regex(CODE_TOKEN_PATTERN);
5851
+ var ReviewerVerdictSchema = z3.object({
5852
+ role: RoleSchema,
5853
+ outcome: z3.enum(["approve", "changes_requested", "not_reviewed"]),
5854
+ blockers: z3.number().int().nonnegative()
5855
+ }).strict();
5817
5856
  var loopShared = {
5818
5857
  meta: HeaderMetaSchema,
5819
5858
  subject: SubjectSchema,
5820
- kind: z2.literal("dev_review_loop"),
5859
+ kind: z3.literal("dev_review_loop"),
5821
5860
  ...envelopeTail,
5822
- loop_id: z2.string()
5861
+ loop_id: z3.string()
5823
5862
  };
5824
- var DevReviewLoopEventSchema = z2.discriminatedUnion("event", [
5825
- z2.object({
5863
+ var DevReviewLoopEventSchema = z3.discriminatedUnion("event", [
5864
+ z3.object({
5826
5865
  ...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())
5866
+ event: z3.literal("loop_started"),
5867
+ task: z3.number().int(),
5868
+ policy: z3.object({
5869
+ max_rounds: z3.number().int().nonnegative(),
5870
+ reviewers: z3.array(RoleSchema),
5871
+ models: z3.record(RoleSchema, z3.string())
5833
5872
  }).strict()
5834
5873
  }).strict(),
5835
- z2.object({ ...loopShared, event: z2.literal("round_started"), round: z2.number().int(), base_head: z2.string() }).strict(),
5836
- z2.object({
5874
+ z3.object({ ...loopShared, event: z3.literal("round_started"), round: z3.number().int(), base_head: z3.string() }).strict(),
5875
+ z3.object({
5837
5876
  ...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()
5877
+ event: z3.literal("gate_result_read"),
5878
+ round: z3.number().int(),
5879
+ head: z3.string(),
5880
+ green: z3.boolean(),
5881
+ confidence_value: z3.number().int().min(0).max(100).optional(),
5882
+ confidence_reason: z3.string().max(CONFIDENCE_REASON_MAX_LENGTH).optional(),
5883
+ confidence_unavailable: z3.boolean().optional(),
5884
+ extra_turn_spent: z3.boolean().optional()
5846
5885
  }).strict(),
5847
- z2.object({
5886
+ z3.object({
5848
5887
  ...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()
5888
+ event: z3.literal("verdicts_read"),
5889
+ round: z3.number().int(),
5890
+ head: z3.string(),
5891
+ all_approve: z3.boolean(),
5892
+ blockers: z3.number().int().nonnegative(),
5893
+ findings: z3.array(ReviewFindingSchema).optional(),
5894
+ reviewers: z3.array(ReviewerVerdictSchema).optional()
5855
5895
  }).strict(),
5856
- z2.object({
5896
+ z3.object({
5857
5897
  ...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())
5898
+ event: z3.literal("findings_compared"),
5899
+ round: z3.number().int(),
5900
+ open: z3.array(z3.string()),
5901
+ resolved: z3.array(z3.string()),
5902
+ new: z3.array(z3.string()),
5903
+ recurring: z3.array(z3.string())
5864
5904
  }).strict(),
5865
- z2.object({
5905
+ z3.object({
5866
5906
  ...loopShared,
5867
- event: z2.literal("stop_condition_met"),
5868
- round: z2.number().int(),
5869
- condition: z2.enum([
5907
+ event: z3.literal("stop_condition_met"),
5908
+ round: z3.number().int(),
5909
+ condition: z3.enum([
5870
5910
  "green",
5871
5911
  "max_rounds",
5872
5912
  "no_progress",
@@ -5875,66 +5915,85 @@ var DevReviewLoopEventSchema = z2.discriminatedUnion("event", [
5875
5915
  "confidence",
5876
5916
  "reappearance",
5877
5917
  "repeat_finding",
5878
- "repeat_failure"
5918
+ "repeat_failure",
5919
+ "time_budget"
5879
5920
  ])
5880
5921
  }).strict(),
5881
- z2.object({
5922
+ z3.object({
5923
+ ...loopShared,
5924
+ event: z3.literal("paused"),
5925
+ round: z3.number().int(),
5926
+ reason: z3.enum(["escalation", "principal_item", "refreeze_needed"]),
5927
+ reason_code: CodeTokenSchema.optional()
5928
+ }).strict(),
5929
+ z3.object({
5930
+ ...loopShared,
5931
+ event: z3.literal("resumed"),
5932
+ round: z3.number().int(),
5933
+ by: z3.enum(["principal", "driver"])
5934
+ }).strict(),
5935
+ z3.object({
5882
5936
  ...loopShared,
5883
- event: z2.literal("paused"),
5884
- round: z2.number().int(),
5885
- reason: z2.enum(["escalation", "principal_item", "refreeze_needed"])
5937
+ event: z3.literal("cancelled"),
5938
+ round: z3.number().int(),
5939
+ by: z3.literal("principal")
5886
5940
  }).strict(),
5887
- z2.object({
5941
+ z3.object({
5888
5942
  ...loopShared,
5889
- event: z2.literal("resumed"),
5890
- round: z2.number().int(),
5891
- by: z2.enum(["principal", "driver"])
5943
+ event: z3.literal("unpushed_work_resume"),
5944
+ round: z3.number().int(),
5945
+ branch: z3.string(),
5946
+ detail: z3.string()
5892
5947
  }).strict(),
5893
- z2.object({
5948
+ z3.object({
5894
5949
  ...loopShared,
5895
- event: z2.literal("cancelled"),
5896
- round: z2.number().int(),
5897
- by: z2.literal("principal")
5950
+ event: z3.literal("round_ended"),
5951
+ round: z3.number().int(),
5952
+ base_head: z3.string(),
5953
+ head: z3.string(),
5954
+ files_changed: z3.number().int().nonnegative(),
5955
+ insertions: z3.number().int().nonnegative(),
5956
+ deletions: z3.number().int().nonnegative(),
5957
+ wall_ms: z3.number().nonnegative(),
5958
+ outcome: z3.enum(["green", "changes_requested", "escalated"])
5898
5959
  }).strict(),
5899
- z2.object({
5960
+ z3.object({
5900
5961
  ...loopShared,
5901
- event: z2.literal("unpushed_work_resume"),
5902
- round: z2.number().int(),
5903
- branch: z2.string(),
5904
- detail: z2.string()
5962
+ event: z3.literal("journal_finalized"),
5963
+ rounds: z3.number().int().nonnegative(),
5964
+ total_wall_ms: z3.number().nonnegative(),
5965
+ time_to_green_ms: z3.number().nonnegative().nullable(),
5966
+ files_changed_total: z3.number().int().nonnegative(),
5967
+ final_head: z3.string(),
5968
+ result: z3.enum(["merged_ready", "stopped"])
5905
5969
  }).strict(),
5906
- z2.object({
5970
+ z3.object({
5907
5971
  ...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"])
5972
+ event: z3.literal("infrastructure_retry"),
5973
+ round: z3.number().int(),
5974
+ failure_kind: z3.enum(["pause_comment_post", "developer_connection"]),
5975
+ attempts: z3.number().int().positive(),
5976
+ outcome: z3.enum(["recovered", "exhausted"])
5917
5977
  }).strict(),
5918
- z2.object({
5978
+ z3.object({
5919
5979
  ...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"])
5980
+ event: z3.literal("driver_heartbeat"),
5981
+ task: z3.number().int(),
5982
+ pr: z3.number().int().positive().optional(),
5983
+ round: z3.number().int(),
5984
+ phase: z3.string()
5927
5985
  }).strict(),
5928
- z2.object({
5986
+ z3.object({
5929
5987
  ...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"])
5988
+ event: z3.literal("driver_exited"),
5989
+ task: z3.number().int(),
5990
+ reason: z3.enum(["finished", "paused", "reexec", "error", "signal"]),
5991
+ last_decision: z3.string(),
5992
+ exit_code: z3.number().int().optional(),
5993
+ error_class: CodeTokenSchema.optional()
5935
5994
  }).strict()
5936
5995
  ]);
5937
- var ForgeOpSchema = z2.enum([
5996
+ var ForgeOpSchema = z3.enum([
5938
5997
  "pr.create",
5939
5998
  "pr.comment",
5940
5999
  "pr.body.replace",
@@ -5948,24 +6007,24 @@ var ForgeOpSchema = z2.enum([
5948
6007
  "label.add",
5949
6008
  "label.remove"
5950
6009
  ]);
5951
- var ForgeWriteTargetSchema = z2.object({
5952
- issue: z2.number().int().optional(),
5953
- pr: z2.number().int().optional()
6010
+ var ForgeWriteTargetSchema = z3.object({
6011
+ issue: z3.number().int().optional(),
6012
+ pr: z3.number().int().optional()
5954
6013
  }).strict();
5955
6014
  var forgeWriteShared = {
5956
6015
  meta: HeaderMetaSchema,
5957
6016
  subject: SubjectSchema,
5958
- kind: z2.literal("forge_write"),
6017
+ kind: z3.literal("forge_write"),
5959
6018
  ...envelopeTail,
5960
6019
  op: ForgeOpSchema,
5961
6020
  target: ForgeWriteTargetSchema
5962
6021
  };
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()
6022
+ var ForgeWriteEventSchema = z3.discriminatedUnion("event", [
6023
+ z3.object({ ...forgeWriteShared, event: z3.literal("validated") }).strict(),
6024
+ z3.object({ ...forgeWriteShared, event: z3.literal("refused"), reason: z3.string() }).strict(),
6025
+ z3.object({ ...forgeWriteShared, event: z3.literal("written"), comment_ids: z3.array(z3.string()) }).strict()
5967
6026
  ]);
5968
- var GateOutcomeSchema = z2.enum([
6027
+ var GateOutcomeSchema = z3.enum([
5969
6028
  "pass",
5970
6029
  "fail",
5971
6030
  "wait",
@@ -5978,61 +6037,74 @@ var GateOutcomeSchema = z2.enum([
5978
6037
  var gateShared = {
5979
6038
  meta: HeaderMetaSchema,
5980
6039
  subject: SubjectSchema,
5981
- kind: z2.literal("gate"),
6040
+ kind: z3.literal("gate"),
5982
6041
  ...envelopeTail,
5983
- check: z2.string(),
5984
- check_version: z2.string().nullable(),
5985
- policy_version: z2.string().nullable(),
5986
- input_fingerprint: z2.string().nullable()
6042
+ check: z3.string(),
6043
+ check_version: z3.string().nullable(),
6044
+ policy_version: z3.string().nullable(),
6045
+ input_fingerprint: z3.string().nullable()
5987
6046
  };
5988
- var GateEventSchema = z2.discriminatedUnion("event", [
5989
- z2.object({
6047
+ var GateEventSchema = z3.discriminatedUnion("event", [
6048
+ z3.object({
5990
6049
  ...gateShared,
5991
- event: z2.literal("checked"),
6050
+ event: z3.literal("checked"),
5992
6051
  outcome: GateOutcomeSchema,
5993
- reason: z2.string().optional()
6052
+ reason: z3.string().optional()
6053
+ }).strict(),
6054
+ z3.object({
6055
+ meta: HeaderMetaSchema,
6056
+ subject: SubjectSchema,
6057
+ kind: z3.literal("gate"),
6058
+ ...envelopeTail,
6059
+ event: z3.literal("summary"),
6060
+ ran: z3.number().int().nonnegative(),
6061
+ passed: z3.number().int().nonnegative(),
6062
+ failed: z3.number().int().nonnegative(),
6063
+ skipped: z3.number().int().nonnegative(),
6064
+ failed_checks: z3.array(z3.string())
5994
6065
  }).strict()
5995
6066
  ]);
5996
- var OperationResultSchema = z2.enum(["ok", "error", "refused", "timeout", "cancelled", "unavailable"]);
6067
+ var OperationResultSchema = z3.enum(["ok", "error", "refused", "timeout", "cancelled", "unavailable"]);
5997
6068
  var operationShared = {
5998
6069
  meta: HeaderMetaSchema,
5999
6070
  subject: SubjectSchema,
6000
- kind: z2.literal("operation"),
6071
+ kind: z3.literal("operation"),
6001
6072
  ...envelopeTail,
6002
- operation: z2.string(),
6003
- target: z2.string().nullable()
6073
+ operation: z3.string(),
6074
+ target: z3.string().nullable()
6004
6075
  };
6005
- var OperationEventSchema = z2.discriminatedUnion("event", [
6006
- z2.object({
6076
+ var OperationEventSchema = z3.discriminatedUnion("event", [
6077
+ z3.object({
6007
6078
  ...operationShared,
6008
- event: z2.literal("completed"),
6079
+ event: z3.literal("completed"),
6009
6080
  result: OperationResultSchema,
6010
- error_class: z2.string().nullable()
6081
+ error_class: z3.string().nullable(),
6082
+ field_names: z3.array(z3.string().max(CUSTOM_FIELD_NAME_MAX_LENGTH)).max(CUSTOM_EVENT_MAX_FIELDS).optional()
6011
6083
  }).strict()
6012
6084
  ]);
6013
- var UsageUnitsSchema = z2.object({
6014
- input: z2.number().nonnegative().nullable(),
6015
- output: z2.number().nonnegative().nullable(),
6016
- cache: z2.number().nonnegative().nullable()
6085
+ var UsageUnitsSchema = z3.object({
6086
+ input: z3.number().nonnegative().nullable(),
6087
+ output: z3.number().nonnegative().nullable(),
6088
+ cache: z3.number().nonnegative().nullable()
6017
6089
  }).strict();
6018
6090
  var usageShared = {
6019
6091
  meta: HeaderMetaSchema,
6020
6092
  subject: SubjectSchema,
6021
- kind: z2.literal("usage"),
6093
+ kind: z3.literal("usage"),
6022
6094
  ...envelopeTail,
6023
- model: z2.string().nullable(),
6024
- source: z2.string(),
6025
- semantics: z2.enum(["cumulative", "delta"])
6095
+ model: z3.string().nullable(),
6096
+ source: z3.string(),
6097
+ semantics: z3.enum(["cumulative", "delta"])
6026
6098
  };
6027
- var UsageEventSchema = z2.discriminatedUnion("event", [
6028
- z2.object({
6099
+ var UsageEventSchema = z3.discriminatedUnion("event", [
6100
+ z3.object({
6029
6101
  ...usageShared,
6030
- event: z2.literal("observed"),
6102
+ event: z3.literal("observed"),
6031
6103
  units: UsageUnitsSchema,
6032
- unknown_reason: z2.string().nullable()
6104
+ unknown_reason: z3.string().nullable()
6033
6105
  }).strict()
6034
6106
  ]);
6035
- var RoleAttemptOutcomeSchema = z2.enum([
6107
+ var RoleAttemptOutcomeSchema = z3.enum([
6036
6108
  "completed",
6037
6109
  "incomplete",
6038
6110
  "infrastructure_failed",
@@ -6043,17 +6115,17 @@ var RoleAttemptOutcomeSchema = z2.enum([
6043
6115
  var roleAttemptShared = {
6044
6116
  meta: HeaderMetaSchema,
6045
6117
  subject: SubjectSchema,
6046
- kind: z2.literal("role_attempt"),
6118
+ kind: z3.literal("role_attempt"),
6047
6119
  ...envelopeTail,
6048
- actor: z2.string().nullable(),
6049
- attempt: z2.number().int().nullable(),
6050
- effect_id: z2.string(),
6051
- model: z2.string().nullable()
6120
+ actor: z3.string().nullable(),
6121
+ attempt: z3.number().int().nullable(),
6122
+ effect_id: z3.string(),
6123
+ model: z3.string().nullable()
6052
6124
  };
6053
- var RoleAttemptEventSchema = z2.discriminatedUnion("event", [
6054
- z2.object({
6125
+ var RoleAttemptEventSchema = z3.discriminatedUnion("event", [
6126
+ z3.object({
6055
6127
  ...roleAttemptShared,
6056
- event: z2.literal("attempted"),
6128
+ event: z3.literal("attempted"),
6057
6129
  outcome: RoleAttemptOutcomeSchema,
6058
6130
  usage: dispatchUsageField
6059
6131
  }).strict()
@@ -6061,42 +6133,59 @@ var RoleAttemptEventSchema = z2.discriminatedUnion("event", [
6061
6133
  var handoffShared = {
6062
6134
  meta: HeaderMetaSchema,
6063
6135
  subject: SubjectSchema,
6064
- kind: z2.literal("handoff"),
6136
+ kind: z3.literal("handoff"),
6065
6137
  ...envelopeTail,
6066
- class: z2.enum(["authority", "strategy", "product"]),
6067
- reason: z2.string()
6138
+ class: z3.enum(["authority", "strategy", "product"]),
6139
+ reason: z3.string()
6068
6140
  };
6069
- var HandoffEventSchema = z2.discriminatedUnion("event", [
6070
- z2.object({
6141
+ var HandoffEventSchema = z3.discriminatedUnion("event", [
6142
+ z3.object({
6071
6143
  ...handoffShared,
6072
- event: z2.literal("raised"),
6073
- requested_decision: z2.string().nullable()
6144
+ event: z3.literal("raised"),
6145
+ requested_decision: z3.string().nullable()
6074
6146
  }).strict(),
6075
- z2.object({
6147
+ z3.object({
6076
6148
  ...handoffShared,
6077
- event: z2.literal("resolved"),
6078
- resolution: z2.string().nullable(),
6079
- resolved_by: z2.string().nullable()
6149
+ event: z3.literal("resolved"),
6150
+ resolution: z3.string().nullable(),
6151
+ resolved_by: z3.string().nullable()
6080
6152
  }).strict()
6081
6153
  ]);
6082
- var EffectTargetSchema = z2.object({
6083
- kind: z2.string(),
6084
- ref: z2.string()
6154
+ var EffectTargetSchema = z3.object({
6155
+ kind: z3.string(),
6156
+ ref: z3.string()
6085
6157
  }).strict();
6086
6158
  var effectShared = {
6087
6159
  meta: HeaderMetaSchema,
6088
6160
  subject: SubjectSchema,
6089
- kind: z2.literal("effect"),
6161
+ kind: z3.literal("effect"),
6090
6162
  ...envelopeTail,
6091
- effect_id: z2.string(),
6163
+ effect_id: z3.string(),
6092
6164
  target: EffectTargetSchema
6093
6165
  };
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()
6166
+ var EffectEventSchema = z3.discriminatedUnion("event", [
6167
+ z3.object({ ...effectShared, event: z3.literal("attempted") }).strict(),
6168
+ z3.object({ ...effectShared, event: z3.literal("observed"), outcome: z3.enum(["success", "failure", "uncertain"]) }).strict(),
6169
+ z3.object({ ...effectShared, event: z3.literal("verified"), outcome: z3.enum(["success", "failure", "uncertain"]) }).strict()
6098
6170
  ]);
6099
- var LogEventSchema = z2.union([
6171
+ var CustomFieldValueSchema = z3.union([z3.string().max(CUSTOM_TEXT_MAX_LENGTH), z3.number().finite(), z3.boolean()]);
6172
+ var customShared = {
6173
+ meta: HeaderMetaV3Schema,
6174
+ subject: SubjectSchema,
6175
+ kind: z3.literal("custom"),
6176
+ ...envelopeTail
6177
+ };
6178
+ var CustomEventSchema = z3.discriminatedUnion("event", [
6179
+ z3.object({
6180
+ ...customShared,
6181
+ event: z3.literal("recorded"),
6182
+ name: z3.string().max(CUSTOM_EVENT_NAME_MAX_LENGTH).regex(CUSTOM_EVENT_NAME_PATTERN),
6183
+ 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, {
6184
+ message: `custom: at most ${CUSTOM_EVENT_MAX_FIELDS} fields`
6185
+ })
6186
+ }).strict()
6187
+ ]);
6188
+ var LogEventSchema = z3.union([
6100
6189
  DispatchEventSchema,
6101
6190
  DevReviewLoopEventSchema,
6102
6191
  ForgeWriteEventSchema,
@@ -6105,10 +6194,11 @@ var LogEventSchema = z2.union([
6105
6194
  UsageEventSchema,
6106
6195
  RoleAttemptEventSchema,
6107
6196
  HandoffEventSchema,
6108
- EffectEventSchema
6197
+ EffectEventSchema,
6198
+ CustomEventSchema
6109
6199
  ]);
6110
-
6111
6200
  // ../../packages/aeg-core/src/log/envelope.ts
6201
+ import { createHash as createHash5 } from "node:crypto";
6112
6202
  function isRole(value) {
6113
6203
  return value !== undefined && ROLE_VALUES.includes(value);
6114
6204
  }
@@ -6145,18 +6235,27 @@ function roundFromEnv(round) {
6145
6235
  const n = Number(round);
6146
6236
  return Number.isInteger(n) ? n : undefined;
6147
6237
  }
6238
+ function prFromEnv(pr) {
6239
+ if (pr === undefined || pr === "")
6240
+ return;
6241
+ const n = Number(pr);
6242
+ return Number.isInteger(n) && n > 0 ? n : undefined;
6243
+ }
6148
6244
  function buildHeader(input) {
6149
6245
  const role = isRole(input.env.role) ? input.env.role : "unattributed";
6150
6246
  const round = roundFromEnv(input.env.round);
6247
+ const pr = prFromEnv(input.env.pr);
6151
6248
  const subject = {
6152
6249
  issue: issueFromTask(input.env.task) ?? input.branchIssue ?? null,
6153
6250
  role,
6154
6251
  ...round !== undefined ? { round } : {},
6252
+ ...pr !== undefined ? { pr } : {},
6155
6253
  ...input.subject ?? {}
6156
6254
  };
6255
+ const issue = subject.issue;
6157
6256
  return {
6158
6257
  meta: {
6159
- schema: 2,
6258
+ schema: 3,
6160
6259
  ts: input.now.toISOString(),
6161
6260
  run_id: input.runId,
6162
6261
  seq: input.seq,
@@ -6179,7 +6278,19 @@ function buildHeader(input) {
6179
6278
  ruling_ordinal: input.inputVersions?.rulingOrdinal ?? null,
6180
6279
  policy_digest: input.inputVersions?.policyDigest ?? null
6181
6280
  },
6182
- provenance: provenanceFor(input)
6281
+ provenance: provenanceFor(input),
6282
+ work: {
6283
+ ref: lineageFieldFromEnv(input.env.workRef) ?? (issue === null ? null : String(issue)),
6284
+ repo: input.repo,
6285
+ change: null,
6286
+ revision: null
6287
+ },
6288
+ flow: {
6289
+ id: lineageFieldFromEnv(input.env.flow) ?? "vinaya",
6290
+ version: lineageFieldFromEnv(input.env.flowVersion)
6291
+ },
6292
+ runtime: lineageFieldFromEnv(input.env.runtime),
6293
+ source: lineageFieldFromEnv(input.env.source)
6183
6294
  },
6184
6295
  subject
6185
6296
  };
@@ -6222,7 +6333,7 @@ function redact(value, home) {
6222
6333
  return value;
6223
6334
  }
6224
6335
  // ../../packages/aeg-core/src/log/store.ts
6225
- var KNOWN_SCHEMA_VERSIONS = [1, 2];
6336
+ var KNOWN_SCHEMA_VERSIONS = [1, 2, 3];
6226
6337
  function metaOf(obj) {
6227
6338
  if (obj === null || typeof obj !== "object")
6228
6339
  return null;
@@ -6288,7 +6399,7 @@ function classifyStoredLine(raw, home) {
6288
6399
  return { status: "invalid", identity: null, raw, reason: "valid event with no derivable identity" };
6289
6400
  }
6290
6401
  const redacted = redact(event, home);
6291
- const provenance = version === 2 ? event.meta.provenance ?? null : null;
6402
+ const provenance = version >= 2 ? event.meta.provenance ?? null : null;
6292
6403
  return {
6293
6404
  status: "ok",
6294
6405
  identity,
@@ -6301,138 +6412,143 @@ function classifyStoredLine(raw, home) {
6301
6412
  };
6302
6413
  }
6303
6414
  // ../../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"),
6415
+ import { z as z4 } from "zod";
6416
+ var isoTimestamp = z4.string().min(1);
6417
+ var taskId = z4.number().int().positive();
6418
+ var epochNumber = z4.number().int().nonnegative();
6419
+ var RunRecordSchema = z4.object({
6420
+ version: z4.literal(1),
6421
+ kind: z4.literal("run"),
6311
6422
  task: taskId,
6312
- runId: z3.string().min(1),
6313
- pid: z3.number().int().positive(),
6314
- host: z3.string().min(1),
6423
+ runId: z4.string().min(1),
6424
+ pid: z4.number().int().positive(),
6425
+ host: z4.string().min(1),
6315
6426
  startedAt: isoTimestamp,
6316
- childStartedAt: z3.string().min(1).nullable().optional(),
6317
- childCommand: z3.string().min(1).nullable().optional()
6427
+ childStartedAt: z4.string().min(1).nullable().optional(),
6428
+ childCommand: z4.string().min(1).nullable().optional()
6318
6429
  }).strict();
6319
- var InputRecordSchema = z3.object({
6320
- version: z3.literal(1),
6321
- kind: z3.literal("input"),
6430
+ var InputRecordSchema = z4.object({
6431
+ version: z4.literal(1),
6432
+ kind: z4.literal("input"),
6322
6433
  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(),
6434
+ runId: z4.string().min(1),
6435
+ source: z4.union([z4.literal("fresh"), z4.literal("resume")]),
6436
+ pr: z4.number().int().positive().nullable(),
6437
+ round: z4.number().int().nonnegative(),
6327
6438
  recordedAt: isoTimestamp
6328
6439
  }).strict();
6329
- var OwnershipRecordSchema = z3.object({
6330
- version: z3.literal(1),
6331
- kind: z3.literal("ownership"),
6440
+ var OwnershipRecordSchema = z4.object({
6441
+ version: z4.literal(1),
6442
+ kind: z4.literal("ownership"),
6332
6443
  task: taskId,
6333
6444
  epoch: epochNumber,
6334
- ownerId: z3.string().min(1),
6335
- pid: z3.number().int().positive(),
6336
- host: z3.string().min(1),
6445
+ ownerId: z4.string().min(1),
6446
+ pid: z4.number().int().positive(),
6447
+ host: z4.string().min(1),
6337
6448
  acquiredAt: isoTimestamp
6338
6449
  }).strict();
6339
- var TransitionRecordSchema = z3.object({
6340
- version: z3.literal(1),
6341
- kind: z3.literal("transition"),
6450
+ var TransitionRecordSchema = z4.object({
6451
+ version: z4.literal(1),
6452
+ kind: z4.literal("transition"),
6342
6453
  task: taskId,
6343
6454
  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(),
6455
+ seq: z4.number().int().nonnegative(),
6456
+ from: z4.string().min(1),
6457
+ to: z4.string().min(1),
6458
+ detail: z4.string().optional(),
6348
6459
  at: isoTimestamp
6349
6460
  }).strict();
6350
- var ManifestRecordSchema = z3.object({
6351
- version: z3.literal(1),
6352
- kind: z3.literal("manifest"),
6461
+ var ManifestRecordSchema = z4.object({
6462
+ version: z4.literal(1),
6463
+ kind: z4.literal("manifest"),
6353
6464
  task: taskId,
6354
6465
  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(),
6466
+ repository: z4.string().min(1),
6467
+ pr: z4.number().int().positive(),
6468
+ branch: z4.string().min(1),
6469
+ baseSha: z4.string().min(1).nullable(),
6470
+ headSha: z4.string().min(1),
6471
+ briefHash: z4.string().min(1).nullable(),
6472
+ objectivesVersion: z4.string().min(1).nullable(),
6362
6473
  rulingOrdinal: epochNumber,
6363
- policyDigest: z3.string().min(1),
6474
+ policyDigest: z4.string().min(1),
6364
6475
  recordedAt: isoTimestamp
6365
6476
  }).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()
6477
+ var roundHeadIdentity = z4.object({ round: z4.number().int().positive(), head: z4.string().min(1) }).strict();
6478
+ var LoopBudgetsSchema = z4.object({
6479
+ mechanicalRetries: z4.number().int().nonnegative(),
6480
+ reviewRounds: z4.number().int().nonnegative(),
6481
+ infrastructureRetries: z4.number().int().nonnegative()
6371
6482
  }).strict();
6372
- var LoopStateRecordSchema = z3.object({
6373
- version: z3.literal(1),
6374
- kind: z3.literal("loop_state"),
6483
+ var LoopStateRecordSchema = z4.object({
6484
+ version: z4.literal(1),
6485
+ kind: z4.literal("loop_state"),
6375
6486
  task: taskId,
6376
- round: z3.number().int().positive(),
6377
- phase: z3.string().min(1),
6378
- pauseReason: z3.string().min(1).nullable(),
6487
+ round: z4.number().int().positive(),
6488
+ phase: z4.string().min(1),
6489
+ pauseReason: z4.string().min(1).nullable(),
6379
6490
  budgets: LoopBudgetsSchema,
6380
6491
  heldResult: roundHeadIdentity.nullable(),
6381
6492
  deliveredFindings: roundHeadIdentity.nullable(),
6382
- repeatMemory: z3.object({
6383
- blockingFindings: z3.array(z3.string()),
6384
- lastFailure: z3.object({ signature: z3.string(), message: z3.string() }).nullable()
6493
+ repeatMemory: z4.object({
6494
+ blockingFindings: z4.array(z4.string()),
6495
+ lastFailure: z4.object({ signature: z4.string(), message: z4.string() }).nullable()
6385
6496
  }).strict().optional(),
6497
+ publicationExpectedBase: z4.string().regex(/^[0-9a-f]{40}$/).nullable().optional(),
6498
+ taskStartedAt: isoTimestamp.optional(),
6499
+ phaseMs: z4.record(z4.string(), z4.number().nonnegative()).optional(),
6386
6500
  recordedAt: isoTimestamp
6387
6501
  }).strict();
6388
- var EffectRecordSchema = z3.object({
6389
- version: z3.literal(1),
6390
- kind: z3.literal("effect"),
6502
+ var EffectRecordSchema = z4.object({
6503
+ version: z4.literal(1),
6504
+ kind: z4.literal("effect"),
6391
6505
  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(),
6506
+ key: z4.string().min(1),
6507
+ operation: z4.string().min(1),
6508
+ target: z4.string().min(1),
6509
+ inputVersion: z4.number().int().nonnegative(),
6510
+ payloadDigest: z4.string().min(1),
6511
+ status: z4.union([z4.literal("started"), z4.literal("verified"), z4.literal("uncertain")]),
6512
+ url: z4.string().optional(),
6399
6513
  recordedAt: isoTimestamp
6400
6514
  }).strict();
6401
- var EscalationRecordSchema = z3.object({
6402
- version: z3.literal(1),
6403
- kind: z3.literal("escalation"),
6515
+ var EscalationRecordSchema = z4.object({
6516
+ version: z4.literal(1),
6517
+ kind: z4.literal("escalation"),
6404
6518
  task: taskId,
6405
- escalationId: z3.string().min(1),
6519
+ escalationId: z4.string().min(1),
6406
6520
  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(),
6521
+ head: z4.string().min(1),
6522
+ branch: z4.string().min(1),
6523
+ pr: z4.number().int().positive().nullable(),
6524
+ runId: z4.string().min(1),
6525
+ pid: z4.number().int().positive(),
6526
+ host: z4.string().min(1),
6527
+ agent: z4.string().min(1).optional(),
6528
+ reason: z4.string().min(1),
6529
+ detail: z4.string().optional(),
6530
+ evidence: z4.string().optional(),
6531
+ attemptedRecovery: z4.string().min(1),
6532
+ requestedDecision: z4.string().min(1),
6533
+ recipient: z4.string().min(1),
6534
+ briefHash: z4.string().min(1).nullable(),
6535
+ objectivesVersion: z4.string().min(1).nullable(),
6422
6536
  rulingOrdinal: epochNumber,
6423
- policyDigest: z3.string().min(1),
6537
+ policyDigest: z4.string().min(1),
6424
6538
  recordedAt: isoTimestamp
6425
6539
  }).strict();
6426
- var ResolutionRecordSchema = z3.object({
6427
- version: z3.literal(1),
6428
- kind: z3.literal("resolution"),
6540
+ var ResolutionRecordSchema = z4.object({
6541
+ version: z4.literal(1),
6542
+ kind: z4.literal("resolution"),
6429
6543
  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),
6544
+ escalationId: z4.string().min(1),
6545
+ decision: z4.union([z4.literal("resume"), z4.literal("cancel")]),
6546
+ authenticatedBy: z4.string().min(1),
6547
+ authenticatedFrom: z4.string().min(1),
6434
6548
  consumedAt: isoTimestamp
6435
6549
  }).strict();
6550
+ // ../../packages/aeg-core/src/control-store/local.ts
6551
+ var CONTROL_AREA_DIRNAME = "control";
6436
6552
  // src/checks/contract.ts
6437
6553
  var CHECK_SCHEMA_VERSION = 1;
6438
6554
  function emitCheckError(error) {
@@ -6441,59 +6557,37 @@ function emitCheckError(error) {
6441
6557
  }
6442
6558
 
6443
6559
  // src/lib/review-gate-input.ts
6444
- import { execFileSync as execFileSync5 } from "node:child_process";
6560
+ import { execFileSync as execFileSync4 } from "node:child_process";
6445
6561
 
6446
6562
  // src/lib/config.ts
6447
- import { execFile as execFile4, execFileSync as execFileSync3 } from "node:child_process";
6563
+ import { execFile as execFile4, execFileSync as execFileSync2 } from "node:child_process";
6448
6564
  import { promisify as promisify4 } from "node:util";
6449
6565
  import { existsSync, mkdirSync, readFileSync as readFileSync2, realpathSync, writeFileSync } from "node:fs";
6450
6566
  import { homedir } from "node:os";
6451
6567
  import { dirname, isAbsolute, join, resolve } from "node:path";
6452
- import { z as z4 } from "zod";
6568
+ import { z as z5 } from "zod";
6453
6569
 
6454
6570
  // src/lib/agent-vendors.ts
6455
6571
  var AGENT_VENDORS = ["skills", "claude", "gemini"];
6456
6572
 
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
6573
  // 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()
6574
+ var EnvEntrySchema = z5.union([
6575
+ z5.literal(true),
6576
+ z5.object({ optional: z5.literal(true) }),
6577
+ z5.object({ anyOf: z5.array(z5.string()).min(2) }),
6578
+ z5.string()
6485
6579
  ]);
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()
6580
+ var CheckEntrySchema = z5.object({
6581
+ run: z5.string(),
6582
+ scope: z5.enum(["diff", "full"]),
6583
+ include: z5.array(z5.string()).optional(),
6584
+ args: z5.array(z5.string()).optional(),
6585
+ timeoutMs: z5.number().optional(),
6586
+ env: z5.record(z5.string(), EnvEntrySchema).optional(),
6587
+ requiresOpenPr: z5.boolean().optional(),
6588
+ ownWorkflow: z5.boolean().optional(),
6589
+ principalOwed: z5.literal(true).optional(),
6590
+ validates: z5.enum(["body", "issue"]).optional()
6497
6591
  }).superRefine((entry, ctx) => {
6498
6592
  if (!entry.env)
6499
6593
  return;
@@ -6503,22 +6597,22 @@ var CheckEntrySchema = z4.object({
6503
6597
  const members = value.anyOf;
6504
6598
  if (new Set(members).size !== members.length) {
6505
6599
  ctx.addIssue({
6506
- code: z4.ZodIssueCode.custom,
6600
+ code: z5.ZodIssueCode.custom,
6507
6601
  message: `env.${key}.anyOf has duplicate members`,
6508
6602
  path: ["env", key, "anyOf"]
6509
6603
  });
6510
6604
  }
6511
6605
  if (!members.includes(key)) {
6512
6606
  ctx.addIssue({
6513
- code: z4.ZodIssueCode.custom,
6607
+ code: z5.ZodIssueCode.custom,
6514
6608
  message: `env.${key}.anyOf must include "${key}" itself as a member`,
6515
6609
  path: ["env", key, "anyOf"]
6516
6610
  });
6517
6611
  }
6518
6612
  }
6519
6613
  });
6520
- var RoleEntrySchema = z4.object({
6521
- contract: z4.string().refine((p) => p.includes("/"), {
6614
+ var RoleEntrySchema = z5.object({
6615
+ contract: z5.string().refine((p) => p.includes("/"), {
6522
6616
  message: 'must be a path (contain at least one "/"), not a bare filename'
6523
6617
  })
6524
6618
  });
@@ -6542,17 +6636,17 @@ var BRIEF_BUILTINS = [
6542
6636
  "briefSections",
6543
6637
  "milestoneShape"
6544
6638
  ];
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() })
6639
+ var BriefSectionSchema = z5.union([
6640
+ z5.object({ builtin: z5.enum(BRIEF_BUILTINS) }),
6641
+ z5.object({ heading: z5.string().min(1), name: z5.string().optional() }),
6642
+ z5.object({ field: z5.string().min(1), name: z5.string().optional() }),
6643
+ z5.object({ phrase: z5.string().min(1), name: z5.string().optional() })
6550
6644
  ]);
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()
6645
+ var BriefSchemaSchema = z5.object({
6646
+ pr: z5.object({ sections: z5.array(BriefSectionSchema) }).optional(),
6647
+ issue: z5.object({ sections: z5.array(BriefSectionSchema) }).optional(),
6648
+ milestone: z5.object({ sections: z5.array(BriefSectionSchema) }).optional(),
6649
+ ack: z5.array(z5.enum(BRIEF_BUILTINS)).optional()
6556
6650
  });
6557
6651
  function isSafeRepoRelPath(p) {
6558
6652
  if (p.length === 0)
@@ -6561,7 +6655,7 @@ function isSafeRepoRelPath(p) {
6561
6655
  return false;
6562
6656
  return p.split(/[\\/]/).every((seg) => seg !== ".." && seg !== "");
6563
6657
  }
6564
- var SafeRepoRelPath = z4.string().refine(isSafeRepoRelPath, {
6658
+ var SafeRepoRelPath = z5.string().refine(isSafeRepoRelPath, {
6565
6659
  message: "must be a repo-root-relative path with no `..` segment or absolute root"
6566
6660
  });
6567
6661
  var CANONICAL_HOOK_BLOCK_PREFIXES = [".git/", ".husky/", ".vinaya/hooks/", ".claude/hooks/"];
@@ -6571,22 +6665,22 @@ function isCanonicalHookBlockPath(p) {
6571
6665
  var ManagedHookBlockPath = SafeRepoRelPath.refine(isCanonicalHookBlockPath, {
6572
6666
  message: `must start with one of ${CANONICAL_HOOK_BLOCK_PREFIXES.join(", ")} (byte-exact, case-sensitive)`
6573
6667
  });
6574
- var ManagedBlockRecordSchema = z4.object({
6668
+ var ManagedBlockRecordSchema = z5.object({
6575
6669
  path: ManagedHookBlockPath,
6576
- marker: z4.string(),
6577
- comment: z4.enum(["hash", "html"])
6670
+ marker: z5.string(),
6671
+ comment: z5.enum(["hash", "html"])
6578
6672
  });
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()
6673
+ var ManagedManifestSchema = z5.object({
6674
+ version: z5.number().int().positive(),
6675
+ files: z5.array(SafeRepoRelPath),
6676
+ blocks: z5.array(ManagedBlockRecordSchema),
6677
+ labels: z5.array(z5.string()),
6678
+ agents: z5.array(z5.enum(AGENT_VENDORS)).optional()
6585
6679
  });
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()
6680
+ var ProjectEntrySchema = z5.object({
6681
+ name: z5.string().min(1),
6682
+ description: z5.string().min(1).optional(),
6683
+ path: z5.string().min(1).optional()
6590
6684
  });
6591
6685
  function parseTokensCollectDeclaration(value) {
6592
6686
  const m = value.trim().match(/^(\S+)\s+(\S+)$/);
@@ -6597,90 +6691,97 @@ function parseTokensCollectDeclaration(value) {
6597
6691
  return null;
6598
6692
  return { interpreter, script };
6599
6693
  }
6600
- var VinayaConfigSchema = z4.object({
6601
- rings: z4.object({
6602
- ring1_forgeWriteInterception: z4.boolean(),
6603
- ring2_asyncAudits: z4.boolean()
6694
+ var VinayaConfigSchema = z5.object({
6695
+ rings: z5.object({
6696
+ ring1_forgeWriteInterception: z5.boolean(),
6697
+ ring2_asyncAudits: z5.boolean()
6604
6698
  }).optional(),
6605
- checks: z4.record(z4.string(), CheckEntrySchema).optional(),
6606
- roles: z4.record(z4.string(), RoleEntrySchema).optional(),
6699
+ checks: z5.record(z5.string(), CheckEntrySchema).optional(),
6700
+ roles: z5.record(z5.string(), RoleEntrySchema).optional(),
6607
6701
  briefSchema: BriefSchemaSchema.optional(),
6608
6702
  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, {
6703
+ principals: z5.array(z5.string()).min(1).optional(),
6704
+ releaseActor: z5.string().min(1).optional(),
6705
+ ci: z5.object({ setup: z5.string().min(1) }).optional(),
6706
+ tokens: z5.object({
6707
+ collect: z5.string().min(1).refine((v) => parseTokensCollectDeclaration(v) !== null, {
6614
6708
  message: 'tokens.collect must be exactly "<interpreter> <repo-relative-script-path>" — two whitespace-separated tokens, no flags, no shell syntax, no quoting'
6615
6709
  })
6616
6710
  }).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()
6711
+ blastRadius: z5.object({ extraDomains: z5.array(z5.string()).optional() }).optional(),
6712
+ proseGates: z5.object({
6713
+ doctrineRoot: z5.string().min(1).optional(),
6714
+ readerFacingPrefix: z5.string().min(1).optional(),
6715
+ readerFacingSuffix: z5.string().min(1).optional(),
6716
+ legacySlugDir: z5.string().min(1).optional(),
6717
+ sourceComments: z5.object({
6718
+ globs: z5.array(z5.string().min(1)).optional(),
6719
+ allowlist: z5.array(z5.string().min(1)).optional(),
6720
+ severity: z5.enum(["warning", "error"]).optional()
6627
6721
  }).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), {
6722
+ specGrandfather: z5.union([z5.array(z5.string().min(1)), z5.record(z5.string().min(1), z5.number().int().min(0))]).optional(),
6723
+ specPaths: z5.array(z5.string().min(1).refine((entry) => !entry.startsWith("/") && !/^[A-Za-z]:/.test(entry), {
6630
6724
  message: "must be a repository-relative path, not an absolute one"
6631
6725
  }).refine((entry) => !entry.split(/[\\/]/).includes(".."), {
6632
6726
  message: "must stay inside the repository — no `..` segment"
6633
6727
  })).optional()
6634
6728
  }).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()
6729
+ projects: z5.array(ProjectEntrySchema).optional(),
6730
+ dispatch: z5.object({
6731
+ timeoutMs: z5.number().int().positive().optional(),
6732
+ killGraceMs: z5.number().int().positive().optional(),
6733
+ agent: z5.enum(["claude", "codex", "gemini"]).optional()
6641
6734
  }).optional(),
6642
- reviewPolicy: z4.object({
6643
- codeReviewThreshold: z4.string().min(1).optional(),
6644
- securityThreshold: z4.string().min(1).optional(),
6645
- maxRounds: z4.number().optional()
6735
+ reviewPolicy: z5.object({
6736
+ codeReviewThreshold: z5.string().min(1).optional(),
6737
+ securityThreshold: z5.string().min(1).optional(),
6738
+ maxRounds: z5.number().optional(),
6739
+ maxTaskMinutes: z5.number().optional()
6646
6740
  }).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()
6741
+ securityScan: z5.object({
6742
+ command: z5.array(z5.string().min(1)).min(1)
6653
6743
  }).optional(),
6654
- planning: z4.object({
6655
- collisionThreshold: z4.number().int().nonnegative().optional()
6744
+ gateCutovers: z5.object({
6745
+ objectivesSinceIssue: z5.number().int().nonnegative().optional(),
6746
+ briefSectionsSinceIssue: z5.number().int().nonnegative().optional(),
6747
+ documentationSinceIssue: z5.number().int().nonnegative().optional(),
6748
+ briefRulesSincePr: z5.number().int().nonnegative().optional(),
6749
+ agentBoxesRefusedSincePr: z5.number().int().nonnegative().optional()
6656
6750
  }).optional(),
6657
- prePush: z4.object({
6658
- alwaysRun: z4.array(z4.string()).optional()
6751
+ planning: z5.object({
6752
+ collisionThreshold: z5.number().int().nonnegative().optional()
6659
6753
  }).optional(),
6660
- report: z4.object({
6661
- commandTimeoutMs: z4.number().int().positive().optional()
6754
+ prePush: z5.object({
6755
+ alwaysRun: z5.array(z5.string()).optional()
6756
+ }).optional(),
6757
+ report: z5.object({
6758
+ commandTimeoutMs: z5.number().int().positive().optional()
6662
6759
  }).superRefine((report, ctx) => {
6663
6760
  const commandTimeoutMs = report.commandTimeoutMs;
6664
6761
  if (commandTimeoutMs !== undefined && commandTimeoutMs > MAX_REPORT_COMMAND_TIMEOUT_MS) {
6665
6762
  ctx.addIssue({
6666
- code: z4.ZodIssueCode.custom,
6763
+ code: z5.ZodIssueCode.custom,
6667
6764
  path: ["commandTimeoutMs"],
6668
6765
  message: "must be at most 3600000 (1 hour)"
6669
6766
  });
6670
6767
  }
6671
6768
  }).optional(),
6672
- logPublish: z4.unknown().refine((v) => v === undefined, {
6769
+ logPublish: z5.unknown().refine((v) => v === undefined, {
6673
6770
  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
6771
  }),
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()
6772
+ runtimeDir: z5.string().min(1).refine((v) => isAbsolute(v), { message: "runtimeDir: must be an absolute path" }).optional(),
6773
+ logs: z5.object({
6774
+ folder: z5.string().min(1).refine((v) => isAbsolute(v), { message: "logs.folder: must be an absolute path" }).optional(),
6775
+ url: z5.string().url().optional(),
6776
+ headers: z5.record(z5.string()).optional(),
6777
+ readHeaders: z5.record(z5.string()).optional(),
6778
+ events: CustomEventDeclarationsSchema.optional()
6680
6779
  }).refine((v) => [v.folder, v.url].filter((x) => x !== undefined).length <= 1, {
6681
6780
  message: "logs: set at most one of folder/url"
6682
6781
  }).refine((v) => v.headers === undefined || v.url !== undefined, {
6683
6782
  message: "logs: headers requires url"
6783
+ }).refine((v) => v.readHeaders === undefined || v.url !== undefined, {
6784
+ message: "logs: readHeaders requires url"
6684
6785
  }).optional()
6685
6786
  });
6686
6787
  var GLOBAL_VINAYA_HOME = join(homedir(), ".vinaya");
@@ -6785,10 +6886,15 @@ function resolveReviewPolicy(config) {
6785
6886
  if (!Number.isInteger(maxRounds) || maxRounds < 1) {
6786
6887
  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
6888
  }
6889
+ const maxTaskMinutes = raw.maxTaskMinutes ?? DEFAULT_REVIEW_POLICY.maxTaskMinutes;
6890
+ if (!Number.isInteger(maxTaskMinutes) || maxTaskMinutes < 0) {
6891
+ 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.`);
6892
+ }
6788
6893
  return {
6789
6894
  codeReviewThreshold,
6790
6895
  securityThreshold,
6791
- maxRounds
6896
+ maxRounds,
6897
+ maxTaskMinutes
6792
6898
  };
6793
6899
  }
6794
6900
  function resolveGateCutovers(config) {
@@ -6828,17 +6934,12 @@ function resolveTrustAnchorLogsDestination(local, trustAnchorConfig) {
6828
6934
  return "url" in anchored && anchored.url === local.url ? anchored : null;
6829
6935
  return "folder" in anchored && anchored.folder === local.folder ? anchored : null;
6830
6936
  }
6831
- function resolveLogsHeaderValues(headers, env, readKeychain = readLogHeaderKeychainCredential) {
6937
+ function resolveLogsHeaderValues(headers, env) {
6832
6938
  if (!headers)
6833
6939
  return;
6834
6940
  const resolved = {};
6835
6941
  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
- });
6942
+ resolved[key] = value.replace(/\$\{([A-Za-z_][A-Za-z0-9_]*)\}/g, (_match, name) => env[name] ?? "");
6842
6943
  }
6843
6944
  return resolved;
6844
6945
  }
@@ -6847,7 +6948,7 @@ function trustAnchorRepo() {
6847
6948
  if (fromRunner)
6848
6949
  return fromRunner;
6849
6950
  try {
6850
- const url = execFileSync3("git", ["remote", "get-url", "origin"], {
6951
+ const url = execFileSync2("git", ["remote", "get-url", "origin"], {
6851
6952
  encoding: "utf-8",
6852
6953
  stdio: ["ignore", "pipe", "pipe"]
6853
6954
  });
@@ -6894,7 +6995,7 @@ function resolveCiTrustAnchorProbeRef(env = process.env) {
6894
6995
  return ref;
6895
6996
  }
6896
6997
  function readTrustAnchorConfigAtRef(ref) {
6897
- const raw = execFileSync3("git", ["show", `${ref}:${LOCAL_CONFIG_FILENAME}`], {
6998
+ const raw = execFileSync2("git", ["show", `${ref}:${LOCAL_CONFIG_FILENAME}`], {
6898
6999
  encoding: "utf-8",
6899
7000
  stdio: ["ignore", "pipe", "pipe"],
6900
7001
  timeout: 1e4
@@ -6908,7 +7009,7 @@ function ghFetchTrustAnchorConfig() {
6908
7009
  const repo = trustAnchorRepo();
6909
7010
  if (!repo)
6910
7011
  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"], {
7012
+ return execFileSync2("gh", ["api", `repos/${repo}/contents/${LOCAL_CONFIG_FILENAME}`, "--jq", ".content"], {
6912
7013
  encoding: "utf-8",
6913
7014
  stdio: ["ignore", "pipe", "pipe"]
6914
7015
  });
@@ -6999,20 +7100,20 @@ function loadConfig() {
6999
7100
  var TOKENS_COLLECT_TRUST_PATH = join(GLOBAL_VINAYA_HOME, "tokens-collect-trust.json");
7000
7101
 
7001
7102
  // src/lib/patch-id.ts
7002
- import { execFileSync as execFileSync4 } from "node:child_process";
7103
+ import { execFileSync as execFileSync3 } from "node:child_process";
7003
7104
  function patchIdAt(base, sha) {
7004
7105
  try {
7005
- execFileSync4("git", ["fetch", "--quiet", "origin", sha], { stdio: ["ignore", "ignore", "ignore"] });
7106
+ execFileSync3("git", ["fetch", "--quiet", "origin", sha], { stdio: ["ignore", "ignore", "ignore"] });
7006
7107
  } catch {}
7007
7108
  try {
7008
- const diff = execFileSync4("git", ["diff", `origin/${base}...${sha}`], {
7109
+ const diff = execFileSync3("git", ["diff", `origin/${base}...${sha}`], {
7009
7110
  encoding: "utf8",
7010
7111
  maxBuffer: 64 * 1024 * 1024,
7011
7112
  stdio: ["ignore", "pipe", "pipe"]
7012
7113
  });
7013
7114
  if (diff === "")
7014
7115
  return null;
7015
- const out = execFileSync4("git", ["patch-id", "--stable"], {
7116
+ const out = execFileSync3("git", ["patch-id", "--stable"], {
7016
7117
  input: diff,
7017
7118
  encoding: "utf8",
7018
7119
  stdio: ["pipe", "pipe", "pipe"]
@@ -7030,7 +7131,7 @@ function failure(message, agentRecoveryPrompt) {
7030
7131
  }
7031
7132
  function fetchPr(prNumber) {
7032
7133
  try {
7033
- const out = execFileSync5("gh", ["pr", "view", String(prNumber), "--json", "number,comments,labels,headRefName,headRefOid,baseRefName,body"], {
7134
+ const out = execFileSync4("gh", ["pr", "view", String(prNumber), "--json", "number,comments,labels,headRefName,headRefOid,baseRefName,body"], {
7034
7135
  encoding: "utf8",
7035
7136
  stdio: ["ignore", "pipe", "pipe"]
7036
7137
  });
@@ -7040,13 +7141,13 @@ function fetchPr(prNumber) {
7040
7141
  }
7041
7142
  }
7042
7143
  function fetchIssueBodyForObjectives(issueNumber) {
7043
- return execFileSync5("gh", ["issue", "view", String(issueNumber), "--json", "body", "--jq", ".body"], {
7144
+ return execFileSync4("gh", ["issue", "view", String(issueNumber), "--json", "body", "--jq", ".body"], {
7044
7145
  encoding: "utf8",
7045
7146
  stdio: ["ignore", "pipe", "pipe"]
7046
7147
  });
7047
7148
  }
7048
7149
  function fetchIssueCommentsForBrief(issueNumber) {
7049
- const out = execFileSync5("gh", ["issue", "view", String(issueNumber), "--json", "comments"], {
7150
+ const out = execFileSync4("gh", ["issue", "view", String(issueNumber), "--json", "comments"], {
7050
7151
  encoding: "utf8",
7051
7152
  stdio: ["ignore", "pipe", "pipe"]
7052
7153
  });
@@ -7098,7 +7199,7 @@ function resolveObjectivesVersion(pr, objectivesSinceIssue) {
7098
7199
  }
7099
7200
  function shaFromLsRemote(branch) {
7100
7201
  try {
7101
- const out = execFileSync5("git", ["ls-remote", "origin", `refs/heads/${branch}`], {
7202
+ const out = execFileSync4("git", ["ls-remote", "origin", `refs/heads/${branch}`], {
7102
7203
  encoding: "utf8",
7103
7204
  stdio: ["ignore", "pipe", "pipe"]
7104
7205
  }).trim();
@@ -7110,7 +7211,7 @@ function shaFromLsRemote(branch) {
7110
7211
  }
7111
7212
  function shaFromGhApi(branch) {
7112
7213
  try {
7113
- const out = execFileSync5("gh", ["api", `repos/{owner}/{repo}/git/ref/heads/${branch}`, "--jq", ".object.sha"], {
7214
+ const out = execFileSync4("gh", ["api", `repos/{owner}/{repo}/git/ref/heads/${branch}`, "--jq", ".object.sha"], {
7114
7215
  encoding: "utf8",
7115
7216
  stdio: ["ignore", "pipe", "pipe"]
7116
7217
  }).trim();
@@ -7132,7 +7233,7 @@ function resolveTrueHeadSha(pr) {
7132
7233
  }
7133
7234
  function fetchWaiverLabelActor(prNumber, label) {
7134
7235
  try {
7135
- const out = execFileSync5("gh", ["api", `repos/{owner}/{repo}/issues/${prNumber}/timeline`, "--paginate"], {
7236
+ const out = execFileSync4("gh", ["api", `repos/{owner}/{repo}/issues/${prNumber}/timeline`, "--paginate"], {
7136
7237
  encoding: "utf8",
7137
7238
  stdio: ["ignore", "pipe", "pipe"]
7138
7239
  });