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