@attalabs/vinaya 0.32.0 → 0.34.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 (218) hide show
  1. package/README.md +1 -1
  2. package/aeg-root/contracts/principal-operator.md +18 -5
  3. package/aeg-root/enforcement.md +1 -1
  4. package/aeg-root/glossary.md +4 -0
  5. package/aeg-root/roles/developer.md +3 -0
  6. package/aeg-root/roles/operator.md +89 -16
  7. package/aeg-root/roles/planner/reference.md +3 -2
  8. package/aeg-root/roles/planner.md +3 -1
  9. package/aeg-root/roles/tranche-archivist.md +1 -0
  10. package/aeg-root/skills/aeg-context-packets/SKILL.md +1 -1
  11. package/aeg-root/skills/aeg-context-packets/examples/operator-start.md +1 -1
  12. package/aeg-root/templates/brief-template.md +9 -7
  13. package/aeg-root/templates/pr-report-template.md +3 -1
  14. package/dist/checks/bin/check-body-bare-digits.js +213 -41
  15. package/dist/checks/bin/check-branch-topology.js +164 -41
  16. package/dist/checks/bin/check-brief-shape.js +219 -46
  17. package/dist/checks/bin/check-changeset-coverage.js +669 -152
  18. package/dist/checks/bin/check-closes-n.js +164 -41
  19. package/dist/checks/bin/check-coherence.js +220 -43
  20. package/dist/checks/bin/check-dead-branch-push.js +159 -40
  21. package/dist/checks/bin/check-dispatch-readiness.js +218 -42
  22. package/dist/checks/bin/check-doc-coverage-push.js +665 -148
  23. package/dist/checks/bin/check-doc-coverage.js +667 -150
  24. package/dist/checks/bin/check-doctrine-no-procedures.js +213 -41
  25. package/dist/checks/bin/check-doctrine-portability.js +666 -149
  26. package/dist/checks/bin/check-evidence-fresh.js +643 -125
  27. package/dist/checks/bin/check-exec-bits.js +663 -146
  28. package/dist/checks/bin/check-first-push-dispatch.js +218 -42
  29. package/dist/checks/bin/check-issue-assignment.js +164 -41
  30. package/dist/checks/bin/check-issue-milestone-attach.js +159 -40
  31. package/dist/checks/bin/check-issue-objectives-numbering.js +685 -41
  32. package/dist/checks/bin/check-issue-parts-coverage.js +159 -40
  33. package/dist/checks/bin/check-issue-surface-globs.js +258 -48
  34. package/dist/checks/bin/check-issue-title-grammar.js +159 -40
  35. package/dist/checks/bin/check-issue-tranche-label.js +159 -40
  36. package/dist/checks/bin/check-main-branch-refusal.js +159 -40
  37. package/dist/checks/bin/check-no-disk-state.js +159 -40
  38. package/dist/checks/bin/check-pr-premise-reassert.js +213 -41
  39. package/dist/checks/bin/check-pr-report-density.js +159 -40
  40. package/dist/checks/bin/check-principal-test-plan-wait.js +159 -40
  41. package/dist/checks/bin/check-quoted-command.js +586 -103
  42. package/dist/checks/bin/check-reader-resolvable-prose.js +637 -111
  43. package/dist/checks/bin/check-registry-gates.js +159 -40
  44. package/dist/checks/bin/check-retired-vocabulary.js +586 -103
  45. package/dist/checks/bin/check-review-gate.js +284 -152
  46. package/dist/checks/bin/check-single-plan-pr.js +159 -40
  47. package/dist/checks/bin/check-surface-scope.js +164 -41
  48. package/dist/checks/bin/check-test-plan.js +159 -40
  49. package/dist/checks/bin/check-token-collection-wired.js +159 -40
  50. package/dist/checks/bin/check-token-report.js +159 -40
  51. package/dist/checks/bin/check-workspace-escape.js +664 -147
  52. package/dist/index.js +3932 -1118
  53. package/dist/lib/pre-push-cache-test-run.js +507 -72
  54. package/dist/lib/pre-push-select-tests.js +136 -13
  55. package/package.json +1 -1
  56. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/actions.ts +10 -12
  57. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/anchored-region.ts +5 -5
  58. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/archive-task.ts +42 -17
  59. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/baseline-capture.ts +1 -2
  60. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/branch-topology-gate.ts +3 -3
  61. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/brief-render.ts +554 -95
  62. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/brief-validation.ts +264 -44
  63. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/claude-code-transcript.ts +9 -9
  64. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/coherence-checks.ts +211 -30
  65. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/consumer-enumeration.ts +2 -2
  66. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/control-store/index.ts +75 -0
  67. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/control-store/local.ts +961 -0
  68. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/control-store/migration.ts +222 -0
  69. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/control-store/outcomes.ts +135 -0
  70. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/control-store/records.ts +394 -0
  71. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dead-branch-push-audit.ts +1 -2
  72. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dead-branch-push-guard.ts +1 -1
  73. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/derive-section7.ts +2 -2
  74. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/assess-round.ts +514 -0
  75. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/fakes.ts +110 -0
  76. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/index.ts +30 -0
  77. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/journal-reconstruction.ts +219 -0
  78. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/render-summary.ts +97 -0
  79. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/types.ts +240 -0
  80. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/diagram-model.ts +1 -1
  81. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/direct-main-push.ts +1 -2
  82. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dispatch-gate.ts +65 -22
  83. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/doc-claim.ts +238 -0
  84. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/doc-owners.ts +14 -1
  85. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/docs/docs-coherence.ts +1 -1
  86. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/docs/legacy-anchors.ts +1 -1
  87. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/docs/node-route.ts +1 -1
  88. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/docs/surfaced-manifest.ts +1 -1
  89. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/doctrine-no-procedures.ts +1 -1
  90. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/doctrine-portability.ts +5 -5
  91. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/ensure-label.ts +1 -1
  92. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/first-push-dispatch-gate.ts +1 -1
  93. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/gate-audience.ts +14 -3
  94. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/index.ts +425 -11
  95. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/issue-assignment.ts +3 -4
  96. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/issue-validation.ts +1450 -33
  97. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/leftover-detection.ts +1 -2
  98. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/local-anchor-coverage.ts +2 -2
  99. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/envelope.ts +119 -0
  100. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/index.ts +75 -0
  101. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/redact.ts +87 -0
  102. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/schema.ts +801 -0
  103. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/store.ts +373 -0
  104. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/main-branch-refusal.ts +2 -2
  105. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/metering-io-guard.ts +1 -1
  106. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/milestone-validation.ts +2 -3
  107. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/no-disk-state.ts +2 -2
  108. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/objectives.ts +288 -0
  109. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/parse-token-report.ts +3 -3
  110. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/parse-tranche.ts +1 -1
  111. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/pr-report-density.ts +30 -16
  112. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/pr-tier.ts +17 -1
  113. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/premise-check.ts +1 -1
  114. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/quoted-command.ts +1 -1
  115. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/reader-resolvable-prose.ts +267 -19
  116. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/registry-checks.ts +91 -24
  117. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/registry-scaffold.ts +6 -6
  118. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/report-tokens.ts +4 -4
  119. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/review-gate.ts +254 -110
  120. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/review-input-manifest.ts +384 -0
  121. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/review-policy.ts +208 -0
  122. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/review-status.ts +80 -28
  123. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/ruling-ordinal.ts +92 -0
  124. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/single-plan-pr.ts +4 -4
  125. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/state-machine-model.ts +40 -27
  126. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/symbol-collisions.ts +2 -2
  127. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/task-branch-identity.ts +38 -0
  128. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/task-phase-history.ts +194 -0
  129. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/task-tools.ts +712 -0
  130. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/test-plan-gate.ts +7 -9
  131. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/test-plan-section.ts +5 -5
  132. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/types.ts +4 -4
  133. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/verdict-extraction.ts +368 -56
  134. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/waiver-label.ts +2 -3
  135. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/workspace-escape.ts +3 -3
  136. package/studio-standalone/apps/vinaya-studio/web/.next/BUILD_ID +1 -1
  137. package/studio-standalone/apps/vinaya-studio/web/.next/build-manifest.json +3 -3
  138. package/studio-standalone/apps/vinaya-studio/web/.next/prerender-manifest.json +3 -3
  139. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.html +1 -1
  140. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.rsc +1 -1
  141. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  142. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  143. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  144. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  145. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  146. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_not-found/page/server-reference-manifest.json +2 -2
  147. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_not-found/page.js.nft.json +1 -1
  148. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  149. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/api/coherence/route.js +1 -1
  150. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/api/coherence/route.js.nft.json +1 -1
  151. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/page/server-reference-manifest.json +2 -2
  152. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/page.js.nft.json +1 -1
  153. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/page_client-reference-manifest.js +1 -1
  154. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/backlog/page/server-reference-manifest.json +2 -2
  155. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/backlog/page.js +1 -1
  156. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/backlog/page.js.nft.json +1 -1
  157. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/backlog/page_client-reference-manifest.js +1 -1
  158. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/page/server-reference-manifest.json +2 -2
  159. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/page.js +1 -1
  160. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/page.js.nft.json +1 -1
  161. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/page_client-reference-manifest.js +1 -1
  162. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/page/server-reference-manifest.json +2 -2
  163. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/page.js +1 -1
  164. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/page.js.nft.json +1 -1
  165. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/page_client-reference-manifest.js +1 -1
  166. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/page/server-reference-manifest.json +3 -3
  167. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/page.js +2 -2
  168. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/page.js.nft.json +1 -1
  169. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/page_client-reference-manifest.js +1 -1
  170. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/tasks/[taskId]/page/server-reference-manifest.json +2 -2
  171. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/tasks/[taskId]/page.js +1 -1
  172. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/tasks/[taskId]/page.js.nft.json +1 -1
  173. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/tasks/[taskId]/page_client-reference-manifest.js +1 -1
  174. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/page/server-reference-manifest.json +2 -2
  175. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/page.js +1 -1
  176. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/page.js.nft.json +1 -1
  177. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/page_client-reference-manifest.js +1 -1
  178. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/tranches/page/server-reference-manifest.json +2 -2
  179. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/tranches/page.js +1 -1
  180. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/tranches/page.js.nft.json +1 -1
  181. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/tranches/page_client-reference-manifest.js +1 -1
  182. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/{[externals]__1agj1ww._.js → [externals]__0cki-x_._.js} +2 -2
  183. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/[root-of-the-server]__02a-3g8._.js +6 -6
  184. 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
  185. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__074w9nf._.js +3 -0
  186. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/{[root-of-the-server]__0r7e54g._.js → [root-of-the-server]__07uhu5z._.js} +1 -1
  187. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__0ls23oh._.js +1 -1
  188. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__1gjqmhq._.js +1 -1
  189. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__1wc4-ip._.js +1 -1
  190. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/{[root-of-the-server]__1r47dr7._.js → _08onyya._.js} +3 -3
  191. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_096f46i._.js +1 -1
  192. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0af2one._.js +1 -1
  193. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0e5tkdd._.js +1 -1
  194. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0kf2g72._.js +1 -1
  195. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0y1jv16._.js +1 -1
  196. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0zf4d27._.js +1 -1
  197. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_1-wo68i._.js +1 -1
  198. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_15gdg48._.js +5 -5
  199. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_1achbh9._.js +1 -1
  200. 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
  201. package/studio-standalone/apps/vinaya-studio/web/.next/server/middleware-build-manifest.js +3 -3
  202. package/studio-standalone/apps/vinaya-studio/web/.next/server/pages/500.html +1 -1
  203. package/studio-standalone/apps/vinaya-studio/web/.next/server/server-reference-manifest.js +1 -1
  204. package/studio-standalone/apps/vinaya-studio/web/.next/server/server-reference-manifest.json +4 -4
  205. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/0bjnj-5fy4e7l.js +1 -0
  206. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/0ko698wh8xx2g.css +1 -0
  207. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/{1dc2_-c_gavj1.js → 0q9p7c6vn-x2w.js} +4 -4
  208. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/{3xg6-flovrcx-.js → 2174nz5he_oc4.js} +1 -1
  209. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/3xnma0-359j17.js +1 -0
  210. package/studio-standalone/apps/vinaya-studio/web/package.json +2 -2
  211. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__0hstap0._.js +0 -3
  212. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/0bm4nrrzwc7zi.css +0 -1
  213. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/2t_rfsztmwu6y.js +0 -1
  214. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/3ua4rm5f-a9k6.js +0 -1
  215. /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/{aeg-core → vinaya/studio-standalone/_node_modules/@attalabs/vinaya/studio-standalone/_node_modules/@attalabs/aeg-core}/bin/verify-coherence.ts +0 -0
  216. /package/studio-standalone/apps/vinaya-studio/web/.next/static/{e8XbZ2vlVz40KzHmlqhwP → HmoeqXdX1E4drt7GReFOO}/_buildManifest.js +0 -0
  217. /package/studio-standalone/apps/vinaya-studio/web/.next/static/{e8XbZ2vlVz40KzHmlqhwP → HmoeqXdX1E4drt7GReFOO}/_clientMiddlewareManifest.js +0 -0
  218. /package/studio-standalone/apps/vinaya-studio/web/.next/static/{e8XbZ2vlVz40KzHmlqhwP → HmoeqXdX1E4drt7GReFOO}/_ssgManifest.js +0 -0
