@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
@@ -1888,45 +1888,6 @@ var DERIVED_STATUSES = [
1888
1888
  "incoherent"
1889
1889
  ];
1890
1890
  var DERIVABLE_STATUSES = DERIVED_STATUSES.filter((s) => s !== "backlog");
1891
- // ../../packages/aeg-core/src/parse-ledger.ts
1892
- function rowFromCells(cells) {
1893
- if (cells.length < 7)
1894
- return null;
1895
- const phase = (cells[0] ?? "").trim();
1896
- if (!phase)
1897
- return null;
1898
- return {
1899
- phase,
1900
- role: (cells[1] ?? "").trim(),
1901
- agentModel: (cells[2] ?? "").trim(),
1902
- tokensIn: parseIntCell(cells[3] ?? ""),
1903
- tokensOut: parseIntCell(cells[4] ?? ""),
1904
- cost: parseCostCell(cells[5] ?? ""),
1905
- date: (cells[6] ?? "").trim()
1906
- };
1907
- }
1908
- function parseIntCell(cell) {
1909
- const trimmed = cell.replace(/`/g, "").trim();
1910
- if (!trimmed || isEmDashOrDash(trimmed))
1911
- return null;
1912
- const normalized = trimmed.replace(/[,_\s]/g, "");
1913
- if (!/^-?\d+$/.test(normalized))
1914
- return null;
1915
- return Number(normalized);
1916
- }
1917
- function parseCostCell(cell) {
1918
- const trimmed = cell.replace(/`/g, "").trim();
1919
- if (!trimmed || isEmDashOrDash(trimmed))
1920
- return null;
1921
- const normalized = trimmed.replace(/^\$/, "").replace(/[,_\s]/g, "");
1922
- if (!/^-?\d+(\.\d+)?$/.test(normalized))
1923
- return null;
1924
- return Number(normalized);
1925
- }
1926
- function isEmDashOrDash(s) {
1927
- const t = s.trim();
1928
- return t === "—" || t === "-" || t === "–";
1929
- }
1930
1891
  // ../../packages/aeg-core/src/waiver-label.ts
1931
1892
  var WAIVER_LABEL = label("waiver-docs");
1932
1893
  var WAIVER_LABEL_REVIEW = label("waiver-review");
@@ -1942,61 +1903,6 @@ function isWaiverLabelActorVerified(opts) {
1942
1903
  return false;
1943
1904
  return isPrincipal(opts.labelActor, opts.principalAllowlist);
1944
1905
  }
