@attalabs/vinaya 0.31.0 → 0.33.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 (212) hide show
  1. package/README.md +2 -3
  2. package/aeg-root/contracts/principal-operator.md +18 -5
  3. package/aeg-root/roles/developer/reference.md +3 -3
  4. package/aeg-root/roles/operator.md +69 -16
  5. package/aeg-root/roles/planner/reference.md +1 -1
  6. package/aeg-root/roles/tranche-archivist.md +1 -0
  7. package/aeg-root/skills/aeg-context-packets/SKILL.md +1 -1
  8. package/aeg-root/skills/aeg-context-packets/examples/operator-start.md +1 -1
  9. package/aeg-root/templates/pr-report-template.md +7 -2
  10. package/dist/checks/bin/check-body-bare-digits.js +340 -101
  11. package/dist/checks/bin/check-branch-topology.js +184 -105
  12. package/dist/checks/bin/check-brief-shape.js +333 -94
  13. package/dist/checks/bin/check-changeset-coverage.js +1028 -248
  14. package/dist/checks/bin/check-ci-shard-coverage.js +82 -0
  15. package/dist/checks/bin/check-closes-n.js +184 -105
  16. package/dist/checks/bin/check-coherence.js +345 -145
  17. package/dist/checks/bin/check-dead-branch-push.js +179 -59
  18. package/dist/checks/bin/check-dispatch-readiness.js +350 -150
  19. package/dist/checks/bin/check-doc-coverage-push.js +1011 -231
  20. package/dist/checks/bin/check-doc-coverage.js +1015 -235
  21. package/dist/checks/bin/check-doctrine-no-procedures.js +333 -94
  22. package/dist/checks/bin/check-doctrine-portability.js +1013 -233
  23. package/dist/checks/bin/check-evidence-fresh.js +1010 -222
  24. package/dist/checks/bin/check-exec-bits.js +1009 -229
  25. package/dist/checks/bin/check-first-push-dispatch.js +343 -145
  26. package/dist/checks/bin/check-issue-assignment.js +186 -107
  27. package/dist/checks/bin/check-issue-milestone-attach.js +176 -56
  28. package/dist/checks/bin/check-issue-objectives-numbering.js +176 -56
  29. package/dist/checks/bin/check-issue-parts-coverage.js +176 -56
  30. package/dist/checks/bin/check-issue-surface-globs.js +363 -143
  31. package/dist/checks/bin/check-issue-title-grammar.js +176 -56
  32. package/dist/checks/bin/check-issue-tranche-label.js +176 -56
  33. package/dist/checks/bin/check-main-branch-refusal.js +176 -56
  34. package/dist/checks/bin/check-no-disk-state.js +176 -56
  35. package/dist/checks/bin/check-pr-premise-reassert.js +333 -92
  36. package/dist/checks/bin/check-pr-report-density.js +176 -56
  37. package/dist/checks/bin/check-principal-test-plan-wait.js +176 -54
  38. package/dist/checks/bin/check-quoted-command.js +999 -217
  39. package/dist/checks/bin/check-reader-resolvable-prose.js +1011 -229
  40. package/dist/checks/bin/check-registry-gates.js +186 -56
  41. package/dist/checks/bin/check-retired-vocabulary.js +997 -215
  42. package/dist/checks/bin/check-review-gate.js +403 -203
  43. package/dist/checks/bin/check-single-plan-pr.js +176 -56
  44. package/dist/checks/bin/check-surface-scope.js +184 -105
  45. package/dist/checks/bin/check-test-plan.js +176 -54
  46. package/dist/checks/bin/check-token-collection-wired.js +182 -57
  47. package/dist/checks/bin/check-token-report.js +178 -58
  48. package/dist/checks/bin/check-workspace-escape.js +1011 -229
  49. package/dist/index.js +5971 -3489
  50. package/dist/lib/pre-push-cache-test-run.js +4431 -0
  51. package/dist/lib/pre-push-select-tests.js +799 -110
  52. package/package.json +3 -2
  53. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/actions.ts +10 -12
  54. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/anchored-region.ts +5 -5
  55. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/archive-task.ts +42 -17
  56. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/baseline-capture.ts +1 -2
  57. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/branch-topology-gate.ts +3 -3
  58. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/brief-render.ts +554 -95
  59. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/brief-validation.ts +264 -44
  60. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/claude-code-transcript.ts +9 -9
  61. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/coherence-checks.ts +211 -30
  62. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/consumer-enumeration.ts +2 -2
  63. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/control-store/index.ts +75 -0
  64. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/control-store/local.ts +961 -0
  65. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/control-store/migration.ts +212 -0
  66. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/control-store/outcomes.ts +135 -0
  67. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/control-store/records.ts +394 -0
  68. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dead-branch-push-audit.ts +1 -2
  69. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dead-branch-push-guard.ts +1 -1
  70. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/derive-section7.ts +2 -2
  71. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/assess-round.ts +514 -0
  72. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/fakes.ts +110 -0
  73. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/index.ts +27 -0
  74. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/journal-reconstruction.ts +123 -0
  75. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/render-summary.ts +27 -0
  76. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/types.ts +240 -0
  77. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/diagram-model.ts +1 -1
  78. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/direct-main-push.ts +1 -2
  79. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dispatch-gate.ts +65 -22
  80. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/doc-claim.ts +238 -0
  81. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/doc-owners.ts +14 -1
  82. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/docs/docs-coherence.ts +1 -1
  83. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/docs/legacy-anchors.ts +1 -1
  84. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/docs/node-route.ts +1 -1
  85. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/docs/surfaced-manifest.ts +1 -1
  86. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/doctrine-no-procedures.ts +1 -1
  87. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/doctrine-portability.ts +5 -5
  88. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/ensure-label.ts +1 -1
  89. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/first-push-dispatch-gate.ts +1 -1
  90. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/gate-audience.ts +14 -3
  91. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/index.ts +379 -11
  92. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/issue-assignment.ts +3 -4
  93. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/issue-validation.ts +1450 -33
  94. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/leftover-detection.ts +1 -2
  95. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/local-anchor-coverage.ts +2 -2
  96. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/envelope.ts +119 -0
  97. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/index.ts +75 -0
  98. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/redact.ts +87 -0
  99. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/schema.ts +801 -0
  100. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/store.ts +373 -0
  101. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/main-branch-refusal.ts +2 -2
  102. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/metering-io-guard.ts +1 -1
  103. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/milestone-validation.ts +2 -3
  104. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/no-disk-state.ts +2 -2
  105. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/objectives.ts +288 -0
  106. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/parse-token-report.ts +3 -3
  107. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/parse-tranche.ts +1 -1
  108. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/pr-report-density.ts +30 -16
  109. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/pr-tier.ts +17 -1
  110. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/premise-check.ts +1 -1
  111. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/quoted-command.ts +1 -1
  112. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/reader-resolvable-prose.ts +267 -19
  113. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/registry-checks.ts +91 -24
  114. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/registry-scaffold.ts +6 -6
  115. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/report-tokens.ts +4 -4
  116. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/review-gate.ts +239 -110
  117. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/review-input-manifest.ts +384 -0
  118. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/review-policy.ts +184 -0
  119. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/review-status.ts +65 -18
  120. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/ruling-ordinal.ts +76 -0
  121. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/single-plan-pr.ts +4 -4
  122. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/state-machine-model.ts +40 -27
  123. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/symbol-collisions.ts +2 -2
  124. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/task-branch-identity.ts +38 -0
  125. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/task-tools.ts +488 -0
  126. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/test-plan-gate.ts +7 -9
  127. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/test-plan-section.ts +5 -5
  128. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/types.ts +4 -4
  129. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/verdict-extraction.ts +314 -56
  130. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/waiver-label.ts +2 -3
  131. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/workspace-escape.ts +3 -3
  132. package/studio-standalone/apps/vinaya-studio/web/.next/BUILD_ID +1 -1
  133. package/studio-standalone/apps/vinaya-studio/web/.next/build-manifest.json +3 -3
  134. package/studio-standalone/apps/vinaya-studio/web/.next/prerender-manifest.json +3 -3
  135. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.html +1 -1
  136. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.rsc +1 -1
  137. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  138. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  139. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  140. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  141. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  142. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_not-found/page/server-reference-manifest.json +2 -2
  143. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_not-found/page.js.nft.json +1 -1
  144. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  145. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/api/coherence/route.js +1 -1
  146. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/api/coherence/route.js.nft.json +1 -1
  147. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/page/server-reference-manifest.json +2 -2
  148. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/page.js.nft.json +1 -1
  149. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/page_client-reference-manifest.js +1 -1
  150. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/backlog/page/server-reference-manifest.json +2 -2
  151. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/backlog/page.js +1 -1
  152. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/backlog/page.js.nft.json +1 -1
  153. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/backlog/page_client-reference-manifest.js +1 -1
  154. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/page/server-reference-manifest.json +2 -2
  155. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/page.js +1 -1
  156. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/page.js.nft.json +1 -1
  157. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/page_client-reference-manifest.js +1 -1
  158. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/page/server-reference-manifest.json +2 -2
  159. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/page.js +1 -1
  160. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/page.js.nft.json +1 -1
  161. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/page_client-reference-manifest.js +1 -1
  162. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/page/server-reference-manifest.json +3 -3
  163. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/page.js +2 -2
  164. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/page.js.nft.json +1 -1
  165. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/page_client-reference-manifest.js +1 -1
  166. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/tasks/[taskId]/page/server-reference-manifest.json +2 -2
  167. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/tasks/[taskId]/page.js +1 -1
  168. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/tasks/[taskId]/page.js.nft.json +1 -1
  169. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/tasks/[taskId]/page_client-reference-manifest.js +1 -1
  170. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/page/server-reference-manifest.json +2 -2
  171. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/page.js +1 -1
  172. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/page.js.nft.json +1 -1
  173. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/page_client-reference-manifest.js +1 -1
  174. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/tranches/page/server-reference-manifest.json +2 -2
  175. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/tranches/page.js +1 -1
  176. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/tranches/page.js.nft.json +1 -1
  177. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/tranches/page_client-reference-manifest.js +1 -1
  178. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/{[externals]__1agj1ww._.js → [externals]__0cki-x_._.js} +2 -2
  179. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/[root-of-the-server]__02a-3g8._.js +6 -6
  180. 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
  181. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__074w9nf._.js +3 -0
  182. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__0ls23oh._.js +1 -1
  183. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/{[root-of-the-server]__0r7e54g._.js → [root-of-the-server]__18paley._.js} +1 -1
  184. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__1gjqmhq._.js +1 -1
  185. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__1wc4-ip._.js +1 -1
  186. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/{[root-of-the-server]__1r47dr7._.js → _08onyya._.js} +3 -3
  187. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_096f46i._.js +1 -1
  188. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0af2one._.js +1 -1
  189. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0e5tkdd._.js +1 -1
  190. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0kf2g72._.js +1 -1
  191. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0y1jv16._.js +1 -1
  192. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0zf4d27._.js +1 -1
  193. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_1-wo68i._.js +1 -1
  194. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_15gdg48._.js +5 -5
  195. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_1achbh9._.js +1 -1
  196. 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
  197. package/studio-standalone/apps/vinaya-studio/web/.next/server/middleware-build-manifest.js +3 -3
  198. package/studio-standalone/apps/vinaya-studio/web/.next/server/pages/500.html +1 -1
  199. package/studio-standalone/apps/vinaya-studio/web/.next/server/server-reference-manifest.js +1 -1
  200. package/studio-standalone/apps/vinaya-studio/web/.next/server/server-reference-manifest.json +4 -4
  201. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/0bjnj-5fy4e7l.js +1 -0
  202. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/{1dc2_-c_gavj1.js → 1ce2dj27_cgbj.js} +4 -4
  203. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/{3xg6-flovrcx-.js → 22s44f5k3ecmj.js} +1 -1
  204. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/34hhdtbp20krb.js +1 -0
  205. package/studio-standalone/apps/vinaya-studio/web/package.json +2 -2
  206. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__0hstap0._.js +0 -3
  207. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/2t_rfsztmwu6y.js +0 -1
  208. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/3ua4rm5f-a9k6.js +0 -1
  209. /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/aeg-core}/bin/verify-coherence.ts +0 -0
  210. /package/studio-standalone/apps/vinaya-studio/web/.next/static/{e8XbZ2vlVz40KzHmlqhwP → vl7QVqELe1AQ-9kaOd9mR}/_buildManifest.js +0 -0
  211. /package/studio-standalone/apps/vinaya-studio/web/.next/static/{e8XbZ2vlVz40KzHmlqhwP → vl7QVqELe1AQ-9kaOd9mR}/_clientMiddlewareManifest.js +0 -0
  212. /package/studio-standalone/apps/vinaya-studio/web/.next/static/{e8XbZ2vlVz40KzHmlqhwP → vl7QVqELe1AQ-9kaOd9mR}/_ssgManifest.js +0 -0