@@ -338,6 +338,33 @@ function entry(key) {
338
338
  function label(key) {
339
339
  return entry(key).id;
340
340
  }
341
+ function trancheSlugOf(name) {
342
+ const prefix = entry("tranche").id;
343
+ return name.startsWith(prefix) ? name.slice(prefix.length) : null;
344
+ }
345
+ function findTrancheSlug(names) {
346
+ for (const n of names) {
347
+ const slug = trancheSlugOf(n);
348
+ if (slug !== null)
349
+ return slug;
350
+ }
351
+ return null;
352
+ }
353
+
354
+ // ../../packages/aeg-forge-state/src/list-tasks.ts
355
+ var TITLE_PATTERN = /^\[([^\]]+)]\s*(\S+)\s*—\s*(.+)$/;
356
+ function resolveTaskIssueRef(title, labels) {
357
+ const m = title.match(TITLE_PATTERN);
358
+ if (!m)
359
+ return null;
360
+ const taskId = (m[2] ?? "").trim();
361
+ if (!taskId)
362
+ return null;
363
+ const trancheSlug = findTrancheSlug(labels);
364
+ if (!trancheSlug)
365
+ return null;
366
+ return { trancheSlug, taskId };
367
+ }
341
368
  // ../../packages/aeg-forge-state/src/github-token.ts
