@attalabs/vinaya 0.35.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 (246) 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 +23 -8
  13. package/aeg-root/roles/planner.md +2 -0
  14. package/aeg-root/roles/principal.md +6 -1
  15. package/aeg-root/roles/reviewer.md +11 -3
  16. package/aeg-root/roles/security.md +19 -9
  17. package/aeg-root/roles/tranche-archivist.md +14 -2
  18. package/aeg-root/state-machine.md +11 -10
  19. package/aeg-root/templates/brief-template.md +10 -4
  20. package/aeg-root/templates/pr-report-template.md +1 -9
  21. package/aeg-root/tranche-model.md +4 -4
  22. package/dist/checks/bin/check-body-bare-digits.js +2081 -1883
  23. package/dist/checks/bin/check-branch-topology.js +1376 -1139
  24. package/dist/checks/bin/check-brief-shape.js +2081 -1883
  25. package/dist/checks/bin/check-changeset-coverage.js +2564 -2025
  26. package/dist/checks/bin/check-closes-n.js +1376 -1139
  27. package/dist/checks/bin/check-coherence.js +1480 -1228
  28. package/dist/checks/bin/check-dead-branch-push.js +1339 -1156
  29. package/dist/checks/bin/check-dispatch-readiness.js +1480 -1228
  30. package/dist/checks/bin/check-doc-coverage-push.js +2563 -2024
  31. package/dist/checks/bin/check-doc-coverage.js +2565 -2026
  32. package/dist/checks/bin/check-doctrine-no-procedures.js +2081 -1883
  33. package/dist/checks/bin/check-doctrine-portability.js +2563 -2024
  34. package/dist/checks/bin/check-evidence-fresh.js +1906 -1536
  35. package/dist/checks/bin/check-exec-bits.js +2136 -1597
  36. package/dist/checks/bin/check-first-push-dispatch.js +1480 -1228
  37. package/dist/checks/bin/check-issue-assignment.js +1376 -1139
  38. package/dist/checks/bin/check-issue-milestone-attach.js +1339 -1156
  39. package/dist/checks/bin/check-issue-objectives-numbering.js +2081 -1883
  40. package/dist/checks/bin/check-issue-parts-coverage.js +1339 -1156
  41. package/dist/checks/bin/check-issue-surface-globs.js +1488 -1227
  42. package/dist/checks/bin/check-issue-title-grammar.js +1339 -1156
  43. package/dist/checks/bin/check-issue-tranche-label.js +1339 -1156
  44. package/dist/checks/bin/check-main-branch-refusal.js +1342 -1159
  45. package/dist/checks/bin/check-no-disk-state.js +1342 -1159
  46. package/dist/checks/bin/check-pr-premise-reassert.js +2081 -1883
  47. package/dist/checks/bin/check-pr-report-density.js +1342 -1159
  48. package/dist/checks/bin/check-principal-test-plan-wait.js +1342 -1159
  49. package/dist/checks/bin/check-quoted-command.js +4063 -3526
  50. package/dist/checks/bin/check-reader-resolvable-prose.js +4082 -3533
  51. package/dist/checks/bin/check-registry-gates.js +1363 -1167
  52. package/dist/checks/bin/check-retired-vocabulary.js +4057 -3520
  53. package/dist/checks/bin/check-review-gate.js +2081 -1883
  54. package/dist/checks/bin/check-single-plan-pr.js +1339 -1156
  55. package/dist/checks/bin/check-surface-scope.js +1376 -1139
  56. package/dist/checks/bin/check-test-plan.js +1339 -1156
  57. package/dist/checks/bin/check-token-collection-wired.js +1342 -1159
  58. package/dist/checks/bin/check-token-report.js +1409 -1342
  59. package/dist/checks/bin/check-workspace-escape.js +2562 -2023
  60. package/dist/index.js +14171 -6490
  61. package/dist/lib/pre-push-cache-test-run.js +1044 -641
  62. package/dist/lib/pre-push-select-tests.js +641 -444
  63. package/package.json +2 -2
  64. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/brief-render.ts +38 -0
  65. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/control-store/records.ts +19 -0
  66. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/assess-round.ts +257 -10
  67. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/fakes.ts +7 -2
  68. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/index.ts +2 -0
  69. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/render-summary.ts +69 -11
  70. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/types.ts +139 -2
  71. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/doc-claim.ts +32 -6
  72. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/index.ts +27 -1
  73. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/issue-validation.ts +757 -0
  74. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/schema.ts +8 -1
  75. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/review-gate.ts +52 -4
  76. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/review-policy.ts +163 -21
  77. package/studio-standalone/apps/vinaya-studio/web/.next/BUILD_ID +1 -1
  78. package/studio-standalone/apps/vinaya-studio/web/.next/app-path-routes-manifest.json +0 -1
  79. package/studio-standalone/apps/vinaya-studio/web/.next/build-manifest.json +3 -3
  80. package/studio-standalone/apps/vinaya-studio/web/.next/prerender-manifest.json +3 -3
  81. package/studio-standalone/apps/vinaya-studio/web/.next/required-server-files.json +0 -5
  82. package/studio-standalone/apps/vinaya-studio/web/.next/routes-manifest.json +0 -6
  83. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error/page.js +1 -1
  84. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error/page.js.nft.json +1 -1
  85. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.html +1 -1
  86. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.rsc +1 -1
  87. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  88. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  89. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  90. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  91. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  92. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_not-found/page/server-reference-manifest.json +2 -2
  93. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_not-found/page.js +1 -1
  94. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_not-found/page.js.nft.json +1 -1
  95. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  96. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/page/server-reference-manifest.json +2 -2
  97. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/page.js +1 -1
  98. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/page.js.nft.json +1 -1
  99. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/page_client-reference-manifest.js +1 -1
  100. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/backlog/page/server-reference-manifest.json +2 -2
  101. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/backlog/page.js +3 -3
  102. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/backlog/page.js.nft.json +1 -1
  103. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/backlog/page_client-reference-manifest.js +1 -1
  104. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/page/server-reference-manifest.json +2 -2
  105. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/page.js +3 -3
  106. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/page.js.nft.json +1 -1
  107. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/page_client-reference-manifest.js +1 -1
  108. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/page/server-reference-manifest.json +2 -2
  109. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/page.js +3 -3
  110. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/page.js.nft.json +1 -1
  111. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/page_client-reference-manifest.js +1 -1
  112. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/page/server-reference-manifest.json +3 -3
  113. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/page.js +5 -5
  114. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/page.js.nft.json +1 -1
  115. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/page_client-reference-manifest.js +1 -1
  116. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/tasks/[taskId]/page/server-reference-manifest.json +2 -2
  117. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/tasks/[taskId]/page.js +3 -3
  118. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/tasks/[taskId]/page.js.nft.json +1 -1
  119. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/tasks/[taskId]/page_client-reference-manifest.js +1 -1
  120. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/page/server-reference-manifest.json +2 -2
  121. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/page.js +3 -3
  122. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/page.js.nft.json +1 -1
  123. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/page_client-reference-manifest.js +1 -1
  124. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/tranches/page/server-reference-manifest.json +2 -2
  125. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/tranches/page.js +3 -3
  126. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/tranches/page.js.nft.json +1 -1
  127. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/tranches/page_client-reference-manifest.js +1 -1
  128. package/studio-standalone/apps/vinaya-studio/web/.next/server/app-paths-manifest.json +0 -1
  129. 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
  130. 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
  131. 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
  132. 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
  133. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/{_15gdg48._.js → [root-of-the-server]__04adkz-._.js} +3 -3
  134. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__05zwn98._.js +14 -0
  135. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__08e39jo._.js +3 -0
  136. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__0ls23oh._.js +1 -1
  137. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__10riywf._.js +3 -0
  138. 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
  139. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/{[root-of-the-server]__0zc_0gx._.js → [root-of-the-server]__14ui9sz._.js} +2 -2
  140. 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
  141. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__1f4bb3_._.js +3 -0
  142. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__1gjqmhq._.js +1 -1
  143. 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
  144. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__1ng2x88._.js +3 -0
  145. 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
  146. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__1snpgaw._.js +56 -0
  147. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__1wc4-ip._.js +2 -2
  148. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_06h3wbl._.js +3 -0
  149. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_08onyya._.js +1 -1
  150. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_096f46i._.js +1 -1
  151. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0af2one._.js +1 -1
  152. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0e5tkdd._.js +1 -1
  153. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0gs4gvl._.js +3 -0
  154. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0kf2g72._.js +1 -1
  155. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0zf4d27._.js +1 -1
  156. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_1-wo68i._.js +1 -1
  157. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_121lrn5._.js +3 -0
  158. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_1achbh9._.js +1 -1
  159. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_1o4v6lb._.js +3 -0
  160. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_1q7h5mz._.js +1 -1
  161. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_1ztd4i3._.js +3 -0
  162. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_209-ugd._.js +3 -0
  163. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_214d71c._.js +3 -0
  164. 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
  165. 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
  166. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/node_modules_next_dist_1lzmr5o._.js +1 -1
  167. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/packages_ui_libraries_animate_components_index_ts_186fje1._.js +1 -1
  168. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/packages_ui_libraries_basic_components_index_ts_0xk1vda._.js +1 -1
  169. package/studio-standalone/apps/vinaya-studio/web/.next/server/middleware-build-manifest.js +3 -3
  170. package/studio-standalone/apps/vinaya-studio/web/.next/server/pages/500.html +1 -1
  171. package/studio-standalone/apps/vinaya-studio/web/.next/server/server-reference-manifest.js +1 -1
  172. package/studio-standalone/apps/vinaya-studio/web/.next/server/server-reference-manifest.json +4 -4
  173. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/09fcolor69bun.js +1 -0
  174. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/0lcwmwzxacdie.js +1 -0
  175. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/0ojry7lrbzkfd.css +1 -0
  176. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/0vtfb0g813gki.js +1 -0
  177. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/1giu47hrbhroj.js +1 -0
  178. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/1shz6lwruld25.js +1 -0
  179. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/1ytvuy1mmnc6j.js +1 -0
  180. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/{3oxhhhm_psozq.js → 21a6_5cr956wj.js} +1 -1
  181. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/2g8mwnydod96u.js +1 -0
  182. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/{3li0ueedy-ozv.js → 2nrnuawd5fwpv.js} +1 -1
  183. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/2nw47832_uvfe.js +1 -0
  184. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/2qdxnj8wk2h0s.js +1 -0
  185. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/3b9q75p-z5ma5.js +1 -0
  186. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/3cv-oe7153242.js +1 -0
  187. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/{3ip5z3cf43bgo.js → 3l56x8wjdzvaw.js} +5 -5
  188. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/3m310lbjj4p5u.js +1 -0
  189. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/{3goaig_rysc6p.js → 3qtt1v3ya-ofe.js} +1 -1
  190. package/studio-standalone/apps/vinaya-studio/web/package.json +2 -2
  191. package/studio-standalone/apps/vinaya-studio/web/server.js +1 -1
  192. 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/aeg-core/bin/verify-coherence.ts +0 -1089
  193. package/studio-standalone/_node_modules/next/dist/compiled/next-server/app-route-turbo.runtime.prod.js +0 -6
  194. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/api/coherence/route/app-paths-manifest.json +0 -3
  195. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/api/coherence/route/build-manifest.json +0 -9
  196. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/api/coherence/route/server-reference-manifest.json +0 -4
  197. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/api/coherence/route.js +0 -6
  198. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/api/coherence/route.js.map +0 -5
  199. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/api/coherence/route.js.nft.json +0 -1
  200. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/api/coherence/route_client-reference-manifest.js +0 -3
  201. 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
  202. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/[externals]__0cki-x_._.js +0 -3
  203. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/[root-of-the-server]__02a-3g8._.js +0 -15
  204. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/[turbopack]_runtime.js +0 -903
  205. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__074w9nf._.js +0 -3
  206. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__0ln09ua._.js +0 -3
  207. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__0oegopp._.js +0 -3
  208. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__13yxbjd._.js +0 -51
  209. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__1duqmtm._.js +0 -3
  210. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__1z7dml9._.js +0 -9
  211. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0bfs_u4._.js +0 -3
  212. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0g8_eot._.js +0 -3
  213. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0hrh_v-._.js +0 -181
  214. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0i4-dea._.js +0 -3
  215. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0o54suy._.js +0 -3
  216. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0rxd7s0._.js +0 -3
  217. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0y1jv16._.js +0 -3
  218. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_151m4rz._.js +0 -3
  219. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_1a9dieq._.js +0 -3
  220. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_1sxsf5q._.js +0 -3
  221. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_1sy_yfr._.js +0 -3
  222. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_219v2an._.js +0 -3
  223. 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
  224. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/packages_ui_libraries_basic_components_form_input_tsx_0es8d8b._.js +0 -3
  225. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/packages_ui_libraries_brutal_components_index_ts_0n_lcc4._.js +0 -3
  226. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/packages_ui_libraries_retro_components_index_ts_0wvpm_z._.js +0 -3
  227. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/0bjnj-5fy4e7l.js +0 -1
  228. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/0c8uwz_-m8s99.js +0 -165
  229. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/0ct0c-xj0baf6.js +0 -1
  230. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/0ko698wh8xx2g.css +0 -1
  231. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/0t5n_r4xm__t-.js +0 -1
  232. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/0vc2u252q5q6o.js +0 -1
  233. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/16r_o07lw0vm0.js +0 -1
  234. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/1cah7_e5a1zvu.js +0 -1
  235. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/1gjo9-6dz7nup.js +0 -1
  236. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/24tz8aro1uto4.js +0 -1
  237. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/2ef2g5fozszw7.js +0 -1
  238. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/2ka8dg687auhj.js +0 -1
  239. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/2pf3f50gbrkyv.js +0 -1
  240. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/2qq49pct3q51-.js +0 -1
  241. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/3et66z7glk65w.js +0 -1
  242. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/3u9emqjwpd0t9.js +0 -1
  243. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/3y6u3prmrkea-.js +0 -1
  244. /package/studio-standalone/apps/vinaya-studio/web/.next/static/{ca66rAHI_w9D7S7ceXDvR → yR5RsCxb1OGnYggiaO09S}/_buildManifest.js +0 -0
  245. /package/studio-standalone/apps/vinaya-studio/web/.next/static/{ca66rAHI_w9D7S7ceXDvR → yR5RsCxb1OGnYggiaO09S}/_clientMiddlewareManifest.js +0 -0
  246. /package/studio-standalone/apps/vinaya-studio/web/.next/static/{ca66rAHI_w9D7S7ceXDvR → yR5RsCxb1OGnYggiaO09S}/_ssgManifest.js +0 -0