@@ -3,10 +3,10 @@ import { createRequire } from "node:module";
3
3
  var __require = /* @__PURE__ */ createRequire(import.meta.url);
4
4
 
5
5
  // src/checks/bin/check-coherence.ts
6
- import { execFile as execFile4, execFileSync as execFileSync3 } from "node:child_process";
6
+ import { execFile as execFile5, execFileSync as execFileSync3 } from "node:child_process";
7
7
  import { existsSync as existsSync2, readFileSync as readFileSync3 } from "node:fs";
8
8
  import { join as join2 } from "node:path";
9
- import { promisify as promisify4 } from "node:util";
9
+ import { promisify as promisify5 } from "node:util";
10
10
  // ../../packages/aeg-core/src/gate-audience.ts
11
11
  var GATE_AUDIENCE = {
12
12
  "check-branch-topology": { shippedAs: "branch-topology", ring: 0 },
@@ -1040,7 +1040,7 @@ function withDefaults(oldDefaults, newDefaults) {
1040
1040
  var endpoint = withDefaults(null, DEFAULTS);
1041
1041
 
1042
1042
  // ../../node_modules/fast-content-type-parse/index.js
1043
- var NullObject = function NullObject2() {};
1043
+ var NullObject = function NullObject() {};
1044
1044
  NullObject.prototype = Object.create(null);
1045
1045
  var paramRE = /; *([!#$%&'*+.^\w`|~-]+)=("(?:[\v\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\v\u0020-\u00ff])*"|[!#$%&'*+.^\w`|~-]+) */gu;
1046
1046
  var quotedPairRE = /\\([\v\u0020-\u00ff])/gu;
@@ -1784,27 +1784,27 @@ function splitTableRow(row) {
1784
1784
  return parts.map((p) => p.split(PLACEHOLDER).join("|"));
1785
1785
  }
1786
1786
  // ../../packages/aeg-core/src/blast-radius-domains.ts
1787
- function resolveWorkspaceEntry(entry2, listDirs) {
1788
- if (entry2.endsWith("/*")) {
1789
- const baseDir = entry2.slice(0, -2);
1787
+ function resolveWorkspaceEntry(entry, listDirs) {
1788
+ if (entry.endsWith("/*")) {
1789
+ const baseDir = entry.slice(0, -2);
1790
1790
  return listDirs(baseDir).map((name) => `${baseDir}/${name}`);
1791
1791
  }
1792
- if (entry2.includes("*"))
1792
+ if (entry.includes("*"))
1793
1793
  return [];
1794
- return [entry2];
1794
+ return [entry];
1795
1795
  }
1796
1796
  // ../../packages/aeg-core/src/consumer-enumeration.ts
1797
1797
  function deriveWorkspaceMemberDirs(workspaces, listDirs) {
1798
- const positive = workspaces.filter((entry2) => !entry2.startsWith("!"));
1799
- const negative = workspaces.filter((entry2) => entry2.startsWith("!")).map((entry2) => entry2.slice(1));
1798
+ const positive = workspaces.filter((entry) => !entry.startsWith("!"));
1799
+ const negative = workspaces.filter((entry) => entry.startsWith("!")).map((entry) => entry.slice(1));
1800
1800
  const excluded = new Set;
1801
- for (const entry2 of negative) {
1802
- for (const member of resolveWorkspaceEntry(entry2, listDirs))
1801
+ for (const entry of negative) {
1802
+ for (const member of resolveWorkspaceEntry(entry, listDirs))
1803
1803
  excluded.add(member);
1804
1804
  }
1805
1805
  const members = new Set;
1806
- for (const entry2 of positive) {
1807
- for (const member of resolveWorkspaceEntry(entry2, listDirs)) {
1806
+ for (const entry of positive) {
1807
+ for (const member of resolveWorkspaceEntry(entry, listDirs)) {
1808
1808
  if (!excluded.has(member))
1809
1809
  members.add(member);
1810
1810
  }
@@ -2050,12 +2050,24 @@ function extractBaseSha(comment) {
2050
2050
  const m = firstThirteenLines(comment).match(BASE_SHA_PATTERN);
2051
2051
  return m ? m[1].toLowerCase() : null;
2052
2052
  }
2053
- var FINDING_SEVERITY_LINE = /^\d+\.\s+\[([A-Z][A-Z]*)\]\s+(.+?)\s+—/gm;
2053
+ var FINDING_DESCRIPTION_STATE = /^F(\d+)(?:\s+\S+)?(?:\s+(open|fix-claimed|reproduced|resolved))?:/;
2054
+ function parseFindingState(description) {
2055
+ const m = FINDING_DESCRIPTION_STATE.exec(description.trim());
2056
+ if (!m)
2057
+ return { id: null, state: null };
2058
+ return { id: `F${m[1]}`, state: m[2] ?? null };
2059
+ }
2060
+ var FINDING_SEVERITY_LINE = /^\d+\.\s+\[([A-Z][A-Z]*)\]\s+(.+?)\s+—(?:\s+(.*))?$/gm;
2054
2061
  function extractFindingSeverities(comment) {
2055
- return [...comment.matchAll(FINDING_SEVERITY_LINE)].map((m) => ({
2056
- severity: m[1],
2057
- location: m[2]
2058
- }));
2062
+ return [...comment.matchAll(FINDING_SEVERITY_LINE)].map((m) => {
2063
+ const { id, state } = parseFindingState(m[3] ?? "");
2064
+ return {
2065
+ severity: m[1],
2066
+ location: m[2],
2067
+ id,
2068
+ state
2069
+ };
2070
+ });
2059
2071
  }
2060
2072
  function extractVerdict(comments, valuePattern, missingLabel) {
2061
2073
  const candidates = comments.filter((c) => valuePattern.test(c));
@@ -2128,15 +2140,15 @@ function summarizeTranscript(jsonl) {
2128
2140
  const line = rawLine.trim();
2129
2141
  if (!line)
2130
2142
  continue;
2131
- let entry2;
2143
+ let entry;
2132
2144
  try {
2133
- entry2 = JSON.parse(line);
2145
+ entry = JSON.parse(line);
2134
2146
  } catch {
2135
2147
  continue;
2136
2148
  }
2137
- if (!entry2 || typeof entry2 !== "object")
2149
+ if (!entry || typeof entry !== "object")
2138
2150
  continue;
2139
- const obj = entry2;
2151
+ const obj = entry;
2140
2152
  if (obj.type !== "assistant")
2141
2153
  continue;
2142
2154
  const message = obj.message;
@@ -2469,6 +2481,12 @@ function evaluateReviewFindings(findings, scale, threshold) {
2469
2481
  });
2470
2482
  return { outcome: blockingFindings.length > 0 ? "blocked" : "clean", blockingFindings };
2471
2483
  }
2484
+ function isConsequentialFinding(finding) {
2485
+ return finding.state !== "resolved";
2486
+ }
2487
+ function consequentialFindings(findings) {
2488
+ return findings.filter((f) => isConsequentialFinding(f));
2489
+ }
2472
2490
  function evaluateCodeReview(findings, policy) {
2473
2491
  return evaluateReviewFindings(findings, CODE_REVIEW_SEVERITY_ORDER, policy.codeReviewThreshold);
2474
2492
  }
@@ -2984,7 +3002,7 @@ function isStep0Block(content) {
2984
3002
  }
2985
3003
  function checkCommandsCarryOutput(prBody) {
2986
3004
  const errors = [];
2987
- for (const [label2, num] of [
3005
+ for (const [label, num] of [
2988
3006
  ["5", 5],
2989
3007
  ["6", 6]
2990
3008
  ]) {
@@ -2998,7 +3016,7 @@ function checkCommandsCarryOutput(prBody) {
2998
3016
  continue;
2999
3017
  const next = blocks[i + 1];
3000
3018
  if (!next || isCommandBlock(next.content)) {
3001
- errors.push(`brief-validation commands carry output: §${label2} has a command block ("${firstNonBlankLine(block.content)}") not immediately followed by a non-command output block — the very next fenced block must hold that command's actual output, not another command.`);
3019
+ errors.push(`brief-validation commands carry output: §${label} has a command block ("${firstNonBlankLine(block.content)}") not immediately followed by a non-command output block — the very next fenced block must hold that command's actual output, not another command.`);
3002
3020
  }
3003
3021
  }
3004
3022
  }
@@ -3435,8 +3453,8 @@ function stripPartBackticks(text) {
3435
3453
  function partWordCount(text) {
3436
3454
  return text.split(/\s+/).filter((w) => /[a-z]/i.test(w)).length;
3437
3455
  }
3438
- function looksLikeFilePath(entry2) {
3439
- const stripped = entry2.replace(/\/\*\*?$/, "");
3456
+ function looksLikeFilePath(entry) {
3457
+ const stripped = entry.replace(/\/\*\*?$/, "");
3440
3458
  const lastSegment = stripped.split("/").pop() ?? stripped;
3441
3459
  const extMatch = /\.[A-Za-z0-9]{1,6}$/.exec(lastSegment);
3442
3460
  return extMatch !== null && extMatch.index > 0;
@@ -3922,14 +3940,14 @@ function checkClosesNTopology(branch, prBody, trancheFiles, taskIssueRefs) {
3922
3940
  const referenced = extractClosesReferences(prBody);
3923
3941
  if (taskIssueRefs) {
3924
3942
  for (const n of referenced) {
3925
- const ref2 = taskIssueRefs.get(n);
3926
- if (!ref2)
3943
+ const ref = taskIssueRefs.get(n);
3944
+ if (!ref)
3927
3945
  continue;
3928
- const expectedBranch = `task/${ref2.trancheSlug}/${ref2.taskId}`;
3946
+ const expectedBranch = `task/${ref.trancheSlug}/${ref.taskId}`;
3929
3947
  if (branch !== expectedBranch) {
3930
3948
  return {
3931
3949
  ok: false,
3932
- message: `closes-n-reverse: branch "${branch}" closes #${n} (task ${ref2.taskId} of tranche "${ref2.trancheSlug}") but is not named "${expectedBranch}" — rename the branch and re-push, or if this work is intentionally outside AEG's dispatch flow, remove the Closes reference.`
3950
+ message: `closes-n-reverse: branch "${branch}" closes #${n} (task ${ref.taskId} of tranche "${ref.trancheSlug}") but is not named "${expectedBranch}" — rename the branch and re-push, or if this work is intentionally outside AEG's dispatch flow, remove the Closes reference.`
3933
3951
  };
3934
3952
  }
3935
3953
  }
@@ -3938,15 +3956,15 @@ function checkClosesNTopology(branch, prBody, trancheFiles, taskIssueRefs) {
3938
3956
  if (!ref)
3939
3957
  return { ok: true };
3940
3958
  if (ref.kind === "issue") {
3941
- const expectedIssue2 = ref.issueNumber;
3942
- if (!referenced.has(expectedIssue2)) {
3959
+ const expectedIssue = ref.issueNumber;
3960
+ if (!referenced.has(expectedIssue)) {
3943
3961
  return {
3944
3962
  ok: false,
3945
- expectedIssue: expectedIssue2,
3946
- message: `closes-n: PR body does not contain \`Closes #${expectedIssue2}\` (required for branch "${branch}"). Add it to the PR body Summary section.`
3963
+ expectedIssue,
3964
+ message: `closes-n: PR body does not contain \`Closes #${expectedIssue}\` (required for branch "${branch}"). Add it to the PR body Summary section.`
3947
3965
  };
3948
3966
  }
3949
- return { ok: true, expectedIssue: expectedIssue2 };
3967
+ return { ok: true, expectedIssue };
3950
3968
  }
3951
3969
  const trancheSlug = ref.tranche;
3952
3970
  const taskId = ref.taskId;
@@ -3992,8 +4010,8 @@ function extractIssue(body) {
3992
4010
  const anchorNums = closesRefs(anchored);
3993
4011
  if (anchorNums.length === 0)
3994
4012
  return { issue: null, extraIssues: bodyNums, outsideHeader: false };
3995
- const issue2 = anchorNums[0];
3996
- return { issue: issue2, extraIssues: bodyNums.filter((n) => n !== issue2), outsideHeader: false };
4013
+ const issue = anchorNums[0];
4014
+ return { issue, extraIssues: bodyNums.filter((n) => n !== issue), outsideHeader: false };
3997
4015
  }
3998
4016
  const headerNums = closesRefs(headerRegion(stripped));
3999
4017
  if (bodyNums.length === 0)
@@ -4062,15 +4080,15 @@ function compareManifest(echoed, current, patchIdOf) {
4062
4080
  const bothFullShas = echoedShaLen >= 40 && currentShaLen >= 40;
4063
4081
  const base = patchHead || exactHead && bothFullShas ? true : isBoundToBase(echoed, current.baseSha);
4064
4082
  const briefHashBound = isBoundToBriefHash(echoed, current.briefHash);
4065
- const objectivesVersion2 = isBoundToObjectives(echoed, current.objectivesVersion);
4083
+ const objectivesVersion = isBoundToObjectives(echoed, current.objectivesVersion);
4066
4084
  const rulingOrdinal = isBoundToRulings(echoed, current.rulingOrdinal);
4067
4085
  const policyDigestBound = isBoundToPolicy(echoed, current.policyDigest);
4068
4086
  return {
4069
- bound: head && base && briefHashBound && objectivesVersion2 && rulingOrdinal && policyDigestBound,
4087
+ bound: head && base && briefHashBound && objectivesVersion && rulingOrdinal && policyDigestBound,
4070
4088
  head,
4071
4089
  base,
4072
4090
  briefHash: briefHashBound,
4073
- objectivesVersion: objectivesVersion2,
4091
+ objectivesVersion,
4074
4092
  rulingOrdinal,
4075
4093
  policyDigest: policyDigestBound
4076
4094
  };
@@ -4101,8 +4119,8 @@ function checkReviewGate(input) {
4101
4119
  let codeReviewPolicyEvaluation;
4102
4120
  let securityPolicyEvaluation;
4103
4121
  try {
4104
- codeReviewPolicyEvaluation = evaluateCodeReview(codeReview.findingSeverities, policy);
4105
- securityPolicyEvaluation = evaluateSecurityReview(security.findingSeverities, policy);
4122
+ codeReviewPolicyEvaluation = evaluateCodeReview(consequentialFindings(codeReview.findingSeverities), policy);
4123
+ securityPolicyEvaluation = evaluateSecurityReview(consequentialFindings(security.findingSeverities), policy);
4106
4124
  } catch (err) {
4107
4125
  return {
4108
4126
  verdict: "fail",
@@ -5183,11 +5201,27 @@ var ObservedSchema = z.object({
5183
5201
  var TaskStatusInputSchema = z.object({
5184
5202
  task: TaskToolRefSchema.optional()
5185
5203
  }).merge(PageRequestSchema).strict();
5204
+ var TaskConfidenceSchema = z.object({
5205
+ round: z.number().int().positive(),
5206
+ percent: z.number().int().min(0).max(100).nullable(),
5207
+ source: z.enum(["stated", "published-summary"])
5208
+ }).strict();
5209
+ var TaskPhaseHistorySchema = z.object({
5210
+ typicalPhaseMinutes: z.number().nonnegative(),
5211
+ typicalPhaseSamples: z.number().int().positive()
5212
+ }).strict();
5186
5213
  var TaskStatusItemSchema = z.object({
5187
5214
  task: TaskToolRefSchema,
5188
5215
  issue: z.number().int().positive(),
5189
5216
  pr: z.number().int().positive().nullable(),
5190
- state: z.string()
5217
+ state: z.string(),
5218
+ round: z.number().int().positive().nullable().optional(),
5219
+ phase: z.string().min(1).nullable().optional(),
5220
+ minutesInPhase: z.number().nonnegative().nullable().optional(),
5221
+ phaseIsCurrent: z.boolean().nullable().optional(),
5222
+ lastConfidence: TaskConfidenceSchema.nullable().optional(),
5223
+ lastConfidenceUnread: z.boolean().optional(),
5224
+ phaseHistory: TaskPhaseHistorySchema.nullable().optional()
5191
5225
  }).merge(ObservedSchema);
5192
5226
  var TaskStatusResultSchema = z.object({
5193
5227
  items: z.array(TaskStatusItemSchema),
@@ -5199,7 +5233,7 @@ var EscalationInputsSchema = z.object({
5199
5233
  round: z.number().int().nonnegative(),
5200
5234
  head: z.string(),
5201
5235
  branch: z.string(),
5202
- prNumber: z.number().int().positive()
5236
+ prNumber: z.number().int().positive().nullable()
5203
5237
  });
5204
5238
  var EscalationEvidenceSchema = z.object({
5205
5239
  round: z.number().int().nonnegative(),
@@ -5235,13 +5269,45 @@ var TaskEscalationReadResultSchema = z.object({
5235
5269
  items: z.array(TaskEscalationPacketSchema),
5236
5270
  nextCursor: z.string().nullable()
5237
5271
  }).merge(ObservedSchema);
5238
- var TaskStartInputSchema = z.object({
5239
- tranche: z.string().min(1),
5240
- id: z.string().min(1)
5272
+ var TaskPrCheckSchema = z.object({
5273
+ name: z.string(),
5274
+ required: z.boolean(),
5275
+ status: z.string(),
5276
+ conclusion: z.string().nullable(),
5277
+ detailsUrl: z.string().nullable(),
5278
+ failureSummary: z.string().nullable()
5279
+ });
5280
+ var TaskPrVerdictSchema = z.object({
5281
+ role: z.enum(["code-review", "security"]),
5282
+ value: z.string(),
5283
+ judgedHead: z.string().nullable(),
5284
+ objectivesVersion: z.string().nullable()
5285
+ });
5286
+ var TaskPrPauseSchema = z.object({
5287
+ reason: z.string(),
5288
+ body: z.string()
5289
+ });
5290
+ var TaskPrReviewRecordSchema = z.object({
5291
+ verdicts: z.array(TaskPrVerdictSchema),
5292
+ roundMarkers: z.array(z.number().int().nonnegative()),
5293
+ summaryTable: z.string().nullable(),
5294
+ pause: TaskPrPauseSchema.nullable()
5295
+ });
5296
+ var TaskPrReadInputSchema = z.object({
5297
+ task: TaskToolRefSchema,
5298
+ pr: z.number().int().positive().optional()
5241
5299
  }).strict();
5300
+ var TaskPrReadResultSchema = z.object({
5301
+ task: TaskToolRefSchema,
5302
+ issue: z.number().int().positive(),
5303
+ pr: z.number().int().positive(),
5304
+ head: z.string().nullable(),
5305
+ checks: z.array(TaskPrCheckSchema),
5306
+ review: TaskPrReviewRecordSchema
5307
+ }).merge(ObservedSchema);
5242
5308
  var TaskStartResultSchema = z.object({
5243
5309
  requestId: z.string().min(1),
5244
- run: z.object({ tranche: z.string().min(1), id: z.string().min(1) }),
5310
+ run: TaskToolRefSchema,
5245
5311
  started: z.boolean(),
5246
5312
  startedAt: z.string(),
5247
5313
  mode: z.literal("attended")
@@ -5255,7 +5321,7 @@ var TaskCancelInputSchema = z.object({
5255
5321
  }).strict();
5256
5322
  var TaskResumeResultSchema = z.object({
5257
5323
  task: z.number().int().positive(),
5258
- pr: z.number().int().positive(),
5324
+ pr: z.number().int().positive().nullable(),
5259
5325
  escalationId: z.string().min(1),
5260
5326
  outcome: z.enum(["started", "already_resumed"]),
5261
5327
  authenticatedBy: z.string().min(1),
@@ -5264,7 +5330,7 @@ var TaskResumeResultSchema = z.object({
5264
5330
  var TaskCancelOutcomeSchema = z.enum(["confirmed", "pending", "uncertain"]);
5265
5331
  var TaskCancelResultSchema = z.object({
5266
5332
  task: z.number().int().positive(),
5267
- pr: z.number().int().positive(),
5333
+ pr: z.number().int().positive().nullable(),
5268
5334
  escalationId: z.string().min(1),
5269
5335
  outcome: TaskCancelOutcomeSchema,
5270
5336
  authenticatedBy: z.string().min(1),
@@ -5275,6 +5341,7 @@ var TASK_TOOL_NAMES = [
5275
5341
  "task_start",
5276
5342
  "task_status",
5277
5343
  "task_escalation_read",
5344
+ "task_pr_read",
5278
5345
  "task_resume",
5279
5346
  "task_cancel"
5280
5347
  ];
@@ -5502,6 +5569,10 @@ function findWorkspaceEscapes(files, knownPaths, workspaceDirs = DEFAULT_WORKSPA
5502
5569
  }
5503
5570
  return findings;
5504
5571
  }
5572
+ // ../../packages/aeg-core/src/dev-review-loop/types.ts
5573
+ var SEVERITY_COLUMNS = ["blocker", "major", "minor", "critical", "high", "medium", "low"];
5574
+ // ../../packages/aeg-core/src/dev-review-loop/journal-reconstruction.ts
5575
+ var SUMMARY_TABLE_HEADER = `| round | ${SEVERITY_COLUMNS.join(" | ")} | confidence | outcome |`;
5505
5576
  // ../../packages/aeg-core/src/log/envelope.ts
5506
5577
  import { createHash as createHash5 } from "node:crypto";
5507
5578
 
@@ -6040,6 +6111,7 @@ function redact(value, home) {
6040
6111
  return value;
6041
6112
  }
6042
6113
  // ../../packages/aeg-core/src/log/store.ts
6114
+ var KNOWN_SCHEMA_VERSIONS = [1, 2];
6043
6115
  function metaOf(obj) {
6044
6116
  if (obj === null || typeof obj !== "object")
6045
6117
  return null;
@@ -6062,11 +6134,61 @@ function recordIdentity(obj) {
6062
6134
  }
6063
6135
  return null;
6064
6136
  }
6065
-
6066
- // ../../packages/aeg-core/src/log/artifact.ts
6067
- var TASK_LOG_ARTIFACT_MAX_BYTES = 8 * 1024 * 1024;
6068
- // ../../packages/aeg-core/src/dev-review-loop/journal-reconstruction.ts
6069
- var STOPPED_CONDITIONS = new Set(["confidence", "reappearance", "no_progress", "max_rounds"]);
6137
+ function schemaVersionOf(obj) {
6138
+ const meta = metaOf(obj);
6139
+ const schema = meta?.schema;
6140
+ return typeof schema === "number" ? schema : null;
6141
+ }
6142
+ function isKnownSchema(version) {
6143
+ return version !== null && KNOWN_SCHEMA_VERSIONS.includes(version);
6144
+ }
6145
+ function classifyStoredLine(raw, home) {
6146
+ let obj;
6147
+ try {
6148
+ obj = JSON.parse(raw);
6149
+ } catch {
6150
+ return { status: "invalid", identity: null, raw, reason: "not valid JSON" };
6151
+ }
6152
+ const version = schemaVersionOf(obj);
6153
+ if (version === null) {
6154
+ return { status: "invalid", identity: recordIdentity(obj), raw, reason: "no readable meta.schema" };
6155
+ }
6156
+ if (!isKnownSchema(version)) {
6157
+ return {
6158
+ status: "unknown_version",
6159
+ identity: recordIdentity(obj),
6160
+ schema: version,
6161
+ raw,
6162
+ reason: `schema version ${version} is not one this build validates (${KNOWN_SCHEMA_VERSIONS.join(", ")}) — kept for diagnosis`
6163
+ };
6164
+ }
6165
+ const result = LogEventSchema.safeParse(obj);
6166
+ if (!result.success) {
6167
+ return {
6168
+ status: "invalid",
6169
+ identity: recordIdentity(obj),
6170
+ raw,
6171
+ reason: result.error.issues[0]?.message ?? "schema violation"
6172
+ };
6173
+ }
6174
+ const event = result.data;
6175
+ const identity = recordIdentity(event);
6176
+ if (identity === null) {
6177
+ return { status: "invalid", identity: null, raw, reason: "valid event with no derivable identity" };
6178
+ }
6179
+ const redacted = redact(event, home);
6180
+ const provenance = version === 2 ? event.meta.provenance ?? null : null;
6181
+ return {
6182
+ status: "ok",
6183
+ identity,
6184
+ runId: event.meta.run_id,
6185
+ seq: event.meta.seq,
6186
+ schema: version,
6187
+ provenance,
6188
+ event,
6189
+ postLine: JSON.stringify(redacted)
6190
+ };
6191
+ }
6070
6192
  // ../../packages/aeg-core/src/control-store/records.ts
6071
6193
  import { z as z3 } from "zod";
6072
6194
  var isoTimestamp = z3.string().min(1);
@@ -6347,10 +6469,10 @@ var COMMANDS = [
6347
6469
  }
6348
6470
  ],
6349
6471
  details: [
6350
- "Composes `task brief`'s own preparation (`prepareTask`) with `dev-review-loop` (`devReviewLoop`) — nothing else. Preparation starts no agent; the loop's own round 1 reads the frozen brief off the Issue and is the only place a developer is ever dispatched from a fresh task, so exactly one developer is started by construction.",
6472
+ "Composes `task brief`'s own preparation (`prepareTask`) with the watching driver (`runDriverLoop`, `dev-review-loop.ts`) — nothing else. Preparation starts no agent; the loop's own round 1 reads the frozen brief off the Issue and is the only place a developer is ever dispatched from a fresh task, so exactly one developer is started by construction.",
6351
6473
  "A brief already frozen on the Issue is reused, never re-posted — the second `task dispatch`/`task brief` call this composes around does not fail the whole run, it just skips straight to running the loop. A task whose Issue refuses preparation (a missing brief section, an unmet dispatch gate) is refused before any agent starts, with nothing posted.",
6352
- "Refuses when the frozen brief's developer branch already has an open pull request — the old `task dispatch` followed by `task run` cannot start two developers this way.",
6353
- "Exit and printed summary distinguish a published, reviewed pull request (exit `0`, the PR URL) from a pause (exit `1`, with the exact `vinaya dev-review-loop --resume <pr>` command to continue), a usage/argv error (exit `2`), and any other failure (exit `3`) — never sharing `1` with a pause, so an unattended host tells them apart from the exit code alone. A run that pauses is resumed with the loop's own existing `--resume <pr>` flag, never a flag on this command."
6474
+ "Refuses when the frozen brief's developer branch already has an open pull request AND a driver is still live for it — a driver that crashed or was killed leaves its PR behind, and this command is the one that revives it, in any state, pause held or not.",
6475
+ "issue-711 O4: a pause never ends this process — it keeps running and watches the pull request, continuing on its own once a newer Principal ruling appears (or, for an `'infrastructure'`/`'stale_driver'` pause, after a bounded backoff), with no `--resume` command needed for the ordinary case. Exit and printed summary distinguish a published pull request OR a watched pause's own genuine end — merged, closed, or an operator's own `--cancel` (exit `0` either way, the PR URL) — from the one pause this process can never watch (no pull request exists yet — exit `1`, with the exact `vinaya task run <tranche> <n>` command to continue by hand), a usage/argv error (exit `2`), and any other failure (exit `3`)."
6354
6476
  ],
6355
6477
  status: "shipped"
6356
6478
  },
@@ -6389,7 +6511,7 @@ var COMMANDS = [
6389
6511
  details: [
6390
6512
  "Exposes the task-operator tool catalog (`packages/aeg-core/src/task-tools.ts`) to an agent runtime as one MCP server speaking newline-delimited JSON-RPC 2.0 (`initialize`/`tools/list`/`tools/call`). Claude registers it through the generated `.mcp.json`; Codex through its documented `~/.codex/config.toml` `[mcp_servers]` table — both point at this same command.",
6391
6513
  "stdout carries JSON-RPC and nothing else: any stray write from the CLI (a forge-read warning) is redirected to stderr, so the protocol stream is never corrupted.",
6392
- "`task_status`/`task_escalation_read` read; `task_start` starts a run in attended mode only, requiring an authenticated caller from the invocation context (`VINAYA_MCP_CALLER`) and refusing without one — MCP is a transport, not authorization. `task_resume`/`task_cancel` require the same authenticated caller, plus a current Principal ruling read fresh from the run's own PR — never a caller-supplied approval; `task_resume` triggers the existing `dev-review-loop --resume` continuation exactly once per escalation, and `task_cancel` reports a truthful `confirmed`/`pending`/`uncertain` outcome, idempotently, across repeated calls. No unattended start until the worker-isolation boundary and a capability flag land."
6514
+ "`task_status`/`task_escalation_read`/`task_pr_read` read; `task_pr_read` returns the selected task's OWN pull request — every required and reported check with its state, conclusion and failure summary, plus the principal-authored review record (newest verdicts and their judged head, round markers, published summary table, pause comment) — and refuses any other pull request; `task_start` starts a run in attended mode only, requiring an authenticated caller from the invocation context (`VINAYA_MCP_CALLER`) and refusing without one — MCP is a transport, not authorization. `task_resume`/`task_cancel` require the same authenticated caller, plus a current Principal ruling read fresh from the run's own PR — never a caller-supplied approval; `task_resume` triggers the existing `dev-review-loop --resume` continuation exactly once per escalation, and `task_cancel` reports a truthful `confirmed`/`pending`/`uncertain` outcome, idempotently, across repeated calls. No unattended start until the worker-isolation boundary and a capability flag land."
6393
6515
  ],
6394
6516
  status: "shipped"
6395
6517
  },
@@ -6519,48 +6641,6 @@ var COMMANDS = [
6519
6641
  ],
6520
6642
  status: "shipped"
6521
6643
  },
6522
- {
6523
- name: "log flush",
6524
- description: "Post a target Issue or PR's outbox as one or more marked comments, then truncate what the forge confirmed",
6525
- flags: [
6526
- { flag: "--issue", description: "Flush this Issue's outbox (`~/.vinaya/outbox/<owner>-<repo>/<n>.ndjson`)" },
6527
- {
6528
- flag: "--pr",
6529
- description: "Flush the Issue named by this PR's `Closes #N` line, posting the comments on the PR"
6530
- },
6531
- { flag: "--json", description: "Enveloped JSON output (schema: 1)" }
6532
- ],
6533
- details: [
6534
- "Exactly one of `--issue`/`--pr` is required. `--pr` resolves the Issue from the PR body's `Closes #N` line — the same anchor every gate reads — and refuses with a check error naming the missing line when the body carries none.",
6535
- "Splits the outbox first at `run_id` boundaries (a maximal run of consecutive lines sharing one `run_id`, never a global group-by, so an interleaved outbox never produces a range spanning a gap), then at `FORGE_COMMENT_MAX_CHARS` (65536) within each run. Each comment opens with `<!-- aeg:log:<run_id>:<seq_from>-<seq_to> -->` on its own line, then one fenced `ndjson` block, one outbox line per line, verbatim. A single line too large to fit alone is refused by name, never split across two comments.",
6536
- "Logs its own `forge_write` line — `validated` before posting, `written` (with every returned comment id) after the last post succeeds, or `refused` (with gh's error) on any failure — through the same `log()` every other family uses, into the same outbox, before truncating. The outbox is truncated only to the lines confirmed posted; a failed chunk's lines, and anything appended to the outbox during the flush (including the flush's own `validated`/`written`/`refused` line), always survive to ride the next flush."
6537
- ],
6538
- status: "shipped"
6539
- },
6540
- {
6541
- name: "log export-artifact",
6542
- description: "Copy this run's own local outbox into a file, for the generated task-path workflow's own upload step",
6543
- flags: [],
6544
- details: [
6545
- "Concatenates every `*.ndjson` file under `~/.vinaya/outbox/` into `<dest>`, verbatim — no filtering, no second redaction pass (lines are already redacted at `log()`'s own write boundary). Writes nothing when the outbox is empty, and exits 0 either way: no gate events this run is a legitimate outcome, never a failure.",
6546
- "Runs inside the generated `vinaya-checks.yml` job, which holds no forge-write credential — this command never calls the forge. Both this step and the `actions/upload-artifact` step after it run `if: always()`, so a cancelled or failed job still exports whatever partial outbox it has."
6547
- ],
6548
- status: "shipped"
6549
- },
6550
- {
6551
- name: "log collect-artifact",
6552
- description: "Validate a downloaded task-log artifact and publish the valid records through the existing flush path",
6553
- flags: [
6554
- { flag: "--pr", description: "The pull request this artifact belongs to" },
6555
- { flag: "--repo", description: "Expected `owner/repo` — a provenance cross-check against each record" }
6556
- ],
6557
- details: [
6558
- "Runs inside the generated `vinaya-task-log-collector.yml` workflow — a `workflow_run`-triggered job on the default branch, holding the write credential the task-path job that produced the artifact never gets. `<path>` is already downloaded by that workflow, scoped to a specific, API-verified run id — a provenance guarantee this command never re-derives from the artifact bytes.",
6559
- "Never executes, imports, or evaluates the artifact's content: every line is read as text and validated (schema, an 8 MiB whole-artifact size cap, redaction, and a repo cross-check) before anything is trusted. A rejected line becomes a named gap — printed, never a silent drop — and the artifact is never partially trusted past that check into executing anything.",
6560
- "The valid, re-redacted survivors are appended into the same local outbox `vinaya log flush` would read for that PR's Issue, then published through the existing `flushOutbox` unmodified — reusing its chunking, its `<!-- aeg:log:… -->` marker, and its idempotent-retry read, rather than a second publisher. A retried collector run (a fresh runner, the same forge state) therefore dedupes for free: the marker already on the forge is acknowledged, never re-posted."
6561
- ],
6562
- status: "shipped"
6563
- },
6564
6644
  {
6565
6645
  name: "milestone create",
6566
6646
  description: "Create a GitHub Milestone from a validated body",
@@ -6890,7 +6970,7 @@ var COMMANDS = [
6890
6970
  { flag: "--task", description: "This dispatch's task Issue number — mutually exclusive with `--pr`" },
6891
6971
  {
6892
6972
  flag: "--pr",
6893
- description: "Flush the outbox to this PR's Issue after the dispatch — mutually exclusive with `--task`"
6973
+ description: "This dispatch's pull request number, for attribution — mutually exclusive with `--task`"
6894
6974
  },
6895
6975
  { flag: "--round", description: "Round number, for a dispatch inside a review loop" },
6896
6976
  {
@@ -6902,7 +6982,7 @@ var COMMANDS = [
6902
6982
  details: [
6903
6983
  "Sets `VINAYA_RUN_ID`/`VINAYA_ROLE`/`VINAYA_TASK`/`VINAYA_ROUND` on the child only — never on this process's own environment — and refuses by name, before any spawn attempt, when the named vendor binary is absent from `PATH` or present but not executable.",
6904
6984
  "Records `dispatched` (with the prompt's sha256), `outcome_received` (duration, the vendor's own usage when its stdout prints a recognizable shape), or `dispatch_failed` (`timeout`, `crash`, or `refused`) through the Vinaya Log's one `dispatch` family writer, `dispatchRole`. A wall-time ceiling (`dispatch.timeoutMs` in config, default one hour) sends `SIGTERM` then, after a grace window, `SIGKILL`.",
6905
- "When `--task` or `--pr` is given, flushes that outbox via `vinaya log flush` immediately after the child settles — `--task` and `--pr` are mutually exclusive here, matching `log flush`'s own single-target rule. Without either, the dispatch still runs and logs; nothing is flushed, and the lines ride to the next flush.",
6985
+ "Runs no flush of its own after the dispatch returns: every log line `dispatchRole` emits reaches its configured `logs` destination live, as it is emitted, so there is nothing left to ship in a trailing step. `--task`/`--pr` are attribution only, and remain mutually exclusive.",
6906
6986
  "A successful dispatch's `DispatchHandle` carries `resumeId` — the vendor's own session/thread identifier (claude/gemini: `session_id`; codex: `thread_id`), parsed from its stdout, `null` on any failure. Passing that value as `--resume <id>` on a later call swaps in that vendor's own resume invocation (`claude -p -r <id> ...`; `codex exec resume <id> ...`; `gemini ... --resume <id> ...`) in place of its first-dispatch args."
6907
6987
  ],
6908
6988
  status: "shipped"
@@ -6922,7 +7002,8 @@ var COMMANDS = [
6922
7002
  "Dispatches the developer through `dispatchRole` with the brief read from the Issue, waits for the PR it opens, then runs `assessRound` (`@attalabs/aeg-core`) — the entire policy — against observations this command reads from the forge: the head via `git ls-remote` only (never `gh pr view headRefOid`, which can lag a push), CI conclusion via the check-runs API (never run locally), and ruling comments matching `<!-- aeg:principal:ruling:<pr>-<k> -->`.",
6923
7003
  "Nothing is posted to the PR before the policy decides `publish`: each round's reviewer and security verdicts are dispatched fresh (never a resumed session) through `dispatchRole`, rendered through `review post`'s own render functions, and written to a local file under the outbox — never `gh pr comment`/`gh pr review`. Posting the held verdicts is a separate, later task.",
6924
7004
  "The developer's session is resumed every round via `dispatchRole`'s `resumeId` — never a fresh session — for every vendor; a round whose resume fails for a vendor that resumed successfully the round before stops the loop rather than silently falling back to a fresh developer session.",
6925
- "Every dispatch and round transition is a log line through the Vinaya Log, flushed to the forge at each round boundary."
7005
+ "Every dispatch and round transition is a log line through the Vinaya Log, delivered live to its configured `logs` destination as it is emitted — never a tracker comment.",
7006
+ "issue-711 O4: this command — `--task <n>`, `--resume <pr>`, `--cancel <pr>` alike — stays `task run`'s own one-shot debug/direct entry; the watching driver that survives a pause and continues on its own is `task run`'s (see that command's own entry)."
6926
7007
  ],
6927
7008
  status: "shipped"
6928
7009
  }
@@ -6949,7 +7030,8 @@ function emitCheckError(error) {
6949
7030
  }
6950
7031
 
6951
7032
  // src/lib/config.ts
6952
- import { execFileSync as execFileSync2 } from "node:child_process";
7033
+ import { execFile as execFile4, execFileSync as execFileSync2 } from "node:child_process";
7034
+ import { promisify as promisify4 } from "node:util";
6953
7035
  import { existsSync, mkdirSync, readFileSync as readFileSync2, realpathSync, writeFileSync } from "node:fs";
6954
7036
  import { homedir } from "node:os";
6955
7037
  import { dirname, isAbsolute, join, resolve } from "node:path";
@@ -6976,10 +7058,10 @@ var CheckEntrySchema = z5.object({
6976
7058
  ownWorkflow: z5.boolean().optional(),
6977
7059
  principalOwed: z5.literal(true).optional(),
6978
7060
  validates: z5.enum(["body", "issue"]).optional()
6979
- }).superRefine((entry2, ctx) => {
6980
- if (!entry2.env)
7061
+ }).superRefine((entry, ctx) => {
7062
+ if (!entry.env)
6981
7063
  return;
6982
- for (const [key, value] of Object.entries(entry2.env)) {
7064
+ for (const [key, value] of Object.entries(entry.env)) {
6983
7065
  if (typeof value !== "object" || value === null || !("anyOf" in value))
6984
7066
  continue;
6985
7067
  const members = value.anyOf;
@@ -7136,18 +7218,19 @@ var VinayaConfigSchema = z5.object({
7136
7218
  });
7137
7219
  }
7138
7220
  }).optional(),
7139
- logPublish: z5.object({
7140
- issue: z5.number().int().positive().optional(),
7141
- pr: z5.number().int().positive().optional(),
7142
- webhookUrl: z5.string().url().optional(),
7143
- headers: z5.record(z5.string()).optional(),
7144
- maxChunksPerFlush: z5.number().int().positive().optional()
7145
- }).refine((v) => [v.issue, v.pr, v.webhookUrl].filter((x) => x !== undefined).length <= 1, {
7146
- message: "logPublish: set at most one of issue/pr/webhookUrl"
7147
- }).refine((v) => v.headers === undefined || v.webhookUrl !== undefined, {
7148
- message: "logPublish: headers requires webhookUrl"
7149
- }).optional(),
7150
- runtimeDir: z5.string().min(1).refine((v) => isAbsolute(v), { message: "runtimeDir: must be an absolute path" }).optional()
7221
+ logPublish: z5.unknown().refine((v) => v === undefined, {
7222
+ message: "logPublish is removed — telemetry is never posted to a tracker or a code host; configure `logs` instead (a folder or a server destination)"
7223
+ }),
7224
+ runtimeDir: z5.string().min(1).refine((v) => isAbsolute(v), { message: "runtimeDir: must be an absolute path" }).optional(),
7225
+ logs: z5.object({
7226
+ folder: z5.string().min(1).refine((v) => isAbsolute(v), { message: "logs.folder: must be an absolute path" }).optional(),
7227
+ url: z5.string().url().optional(),
7228
+ headers: z5.record(z5.string()).optional()
7229
+ }).refine((v) => [v.folder, v.url].filter((x) => x !== undefined).length <= 1, {
7230
+ message: "logs: set at most one of folder/url"
7231
+ }).refine((v) => v.headers === undefined || v.url !== undefined, {
7232
+ message: "logs: headers requires url"
7233
+ }).optional()
7151
7234
  });
7152
7235
  var GLOBAL_VINAYA_HOME = join(homedir(), ".vinaya");
7153
7236
  var GLOBAL_CONFIG_PATH = join(GLOBAL_VINAYA_HOME, "config.json");
@@ -7192,32 +7275,39 @@ function globalTokensCollectIgnoredWarning(path) {
7192
7275
  function globalRuntimeDirIgnoredWarning(path) {
7193
7276
  return `${path}: "runtimeDir" in the global config is ignored — it carries no repository segment, so a machine-wide value would collapse every repository's task folders into one tree. Declare it from a repo-local vinaya.config.json.`;
7194
7277
  }
7278
+ var emittedGlobalKeyWarnings = new Set;
7279
+ function warnGlobalKeyIgnoredOnce(message) {
7280
+ if (emittedGlobalKeyWarnings.has(message))
7281
+ return;
7282
+ emittedGlobalKeyWarnings.add(message);
7283
+ console.error(`⚠ ${message}`);
7284
+ }
7195
7285
  function stripGlobalOnlyKeys(config, path) {
7196
7286
  if (path !== GLOBAL_CONFIG_PATH)
7197
7287
  return config;
7198
7288
  let result = config;
7199
7289
  if (result.checks && Object.keys(result.checks).length > 0) {
7200
- console.error(`⚠ ${globalChecksIgnoredWarning(path)}`);
7290
+ warnGlobalKeyIgnoredOnce(globalChecksIgnoredWarning(path));
7201
7291
  result = { ...result, checks: undefined };
7202
7292
  }
7203
7293
  if (result.roles && Object.keys(result.roles).length > 0) {
7204
- console.error(`⚠ ${globalRolesIgnoredWarning(path)}`);
7294
+ warnGlobalKeyIgnoredOnce(globalRolesIgnoredWarning(path));
7205
7295
  result = { ...result, roles: undefined };
7206
7296
  }
7207
7297
  if (result.principals && result.principals.length > 0) {
7208
- console.error(`⚠ ${globalPrincipalsIgnoredWarning(path)}`);
7298
+ warnGlobalKeyIgnoredOnce(globalPrincipalsIgnoredWarning(path));
7209
7299
  result = { ...result, principals: undefined };
7210
7300
  }
7211
7301
  if (result.releaseActor) {
7212
- console.error(`⚠ ${globalReleaseActorIgnoredWarning(path)}`);
7302
+ warnGlobalKeyIgnoredOnce(globalReleaseActorIgnoredWarning(path));
7213
7303
  result = { ...result, releaseActor: undefined };
7214
7304
  }
7215
7305
  if (result.tokens) {
7216
- console.error(`⚠ ${globalTokensCollectIgnoredWarning(path)}`);
7306
+ warnGlobalKeyIgnoredOnce(globalTokensCollectIgnoredWarning(path));
7217
7307
  result = { ...result, tokens: undefined };
7218
7308
  }
7219
7309
  if (result.runtimeDir) {
7220
- console.error(`⚠ ${globalRuntimeDirIgnoredWarning(path)}`);
7310
+ warnGlobalKeyIgnoredOnce(globalRuntimeDirIgnoredWarning(path));
7221
7311
  result = { ...result, runtimeDir: undefined };
7222
7312
  }
7223
7313
  return result;
@@ -7250,26 +7340,102 @@ function resolveReviewPolicy(config) {
7250
7340
  maxRounds
7251
7341
  };
7252
7342
  }
7253
- function trustAnchorRepo() {
7254
- const wellFormed = (slug) => /^[^/\s]+\/[^/\s]+$/.test(slug) ? slug : null;
7255
- const fromRunner = process.env.GITHUB_REPOSITORY?.trim();
7256
- if (fromRunner) {
7257
- const validated = wellFormed(fromRunner);
7258
- if (validated)
7259
- return validated;
7343
+ function resolveRuntimeDirSetting(config) {
7344
+ return config?.runtimeDir ?? null;
7345
+ }
7346
+ function resolveTrustAnchorRuntimeDir(localRuntimeDir, trustAnchorConfig) {
7347
+ const anchored = resolveRuntimeDirSetting(trustAnchorConfig);
7348
+ return anchored !== null && anchored === localRuntimeDir ? anchored : null;
7349
+ }
7350
+ function resolveLogsSetting(config) {
7351
+ const raw = config?.logs;
7352
+ if (!raw)
7353
+ return null;
7354
+ if (raw.url !== undefined)
7355
+ return { url: raw.url, headers: raw.headers };
7356
+ if (raw.folder !== undefined)
7357
+ return { folder: raw.folder };
7358
+ return null;
7359
+ }
7360
+ function resolveTrustAnchorLogsDestination(local, trustAnchorConfig) {
7361
+ const anchored = resolveLogsSetting(trustAnchorConfig);
7362
+ if (!anchored)
7363
+ return null;
7364
+ if ("url" in local)
7365
+ return "url" in anchored && anchored.url === local.url ? anchored : null;
7366
+ return "folder" in anchored && anchored.folder === local.folder ? anchored : null;
7367
+ }
7368
+ function resolveLogsHeaderValues(headers, env) {
7369
+ if (!headers)
7370
+ return;
7371
+ const resolved = {};
7372
+ for (const [key, value] of Object.entries(headers)) {
7373
+ resolved[key] = value.replace(/\$\{([A-Za-z_][A-Za-z0-9_]*)\}/g, (_match, name) => env[name] ?? "");
7260
7374
  }
7375
+ return resolved;
7376
+ }
7377
+ function trustAnchorRepo() {
7378
+ const fromRunner = trustAnchorRepoFromRunner();
7379
+ if (fromRunner)
7380
+ return fromRunner;
7261
7381
  try {
7262
7382
  const url = execFileSync2("git", ["remote", "get-url", "origin"], {
7263
7383
  encoding: "utf-8",
7264
7384
  stdio: ["ignore", "pipe", "pipe"]
7265
- }).trim();
7266
- const m = url.match(/github\.com[:/]([^/]+)\/(.+?)(?:\.git)?\/?$/);
7267
- return m?.[1] && m[2] ? wellFormed(`${m[1]}/${m[2]}`) : null;
7385
+ });
7386
+ return trustAnchorRepoFromRemoteUrl(url);
7268
7387
  } catch {
7269
7388
  return null;
7270
7389
  }
7271
7390
  }
7391
+ async function trustAnchorRepoAsync() {
7392
+ const fromRunner = trustAnchorRepoFromRunner();
7393
+ if (fromRunner)
7394
+ return fromRunner;
7395
+ try {
7396
+ const { stdout } = await execFileAsync4("git", ["remote", "get-url", "origin"], {
7397
+ encoding: "utf-8",
7398
+ timeout: 1e4
7399
+ });
7400
+ return trustAnchorRepoFromRemoteUrl(stdout);
7401
+ } catch {
7402
+ return null;
7403
+ }
7404
+ }
7405
+ function wellFormedRepoSlug(slug) {
7406
+ return /^[^/\s]+\/[^/\s]+$/.test(slug) ? slug : null;
7407
+ }
7408
+ function trustAnchorRepoFromRunner() {
7409
+ const fromRunner = process.env.GITHUB_REPOSITORY?.trim();
7410
+ return fromRunner ? wellFormedRepoSlug(fromRunner) : null;
7411
+ }
7412
+ function trustAnchorRepoFromRemoteUrl(url) {
7413
+ const m = url.trim().match(/github\.com[:/]([^/]+)\/(.+?)(?:\.git)?\/?$/);
7414
+ return m?.[1] && m[2] ? wellFormedRepoSlug(`${m[1]}/${m[2]}`) : null;
7415
+ }
7416
+ var execFileAsync4 = promisify4(execFile4);
7417
+ function resolveCiTrustAnchorProbeRef(env = process.env) {
7418
+ const ref = env.VINAYA_CI_CONFIG_PROBE_REF?.trim();
7419
+ if (!ref)
7420
+ return null;
7421
+ if (env.GITHUB_ACTIONS !== "true")
7422
+ return null;
7423
+ if ((env.GH_TOKEN ?? "").length > 0 || (env.GITHUB_TOKEN ?? "").length > 0)
7424
+ return null;
7425
+ return ref;
7426
+ }
7427
+ function readTrustAnchorConfigAtRef(ref) {
7428
+ const raw = execFileSync2("git", ["show", `${ref}:${LOCAL_CONFIG_FILENAME}`], {
7429
+ encoding: "utf-8",
7430
+ stdio: ["ignore", "pipe", "pipe"],
7431
+ timeout: 1e4
7432
+ });
7433
+ return Buffer.from(raw, "utf-8").toString("base64");
7434
+ }
7272
7435
  function ghFetchTrustAnchorConfig() {
7436
+ const probeRef = resolveCiTrustAnchorProbeRef();
7437
+ if (probeRef)
7438
+ return readTrustAnchorConfigAtRef(probeRef);
7273
7439
  const repo = trustAnchorRepo();
7274
7440
  if (!repo)
7275
7441
  throw new Error("could not resolve repo identity for the trust-anchor read");
@@ -7278,6 +7444,21 @@ function ghFetchTrustAnchorConfig() {
7278
7444
  stdio: ["ignore", "pipe", "pipe"]
7279
7445
  });
7280
7446
  }
7447
+ async function ghFetchTrustAnchorConfigAsync() {
7448
+ const probeRef = resolveCiTrustAnchorProbeRef();
7449
+ if (probeRef) {
7450
+ const { stdout } = await execFileAsync4("git", ["show", `${probeRef}:${LOCAL_CONFIG_FILENAME}`], {
7451
+ encoding: "utf-8",
7452
+ timeout: 1e4
7453
+ });
7454
+ return Buffer.from(stdout, "utf-8").toString("base64");
7455
+ }
7456
+ const repo = await trustAnchorRepoAsync();
7457
+ if (!repo)
7458
+ throw new Error("could not resolve repo identity for the trust-anchor read");
7459
+ const { stdout } = await execFileAsync4("gh", ["api", `repos/${repo}/contents/${LOCAL_CONFIG_FILENAME}`, "--jq", ".content"], { encoding: "utf-8", timeout: 1e4 });
7460
+ return stdout;
7461
+ }
7281
7462
  function firstLine(err) {
7282
7463
  return err?.message?.split(`
7283
7464
  `)[0] ?? "unknown error";
@@ -7292,16 +7473,35 @@ function isMissingFileError(err) {
7292
7473
  return /\b404\b|not found/i.test(haystack);
7293
7474
  }
7294
7475
  function loadTrustAnchorConfig(fetcher = ghFetchTrustAnchorConfig) {
7295
- const warn = (why) => process.stdout.write(`⚠ could not read the trust-anchor config (\`principals\`/\`releaseActor\`) from the default branch (${why}) — falling back to vinaya's built-in defaults.
7296
- `);
7297
7476
  let base64;
7298
7477
  try {
7299
- base64 = fetcher().trim();
7478
+ base64 = fetcher();
7300
7479
  } catch (err) {
7301
- if (!isMissingFileError(err))
7302
- warn(firstLine(err));
7303
- return null;
7480
+ return trustAnchorFetchFailed(err);
7481
+ }
7482
+ return parseTrustAnchorContent(base64);
7483
+ }
7484
+ async function loadTrustAnchorConfigAsync(fetcher = ghFetchTrustAnchorConfigAsync, options = {}) {
7485
+ const warn = options.quiet ? () => {} : warnTrustAnchorFallback;
7486
+ let base64;
7487
+ try {
7488
+ base64 = await fetcher();
7489
+ } catch (err) {
7490
+ return trustAnchorFetchFailed(err, warn);
7304
7491
  }
7492
+ return parseTrustAnchorContent(base64, warn);
7493
+ }
7494
+ function warnTrustAnchorFallback(why) {
7495
+ process.stdout.write(`⚠ could not read the trust-anchor config (\`principals\`/\`releaseActor\`) from the default branch (${why}) — falling back to vinaya's built-in defaults.
7496
+ `);
7497
+ }
7498
+ function trustAnchorFetchFailed(err, warn = warnTrustAnchorFallback) {
7499
+ if (!isMissingFileError(err))
7500
+ warn(firstLine(err));
7501
+ return null;
7502
+ }
7503
+ function parseTrustAnchorContent(content, warn = warnTrustAnchorFallback) {
7504
+ const base64 = content.trim();
7305
7505
  if (!base64)
7306
7506
  return null;
7307
7507
  try {
@@ -7331,7 +7531,7 @@ var TOKENS_COLLECT_TRUST_PATH = join(GLOBAL_VINAYA_HOME, "tokens-collect-trust.j
7331
7531
 
7332
7532
  // src/checks/bin/check-coherence.ts
7333
7533
  var CHECK_NAME = "coherence";
7334
- var execFileAsync4 = promisify4(execFile4);
7534
+ var execFileAsync5 = promisify5(execFile5);
7335
7535
  function git(args) {
7336
7536
  try {
7337
7537
  return execFileSync3("git", args, { encoding: "utf8", stdio: ["ignore", "pipe", "pipe"] }).trim();
@@ -7370,7 +7570,7 @@ async function resolveToken() {
7370
7570
  if (process.env.GH_TOKEN)
7371
7571
  return process.env.GH_TOKEN;
7372
7572
  try {
7373
- const { stdout } = await execFileAsync4("gh", ["auth", "token"]);
7573
+ const { stdout } = await execFileAsync5("gh", ["auth", "token"]);
7374
7574
  const token = stdout.trim();
7375
7575
  return token.length > 0 ? token : null;
7376
7576
  } catch {