342
369
  import { execFile as execFile2 } from "node:child_process";
343
370
  import { promisify as promisify2 } from "node:util";
@@ -632,15 +659,32 @@ var ObservedSchema = z.object({
632
659
  var TaskStatusInputSchema = z.object({
633
660
  task: TaskToolRefSchema.optional()
634
661
  }).merge(PageRequestSchema).strict();
662
+ var TaskConfidenceSchema = z.object({
663
+ round: z.number().int().positive(),
664
+ percent: z.number().int().min(0).max(100).nullable(),
665
+ source: z.enum(["stated", "published-summary"])
666
+ }).strict();
667
+ var TaskPhaseHistorySchema = z.object({
668
+ typicalPhaseMinutes: z.number().nonnegative(),
669
+ typicalPhaseSamples: z.number().int().positive()
670
+ }).strict();
635
671
  var TaskStatusItemSchema = z.object({
636
672
  task: TaskToolRefSchema,
637
673
  issue: z.number().int().positive(),
638
674
  pr: z.number().int().positive().nullable(),
639
- state: z.string()
675
+ state: z.string(),
676
+ round: z.number().int().positive().nullable().optional(),
677
+ phase: z.string().min(1).nullable().optional(),
678
+ minutesInPhase: z.number().nonnegative().nullable().optional(),
679
+ phaseIsCurrent: z.boolean().nullable().optional(),
680
+ lastConfidence: TaskConfidenceSchema.nullable().optional(),
681
+ lastConfidenceUnread: z.boolean().optional(),
682
+ phaseHistory: TaskPhaseHistorySchema.nullable().optional()
640
683
  }).merge(ObservedSchema);
641
684
  var TaskStatusResultSchema = z.object({
642
685
  items: z.array(TaskStatusItemSchema),
643
- nextCursor: z.string().nullable()
686
+ nextCursor: z.string().nullable(),
687
+ table: z.string()
644
688
  });
645
689
  var RequestedAuthoritySchema = z.enum(["planner", "principal", "operator", "self"]);
646
690
  var EscalationInputsSchema = z.object({
@@ -648,7 +692,7 @@ var EscalationInputsSchema = z.object({
648
692
  round: z.number().int().nonnegative(),
649
693
  head: z.string(),
650
694
  branch: z.string(),
651
- prNumber: z.number().int().positive()
695
+ prNumber: z.number().int().positive().nullable()
652
696
  });
653
697
  var EscalationEvidenceSchema = z.object({
654
698
  round: z.number().int().nonnegative(),
@@ -684,13 +728,45 @@ var TaskEscalationReadResultSchema = z.object({
684
728
  items: z.array(TaskEscalationPacketSchema),
685
729
  nextCursor: z.string().nullable()
686
730
  }).merge(ObservedSchema);
687
- var TaskStartInputSchema = z.object({
688
- tranche: z.string().min(1),
689
- id: z.string().min(1)
731
+ var TaskPrCheckSchema = z.object({
732
+ name: z.string(),
733
+ required: z.boolean(),
734
+ status: z.string(),
735
+ conclusion: z.string().nullable(),
736
+ detailsUrl: z.string().nullable(),
737
+ failureSummary: z.string().nullable()
738
+ });
739
+ var TaskPrVerdictSchema = z.object({
740
+ role: z.enum(["code-review", "security"]),
741
+ value: z.string(),
742
+ judgedHead: z.string().nullable(),
743
+ objectivesVersion: z.string().nullable()
744
+ });
745
+ var TaskPrPauseSchema = z.object({
746
+ reason: z.string(),
747
+ body: z.string()
748
+ });
749
+ var TaskPrReviewRecordSchema = z.object({
750
+ verdicts: z.array(TaskPrVerdictSchema),
751
+ roundMarkers: z.array(z.number().int().nonnegative()),
752
+ summaryTable: z.string().nullable(),
753
+ pause: TaskPrPauseSchema.nullable()
754
+ });
755
+ var TaskPrReadInputSchema = z.object({
756
+ task: TaskToolRefSchema,
757
+ pr: z.number().int().positive().optional()
690
758
  }).strict();
759
+ var TaskPrReadResultSchema = z.object({
760
+ task: TaskToolRefSchema,
761
+ issue: z.number().int().positive(),
762
+ pr: z.number().int().positive(),
763
+ head: z.string().nullable(),
764
+ checks: z.array(TaskPrCheckSchema),
765
+ review: TaskPrReviewRecordSchema
766
+ }).merge(ObservedSchema);
691
767
  var TaskStartResultSchema = z.object({
692
768
  requestId: z.string().min(1),
693
- run: z.object({ tranche: z.string().min(1), id: z.string().min(1) }),
769
+ run: TaskToolRefSchema,
694
770
  started: z.boolean(),
695
771
  startedAt: z.string(),
696
772
  mode: z.literal("attended")
@@ -704,7 +780,7 @@ var TaskCancelInputSchema = z.object({
704
780
  }).strict();
705
781
  var TaskResumeResultSchema = z.object({
706
782
  task: z.number().int().positive(),
707
- pr: z.number().int().positive(),
783
+ pr: z.number().int().positive().nullable(),
708
784
  escalationId: z.string().min(1),
709
785
  outcome: z.enum(["started", "already_resumed"]),
710
786
  authenticatedBy: z.string().min(1),
@@ -713,7 +789,7 @@ var TaskResumeResultSchema = z.object({
713
789
  var TaskCancelOutcomeSchema = z.enum(["confirmed", "pending", "uncertain"]);
714
790
  var TaskCancelResultSchema = z.object({
715
791
  task: z.number().int().positive(),
716
- pr: z.number().int().positive(),
792
+ pr: z.number().int().positive().nullable(),
717
793
  escalationId: z.string().min(1),
718
794
  outcome: TaskCancelOutcomeSchema,
719
795
  authenticatedBy: z.string().min(1),
@@ -724,6 +800,7 @@ var TASK_TOOL_NAMES = [
724
800
  "task_start",
725
801
  "task_status",
726
802
  "task_escalation_read",
803
+ "task_pr_read",
727
804
  "task_resume",
728
805
  "task_cancel"
729
806
  ];
@@ -1178,6 +1255,8 @@ function attemptFromEnv(value) {
1178
1255
  function provenanceFor(input) {
1179
1256
  if (input.provenance)
1180
1257
  return input.provenance;
1258
+ if (issueFromTask(input.env.task) === null && (input.branchIssue ?? null) !== null)
1259
+ return "unavailable";
1181
1260
  if (input.env.role || input.env.task)
1182
1261
  return "env_correlated";
1183
1262
  return "unavailable";
@@ -1198,7 +1277,7 @@ function buildHeader(input) {
1198
1277
  const role = isRole(input.env.role) ? input.env.role : "unattributed";
1199
1278
  const round = roundFromEnv(input.env.round);
1200
1279
  const subject = {
1201
- issue: issueFromTask(input.env.task),
1280
+ issue: issueFromTask(input.env.task) ?? input.branchIssue ?? null,
1202
1281
  role,
1203
1282
  ...round !== undefined ? { round } : {},
1204
1283
  ...input.subject ?? {}
@@ -1706,7 +1785,12 @@ var VinayaConfigSchema = z4.object({
1706
1785
  allowlist: z4.array(z4.string().min(1)).optional(),
1707
1786
  severity: z4.enum(["warning", "error"]).optional()
1708
1787
  }).optional(),
1709
- specGrandfather: z4.array(z4.string().min(1)).optional()
1788
+ specGrandfather: z4.array(z4.string().min(1)).optional(),
1789
+ specPaths: z4.array(z4.string().min(1).refine((entry) => !entry.startsWith("/") && !/^[A-Za-z]:/.test(entry), {
1790
+ message: "must be a repository-relative path, not an absolute one"
1791
+ }).refine((entry) => !entry.split(/[\\/]/).includes(".."), {
1792
+ message: "must stay inside the repository — no `..` segment"
1793
+ })).optional()
1710
1794
  }).optional(),
1711
1795
  projects: z4.array(ProjectEntrySchema).optional(),
1712
1796
  dispatch: z4.object({
@@ -1720,6 +1804,13 @@ var VinayaConfigSchema = z4.object({
1720
1804
  securityThreshold: z4.string().min(1).optional(),
1721
1805
  maxRounds: z4.number().optional()
1722
1806
  }).optional(),
1807
+ gateCutovers: z4.object({
1808
+ objectivesSinceIssue: z4.number().int().nonnegative().optional(),
1809
+ briefSectionsSinceIssue: z4.number().int().nonnegative().optional(),
1810
+ documentationSinceIssue: z4.number().int().nonnegative().optional(),
1811
+ briefRulesSincePr: z4.number().int().nonnegative().optional(),
1812
+ agentBoxesRefusedSincePr: z4.number().int().nonnegative().optional()
1813
+ }).optional(),
1723
1814
  prePush: z4.object({
1724
1815
  alwaysRun: z4.array(z4.string()).optional()
1725
1816
  }).optional(),
@@ -1903,7 +1994,28 @@ function trustAnchorRepoFromRemoteUrl(url) {
1903
1994
  return m?.[1] && m[2] ? wellFormedRepoSlug(`${m[1]}/${m[2]}`) : null;
1904
1995
  }
1905
1996
  var execFileAsync4 = promisify4(execFile4);
1997
+ function resolveCiTrustAnchorProbeRef(env = process.env) {
1998
+ const ref = env.VINAYA_CI_CONFIG_PROBE_REF?.trim();
1999
+ if (!ref)
2000
+ return null;
2001
+ if (env.GITHUB_ACTIONS !== "true")
2002
+ return null;
2003
+ if ((env.GH_TOKEN ?? "").length > 0 || (env.GITHUB_TOKEN ?? "").length > 0)
2004
+ return null;
2005
+ return ref;
2006
+ }
2007
+ function readTrustAnchorConfigAtRef(ref) {
2008
+ const raw = execFileSync2("git", ["show", `${ref}:${LOCAL_CONFIG_FILENAME}`], {
2009
+ encoding: "utf-8",
2010
+ stdio: ["ignore", "pipe", "pipe"],
2011
+ timeout: 1e4
2012
+ });
2013
+ return Buffer.from(raw, "utf-8").toString("base64");
2014
+ }
1906
2015
  function ghFetchTrustAnchorConfig() {
2016
+ const probeRef = resolveCiTrustAnchorProbeRef();
2017
+ if (probeRef)
2018
+ return readTrustAnchorConfigAtRef(probeRef);
1907
2019
  const repo = trustAnchorRepo();
1908
2020
  if (!repo)
1909
2021
  throw new Error("could not resolve repo identity for the trust-anchor read");
@@ -1913,6 +2025,14 @@ function ghFetchTrustAnchorConfig() {
1913
2025
  });
1914
2026
  }
1915
2027
  async function ghFetchTrustAnchorConfigAsync() {
2028
+ const probeRef = resolveCiTrustAnchorProbeRef();
2029
+ if (probeRef) {
2030
+ const { stdout } = await execFileAsync4("git", ["show", `${probeRef}:${LOCAL_CONFIG_FILENAME}`], {
2031
+ encoding: "utf-8",
2032
+ timeout: 1e4
2033
+ });
2034
+ return Buffer.from(stdout, "utf-8").toString("base64");
2035
+ }
1916
2036
  const repo = await trustAnchorRepoAsync();
1917
2037
  if (!repo)
1918
2038
  throw new Error("could not resolve repo identity for the trust-anchor read");
@@ -2994,6 +3114,7 @@ function resolveThroughTable(ctx, file, name, table, stack) {
2994
3114
  };
2995
3115
  }
2996
3116
  var DEFAULT_CLI_ENTRYPOINT = "apps/cli/src/index.ts";
3117
+ var ROOT_CONFIG_FILENAME = "vinaya.config.json";
2997
3118
  function selectAffectedTestFiles(repoRoot, changedFiles, options = {}) {
2998
3119
  const packages = discoverWorkspacePackages(repoRoot);
2999
3120
  const absChanged = new Set(changedFiles.map((f) => isAbsolute4(f) ? f : join7(repoRoot, f)));
@@ -3164,6 +3285,9 @@ function selectAffectedTestFiles(repoRoot, changedFiles, options = {}) {
3164
3285
  const depthOneDefault = options.depth === "one" ? "ignore" : "select";
3165
3286
  const repoTreeScanners = options.repoTreeScanners ?? depthOneDefault;
3166
3287
  const cliSpawnDetection = options.cliSpawnDetection ?? depthOneDefault;
3288
+ const cliEntrypoint = join7(repoRoot, options.cliEntrypoint ?? DEFAULT_CLI_ENTRYPOINT);
3289
+ const rootConfigChanged = absChanged.has(join7(repoRoot, ROOT_CONFIG_FILENAME));
3290
+ const cliPackage = packages.find((pkg) => cliEntrypoint.startsWith(`${pkg.dir}/`)) ?? null;
3167
3291
  if (typescript && repoTreeScanners !== "ignore") {
3168
3292
  for (const file of allSourceFiles) {
3169
3293
  if (!isTestFile(file))
@@ -3176,7 +3300,6 @@ function selectAffectedTestFiles(repoRoot, changedFiles, options = {}) {
3176
3300
  }
3177
3301
  }
3178
3302
  if (typescript && cliSpawnDetection !== "ignore") {
3179
- const cliEntrypoint = join7(repoRoot, options.cliEntrypoint ?? DEFAULT_CLI_ENTRYPOINT);
3180
3303
  const cliEntrypointSourceRoot = dirname6(cliEntrypoint);
3181
3304
  for (const file of allSourceFiles) {
3182
3305
  if (!isTestFile(file))
@@ -3199,7 +3322,7 @@ function selectAffectedTestFiles(repoRoot, changedFiles, options = {}) {
3199
3322
  continue;
3200
3323
  const maxDepth = options.depth === "one" ? 1 : Number.POSITIVE_INFINITY;
3201
3324
  for (const test of testFiles) {
3202
- const forced = alwaysRunRegexes.some((re) => re.test(test.slice(repoRoot.length + 1))) || addedOrRenamed.has(test);
3325
+ const forced = alwaysRunRegexes.some((re) => re.test(test.slice(repoRoot.length + 1))) || addedOrRenamed.has(test) || rootConfigChanged && pkg === cliPackage;
3203
3326
  if (forced || anythingChanged && reaches(`${ALL_PREFIX}${test}`, edges, changeFacts, maxDepth)) {
3204
3327
  selected.push(test);
3205
3328
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@attalabs/vinaya",
3
- "version": "0.32.0",
3
+ "version": "0.34.0",
4
4
  "description": "Vinaya — Agentic Engineering Harness. Deterministic checks every AI coding agent must satisfy before merge.",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
@@ -4,7 +4,7 @@
4
4
  * Pure data, zero I/O, zero imports beyond the type itself — same discipline
5
5
  * as `waiver-label.ts`.
6
6
  *
7
- * Two consumers read this one list (Issue #505): G3's "no seventh way into
7
+ * Two consumers read this one list: G3's "no seventh way into
8
8
  * GitHub" completeness story (`registry-checks.ts`) targets the
9
9
  * `crosses: 'into-github'` subset against `enforcement.md`'s Ring-0 gate rows;
10
10
  * task 506's DiagramModel places each action both inside a ring-0 gate (as a
@@ -12,16 +12,15 @@
12
12
  * hand-off). One list, so an `ACTIONS.length`-driven diagram edge count and
13
13
  * G3's crossing list can never drift apart.
14
14
  *
15
- * The set is 11 distinct actions: the 6 crossings named in Issue #505 plus 5
16
- * seam-only actions (4 original, plus `create-the-milestone`,
17
- * vinaya-milestone-model-v1 task 2). Two of the six contract seams are already
15
+ * The set is 11 distinct actions: 6 real crossings plus 5
16
+ * seam-only actions (4 original, plus `create-the-milestone`). Two of the six contract seams are already
18
17
  * accomplished by a GitHub crossing (the Planner→Brief seam's carrier is the
19
18
  * Issue body, created by `create-a-task-issue`; the Developer→Reviewer seam's
20
19
  * carrier is the PR, created by `open-a-pull-request`), so they get no
21
20
  * duplicate id — inventing one would give two ids for one real act and break
22
21
  * any `ACTIONS.length`-driven edge count.
23
22
  *
24
- * `crosses` is factually per-action, not a mirror of Issue #505's prose:
23
+ * `crosses` is factually per-action, not a mirror of a rationale's prose:
25
24
  * `commit-the-work` is `'none'` because `git commit` never leaves the local
26
25
  * machine — it is `git push` (`publish-the-branch`) that reaches the
27
26
  * GitHub-hosted remote. `enforcement.md`'s own Ring-0 table lists them as
@@ -29,7 +28,7 @@
29
28
  * reason..
30
29
  *
31
30
  * The only valid `performedBy` values are the 9 `role_id`s under
32
- * `aeg-root/roles/*.md` (task 2, #522) — asserted by the real-file test.
31
+ * `aeg-root/roles/*.md` — asserted by the real-file test.
33
32
  */
34
33
 
35
34
  export type ActionCrossing = 'into-github' | 'none'
@@ -105,10 +104,10 @@ export const ACTIONS: Action[] = [
105
104
  id: 'author-the-brief',
106
105
  label: 'author the brief',
107
106
  crosses: 'none',
108
- performedBy: ['brief-author'],
107
+ performedBy: ['planner'],
109
108
  summary: 'Ever started a task with no clear idea of what "done" means?',
110
109
  description:
111
- 'Turning one intent into instructions someone can execute: what to build, what is out of scope, and what done means.'
110
+ 'Dispatching one intent as instructions someone can execute: what to build, what is out of scope, and what done means.'
112
111
  },
113
112
  {
114
113
  id: 'produce-the-verdict',
@@ -143,8 +142,7 @@ export const ACTIONS: Action[] = [
143
142
  // reason `post-provenance-comment`/`produce-the-verdict` are 'none'
144
143
  // despite writing PR comments via the API. `vinaya milestone create`
145
144
  // is a manually-invoked CLI command with no Ring-0 hook intercepting a
146
- // raw bypass, so it stays seam-only here (vinaya-milestone-model-v1
147
- // task 2).
145
+ // raw bypass, so it stays seam-only here.
148
146
  crosses: 'none',
149
147
  performedBy: ['architect'],
150
148
  summary: 'Ever had a Milestone whose title quietly became the only place a version lived?',
@@ -154,8 +152,8 @@ export const ACTIONS: Action[] = [
154
152
  ]
155
153
 
156
154
  // A stable keyword per into-github action that must appear (case-insensitive)
157
- // in some real Ring-0 gate row's action text — the "feeds G3" tripwire from
158
- // Issue #505. If enforcement.md ever drops the gate row backing a crossing,
155
+ // in some real Ring-0 gate row's action text — the "feeds G3" tripwire.
156
+ // If enforcement.md ever drops the gate row backing a crossing,
159
157
  // the corresponding assertion fails. grant-a-waiver's keyword is
160
158
  // `pull request`: granting a waiver is an act on a pull request (labeling it),
161
159
  // honored at the Ring-0 PR-creation/editing gate and refused-from-agents at
@@ -1,5 +1,5 @@
1
1
  /**
2
- * AEG anchored-region grammar (aeg-governance-hardening task 30, #393). Pure —
2
+ * AEG anchored-region grammar. Pure —
3
3
  * no `fs`, no `gh`/`git`.
4
4
  *
5
5
  * One anchor syntax for every gate-read field: an HTML comment pair
@@ -7,8 +7,8 @@
7
7
  * field's one canonical home inside a PR/Issue body. HTML comments render
8
8
  * invisibly on the forge, survive inside `<details>` blocks, and can never be
9
9
  * produced accidentally by freeform prose — which is exactly the failure class
10
- * this closes (PR #392's pasted reference brief duplicated its own Test Plan
11
- * inside the PR body; #363/#377 were the same shape as real bugs).
10
+ * this closes (a real pasted reference brief duplicated its own Test Plan
11
+ * inside the PR body; other real PRs hit the same shape of bug).
12
12
  *
13
13
  * Recognition semantics, shared by every consumer
14
14
  * (`pr-tier.ts`, `test-plan-section.ts`, `premise-check.ts`,
@@ -31,7 +31,7 @@
31
31
  * - **Markers inside fenced code blocks or inline code spans do not count**
32
32
  * — example/quoted anchor syntax in documentation or evidence output is
33
33
  * never mistaken for a real anchor (same code-stripping philosophy as
34
- * `archive-task.ts`'s `stripCode`, #311 regression).
34
+ * `archive-task.ts`'s `stripCode`, after a real regression).
35
35
  *
36
36
  * The field line/block goes on its own line(s) INSIDE the pair — e.g.
37
37
  *
@@ -52,7 +52,7 @@
52
52
  import { maskCode } from '@attalabs/aeg-forge-state/strip-code'
53
53
 
54
54
  /**
55
- * The seven gate-read fields with an anchored home. `TOKENS` (task 5, #378)
55
+ * The seven gate-read fields with an anchored home. `TOKENS`
56
56
  * joined here rather than through a second, parallel field list —
57
57
  * `pr-report.ts`'s own `AEG:TOKENS:START`/`:END` markers already use this
58
58
  * exact grammar, so the registry is the fix, not a workaround beside it.
@@ -1,6 +1,5 @@
1
1
  /**
2
- * Post-merge Archivist provenance assembly (aeg-governance-hardening
3
- * task 5d, #309). Pure — no `fs`, no `fetch`, no `process.env`. The CLI shim
2
+ * Post-merge Archivist provenance assembly. Pure — no `fs`, no `fetch`, no `process.env`. The CLI shim
4
3
  * (`bin/archive-task.ts`) resolves the merged PR via `gh`, gathers
5
4
  * `MergedPrFacts`, and calls these functions.
6
5
  *
@@ -9,13 +8,14 @@
9
8
  * froze — the PR body, PR metadata, or PR comments. A field whose source
10
9
  * fact is absent becomes a DANGLING entry, never an inferred or defaulted
11
10
  * value. Field/heading shapes below mirror the live provenance comments
12
- * posted by hand on PRs #302/#305/#306.
11
+ * posted by hand on real PRs.
13
12
  */
14
13
 
15
14
  import { hasLabel } from '@attalabs/aeg-forge-state'
16
15
  import { type AnchorField, anchoredRegion, stripCode } from './anchored-region'
17
16
  import { headerRegion } from './brief-validation'
18
17
  import { readTierFromPrBody } from './pr-tier'
18
+ import { parseTaskBranchIdentity } from './task-branch-identity'
19
19
  import { extractCodeReviewVerdict, extractSecurityReviewVerdict } from './verdict-extraction'
20
20
 
21
21
  export type MergedPrFacts = {
@@ -25,12 +25,22 @@ export type MergedPrFacts = {
25
25
  mergedAt: string
26
26
  mergeSha: string
27
27
  comments: string[]
28
+ /**
29
+ * The task Issue's frozen `aeg:brief:v1` comment URL (`dispatchTask`) —
30
+ * the brief's permanent home now that it no
31
+ * longer lives in this PR body at all. `null` when the CLI shim
32
+ * (`bin/archive-task.ts`) could not resolve one — no Issue to close, no
33
+ * `aeg:brief:v1` comment on it (a pre-cutover task, or one dispatched by
34
+ * hand), or the lookup itself failed — never defaulted to a guess.
35
+ * Optional so a caller assembling `MergedPrFacts` without this task's
36
+ * change still type-checks; `buildProvenanceBlock` treats an absent field
37
+ * exactly like an explicit `null`.
38
+ */
39
+ briefCommentUrl?: string | null
28
40
  }
29
41
 
30
- const TASK_BRANCH_PATTERN = /^task\/([^/]+)\/([^/]+)$/
31
-
32
42
  /**
33
- * null when headRefName is not task/<tranche>/<taskId>.
43
+ * null when headRefName is not task/<tranche>/<taskId> or task/issue-<n>.
34
44
  *
35
45
  * This is ONE of two independent eligibility signals for provenance —
36
46
  * the branch-name pattern — not the only one. A PR that closes a
@@ -45,11 +55,18 @@ const TASK_BRANCH_PATTERN = /^task\/([^/]+)\/([^/]+)$/
45
55
  * the sole gate. (Confirmed gap: a task whose Issue carried a
46
56
  * `vinaya/tranche:*` label was closed by a `fix/*`-branch PR;
47
57
  * branch-name-only detection silently skipped provenance forever.)
58
+ *
59
+ * `tranche: null` for a backlog Issue's `task/issue-<n>` branch —
60
+ * `taskId` is the Issue number itself, so this signal alone
61
+ * makes a backlog task's PR eligible for provenance, with no
62
+ * `vinaya/tranche:*` label needed at all.
48
63
  */
49
- export function taskRefFromBranch(branch: string): { tranche: string; taskId: string } | null {
50
- const m = branch.match(TASK_BRANCH_PATTERN)
51
- if (!m) return null
52
- return { tranche: m[1] as string, taskId: m[2] as string }
64
+ export function taskRefFromBranch(branch: string): { tranche: string | null; taskId: string } | null {
65
+ const ref = parseTaskBranchIdentity(branch)
66
+ if (!ref) return null
67
+ return ref.kind === 'issue'
68
+ ? { tranche: null, taskId: String(ref.issueNumber) }
69
+ : { tranche: ref.tranche, taskId: ref.taskId }
53
70
  }
54
71
 
55
72
  /**
@@ -60,7 +77,7 @@ export function taskRefFromBranch(branch: string): { tranche: string; taskId: st
60
77
  * or the closed Issue's own labels carry an `vinaya/tranche:*` tag.
61
78
  */
62
79
  export function isEligibleForProvenance(
63
- ref: { tranche: string; taskId: string } | null,
80
+ ref: { tranche: string | null; taskId: string } | null,
64
81
  issueLabels: string[]
65
82
  ): boolean {
66
83
  if (ref !== null) return true
@@ -79,7 +96,7 @@ export function hasProvenance(comments: string[]): boolean {
79
96
  * searched ONLY in the header region (shared with `brief-validation.ts`'s
80
97
  * gate — gate and archivist read the same region, so a body that passes the
81
98
  * gate can't produce a DANGLING field here). Whole-body scanning is the
82
- * regression from #311's first live run, where a prose sentence *about* the
99
+ * regression from a real first live run, where a prose sentence *about* the
83
100
  * `Ticket:` field in a later section was extracted as the field's value.
84
101
  *
85
102
  * When `anchor` is given and the body carries that anchor pair
@@ -106,7 +123,7 @@ function closesRefs(text: string): number[] {
106
123
  * falling back to the first anywhere in the body (flagged, not lost). Extras
107
124
  * are scanned body-wide so a real second closing reference in prose is still
108
125
  * flagged — but always fence-stripped, so example text like a Test Plan's
109
- * `Closes #123` fixture never counts (#311 regression).
126
+ * `Closes #NNN` fixture never counts (a real regression).
110
127
  *
111
128
  * When the body carries an `AEG:CLOSES` anchor pair (`anchored-region.ts`,
112
129
  * task 30), the pair replaces the header block as the canonical placement:
@@ -122,8 +139,8 @@ export function extractIssue(body: string): { issue: number | null; extraIssues:
122
139
  // GitHub *does* auto-close it) but looks like a bare 4-space indented code
123
140
  // block once sliced, so stripping the region blanked the reference and
124
141
  // returned `issue: null` — the Issue then goes unclosed on merge, the exact
125
- // stranding this PR exists to eliminate, reintroduced along the over-strip
126
- // axis (PR #617 review MAJOR). Stripping first also subsumes the decoy
142
+ // stranding this exists to eliminate, reintroduced along the over-strip
143
+ // axis (a MAJOR review finding). Stripping first also subsumes the decoy
127
144
  // protection rather than trading against it: `AEG:*` markers are HTML
128
145
  // comments and survive the strip, while a decoy anchor inside code does not
129
146
  // survive to be sliced in the first place.
@@ -169,6 +186,10 @@ export function buildProvenanceBlock(facts: MergedPrFacts): {
169
186
  const tier = readTierFromPrBody(facts.body)
170
187
  if (tier === null) dangling.push('no `Tier:` field found in PR body — Tier field is DANGLING')
171
188
 
189
+ if (issue !== null && (facts.briefCommentUrl ?? null) === null) {
190
+ dangling.push(`no \`aeg:brief:v1\` comment resolved for Issue #${issue} — Brief field is DANGLING`)
191
+ }
192
+
172
193
  const project = extractField(facts.body, 'Project(?:\\(s\\))?', 'PROJECT')
173
194
  if (!project) dangling.push('no `Project:` field found in PR body — Project(s) field is DANGLING')
174
195
 
@@ -183,13 +204,17 @@ export function buildProvenanceBlock(facts: MergedPrFacts): {
183
204
 
184
205
  const ticket = extractField(facts.body, 'Ticket') ?? 'none'
185
206
 
186
- const taskLabel = ref ? `task ${ref.taskId} (tranche ${ref.tranche})` : `task (branch ${facts.headRefName})`
207
+ const taskLabel = ref
208
+ ? ref.tranche !== null
209
+ ? `task ${ref.taskId} (tranche ${ref.tranche})`
210
+ : `task (backlog Issue #${ref.taskId})`
211
+ : `task (branch ${facts.headRefName})`
187
212
 
188
213
  const lines = [
189
214
  `${PROVENANCE_HEADING} — ${taskLabel}`,
190
215
  `- Issue: ${issue !== null ? `#${issue} (closed by merge)` : 'DANGLING — no Closes #N in PR body'}`,
191
216
  `- Tier: ${tier !== null ? tier : 'DANGLING — no Tier field in PR body'}`,
192
- '- Brief: in this PR body (the frozen intent)',
217
+ `- Brief: ${facts.briefCommentUrl ?? 'DANGLING — no aeg:brief:v1 comment resolved for this task'}`,
193
218
  `- Project(s): ${project ?? 'DANGLING — no Project field in PR body'}`,
194
219
  `- Model/agent: ${forField ?? 'DANGLING — no For field in PR body'}`,
195
220
  `- Code review: ${codeReview.value}`,
@@ -1,6 +1,5 @@
1
1
  /**
2
- * Finding-count baseline capture + comparison (aeg-governance-hardening task
3
- * 11, #324). Pure — does not run `verify-docs.ts`/`verify-coherence.ts`
2
+ * Finding-count baseline capture + comparison. Pure — does not run `verify-docs.ts`/`verify-coherence.ts`
4
3
  * itself and never calls `Date.now()` (a pure `src/` module cannot — see
5
4
  * `packages/aeg-core/CLAUDE.md`-equivalent constraint, this repo's is the
6
5
  * Workflow-script rule of the same shape). The CLI shim runs those tools,
@@ -1,10 +1,10 @@
1
1
  import type { Tranche } from './types'
2
2
 
3
3
  /**
4
- * Branch↔topology gate (aeg-governance-hardening task 32, #399). Pure — no
4
+ * Branch↔topology gate. Pure — no
5
5
  * `fs`, no shell-outs. The CLI shim (`bin/check-branch-topology.ts`) derives
6
- * the tranche from the forge (`@attalabs/aeg-forge-state`, task
7
- * aeg-forge-state-v1 3a) and passes the result (or `null` when no tranche
6
+ * the tranche from the forge (`@attalabs/aeg-forge-state`)
7
+ * and passes the result (or `null` when no tranche
8
8
  * data could be derived) in here.
9
9
  *
10
10
  * Closes the logic fork: `.husky/pre-push` used to answer "does this