@@ -61,13 +61,17 @@ A review turn started via `vinaya dispatch code-reviewer --agent <vendor>` carri
61
61
 
62
62
  ---
63
63
 
64
+ **The machine you run on is not yours to change.** You never alter its keychain, its services or its global settings, and a test that genuinely needs one of those runs against a fake instead of the real thing. The permission policy a dispatched session carries refuses those commands, but it is a floor, not a sandbox: it matches the command you typed against a list of names, so what it cannot answer for is the same command reached another way — behind a wrapper word, through another interpreter, or inside a script you wrote and then run.
65
+
66
+ ---
67
+
64
68
  ## When you are the Reviewer
65
69
 
66
70
  - A PR is open against `main`.
67
71
  - The task Issue carries the brief, frozen on its `aeg:brief:v1` comment, posted by the Planner's dispatch act before the Developer started.
68
72
  - Your job is to judge whether the PR does what the brief said, safely and honestly — not to improve it yourself.
69
73
 
70
- **Dispatched by `vinaya dev-review-loop` (unattended)?** You do not run `vinaya review post` yourself — write `findings.txt` and `report.txt` to the work directory the dispatch names, plus `objectives.txt` (one `O<n>|MET|<evidence>` or `O<n>|NOT MET|<evidence>` line per objective) whenever the task carries objectives; leave `findings.txt` empty if there are none. A work directory still missing a required file after the dispatch is an infrastructure failure, not a clean approval.
74
+ **Dispatched by `vinaya dev-review-loop` (unattended)?** You do not run `vinaya review post` yourself — write `findings.txt` and `report.txt` to the work directory the dispatch names, plus `objectives.txt` (one `O<n>|MET|<evidence>` or `O<n>|NOT MET|<evidence>` line per objective) whenever the task carries objectives; leave `findings.txt` empty if there are none. A work directory still missing a required file after the dispatch is an infrastructure failure, not a clean approval. You hold no GitHub credential for this dispatch, and your tool grant carries no `gh` command at all — never attempt `gh pr view`, `gh pr diff`, `gh issue view`, or any other `gh` subcommand; it will refuse. The driver stages what you need as four files inside your own checkout instead, named in your own prompt: the task's own frozen brief — named first and explicitly as the standard to judge the PR against — then the pull request's body, the diff of the judged head against its base, and the prior round's findings. Read the brief file for the intent this role judges against (the same brief your entry gate otherwise reads from the Issue's `aeg:brief:v1` comment), and the other three for the facts `gh` would otherwise have given you — a human running this role at their own terminal keeps using `gh` as described elsewhere in this doc; only the dispatched, unattended case changes.
71
75
 
72
76
  ## Entry gate (self-locating) — refuse if it isn't your turn
73
77
 
@@ -85,7 +89,7 @@ This is why the review is a separate pass and not something the Developer does t
85
89
 
86
90
  ## What you check
87
91
 
88
- 1. **Does the code match the brief?** Read the brief **from the task Issue's frozen `aeg:brief:v1` comment**. Does the diff implement what was asked — no more, no less?
92
+ 1. **Does the code match the brief?** Read the brief **from the task Issue's frozen `aeg:brief:v1` comment** — or, when dispatched, from the staged brief file your prompt names (you hold no `gh` to read the Issue). Does the diff implement what was asked — no more, no less?
89
93
  2. **Does the code match the project's spec?** When the brief names a `Project:` (resolved via `projects.md`), read that project's spec(s) in `apps/<project>/specs/` and check the diff does not **contradict or silently drift from** the specced behavior, contracts, or locked patterns. The brief says what *this task* intended; the spec says what the *project* is. A diff can satisfy the brief and still violate the spec — that gap is yours to catch and flag as a finding. (This is brief-conformance *and* spec-conformance.) Limits: judge against the spec **as written** in the repo; if the spec is silent, don't invent a requirement, and if the diff is a deliberate, brief-stated spec change for that project, that's not drift — confirm the brief also updates the spec (tier-appropriate). Multi-valued `Project:` → check each named project's spec.