1945
-
1946
- // ../../packages/aeg-core/src/parse-token-report.ts
1947
- var TOKEN_REPORT_HEADING = /^\s*(?:#{1,6}\s*Token report\s*|\*\*Token report\*\*)\s*$/i;
1948
- 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;
1949
- function parseTokenReportEntries(body) {
1950
- const lines = body.split(/\r?\n/);
1951
- const headingIdxs = [];
1952
- lines.forEach((line, i) => {
1953
- if (TOKEN_REPORT_HEADING.test(line))
1954
- headingIdxs.push(i);
1955
- });
1956
- const out = [];
1957
- for (let h = 0;h < headingIdxs.length; h++) {
1958
- const start = headingIdxs[h] + 1;
1959
- const end = h + 1 < headingIdxs.length ? headingIdxs[h + 1] : lines.length;
1960
- const section = lines.slice(start, end).join(`
1961
- `);
1962
- const tableRows = parseTableSection(section);
1963
- if (tableRows.length > 0) {
1964
- out.push(...tableRows);
1965
- continue;
1966
- }
1967
- const inlineRow = parseInlineFieldList(section);
1968
- if (inlineRow)
1969
- out.push(inlineRow);
1970
- }
1971
- return out;
1972
- }
1973
- function parseTableSection(section) {
1974
- const lines = section.split(/\r?\n/);
1975
- let i = 0;
1976
- for (;i < lines.length; i++) {
1977
- if ((lines[i] ?? "").trim().startsWith("|"))
1978
- break;
1979
- }
1980
- if (i + 1 >= lines.length)
1981
- return [];
1982
- i += 2;
1983
- const out = [];
1984
- for (;i < lines.length; i++) {
1985
- const trimmed = (lines[i] ?? "").trim();
1986
- if (!trimmed.startsWith("|"))
1987
- break;
1988
- const row = rowFromCells(splitTableRow(trimmed));
1989
- if (row)
1990
- out.push(row);
1991
- }
1992
- return out;
1993
- }
1994
- function parseInlineFieldList(section) {
1995
- const m = section.match(INLINE_FIELD_LIST);
1996
- if (!m)
1997
- return null;
1998
- return rowFromCells([m[1], m[2], m[3], m[4], m[5], m[6], m[7]]);
1999
- }
2000
1906
  // ../../packages/aeg-core/src/verdict-extraction.ts
2001
1907
  var HEAD_SHA_PATTERN = /^[ \t]*(?:\*{1,3}|_{1,3})?Judged head:\s*([0-9a-f]{7,40})(?![A-Za-z0-9])/im;
2002
1908
  var OBJECTIVES_VERSION_PATTERN = /^[ \t]*(?:\*{1,3}|_{1,3})?Objectives version:\s*([0-9a-f]{64})(?![A-Za-z0-9])/im;
@@ -2445,10 +2351,12 @@ function evaluateC5(changed, docOwnersContent, prBody, fileExists, waiverActive,
2445
2351
  var CODE_REVIEW_SEVERITY_ORDER = ["BLOCKER", "MAJOR", "MINOR"];
2446
2352
  var SECURITY_SEVERITY_ORDER = ["CRITICAL", "HIGH", "MEDIUM", "LOW"];
2447
2353
  var DEFAULT_MAX_ROUNDS = 3;
2354
+ var DEFAULT_MAX_TASK_MINUTES = 180;
2448
2355
  var DEFAULT_REVIEW_POLICY = {
2449
2356
  codeReviewThreshold: "BLOCKER",
2450
2357
  securityThreshold: "HIGH",
2451
- maxRounds: DEFAULT_MAX_ROUNDS
2358
+ maxRounds: DEFAULT_MAX_ROUNDS,
2359
+ maxTaskMinutes: DEFAULT_MAX_TASK_MINUTES
2452
2360
  };
2453
2361
  var FILE_SHAPED_LOCATION = /\.[a-zA-Z0-9]{1,10}(:\d+)?\s*$/;
2454
2362
  var PROSE_LOCATION_PATTERNS = [/\bpr\s*body\b/i, /\bcomment\b/i];
@@ -2849,11 +2757,13 @@ function checkDocUpdateList(prBody) {
2849
2757
  return headingCheck(prBody, "(?:documentation|doc)[- ]update(?:\\s+list)?", "Documentation-update list");
2850
2758
  }
2851
2759
  function checkWorktreeStep0(prBody) {
2852
- if (/git worktree add/.test(prBody))
2760
+ if (/git worktree add/.test(prBody) || /cd \.worktrees\//.test(prBody) || /bun install --frozen-lockfile/.test(prBody))
2853
2761
  return { status: "pass", errors: [] };
2854
2762
  return {
2855
2763
  status: "fail",
2856
- errors: ["brief-validation worktree Step 0: no `git worktree add` command found in the PR body."]
2764
+ errors: [
2765
+ "brief-validation worktree Step 0: no `git worktree add`, `cd .worktrees/`, or `bun install --frozen-lockfile` command found in the PR body."
2766
+ ]
2857
2767
  };
2858
2768
  }
2859
2769
  function checkStopConditions(prBody) {
@@ -3043,7 +2953,8 @@ function isCommandBlock(content) {
3043
2953
  return COMMAND_WORDS.includes(commandWordOf(firstNonBlankLine(content)));
3044
2954
  }
3045
2955
  function isStep0Block(content) {
3046
- return firstNonBlankLine(content).startsWith("git worktree add");
2956
+ const first = firstNonBlankLine(content);
2957
+ return first.startsWith("git worktree add") || first.startsWith("cd .worktrees/") || first.startsWith("bun install --frozen-lockfile");
3047
2958
  }
3048
2959
  function checkCommandsCarryOutput(prBody) {
3049
2960
  const errors = [];
@@ -3512,10 +3423,14 @@ function legacySlugPattern(legacySlugs) {
3512
3423
  const alternation = legacySlugs.map((s) => s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")).join("|");
3513
3424
  return new RegExp(`(^|[^a-zA-Z0-9\\n-])(${alternation})([^a-zA-Z0-9\\n-]|$)`, "g");
3514
3425
  }
3426
+ function specGrandfatherPaths(specGrandfather) {
3427
+ return Array.isArray(specGrandfather) ? [...specGrandfather] : Object.keys(specGrandfather);
3428
+ }
3515
3429
  function checkUnresolvableReferences(files, readerFacingPrefix, readerFacingSuffix, legacySlugs = [], shipsPrefix = SHIPS_PREFIX, specGrandfather = [], specPaths = DEFAULT_SPEC_PATHS) {
3516
3430
  const findings = [];
3517
3431
  const legacyPattern = legacySlugPattern(legacySlugs);
3518
- const grandfathered = new Set(specGrandfather);
3432
+ const grandfatheredWhole = new Set(Array.isArray(specGrandfather) ? specGrandfather : []);
3433
+ const limits = new Map(Array.isArray(specGrandfather) ? [] : Object.entries(specGrandfather));
3519
3434
  const patterns = [
3520
3435
  { pattern: FORGE_NUMBER_PATTERN, what: "a forge number" },
3521
3436
  { pattern: TRANCHE_SLUG_VN_PATTERN, what: "an internal tranche slug" },
@@ -3534,18 +3449,19 @@ function checkUnresolvableReferences(files, readerFacingPrefix, readerFacingSuff
3534
3449
  continue;
3535
3450
  if (cls !== "product" && cls !== "spec" && !SWEPT_CLASSES.has(cls))
3536
3451
  continue;
3537
- if (cls === "spec" && grandfathered.has(file.path))
3452
+ if (cls === "spec" && grandfatheredWhole.has(file.path))
3538
3453
  continue;
3539
3454
  const blocking = cls === "product" || cls === "spec";
3540
3455
  const scrubbed = cls === "product" ? stripNonProseForProduct(file.path, file.content) : stripNonProse(file.path, file.content);
3541
3456
  const patternsToRun = cls === "product" ? productPatterns : cls === "spec" ? specPatterns : patterns;
3457
+ const fileFindings = [];
3542
3458
  for (const { pattern, what, group } of patternsToRun) {
3543
3459
  pattern.lastIndex = 0;
3544
3460
  let match = pattern.exec(scrubbed);
3545
3461
  while (match !== null) {
3546
3462
  const cited = group !== undefined ? match[group] ?? match[0] : match[0];
3547
3463
  const citedIndex = match.index + match[0].indexOf(cited);
3548
- findings.push({
3464
+ fileFindings.push({
3549
3465
  file: file.path,
3550
3466
  line: lineAt(scrubbed, citedIndex),
3551
3467
  message: `references ${what} ("${cited}") a reader outside this repo's tracker cannot resolve`,
@@ -3554,6 +3470,15 @@ function checkUnresolvableReferences(files, readerFacingPrefix, readerFacingSuff
3554
3470
  match = pattern.exec(scrubbed);
3555
3471
  }
3556
3472
  }
3473
+ const limit = cls === "spec" ? limits.get(file.path) : undefined;
3474
+ if (limit !== undefined) {
3475
+ if (fileFindings.length <= limit)
3476
+ continue;
3477
+ for (const f of fileFindings) {
3478
+ f.message += `; ${file.path} carries ${fileFindings.length} such findings, over its proseGates.specGrandfather limit of ${limit}`;
3479
+ }
3480
+ }
3481
+ findings.push(...fileFindings);
3557
3482
  }
3558
3483
  return findings;
3559
3484
  }
@@ -4513,8 +4438,7 @@ function briefHash(brief) {
4513
4438
  function policyDigest(policy) {
4514
4439
  return createHash4("sha256").update(JSON.stringify({
4515
4440
  codeReviewThreshold: policy.codeReviewThreshold,
4516
- securityThreshold: policy.securityThreshold,
4517
- maxRounds: policy.maxRounds
4441
+ securityThreshold: policy.securityThreshold
4518
4442
  })).digest("hex");
4519
4443
  }
4520
4444
  function isBoundToHead(echoed, headSha) {
@@ -4827,7 +4751,46 @@ function parseEnforcementRegistry(content) {
4827
4751
  return result;
4828
4752
  }
4829
4753
  // ../../packages/aeg-core/src/registry-checks.ts
4830
- function checkG1(rows, existsFn) {
4754
+ var HOOK_DIR_PREFIXES = [".claude/hooks/", ".vinaya/hooks/", ".husky/", ".git/hooks/"];
4755
+ var BARE_HOOK_NAME = /^check-[A-Za-z0-9_.-]*\.sh$/;
4756
+ function basename(path) {
4757
+ return path.slice(path.lastIndexOf("/") + 1);
4758
+ }
4759
+ function lineOf(content, index) {
4760
+ let line = 1;
4761
+ for (let i = 0;i < index; i++)
4762
+ if (content.charCodeAt(i) === 10)
4763
+ line++;
4764
+ return line;
4765
+ }
4766
+ function findUnshippedHookRefs(docs, shipped) {
4767
+ const shippedNames = new Set([...shipped].map(basename));
4768
+ const findings = [];
4769
+ const flag = (doc, token, index) => {
4770
+ findings.push({
4771
+ path: doc.path,
4772
+ reason: `${doc.path}:${lineOf(doc.content, index)} names hook "${token}", which is neither tracked in git nor emitted by \`vinaya init\``
4773
+ });
4774
+ };
4775
+ for (const doc of docs) {
4776
+ for (const { cited, index } of extractCitedPaths(doc.content)) {
4777
+ if (cited.endsWith("/") || !HOOK_DIR_PREFIXES.some((p) => cited.startsWith(p)))
4778
+ continue;
4779
+ if (!shipped.has(cited))
4780
+ flag(doc, cited, index);
4781
+ }
4782
+ const spanPattern = /`([^`\n]+)`/g;
4783
+ let match = spanPattern.exec(doc.content);
4784
+ while (match !== null) {
4785
+ const token = match[1] ?? "";
4786
+ if (BARE_HOOK_NAME.test(token) && !shippedNames.has(token))
4787
+ flag(doc, token, match.index);
4788
+ match = spanPattern.exec(doc.content);
4789
+ }
4790
+ }
4791
+ return findings;
4792
+ }
4793
+ function checkG1(rows, existsFn, hookRefs) {
4831
4794
  const findings = [];
4832
4795
  for (const row of rows) {
4833
4796
  if (row.implementation === "")
@@ -4840,6 +4803,8 @@ function checkG1(rows, existsFn) {
4840
4803
  });
4841
4804
  }
4842
4805
  }
4806
+ if (hookRefs)
4807
+ findings.push(...findUnshippedHookRefs(hookRefs.docs, hookRefs.shipped));
4843
4808
  return { check: "G1", status: findings.length > 0 ? "fail" : "pass", findings };
4844
4809
  }
4845
4810
  var SCAFFOLD_PLACEHOLDER = "[undocumented — fill in why]";
@@ -5393,7 +5358,6 @@ var TaskPrPauseSchema = z.object({
5393
5358
  var TaskPrReviewRecordSchema = z.object({
5394
5359
  verdicts: z.array(TaskPrVerdictSchema),
5395
5360
  roundMarkers: z.array(z.number().int().nonnegative()),
5396
- summaryTable: z.string().nullable(),
5397
5361
  pause: TaskPrPauseSchema.nullable()
5398
5362
  });
5399
5363
  var TaskPrReadInputSchema = z.object({
@@ -5440,16 +5404,6 @@ var TaskCancelResultSchema = z.object({
5440
5404
  authenticatedFrom: z.string().min(1),
5441
5405
  fencedEffectKeys: z.array(z.string())
5442
5406
  });
5443
- var TASK_TOOL_NAMES = [
5444
- "task_start",
5445
- "task_status",
5446
- "task_escalation_read",
5447
- "task_pr_read",
5448
- "task_resume",
5449
- "task_cancel"
5450
- ];
5451
- var OPERATOR_STATUS_FOLLOW = "task_status_follow";
5452
- var OPERATOR_TOOL_GRANT = [...TASK_TOOL_NAMES, OPERATOR_STATUS_FOLLOW];
5453
5407
  // ../../packages/aeg-core/src/first-push-dispatch-gate.ts
5454
5408
  function parseTaskBranch(branch) {
5455
5409
  const m = /^task\/([^/]+)\/([^/]+)$/.exec(branch);
@@ -5680,15 +5634,69 @@ var NO_GATE_CUTOVERS = {
5680
5634
  briefRulesSincePr: null,
5681
5635
  agentBoxesRefusedSincePr: null
5682
5636
  };
5683
- // ../../packages/aeg-core/src/dev-review-loop/types.ts
5684
- var SEVERITY_COLUMNS = ["blocker", "major", "minor", "critical", "high", "medium", "low"];
5685
- // ../../packages/aeg-core/src/dev-review-loop/journal-reconstruction.ts
5686
- var SUMMARY_TABLE_HEADER = `| round | ${SEVERITY_COLUMNS.join(" | ")} | confidence | outcome |`;
5687
- // ../../packages/aeg-core/src/log/envelope.ts
5688
- import { createHash as createHash5 } from "node:crypto";
5689
-
5690
5637
  // ../../packages/aeg-core/src/log/schema.ts
5638
+ import { z as z3 } from "zod";
5639
+
5640
+ // ../../packages/aeg-core/src/log/custom.ts
5691
5641
  import { z as z2 } from "zod";
5642
+ var CUSTOM_EVENT_NAME_PATTERN = /^[a-z][a-z0-9_]*\.[a-z][a-z0-9_.]*$/;
5643
+ var CUSTOM_EVENT_NAME_MAX_LENGTH = 64;
5644
+ var CUSTOM_EVENT_RESERVED_NAMESPACE = "vinaya";
5645
+ var CUSTOM_EVENT_MAX_FIELDS = 20;
5646
+ var CUSTOM_FIELD_NAME_PATTERN = /^[a-z][a-z0-9_]*$/;
5647
+ var CUSTOM_FIELD_NAME_MAX_LENGTH = 64;
5648
+ var CUSTOM_TEXT_MAX_LENGTH = 500;
5649
+ var CUSTOM_WORD_PATTERN = /^[a-z0-9][a-z0-9_-]*$/;
5650
+ var CUSTOM_WORD_MAX_LENGTH = 64;
5651
+ var CUSTOM_FIELD_MAX_WORDS = 50;
5652
+ var CustomFieldTypeSchema = z2.union([z2.enum(["text", "number", "boolean"]), z2.array(z2.string())]);
5653
+ var CustomEventDeclarationsSchema = z2.record(z2.string(), z2.object({
5654
+ fields: z2.record(z2.string(), CustomFieldTypeSchema)
5655
+ }).strict()).superRefine((events, ctx) => {
5656
+ for (const [name, declaration] of Object.entries(events)) {
5657
+ const refuse = (message, path = []) => {
5658
+ ctx.addIssue({
5659
+ code: z2.ZodIssueCode.custom,
5660
+ path: [name, ...path],
5661
+ message: `logs.events "${name}": ${message}`
5662
+ });
5663
+ };
5664
+ if (name.length > CUSTOM_EVENT_NAME_MAX_LENGTH) {
5665
+ refuse(`the name must be at most ${CUSTOM_EVENT_NAME_MAX_LENGTH} characters`);
5666
+ }
5667
+ if (!CUSTOM_EVENT_NAME_PATTERN.test(name)) {
5668
+ refuse("the name must be `<namespace>.<event>` — lowercase letters, digits and `_`, a dot between them");
5669
+ } else if (name.split(".")[0] === CUSTOM_EVENT_RESERVED_NAMESPACE) {
5670
+ refuse(`the \`${CUSTOM_EVENT_RESERVED_NAMESPACE}.\` namespace is reserved for Vinaya's own events`);
5671
+ }
5672
+ const fieldEntries = Object.entries(declaration.fields);
5673
+ if (fieldEntries.length > CUSTOM_EVENT_MAX_FIELDS) {
5674
+ refuse(`at most ${CUSTOM_EVENT_MAX_FIELDS} fields may be declared (found ${fieldEntries.length})`, ["fields"]);
5675
+ }
5676
+ for (const [field, type] of fieldEntries) {
5677
+ if (field.length > CUSTOM_FIELD_NAME_MAX_LENGTH || !CUSTOM_FIELD_NAME_PATTERN.test(field)) {
5678
+ 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]);
5679
+ }
5680
+ if (typeof type === "string")
5681
+ continue;
5682
+ if (type.length === 0) {
5683
+ refuse(`field "${field}": a list of words must name at least one word`, ["fields", field]);
5684
+ }
5685
+ if (type.length > CUSTOM_FIELD_MAX_WORDS) {
5686
+ refuse(`field "${field}": a list of words may name at most ${CUSTOM_FIELD_MAX_WORDS}`, ["fields", field]);
5687
+ }
5688
+ const bad = type.filter((w) => w.length > CUSTOM_WORD_MAX_LENGTH || !CUSTOM_WORD_PATTERN.test(w));
5689
+ if (bad.length > 0) {
5690
+ refuse(`field "${field}": a listed word is lowercase letters, digits, \`_\` and \`-\`, at most ${CUSTOM_WORD_MAX_LENGTH} characters`, ["fields", field]);
5691
+ }
5692
+ if (new Set(type).size !== type.length) {
5693
+ refuse(`field "${field}": a list of words names a word twice`, ["fields", field]);
5694
+ }
5695
+ }
5696
+ }
5697
+ });
5698
+
5699
+ // ../../packages/aeg-core/src/log/schema.ts
5692
5700
  var CONFIDENCE_REASON_MAX_LENGTH = 280;
5693
5701
  var ROLE_VALUES = [
5694
5702
  "planner",
@@ -5699,178 +5707,210 @@ var ROLE_VALUES = [
5699
5707
  "archivist",
5700
5708
  "architect"
5701
5709
  ];
5702
- var RoleSchema = z2.enum(ROLE_VALUES);
5710
+ var RoleSchema = z3.enum(ROLE_VALUES);
5703
5711
  var HOST_VALUES = ["hook", "ci", "cli", "loop"];
5704
- var HostSchema = z2.enum(HOST_VALUES);
5712
+ var HostSchema = z3.enum(HOST_VALUES);
5705
5713
  var RUN_ID_PATTERN = /^[A-Za-z0-9_.-]{1,128}$/;
5706
5714
  var headerMetaCore = {
5707
- ts: z2.string(),
5708
- run_id: z2.string().regex(RUN_ID_PATTERN),
5709
- seq: z2.number().int().nonnegative(),
5710
- repo: z2.string().nullable(),
5711
- vinaya: z2.string(),
5712
- doctrine: z2.string(),
5715
+ ts: z3.string(),
5716
+ run_id: z3.string().regex(RUN_ID_PATTERN),
5717
+ seq: z3.number().int().nonnegative(),
5718
+ repo: z3.string().nullable(),
5719
+ vinaya: z3.string(),
5720
+ doctrine: z3.string(),
5713
5721
  host: HostSchema,
5714
- machine: z2.string()
5722
+ machine: z3.string()
5715
5723
  };
5716
- var HeaderMetaV1Schema = z2.object({
5717
- schema: z2.literal(1),
5724
+ var HeaderMetaV1Schema = z3.object({
5725
+ schema: z3.literal(1),
5718
5726
  ...headerMetaCore
5719
5727
  }).strict();
5720
- var LineageSchema = z2.object({
5721
- run: z2.string().nullable(),
5722
- attempt: z2.number().int().nullable(),
5723
- parent: z2.string().nullable()
5728
+ var LineageSchema = z3.object({
5729
+ run: z3.string().nullable(),
5730
+ attempt: z3.number().int().nullable(),
5731
+ parent: z3.string().nullable()
5724
5732
  }).strict();
5725
- var InputVersionsSchema = z2.object({
5726
- objectives_version: z2.string().nullable(),
5727
- brief_hash: z2.string().nullable(),
5728
- ruling_ordinal: z2.number().int().nullable(),
5729
- policy_digest: z2.string().nullable()
5733
+ var InputVersionsSchema = z3.object({
5734
+ objectives_version: z3.string().nullable(),
5735
+ brief_hash: z3.string().nullable(),
5736
+ ruling_ordinal: z3.number().int().nullable(),
5737
+ policy_digest: z3.string().nullable()
5730
5738
  }).strict();
5731
- var ProvenanceSchema = z2.enum(["parent_attributed", "env_correlated", "self_reported", "unavailable"]);
5732
- var HeaderMetaV2Schema = z2.object({
5733
- schema: z2.literal(2),
5739
+ var ProvenanceSchema = z3.enum(["parent_attributed", "env_correlated", "self_reported", "unavailable"]);
5740
+ var HeaderMetaV2Schema = z3.object({
5741
+ schema: z3.literal(2),
5734
5742
  ...headerMetaCore,
5735
- event_id: z2.string().min(1),
5736
- process_id: z2.string().min(1),
5737
- actor_id: z2.string().nullable(),
5743
+ event_id: z3.string().min(1),
5744
+ process_id: z3.string().min(1),
5745
+ actor_id: z3.string().nullable(),
5738
5746
  lineage: LineageSchema,
5739
5747
  input_versions: InputVersionsSchema,
5740
5748
  provenance: ProvenanceSchema
5741
5749
  }).strict();
5742
- var HeaderMetaSchema = z2.discriminatedUnion("schema", [HeaderMetaV1Schema, HeaderMetaV2Schema]);
5743
- var SubjectSchema = z2.object({
5744
- issue: z2.number().int().nullable(),
5745
- pr: z2.number().int().optional(),
5746
- sha: z2.string().optional(),
5747
- role: z2.union([RoleSchema, z2.literal("unattributed")]),
5748
- round: z2.number().int().optional(),
5749
- objectives_version: z2.string().optional()
5750
+ var WorkSchema = z3.object({
5751
+ ref: z3.string().nullable(),
5752
+ repo: z3.string().nullable(),
5753
+ change: z3.string().nullable(),
5754
+ revision: z3.string().nullable()
5755
+ }).strict();
5756
+ var FlowSchema = z3.object({
5757
+ id: z3.string().nullable(),
5758
+ version: z3.string().nullable()
5759
+ }).strict();
5760
+ var HeaderMetaV3Schema = z3.object({
5761
+ schema: z3.literal(3),
5762
+ ...headerMetaCore,
5763
+ event_id: z3.string().min(1),
5764
+ process_id: z3.string().min(1),
5765
+ actor_id: z3.string().nullable(),
5766
+ lineage: LineageSchema,
5767
+ input_versions: InputVersionsSchema,
5768
+ provenance: ProvenanceSchema,
5769
+ work: WorkSchema,
5770
+ flow: FlowSchema,
5771
+ runtime: z3.string().nullable(),
5772
+ source: z3.string().nullable()
5773
+ }).strict();
5774
+ var HeaderMetaSchema = z3.discriminatedUnion("schema", [HeaderMetaV1Schema, HeaderMetaV2Schema, HeaderMetaV3Schema]);
5775
+ var SubjectSchema = z3.object({
5776
+ issue: z3.number().int().nullable(),
5777
+ pr: z3.number().int().optional(),
5778
+ sha: z3.string().optional(),
5779
+ role: z3.union([RoleSchema, z3.literal("unattributed")]),
5780
+ round: z3.number().int().optional(),
5781
+ objectives_version: z3.string().optional()
5750
5782
  }).strict();
5751
- var HeaderSchema = z2.object({
5783
+ var HeaderSchema = z3.object({
5752
5784
  meta: HeaderMetaSchema,
5753
5785
  subject: SubjectSchema
5754
5786
  }).strict();
5755
5787
  var envelopeTail = {
5756
- duration_ms: z2.number().nonnegative().optional(),
5757
- payload: z2.object({}).strict()
5788
+ duration_ms: z3.number().nonnegative().optional(),
5789
+ payload: z3.object({}).strict()
5758
5790
  };
5759
- var ReviewFindingSchema = z2.object({
5760
- id: z2.string(),
5761
- severity: z2.string(),
5762
- state: z2.string().optional(),
5763
- severity_scale: z2.string().optional(),
5764
- policy_treatment: z2.enum(["blocking", "non_blocking", "unavailable"]).optional(),
5765
- confidence: z2.number().min(0).max(1).optional(),
5766
- confidence_scale: z2.string().optional(),
5767
- confidence_source: z2.string().optional()
5791
+ var ReviewFindingSchema = z3.object({
5792
+ id: z3.string(),
5793
+ severity: z3.string(),
5794
+ state: z3.string().optional(),
5795
+ severity_scale: z3.string().optional(),
5796
+ policy_treatment: z3.enum(["blocking", "non_blocking", "unavailable"]).optional(),
5797
+ confidence: z3.number().min(0).max(1).optional(),
5798
+ confidence_scale: z3.string().optional(),
5799
+ confidence_source: z3.string().optional()
5768
5800
  }).strict();
5769
- var DispatchOutcomeSchema = z2.discriminatedUnion("type", [
5770
- z2.object({ type: z2.literal("pr_opened"), pr: z2.number().int(), head: z2.string() }).strict(),
5771
- z2.object({
5772
- type: z2.literal("round_pushed"),
5773
- pr: z2.number().int(),
5774
- head: z2.string(),
5775
- comment_id: z2.number().int()
5801
+ var DispatchOutcomeSchema = z3.discriminatedUnion("type", [
5802
+ z3.object({ type: z3.literal("pr_opened"), pr: z3.number().int(), head: z3.string() }).strict(),
5803
+ z3.object({
5804
+ type: z3.literal("round_pushed"),
5805
+ pr: z3.number().int(),
5806
+ head: z3.string(),
5807
+ comment_id: z3.number().int()
5776
5808
  }).strict(),
5777
- z2.object({
5778
- type: z2.literal("verdict"),
5779
- verdict: z2.enum(["APPROVE", "REQUEST CHANGES", "PASS", "FAIL"]),
5780
- head: z2.string(),
5781
- comment_id: z2.number().int(),
5782
- objectives: z2.array(z2.object({ id: z2.string(), met: z2.boolean() }).strict()),
5783
- findings: z2.array(ReviewFindingSchema)
5809
+ z3.object({
5810
+ type: z3.literal("verdict"),
5811
+ verdict: z3.enum(["APPROVE", "REQUEST CHANGES", "PASS", "FAIL"]),
5812
+ head: z3.string(),
5813
+ comment_id: z3.number().int(),
5814
+ objectives: z3.array(z3.object({ id: z3.string(), met: z3.boolean() }).strict()),
5815
+ findings: z3.array(ReviewFindingSchema)
5784
5816
  }).strict(),
5785
- z2.object({
5786
- type: z2.literal("escalation"),
5787
- class: z2.enum(["authority", "strategy", "product"]),
5788
- comment_id: z2.number().int()
5817
+ z3.object({
5818
+ type: z3.literal("escalation"),
5819
+ class: z3.enum(["authority", "strategy", "product"]),
5820
+ comment_id: z3.number().int()
5789
5821
  }).strict(),
5790
- z2.object({ type: z2.literal("brief"), comment_id: z2.number().int(), hash: z2.string() }).strict(),
5791
- z2.object({ type: z2.literal("plan"), issues: z2.array(z2.number().int()) }).strict(),
5792
- z2.object({ type: z2.literal("archive"), provenance_comment_id: z2.number().int() }).strict(),
5793
- z2.object({ type: z2.literal("completed") }).strict()
5822
+ z3.object({ type: z3.literal("brief"), comment_id: z3.number().int(), hash: z3.string() }).strict(),
5823
+ z3.object({ type: z3.literal("plan"), issues: z3.array(z3.number().int()) }).strict(),
5824
+ z3.object({ type: z3.literal("archive"), provenance_comment_id: z3.number().int() }).strict(),
5825
+ z3.object({ type: z3.literal("completed") }).strict()
5794
5826
  ]);
5795
5827
  var dispatchShared = {
5796
5828
  meta: HeaderMetaSchema,
5797
5829
  subject: SubjectSchema,
5798
- kind: z2.literal("dispatch"),
5830
+ kind: z3.literal("dispatch"),
5799
5831
  ...envelopeTail,
5800
5832
  target_role: RoleSchema,
5801
- model: z2.string(),
5802
- round: z2.number().int().optional(),
5803
- effect_id: z2.string()
5833
+ model: z3.string(),
5834
+ round: z3.number().int().optional(),
5835
+ effect_id: z3.string()
5804
5836
  };
5805
- var dispatchUsageField = z2.object({ input: z2.number().nonnegative(), output: z2.number().nonnegative() }).strict().nullable();
5806
- var DispatchEventSchema = z2.discriminatedUnion("event", [
5807
- z2.object({ ...dispatchShared, event: z2.literal("dispatched"), prompt_hash: z2.string() }).strict(),
5808
- z2.object({
5837
+ var dispatchUsageField = z3.object({ input: z3.number().nonnegative(), output: z3.number().nonnegative() }).strict().nullable();
5838
+ var DispatchEventSchema = z3.discriminatedUnion("event", [
5839
+ z3.object({ ...dispatchShared, event: z3.literal("dispatched"), prompt_hash: z3.string() }).strict(),
5840
+ z3.object({
5809
5841
  ...dispatchShared,
5810
- event: z2.literal("outcome_received"),
5842
+ event: z3.literal("outcome_received"),
5811
5843
  outcome: DispatchOutcomeSchema,
5812
5844
  usage: dispatchUsageField
5813
5845
  }).strict(),
5814
- z2.object({
5846
+ z3.object({
5815
5847
  ...dispatchShared,
5816
- event: z2.literal("dispatch_failed"),
5817
- reason: z2.enum(["timeout", "crash", "refused", "unattributed_write"]),
5848
+ event: z3.literal("dispatch_failed"),
5849
+ reason: z3.enum(["timeout", "crash", "refused", "unattributed_write"]),
5818
5850
  usage: dispatchUsageField
5819
5851
  }).strict()
5820
5852
  ]);
5853
+ var CODE_TOKEN_PATTERN = /^[A-Za-z0-9._-]{1,64}$/;
5854
+ var CodeTokenSchema = z3.string().regex(CODE_TOKEN_PATTERN);
5855
+ var ReviewerVerdictSchema = z3.object({
5856
+ role: RoleSchema,
5857
+ outcome: z3.enum(["approve", "changes_requested", "not_reviewed"]),
5858
+ blockers: z3.number().int().nonnegative()
5859
+ }).strict();
5821
5860
  var loopShared = {
5822
5861
  meta: HeaderMetaSchema,
5823
5862
  subject: SubjectSchema,
5824
- kind: z2.literal("dev_review_loop"),
5863
+ kind: z3.literal("dev_review_loop"),
5825
5864
  ...envelopeTail,
5826
- loop_id: z2.string()
5865
+ loop_id: z3.string()
5827
5866
  };
5828
- var DevReviewLoopEventSchema = z2.discriminatedUnion("event", [
5829
- z2.object({
5867
+ var DevReviewLoopEventSchema = z3.discriminatedUnion("event", [
5868
+ z3.object({
5830
5869
  ...loopShared,
5831
- event: z2.literal("loop_started"),
5832
- task: z2.number().int(),
5833
- policy: z2.object({
5834
- max_rounds: z2.number().int().nonnegative(),
5835
- reviewers: z2.array(RoleSchema),
5836
- models: z2.record(RoleSchema, z2.string())
5870
+ event: z3.literal("loop_started"),
5871
+ task: z3.number().int(),
5872
+ policy: z3.object({
5873
+ max_rounds: z3.number().int().nonnegative(),
5874
+ reviewers: z3.array(RoleSchema),
5875
+ models: z3.record(RoleSchema, z3.string())
5837
5876
  }).strict()
5838
5877
  }).strict(),
5839
- z2.object({ ...loopShared, event: z2.literal("round_started"), round: z2.number().int(), base_head: z2.string() }).strict(),
5840
- z2.object({
5878
+ z3.object({ ...loopShared, event: z3.literal("round_started"), round: z3.number().int(), base_head: z3.string() }).strict(),
5879
+ z3.object({
5841
5880
  ...loopShared,
5842
- event: z2.literal("gate_result_read"),
5843
- round: z2.number().int(),
5844
- head: z2.string(),
5845
- green: z2.boolean(),
5846
- confidence_value: z2.number().int().min(0).max(100).optional(),
5847
- confidence_reason: z2.string().max(CONFIDENCE_REASON_MAX_LENGTH).optional(),
5848
- confidence_unavailable: z2.boolean().optional(),
5849
- extra_turn_spent: z2.boolean().optional()
5881
+ event: z3.literal("gate_result_read"),
5882
+ round: z3.number().int(),
5883
+ head: z3.string(),
5884
+ green: z3.boolean(),
5885
+ confidence_value: z3.number().int().min(0).max(100).optional(),
5886
+ confidence_reason: z3.string().max(CONFIDENCE_REASON_MAX_LENGTH).optional(),
5887
+ confidence_unavailable: z3.boolean().optional(),
5888
+ extra_turn_spent: z3.boolean().optional()
5850
5889
  }).strict(),
5851
- z2.object({
5890
+ z3.object({
5852
5891
  ...loopShared,
5853
- event: z2.literal("verdicts_read"),
5854
- round: z2.number().int(),
5855
- head: z2.string(),
5856
- all_approve: z2.boolean(),
5857
- blockers: z2.number().int().nonnegative(),
5858
- findings: z2.array(ReviewFindingSchema).optional()
5892
+ event: z3.literal("verdicts_read"),
5893
+ round: z3.number().int(),
5894
+ head: z3.string(),
5895
+ all_approve: z3.boolean(),
5896
+ blockers: z3.number().int().nonnegative(),
5897
+ findings: z3.array(ReviewFindingSchema).optional(),
5898
+ reviewers: z3.array(ReviewerVerdictSchema).optional()
5859
5899
  }).strict(),
5860
- z2.object({
5900
+ z3.object({
5861
5901
  ...loopShared,
5862
- event: z2.literal("findings_compared"),
5863
- round: z2.number().int(),
5864
- open: z2.array(z2.string()),
5865
- resolved: z2.array(z2.string()),
5866
- new: z2.array(z2.string()),
5867
- recurring: z2.array(z2.string())
5902
+ event: z3.literal("findings_compared"),
5903
+ round: z3.number().int(),
5904
+ open: z3.array(z3.string()),
5905
+ resolved: z3.array(z3.string()),
5906
+ new: z3.array(z3.string()),
5907
+ recurring: z3.array(z3.string())
5868
5908
  }).strict(),
5869
- z2.object({
5909
+ z3.object({
5870
5910
  ...loopShared,
5871
- event: z2.literal("stop_condition_met"),
5872
- round: z2.number().int(),
5873
- condition: z2.enum([
5911
+ event: z3.literal("stop_condition_met"),
5912
+ round: z3.number().int(),
5913
+ condition: z3.enum([
5874
5914
  "green",
5875
5915
  "max_rounds",
5876
5916
  "no_progress",
@@ -5879,66 +5919,85 @@ var DevReviewLoopEventSchema = z2.discriminatedUnion("event", [
5879
5919
  "confidence",
5880
5920
  "reappearance",
5881
5921
  "repeat_finding",
5882
- "repeat_failure"
5922
+ "repeat_failure",
5923
+ "time_budget"
5883
5924
  ])
5884
5925
  }).strict(),
5885
- z2.object({
5926
+ z3.object({
5927
+ ...loopShared,
5928
+ event: z3.literal("paused"),
5929
+ round: z3.number().int(),
5930
+ reason: z3.enum(["escalation", "principal_item", "refreeze_needed"]),
5931
+ reason_code: CodeTokenSchema.optional()
5932
+ }).strict(),
5933
+ z3.object({
5934
+ ...loopShared,
5935
+ event: z3.literal("resumed"),
5936
+ round: z3.number().int(),
5937
+ by: z3.enum(["principal", "driver"])
5938
+ }).strict(),
5939
+ z3.object({
5886
5940
  ...loopShared,
5887
- event: z2.literal("paused"),
5888
- round: z2.number().int(),
5889
- reason: z2.enum(["escalation", "principal_item", "refreeze_needed"])
5941
+ event: z3.literal("cancelled"),
5942
+ round: z3.number().int(),
5943
+ by: z3.literal("principal")
5890
5944
  }).strict(),
5891
- z2.object({
5945
+ z3.object({
5892
5946
  ...loopShared,
5893
- event: z2.literal("resumed"),
5894
- round: z2.number().int(),
5895
- by: z2.enum(["principal", "driver"])
5947
+ event: z3.literal("unpushed_work_resume"),
5948
+ round: z3.number().int(),
5949
+ branch: z3.string(),
5950
+ detail: z3.string()
5896
5951
  }).strict(),
5897
- z2.object({
5952
+ z3.object({
5898
5953
  ...loopShared,
5899
- event: z2.literal("cancelled"),
5900
- round: z2.number().int(),
5901
- by: z2.literal("principal")
5954
+ event: z3.literal("round_ended"),
5955
+ round: z3.number().int(),
5956
+ base_head: z3.string(),
5957
+ head: z3.string(),
5958
+ files_changed: z3.number().int().nonnegative(),
5959
+ insertions: z3.number().int().nonnegative(),
5960
+ deletions: z3.number().int().nonnegative(),
5961
+ wall_ms: z3.number().nonnegative(),
5962
+ outcome: z3.enum(["green", "changes_requested", "escalated"])
5902
5963
  }).strict(),
5903
- z2.object({
5964
+ z3.object({
5904
5965
  ...loopShared,
5905
- event: z2.literal("unpushed_work_resume"),
5906
- round: z2.number().int(),
5907
- branch: z2.string(),
5908
- detail: z2.string()
5966
+ event: z3.literal("journal_finalized"),
5967
+ rounds: z3.number().int().nonnegative(),
5968
+ total_wall_ms: z3.number().nonnegative(),
5969
+ time_to_green_ms: z3.number().nonnegative().nullable(),
5970
+ files_changed_total: z3.number().int().nonnegative(),
5971
+ final_head: z3.string(),
5972
+ result: z3.enum(["merged_ready", "stopped"])
5909
5973
  }).strict(),
5910
- z2.object({
5974
+ z3.object({
5911
5975
  ...loopShared,
5912
- event: z2.literal("round_ended"),
5913
- round: z2.number().int(),
5914
- base_head: z2.string(),
5915
- head: z2.string(),
5916
- files_changed: z2.number().int().nonnegative(),
5917
- insertions: z2.number().int().nonnegative(),
5918
- deletions: z2.number().int().nonnegative(),
5919
- wall_ms: z2.number().nonnegative(),
5920
- outcome: z2.enum(["green", "changes_requested", "escalated"])
5976
+ event: z3.literal("infrastructure_retry"),
5977
+ round: z3.number().int(),
5978
+ failure_kind: z3.enum(["pause_comment_post", "developer_connection"]),
5979
+ attempts: z3.number().int().positive(),
5980
+ outcome: z3.enum(["recovered", "exhausted"])
5921
5981
  }).strict(),
5922
- z2.object({
5982
+ z3.object({
5923
5983
  ...loopShared,
5924
- event: z2.literal("journal_finalized"),
5925
- rounds: z2.number().int().nonnegative(),
5926
- total_wall_ms: z2.number().nonnegative(),
5927
- time_to_green_ms: z2.number().nonnegative().nullable(),
5928
- files_changed_total: z2.number().int().nonnegative(),
5929
- final_head: z2.string(),
5930
- result: z2.enum(["merged_ready", "stopped"])
5984
+ event: z3.literal("driver_heartbeat"),
5985
+ task: z3.number().int(),
5986
+ pr: z3.number().int().positive().optional(),
5987
+ round: z3.number().int(),
5988
+ phase: z3.string()
5931
5989
  }).strict(),
5932
- z2.object({
5990
+ z3.object({
5933
5991
  ...loopShared,
5934
- event: z2.literal("infrastructure_retry"),
5935
- round: z2.number().int(),
5936
- failure_kind: z2.enum(["pause_comment_post", "developer_connection"]),
5937
- attempts: z2.number().int().positive(),
5938
- outcome: z2.enum(["recovered", "exhausted"])
5992
+ event: z3.literal("driver_exited"),
5993
+ task: z3.number().int(),
5994
+ reason: z3.enum(["finished", "paused", "reexec", "error", "signal"]),
5995
+ last_decision: z3.string(),
5996
+ exit_code: z3.number().int().optional(),
5997
+ error_class: CodeTokenSchema.optional()
5939
5998
  }).strict()
5940
5999
  ]);
5941
- var ForgeOpSchema = z2.enum([
6000
+ var ForgeOpSchema = z3.enum([
5942
6001
  "pr.create",
5943
6002
  "pr.comment",
5944
6003
  "pr.body.replace",
@@ -5952,24 +6011,24 @@ var ForgeOpSchema = z2.enum([
5952
6011
  "label.add",
5953
6012
  "label.remove"
5954
6013
  ]);
5955
- var ForgeWriteTargetSchema = z2.object({
5956
- issue: z2.number().int().optional(),
5957
- pr: z2.number().int().optional()
6014
+ var ForgeWriteTargetSchema = z3.object({
6015
+ issue: z3.number().int().optional(),
6016
+ pr: z3.number().int().optional()
5958
6017
  }).strict();
5959
6018
  var forgeWriteShared = {
5960
6019
  meta: HeaderMetaSchema,
5961
6020
  subject: SubjectSchema,
5962
- kind: z2.literal("forge_write"),
6021
+ kind: z3.literal("forge_write"),
5963
6022
  ...envelopeTail,
5964
6023
  op: ForgeOpSchema,
5965
6024
  target: ForgeWriteTargetSchema
5966
6025
  };
5967
- var ForgeWriteEventSchema = z2.discriminatedUnion("event", [
5968
- z2.object({ ...forgeWriteShared, event: z2.literal("validated") }).strict(),
5969
- z2.object({ ...forgeWriteShared, event: z2.literal("refused"), reason: z2.string() }).strict(),
5970
- z2.object({ ...forgeWriteShared, event: z2.literal("written"), comment_ids: z2.array(z2.string()) }).strict()
6026
+ var ForgeWriteEventSchema = z3.discriminatedUnion("event", [
6027
+ z3.object({ ...forgeWriteShared, event: z3.literal("validated") }).strict(),
6028
+ z3.object({ ...forgeWriteShared, event: z3.literal("refused"), reason: z3.string() }).strict(),
6029
+ z3.object({ ...forgeWriteShared, event: z3.literal("written"), comment_ids: z3.array(z3.string()) }).strict()
5971
6030
  ]);
5972
- var GateOutcomeSchema = z2.enum([
6031
+ var GateOutcomeSchema = z3.enum([
5973
6032
  "pass",
5974
6033
  "fail",
5975
6034
  "wait",
@@ -5982,61 +6041,74 @@ var GateOutcomeSchema = z2.enum([
5982
6041
  var gateShared = {
5983
6042
  meta: HeaderMetaSchema,
5984
6043
  subject: SubjectSchema,
5985
- kind: z2.literal("gate"),
6044
+ kind: z3.literal("gate"),
5986
6045
  ...envelopeTail,
5987
- check: z2.string(),
5988
- check_version: z2.string().nullable(),
5989
- policy_version: z2.string().nullable(),
5990
- input_fingerprint: z2.string().nullable()
6046
+ check: z3.string(),
6047
+ check_version: z3.string().nullable(),
6048
+ policy_version: z3.string().nullable(),
6049
+ input_fingerprint: z3.string().nullable()
5991
6050
  };
5992
- var GateEventSchema = z2.discriminatedUnion("event", [
5993
- z2.object({
6051
+ var GateEventSchema = z3.discriminatedUnion("event", [
6052
+ z3.object({
5994
6053
  ...gateShared,
5995
- event: z2.literal("checked"),
6054
+ event: z3.literal("checked"),
5996
6055
  outcome: GateOutcomeSchema,
5997
- reason: z2.string().optional()
6056
+ reason: z3.string().optional()
6057
+ }).strict(),
6058
+ z3.object({
6059
+ meta: HeaderMetaSchema,
6060
+ subject: SubjectSchema,
6061
+ kind: z3.literal("gate"),
6062
+ ...envelopeTail,
6063
+ event: z3.literal("summary"),
6064
+ ran: z3.number().int().nonnegative(),
6065
+ passed: z3.number().int().nonnegative(),
6066
+ failed: z3.number().int().nonnegative(),
6067
+ skipped: z3.number().int().nonnegative(),
6068
+ failed_checks: z3.array(z3.string())
5998
6069
  }).strict()
5999
6070
  ]);
6000
- var OperationResultSchema = z2.enum(["ok", "error", "refused", "timeout", "cancelled", "unavailable"]);
6071
+ var OperationResultSchema = z3.enum(["ok", "error", "refused", "timeout", "cancelled", "unavailable"]);
6001
6072
  var operationShared = {
6002
6073
  meta: HeaderMetaSchema,
6003
6074
  subject: SubjectSchema,
6004
- kind: z2.literal("operation"),
6075
+ kind: z3.literal("operation"),
6005
6076
  ...envelopeTail,
6006
- operation: z2.string(),
6007
- target: z2.string().nullable()
6077
+ operation: z3.string(),
6078
+ target: z3.string().nullable()
6008
6079
  };
6009
- var OperationEventSchema = z2.discriminatedUnion("event", [
6010
- z2.object({
6080
+ var OperationEventSchema = z3.discriminatedUnion("event", [
6081
+ z3.object({
6011
6082
  ...operationShared,
6012
- event: z2.literal("completed"),
6083
+ event: z3.literal("completed"),
6013
6084
  result: OperationResultSchema,
6014
- error_class: z2.string().nullable()
6085
+ error_class: z3.string().nullable(),
6086
+ field_names: z3.array(z3.string().max(CUSTOM_FIELD_NAME_MAX_LENGTH)).max(CUSTOM_EVENT_MAX_FIELDS).optional()
6015
6087
  }).strict()
6016
6088
  ]);
6017
- var UsageUnitsSchema = z2.object({
6018
- input: z2.number().nonnegative().nullable(),
6019
- output: z2.number().nonnegative().nullable(),
6020
- cache: z2.number().nonnegative().nullable()
6089
+ var UsageUnitsSchema = z3.object({
6090
+ input: z3.number().nonnegative().nullable(),
6091
+ output: z3.number().nonnegative().nullable(),
6092
+ cache: z3.number().nonnegative().nullable()
6021
6093
  }).strict();
6022
6094
  var usageShared = {
6023
6095
  meta: HeaderMetaSchema,
6024
6096
  subject: SubjectSchema,
6025
- kind: z2.literal("usage"),
6097
+ kind: z3.literal("usage"),
6026
6098
  ...envelopeTail,
6027
- model: z2.string().nullable(),
6028
- source: z2.string(),
6029
- semantics: z2.enum(["cumulative", "delta"])
6099
+ model: z3.string().nullable(),
6100
+ source: z3.string(),
6101
+ semantics: z3.enum(["cumulative", "delta"])
6030
6102
  };
6031
- var UsageEventSchema = z2.discriminatedUnion("event", [
6032
- z2.object({
6103
+ var UsageEventSchema = z3.discriminatedUnion("event", [
6104
+ z3.object({
6033
6105
  ...usageShared,
6034
- event: z2.literal("observed"),
6106
+ event: z3.literal("observed"),
6035
6107
  units: UsageUnitsSchema,
6036
- unknown_reason: z2.string().nullable()
6108
+ unknown_reason: z3.string().nullable()
6037
6109
  }).strict()
6038
6110
  ]);
6039
- var RoleAttemptOutcomeSchema = z2.enum([
6111
+ var RoleAttemptOutcomeSchema = z3.enum([
6040
6112
  "completed",
6041
6113
  "incomplete",
6042
6114
  "infrastructure_failed",
@@ -6047,17 +6119,17 @@ var RoleAttemptOutcomeSchema = z2.enum([
6047
6119
  var roleAttemptShared = {
6048
6120
  meta: HeaderMetaSchema,
6049
6121
  subject: SubjectSchema,
6050
- kind: z2.literal("role_attempt"),
6122
+ kind: z3.literal("role_attempt"),
6051
6123
  ...envelopeTail,
6052
- actor: z2.string().nullable(),
6053
- attempt: z2.number().int().nullable(),
6054
- effect_id: z2.string(),
6055
- model: z2.string().nullable()
6124
+ actor: z3.string().nullable(),
6125
+ attempt: z3.number().int().nullable(),
6126
+ effect_id: z3.string(),
6127
+ model: z3.string().nullable()
6056
6128
  };
6057
- var RoleAttemptEventSchema = z2.discriminatedUnion("event", [
6058
- z2.object({
6129
+ var RoleAttemptEventSchema = z3.discriminatedUnion("event", [
6130
+ z3.object({
6059
6131
  ...roleAttemptShared,
6060
- event: z2.literal("attempted"),
6132
+ event: z3.literal("attempted"),
6061
6133
  outcome: RoleAttemptOutcomeSchema,
6062
6134
  usage: dispatchUsageField
6063
6135
  }).strict()
@@ -6065,42 +6137,59 @@ var RoleAttemptEventSchema = z2.discriminatedUnion("event", [
6065
6137
  var handoffShared = {
6066
6138
  meta: HeaderMetaSchema,
6067
6139
  subject: SubjectSchema,
6068
- kind: z2.literal("handoff"),
6140
+ kind: z3.literal("handoff"),
6069
6141
  ...envelopeTail,
6070
- class: z2.enum(["authority", "strategy", "product"]),
6071
- reason: z2.string()
6142
+ class: z3.enum(["authority", "strategy", "product"]),
6143
+ reason: z3.string()
6072
6144
  };
6073
- var HandoffEventSchema = z2.discriminatedUnion("event", [
6074
- z2.object({
6145
+ var HandoffEventSchema = z3.discriminatedUnion("event", [
6146
+ z3.object({
6075
6147
  ...handoffShared,
6076
- event: z2.literal("raised"),
6077
- requested_decision: z2.string().nullable()
6148
+ event: z3.literal("raised"),
6149
+ requested_decision: z3.string().nullable()
6078
6150
  }).strict(),
6079
- z2.object({
6151
+ z3.object({
6080
6152
  ...handoffShared,
6081
- event: z2.literal("resolved"),
6082
- resolution: z2.string().nullable(),
6083
- resolved_by: z2.string().nullable()
6153
+ event: z3.literal("resolved"),
6154
+ resolution: z3.string().nullable(),
6155
+ resolved_by: z3.string().nullable()
6084
6156
  }).strict()
6085
6157
  ]);
6086
- var EffectTargetSchema = z2.object({
6087
- kind: z2.string(),
6088
- ref: z2.string()
6158
+ var EffectTargetSchema = z3.object({
6159
+ kind: z3.string(),
6160
+ ref: z3.string()
6089
6161
  }).strict();
6090
6162
  var effectShared = {
6091
6163
  meta: HeaderMetaSchema,
6092
6164
  subject: SubjectSchema,
6093
- kind: z2.literal("effect"),
6165
+ kind: z3.literal("effect"),
6094
6166
  ...envelopeTail,
6095
- effect_id: z2.string(),
6167
+ effect_id: z3.string(),
6096
6168
  target: EffectTargetSchema
6097
6169
  };
6098
- var EffectEventSchema = z2.discriminatedUnion("event", [
6099
- z2.object({ ...effectShared, event: z2.literal("attempted") }).strict(),
6100
- z2.object({ ...effectShared, event: z2.literal("observed"), outcome: z2.enum(["success", "failure", "uncertain"]) }).strict(),
6101
- z2.object({ ...effectShared, event: z2.literal("verified"), outcome: z2.enum(["success", "failure", "uncertain"]) }).strict()
6170
+ var EffectEventSchema = z3.discriminatedUnion("event", [
6171
+ z3.object({ ...effectShared, event: z3.literal("attempted") }).strict(),
6172
+ z3.object({ ...effectShared, event: z3.literal("observed"), outcome: z3.enum(["success", "failure", "uncertain"]) }).strict(),
6173
+ z3.object({ ...effectShared, event: z3.literal("verified"), outcome: z3.enum(["success", "failure", "uncertain"]) }).strict()
6174
+ ]);
6175
+ var CustomFieldValueSchema = z3.union([z3.string().max(CUSTOM_TEXT_MAX_LENGTH), z3.number().finite(), z3.boolean()]);
6176
+ var customShared = {
6177
+ meta: HeaderMetaV3Schema,
6178
+ subject: SubjectSchema,
6179
+ kind: z3.literal("custom"),
6180
+ ...envelopeTail
6181
+ };
6182
+ var CustomEventSchema = z3.discriminatedUnion("event", [
6183
+ z3.object({
6184
+ ...customShared,
6185
+ event: z3.literal("recorded"),
6186
+ name: z3.string().max(CUSTOM_EVENT_NAME_MAX_LENGTH).regex(CUSTOM_EVENT_NAME_PATTERN),
6187
+ 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, {
6188
+ message: `custom: at most ${CUSTOM_EVENT_MAX_FIELDS} fields`
6189
+ })
6190
+ }).strict()
6102
6191
  ]);
6103
- var LogEventSchema = z2.union([
6192
+ var LogEventSchema = z3.union([
6104
6193
  DispatchEventSchema,
6105
6194
  DevReviewLoopEventSchema,
6106
6195
  ForgeWriteEventSchema,
@@ -6109,10 +6198,11 @@ var LogEventSchema = z2.union([
6109
6198
  UsageEventSchema,
6110
6199
  RoleAttemptEventSchema,
6111
6200
  HandoffEventSchema,
6112
- EffectEventSchema
6201
+ EffectEventSchema,
6202
+ CustomEventSchema
6113
6203
  ]);
6114
-
6115
6204
  // ../../packages/aeg-core/src/log/envelope.ts
6205
+ import { createHash as createHash5 } from "node:crypto";
6116
6206
  function isRole(value) {
6117
6207
  return value !== undefined && ROLE_VALUES.includes(value);
6118
6208
  }
@@ -6149,18 +6239,27 @@ function roundFromEnv(round) {
6149
6239
  const n = Number(round);
6150
6240
  return Number.isInteger(n) ? n : undefined;
6151
6241
  }
6242
+ function prFromEnv(pr) {
6243
+ if (pr === undefined || pr === "")
6244
+ return;
6245
+ const n = Number(pr);
6246
+ return Number.isInteger(n) && n > 0 ? n : undefined;
6247
+ }
6152
6248
  function buildHeader(input) {
6153
6249
  const role = isRole(input.env.role) ? input.env.role : "unattributed";
6154
6250
  const round = roundFromEnv(input.env.round);
6251
+ const pr = prFromEnv(input.env.pr);
6155
6252
  const subject = {
6156
6253
  issue: issueFromTask(input.env.task) ?? input.branchIssue ?? null,
6157
6254
  role,
6158
6255
  ...round !== undefined ? { round } : {},
6256
+ ...pr !== undefined ? { pr } : {},
6159
6257
  ...input.subject ?? {}
6160
6258
  };
6259
+ const issue = subject.issue;
6161
6260
  return {
6162
6261
  meta: {
6163
- schema: 2,
6262
+ schema: 3,
6164
6263
  ts: input.now.toISOString(),
6165
6264
  run_id: input.runId,
6166
6265
  seq: input.seq,
@@ -6183,7 +6282,19 @@ function buildHeader(input) {
6183
6282
  ruling_ordinal: input.inputVersions?.rulingOrdinal ?? null,
6184
6283
  policy_digest: input.inputVersions?.policyDigest ?? null
6185
6284
  },
6186
- provenance: provenanceFor(input)
6285
+ provenance: provenanceFor(input),
6286
+ work: {
6287
+ ref: lineageFieldFromEnv(input.env.workRef) ?? (issue === null ? null : String(issue)),
6288
+ repo: input.repo,
6289
+ change: null,
6290
+ revision: null
6291
+ },
6292
+ flow: {
6293
+ id: lineageFieldFromEnv(input.env.flow) ?? "vinaya",
6294
+ version: lineageFieldFromEnv(input.env.flowVersion)
6295
+ },
6296
+ runtime: lineageFieldFromEnv(input.env.runtime),
6297
+ source: lineageFieldFromEnv(input.env.source)
6187
6298
  },
6188
6299
  subject
6189
6300
  };
@@ -6226,7 +6337,7 @@ function redact(value, home) {
6226
6337
  return value;
6227
6338
  }
6228
6339
  // ../../packages/aeg-core/src/log/store.ts
6229
- var KNOWN_SCHEMA_VERSIONS = [1, 2];
6340
+ var KNOWN_SCHEMA_VERSIONS = [1, 2, 3];
6230
6341
  function metaOf(obj) {
6231
6342
  if (obj === null || typeof obj !== "object")
6232
6343
  return null;
@@ -6292,7 +6403,7 @@ function classifyStoredLine(raw, home) {
6292
6403
  return { status: "invalid", identity: null, raw, reason: "valid event with no derivable identity" };
6293
6404
  }
6294
6405
  const redacted = redact(event, home);
6295
- const provenance = version === 2 ? event.meta.provenance ?? null : null;
6406
+ const provenance = version >= 2 ? event.meta.provenance ?? null : null;
6296
6407
  return {
6297
6408
  status: "ok",
6298
6409
  identity,
@@ -6305,138 +6416,143 @@ function classifyStoredLine(raw, home) {
6305
6416
  };
6306
6417
  }
6307
6418
  // ../../packages/aeg-core/src/control-store/records.ts
6308
- import { z as z3 } from "zod";
6309
- var isoTimestamp = z3.string().min(1);
6310
- var taskId = z3.number().int().positive();
6311
- var epochNumber = z3.number().int().nonnegative();
6312
- var RunRecordSchema = z3.object({
6313
- version: z3.literal(1),
6314
- kind: z3.literal("run"),
6419
+ import { z as z4 } from "zod";
6420
+ var isoTimestamp = z4.string().min(1);
6421
+ var taskId = z4.number().int().positive();
6422
+ var epochNumber = z4.number().int().nonnegative();
6423
+ var RunRecordSchema = z4.object({
6424
+ version: z4.literal(1),
6425
+ kind: z4.literal("run"),
6315
6426
  task: taskId,
6316
- runId: z3.string().min(1),
6317
- pid: z3.number().int().positive(),
6318
- host: z3.string().min(1),
6427
+ runId: z4.string().min(1),
6428
+ pid: z4.number().int().positive(),
6429
+ host: z4.string().min(1),
6319
6430
  startedAt: isoTimestamp,
6320
- childStartedAt: z3.string().min(1).nullable().optional(),
6321
- childCommand: z3.string().min(1).nullable().optional()
6431
+ childStartedAt: z4.string().min(1).nullable().optional(),
6432
+ childCommand: z4.string().min(1).nullable().optional()
6322
6433
  }).strict();
6323
- var InputRecordSchema = z3.object({
6324
- version: z3.literal(1),
6325
- kind: z3.literal("input"),
6434
+ var InputRecordSchema = z4.object({
6435
+ version: z4.literal(1),
6436
+ kind: z4.literal("input"),
6326
6437
  task: taskId,
6327
- runId: z3.string().min(1),
6328
- source: z3.union([z3.literal("fresh"), z3.literal("resume")]),
6329
- pr: z3.number().int().positive().nullable(),
6330
- round: z3.number().int().nonnegative(),
6438
+ runId: z4.string().min(1),
6439
+ source: z4.union([z4.literal("fresh"), z4.literal("resume")]),
6440
+ pr: z4.number().int().positive().nullable(),
6441
+ round: z4.number().int().nonnegative(),
6331
6442
  recordedAt: isoTimestamp
6332
6443
  }).strict();
6333
- var OwnershipRecordSchema = z3.object({
6334
- version: z3.literal(1),
6335
- kind: z3.literal("ownership"),
6444
+ var OwnershipRecordSchema = z4.object({
6445
+ version: z4.literal(1),
6446
+ kind: z4.literal("ownership"),
6336
6447
  task: taskId,
6337
6448
  epoch: epochNumber,
6338
- ownerId: z3.string().min(1),
6339
- pid: z3.number().int().positive(),
6340
- host: z3.string().min(1),
6449
+ ownerId: z4.string().min(1),
6450
+ pid: z4.number().int().positive(),
6451
+ host: z4.string().min(1),
6341
6452
  acquiredAt: isoTimestamp
6342
6453
  }).strict();
6343
- var TransitionRecordSchema = z3.object({
6344
- version: z3.literal(1),
6345
- kind: z3.literal("transition"),
6454
+ var TransitionRecordSchema = z4.object({
6455
+ version: z4.literal(1),
6456
+ kind: z4.literal("transition"),
6346
6457
  task: taskId,
6347
6458
  epoch: epochNumber,
6348
- seq: z3.number().int().nonnegative(),
6349
- from: z3.string().min(1),
6350
- to: z3.string().min(1),
6351
- detail: z3.string().optional(),
6459
+ seq: z4.number().int().nonnegative(),
6460
+ from: z4.string().min(1),
6461
+ to: z4.string().min(1),
6462
+ detail: z4.string().optional(),
6352
6463
  at: isoTimestamp
6353
6464
  }).strict();
6354
- var ManifestRecordSchema = z3.object({
6355
- version: z3.literal(1),
6356
- kind: z3.literal("manifest"),
6465
+ var ManifestRecordSchema = z4.object({
6466
+ version: z4.literal(1),
6467
+ kind: z4.literal("manifest"),
6357
6468
  task: taskId,
6358
6469
  round: epochNumber,
6359
- repository: z3.string().min(1),
6360
- pr: z3.number().int().positive(),
6361
- branch: z3.string().min(1),
6362
- baseSha: z3.string().min(1).nullable(),
6363
- headSha: z3.string().min(1),
6364
- briefHash: z3.string().min(1).nullable(),
6365
- objectivesVersion: z3.string().min(1).nullable(),
6470
+ repository: z4.string().min(1),
6471
+ pr: z4.number().int().positive(),
6472
+ branch: z4.string().min(1),
6473
+ baseSha: z4.string().min(1).nullable(),
6474
+ headSha: z4.string().min(1),
6475
+ briefHash: z4.string().min(1).nullable(),
6476
+ objectivesVersion: z4.string().min(1).nullable(),
6366
6477
  rulingOrdinal: epochNumber,
6367
- policyDigest: z3.string().min(1),
6478
+ policyDigest: z4.string().min(1),
6368
6479
  recordedAt: isoTimestamp
6369
6480
  }).strict();
6370
- var roundHeadIdentity = z3.object({ round: z3.number().int().positive(), head: z3.string().min(1) }).strict();
6371
- var LoopBudgetsSchema = z3.object({
6372
- mechanicalRetries: z3.number().int().nonnegative(),
6373
- reviewRounds: z3.number().int().nonnegative(),
6374
- infrastructureRetries: z3.number().int().nonnegative()
6481
+ var roundHeadIdentity = z4.object({ round: z4.number().int().positive(), head: z4.string().min(1) }).strict();
6482
+ var LoopBudgetsSchema = z4.object({
6483
+ mechanicalRetries: z4.number().int().nonnegative(),
6484
+ reviewRounds: z4.number().int().nonnegative(),
6485
+ infrastructureRetries: z4.number().int().nonnegative()
6375
6486
  }).strict();
6376
- var LoopStateRecordSchema = z3.object({
6377
- version: z3.literal(1),
6378
- kind: z3.literal("loop_state"),
6487
+ var LoopStateRecordSchema = z4.object({
6488
+ version: z4.literal(1),
6489
+ kind: z4.literal("loop_state"),
6379
6490
  task: taskId,
6380
- round: z3.number().int().positive(),
6381
- phase: z3.string().min(1),
6382
- pauseReason: z3.string().min(1).nullable(),
6491
+ round: z4.number().int().positive(),
6492
+ phase: z4.string().min(1),
6493
+ pauseReason: z4.string().min(1).nullable(),
6383
6494
  budgets: LoopBudgetsSchema,
6384
6495
  heldResult: roundHeadIdentity.nullable(),
6385
6496
  deliveredFindings: roundHeadIdentity.nullable(),
6386
- repeatMemory: z3.object({
6387
- blockingFindings: z3.array(z3.string()),
6388
- lastFailure: z3.object({ signature: z3.string(), message: z3.string() }).nullable()
6497
+ repeatMemory: z4.object({
6498
+ blockingFindings: z4.array(z4.string()),
6499
+ lastFailure: z4.object({ signature: z4.string(), message: z4.string() }).nullable()
6389
6500
  }).strict().optional(),
6501
+ publicationExpectedBase: z4.string().regex(/^[0-9a-f]{40}$/).nullable().optional(),
6502
+ taskStartedAt: isoTimestamp.optional(),
6503
+ phaseMs: z4.record(z4.string(), z4.number().nonnegative()).optional(),
6390
6504
  recordedAt: isoTimestamp
6391
6505
  }).strict();
6392
- var EffectRecordSchema = z3.object({
6393
- version: z3.literal(1),
6394
- kind: z3.literal("effect"),
6506
+ var EffectRecordSchema = z4.object({
6507
+ version: z4.literal(1),
6508
+ kind: z4.literal("effect"),
6395
6509
  task: taskId,
6396
- key: z3.string().min(1),
6397
- operation: z3.string().min(1),
6398
- target: z3.string().min(1),
6399
- inputVersion: z3.number().int().nonnegative(),
6400
- payloadDigest: z3.string().min(1),
6401
- status: z3.union([z3.literal("started"), z3.literal("verified"), z3.literal("uncertain")]),
6402
- url: z3.string().optional(),
6510
+ key: z4.string().min(1),
6511
+ operation: z4.string().min(1),
6512
+ target: z4.string().min(1),
6513
+ inputVersion: z4.number().int().nonnegative(),
6514
+ payloadDigest: z4.string().min(1),
6515
+ status: z4.union([z4.literal("started"), z4.literal("verified"), z4.literal("uncertain")]),
6516
+ url: z4.string().optional(),
6403
6517
  recordedAt: isoTimestamp
6404
6518
  }).strict();
6405
- var EscalationRecordSchema = z3.object({
6406
- version: z3.literal(1),
6407
- kind: z3.literal("escalation"),
6519
+ var EscalationRecordSchema = z4.object({
6520
+ version: z4.literal(1),
6521
+ kind: z4.literal("escalation"),
6408
6522
  task: taskId,
6409
- escalationId: z3.string().min(1),
6523
+ escalationId: z4.string().min(1),
6410
6524
  round: epochNumber,
6411
- head: z3.string().min(1),
6412
- branch: z3.string().min(1),
6413
- pr: z3.number().int().positive().nullable(),
6414
- runId: z3.string().min(1),
6415
- pid: z3.number().int().positive(),
6416
- host: z3.string().min(1),
6417
- agent: z3.string().min(1).optional(),
6418
- reason: z3.string().min(1),
6419
- detail: z3.string().optional(),
6420
- evidence: z3.string().optional(),
6421
- attemptedRecovery: z3.string().min(1),
6422
- requestedDecision: z3.string().min(1),
6423
- recipient: z3.string().min(1),
6424
- briefHash: z3.string().min(1).nullable(),
6425
- objectivesVersion: z3.string().min(1).nullable(),
6525
+ head: z4.string().min(1),
6526
+ branch: z4.string().min(1),
6527
+ pr: z4.number().int().positive().nullable(),
6528
+ runId: z4.string().min(1),
6529
+ pid: z4.number().int().positive(),
6530
+ host: z4.string().min(1),
6531
+ agent: z4.string().min(1).optional(),
6532
+ reason: z4.string().min(1),
6533
+ detail: z4.string().optional(),
6534
+ evidence: z4.string().optional(),
6535
+ attemptedRecovery: z4.string().min(1),
6536
+ requestedDecision: z4.string().min(1),
6537
+ recipient: z4.string().min(1),
6538
+ briefHash: z4.string().min(1).nullable(),
6539
+ objectivesVersion: z4.string().min(1).nullable(),
6426
6540
  rulingOrdinal: epochNumber,
6427
- policyDigest: z3.string().min(1),
6541
+ policyDigest: z4.string().min(1),
6428
6542
  recordedAt: isoTimestamp
6429
6543
  }).strict();
6430
- var ResolutionRecordSchema = z3.object({
6431
- version: z3.literal(1),
6432
- kind: z3.literal("resolution"),
6544
+ var ResolutionRecordSchema = z4.object({
6545
+ version: z4.literal(1),
6546
+ kind: z4.literal("resolution"),
6433
6547
  task: taskId,
6434
- escalationId: z3.string().min(1),
6435
- decision: z3.union([z3.literal("resume"), z3.literal("cancel")]),
6436
- authenticatedBy: z3.string().min(1),
6437
- authenticatedFrom: z3.string().min(1),
6548
+ escalationId: z4.string().min(1),
6549
+ decision: z4.union([z4.literal("resume"), z4.literal("cancel")]),
6550
+ authenticatedBy: z4.string().min(1),
6551
+ authenticatedFrom: z4.string().min(1),
6438
6552
  consumedAt: isoTimestamp
6439
6553
  }).strict();
6554
+ // ../../packages/aeg-core/src/control-store/local.ts
6555
+ var CONTROL_AREA_DIRNAME = "control";
6440
6556
  // src/checks/contract.ts
6441
6557
  var CHECK_SCHEMA_VERSION = 1;
6442
6558
  function emitCheckError(error) {
@@ -6448,56 +6564,34 @@ function emitCheckError(error) {
6448
6564
  import { dirname as dirname2, isAbsolute as isAbsolute2, join as join2, resolve as resolve2, sep } from "node:path";
6449
6565
 
6450
6566
  // src/lib/config.ts
6451
- import { execFile as execFile4, execFileSync as execFileSync3 } from "node:child_process";
6567
+ import { execFile as execFile4, execFileSync as execFileSync2 } from "node:child_process";
6452
6568
  import { promisify as promisify4 } from "node:util";
6453
6569
  import { existsSync, mkdirSync, readFileSync as readFileSync2, realpathSync, writeFileSync } from "node:fs";
6454
6570
  import { homedir } from "node:os";
6455
6571
  import { dirname, isAbsolute, join, resolve } from "node:path";
6456
- import { z as z4 } from "zod";
6572
+ import { z as z5 } from "zod";
6457
6573
 
6458
6574
  // src/lib/agent-vendors.ts
6459
6575
  var AGENT_VENDORS = ["skills", "claude", "gemini"];
6460
6576
 
6461
- // src/lib/worker-boundary.ts
6462
- import { execFileSync as execFileSync2 } from "node:child_process";
6463
- var LOG_HEADER_KEYCHAIN_SERVICE = "Vinaya Log";
6464
- var logHeaderKeychainCache = new Map;
6465
- function readRealLogHeaderKeychainCredential(variable) {
6466
- if (process.platform !== "darwin")
6467
- return null;
6468
- try {
6469
- 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$/, "");
6470
- } catch {
6471
- return null;
6472
- }
6473
- }
6474
- function readLogHeaderKeychainCredential(variable) {
6475
- const cached = logHeaderKeychainCache.get(variable);
6476
- if (cached !== undefined)
6477
- return cached;
6478
- const value = readRealLogHeaderKeychainCredential(variable);
6479
- logHeaderKeychainCache.set(variable, value);
6480
- return value;
6481
- }
6482
-
6483
6577
  // src/lib/config.ts
6484
- var EnvEntrySchema = z4.union([
6485
- z4.literal(true),
6486
- z4.object({ optional: z4.literal(true) }),
6487
- z4.object({ anyOf: z4.array(z4.string()).min(2) }),
6488
- z4.string()
6578
+ var EnvEntrySchema = z5.union([
6579
+ z5.literal(true),
6580
+ z5.object({ optional: z5.literal(true) }),
6581
+ z5.object({ anyOf: z5.array(z5.string()).min(2) }),
6582
+ z5.string()
6489
6583
  ]);
6490
- var CheckEntrySchema = z4.object({
6491
- run: z4.string(),
6492
- scope: z4.enum(["diff", "full"]),
6493
- include: z4.array(z4.string()).optional(),
6494
- args: z4.array(z4.string()).optional(),
6495
- timeoutMs: z4.number().optional(),
6496
- env: z4.record(z4.string(), EnvEntrySchema).optional(),
6497
- requiresOpenPr: z4.boolean().optional(),
6498
- ownWorkflow: z4.boolean().optional(),
6499
- principalOwed: z4.literal(true).optional(),
6500
- validates: z4.enum(["body", "issue"]).optional()
6584
+ var CheckEntrySchema = z5.object({
6585
+ run: z5.string(),
6586
+ scope: z5.enum(["diff", "full"]),
6587
+ include: z5.array(z5.string()).optional(),
6588
+ args: z5.array(z5.string()).optional(),
6589
+ timeoutMs: z5.number().optional(),
6590
+ env: z5.record(z5.string(), EnvEntrySchema).optional(),
6591
+ requiresOpenPr: z5.boolean().optional(),
6592
+ ownWorkflow: z5.boolean().optional(),
6593
+ principalOwed: z5.literal(true).optional(),
6594
+ validates: z5.enum(["body", "issue"]).optional()
6501
6595
  }).superRefine((entry, ctx) => {
6502
6596
  if (!entry.env)
6503
6597
  return;
@@ -6507,22 +6601,22 @@ var CheckEntrySchema = z4.object({
6507
6601
  const members = value.anyOf;
6508
6602
  if (new Set(members).size !== members.length) {
6509
6603
  ctx.addIssue({
6510
- code: z4.ZodIssueCode.custom,
6604
+ code: z5.ZodIssueCode.custom,
6511
6605
  message: `env.${key}.anyOf has duplicate members`,
6512
6606
  path: ["env", key, "anyOf"]
6513
6607
  });
6514
6608
  }
6515
6609
  if (!members.includes(key)) {
6516
6610
  ctx.addIssue({
6517
- code: z4.ZodIssueCode.custom,
6611
+ code: z5.ZodIssueCode.custom,
6518
6612
  message: `env.${key}.anyOf must include "${key}" itself as a member`,
6519
6613
  path: ["env", key, "anyOf"]
6520
6614
  });
6521
6615
  }
6522
6616
  }
6523
6617
  });
6524
- var RoleEntrySchema = z4.object({
6525
- contract: z4.string().refine((p) => p.includes("/"), {
6618
+ var RoleEntrySchema = z5.object({
6619
+ contract: z5.string().refine((p) => p.includes("/"), {
6526
6620
  message: 'must be a path (contain at least one "/"), not a bare filename'
6527
6621
  })
6528
6622
  });
@@ -6546,17 +6640,17 @@ var BRIEF_BUILTINS = [
6546
6640
  "briefSections",
6547
6641
  "milestoneShape"
6548
6642
  ];
6549
- var BriefSectionSchema = z4.union([
6550
- z4.object({ builtin: z4.enum(BRIEF_BUILTINS) }),
6551
- z4.object({ heading: z4.string().min(1), name: z4.string().optional() }),
6552
- z4.object({ field: z4.string().min(1), name: z4.string().optional() }),
6553
- z4.object({ phrase: z4.string().min(1), name: z4.string().optional() })
6643
+ var BriefSectionSchema = z5.union([
6644
+ z5.object({ builtin: z5.enum(BRIEF_BUILTINS) }),
6645
+ z5.object({ heading: z5.string().min(1), name: z5.string().optional() }),
6646
+ z5.object({ field: z5.string().min(1), name: z5.string().optional() }),
6647
+ z5.object({ phrase: z5.string().min(1), name: z5.string().optional() })
6554
6648
  ]);
6555
- var BriefSchemaSchema = z4.object({
6556
- pr: z4.object({ sections: z4.array(BriefSectionSchema) }).optional(),
6557
- issue: z4.object({ sections: z4.array(BriefSectionSchema) }).optional(),
6558
- milestone: z4.object({ sections: z4.array(BriefSectionSchema) }).optional(),
6559
- ack: z4.array(z4.enum(BRIEF_BUILTINS)).optional()
6649
+ var BriefSchemaSchema = z5.object({
6650
+ pr: z5.object({ sections: z5.array(BriefSectionSchema) }).optional(),
6651
+ issue: z5.object({ sections: z5.array(BriefSectionSchema) }).optional(),
6652
+ milestone: z5.object({ sections: z5.array(BriefSectionSchema) }).optional(),
6653
+ ack: z5.array(z5.enum(BRIEF_BUILTINS)).optional()
6560
6654
  });
6561
6655
  function isSafeRepoRelPath(p) {
6562
6656
  if (p.length === 0)
@@ -6565,7 +6659,7 @@ function isSafeRepoRelPath(p) {
6565
6659
  return false;
6566
6660
  return p.split(/[\\/]/).every((seg) => seg !== ".." && seg !== "");
6567
6661
  }
6568
- var SafeRepoRelPath = z4.string().refine(isSafeRepoRelPath, {
6662
+ var SafeRepoRelPath = z5.string().refine(isSafeRepoRelPath, {
6569
6663
  message: "must be a repo-root-relative path with no `..` segment or absolute root"
6570
6664
  });
6571
6665
  var CANONICAL_HOOK_BLOCK_PREFIXES = [".git/", ".husky/", ".vinaya/hooks/", ".claude/hooks/"];
@@ -6575,22 +6669,22 @@ function isCanonicalHookBlockPath(p) {
6575
6669
  var ManagedHookBlockPath = SafeRepoRelPath.refine(isCanonicalHookBlockPath, {
6576
6670
  message: `must start with one of ${CANONICAL_HOOK_BLOCK_PREFIXES.join(", ")} (byte-exact, case-sensitive)`
6577
6671
  });
6578
- var ManagedBlockRecordSchema = z4.object({
6672
+ var ManagedBlockRecordSchema = z5.object({
6579
6673
  path: ManagedHookBlockPath,
6580
- marker: z4.string(),
6581
- comment: z4.enum(["hash", "html"])
6674
+ marker: z5.string(),
6675
+ comment: z5.enum(["hash", "html"])
6582
6676
  });
6583
- var ManagedManifestSchema = z4.object({
6584
- version: z4.number().int().positive(),
6585
- files: z4.array(SafeRepoRelPath),
6586
- blocks: z4.array(ManagedBlockRecordSchema),
6587
- labels: z4.array(z4.string()),
6588
- agents: z4.array(z4.enum(AGENT_VENDORS)).optional()
6677
+ var ManagedManifestSchema = z5.object({
6678
+ version: z5.number().int().positive(),
6679
+ files: z5.array(SafeRepoRelPath),
6680
+ blocks: z5.array(ManagedBlockRecordSchema),
6681
+ labels: z5.array(z5.string()),
6682
+ agents: z5.array(z5.enum(AGENT_VENDORS)).optional()
6589
6683
  });
6590
- var ProjectEntrySchema = z4.object({
6591
- name: z4.string().min(1),
6592
- description: z4.string().min(1).optional(),
6593
- path: z4.string().min(1).optional()
6684
+ var ProjectEntrySchema = z5.object({
6685
+ name: z5.string().min(1),
6686
+ description: z5.string().min(1).optional(),
6687
+ path: z5.string().min(1).optional()
6594
6688
  });
6595
6689
  function parseTokensCollectDeclaration(value) {
6596
6690
  const m = value.trim().match(/^(\S+)\s+(\S+)$/);
@@ -6601,90 +6695,97 @@ function parseTokensCollectDeclaration(value) {
6601
6695
  return null;
6602
6696
  return { interpreter, script };
6603
6697
  }
6604
- var VinayaConfigSchema = z4.object({
6605
- rings: z4.object({
6606
- ring1_forgeWriteInterception: z4.boolean(),
6607
- ring2_asyncAudits: z4.boolean()
6698
+ var VinayaConfigSchema = z5.object({
6699
+ rings: z5.object({
6700
+ ring1_forgeWriteInterception: z5.boolean(),
6701
+ ring2_asyncAudits: z5.boolean()
6608
6702
  }).optional(),
6609
- checks: z4.record(z4.string(), CheckEntrySchema).optional(),
6610
- roles: z4.record(z4.string(), RoleEntrySchema).optional(),
6703
+ checks: z5.record(z5.string(), CheckEntrySchema).optional(),
6704
+ roles: z5.record(z5.string(), RoleEntrySchema).optional(),
6611
6705
  briefSchema: BriefSchemaSchema.optional(),
6612
6706
  managed: ManagedManifestSchema.optional(),
6613
- principals: z4.array(z4.string()).min(1).optional(),
6614
- releaseActor: z4.string().min(1).optional(),
6615
- ci: z4.object({ setup: z4.string().min(1) }).optional(),
6616
- tokens: z4.object({
6617
- collect: z4.string().min(1).refine((v) => parseTokensCollectDeclaration(v) !== null, {
6707
+ principals: z5.array(z5.string()).min(1).optional(),
6708
+ releaseActor: z5.string().min(1).optional(),
6709
+ ci: z5.object({ setup: z5.string().min(1) }).optional(),
6710
+ tokens: z5.object({
6711
+ collect: z5.string().min(1).refine((v) => parseTokensCollectDeclaration(v) !== null, {
6618
6712
  message: 'tokens.collect must be exactly "<interpreter> <repo-relative-script-path>" — two whitespace-separated tokens, no flags, no shell syntax, no quoting'
6619
6713
  })
6620
6714
  }).optional(),
6621
- blastRadius: z4.object({ extraDomains: z4.array(z4.string()).optional() }).optional(),
6622
- proseGates: z4.object({
6623
- doctrineRoot: z4.string().min(1).optional(),
6624
- readerFacingPrefix: z4.string().min(1).optional(),
6625
- readerFacingSuffix: z4.string().min(1).optional(),
6626
- legacySlugDir: z4.string().min(1).optional(),
6627
- sourceComments: z4.object({
6628
- globs: z4.array(z4.string().min(1)).optional(),
6629
- allowlist: z4.array(z4.string().min(1)).optional(),
6630
- severity: z4.enum(["warning", "error"]).optional()
6715
+ blastRadius: z5.object({ extraDomains: z5.array(z5.string()).optional() }).optional(),
6716
+ proseGates: z5.object({
6717
+ doctrineRoot: z5.string().min(1).optional(),
6718
+ readerFacingPrefix: z5.string().min(1).optional(),
6719
+ readerFacingSuffix: z5.string().min(1).optional(),
6720
+ legacySlugDir: z5.string().min(1).optional(),
6721
+ sourceComments: z5.object({
6722
+ globs: z5.array(z5.string().min(1)).optional(),
6723
+ allowlist: z5.array(z5.string().min(1)).optional(),
6724
+ severity: z5.enum(["warning", "error"]).optional()
6631
6725
  }).optional(),
6632
- specGrandfather: z4.array(z4.string().min(1)).optional(),
6633
- specPaths: z4.array(z4.string().min(1).refine((entry) => !entry.startsWith("/") && !/^[A-Za-z]:/.test(entry), {
6726
+ specGrandfather: z5.union([z5.array(z5.string().min(1)), z5.record(z5.string().min(1), z5.number().int().min(0))]).optional(),
6727
+ specPaths: z5.array(z5.string().min(1).refine((entry) => !entry.startsWith("/") && !/^[A-Za-z]:/.test(entry), {
6634
6728
  message: "must be a repository-relative path, not an absolute one"
6635
6729
  }).refine((entry) => !entry.split(/[\\/]/).includes(".."), {
6636
6730
  message: "must stay inside the repository — no `..` segment"
6637
6731
  })).optional()
6638
6732
  }).optional(),
6639
- projects: z4.array(ProjectEntrySchema).optional(),
6640
- dispatch: z4.object({
6641
- timeoutMs: z4.number().int().positive().optional(),
6642
- killGraceMs: z4.number().int().positive().optional(),
6643
- agent: z4.enum(["claude", "codex", "gemini"]).optional(),
6644
- requireWorkerIsolation: z4.boolean().optional()
6733
+ projects: z5.array(ProjectEntrySchema).optional(),
6734
+ dispatch: z5.object({
6735
+ timeoutMs: z5.number().int().positive().optional(),
6736
+ killGraceMs: z5.number().int().positive().optional(),
6737
+ agent: z5.enum(["claude", "codex", "gemini"]).optional()
6738
+ }).optional(),
6739
+ reviewPolicy: z5.object({
6740
+ codeReviewThreshold: z5.string().min(1).optional(),
6741
+ securityThreshold: z5.string().min(1).optional(),
6742
+ maxRounds: z5.number().optional(),
6743
+ maxTaskMinutes: z5.number().optional()
6645
6744
  }).optional(),
6646
- reviewPolicy: z4.object({
6647
- codeReviewThreshold: z4.string().min(1).optional(),
6648
- securityThreshold: z4.string().min(1).optional(),
6649
- maxRounds: z4.number().optional()
6745
+ securityScan: z5.object({
6746
+ command: z5.array(z5.string().min(1)).min(1)
6650
6747
  }).optional(),
6651
- gateCutovers: z4.object({
6652
- objectivesSinceIssue: z4.number().int().nonnegative().optional(),
6653
- briefSectionsSinceIssue: z4.number().int().nonnegative().optional(),
6654
- documentationSinceIssue: z4.number().int().nonnegative().optional(),
6655
- briefRulesSincePr: z4.number().int().nonnegative().optional(),
6656
- agentBoxesRefusedSincePr: z4.number().int().nonnegative().optional()
6748
+ gateCutovers: z5.object({
6749
+ objectivesSinceIssue: z5.number().int().nonnegative().optional(),
6750
+ briefSectionsSinceIssue: z5.number().int().nonnegative().optional(),
6751
+ documentationSinceIssue: z5.number().int().nonnegative().optional(),
6752
+ briefRulesSincePr: z5.number().int().nonnegative().optional(),
6753
+ agentBoxesRefusedSincePr: z5.number().int().nonnegative().optional()
6657
6754
  }).optional(),
6658
- planning: z4.object({
6659
- collisionThreshold: z4.number().int().nonnegative().optional()
6755
+ planning: z5.object({
6756
+ collisionThreshold: z5.number().int().nonnegative().optional()
6660
6757
  }).optional(),
6661
- prePush: z4.object({
6662
- alwaysRun: z4.array(z4.string()).optional()
6758
+ prePush: z5.object({
6759
+ alwaysRun: z5.array(z5.string()).optional()
6663
6760
  }).optional(),
6664
- report: z4.object({
6665
- commandTimeoutMs: z4.number().int().positive().optional()
6761
+ report: z5.object({
6762
+ commandTimeoutMs: z5.number().int().positive().optional()
6666
6763
  }).superRefine((report, ctx) => {
6667
6764
  const commandTimeoutMs = report.commandTimeoutMs;
6668
6765
  if (commandTimeoutMs !== undefined && commandTimeoutMs > MAX_REPORT_COMMAND_TIMEOUT_MS) {
6669
6766
  ctx.addIssue({
6670
- code: z4.ZodIssueCode.custom,
6767
+ code: z5.ZodIssueCode.custom,
6671
6768
  path: ["commandTimeoutMs"],
6672
6769
  message: "must be at most 3600000 (1 hour)"
6673
6770
  });
6674
6771
  }
6675
6772
  }).optional(),
6676
- logPublish: z4.unknown().refine((v) => v === undefined, {
6773
+ logPublish: z5.unknown().refine((v) => v === undefined, {
6677
6774
  message: "logPublish is removed — telemetry is never posted to a tracker or a code host; configure `logs` instead (a folder or a server destination)"
6678
6775
  }),
6679
- runtimeDir: z4.string().min(1).refine((v) => isAbsolute(v), { message: "runtimeDir: must be an absolute path" }).optional(),
6680
- logs: z4.object({
6681
- folder: z4.string().min(1).refine((v) => isAbsolute(v), { message: "logs.folder: must be an absolute path" }).optional(),
6682
- url: z4.string().url().optional(),
6683
- headers: z4.record(z4.string()).optional()
6776
+ runtimeDir: z5.string().min(1).refine((v) => isAbsolute(v), { message: "runtimeDir: must be an absolute path" }).optional(),
6777
+ logs: z5.object({
6778
+ folder: z5.string().min(1).refine((v) => isAbsolute(v), { message: "logs.folder: must be an absolute path" }).optional(),
6779
+ url: z5.string().url().optional(),
6780
+ headers: z5.record(z5.string()).optional(),
6781
+ readHeaders: z5.record(z5.string()).optional(),
6782
+ events: CustomEventDeclarationsSchema.optional()
6684
6783
  }).refine((v) => [v.folder, v.url].filter((x) => x !== undefined).length <= 1, {
6685
6784
  message: "logs: set at most one of folder/url"
6686
6785
  }).refine((v) => v.headers === undefined || v.url !== undefined, {
6687
6786
  message: "logs: headers requires url"
6787
+ }).refine((v) => v.readHeaders === undefined || v.url !== undefined, {
6788
+ message: "logs: readHeaders requires url"
6688
6789
  }).optional()
6689
6790
  });
6690
6791
  var GLOBAL_VINAYA_HOME = join(homedir(), ".vinaya");
@@ -6789,10 +6890,15 @@ function resolveReviewPolicy(config) {
6789
6890
  if (!Number.isInteger(maxRounds) || maxRounds < 1) {
6790
6891
  throw new Error(`vinaya.config.json: reviewPolicy.maxRounds "${maxRounds}" is not a positive integer — fix the config, this never falls back to a default.`);
6791
6892
  }
6893
+ const maxTaskMinutes = raw.maxTaskMinutes ?? DEFAULT_REVIEW_POLICY.maxTaskMinutes;
6894
+ if (!Number.isInteger(maxTaskMinutes) || maxTaskMinutes < 0) {
6895
+ 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.`);
6896
+ }
6792
6897
  return {
6793
6898
  codeReviewThreshold,
6794
6899
  securityThreshold,
6795
- maxRounds
6900
+ maxRounds,
6901
+ maxTaskMinutes
6796
6902
  };
6797
6903
  }
6798
6904
  function resolveGateCutovers(config) {
@@ -6832,17 +6938,12 @@ function resolveTrustAnchorLogsDestination(local, trustAnchorConfig) {
6832
6938
  return "url" in anchored && anchored.url === local.url ? anchored : null;
6833
6939
  return "folder" in anchored && anchored.folder === local.folder ? anchored : null;
6834
6940
  }
6835
- function resolveLogsHeaderValues(headers, env, readKeychain = readLogHeaderKeychainCredential) {
6941
+ function resolveLogsHeaderValues(headers, env) {
6836
6942
  if (!headers)
6837
6943
  return;
6838
6944
  const resolved = {};
6839
6945
  for (const [key, value] of Object.entries(headers)) {
6840
- resolved[key] = value.replace(/\$\{([A-Za-z_][A-Za-z0-9_]*)\}/g, (_match, name) => {
6841
- const fromEnv = env[name];
6842
- if (fromEnv !== undefined)
6843
- return fromEnv;
6844
- return readKeychain(name) ?? "";
6845
- });
6946
+ resolved[key] = value.replace(/\$\{([A-Za-z_][A-Za-z0-9_]*)\}/g, (_match, name) => env[name] ?? "");
6846
6947
  }
6847
6948
  return resolved;
6848
6949
  }
@@ -6851,7 +6952,7 @@ function trustAnchorRepo() {
6851
6952
  if (fromRunner)
6852
6953
  return fromRunner;
6853
6954
  try {
6854
- const url = execFileSync3("git", ["remote", "get-url", "origin"], {
6955
+ const url = execFileSync2("git", ["remote", "get-url", "origin"], {
6855
6956
  encoding: "utf-8",
6856
6957
  stdio: ["ignore", "pipe", "pipe"]
6857
6958
  });
@@ -6898,7 +6999,7 @@ function resolveCiTrustAnchorProbeRef(env = process.env) {
6898
6999
  return ref;
6899
7000
  }
6900
7001
  function readTrustAnchorConfigAtRef(ref) {
6901
- const raw = execFileSync3("git", ["show", `${ref}:${LOCAL_CONFIG_FILENAME}`], {
7002
+ const raw = execFileSync2("git", ["show", `${ref}:${LOCAL_CONFIG_FILENAME}`], {
6902
7003
  encoding: "utf-8",
6903
7004
  stdio: ["ignore", "pipe", "pipe"],
6904
7005
  timeout: 1e4
@@ -6912,7 +7013,7 @@ function ghFetchTrustAnchorConfig() {
6912
7013
  const repo = trustAnchorRepo();
6913
7014
  if (!repo)
6914
7015
  throw new Error("could not resolve repo identity for the trust-anchor read");
6915
- return execFileSync3("gh", ["api", `repos/${repo}/contents/${LOCAL_CONFIG_FILENAME}`, "--jq", ".content"], {
7016
+ return execFileSync2("gh", ["api", `repos/${repo}/contents/${LOCAL_CONFIG_FILENAME}`, "--jq", ".content"], {
6916
7017
  encoding: "utf-8",
6917
7018
  stdio: ["ignore", "pipe", "pipe"]
6918
7019
  });