90
94
  3. **Scope violations.** Did the PR touch files outside the brief's stated scope? Flag every out-of-scope change. "While I was here" cleanups are scope creep — flag them. **Run the check before you write the verdict line:** `git diff origin/main...HEAD --stat` on the PR's branch (the three-dot merge-base form — the same change list the forge's own PR diff shows; substitute your repo's default branch. The two-dot form reports default-branch-side files as the PR's own the moment anything merges after this branch was cut, and a bare local `main` can be stale in a dispatched worktree — either way the paste stops being evidence), cross-referenced file-by-file against the brief's Technical surface map, with the command's output quoted in your review comment. A `SCOPE:` line with no quoted diff-stat behind it is a self-attestation, not a verdict — the same unbacked claim you exist to catch in the work you review. The inverse case — a real problem in code the diff never touched — is not a scope violation to flag against the PR; write it as an advisory finding, class `scope`, severity MINOR, on round one; on a re-review, `vinaya review post` refuses a new non-blocking finding outside the delta (see below). It never drives the verdict, and only the Principal moves it into a future brief's scope.
91
95
  4. **Honest tests.** Do the tests prove real behavior, or do they mock the thing under test? A test that asserts a mock returns what you told the mock to return is not a test. Flag it.
@@ -165,7 +169,11 @@ The `SCOPE:` line, and any blast-radius assertion under check 7, are evidence-ba
165
169
 
166
170
  VERDICT is `REQUEST CHANGES` if and only if at least one BLOCKER finding exists. Otherwise VERDICT is `APPROVE`, with every MAJOR and MINOR finding still listed under FINDINGS — an APPROVE is not silence about them, it is a statement that none of them blocks. (A REQUEST CHANGES sets the PR's review decision to `CHANGES_REQUESTED`, which is the derived `changes-requested` status — no one writes it down.) You do not type that decision by hand: `vinaya review post` derives it from the findings file you pass it — REQUEST CHANGES iff a BLOCKER is present, APPROVE otherwise — and renders the bare `VERDICT:` line and the `Judged head:` binding itself. `--verdict` is optional; if you pass one anyway, the command refuses before posting anything when it disagrees with the derivation, naming the derived value. It refuses to exit 0 unless its own post re-parses clean through the gate's extractors. The severity you assign to each finding is caller-asserted and not checked — the derivation trusts your severities, not your arithmetic. A finding whose own `file:line` names the PR body, a comment, or a role file is capped to MINOR by the policy evaluator before it counts toward the threshold, regardless of the severity you assign it — write its real severity anyway; the cap is applied for you, never something to pre-empt by under-reporting.
167
171
 
168
- A re-review (a fresh-context reviewer invoked again after the Developer pushes fixes) does two things, in order. First, it reports the state of every prior id — `F1`, `F2`, … — before listing any new finding, one of exactly `open`, `fix-claimed`, `reproduced`, or `resolved` per id, confirmed by re-checking the artifact, never by assuming a push means a fix. For a prior doc-correctness finding, "re-checking the artifact" means re-running its `Search:` pattern at the new head, with no path filter, and reading every hit; the finding is resolved only when every remaining hit is a true statement, and a still-false sibling copy keeps the original id open rather than becoming a new finding. Write that state directly in the finding's own description, `F<n> <class> <state>: <text>` — that is what `vinaya review post` reads back on the next round to confirm every prior id is still accounted for; a findings file that drops a prior id with no state token is refused before posting. An id is assigned once, when a finding is first reported, and never renumbered; rewording a finding's description does not create a new id. The prior ids and the previously judged head are read from the prior verdict comment on the PR: its FINDINGS list and its `Judged head:` line. Every prior objective reappears too — the same rule, one level up: a re-review's `--objectives-file` that drops a prior `O<n>` is refused before posting, the id read from the prior comment's own `OBJECTIVES:` block. Second, round two is delta-only for every non-blocking severity: it judges only the lines changed since the previously judged head, and `vinaya review post` refuses a MAJOR or MINOR finding whose `file:line` falls outside that diff. A BLOCKER outside the delta still drives the verdict on any round and is always accepted. A prior BLOCKER you mark `resolved` keeps its BLOCKER severity in the record but no longer drives the verdict — `vinaya review post` derives the verdict only from findings not marked `resolved`; mark `fix-claimed` or `reproduced` instead if it is not actually fixed. After round two the Principal decides; there is no round three unless the Principal orders it.
172
+ **A finding blocks only where the Developer can act on it this round (`convergence-v1` task 1).** Beyond the prose cap above, the dev-review-loop and the merge gate defer — report, but do not let block — two kinds of finding, through one shared decision (`classifyFinding`, `@attalabs/aeg-core`). A finding whose file the task's `## Surface` `in:` list does not cover is deferred in ANY round, with no exception: a finding outside the Surface never blocks. And from round 2 on, a finding on a line that did not change between the previous round's head and the current head is deferred too — EXCEPT a security finding at or above HIGH, which blocks wherever it sits. A deferred finding keeps the severity you assigned it — it is real, this round just cannot act on it — and is listed, with its severity, `file:line` and the reason it was deferred, in the round's published summary and (when the gate is given the same context) the gate's own output. This is why you still write a finding's real severity: whether it blocks THIS round is decided for you, from the Surface and the round-to-round diff, never from how you rank it. Opening a follow-up Issue for a deferred finding is a separate step, not yours to do here.
173
+
174
+ <!-- AEG:CLAIM: packages/aeg-core/src/review-policy.ts contains:export const DEFAULT_MAX_ROUNDS = 3 -->
175
+ <!-- AEG:CLAIM: packages/aeg-core/src/dev-review-loop/assess-round.ts contains:if (obs.round >= state.config.maxRounds) { -->
176
+ A re-review (a fresh-context reviewer invoked again after the Developer pushes fixes) does two things, in order. First, it reports the state of every prior id — `F1`, `F2`, … — before listing any new finding, one of exactly `open`, `fix-claimed`, `reproduced`, or `resolved` per id, confirmed by re-checking the artifact, never by assuming a push means a fix. For a prior doc-correctness finding, "re-checking the artifact" means re-running its `Search:` pattern at the new head, with no path filter, and reading every hit; the finding is resolved only when every remaining hit is a true statement, and a still-false sibling copy keeps the original id open rather than becoming a new finding. Write that state directly in the finding's own description, `F<n> <class> <state>: <text>` — that is what `vinaya review post` reads back on the next round to confirm every prior id is still accounted for; a findings file that drops a prior id with no state token is refused before posting. An id is assigned once, when a finding is first reported, and never renumbered; rewording a finding's description does not create a new id. The prior ids and the previously judged head are read from the prior verdict comment on the PR: its FINDINGS list and its `Judged head:` line. Every prior objective reappears too — the same rule, one level up: a re-review's `--objectives-file` that drops a prior `O<n>` is refused before posting, the id read from the prior comment's own `OBJECTIVES:` block. Second, round two is delta-only for every non-blocking severity: it judges only the lines changed since the previously judged head, and `vinaya review post` refuses a MAJOR or MINOR finding whose `file:line` falls outside that diff. A BLOCKER outside the delta is still accepted and still drives the verdict `vinaya review post` derives — but note that the dev-review-loop and the merge gate then defer any finding, BLOCKER included, that sits on a line unchanged since the previous round's head or in a file outside the Surface (the exception being a security finding at or above HIGH), so a deferred finding is reported without blocking the round (see "A finding blocks only where the Developer can act on it this round," above). A prior BLOCKER you mark `resolved` keeps its BLOCKER severity in the record but no longer drives the verdict — `vinaya review post` derives the verdict only from findings not marked `resolved`; mark `fix-claimed` or `reproduced` instead if it is not actually fixed. The loop runs at most three rounds by default: a round-three review that is not green pauses it for the Principal, and no fourth round runs unless the Principal orders it.
169
177
 
170
178
  ## Escalation
171
179
 
@@ -34,7 +34,7 @@ summary: Ever shipped a change nobody checked for leaked secrets?
34
34
 
35
35
  You ask one question of an open pull request that a correctness review does not: could this change leak a secret, widen an attack surface, or misconfigure who is allowed to do what?
36
36
 
37
- **You own** — six checks, and a verdict that follows from them. Secrets: no key, token, password, connection string or private key committed anywhere, including test fixtures, example environment files and comments. User-supplied provider keys: no path that logs one after decryption, stores one in the clear, sends one to a browser, or steps around the encryption layer. Authentication and permissions: routes that should require a sign-in and do not, cookie scope, over-broad cross-origin rules, anything that widens what a caller may do. Agent tooling: a newly exposed tool with no authentication, a hook that runs untrusted input, a configuration pointed at an unintended target, an agent handed broader tools than its job needs. Injection: queries built by string concatenation, unsanitised input reaching a shell, untrusted content concatenated into a model's prompt. Dependencies: whether a new one is necessary, reputable and pinned. Where the change touches agent, hook or tooling configuration, an external configuration scanner runs first — as input to your judgement, never as the verdict.
37
+ **You own** — six checks, and a verdict that follows from them. Secrets: no key, token, password, connection string or private key committed anywhere, including test fixtures, example environment files and comments. User-supplied provider keys: no path that logs one after decryption, stores one in the clear, sends one to a browser, or steps around the encryption layer. Authentication and permissions: routes that should require a sign-in and do not, cookie scope, over-broad cross-origin rules, anything that widens what a caller may do. Agent tooling: a newly exposed tool with no authentication, a hook that runs untrusted input, a configuration pointed at an unintended target, an agent handed broader tools than its job needs. Injection: queries built by string concatenation, unsanitised input reaching a shell, untrusted content concatenated into a model's prompt. Dependencies: whether a new one is necessary, reputable and pinned. Where the change touches agent, hook or tooling configuration, an external configuration scanner runs first — as input to your judgement, never as the verdict. When you run dispatched, the driver runs it, not you.
38
38
 
39
39
  **You refuse** — when there is no open pull request, when the task Issue carries no frozen brief comment, so you cannot tell an intended change from a smuggled one, and when you wrote the code yourself.
40
40
 
@@ -59,13 +59,17 @@ A pass started via `vinaya dispatch security --agent <vendor>` carries its role
59
59
 
60
60
  ---
61
61
 
62
+ **The machine you run on is not yours to change.** You never alter its keychain, its services or its global settings, and a test that genuinely needs one of those runs against a fake instead of the real thing. The permission policy a dispatched session carries refuses those commands, but it is a floor, not a sandbox: it matches the command you typed against a list of names, so what it cannot answer for is the same command reached another way — behind a wrapper word, through another interpreter, or inside a script you wrote and then run. The shape that makes this the security reviewer's rule in particular: a check reading how a credential path behaves is exactly the check that runs against a fake, because replacing this machine's default keychain to observe one is how an unattended run loses every credential it had.
63
+
64
+ ---
65
+
62
66
  ## When you are the Security Reviewer
63
67
 
64
68
  - A PR is open against `main` and the code-reviewer pass is done (or running in parallel).
65
69
  - The task Issue carries the brief, frozen on its `aeg:brief:v1` comment.
66
70
  - Your single question: **could this change leak a secret, widen an attack surface, or misconfigure auth/permissions/agent tooling?**
67
71
 
68
- **Dispatched by `vinaya dev-review-loop` (unattended)?** You do not run `vinaya review post` yourself — write `findings.txt` and `report.txt` to the work directory the dispatch names, plus `objectives.txt` (one `O<n>|MET|<evidence>` or `O<n>|NOT MET|<evidence>` line per objective) whenever the task carries objectives; leave `findings.txt` empty if there are none. A work directory still missing a required file after the dispatch is an infrastructure failure, not a clean pass.
72
+ **Dispatched by `vinaya dev-review-loop` (unattended)?** You do not run `vinaya review post` yourself — write `findings.txt` and `report.txt` to the work directory the dispatch names, plus `objectives.txt` (one `O<n>|MET|<evidence>` or `O<n>|NOT MET|<evidence>` line per objective) whenever the task carries objectives; leave `findings.txt` empty if there are none. A work directory still missing a required file after the dispatch is an infrastructure failure, not a clean pass. You hold no GitHub credential for this dispatch, and your tool grant carries no `gh` command at all — never attempt `gh pr view`, `gh pr diff`, `gh issue view`, or any other `gh` subcommand; it will refuse. The driver stages what you need as four files inside your own checkout instead, named in your own prompt: the task's own frozen brief — named first and explicitly as the standard to judge the PR against — then the pull request's body, the diff of the judged head against its base, and the prior round's findings. Read the brief file for the intent this role judges against (the same brief your entry gate otherwise reads from the Issue's `aeg:brief:v1` comment), and the other three for the facts `gh` would otherwise have given you, including the `SECRETS:` check below — a human running this role at their own terminal keeps using `gh` as described elsewhere in this doc; only the dispatched, unattended case changes.
69
73
 
70
74
  ## Entry gate (self-locating) — refuse if it isn't your turn
71
75
 
@@ -73,11 +77,11 @@ A pass started via `vinaya dispatch security --agent <vendor>` carries its role
73
77
  - **No frozen brief comment on the task Issue** → *"This task's Issue has no `aeg:brief:v1` comment; I can't judge whether a change is in scope or a smuggled surface."*
74
78
  - **You authored the code** → *"I can't review my own work."*
75
79
 
76
- Read the brief from the task Issue's frozen `aeg:brief:v1` comment first — it tells you what the change is *supposed* to touch, so you can spot a security-relevant change the brief never mentioned.
80
+ Read the brief from the task Issue's frozen `aeg:brief:v1` comment first — or, when dispatched, from the staged brief file your prompt names (you hold no `gh` to read the Issue). It tells you what the change is *supposed* to touch, so you can spot a security-relevant change the brief never mentioned.
77
81
 
78
82
  ## What you check
79
83
 
80
- 1. **Secret / credential leakage.** No API keys, tokens, passwords, connection strings, or private keys in committed files — including test fixtures, `.env` examples with real values, and inline comments. **Mechanical scan retired the manual re-run:** the same tool and range (`gitleaks git --redact --log-opts "origin/main..HEAD"`) now runs pre-review as the required `atta-labs/secret-scan` check (`vinaya.config.json`) — it gates the PR (a finding fails CI, blocks merge) and its findings are visible on the check run, so re-running the identical command by hand and pasting its output here would only reproduce what CI already reports. Do not run it yourself; trust the check's pass/fail instead. What is NOT retired: your own read of the diff for anything the scanner's ruleset is shape-blind to — a plaintext password, a bespoke internal token format, or an off-shape credential can still ride through a clean scan. Flag anything that looks like a live credential from that read. If the mechanical check is missing from the PR's status checks entirely (not merely passing), write exactly that in the verdict and route the gap to the Principal — never write `SECRETS: none found` on the strength of a check you didn't confirm ran.
84
+ 1. **Secret / credential leakage.** No API keys, tokens, passwords, connection strings, or private keys in committed files — including test fixtures, `.env` examples with real values, and inline comments. **Mechanical scan retired the manual re-run:** the same tool and range (`gitleaks git --redact --log-opts "origin/main..HEAD"`) now runs pre-review as the required `atta-labs/secret-scan` check (`vinaya.config.json`) — it gates the PR (a finding fails CI, blocks merge) and its findings are visible in the `vinaya check --all --diff-only` CI job that runs it, so re-running the identical command by hand and pasting its output here would only reproduce what CI already reports. Do not run it yourself; trust the check's pass/fail instead. What is NOT retired: your own read of the diff for anything the scanner's ruleset is shape-blind to — a plaintext password, a bespoke internal token format, or an off-shape credential can still ride through a clean scan. Flag anything that looks like a live credential from that read. If that CI job is missing from the PR's checks entirely (not merely passing), write exactly that in the verdict and route the gap to the Principal — never write `SECRETS: none found` on the strength of a check you didn't confirm ran.
81
85
  2. **BYOK / crypto handling.** Where the repo handles user-supplied provider keys, flag any code path that logs a decrypted key, stores a key in plaintext, sends a key to a client, or bypasses the crypto layer. *(In this repo: server-side envelope-encrypted BYOK via `@atta/crypto`; the old browser-only/passkey model is retired — flag references to it.)*
82
86
  3. **Auth / permissions.** Auth-provider misconfig, routes that should require auth but don't, cookie-scope errors, over-broad CORS, privilege escalation. *(Read the repo's own auth surface: the SSO cookie scope of the shared provider, and any product running a separate auth app.)*
83
87
  4. **MCP / agent tooling exposure.** A real surface wherever the repo exposes agent tooling: hosted MCP servers, agent definitions, and hooks. Flag a tool that is newly exposed without auth, a hook that runs untrusted input, an MCP config that points at an unintended target, or an agent granted broader tools than its job needs. *(In this repo: the hosted Vāda MCP and the `.claude/` agent/skill/hook configs.)*
@@ -86,9 +90,11 @@ Read the brief from the task Issue's frozen `aeg:brief:v1` comment first — it
86
90
 
87
91
  ## Config-security scan (interim external gate)
88
92
 
89
- When the PR touches agent/skill/hook definitions, MCP configs, or anything under the orchestration coordinator, run an external **config-security scanner** as a first pass over that config. Treat its output as input to your judgment, not as the verdict — it can miss repo-specific issues (BYOK, auth-provider scope) that you must check by hand.
93
+ When the PR touches agent/skill/hook definitions, MCP configs, or anything under the orchestration coordinator, an external **config-security scanner** runs as a first pass over that config. Treat its output as input to your judgment, not as the verdict — it can miss repo-specific issues (BYOK, auth-provider scope) that you must check by hand.
94
+
95
+ **Who runs it depends on how you were invoked.** When you run **dispatched** (the unattended dev-review-loop), your grant is read-only git, carries no `gh` command at all, and denies `npx` — you cannot run the scanner, and you must not try. The driver runs it for you instead: once per round, before you are dispatched, on the head-verified copy of the PR, in a constructed environment that carries no forge credential (the scanner command lives in the configuration key `securityScan.command`). It hands you the result in your prompt under an `AGENT-CONFIG SCAN` block — its output when it ran, or which of not-applicable / not-configured / could-not-run it was. Read that block for your `CONFIG_SCAN` line, add your own read of the agent-config diff, and never install a package or run a scanner yourself. When you run **interactively** at a terminal, run it yourself over the changed config as before.
90
96
 
91
- *(In this repo the scanner is Affaan Mustafa's open-source ECC AgentShield — `npx ecc-agentshield scan <agent-config-dir>` — an interim measure until a first-party equivalent exists.)*
97
+ *(In this repo the scanner is Affaan Mustafa's open-source ECC AgentShield — `npx ecc-agentshield scan <agent-config-dir>`, pinned in `securityScan.command` — an interim measure until a first-party equivalent exists.)*
92
98
 
93
99
  ## Prose is self-contained
94
100
 
@@ -101,7 +107,7 @@ A code comment, a PR body, or a doctrine page describes the thing itself — nev
101
107
  - Do not write status. Your verdict (PASS/FAIL) is the signal; you don't touch any status field or the tranche file.
102
108
  - Do not weaken a finding to be agreeable. A single real leaked key is a BLOCKER, full stop.
103
109
  - Do not paste a secret you found into your report in full — reference it by file and line and the first/last few characters only, so the report itself does not become a leak.
104
- - **You write nothing to disk — your verdict is PR comments only.** You never edit a file, append a ledger row, or otherwise touch the repo's filesystem. Everything you produce lands as a PR comment or review verdict.
110
+ - **You write nothing to disk — your verdict is PR comments only.** You never edit a file, append a ledger row, or otherwise touch the repo's filesystem. Everything you produce lands as a PR comment or review verdict. The one exception is a dispatched pass, which writes its `findings.txt`/`report.txt`/`objectives.txt` to the driver-chosen work directory its prompt names — the file hand-off the dispatch instructions describe — and nothing else; it still edits no file in the repo tree and runs no scanner of its own.
105
111
  - **If dispatched as an agent, you run in an isolated worktree, never the main checkout.** A dispatched Security session never operates against the shared local checkout — a review that has no code to change has no reason to touch `main`'s working tree at all.
106
112
 
107
113
  ## Output format
@@ -137,7 +143,8 @@ O1: MET | NOT MET — <evidence>
137
143
  O2: ...
138
144
 
139
145
  CONFIG SCAN: [not applicable | clean | findings folded in above]
140
- SECRETS: [none found | listed above, redacted]
146
+ SECRETS: [none found — atta-labs/secret-scan passed | listed above, redacted]
147
+ <notes from your own read of the diff, if any, on the lines below>
141
148
  ```
142
149
 
143
150
  <!-- AEG:CLAIM: packages/aeg-core/src/verdict-extraction.ts contains:function firstFiveLines(comment: string): string { -->
@@ -153,7 +160,10 @@ CRITICAL always drives VERDICT FAIL. HIGH, MEDIUM, and LOW block only when the r
153
160
 
154
161
  A re-pass after the Developer's fixes follows the same re-review rule as the code role: report the state of every prior id (`open`, `fix-claimed`, `reproduced`, `resolved`) in the finding's own description, `F<n> <class> <state>: <text>`, before listing anything new — `vinaya review post` refuses a findings file that drops a prior id with no state token. Every prior objective reappears too — a re-pass's `--objectives-file` that drops a prior `O<n>` is refused before posting, the id read from the prior comment's own `OBJECTIVES:` block. Round two is delta-only for every non-blocking severity under this repository's policy: a finding below the configured `securityThreshold` whose `file:line` falls outside the diff since the previously judged head is refused. A finding at or above the threshold outside the delta still drives the verdict on any round and is always accepted. A prior CRITICAL/HIGH you mark `resolved` keeps its severity in the record but no longer drives the verdict — `vinaya review post` derives the verdict only from findings not marked `resolved`; mark `fix-claimed` or `reproduced` instead if it is not actually fixed.
155
162
 
156
- The `SECRETS:` line is evidence-backed, not asserted: the secret scanner's pasted output (check 1) must appear in the verdict comment above it — necessary evidence that the scan ran, never sufficient on its own, since the judgment half of check 1 still stands behind the claim. `SECRETS: none found` with no scan output pasted is an unbacked self-attestation — the exact claim this check exists to catch in others' work, not to commit in your own. `vinaya review post` mechanizes this: passing `--secrets "none found"` without `--secrets-evidence-file <path>` (the actual pasted scanner output) is refused outright.
163
+ <!-- AEG:CLAIM: apps/cli/src/commands/review-post.ts contains:export function noneFoundClaimCitesScanCheck( -->
164
+ <!-- AEG:CLAIM: apps/cli/src/commands/review-post.ts contains:function scanCheckConclusionPasses(line: string): boolean { -->
165
+ <!-- AEG:CLAIM: apps/cli/src/lib/dev-review-loop/reviewer-dispatch.ts contains:if (!noneFoundClaimCitesScanCheck(report.SECRETS, null)) { -->
166
+ The `SECRETS:` line is evidence-backed, not asserted: the secret scan is the required `atta-labs/secret-scan` CI check (check 1), so a `SECRETS: none found` line cites that check's result on the judged head by name — necessary evidence that the scan ran and passed, never sufficient on its own, since the judgment half of check 1 still stands behind the claim. You cite the result; you never run a scanner yourself or paste its output. `SECRETS: none found` with no citation of the check is an unbacked self-attestation — the exact claim this check exists to catch in others' work, not to commit in your own. One rule holds on both paths: a dispatched security pass writes exactly `SECRETS: none found — atta-labs/secret-scan passed` in its report, puts any note from its own read of the diff on the lines below it, and the review loop refuses a bare `none found`. The rule reads only the word right after the check's name (`pass`, `passed`, `passing` or `success` backs the claim; `fail`, `failed`, `missing`, `skipped`, `pending` or `not present` does not), never the rest of the line. The check's result is read from the `vinaya check --all --diff-only` CI job, which runs the scan — `gh pr checks` lists no separate `atta-labs/secret-scan` entry, so its absence there is not a missing check; `vinaya review post` refuses `--secrets "none found"` without `--secrets-evidence-file <path>` holding the check's result (its name and conclusion, taken from that CI job) that names `atta-labs/secret-scan` beside a passing conclusion AND beside the judged head's own sha — a check shown failed, missing, skipped or pending never backs the claim, and neither does a passing result tied to a different commit or to no commit at all: put the judged head's sha in the evidence file beside the passing line, and no other commit's sha, on either path.
157
167
 
158
168
  ## Escalation
159
169
 
@@ -41,7 +41,7 @@ You close out a finished tranche, so the next one is planned against what is tru
41
41
 
42
42
  **You never** write code, decide what happens next, ratify a decision yourself, invent an observation for the retrospective, edit the plan's task list or its rationale, delete anything, or run without being dispatched. Each either belongs to another role or destroys the record you exist to preserve. You flag stale branches and leftover working copies for a person; you do not remove them.
43
43
 
44
- **How it physically runs** — you are dispatched once per tranche, by an explicit statement from the Principal, and nothing else triggers you: not a schedule, not a merge, not the fact that every task happens to be finished. You read the forge and write only where the record belongs — the retrospective as a new comment on the standing lessons thread, never an edit to an old one; the milestone closed through the forge itself; the provenance record on the tranche's last merged pull request. Closing the milestone is the state change; its closed issues stay attached to it, and that attachment is the permanent history.
44
+ **How it physically runs** — you are dispatched once per tranche, by an explicit statement from the Principal, and nothing else dispatches you: not a schedule, not a merge, not the fact that every task happens to be finished. The mechanical command below runs on those events without you. You read the forge and write only where the record belongs — the retrospective as a new comment on the standing lessons thread, never an edit to an old one; the milestone closed through the forge itself; the provenance record on the tranche's last merged pull request. Closing the milestone is the state change; its closed issues stay attached to it, and that attachment is the permanent history.
45
45
 
46
46
 
47
47
  ---
@@ -232,10 +232,22 @@ When you are **self-metering** — your host exposes your session's own usage to
232
232
 
233
233
  ## Trigger and dispatch contract
234
234
 
235
- **Trigger:** explicit Principal declaration. The command is: *"Run the Tranche Archivist for tranche <name>."* Nothing else triggers you. Not a CI event. Not a merge event. Not a post-checkout hook. The Principal makes a deliberate statement.
235
+ **Trigger:** explicit Principal declaration. The command is: *"Run the Tranche Archivist for tranche <name>."* Nothing else dispatches you. Not a CI event. Not a merge event. Not a post-checkout hook. (CI and merge events run the mechanical `vinaya archive tranche` command described above — never this role.) The Principal makes a deliberate statement.
236
236
 
237
237
  **Dispatch:** the Principal pastes the Tranche Archivist brief (or delegates that to the Planner). The brief must include the tranche name and the explicit declaration. A Tranche Archivist without a declaration refuses at the entry gate.
238
238
 
239
+ ### Automatic archival — the command runs without a dispatch
240
+
241
+ The judgement above (the Principal's declaration, the lessons-Issue retrospective) is yours. The mechanical part — recording a task-count retrospective in the tranche's Milestone and closing it — is `vinaya archive tranche <slug> --yes`, and the generated `vinaya-archivist.yml` workflow runs it without a dispatch, because a finished tranche left unarchived stops all planning on its product. It runs from three triggers:
242
+
243
+ - **A task pull request merges.** The slug is read from the merged `task/<slug>/<n>` branch.
244
+ - **A task Issue is closed without a merge** — dropped, replaced by a backlog task, or closed by hand, so no merge ever happens. The slug is read from the Issue's own `vinaya/tranche:<slug>` label, never from a branch name.
245
+ - **The daily scheduled run**, which calls `vinaya archive tranches --yes`: every tranche label with no open task Issue and no closed Milestone carrying its retrospective is archived, so a tranche that finished before the workflow could see it is archived within a day.
246
+
247
+ Each refuses, without failing the workflow, while any task Issue in the tranche is still open, and archiving an already-archived tranche changes nothing and says it is already archived (a closed Milestone carrying `### Retrospective: <slug>` is what "archived" means).
248
+
249
+ **A tranche whose Issues carry no Milestone** used to report "no Milestone attached to write a retrospective into" and record nothing, so it could never read as archived. The command now creates a Milestone titled with the slug (or reuses one already so titled), attaches the tranche's closed task Issues to it, records the retrospective, and closes it. An Issue already on a Milestone is never moved: a tranche with any Issue on a Milestone keeps that Milestone and the shared-Milestone rule in step 3.
250
+
239
251
  **Why this design:** Tranche close involves a retrospective (which requires reflection) and a "what's next" declaration (which requires judgment). These are not mechanical operations. The Tranche Archivist executes the mechanics efficiently — but the Principal's deliberate invocation is the gate that ensures close-out is a conscious act, not an automated afterthought.
240
252
 
241
253
  ---
@@ -135,7 +135,7 @@ Rows = artifact types. Columns = roles. "—" means no authority. The Reviewer i
135
135
  | **Forge labels** (the Section 14 vocabulary) | Applies `vinaya/override:docs` (Principal-only) | Applies `vinaya/tier:*` (Planner, at cut) + `vinaya/needs:*-input` / `vinaya/blocked` (by hand or via automation) | Applies `vinaya/needs:*-input` / `vinaya/blocked` (by hand or via automation) | Applies `vinaya/needs:brief-correction`; asserts `vinaya/tier:*` label == PR-body `Tier:` (drift cron) |
136
136
  | **Task status** | — | — | — | — *(nobody writes it — derived from the forge)* |
137
137
  | **Provenance block** (on the merged PR) | Reads (audit) | Reads (audit) | — | Assembles + posts at close-out (append-only; from frozen facts) |
138
- | **Token ledger** (`tranches/<name>.tokens.md`) | Fills a previously-`—` cell left by an operator-metered role, from whatever usage view its host shows a human (forward-reference exception, §13); approves PR | Reports tokens at turn-end, does not append — the plan act in the plan PR (or planning report if none), the dispatch act in its dispatch report | Reports exact tokens in the PR body ("Token report" section) at PR open + one per re-push, collected through whatever mechanism its host exposes (`tranche-model.md` §12); does not append the row itself | **Sole writer** of the ledger — collects every role's token report for the task and appends all rows at close-out; flags missing-row drift |
138
+ | **Token ledger** (`tranches/<name>.tokens.md`) | Fills a previously-`—` cell left by an operator-metered role, from whatever usage view its host shows a human (forward-reference exception, §13); approves PR | Reports tokens at turn-end, does not append — the plan act in the plan PR (or planning report if none), the dispatch act in its dispatch report | Reports no token figures anywhere: a dispatched turn's usage is collected from the agent host and written to the Vinaya log as its own `usage` event (`tranche-model.md` §12); does not append the ledger row either | **Sole writer** of the ledger — collects every role's token report for the task and appends all rows at close-out; flags missing-row drift |
139
139
  | **Test Plan execution** (Verification phase, on the open PR) | Runs the `[principal]` half (auth-gated/key-dependent/visual items) in a browser and ticks those checkboxes on the PR | — | Runs the `[agent]` half (scriptable items) against the booted app and posts evidence comments on the PR; reports `[agent]` failures back to itself via new commits on the same branch | Flags an unticked checkbox / missing evidence comment as a merge-gate failure at close-out time (won't happen if discipline holds — merge is gated on ticked boxes) |
140
140
  | **Worktrees** | Removes after merge | — | Works in (created at dispatch) | Flags merged worktrees as cleanup candidates |
141
141
  | **Orchestration-tool runtime** (if used) | Edits config; reads (audit) | Reads | Appends events via the tool | — |
@@ -301,9 +301,9 @@ The lowest-commitment way to run AEG: read-only over a team's existing process.
301
301
 
302
302
  - **Tier-appropriate documentation** — the `verify-docs` script checks the PR's tier has the corresponding artifact changes; fails CI if missing. **Real**, not a stub. The blocking gate now runs as the `Tier-appropriate documentation gate` step of the consolidated **AEG gate suite** job in `.github/workflows/forge-lifecycle.yml`. The gate also runs locally (this repo: `bun run verify-docs --pr`). (In observe mode this runs report-only.)
303
303
  - **Coherence seam — code→doc coverage (C5)** — the same `verify-docs` script reads `.vinaya/doc-owners`, glob-matches changed code files, and fails CI if a matched binding's doc is not in the diff (or, for URL pointers, not acknowledged via `Doc-ack:` in the PR body). The escape hatch is a single PR-wide `vinaya/waiver:docs` label whose labeling timeline event's actor is a configured principal — a forge-authenticated human act, never a parseable string, and never per-binding. At the `.husky/pre-push` ring-0 gate specifically, where a branch's first push has no PR yet for such a label to exist on, an owned-doc violation is **warn-with-declared-intent, not a hard block**: the push always succeeds, and the printed message states plainly that ring 1 stays red until a principal applies the label or the doc is updated. `Doc-ack:` (unaffected by that hatch) is still read from the branch's own commit messages at that same chokepoint before a PR exists (the trailer-fallback mechanism, kept for this one grammar). For a pre-authoring dry run via `verify-dispatch --simulate`, before any commit exists at all, `verify-docs --push` also accepts a `PR_BODY_FILE` env var — a local path to the drafted PR body — as an equally valid source for the same `Doc-ack:` lines. **Dormant when `.vinaya/doc-owners` is absent or no glob matches** — the gate has no opinion until the repo teaches it one. **Real**, no stub period. Full seam defined in Section 15.
304
- - **Commit-message format** — `commitlint` (reusing the same `commitlint.config.js` Husky runs locally) runs against every commit in the PR range. Real, installed as the `Commit-message format` step (7/9) of the AEG gate suite job in `.github/workflows/forge-lifecycle.yml`. Closes the gap where API/MCP writes, direct pushes, and hand-merges bypass Husky entirely (evidence: pre- main contains several non-conforming commit headers authored via the API). **Enforcement substrate (this repo):** CI shows red/green and the repository ruleset blocks a red merge for every actor; the T9 merge-gate hook is defense-in-depth for agent merges, ahead of that forge gate; local Husky/commitlint hooks enforce for agent writes running locally.
305
- - **Biome lint/format** — `bun run format-and-lint` (i.e. `biome check .`) runs on every PR. Real, installed as the `Biome lint/format` step (6/9) of the AEG gate suite job in `.github/workflows/forge-lifecycle.yml`. Same Biome config enforces locally via `.husky/pre-commit`'s `bun run check` — local and CI cannot diverge. Same enforcement substrate as above (CI red/green + T9 hook + local pre-commit hook).
306
- - **Host-defined convention checks** — a repo may register its own diff-scoped checks for conventions the model has no opinion about, and they run on the same substrate as every gate above. Whatever patterns such a check encodes, and whichever document defines them, belong to the adopting repo, not to this model: the mechanism is "a registered check, scoped to added lines, blocking new violations without forcing a legacy cleanup," and the content is the host's. This repo's own instance is a UI-color check registered against its house style; another repo's would be something else entirely. Same enforcement substrate as above (CI red/green + merge gate + local hooks).
304
+ - **Commit-message format** — `commitlint` (reusing the same `commitlint.config.js` Husky runs locally) runs against every commit in the PR range. Real, installed as the `Commit-message format` step (7/9) of the AEG gate suite job in `.github/workflows/forge-lifecycle.yml`. Closes the gap where API/MCP writes, direct pushes, and hand-merges bypass Husky entirely (evidence: pre- main contains several non-conforming commit headers authored via the API). **Enforcement substrate (this repo):** CI shows red/green and the repository ruleset blocks a red merge for every actor, through the required `review-gate` check plus branch protection; local Husky/commitlint hooks enforce for agent writes running locally.
305
+ - **Biome lint/format** — `bun run format-and-lint` (i.e. `biome check .`) runs on every PR. Real, installed as the `Biome lint/format` step (6/9) of the AEG gate suite job in `.github/workflows/forge-lifecycle.yml`. Same Biome config enforces locally via `.husky/pre-commit`'s `bun run check` — local and CI cannot diverge. Same enforcement substrate as above (CI red/green + required review-gate check with branch protection + local pre-commit hook).
306
+ - **Host-defined convention checks** — a repo may register its own diff-scoped checks for conventions the model has no opinion about, and they run on the same substrate as every gate above. Whatever patterns such a check encodes, and whichever document defines them, belong to the adopting repo, not to this model: the mechanism is "a registered check, scoped to added lines, blocking new violations without forcing a legacy cleanup," and the content is the host's. This repo's own instance is a UI-color check registered against its house style; another repo's would be something else entirely. Same enforcement substrate as above (CI red/green + required review-gate check with branch protection + local hooks).
307
307
  - **Typecheck, tests** — standard CI gates; always blocking.
308
308
  - **Issue template / no forbidden fields** — a required Issue template + a CI check reject planning metadata (priority/estimates/points) on task Issues, keeping them execution-only.
309
309
  - **Brief validation** — the Archivist's `brief-validation` job runs `packages/aeg-core/bin/verify-brief.ts` against the PR body and checks presence of every required brief section (Tier, `For:` model attribution, `Project:` — both read from the PR body's header block, before the first `##` heading, the same region the post-merge Archivist's provenance assembly reads — tagged Test Plan, surface map, doc-update list, worktree Step 0, stop conditions, autonomy clause, `Closes #N`); flags malformed briefs (`vinaya/needs:brief-correction`) and fails CI. **The trigger is the body, not the branch (`fix/brief-gate-nontask`):** the gate runs when the branch is `task/<tranche>/<n>` **or** the body is brief-shaped (`isBriefShaped` — ≥2 of surface map / doc-update list / stop conditions / autonomy clause, matched on `stripCode`'d text so a brief *quoted inside a fence* stays exempt). Bodies that are neither still bypass — that exemption is for an ordinary non-AEG PR (a one-line dependency bump) which carries no brief and must not be forced to grow one. The old branch-only bypass was the wrong proxy for it: a standalone `fix/*` brief **is** a brief, and it skipped every section check — confirmed live on `fix/studio-tranche-href`, which shipped with no §7 documentation-update list because `checkDocUpdateList`, the checker that exists for exactly that, never ran. `Closes #N` remains **task-branch-only** (`BriefSectionsOptions.requireClosesN`): a standalone fix brief has no task Issue to close, and a `plan/*` PR is *forbidden* to carry one by the plan-PR guard below — requiring it there would make the two gates jointly unsatisfiable. The same validator also runs at **authoring time** as the `brief-shape` check — `PR_BODY="$(cat brief.md)" vinaya check brief-shape` (on this repo's toolchain, also `bun packages/aeg-core/bin/verify-brief.ts --body-file <brief.md>`) — before a PR or even a branch exists, so the Planner's dispatch act gates a brief before dispatch rather than after the Developer has done the work (`roles/planner/reference.md` § The dispatch act); with no `BRANCH`, the branch is read from the brief's own Step 0 `git worktree add … -b` line. **Includes the plan-PR Closes guard**: a `plan/*` branch whose PR body carries `Closes #N` fails CI before the non-task bypass even runs — a plan PR creates Issues, it does not resolve one (`roles/planner.md`); this closed a confirmed pattern of plan PRs prematurely closing task Issues on merge. **Real**, now the `Brief Validation` step (9/9) of the AEG gate suite job in `.github/workflows/forge-lifecycle.yml`. Presence-only — it cannot judge whether a Test Plan item is truly scriptable or whether a declared `unit-tests-only` is justified by the surface map; those remain Reviewer + Verification judgment. Same enforcement substrate as above.
@@ -311,13 +311,13 @@ The lowest-commitment way to run AEG: read-only over a team's existing process.
311
311
  - **Manifest integrity** — `verify-docs --full` and the coherence oracle validate the doc-owners manifest: pointer existence (M1), glob syntax (M2 advisory), and duplicate globs (M3). There is no decision-number sequencing: the log it validated is gone.
312
312
  - **Closes #N gate** — task-branch PRs must declare `Closes #<its-issue>` in the PR body; absence fails CI. Non-task branches bypass this forward direction automatically. Real, installed at `.github/workflows/forge-lifecycle.yml::closes-n-gate`. Same enforcement substrate as above. **Forge-native-tranche fix (`fix/closes-n-forge-native`):** the gate's scoped `loadTrancheFiles(null, onlySlug)` call discovers which tranches exist by listing `aeg-root/tranches/*.md` filenames — a tranche with zero topology file never entered that enumeration, so the forge derivation was never invoked for it despite the tranche already being fully Milestone-capable, and the gate failed every such PR with a misleading "no topology file found." Fixed by falling back to a direct forge derivation (the Milestone-existence check plus the file-and-forge composition, today `indexTrancheMilestonesAsync` + `mergeFileTopology`) when the requested `onlySlug` isn't found via files, gated on an actual open Milestone existing so an unrecognized branch slug still fails honestly — the scoped-path counterpart to `verify-dispatch.ts`'s `otherActiveTrancheSlugs` fix. **Reverse direction (`fix/closes-n-reverse`):** a `Closes #N` that resolves to a real AEG task Issue (title matches the `[<tranche-slug>] <task-id>...` convention and carries a `vinaya/tranche:<slug>` label) now requires the branch to actually be named `task/<tranche-slug>/<task-id>`, regardless of what the branch itself is called — closing the blind spot that let a mis-named branch implement a real task Issue with zero forge-visible status. One batched forge query (`fetchTaskIssueRefs`) resolves each referenced Issue's task identity before `checkClosesN` runs. **Code-span hardening (`fix/closes-gate-hardening`):** both the pre-merge gate (`checkClosesN` in `brief-validation.ts`) and the coherence-side parse (`extractClosesReferences` in `coherence-checks.ts`) now `stripCode` the body before matching the closing keyword, as GitHub's own auto-close parser ignores `Closes #N` inside a code span or fenced block. Inline spans of **any backtick-run length** are covered (`` `x` ``, `` ``x`` ``, …) via CommonMark's `(`+)…\1` matched-run rule — the double-backtick form was a false-green in the first cut (peeled as two empty spans). Fenced blocks are matched by a line scanner that pairs a fence with its own closer by **character and run length**: `~~~` tilde fences, info strings (```` ```js ````), and runs longer than three (```` `````` ````) all strip correctly, and an unclosed fence runs to end of body as GitHub renders it — the earlier `` /```[\s\S]*?```/g `` regex missed all three. The keyword set matches GitHub's own: `close`/`closes`/`closed`, `fix`/`fixes`/`fixed`, `resolve`/`resolves`/`resolved`. Before this, a body whose only `Closes #N` was backticked passed the gate **green** yet merged **without** closing its Issue, then read red on every open PR via A3 `auto-close-misfire`; "verify-docs green" now implies "GitHub will auto-close" for fenced + inline-code forms. 4-space **indented** code blocks are stripped too, conservatively: a ≥4-column-indented run counts as code only when it follows a blank line *and* is not inside a list — since within a list item that indentation is the item's own content indent, which GitHub *does* auto-close (blanking it would be a false-red, the brief's over-strip stop condition). The strip runs on the **whole body, before any region is sliced out of it** — never on a slice. Every rule in it is block-structural (a fence pairs with its own closer; an indented run is code only after a blank line and outside list context), so a fragment strips differently from the same text in place: stripping the sliced `AEG:CLOSES` region blanked an anchor indented inside a list item — list content GitHub *does* auto-close — and the Archivist's `extractIssue` returned no Issue, stranding it on merge exactly as before. Markers are HTML comments and survive the strip, so selecting the region from stripped text loses nothing and subsumes the decoy protection: a decoy anchor inside code never survives to be sliced. The same grammar governs `maskCode`, the index-preserving variant `anchoredRegion` runs to find the `AEG:*` markers themselves — it is **upstream** of every `stripCode` call, so while it stayed on the naive fence/inline regexes a decoy `AEG:CLOSES` anchor inside a tilde fence, a ≥4-backtick fence, a double-backtick span, or an indented block won the region outright and the gate resolved a **wrong** Issue number (worse than the strandings above: the post-merge Archivist's `extractIssue` would explicitly close an unrelated Issue). Both now delegate to one pair of scanners, differing only in what they emit per code line — nothing for `stripCode`, same-length filler for `maskCode` — so a divergence is a compile-level impossibility rather than a convention. This hardens all five anchored fields (`CLOSES`, `PROJECT`, `TIER`, `PREMISE`, `TEST-PLAN`) at once, not just the closing reference. `stripCode` normalises `\r\n`/`\r` to `\n` before any of these scanners run: the fence scanners anchor per line, and JS's `.`/`$` never match `\r`, so a CRLF body opened no fence at all and let a fenced `Closes #N` walk free — the same false-green along a new axis, and it hit exactly the web-UI-authored bodies this CI backstop exists for (HTML normalises textarea newlines to CRLF on submit). The closing-keyword separator is **bounded** (`\s{0,8}:?\s{0,8}`, identical in both parsers): two adjacent unbounded `\s*` groups backtrack quadratically on `closes` + long whitespace + no `#` — ~2.0 s at GitHub's 65,536-char body cap, run twice on the fail path — where the bound is 0.1 ms. **Known residual:** a genuine indented code block *nested inside a list* is therefore left unstripped — the deliberately safe direction of that trade. A `Closes #N` surviving only inside code fails with an actionable message pointing at a bare reference in the `AEG:CLOSES` anchor. `stripCode` is the one shared stripper, exported from `anchored-region.ts` (no duplicated regex).
313
313
  - *(The practitioner-facing map of every enforcement mechanism — prevention, detection, audit — lives in `aeg-root/enforcement.md`; this section remains the normative gate registry.)*
314
- - **Tool-layer forge gates (ring 0)** — the earliest enforcement point: a tool-interception hook, wired into the agent's own host so it runs before any raw forge-mutating call reaches GitHub, denies raw `gh pr create`/`gh pr edit --body*`/`gh issue create`/`gh issue edit --body*` (and `gh api` creation POSTs), directing agents to the validated wrappers `packages/aeg-core/bin/open-pr.ts` (runs verify-brief + verify-docs `--pr` + the Closes #N gate locally, calls `gh` only on green) and `bin/open-issue.ts` (a task Issue with a `vinaya/tranche:*` label must carry the full eight-field Planner rationale — `checkIssueRationale`, planner-developer contract, **and pass three content checks on what those fields say, `checkBlastRadiusScope` (the declared surface may not reach a shared collision domain — live-derived `packages/*` workspace members, built-in cross-cutting defaults, plus any `vinaya.config.json` `blastRadius.extraDomains` entries — that no declared project owns, absent a second **registered** project or a `blast-radius-ack:` line), `checkNoBriefContent` (no brief-shaped section in the Issue), `checkRationaleNamesDocs` (the rationale names a concrete doc/skill path, or the `no-doc-surface` sentinel). `checkConflictCompleteness` warns on an undeclared collision-domain overlap and never blocks**). Prevention, not detection: a malformed PR/Issue body is refused at the agent's own tool call and never reaches the forge; the CI gates below re-run the identical aeg-core checks purely as a backstop for non-hook writers. Also enforced at the same layer: title grammar (`checkForgeTitle`, both wrappers), the single-plan-PR guard (`checkSinglePlanPr` — a diff touching a tranche's topology file is refused when another OPEN PR already touches that same tranche's topology file), `gh api` PATCH/curl write-method denies, and a `.husky/pre-push` gate refusing `task/<tranche>/<id>` pushes whose id has no topology row (mechanical). On this repo's shipped reference host, this hook type is a `PreToolUse` hook (`.claude/hooks/check-forge-gates.sh`, wired in `.claude/settings.json`) — one instance of the pattern, not the concept itself; see `tranche-model.md` §12 for how this doctrine names its one concrete example. Operational rule: restart running agent sessions after merging hook/settings changes — hooks load at session start. Same mechanism as skill-check enforcement and the T9 merge gate.
315
- - **Single-plan-PR CI backstop** — `checkSinglePlanPr` (`packages/aeg-core/src/single-plan-pr.ts`) was extracted from `open-pr.ts` (previously private to that wrapper) so the identical predicate could also run forge-side: `.github/workflows/forge-lifecycle.yml::single-plan-pr-gate` re-fetches this PR's touched files plus every other open PR's touched files and fails CI on the same violation the ring-0 hook refuses locally. Closes the gap where a PR opened directly via the GitHub web UI bypasses `open-pr.ts` entirely. No-ops (never fires) for an ordinary task-branch PR, since its diff never touches a tranche topology file. **Dormant in this repo entirely, as of the forge-native cutover:** a plan is now a Milestone plus labeled Issues, and `aeg-root/tranches/` holds no active topology file for a diff to collide over. The guard is kept, not deleted, because it is correct and live for any repo that does keep plans as files — but nothing here can trip it, and a gate that cannot fire should say so rather than read as active protection. One implementation, two enforcement points — no second copy of the predicate.
314
+ - **Validated forge writes (ring 0)** — the earliest enforcement point this repo has: the validated wrappers `packages/aeg-core/bin/open-pr.ts` (runs verify-brief + verify-docs `--pr` + the Closes #N gate locally, calls `gh` only on green) and `bin/open-issue.ts` (a task Issue with a `vinaya/tranche:*` label must carry the full eight-field Planner rationale — `checkIssueRationale`, planner-developer contract, **and pass three content checks on what those fields say, `checkBlastRadiusScope` (the declared surface may not reach a shared collision domain — live-derived `packages/*` workspace members, built-in cross-cutting defaults, plus any `vinaya.config.json` `blastRadius.extraDomains` entries — that no declared project owns, absent a second **registered** project or a `blast-radius-ack:` line), `checkNoBriefContent` (no brief-shaped section in the Issue), `checkRationaleNamesDocs` (the rationale names a concrete doc/skill path, or the `no-doc-surface` sentinel). `checkConflictCompleteness` warns on an undeclared collision-domain overlap and never blocks**). Prevention, not detection: a malformed PR/Issue body sent through a wrapper is refused locally and never reaches the forge; no hook refuses a raw `gh` write, so the CI gates below re-run the identical aeg-core checks against whatever landed, and a dispatched reviewer's permissions additionally deny raw `gh pr` writes. Also enforced at the same layer: title grammar (`checkForgeTitle`, both wrappers), the single-plan-PR guard (`checkSinglePlanPr` — a diff touching a tranche's topology file is refused when another OPEN PR already touches that same tranche's topology file), and a `.husky/pre-push` gate refusing `task/<tranche>/<id>` pushes whose id has no topology row (mechanical). This repo ships no tool-interception hook, so nothing at the agent's own tool call refuses a raw forge write. Operational rule: restart running agent sessions after merging hook/settings changes — hooks load at session start.
315
+ - **Single-plan-PR CI backstop** — `checkSinglePlanPr` (`packages/aeg-core/src/single-plan-pr.ts`) was extracted from `open-pr.ts` (previously private to that wrapper) so the identical predicate could also run forge-side: `.github/workflows/forge-lifecycle.yml::single-plan-pr-gate` re-fetches this PR's touched files plus every other open PR's touched files and fails CI on the same violation the validated `open-pr.ts` wrapper refuses locally. Closes the gap where a PR opened directly via the GitHub web UI bypasses `open-pr.ts` entirely. No-ops (never fires) for an ordinary task-branch PR, since its diff never touches a tranche topology file. **Dormant in this repo entirely, as of the forge-native cutover:** a plan is now a Milestone plus labeled Issues, and `aeg-root/tranches/` holds no active topology file for a diff to collide over. The guard is kept, not deleted, because it is correct and live for any repo that does keep plans as files — but nothing here can trip it, and a gate that cannot fire should say so rather than read as active protection. One implementation, two enforcement points — no second copy of the predicate.
316
316
  - **Coherence oracle (A1/A2/A3/T1/T2/T3/D1/M1/M3)** — `packages/aeg-core/bin/verify-coherence.ts` runs against every PR and genuinely blocks CI — the CLI's own exit code, non-zero on any `fail`-status check, is what the `coherence-gate` job exits with. Failures in A1 (closed-without-merge), A2 (archived-without-provenance), A3 (auto-close-misfire), T1 (phantom-issue-ref), T2 (orphan-task — **plan PRs only, see below**), T3 (tbd-in-active-tranche), D1 (dispatched-on-unmet-deps), M1 (manifest-dangling), and M3 (manifest-duplicate-glob) fail CI. L1–L5 and M2 are advisory (info-only) — every `checkL*` returns `status: info`, so a premature-archive, lifecycle-hygiene, Milestone-attachment-drift, or open-Milestone-all-closed finding is surfaced for a human to investigate but never fails CI. On A1 failures the relevant Issues receive the `vinaya/incoherent` label (Section 14). Real, installed at `.github/workflows/forge-lifecycle.yml::coherence-gate`. Same enforcement substrate as above. **The job's repo-state inputs (topology files, tranche list) are read from a freshly-fetched `origin/main` — not the checkout's `refs/pull/N/merge`, which GitHub materializes lazily and can lag behind main (5+ false-red cycles, 2026-07-03/04). A plan PR's own topology diff still reads from its head ref.**
317
- - **Planner→Developer rationale completeness (R1)** — the same coherence oracle's **R1** check re-runs `checkIssueRationale` **and `checkProjectsRegistered`** (`packages/aeg-core`) against every open task Issue's body, batched per active tranche alongside T2. A non-grandfathered Issue missing any of the eight `contracts/planner-developer.md` rationale fields — or whose `Project:` field names a project with no row in the project registry — fails CI. Paired with the ring-0 creation gate (`bin/open-issue.ts`, same tool-layer-forge-gates row above) — R1 is the continuous half, the hook is the point-of-creation half; one grammar, two enforcement points (`aeg-root/enforcement.md`). Pre- Issues are grandfathered by explicit Issue number (`R1_GRANDFATHERED_ISSUES`), reported `info`, never blocking — see Section 15b. **Real.** Moves this seam's rationale-completeness half from Trusted (below) to Enforced; the "role doc matches contract prose" half of contract conformance remains Trusted.
317
+ - **Planner→Developer rationale completeness (R1)** — the same coherence oracle's **R1** check re-runs `checkIssueRationale` **and `checkProjectsRegistered`** (`packages/aeg-core`) against every open task Issue's body, batched per active tranche alongside T2. A non-grandfathered Issue missing any of the eight `contracts/planner-developer.md` rationale fields — or whose `Project:` field names a project with no row in the project registry — fails CI. Paired with the ring-0 creation gate (`bin/open-issue.ts`, the validated forge writes bullet above) — R1 is the continuous half, `bin/open-issue.ts` is the point-of-creation half; one grammar, two enforcement points (`aeg-root/enforcement.md`). Pre- Issues are grandfathered by explicit Issue number (`R1_GRANDFATHERED_ISSUES`), reported `info`, never blocking — see Section 15b. **Real.** Moves this seam's rationale-completeness half from Trusted (below) to Enforced; the "role doc matches contract prose" half of contract conformance remains Trusted.
318
318
  - **Review gate — code-review + security-review verdicts, bound to the commit they judged** — `packages/aeg-core/bin/verify-review-gate.ts`, a step of the AEG gate suite job, blocks merge on a task-branch PR unless a clean code-reviewer `APPROVE` verdict comment AND a clean security-review `PASS` verdict comment both exist AND both cover the PR's current head commit — `REQUEST CHANGES`, `FAIL`, a missing verdict, an unclear one, or a clean verdict bound to a superseded commit (or carrying no binding at all) all fail CI (reviewed-commit binding). Reuses `extractCodeReviewVerdict`/`extractSecurityReviewVerdict` (`verdict-extraction.ts`) — the exact detection the post-merge Archivist's provenance assembly already ran, previously advisory-only (a DANGLING note on the merged PR, never a block) — now also parsing a same-comment `Judged head: <sha>` line and comparing it against `gh pr view --json headRefOid`, resolved from GitHub, never an env var or local git. A principal can waive it for one PR with an actor-verified `vinaya/waiver:review` label (the same `isWaiverLabelActorVerified` pattern, parameterized by label — see the waiver-label-actor row above); label presence alone is never sufficient. **Real, installed at `.github/workflows/forge-lifecycle.yml::aeg-gate-suite`.** Closes the gap where task PRs could previously merge with no review pass at all, and the second gap where a clean verdict could still merge stale code because nothing checked which commit it covered. **What remains Trusted, not Enforced: *dispatching* the code-reviewer/security-reviewer subagents in the first place** — see below; this gate only verifies a dispatched review's verdict is clean and current, it cannot make a review happen.
319
319
  - **Verification phase — `[principal]` Test Plan checkbox state** — `packages/aeg-core/bin/verify-test-plan.ts` (`evaluateTestPlanGate`, `test-plan-gate.ts`), the registered `test-plan` check, runs in the same blocking suite as every other check above and fails CI on any unticked `- [ ] **[principal]**` line, or on a missing Test Plan section for a task branch. **Real.** Moves the `[principal]`-checkbox-state half of the Verification phase from Trusted (below) to Enforced; the `[agent]` half is no longer a checkbox at all (task 12) — it is a fenced command list `vinaya pr report` executes, graded by the Evidence block's own freshness check instead.
320
- - **Registry load-bearing checks G1/G3/G4/G5/G6** — `apps/cli/src/checks/bin/check-registry-gates.ts` (the registered `registry-gates` check; `packages/aeg-core/bin/verify-registry.ts` is the standalone aeg-core-purity mirror, minus G6 — see below), a step of the AEG gate suite job, blocks merge on: G1 (a row's non-empty `implementation` that does not resolve to a real path on disk — report-only through its own rollout window, re-graded to blocking at task 8 once that window had cleared the orphan backlog it existed to surface); G3 (a file making the exact class of GitHub-mutating call `check-forge-gates.sh` gates — PR/Issue create, PR/Issue body/title edit, `gh api` create/edit, raw curl/wget writes — with no guarding Ring-0 row); G4 (a `#NNN` cited anywhere in `aeg-root/enforcement.md`'s body that does not resolve to a real Issue or PR in the forge); G5 (a contract's `producer`/`consumer` that is not a real `role_id`, or a role with an empty `performs`/`refuses_when`); G6 (task 8 — a row whose `Audience` cell reads `product` but whose `implementation` does not resolve to a real `coreCheckRegistry()` entry, the parity check "claimed checks must ship" exists for). **G2 (no-orphan-hook/CLI) stays report-only** — unchanged by task 8, it runs in the same step and prints `info` findings but never affects the exit code. Pure evaluators in `packages/aeg-core/src/registry-checks.ts`, parsing `packages/aeg-core/src/registry-parse.ts` — same shape (pure predicate + thin I/O shim) as `coherence-checks.ts`/`verify-coherence.ts`, deliberately a separate mechanism (different registry: `enforcement.md`'s own ring tables, not the tranche/forge state coherence-checks.ts reads). `registry-parse.ts`'s `GateRow` additionally carries `summary`/`category` and `description`/`spec` — purely descriptive fields consumed by the Vinaya `/how-it-works` page, not read by any G-check; G1–G6's pass/fail behavior is unaffected. `description` is the row's plain-language sentence and is resolved by header name, not column index; `spec` is the enforcement column it must never be confused with (the "what must be true"/"Re-verifies"/"Catches" slot before `implementation`). `GateRow.audience` (task 8) is the third by-header-name field, `product` or `repo-own`, defaulting to `repo-own` when the column is absent — the sole input G6 reads; it maps a `product` row's `implementation` to its claimed `coreCheckRegistry()` name(s) via `GATE_AUDIENCE` (`gate-audience.ts`, same package, no import cycle) for a `packages/aeg-core/bin/*` path, or 1:1 for a direct `apps/cli/src/checks/bin/check-*.ts` path. G6 needs `coreCheckRegistry()` itself, which lives in `apps/cli`; `aeg-core` cannot import it without closing a dependency cycle (same reasoning `gate-audience.ts` documents), so G6 runs only from `check-registry-gates.ts` — the standalone `verify-registry.ts` prints an explanatory note and skips it.
320
+ - **Registry load-bearing checks G1/G3/G4/G5/G6** — `apps/cli/src/checks/bin/check-registry-gates.ts` (the registered `registry-gates` check; `packages/aeg-core/bin/verify-registry.ts` is the standalone aeg-core-purity mirror, minus G6 — see below), a step of the AEG gate suite job, blocks merge on: G1 (a row's non-empty `implementation` that does not resolve to a real path on disk — report-only through its own rollout window, re-graded to blocking at task 8 once that window had cleared the orphan backlog it existed to surface); G3 (a file making the class of GitHub-mutating call the doctrine gates — PR/Issue create, PR/Issue body/title edit, `gh api` create/edit, raw curl/wget writes — with no guarding Ring-0 row); G4 (a `#NNN` cited anywhere in `aeg-root/enforcement.md`'s body that does not resolve to a real Issue or PR in the forge); G5 (a contract's `producer`/`consumer` that is not a real `role_id`, or a role with an empty `performs`/`refuses_when`); G6 (task 8 — a row whose `Audience` cell reads `product` but whose `implementation` does not resolve to a real `coreCheckRegistry()` entry, the parity check "claimed checks must ship" exists for). **G2 (no-orphan-hook/CLI) stays report-only** — unchanged by task 8, it runs in the same step and prints `info` findings but never affects the exit code. Pure evaluators in `packages/aeg-core/src/registry-checks.ts`, parsing `packages/aeg-core/src/registry-parse.ts` — same shape (pure predicate + thin I/O shim) as `coherence-checks.ts`/`verify-coherence.ts`, deliberately a separate mechanism (different registry: `enforcement.md`'s own ring tables, not the tranche/forge state coherence-checks.ts reads). `registry-parse.ts`'s `GateRow` additionally carries `summary`/`category` and `description`/`spec` — purely descriptive fields consumed by the Vinaya `/how-it-works` page, not read by any G-check; G1–G6's pass/fail behavior is unaffected. `description` is the row's plain-language sentence and is resolved by header name, not column index; `spec` is the enforcement column it must never be confused with (the "what must be true"/"Re-verifies"/"Catches" slot before `implementation`). `GateRow.audience` (task 8) is the third by-header-name field, `product` or `repo-own`, defaulting to `repo-own` when the column is absent — the sole input G6 reads; it maps a `product` row's `implementation` to its claimed `coreCheckRegistry()` name(s) via `GATE_AUDIENCE` (`gate-audience.ts`, same package, no import cycle) for a `packages/aeg-core/bin/*` path, or 1:1 for a direct `apps/cli/src/checks/bin/check-*.ts` path. G6 needs `coreCheckRegistry()` itself, which lives in `apps/cli`; `aeg-core` cannot import it without closing a dependency cycle (same reasoning `gate-audience.ts` documents), so G6 runs only from `check-registry-gates.ts` — the standalone `verify-registry.ts` prints an explanatory note and skips it.
321
321
  - **Canonical action set** — `packages/aeg-core/src/actions.ts` exports `ACTIONS`, the 10-entry list of every AEG action that either crosses into GitHub (`crosses: 'into-github'`) or hands work across a role-seam contract (`crosses: 'none'`) — 6 crossings plus 4 seam-only actions, with no duplicate id for the two seams already accomplished by a crossing. Pure data (zero I/O, same shape as `waiver-label.ts`); `commit-the-work` is `'none'` because `git commit` is local-only (only `git push`/`publish-the-branch` reaches the forge). G3's crossing-file detection uses the `crosses: 'into-github'` subset; the `DiagramModel` derivation (`deriveDiagramModel`, `packages/aeg-core/src/diagram-model.ts`) now exists and places each action on a ring-0 gate (via `guards` edges) or a role/contract edge (via `performs`/`produces`/`consumes`), consuming this same `ACTIONS` list plus its `CROSSING_KEYWORDS` map (promoted into `actions.ts` alongside `ACTIONS` this task) — so G3's completeness set and the diagram's edge count cannot drift apart. The derivation is pure and takes doctrine through a `DoctrineSource` seam (`packages/aeg-core/src/doctrine-source.ts`, I/O-free; file-backed adapter `createFileDoctrineSource` in `@attalabs/vinaya-sources`), never `aeg-root/` paths directly. `actions.test.ts` cross-checks every `into-github` action against a real Ring-0 gate row in `enforcement.md` and every `performedBy` against a real `role_id`. Each entry also carries a `summary` question and a **required** `description` — required, so a new action cannot be added without one; `deriveDiagramModel` threads both onto the action's node, along with its `crosses`, which a client renderer cannot read off `ACTIONS` itself (importing it drags `node:child_process` into the browser bundle).
322
322
  - **Code-owned state machine + label vocabulary** — the same one-list-of-pure-data discipline, applied to status derivation. `packages/aeg-core/src/state-machine-model.ts` exports three parts: `FORGE_FACT_INPUTS` (every `ForgeFacts` field and the GitHub object it is read from), `DERIVED_STATUSES` (the 9-value set; `backlog` stays a member but derivation never emits it inside a tranche), and `DERIVATION_RULES` — the ordered rule list, first match wins, each entry carrying its predicate, its prose, and the reason its position matters. `deriveStatus` (`derive-tranche.ts`) executes that list, so the rules a reader sees rendered and the rules that actually run are the same objects. The list is total (its final rule matches unconditionally), and `state-machine-model.test.ts` pins the order rule-for-rule, proves every derivable status reachable, proves no rule is shadowed by an earlier one, and asserts equivalence with the pre-refactor `if`-chain across all 432 combinations of the facts derivation reads. The label vocabulary lives in `packages/aeg-forge-state/src/labels.ts` (`LABELS` + `AEG_BLOCKED_LABEL`) — in `aeg-forge-state`, not `aeg-core`, because the dependency direction is `aeg-core → aeg-forge-state → aeg-types` and the vocabulary's first consumer, `map-forge-facts.ts`, lives there and cannot import backward. Each label records the single orthogonal fact it carries; there is deliberately no `status:*` label, since status is derived and never written. `state-machine-model.ts` does **not** import that vocabulary: derivation works on `ForgeFacts`, never on label strings, and importing `@attalabs/aeg-forge-state` would drag its `node:child_process` into any browser bundle rendering the model — the same hazard the `ACTIONS` note above records.
323
323
 
@@ -411,7 +411,7 @@ No label outside this table may be applied to a task Issue or its PR. (The Archi
411
411
  | `vinaya/needs:principal-input` | Issue | Routes to the **Principal** — the surface the Principal scans to see what is waiting on them. | Developer at escalation; removed when answered. | Conditional-mandatory |
412
412
  | `vinaya/needs:brief-correction` | Issue/PR | The Archivist's "this brief is malformed" flag (§3, §12). | Archivist (automation); removed when the brief is fixed. | Conditional-mandatory |
413
413
  | `vinaya/override:docs` | PR | Suppresses the verify-docs gate for one PR (§12) — honored identically in `--pr` and `--push` mode (previously dead code in push mode). | **Principal only**, deliberately. | **Optional** (escape hatch) |
414
- | `vinaya/waiver:docs` | PR | Honors a C5 doc-coverage finding PR-wide (§15) — but ONLY when this label's own labeling timeline event was actored by a configured principal; the forge can say a label was added, but not by whom in a way CI trusts without a dedicated actor check, so this row exists to mark that the actor-verification layer, not the label add, is what carries the authority. | **Principal only**, applied outside any agent session — `.claude/hooks/check-forge-gates.sh` denies any agent-session command that mutates this specific label. | **Optional** (escape hatch) |
414
+ | `vinaya/waiver:docs` | PR | Honors a C5 doc-coverage finding PR-wide (§15) — but ONLY when this label's own labeling timeline event was actored by a configured principal; the forge can say a label was added, but not by whom in a way CI trusts without a dedicated actor check, so this row exists to mark that the actor-verification layer, not the label add, is what carries the authority. | **Principal only**, applied outside any agent session — enforced by the labeling event's actor check, not by a hook: no session hook stops an agent applying the label with the Principal's shared credential, so an agent-applied label carries no authority. | **Optional** (escape hatch) |
415
415
 
416
416
  ### Two rules that are easy to get wrong
417
417
 
@@ -616,8 +616,9 @@ Sibling to `verify-docs.ts`/`verify-coherence.ts`, same thin-CLI-shim discipline
616
616
 
617
617
  **The default-mode composite ships as the `dispatch-readiness` check** (`vinaya check dispatch-readiness`, branch-scoped) — see `enforcement.md`'s dispatch row for its known parity gap (prior-tranche-archival always reports empty). The `--premise`/`--simulate`/`--check-baseline` modes below have no shipped `vinaya` equivalent yet.
618
618
 
619
- **Usage (this repo's toolchain)** — four independent invocation forms, not a sequence:
619
+ **Usage (this repo's toolchain)** — five independent invocation forms, not a sequence:
620
620
  - Default mode: `bun packages/aeg-core/bin/verify-dispatch.ts <tranche> <n>`
621
+ - Default mode, resuming existing work: `bun packages/aeg-core/bin/verify-dispatch.ts <tranche> <n> --existing-work` — commits already ahead of main never refuse dispatch (the review-loop driver passes it before every Developer turn)
621
622
  - Premise re-assertion: `bun packages/aeg-core/bin/verify-dispatch.ts <tranche> <n> --premise <body-file>`
622
623
  - Simulate mode: `bun packages/aeg-core/bin/verify-dispatch.ts <tranche> <n> --simulate <body-file>`
623
624
  - Baseline compare: `bun packages/aeg-core/bin/verify-dispatch.ts <tranche> <n> --check-baseline <file>`
@@ -28,6 +28,10 @@ You are the AEG Developer. Run `vinaya doctrine --role developer --print` and re
28
28
 
29
29
  [Copied verbatim from the Issue's own `## Documentation` section — every normative source this task depends on (a doc URL, an in-repo spec), each against the mechanism it governs: `- <source> — <mechanism>`. A task with no externally-normative source states the explicit `None` sentinel instead of an empty section. Placed immediately after Objectives, before the Developer holds a complete plan, so it is read first rather than skimmed as appendix evidence after the fact. Every source named here must be read before Step 0 — `aeg-root/roles/developer.md`'s entry gate names the obligation; a `PostToolUse`/`Stop` hook pair enforces it mechanically, not the Developer's own judgement.]
30
30
 
31
+ ## Premises
32
+
33
+ [Copied from the Issue's own `## Premises` section — one line per fact about the code this plan rests on, written `` `<path>` contains `<text>` `` and optionally prefixed `after #<n>:` for a fact a declared dependency has yet to make true. Every line was asserted against the checkout when the Issue was cut and asserted again against the default branch immediately before this render, so read them as checked facts, not as claims to re-verify by hand. A task whose Boundary states nothing about the code as it stands carries no premise and the heading is omitted. Distinct from §4's `**Premise:**` pins, which pin the surface files' current bytes rather than the plan's own facts.]
34
+
31
35
  ## 2. Context — read before doing anything
32
36
 
33
37
  - **Tranche:** [`tranche-slug`], task [n], Issue #[N]. Branch `task/[tranche-slug]/[n]`. `Depends-on: [—|ids]`, `Conflicts-with: [—|ids]`. Confirm dispatch readiness at your own Step 0, with the command §5 names.
@@ -59,17 +63,19 @@ You are the AEG Developer. Run `vinaya doctrine --role developer --print` and re
59
63
 
60
64
  **Step 0 (mandatory, verbatim):**
61
65
 
66
+ Under the review loop the driver has already created this worktree, outside any sandbox, and your working directory is it — the rendered Step 0 is only the install line of the command below, run from that worktree. Working manually, with no driver, run the whole command as written to create the worktree first, then enter it and install.
67
+
62
68
  ```
63
69
  git worktree add .worktrees/task/[tranche-slug]/[n] -b task/[tranche-slug]/[n] --no-track origin/main && cd .worktrees/task/[tranche-slug]/[n] && git config push.autoSetupRemote true && bun install --frozen-lockfile --silent
64
70
  ```
65
71
 
66
72
  1. Clean status; parent `origin/main`; branch suffix literal-matches topology `#` column (`[n]`).
67
- 2. `vinaya check dispatch-readiness` → pass required; else STOP. (Known gap: its prior-tranche-archival predicate always reports empty — confirm that predicate yourself regardless. A repository that ships an unabridged derivation of its own has the render name that too — in this repo, `bun packages/aeg-core/bin/verify-dispatch.ts [tranche-slug] [n]`.)
73
+ 2. Under `vinaya dispatch`/the review loop, the driver has already run the dispatch-readiness gate (the shipped check, plus this repository's own fuller derivation where it ships one) from its own unsandboxed process before dispatching you, and staged the combined verdict in this round's own Developer folder — read it there; either script's own `gh` call fails inside your sandbox. Working manually, with no driver behind you, fall back to `roles/developer.md`'s own items 3/5/7 prose — each a complete, hand-run forge check in its own right.
68
74
  3. [any task-specific pre-flight checks — required tools present, reference files readable, re-digs to confirm the §2 citations]
69
75
 
70
76
  On any failure: STOP and report.
71
77
 
72
- ## 6. Numbered parts — commit after EACH part; push once, before opening the PR
78
+ ## 6. Numbered parts — call `publish_changes` after EACH part; `open_pull_request` once the first part is published
73
79
 
74
80
  <!-- AEG:CLAIM: packages/aeg-core/src/brief-render.ts contains:function renderPartCitation(part: IssuePart): string { -->
75
81
  [Rendered from the Issue's `## Parts` section — `vinaya brief render` fills one numbered Part per `Part <k> (O<n>[, O<m>]) — <outcome>` line, citation reconstructed verbatim, files grouped by package as today. Hand-authoring the same: exact files + exact function/type signatures + constraints — not prose. A Part that depends on a fact about current code opens with the fenced command that establishes it, followed by the executed output (skill §2's rule). Cite at least one `O<n>` from the Objectives section above; an administrative Part with no objective of its own (a changeset commit, the final push) may omit the citation.]
@@ -117,9 +123,9 @@ STOP and report if: pre-flight fails; [the Planner's stop-and-escalate condition
117
123
  ## 12. Deliverable
118
124
 
119
125
  - PR title (exact): `[[tranche-slug]] [n] — [task title]`
120
- - Open the PR only via `vinaya pr create --body-file <path> --title "<title above>"` — written, like every command the render emits, the way this repository itself invokes the CLI.
126
+ - Open the PR only via the `open_pull_request` tool (title and body); publish your commits with `publish_changes`, and update the body with `update_pull_request_body`/`refresh_evidence` — you hold no `gh`/`git push` credential of your own. (Working manually, with no driver, you publish these yourself with the CLI the way this repository invokes it.)
121
127
  - PR body = the Developer's PR report (print it with `vinaya doctrine --template pr-report --print`), with this entire brief pasted as the reference copy inside a collapsed `<details>` block, and `Closes #[N]` at the top of the header block.
122
128
  - [what to state in the PR body: decisions made, confirmations required by §8]
123
129
  - Pre-open gate: tier checklist satisfied, and `PR_BODY="$(cat <body-file>)" vinaya check doc-coverage` green (in this repo the render also names `PR_BODY="$(cat <body-file>)" bun packages/aeg-core/bin/verify-docs.ts --pr`).
124
- - Include `git diff main --stat` and a token report (if unavailable, state so).
130
+ - Include `git diff main --stat`. Token use needs no report here — it is recorded as the Vinaya log's own `usage` event.
125
131
  - Then STOP. Review and Verification are separate invocations.
@@ -69,14 +69,6 @@ The block opens with `Head:` and a `Summary:` line — a file and line count der
69
69
  **Tier:** [0 | 1 | 3]
70
70
  <!-- AEG:TIER:END -->
71
71
 
72
- ## Token report
73
-
74
- <!-- AEG:TOKENS:START -->
75
- | Phase | Role | Agent/Model | Tokens in | Tokens out | Cost | Date |
76
- |---|---|---|---|---|---|---|
77
- | [task-id]: develop | Developer | [model] | [exact in] | [exact out] | [cost] | [YYYY-MM-DD] |
78
- <!-- AEG:TOKENS:END -->
79
-
80
72
  ---
81
73
 
82
- **This body is written once, at open.** After the PR is open the Developer changes nothing outside the `AEG:EVIDENCE` anchor and one appended `AEG:TOKENS` row. The Principal's `[principal]` ticks are the Principal's writes and must survive every Developer edit. A round's response, its re-run evidence, and any disclosure the brief didn't anticipate are PR comments, never edits to this body. The brief itself never lives here — it is posted once, frozen, as the `aeg:brief:v1` comment on the task Issue (`vinaya task dispatch`); `pr create` refuses a body carrying either legacy `<!-- aeg:brief:start -->`/`<!-- aeg:brief:end -->` marker outright.
74
+ **This body is written once, at open.** After the PR is open the Developer changes nothing outside the `AEG:EVIDENCE` anchor. The body carries no token table: a dispatched turn's token use is recorded as the Vinaya log's own `usage` event, never in this body. The Principal's `[principal]` ticks are the Principal's writes and must survive every Developer edit. A round's response, its re-run evidence, and any disclosure the brief didn't anticipate are PR comments, never edits to this body. The brief itself never lives here — it is posted once, frozen, as the `aeg:brief:v1` comment on the task Issue (`vinaya task dispatch`); `pr create` refuses a body carrying either legacy `<!-- aeg:brief:start -->`/`<!-- aeg:brief:end -->` marker outright.
@@ -280,7 +280,7 @@ Append-only. Each row records one role's turn at a phase. Re-entry appends a **n
280
280
 
281
281
  ### The append rule (read this exactly the way you read derived status)
282
282
 
283
- - **No role appends its own row on a task branch.** Two live-fire incidents forced this: read-only roles (Reviewer, Security, Planner) structurally cannot append — they hold no task branch, and some never touch the repo's filesystem at all; and parallel Developer sessions on different tasks collided appending to the same shared `tokens.md` file. Instead, every role **reports** its token spend in the artifact its turn already produces — the PR body ("Token report" section) for a role holding a branch, the verdict comment for a reviewing role, the plan PR or planning report for the Planner (either act) — and the per-task **Archivist appends every row at task close-out**, one row per role-turn, including its own.
283
+ - **No role appends its own row on a task branch.** Two live-fire incidents forced this: read-only roles (Reviewer, Security, Planner) structurally cannot append — they hold no task branch, and some never touch the repo's filesystem at all; and parallel Developer sessions on different tasks collided appending to the same shared `tokens.md` file. Instead, a dispatched role's spend is recorded where the dispatch already writes: the Vinaya log's own `usage` event, one per attempt, collected from the agent host with no step of the role's own in between. A role whose turn is not dispatched still **reports** its spend in the artifact that turn already produces — the verdict comment for a reviewing role, the plan PR or planning report for the Planner (either act) — and the per-task **Archivist appends every row at task close-out**, one row per role-turn, including its own. A pull-request body is no longer one of those artifacts: the "Token report" section a task PR used to carry is retired, and a body that still shows one, opened before this changed, keeps it untouched.
284
284
  - **Never edit** an existing row. If you discover a mistake, append a new row that supersedes it in prose (or fix the source file in a separate, declared edit — same exception that `state-machine.md` §13 carves for forward-reference fields).
285
285
  - **Re-entry appends.** A Developer dispatched for `9: develop`, asked for changes, and re-running for `9: develop` again produces a **second** `9: develop` report, which the Archivist appends as a **second** row — never a sum, never an overwrite. The two rows both count.
286
286
  - The **tranche total is `sum(rows)`**, derived at read time, never stored. This is the same philosophy as forge-derived status (don't store the aggregate; sum the immutable entries). A stored total reintroduces the merge-collision + stale-aggregate problem.
@@ -291,7 +291,7 @@ Token reporting is three separable things, and only one of them depends on the a
291
291
 
292
292
  1. **The obligation — portable.** Every role reports its own turn's usage at turn-end. This does not weaken, is not best-effort, and is not conditional on the host making it convenient. It exists because the figure is otherwise unrecoverable after the fact (see the retraction below).
293
293
  2. **Collection — host-specific.** *How* a role obtains true figures for its own turn. This is the only layer an adapter belongs in, and the only layer that may name a host, a transcript format, or a script path.
294
- 3. **The destination and the grammar — portable.** The `Tokens: …` line, in the artifact the role's turn already produced: the PR body's "Token report" section for a role that holds a branch, the verdict comment for a reviewing role, the plan PR or planning report for the Planner. The ledger stays append-only, and the Archivist transcribes what each role reported rather than re-deriving it.
294
+ 3. **The destination and the grammar — portable.** For a dispatched role, the Vinaya log's own `usage` event, written by the dispatch path: the role reports nothing itself, and its pull-request body carries no token table. For every other role, the `Tokens: …` line in the artifact that turn already produced — the verdict comment for a reviewing role, the plan PR or planning report for the Planner. The ledger stays append-only, and the Archivist transcribes what each role reported rather than re-deriving it.
295
295
 
296
296
  The destination was never the coupled part — no role writes a shared ledger file on a task branch, so layer 3 is satisfied through the forge for every task-branch role. One source remains the known open gap recorded in `roles/archivist.md`: the Planner's tranche-wide report — the Archivist's own row is not part of it (see the "Known gap" paragraph below). **An adopter implements layer 2 for their own harness and inherits layers 1 and 3 unchanged.** A doctrine sentence that names a tool belongs in layer 2 or nowhere.
297
297
 
@@ -324,9 +324,9 @@ AEG ships exactly one collection adapter, for today's shipped reference host, Cl
324
324
 
325
325
  ### Live reads (Studio) — a second, narrower read path
326
326
 
327
- Vinaya Studio's tranche page no longer reads `<name>.tokens.md` off disk to render token totals — it re-derives the same row shape live off the forge: every MERGED PR on a task's own branch (`task/<tranche>/<id>`), parsing the Developer's "Token report" entries from the PR body (every one, including re-push entries) and the Reviewer's/Security's `Tokens: …` lines from that PR's comments (`@attalabs/aeg-core`'s token-report parser, `aggregateTaskTokenRows`, fetched by Studio's own forge-reading layer in the repo that hosts it). Same row shape, same `sumLedger` totals math (`parse-ledger.ts`) — different source.
327
+ Vinaya Studio's tranche page no longer reads `<name>.tokens.md` off disk to render token totals — it re-derives the same row shape live off the forge: every MERGED PR on a task's own branch (`task/<tranche>/<id>`), parsing the Reviewer's/Security's `Tokens: …` lines from that PR's comments, and a "Token report" entry from the PR body wherever a body opened before that section was retired still carries one (`@attalabs/aeg-core`'s token-report parser, `aggregateTaskTokenRows`, fetched by Studio's own forge-reading layer in the repo that hosts it). Same row shape, same `sumLedger` totals math (`parse-ledger.ts`) — different source. **A dispatched role's own spend is no longer on this path at all:** it is written to the Vinaya log as a `usage` event, which is the record to read for it.
328
328
 
329
- This is deliberately **narrower** than what the Archivist collects into the file: it cannot recover the Planner's `Tokens: planning …` report (no reliable way to attribute a plan PR to one task from the forge alone without false-positive cross-task matches, confirmed live during 4b's build — a task Issue's cross-reference timeline picks up ANY PR that merely mentions its number in passing prose, not just its own plan PR). The Archivist's own `<task-id>: archive` row is not part of that gap: `vinaya archive` posts it inside the same provenance comment it posts on the merged task PR, so this mechanism recovers it exactly as it recovers every other role's row on that PR. The Planner's report remains recoverable only from `.tokens.md`, which is why the file is not deleted here (task 7's job, once the live mechanism is proven in wider use). A task's report that's missing or malformed (e.g. a "Token report" heading with no table and no parseable text after it) yields no row for that report, never a fabricated one — same discipline as the Archivist's own DANGLING convention.
329
+ This is deliberately **narrower** than what the Archivist collects into the file: it cannot recover the Planner's `Tokens: planning …` report (no reliable way to attribute a plan PR to one task from the forge alone without false-positive cross-task matches, confirmed live during 4b's build — a task Issue's cross-reference timeline picks up ANY PR that merely mentions its number in passing prose, not just its own plan PR). The Archivist's own `<task-id>: archive` row is not part of that gap: `vinaya archive` posts it inside the same provenance comment it posts on the merged task PR, so this mechanism recovers it exactly as it recovers every other role's row on that PR. The Planner's report remains recoverable only from `.tokens.md`, which is why the file is not deleted here. A report that's missing or malformed (e.g. a "Token report" heading with no table and no parseable text after it, on a body old enough to carry one) yields no row for that report, never a fabricated one — same discipline as the Archivist's own DANGLING convention.
330
330
 
331
331
  ### Anti-regression
332
332