@attalabs/vinaya 0.39.0 → 0.41.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 (186) hide show
  1. package/README.md +9 -9
  2. package/aeg-root/contracts/developer-reviewer.md +2 -2
  3. package/aeg-root/contracts/planner-developer.md +5 -5
  4. package/aeg-root/enforcement.md +22 -22
  5. package/aeg-root/process.md +4 -4
  6. package/aeg-root/roles/archivist.md +1 -1
  7. package/aeg-root/roles/developer/reference.md +7 -1
  8. package/aeg-root/roles/developer.md +1 -1
  9. package/aeg-root/roles/planner/reference.md +18 -5
  10. package/aeg-root/roles/principal.md +1 -1
  11. package/aeg-root/roles/reviewer.md +3 -3
  12. package/aeg-root/roles/security.md +4 -4
  13. package/aeg-root/roles/tranche-archivist.md +2 -2
  14. package/aeg-root/skills/aeg/SKILL.md +1 -1
  15. package/aeg-root/state-machine.md +10 -15
  16. package/aeg-root/templates/brief-template.md +5 -2
  17. package/aeg-root/templates/decision-record-template.md +38 -0
  18. package/aeg-root/templates/issue-rationale-template.md +1 -1
  19. package/aeg-root/tranche-model.md +1 -1
  20. package/dist/checks/bin/check-body-bare-digits.js +1974 -354
  21. package/dist/checks/bin/check-branch-topology.js +1296 -243
  22. package/dist/checks/bin/check-brief-shape.js +2038 -460
  23. package/dist/checks/bin/check-changeset-coverage.js +2411 -564
  24. package/dist/checks/bin/check-ci-shard-coverage.js +12391 -15
  25. package/dist/checks/bin/check-closes-n.js +1296 -243
  26. package/dist/checks/bin/check-coherence.js +1914 -1155
  27. package/dist/checks/bin/check-dead-branch-push.js +1242 -230
  28. package/dist/checks/bin/check-dispatch-readiness.js +2222 -460
  29. package/dist/checks/bin/check-doc-claims.js +2233 -260
  30. package/dist/checks/bin/check-doc-coverage-push.js +2436 -550
  31. package/dist/checks/bin/check-doc-coverage.js +2434 -552
  32. package/dist/checks/bin/check-doctrine-no-procedures.js +1776 -353
  33. package/dist/checks/bin/check-doctrine-portability.js +2408 -561
  34. package/dist/checks/bin/check-evidence-fresh.js +2370 -508
  35. package/dist/checks/bin/check-exec-bits.js +2407 -560
  36. package/dist/checks/bin/check-first-push-dispatch.js +1984 -380
  37. package/dist/checks/bin/check-issue-assignment.js +712 -170
  38. package/dist/checks/bin/check-issue-milestone-attach.js +1233 -230
  39. package/dist/checks/bin/check-issue-objectives-numbering.js +1769 -346
  40. package/dist/checks/bin/check-issue-parts-coverage.js +1233 -230
  41. package/dist/checks/bin/check-issue-surface-globs.js +1926 -378
  42. package/dist/checks/bin/check-issue-title-grammar.js +1233 -230
  43. package/dist/checks/bin/check-issue-tranche-label.js +702 -170
  44. package/dist/checks/bin/check-main-branch-refusal.js +1245 -232
  45. package/dist/checks/bin/check-no-disk-state.js +1233 -230
  46. package/dist/checks/bin/check-pr-premise-reassert.js +1769 -346
  47. package/dist/checks/bin/check-pr-report-density.js +1233 -230
  48. package/dist/checks/bin/check-principal-test-plan-wait.js +2489 -259
  49. package/dist/checks/bin/check-quoted-command.js +2391 -544
  50. package/dist/checks/bin/check-reader-resolvable-prose.js +2437 -564
  51. package/dist/checks/bin/check-registry-gates.js +1380 -296
  52. package/dist/checks/bin/check-retired-vocabulary.js +2416 -550
  53. package/dist/checks/bin/check-review-gate.js +2073 -371
  54. package/dist/checks/bin/check-single-plan-pr.js +1297 -235
  55. package/dist/checks/bin/check-surface-scope.js +1531 -252
  56. package/dist/checks/bin/check-test-plan.js +2487 -258
  57. package/dist/checks/bin/check-token-collection-wired.js +1233 -230
  58. package/dist/checks/bin/check-workspace-escape.js +2408 -561
  59. package/dist/checks/bin/verify-coherence.js +597 -97
  60. package/dist/checks/bin/verify-dispatch.js +632 -152
  61. package/dist/checks/bin/verify-docs.js +642 -132
  62. package/dist/index.js +25948 -16630
  63. package/dist/lib/pre-push-cache-test-run.js +1813 -297
  64. package/dist/lib/pre-push-changed-files.js +65 -19
  65. package/dist/lib/pre-push-mode.js +466 -0
  66. package/dist/lib/pre-push-progress-dir.js +4205 -0
  67. package/dist/lib/pre-push-record-tests.js +446 -0
  68. package/dist/lib/pre-push-select-tests.js +2353 -632
  69. package/dist/lib/push-progress-observer.js +4213 -0
  70. package/package.json +22 -5
  71. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/anchored-region.ts +17 -3
  72. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/brief-render.ts +73 -30
  73. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/brief-validation.ts +3 -3
  74. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/coherence-checks.ts +2 -2
  75. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/control-store/local.ts +88 -5
  76. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/control-store/records.ts +34 -2
  77. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/assess-round.ts +26 -4
  78. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/fakes.ts +7 -2
  79. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/index.ts +7 -1
  80. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/types.ts +29 -3
  81. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dispatch-gate.ts +35 -18
  82. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/docs/index.ts +1 -1
  83. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/docs/published-prose.ts +70 -45
  84. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/doctrine-portability.ts +6 -1
  85. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/entry-point.ts +27 -0
  86. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/gate-audience.ts +3 -5
  87. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/index.ts +96 -9
  88. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/issue-assignment.ts +24 -54
  89. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/issue-validation.ts +809 -106
  90. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/live-record.ts +179 -0
  91. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/envelope.ts +8 -2
  92. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/index.ts +1 -0
  93. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/narration.ts +2 -0
  94. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/schema-digest.ts +225 -0
  95. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/schema.ts +7 -1
  96. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/main-branch-refusal.ts +23 -1
  97. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/pr-report-density.ts +6 -4
  98. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/principals-config.ts +44 -0
  99. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/prose-rules.ts +532 -0
  100. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/protected-paths.ts +31 -0
  101. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/reader-resolvable-prose.ts +157 -80
  102. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/registry-checks.ts +8 -12
  103. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/retired-vocabulary.ts +53 -93
  104. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/review-gate.ts +46 -17
  105. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/review-input-manifest.ts +85 -1
  106. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/review-policy.ts +32 -13
  107. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/ruling-ordinal.ts +46 -0
  108. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/task-branch-identity.ts +2 -4
  109. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/test-plan-gate.ts +63 -8
  110. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/verdict-extraction.ts +24 -0
  111. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/waiver-label.ts +0 -1
  112. package/studio-standalone/apps/vinaya-studio/web/.next/BUILD_ID +1 -1
  113. package/studio-standalone/apps/vinaya-studio/web/.next/build-manifest.json +3 -3
  114. package/studio-standalone/apps/vinaya-studio/web/.next/prerender-manifest.json +3 -3
  115. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.html +1 -1
  116. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.rsc +1 -1
  117. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  118. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  119. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  120. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  121. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  122. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_not-found/page/server-reference-manifest.json +2 -2
  123. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_not-found/page.js.nft.json +1 -1
  124. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  125. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/page/server-reference-manifest.json +2 -2
  126. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/page.js.nft.json +1 -1
  127. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/page_client-reference-manifest.js +1 -1
  128. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/backlog/page/server-reference-manifest.json +2 -2
  129. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/backlog/page.js +1 -1
  130. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/backlog/page.js.nft.json +1 -1
  131. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/backlog/page_client-reference-manifest.js +1 -1
  132. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/page/server-reference-manifest.json +2 -2
  133. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/page.js +1 -1
  134. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/page.js.nft.json +1 -1
  135. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/page_client-reference-manifest.js +1 -1
  136. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/page/server-reference-manifest.json +2 -2
  137. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/page.js +1 -1
  138. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/page.js.nft.json +1 -1
  139. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/page_client-reference-manifest.js +1 -1
  140. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/page/server-reference-manifest.json +3 -3
  141. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/page.js +1 -1
  142. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/page.js.nft.json +1 -1
  143. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/page_client-reference-manifest.js +1 -1
  144. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/tasks/[taskId]/page/server-reference-manifest.json +2 -2
  145. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/tasks/[taskId]/page.js +2 -2
  146. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/tasks/[taskId]/page.js.nft.json +1 -1
  147. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/tasks/[taskId]/page_client-reference-manifest.js +1 -1
  148. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/page/server-reference-manifest.json +2 -2
  149. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/page.js +1 -1
  150. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/page.js.nft.json +1 -1
  151. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/page_client-reference-manifest.js +1 -1
  152. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/tranches/page/server-reference-manifest.json +2 -2
  153. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/tranches/page.js +1 -1
  154. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/tranches/page.js.nft.json +1 -1
  155. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/tranches/page_client-reference-manifest.js +1 -1
  156. 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
  157. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__08e39jo._.js +1 -1
  158. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__0ls23oh._.js +1 -1
  159. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__0sxadt2._.js +13 -0
  160. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__1a3j3n1._.js +57 -0
  161. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/{[root-of-the-server]__1ug9syi._.js → [root-of-the-server]__1d4eth3._.js} +1 -1
  162. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__1gjqmhq._.js +1 -1
  163. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__1snpgaw._.js +3 -3
  164. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__1wc4-ip._.js +1 -1
  165. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_08onyya._.js +2 -2
  166. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_096f46i._.js +1 -1
  167. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0af2one._.js +1 -1
  168. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0e5tkdd._.js +1 -1
  169. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0kf2g72._.js +1 -1
  170. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0zf4d27._.js +3 -3
  171. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_1-wo68i._.js +1 -1
  172. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_1achbh9._.js +1 -1
  173. 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
  174. package/studio-standalone/apps/vinaya-studio/web/.next/server/middleware-build-manifest.js +3 -3
  175. package/studio-standalone/apps/vinaya-studio/web/.next/server/pages/500.html +1 -1
  176. package/studio-standalone/apps/vinaya-studio/web/.next/server/server-reference-manifest.js +1 -1
  177. package/studio-standalone/apps/vinaya-studio/web/.next/server/server-reference-manifest.json +4 -4
  178. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/{33rszkngkuoko.js → 0x7u6si-ai179.js} +1 -1
  179. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/{06_55xbp7rcbi.js → 2fu7mfsj4oima.js} +1 -1
  180. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/{2brkwv169ygep.js → 34b4ruddunn3q.js} +1 -1
  181. package/studio-standalone/apps/vinaya-studio/web/package.json +2 -2
  182. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__04adkz-._.js +0 -57
  183. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__19jyp3m._.js +0 -13
  184. /package/studio-standalone/apps/vinaya-studio/web/.next/static/{D3LiJNIq5FWZxen7CpOSJ → 2ZARxTwpuRew8-SvYsRdU}/_buildManifest.js +0 -0
  185. /package/studio-standalone/apps/vinaya-studio/web/.next/static/{D3LiJNIq5FWZxen7CpOSJ → 2ZARxTwpuRew8-SvYsRdU}/_clientMiddlewareManifest.js +0 -0
  186. /package/studio-standalone/apps/vinaya-studio/web/.next/static/{D3LiJNIq5FWZxen7CpOSJ → 2ZARxTwpuRew8-SvYsRdU}/_ssgManifest.js +0 -0
@@ -45,7 +45,6 @@ var GATE_AUDIENCE = {
45
45
  };
46
46
  var NON_GATE_BINS = [
47
47
  "archive-task",
48
- "assign-task-issue",
49
48
  "dead-branch-audit",
50
49
  "eval-agent-compliance",
51
50
  "open-issue",
@@ -308,6 +307,25 @@ async function runAsync(args) {
308
307
  function ghApiGet(path) {
309
308
  return JSON.parse(run(["api", path]));
310
309
  }
310
+ var MAX_PER_PAGE = 100;
311
+ var MAX_PAGES = 100;
312
+ async function ghApiGetAllPagesAsync(pathWithoutPage, opts) {
313
+ const [base = pathWithoutPage, query = ""] = pathWithoutPage.split("?");
314
+ const params = new URLSearchParams(query);
315
+ params.set("per_page", String(MAX_PER_PAGE));
316
+ const all = [];
317
+ for (let page = 1;page <= MAX_PAGES; page++) {
318
+ params.set("page", String(page));
319
+ const args = ["api", `${base}?${params.toString()}`];
320
+ if (opts?.jq)
321
+ args.push("-q", opts.jq);
322
+ const batch = JSON.parse(await runAsync(args));
323
+ all.push(...batch);
324
+ if (batch.length < MAX_PER_PAGE)
325
+ return all;
326
+ }
327
+ throw new Error(`ghApiGetAllPagesAsync: "${pathWithoutPage}" did not terminate within ${MAX_PAGES} pages (${MAX_PAGES * MAX_PER_PAGE} items) — refusing to keep walking.`);
328
+ }
311
329
  function issueListByLabelArgs(owner, repo, label) {
312
330
  return [
313
331
  "issue",
@@ -719,6 +737,10 @@ function intentGoalForSlug(description, slug) {
719
737
  function matchesLegacyMilestone(milestones, slug) {
720
738
  return milestones.find((m) => m.title === slug) ?? null;
721
739
  }
740
+ var TRANCHE_SLUG_SHAPE = /^[a-z0-9]+(?:-[a-z0-9]+)*-v\d+$/;
741
+ function slugShapedTitles(milestones) {
742
+ return milestones.map((m) => m.title).filter((t) => TRANCHE_SLUG_SHAPE.test(t));
743
+ }
722
744
  function factsFromLegacyMilestone(milestone) {
723
745
  return {
724
746
  goal: milestone.description ?? "",
@@ -752,6 +774,105 @@ function findMilestoneForSlug(owner, repo, slug) {
752
774
  return resolveLegacyFacts(legacy, issues);
753
775
  return { goal: goalFromMilestones(milestones, slug), lifecycle: lifecycleFromIssues(issues) };
754
776
  }
777
+ function trancheSlugsFromLabels(labels) {
778
+ const slugs = [];
779
+ for (const l of labels) {
780
+ const slug = trancheSlugOf(l.name);
781
+ if (slug !== null)
782
+ slugs.push(slug);
783
+ }
784
+ return slugs;
785
+ }
786
+ async function indexTrancheMilestonesAsync(owner, repo, options = {}) {
787
+ const read = (fetch) => options.retryFailedReads ? retryOnce(fetch) : fetch();
788
+ const [milestones, labels] = await Promise.all([
789
+ read(() => ghApiGetAllPagesAsync(`repos/${owner}/${repo}/milestones?state=all&per_page=100`)),
790
+ read(() => ghApiGetAllPagesAsync(`repos/${owner}/${repo}/labels?per_page=100`))
791
+ ]);
792
+ const active = [];
793
+ const archived = [];
794
+ const facts = new Map;
795
+ const legacySlugs = new Set(slugShapedTitles(milestones));
796
+ const legacyMilestoneBySlug = new Map(milestones.filter((m) => legacySlugs.has(m.title)).map((m) => [m.title, m]));
797
+ const newPathSlugs = trancheSlugsFromLabels(labels).filter((slug) => !legacySlugs.has(slug));
798
+ const uniqueNewPathSlugs = [...new Set(newPathSlugs)];
799
+ const uniqueLegacySlugs = [...legacySlugs];
800
+ const [legacyIssuesBySlug, newPathIssuesBySlug] = await Promise.all([
801
+ Promise.all(uniqueLegacySlugs.map((slug) => read(() => ghIssueListByLabelAsync(owner, repo, trancheLabel(slug))))),
802
+ Promise.all(uniqueNewPathSlugs.map((slug) => read(() => ghIssueListByLabelAsync(owner, repo, trancheLabel(slug)))))
803
+ ]);
804
+ const issuesBySlug = new Map;
805
+ uniqueLegacySlugs.forEach((slug, i) => {
806
+ issuesBySlug.set(slug, legacyIssuesBySlug[i] ?? []);
807
+ });
808
+ uniqueNewPathSlugs.forEach((slug, i) => {
809
+ issuesBySlug.set(slug, newPathIssuesBySlug[i] ?? []);
810
+ });
811
+ uniqueLegacySlugs.forEach((slug, i) => {
812
+ const m = legacyMilestoneBySlug.get(slug);
813
+ if (!m)
814
+ return;
815
+ const ref = { slug, goal: m.description ?? "" };
816
+ const f = resolveLegacyFacts(m, legacyIssuesBySlug[i] ?? []);
817
+ if (f.lifecycle === "complete")
818
+ archived.push(ref);
819
+ else if (f.lifecycle === "active")
820
+ active.push(ref);
821
+ facts.set(slug, f);
822
+ });
823
+ uniqueNewPathSlugs.forEach((slug, i) => {
824
+ const issues = newPathIssuesBySlug[i] ?? [];
825
+ const lifecycle = lifecycleFromIssues(issues);
826
+ const goal = goalFromMilestones(milestones, slug);
827
+ const f = { goal, lifecycle };
828
+ facts.set(slug, f);
829
+ if (lifecycle === "active")
830
+ active.push({ slug, goal });
831
+ else if (lifecycle === "complete")
832
+ archived.push({ slug, goal });
833
+ });
834
+ return { active, archived, facts, legacySlugs, issuesBySlug };
835
+ }
836
+ async function retryOnce(fetch) {
837
+ try {
838
+ return await fetch();
839
+ } catch {
840
+ return fetch();
841
+ }
842
+ }
843
+ async function indexTrancheMilestonesForSlugAsync(owner, repo, slug) {
844
+ const [milestones, labels, issues] = await Promise.all([
845
+ ghApiGetAllPagesAsync(`repos/${owner}/${repo}/milestones?state=all&per_page=100`),
846
+ ghApiGetAllPagesAsync(`repos/${owner}/${repo}/labels?per_page=100`),
847
+ ghIssueListByLabelAsync(owner, repo, trancheLabel(slug))
848
+ ]);
849
+ const active = [];
850
+ const archived = [];
851
+ const facts = new Map;
852
+ const legacySlugs = new Set;
853
+ const legacyMilestone = slugShapedTitles(milestones).includes(slug) ? matchesLegacyMilestone(milestones, slug) : null;
854
+ if (legacyMilestone) {
855
+ legacySlugs.add(slug);
856
+ const ref = { slug, goal: legacyMilestone.description ?? "" };
857
+ const f = resolveLegacyFacts(legacyMilestone, issues);
858
+ if (f.lifecycle === "complete")
859
+ archived.push(ref);
860
+ else if (f.lifecycle === "active")
861
+ active.push(ref);
862
+ facts.set(slug, f);
863
+ } else if (trancheSlugsFromLabels(labels).includes(slug)) {
864
+ const lifecycle = lifecycleFromIssues(issues);
865
+ const goal = goalFromMilestones(milestones, slug);
866
+ facts.set(slug, { goal, lifecycle });
867
+ if (lifecycle === "active")
868
+ active.push({ slug, goal });
869
+ else if (lifecycle === "complete")
870
+ archived.push({ slug, goal });
871
+ }
872
+ const openLegacyTitles = new Set(slugShapedTitles(milestones.filter((m) => m.state === "open")));
873
+ const otherOpenLegacySlugs = [...openLegacyTitles].filter((t) => t !== slug);
874
+ return { active, archived, facts, legacySlugs, otherOpenLegacySlugs };
875
+ }
755
876
 
756
877
  // ../../packages/aeg-forge-state/src/derive-from-forge.ts
757
878
  function trancheFromIssues(slug, issues, known) {
@@ -1412,6 +1533,125 @@ var graphql2 = withDefaults3(request, {
1412
1533
  method: "POST",
1413
1534
  url: "/graphql"
1414
1535
  });
1536
+
1537
+ // ../../packages/aeg-forge-state/src/fetch-provenance.ts
1538
+ var PROVENANCE_PATTERN = /^###\s+AEG provenance\b/im;
1539
+ function provenanceMatchesIssue(text, issueNum) {
1540
+ if (!PROVENANCE_PATTERN.test(text))
1541
+ return false;
1542
+ const m = text.match(/^-\s*Issue:\s*#(\d+)/im);
1543
+ return m !== null && Number(m[1]) === issueNum;
1544
+ }
1545
+ function isPrCloser(closer) {
1546
+ return closer !== null && typeof closer.number === "number";
1547
+ }
1548
+ async function fetchProvenanceViaCrossReferences(issueNums, owner, repo, token) {
1549
+ const result = new Map;
1550
+ if (issueNums.length === 0)
1551
+ return result;
1552
+ const client = graphql2.defaults({ headers: { authorization: `bearer ${token}` } });
1553
+ const perIssue = issueNums.map((n) => `
1554
+ i_${n}: issue(number: ${n}) {
1555
+ timelineItems(first: 50, itemTypes: [CROSS_REFERENCED_EVENT]) {
1556
+ nodes {
1557
+ ... on CrossReferencedEvent {
1558
+ source {
1559
+ ... on PullRequest {
1560
+ number
1561
+ body
1562
+ comments(first: 50) { nodes { body } }
1563
+ }
1564
+ }
1565
+ }
1566
+ }
1567
+ }
1568
+ }`).join("");
1569
+ const query = `query ProvenanceCrossRef($owner: String!, $repo: String!) {
1570
+ repository(owner: $owner, name: $repo) {${perIssue}
1571
+ }
1572
+ }`;
1573
+ let response;
1574
+ try {
1575
+ response = await client(query, { owner, repo });
1576
+ } catch {
1577
+ return result;
1578
+ }
1579
+ if (!response.repository)
1580
+ return result;
1581
+ for (const n of issueNums) {
1582
+ const raw = response.repository[`i_${n}`];
1583
+ const nodes = raw?.timelineItems?.nodes ?? [];
1584
+ const found = nodes.some(({ source }) => {
1585
+ if (!source || typeof source.number !== "number")
1586
+ return false;
1587
+ const pr = source;
1588
+ if (provenanceMatchesIssue(pr.body ?? "", n))
1589
+ return true;
1590
+ return pr.comments.nodes.some((c) => provenanceMatchesIssue(c.body, n));
1591
+ });
1592
+ result.set(n, found);
1593
+ }
1594
+ return result;
1595
+ }
1596
+ async function fetchProvenance(issueNums, owner, repo, token) {
1597
+ const result = new Map;
1598
+ if (issueNums.length === 0)
1599
+ return result;
1600
+ const client = graphql2.defaults({ headers: { authorization: `bearer ${token}` } });
1601
+ const perIssue = issueNums.map((n) => `
1602
+ i_${n}: issue(number: ${n}) {
1603
+ timelineItems(last: 1, itemTypes: [CLOSED_EVENT]) {
1604
+ nodes {
1605
+ ... on ClosedEvent {
1606
+ closer {
1607
+ ... on PullRequest {
1608
+ number
1609
+ body
1610
+ comments(first: 50) {
1611
+ nodes { body }
1612
+ }
1613
+ }
1614
+ }
1615
+ }
1616
+ }
1617
+ }
1618
+ }`).join("");
1619
+ const query = `query Provenance($owner: String!, $repo: String!) {
1620
+ repository(owner: $owner, name: $repo) {${perIssue}
1621
+ }
1622
+ }`;
1623
+ let response;
1624
+ try {
1625
+ response = await client(query, { owner, repo });
1626
+ } catch {
1627
+ return result;
1628
+ }
1629
+ if (!response.repository)
1630
+ return result;
1631
+ const needsFallback = [];
1632
+ for (const n of issueNums) {
1633
+ const raw = response.repository[`i_${n}`];
1634
+ if (!raw) {
1635
+ result.set(n, false);
1636
+ continue;
1637
+ }
1638
+ const closer = raw.timelineItems?.nodes?.[0]?.closer;
1639
+ const c = closer ?? null;
1640
+ if (!isPrCloser(c)) {
1641
+ needsFallback.push(n);
1642
+ continue;
1643
+ }
1644
+ const bodyHas = PROVENANCE_PATTERN.test(c.body ?? "");
1645
+ const commentHas = c.comments.nodes.some((x) => PROVENANCE_PATTERN.test(x.body));
1646
+ result.set(n, bodyHas || commentHas);
1647
+ }
1648
+ if (needsFallback.length > 0) {
1649
+ const fallback = await fetchProvenanceViaCrossReferences(needsFallback, owner, repo, token);
1650
+ for (const [n, found] of fallback)
1651
+ result.set(n, found);
1652
+ }
1653
+ return result;
1654
+ }
1415
1655
  // ../../packages/aeg-forge-state/src/github-token.ts
1416
1656
  import { execFile as execFile2 } from "node:child_process";
1417
1657
  import { promisify as promisify2 } from "node:util";
@@ -1641,6 +1881,52 @@ function describeError(err) {
1641
1881
  return err;
1642
1882
  return "unknown error";
1643
1883
  }
1884
+ // ../../packages/aeg-forge-state/src/prior-tranche-archival.ts
1885
+ function defaultPriorTrancheArchivalDeps() {
1886
+ return {
1887
+ activeTranches: async (excludeSlug, repo) => {
1888
+ const index = await indexTrancheMilestonesAsync(repo.owner, repo.repo, { retryFailedReads: true });
1889
+ return index.active.filter((m) => m.slug !== excludeSlug).map((m) => {
1890
+ const issues = index.issuesBySlug?.get(m.slug);
1891
+ if (!issues)
1892
+ throw new Error(`the Milestone index holds no Issue list for tranche \`${m.slug}\``);
1893
+ return { slug: m.slug, issues };
1894
+ });
1895
+ }
1896
+ };
1897
+ }
1898
+ function reason(err) {
1899
+ return err instanceof Error ? err.message.split(`
1900
+ `)[0] ?? "failed" : String(err);
1901
+ }
1902
+ async function resolvePriorTrancheArchival(projects, excludeSlug, repo, deps = defaultPriorTrancheArchivalDeps()) {
1903
+ if (projects.length === 0)
1904
+ return { facts: [], infraFailure: null };
1905
+ let candidates;
1906
+ try {
1907
+ candidates = await deps.activeTranches(excludeSlug, repo);
1908
+ } catch (err) {
1909
+ return {
1910
+ facts: [],
1911
+ infraFailure: `severity:infra — could not read the active tranches (${reason(err)}); whether a prior tranche is archived is unknown.`
1912
+ };
1913
+ }
1914
+ const tasksBySlug = new Map(candidates.map((c) => [c.slug, tasksFromIssues(c.issues)]));
1915
+ const facts = [];
1916
+ for (const project of projects) {
1917
+ let found = null;
1918
+ for (const { slug, issues } of candidates) {
1919
+ if (!(tasksBySlug.get(slug) ?? []).some((t) => t.projects.includes(project)))
1920
+ continue;
1921
+ if (!issues.some((issue) => issue.state === "OPEN")) {
1922
+ found = { project, priorTrancheSlug: slug, archived: false };
1923
+ break;
1924
+ }
1925
+ }
1926
+ facts.push(found ?? { project, priorTrancheSlug: null, archived: false });
1927
+ }
1928
+ return { facts, infraFailure: null };
1929
+ }
1644
1930
  // ../../packages/aeg-forge-state/src/fetch-open-issues.ts
1645
1931
  async function fetchOpenIssuesByLabel(slugs, owner, repo, token) {
1646
1932
  const result = new Map;
@@ -1715,6 +2001,10 @@ function buildQuery(issueNumbers) {
1715
2001
  }
1716
2002
  }`;
1717
2003
  }
2004
+ // ../../packages/aeg-forge-state/src/list-issue-milestones.ts
2005
+ function issueMilestonesFromIssues(issues) {
2006
+ return issues.filter((i) => i.state === "OPEN").map((i) => ({ issue: i.number, milestoneTitle: i.milestone?.title ?? null }));
2007
+ }
1718
2008
  // ../../packages/aeg-forge-state/src/resolve-repo.ts
1719
2009
  import { execFile as execFile3 } from "node:child_process";
1720
2010
  import { promisify as promisify3 } from "node:util";
@@ -1777,7 +2067,8 @@ var ANCHOR_FIELDS = [
1777
2067
  "PREMISE",
1778
2068
  "TEST-PLAN",
1779
2069
  "EVIDENCE",
1780
- "BEYOND-SURFACE"
2070
+ "BEYOND-SURFACE",
2071
+ "LIVE"
1781
2072
  ];
1782
2073
  function anchoredRegionBounds(body, field) {
1783
2074
  const masked = maskCode(body);
@@ -1978,7 +2269,6 @@ var DERIVABLE_STATUSES = DERIVED_STATUSES.filter((s) => s !== "backlog");
1978
2269
  // ../../packages/aeg-core/src/waiver-label.ts
1979
2270
  var WAIVER_LABEL = label("waiver-docs");
1980
2271
  var WAIVER_LABEL_REVIEW = label("waiver-review");
1981
- var PRINCIPAL_ALLOWLIST = ["daniboomerang"];
1982
2272
  function isPrincipal(login, principalAllowlist) {
1983
2273
  if (login === null)
1984
2274
  return false;
@@ -1997,6 +2287,14 @@ var RULING_ORDINAL_PATTERN = /^[ \t]*(?:\*{1,3}|_{1,3})?Ruling ordinal:\s*(\d+)(
1997
2287
  var BRIEF_HASH_PATTERN = /^[ \t]*(?:\*{1,3}|_{1,3})?Brief hash:\s*([0-9a-f]{64})(?![A-Za-z0-9])/im;
1998
2288
  var POLICY_DIGEST_PATTERN = /^[ \t]*(?:\*{1,3}|_{1,3})?Policy digest:\s*([0-9a-f]{64})(?![A-Za-z0-9])/im;
1999
2289
  var BASE_SHA_PATTERN = /^[ \t]*(?:\*{1,3}|_{1,3})?Judged base:\s*([0-9a-f]{7,40})(?![A-Za-z0-9])/im;
2290
+ var MANIFEST_VERSION_PATTERN = /^[ \t]*(?:\*{1,3}|_{1,3})?Manifest version:\s*(\d+)\s*$/im;
2291
+ var PAUSE_BOUND_RULING_PATTERN = /^[ \t]*(?:\*{1,3}|_{1,3})?Pause-bound ruling:\s*(?:(\S+)\|(\S+)\|([0-9a-f]{64})|\(none\))\s*$/im;
2292
+ function extractPauseBoundRuling(comment) {
2293
+ const m = comment.match(PAUSE_BOUND_RULING_PATTERN);
2294
+ if (!m)
2295
+ return;
2296
+ return m[1] ? { rulingId: m[1], pauseId: m[2], contentDigest: m[3] } : null;
2297
+ }
2000
2298
  function firstFiveLines(comment) {
2001
2299
  return comment.split(`
2002
2300
  `).slice(0, 5).join(`
@@ -2090,6 +2388,8 @@ function extractVerdict(comments, valuePattern, missingLabel) {
2090
2388
  danglingNote: `the most recent ${missingLabel} verdict comment carries a VERDICT-shaped line outside the first-five-line read window`
2091
2389
  };
2092
2390
  }
2391
+ const versionMatch = latest.match(MANIFEST_VERSION_PATTERN);
2392
+ const pauseBoundRuling = extractPauseBoundRuling(latest);
2093
2393
  return {
2094
2394
  value: m[1].toUpperCase().replace(/[_-]/g, " "),
2095
2395
  headSha: extractHeadSha(latest),
@@ -2098,6 +2398,8 @@ function extractVerdict(comments, valuePattern, missingLabel) {
2098
2398
  briefHash: extractBriefHash(latest),
2099
2399
  policyDigest: extractPolicyDigest(latest),
2100
2400
  baseSha: extractBaseSha(latest),
2401
+ ...versionMatch ? { manifestVersion: Number.parseInt(versionMatch[1], 10) } : {},
2402
+ ...pauseBoundRuling === undefined ? {} : { pauseBoundRuling },
2101
2403
  findingSeverities: extractFindingSeverities(latest),
2102
2404
  danglingNote: null
2103
2405
  };
@@ -2108,6 +2410,16 @@ function extractCodeReviewVerdict(comments) {
2108
2410
  function extractSecurityReviewVerdict(comments) {
2109
2411
  return extractVerdict(comments, /^[ \t]*(?:\*{1,3}|_{1,3})?VERDICT:\s*(PASS|FAIL)(?![A-Za-z0-9])/im, "security-review");
2110
2412
  }
2413
+
2414
+ // ../../packages/aeg-core/src/review-status.ts
2415
+ var DEVELOPER_ROUND_MARKER = /<!--\s*aeg:developer:round-(\d+)\s*-->/i;
2416
+ function parseDeveloperRoundMarker(body) {
2417
+ const m = body.match(DEVELOPER_ROUND_MARKER);
2418
+ if (!m)
2419
+ return null;
2420
+ const n = Number(m[1]);
2421
+ return Number.isFinite(n) ? n : null;
2422
+ }
2111
2423
  // ../../packages/aeg-core/src/report-tokens.ts
2112
2424
  var DASH_LOOKALIKES = {
2113
2425
  "-": "‑",
@@ -2439,11 +2751,13 @@ var CODE_REVIEW_SEVERITY_ORDER = ["BLOCKER", "MAJOR", "MINOR"];
2439
2751
  var SECURITY_SEVERITY_ORDER = ["CRITICAL", "HIGH", "MEDIUM", "LOW"];
2440
2752
  var DEFAULT_MAX_ROUNDS = 3;
2441
2753
  var DEFAULT_MAX_TASK_MINUTES = 180;
2754
+ var DEFAULT_READY_PUSH_TIMEOUT_MINUTES = 20;
2442
2755
  var DEFAULT_REVIEW_POLICY = {
2443
2756
  codeReviewThreshold: "BLOCKER",
2444
2757
  securityThreshold: "HIGH",
2445
2758
  maxRounds: DEFAULT_MAX_ROUNDS,
2446
- maxTaskMinutes: DEFAULT_MAX_TASK_MINUTES
2759
+ maxTaskMinutes: DEFAULT_MAX_TASK_MINUTES,
2760
+ readyPushTimeoutMinutes: DEFAULT_READY_PUSH_TIMEOUT_MINUTES
2447
2761
  };
2448
2762
  var FILE_SHAPED_LOCATION = /\.[a-zA-Z0-9]{1,10}(:\d+)?\s*$/;
2449
2763
  var PROSE_LOCATION_PATTERNS = [/\bpr\s*body\b/i, /\bcomment\b/i];
@@ -2803,14 +3117,14 @@ function checkTestPlan(prBody) {
2803
3117
  const region = located.found ? located.section : prBody;
2804
3118
  if (TEST_PLAN_UNIT_TESTS_ONLY_RE.test(region))
2805
3119
  return { status: "pass", errors: [] };
2806
- if (/\*\*\[(?:agent|principal)\]\*\*/.test(region))
3120
+ if (/\*\*\[(?:agent|principal|live)\]\*\*/.test(region))
2807
3121
  return { status: "pass", errors: [] };
2808
3122
  if (located.found && extractFencedBlocks(region).length > 0)
2809
3123
  return { status: "pass", errors: [] };
2810
3124
  return {
2811
3125
  status: "fail",
2812
3126
  errors: [
2813
- "brief-validation Test Plan: no Test Plan section found — expected `Test Plan: unit-tests-only`, a fenced `[agent]` command list, or at least one `**[agent]**`/`**[principal]**`-tagged checklist item."
3127
+ "brief-validation Test Plan: no Test Plan section found — expected `Test Plan: unit-tests-only`, a fenced `[agent]` command list, or at least one `**[agent]**`/`**[principal]**`/`**[live]**`-tagged item."
2814
3128
  ]
2815
3129
  };
2816
3130
  }
@@ -3432,6 +3746,375 @@ function checkPrReportDensity(prBody) {
3432
3746
  const results = [checkDecisionsDensity(prBody), checkScopeDensity(prBody)];
3433
3747
  return { errors: results.flatMap((r) => r.errors) };
3434
3748
  }
3749
+ // ../../packages/aeg-core/src/prose-rules.ts
3750
+ var RETIRED_GLOBAL_EXEMPTIONS = [
3751
+ "docs/decisions-legacy.md",
3752
+ "apps/herald-ai/docs/",
3753
+ "apps/vada-ai/docs/",
3754
+ "aeg-root/tranches/completed/",
3755
+ "packages/aeg-core/src/docs/published-prose",
3756
+ "packages/aeg-core/src/retired-vocabulary.test.ts",
3757
+ "packages/aeg-core/src/retired-vocabulary.ts",
3758
+ "/fixtures/",
3759
+ "/node_modules/",
3760
+ "/.next/",
3761
+ "/.turbo/"
3762
+ ];
3763
+ var PLAN_ON_DISK_PATTERNS = ["[Tt]opology files?", "aeg-root/tranches/", "aeg-project/"];
3764
+ var TRANCHE_MODEL_FILE = "/tranche-model.md";
3765
+ var RETIRED_PATTERN_EXEMPTIONS = {
3766
+ [String.raw`\bD-[0-9]{3}\b`]: ["./CLAUDE.md"],
3767
+ [String.raw`(^|[^-_a-zA-Z0-9])decisions\.md`]: [
3768
+ "docs-index.md",
3769
+ "apps/vada-ai/specs/legacy/README.md",
3770
+ "apps/vada-ai/specs/vada-product-spec.md",
3771
+ "apps/vada-ai/web/CLAUDE.md",
3772
+ "apps/vada-ai/CLAUDE.md"
3773
+ ],
3774
+ "decisions-legacy": [
3775
+ "packages/aeg-core/src/file-classify.ts",
3776
+ "packages/aeg-core/src/file-classify.test.ts",
3777
+ "packages/aeg-core/src/pr-tier.test.ts",
3778
+ "docs-index.md",
3779
+ ".claude/skills/database/SKILL.md",
3780
+ ".claude/skills/vada-architecture/SKILL.md",
3781
+ "apps/vada-ai/specs/vada-byok-principles.md",
3782
+ "apps/vada-ai/web/CLAUDE.md",
3783
+ "apps/vada-ai/CLAUDE.md"
3784
+ ],
3785
+ CONTRADICTION: ["apps/vada-ai/specs/vada-reviewers-spec.md"],
3786
+ ...Object.fromEntries(PLAN_ON_DISK_PATTERNS.map((pattern) => [pattern, [TRANCHE_MODEL_FILE]]))
3787
+ };
3788
+ var retiredPatterns = [
3789
+ String.raw`\bD-[0-9]{3}\b`,
3790
+ "D-(###|NNN|nnn|xxx)",
3791
+ "decision (entry|logged)",
3792
+ "decision-log entry",
3793
+ "decision log entry",
3794
+ "decision log(s|ged|ging)?([^a-z]|$)",
3795
+ "decision-log",
3796
+ "decision entr",
3797
+ "decisions? (are |is )?logged",
3798
+ "log entries",
3799
+ String.raw`(^|[^-_a-zA-Z0-9])decisions\.md`,
3800
+ "decisions-legacy",
3801
+ "CONTRADICTION",
3802
+ "assumes Tier 3",
3803
+ "Lock: ?YES",
3804
+ "Lock: ?NO",
3805
+ "lock approvals?",
3806
+ "approves locks",
3807
+ "Conforms to lock",
3808
+ "Challenges lock",
3809
+ "checkDecisionNumbersFresh",
3810
+ String.raw`roles/team-leader\.md`,
3811
+ String.raw`\(,`,
3812
+ String.raw`,\)`,
3813
+ String.raw`\(\.\)`,
3814
+ ...PLAN_ON_DISK_PATTERNS
3815
+ ];
3816
+ var published = [
3817
+ ["decision-id", "a decision id", /\bD-\d{3,}\b/],
3818
+ ["section-ref", "a section reference", /§/],
3819
+ ["forge-number", "a forge number", /#\d+/],
3820
+ ["retired-name", "the retired public name", /\bAEG\b/],
3821
+ ["tranche-slug", "a tranche slug", /\b[a-z][a-z0-9]*(?:-[a-z0-9]+)+-v\d+\b/],
3822
+ [
3823
+ "label-vocabulary",
3824
+ "forge label vocabulary",
3825
+ /(?:vinaya\/)?\b(?:tranche|iteration|tier|needs|waiver|project|aeg):(?![/\s]|$)/
3826
+ ],
3827
+ ["internal-path", "a repo-internal path", /\b(?:packages|apps|aeg-root|tools|scripts)\//],
3828
+ ["internal-path", "a repo-internal path", /\.(?:claude|husky|github)\//],
3829
+ [
3830
+ "internal-path",
3831
+ "a repo-internal file",
3832
+ /(?:^|[\s(`"'[])[\w.-]+(?:\/[\w.-]+)*\.(?:ts|tsx|js|jsx|mjs|cjs|sh|ya?ml|json|md)\b/
3833
+ ]
3834
+ ];
3835
+ var DEFAULT_PROSE_RULES = [
3836
+ {
3837
+ id: "forge-number",
3838
+ group: "reader-resolvable",
3839
+ scopes: ["ships", "reader-facing", "spec"],
3840
+ patterns: { prose: /#[0-9]{2,4}/g },
3841
+ flags: ["global"],
3842
+ message: "a forge number",
3843
+ severity: { ships: "warning", "reader-facing": "warning", spec: "error" },
3844
+ exemptions: []
3845
+ },
3846
+ {
3847
+ id: "tranche-slug",
3848
+ group: "reader-resolvable",
3849
+ scopes: ["ships", "reader-facing", "product", "spec"],
3850
+ patterns: { prose: /[a-z][a-z-]+-v[0-9]/g },
3851
+ flags: ["global"],
3852
+ message: "an internal tranche slug",
3853
+ severity: { ships: "warning", "reader-facing": "warning", product: "error", spec: "error" },
3854
+ exemptions: []
3855
+ },
3856
+ {
3857
+ id: "task-number",
3858
+ group: "reader-resolvable",
3859
+ scopes: ["spec"],
3860
+ patterns: { prose: /(^|[^a-z0-9-])(tasks?[ \t]+#?[0-9]+)/gi },
3861
+ flags: ["global", "ignore-case"],
3862
+ message: "a task number",
3863
+ severity: { spec: "error" },
3864
+ exemptions: []
3865
+ },
3866
+ {
3867
+ id: "source-comment-tranche-slug",
3868
+ group: "reader-resolvable",
3869
+ scopes: ["source-comment"],
3870
+ patterns: { comment: /[a-z0-9]+(?:-[a-z0-9]+)*-v[0-9]+/g },
3871
+ flags: ["global"],
3872
+ message: "a tranche-slug citation",
3873
+ severity: { "source-comment": "warning" },
3874
+ exemptions: []
3875
+ },
3876
+ {
3877
+ id: "source-comment-forge-number",
3878
+ group: "reader-resolvable",
3879
+ scopes: ["source-comment"],
3880
+ patterns: { comment: /#[0-9]{2,}/g },
3881
+ flags: ["global"],
3882
+ message: "a forge-number citation",
3883
+ severity: { "source-comment": "warning" },
3884
+ exemptions: []
3885
+ },
3886
+ {
3887
+ id: "legacy-batch-name",
3888
+ group: "reader-resolvable",
3889
+ scopes: ["ships", "reader-facing", "spec"],
3890
+ patterns: {},
3891
+ flags: ["built-in"],
3892
+ message: "an internal tranche slug",
3893
+ severity: { ships: "warning", "reader-facing": "warning", spec: "error" },
3894
+ exemptions: [],
3895
+ builtIn: true
3896
+ },
3897
+ {
3898
+ id: "coined-term",
3899
+ group: "reader-resolvable",
3900
+ scopes: ["ships", "reader-facing"],
3901
+ patterns: {},
3902
+ flags: ["built-in"],
3903
+ message: "uses coined term without defining it inline or linking the glossary",
3904
+ severity: { ships: "warning", "reader-facing": "warning" },
3905
+ exemptions: [],
3906
+ builtIn: true
3907
+ },
3908
+ ...retiredPatterns.map((pattern, index) => ({
3909
+ id: `retired-vocabulary-${index + 1}`,
3910
+ group: "retired-vocabulary",
3911
+ scopes: ["repository"],
3912
+ patterns: { repository: pattern },
3913
+ flags: [],
3914
+ message: "retired vocabulary",
3915
+ severity: { repository: "error" },
3916
+ exemptions: RETIRED_GLOBAL_EXEMPTIONS,
3917
+ patternExemptions: RETIRED_PATTERN_EXEMPTIONS
3918
+ })),
3919
+ ...published.map(([id, message, pattern]) => ({
3920
+ id,
3921
+ group: "published-prose",
3922
+ scopes: ["published"],
3923
+ patterns: { published: pattern },
3924
+ flags: [],
3925
+ message,
3926
+ severity: { published: "error" },
3927
+ exemptions: [".worktrees/task/<tranche>/<n>", "task/<tranche>/<n>", ".worktrees/"]
3928
+ }))
3929
+ ];
3930
+ var rulesForGroup = (group) => DEFAULT_PROSE_RULES.filter((rule) => rule.group === group);
3931
+ var RESOLVABLE_SCOPES = ["ships", "reader-facing", "product", "spec", "source-comment"];
3932
+ var RETIRED_SCOPES = ["repository"];
3933
+ var CONFIGURABLE_PROSE_SCOPES = [...RESOLVABLE_SCOPES, ...RETIRED_SCOPES];
3934
+ function groupOfScope(scope) {
3935
+ if (RESOLVABLE_SCOPES.includes(scope))
3936
+ return "reader-resolvable";
3937
+ if (RETIRED_SCOPES.includes(scope))
3938
+ return "retired-vocabulary";
3939
+ return;
3940
+ }
3941
+ var CONFIGURED_PROSE_FLAGS = ["i", "u"];
3942
+ var CONFIGURED_PATTERN_MAX_LENGTH = 200;
3943
+ var CONFIGURABLE_DEFAULT_RULES = DEFAULT_PROSE_RULES.filter((rule) => rule.group !== "published-prose");
3944
+ function allowedScopesFor(rule) {
3945
+ if (rule.builtIn)
3946
+ return rule.scopes;
3947
+ return rule.group === "retired-vocabulary" ? RETIRED_SCOPES : RESOLVABLE_SCOPES;
3948
+ }
3949
+ function normalizeRepoPath(entry) {
3950
+ let out = entry.replace(/\\/g, "/");
3951
+ while (out.startsWith("./"))
3952
+ out = out.slice(2);
3953
+ out = out.replace(/\/{2,}/g, "/");
3954
+ while (out.endsWith("/"))
3955
+ out = out.slice(0, -1);
3956
+ return out;
3957
+ }
3958
+ function isConfiguredExempt(path, exempt, repoRoot) {
3959
+ if (exempt.length === 0)
3960
+ return false;
3961
+ const root = repoRoot === undefined ? undefined : normalizeRepoPath(repoRoot);
3962
+ let rel = normalizeRepoPath(path);
3963
+ if (root && rel.startsWith(`${root}/`))
3964
+ rel = rel.slice(root.length + 1);
3965
+ return exempt.some((entry) => {
3966
+ const e = normalizeRepoPath(entry);
3967
+ return rel === e || rel.startsWith(`${e}/`);
3968
+ });
3969
+ }
3970
+ function ruleReads(set, rule, path) {
3971
+ return !isConfiguredExempt(path, set.exempt, set.repoRoot) && !isConfiguredExempt(path, rule.exempt, set.repoRoot);
3972
+ }
3973
+ var RESOLVABLE_RUN_ORDER = [
3974
+ "forge-number",
3975
+ "tranche-slug",
3976
+ "legacy-batch-name",
3977
+ "task-number",
3978
+ "source-comment-tranche-slug",
3979
+ "source-comment-forge-number",
3980
+ "coined-term"
3981
+ ];
3982
+ var REPORT_GROUPS = { "task-number": 2, "legacy-batch-name": 2 };
3983
+ function scopeDefaultSeverity(scope, sourceCommentSeverity) {
3984
+ if (scope === "source-comment")
3985
+ return sourceCommentSeverity ?? "warning";
3986
+ if (scope === "repository")
3987
+ return "error";
3988
+ return "warning";
3989
+ }
3990
+ function applySeverity(scopes, base, setting) {
3991
+ const out = {};
3992
+ for (const scope of scopes) {
3993
+ const configured = typeof setting === "string" ? setting : setting?.[scope];
3994
+ const value = configured ?? base[scope];
3995
+ if (value !== undefined)
3996
+ out[scope] = value;
3997
+ }
3998
+ return out;
3999
+ }
4000
+ function defaultPatternFor(rule) {
4001
+ const cache = new Map;
4002
+ return (scope) => {
4003
+ if (cache.has(scope))
4004
+ return cache.get(scope) ?? null;
4005
+ const own = rule.patterns[scope] ?? (scope === "source-comment" ? rule.patterns.comment : rule.patterns.prose) ?? Object.values(rule.patterns)[0];
4006
+ const compiled = own === undefined ? null : own instanceof RegExp ? own : new RegExp(own);
4007
+ cache.set(scope, compiled);
4008
+ return compiled;
4009
+ };
4010
+ }
4011
+ function customPatternFor(rule, global) {
4012
+ const cache = new Map;
4013
+ return (scope) => {
4014
+ if (cache.has(scope))
4015
+ return cache.get(scope) ?? null;
4016
+ const source = rule.patterns?.[scope] ?? rule.pattern;
4017
+ const compiled = source === undefined ? null : new RegExp(source, `${rule.flags ?? ""}${global ? "g" : ""}`);
4018
+ cache.set(scope, compiled);
4019
+ return compiled;
4020
+ };
4021
+ }
4022
+ function resolveProseRules(config = undefined, options = {}) {
4023
+ const rules = [];
4024
+ const defaults = config?.defaults ?? {};
4025
+ for (const rule of CONFIGURABLE_DEFAULT_RULES) {
4026
+ const override = defaults[rule.id];
4027
+ if (override === "off")
4028
+ continue;
4029
+ const group = rule.group;
4030
+ const scopes = override?.scopes ?? rule.scopes;
4031
+ const base = {};
4032
+ for (const scope of scopes) {
4033
+ base[scope] = scope === "source-comment" ? options.sourceCommentSeverity ?? rule.severity[scope] ?? "warning" : rule.severity[scope] ?? scopeDefaultSeverity(scope, options.sourceCommentSeverity);
4034
+ }
4035
+ rules.push({
4036
+ id: rule.id,
4037
+ group,
4038
+ custom: false,
4039
+ builtIn: rule.builtIn === true,
4040
+ scopes,
4041
+ message: rule.message,
4042
+ severity: applySeverity(scopes, base, override?.severity),
4043
+ exempt: override?.exempt ?? [],
4044
+ substringExempt: rule.exemptions,
4045
+ reportGroup: REPORT_GROUPS[rule.id],
4046
+ patternFor: defaultPatternFor(rule)
4047
+ });
4048
+ }
4049
+ for (const rule of config?.custom ?? []) {
4050
+ const group = groupOfScope(rule.scopes[0] ?? "") ?? "reader-resolvable";
4051
+ const base = {};
4052
+ for (const scope of rule.scopes)
4053
+ base[scope] = scopeDefaultSeverity(scope, options.sourceCommentSeverity);
4054
+ rules.push({
4055
+ id: rule.id,
4056
+ group,
4057
+ custom: true,
4058
+ builtIn: false,
4059
+ scopes: rule.scopes,
4060
+ message: rule.means,
4061
+ severity: applySeverity(rule.scopes, base, rule.severity),
4062
+ exempt: rule.exempt ?? [],
4063
+ substringExempt: [],
4064
+ patternFor: customPatternFor(rule, group === "reader-resolvable")
4065
+ });
4066
+ }
4067
+ if (options.decisionRecordsPath !== undefined)
4068
+ rules.push(decisionRecordCitationRule(options.decisionRecordsPath));
4069
+ const order = (rule) => {
4070
+ const at = RESOLVABLE_RUN_ORDER.indexOf(rule.id);
4071
+ return rule.custom || at === -1 ? RESOLVABLE_RUN_ORDER.length : at;
4072
+ };
4073
+ const resolvable = rules.filter((rule) => rule.group === "reader-resolvable");
4074
+ const sorted = resolvable.map((rule, index) => ({ rule, index })).sort((a, b) => order(a.rule) - order(b.rule) || a.index - b.index).map(({ rule }) => rule);
4075
+ return {
4076
+ rules: [...sorted, ...rules.filter((rule) => rule.group === "retired-vocabulary")],
4077
+ exempt: config?.exempt ?? [],
4078
+ repoRoot: options.repoRoot
4079
+ };
4080
+ }
4081
+ function rulesOfGroup(set, group) {
4082
+ return set.rules.filter((rule) => rule.group === group);
4083
+ }
4084
+ function rulesInScope(set, scope) {
4085
+ return set.rules.filter((rule) => rule.scopes.includes(scope));
4086
+ }
4087
+ var DEFAULT_PROSE_RULE_SET = resolveProseRules();
4088
+ var DECISION_RECORD_CITATION_ID = "decision-record-citation";
4089
+ var DECISION_RECORD_CITATION_SCOPES = ["ships", "product", "spec", "source-comment"];
4090
+ var DECISION_RECORD_CITATION_MESSAGE = "a decision-record number";
4091
+ function escapeRegExp(text) {
4092
+ return text.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
4093
+ }
4094
+ function decisionRecordCitationPattern(decisionRecordsPath) {
4095
+ const folder = escapeRegExp(normalizeRepoPath(decisionRecordsPath));
4096
+ return new RegExp(String.raw`\bADR[- ]?[0-9]+\b|(?<![A-Za-z0-9_-])${folder}/[0-9]+[A-Za-z0-9._-]*`, "g");
4097
+ }
4098
+ function decisionRecordCitationRule(decisionRecordsPath) {
4099
+ const folder = normalizeRepoPath(decisionRecordsPath);
4100
+ const pattern = decisionRecordCitationPattern(folder);
4101
+ const severity = {};
4102
+ for (const scope of DECISION_RECORD_CITATION_SCOPES)
4103
+ severity[scope] = "error";
4104
+ return {
4105
+ id: DECISION_RECORD_CITATION_ID,
4106
+ group: "reader-resolvable",
4107
+ custom: false,
4108
+ builtIn: false,
4109
+ scopes: DECISION_RECORD_CITATION_SCOPES,
4110
+ message: DECISION_RECORD_CITATION_MESSAGE,
4111
+ severity,
4112
+ exempt: [folder],
4113
+ substringExempt: [],
4114
+ patternFor: () => pattern
4115
+ };
4116
+ }
4117
+
3435
4118
  // ../../packages/aeg-core/src/reader-resolvable-prose.ts
3436
4119
  var PRODUCT_SLUG_SCOPE = [
3437
4120
  "apps/cli/src",
@@ -3443,8 +4126,8 @@ var PRODUCT_SLUG_SCOPE = [
3443
4126
  function isUnderOrEqual(path, prefix) {
3444
4127
  return path === prefix || path.startsWith(`${prefix}/`);
3445
4128
  }
3446
- function isProductScopeFile(path) {
3447
- return PRODUCT_SLUG_SCOPE.some((prefix) => isUnderOrEqual(path, prefix));
4129
+ function isProductScopeFile(path, productPaths) {
4130
+ return productPaths.some((prefix) => isUnderOrEqual(path, normalizeRepoPath(prefix)));
3448
4131
  }
3449
4132
  var SHIPS_PREFIX = "aeg-root/";
3450
4133
  function shipsArchivePrefix(shipsPrefix) {
@@ -3452,13 +4135,7 @@ function shipsArchivePrefix(shipsPrefix) {
3452
4135
  }
3453
4136
  var DEFAULT_SPEC_PATHS = ["SPEC.md", "CONTEXT.md", "docs/adr"];
3454
4137
  function normalizeSpecPath(entry) {
3455
- let out = entry.replace(/\\/g, "/");
3456
- while (out.startsWith("./"))
3457
- out = out.slice(2);
3458
- out = out.replace(/\/{2,}/g, "/");
3459
- while (out.endsWith("/"))
3460
- out = out.slice(0, -1);
3461
- return out;
4138
+ return normalizeRepoPath(entry);
3462
4139
  }
3463
4140
  function isSpecFile2(path, specPaths) {
3464
4141
  if (path.startsWith("apps/") && path.includes("/specs/") && path.endsWith(".md"))
@@ -3470,7 +4147,7 @@ function isSpecFile2(path, specPaths) {
3470
4147
  function isClaudeMdFile(path) {
3471
4148
  return path === "CLAUDE.md" || path.endsWith("/CLAUDE.md");
3472
4149
  }
3473
- function classifyProseFile(path, readerFacingPrefix, readerFacingSuffix, shipsPrefix = SHIPS_PREFIX, specPaths = DEFAULT_SPEC_PATHS) {
4150
+ function classifyProseFile(path, readerFacingPrefix, readerFacingSuffix, shipsPrefix = SHIPS_PREFIX, specPaths = DEFAULT_SPEC_PATHS, productPaths = PRODUCT_SLUG_SCOPE) {
3474
4151
  if (path.startsWith(shipsPrefix)) {
3475
4152
  return path.startsWith(shipsArchivePrefix(shipsPrefix)) ? "internal" : "ships";
3476
4153
  }
@@ -3481,7 +4158,7 @@ function classifyProseFile(path, readerFacingPrefix, readerFacingSuffix, shipsPr
3481
4158
  return "internal";
3482
4159
  if (isSpecFile2(path, specPaths))
3483
4160
  return "spec";
3484
- if (isProductScopeFile(path))
4161
+ if (isProductScopeFile(path, productPaths))
3485
4162
  return "product";
3486
4163
  return null;
3487
4164
  }
@@ -3506,9 +4183,16 @@ function lineAt(content, index) {
3506
4183
  }
3507
4184
  return line;
3508
4185
  }
3509
- var FORGE_NUMBER_PATTERN = /#[0-9]{2,4}/g;
3510
- var TRANCHE_SLUG_VN_PATTERN = /[a-z][a-z-]+-v[0-9]/g;
3511
- var TASK_NUMBER_PATTERN = /(^|[^a-z0-9-])(tasks?[ \t]+#?[0-9]+)/gi;
4186
+ var readerRules = rulesForGroup("reader-resolvable");
4187
+ var readerPattern = (id, scope = "prose") => {
4188
+ const pattern = readerRules.find((rule) => rule.id === id)?.patterns[scope];
4189
+ if (!(pattern instanceof RegExp))
4190
+ throw new Error(`default prose rule ${id} has no ${scope} pattern`);
4191
+ return pattern;
4192
+ };
4193
+ var FORGE_NUMBER_PATTERN = readerPattern("forge-number");
4194
+ var TRANCHE_SLUG_VN_PATTERN = readerPattern("tranche-slug");
4195
+ var TASK_NUMBER_PATTERN = readerPattern("task-number");
3512
4196
  function legacySlugPattern(legacySlugs) {
3513
4197
  if (legacySlugs.length === 0)
3514
4198
  return null;
@@ -3518,48 +4202,61 @@ function legacySlugPattern(legacySlugs) {
3518
4202
  function specGrandfatherPaths(specGrandfather) {
3519
4203
  return Array.isArray(specGrandfather) ? [...specGrandfather] : Object.keys(specGrandfather);
3520
4204
  }
3521
- function checkUnresolvableReferences(files, readerFacingPrefix, readerFacingSuffix, legacySlugs = [], shipsPrefix = SHIPS_PREFIX, specGrandfather = [], specPaths = DEFAULT_SPEC_PATHS) {
4205
+ var REFERENCE_CLASSES = new Set(["ships", "reader-facing", "product", "spec"]);
4206
+ function referenceRulesFor(set, cls) {
4207
+ return rulesInScope(set, cls).filter((rule) => rule.group === "reader-resolvable" && rule.id !== "coined-term");
4208
+ }
4209
+ function citations(pattern, text, group) {
4210
+ const out = [];
4211
+ const re = pattern.global ? pattern : new RegExp(pattern.source, `${pattern.flags}g`);
4212
+ re.lastIndex = 0;
4213
+ let match = re.exec(text);
4214
+ while (match !== null) {
4215
+ if (match[0] === "") {
4216
+ re.lastIndex++;
4217
+ } else {
4218
+ const cited = group !== undefined ? match[group] ?? match[0] : match[0];
4219
+ out.push({ cited, index: match.index + match[0].indexOf(cited) });
4220
+ }
4221
+ match = re.exec(text);
4222
+ }
4223
+ re.lastIndex = 0;
4224
+ return out;
4225
+ }
4226
+ function customMessage(rule, cited) {
4227
+ return `${rule.id}: ${rule.message} ("${cited}")`;
4228
+ }
4229
+ function checkUnresolvableReferences(files, readerFacingPrefix, readerFacingSuffix, legacySlugs = [], shipsPrefix = SHIPS_PREFIX, specGrandfather = [], specPaths = DEFAULT_SPEC_PATHS, options = {}) {
4230
+ const set = options.rules ?? DEFAULT_PROSE_RULE_SET;
4231
+ const productPaths = options.productPaths ?? PRODUCT_SLUG_SCOPE;
3522
4232
  const findings = [];
3523
4233
  const legacyPattern = legacySlugPattern(legacySlugs);
3524
4234
  const grandfatheredWhole = new Set(Array.isArray(specGrandfather) ? specGrandfather : []);
3525
4235
  const limits = new Map(Array.isArray(specGrandfather) ? [] : Object.entries(specGrandfather));
3526
- const patterns = [
3527
- { pattern: FORGE_NUMBER_PATTERN, what: "a forge number" },
3528
- { pattern: TRANCHE_SLUG_VN_PATTERN, what: "an internal tranche slug" },
3529
- ...legacyPattern ? [{ pattern: legacyPattern, what: "an internal tranche slug", group: 2 }] : []
3530
- ];
3531
- const productPatterns = [
3532
- { pattern: TRANCHE_SLUG_VN_PATTERN, what: "an internal tranche slug in product code" }
3533
- ];
3534
- const specPatterns = [
3535
- ...patterns,
3536
- { pattern: TASK_NUMBER_PATTERN, what: "a task number", group: 2 }
3537
- ];
3538
4236
  for (const file of files) {
3539
- const cls = classifyProseFile(file.path, readerFacingPrefix, readerFacingSuffix, shipsPrefix, specPaths);
3540
- if (!cls || cls === "internal")
3541
- continue;
3542
- if (cls !== "product" && cls !== "spec" && !SWEPT_CLASSES.has(cls))
4237
+ const cls = classifyProseFile(file.path, readerFacingPrefix, readerFacingSuffix, shipsPrefix, specPaths, productPaths);
4238
+ if (!cls || !REFERENCE_CLASSES.has(cls))
3543
4239
  continue;
3544
4240
  if (cls === "spec" && grandfatheredWhole.has(file.path))
3545
4241
  continue;
3546
- const blocking = cls === "product" || cls === "spec";
3547
4242
  const scrubbed = cls === "product" ? stripNonProseForProduct(file.path, file.content) : stripNonProse(file.path, file.content);
3548
- const patternsToRun = cls === "product" ? productPatterns : cls === "spec" ? specPatterns : patterns;
3549
4243
  const fileFindings = [];
3550
- for (const { pattern, what, group } of patternsToRun) {
3551
- pattern.lastIndex = 0;
3552
- let match = pattern.exec(scrubbed);
3553
- while (match !== null) {
3554
- const cited = group !== undefined ? match[group] ?? match[0] : match[0];
3555
- const citedIndex = match.index + match[0].indexOf(cited);
4244
+ for (const rule of referenceRulesFor(set, cls)) {
4245
+ if (!ruleReads(set, rule, file.path))
4246
+ continue;
4247
+ const pattern = !rule.custom && rule.id === "legacy-batch-name" ? legacyPattern : rule.patternFor(cls);
4248
+ if (!pattern)
4249
+ continue;
4250
+ const blocking = rule.severity[cls] === "error";
4251
+ const what = cls === "product" ? `${rule.message} in product code` : rule.message;
4252
+ for (const { cited, index } of citations(pattern, scrubbed, rule.custom ? undefined : rule.reportGroup)) {
3556
4253
  fileFindings.push({
3557
4254
  file: file.path,
3558
- line: lineAt(scrubbed, citedIndex),
3559
- message: `references ${what} ("${cited}") a reader outside this repo's tracker cannot resolve`,
3560
- blocking
4255
+ line: lineAt(scrubbed, index),
4256
+ message: rule.custom ? customMessage(rule, cited) : `references ${what} ("${cited}") a reader outside this repo's tracker cannot resolve`,
4257
+ blocking,
4258
+ rule: rule.id
3561
4259
  });
3562
- match = pattern.exec(scrubbed);
3563
4260
  }
3564
4261
  }
3565
4262
  const limit = cls === "spec" ? limits.get(file.path) : undefined;
@@ -3600,11 +4297,17 @@ function definesOrLinksGlossary(content, term) {
3600
4297
  return true;
3601
4298
  return /docs\/glossary|glossary\.md/i.test(content);
3602
4299
  }
3603
- function checkUndefinedVocabulary(files, glossaryTerms, readerFacingPrefix, readerFacingSuffix, shipsPrefix = SHIPS_PREFIX) {
4300
+ function checkUndefinedVocabulary(files, glossaryTerms, readerFacingPrefix, readerFacingSuffix, shipsPrefix = SHIPS_PREFIX, options = {}) {
3604
4301
  const findings = [];
4302
+ const set = options.rules ?? DEFAULT_PROSE_RULE_SET;
4303
+ const rule = set.rules.find((r) => !r.custom && r.id === "coined-term");
4304
+ if (!rule)
4305
+ return findings;
3605
4306
  for (const file of files) {
3606
- const cls = classifyProseFile(file.path, readerFacingPrefix, readerFacingSuffix, shipsPrefix);
3607
- if (!cls || !SWEPT_CLASSES.has(cls))
4307
+ const cls = classifyProseFile(file.path, readerFacingPrefix, readerFacingSuffix, shipsPrefix, DEFAULT_SPEC_PATHS, options.productPaths);
4308
+ if (!cls || !SWEPT_CLASSES.has(cls) || !rule.scopes.includes(cls))
4309
+ continue;
4310
+ if (!ruleReads(set, rule, file.path))
3608
4311
  continue;
3609
4312
  const scrubbed = stripNonProse(file.path, file.content);
3610
4313
  for (const term of glossaryTerms) {
@@ -3617,14 +4320,15 @@ function checkUndefinedVocabulary(files, glossaryTerms, readerFacingPrefix, read
3617
4320
  file: file.path,
3618
4321
  line,
3619
4322
  message: `uses coined term "${term}" without defining it inline or linking the glossary`,
3620
- blocking: false
4323
+ blocking: rule.severity[cls] === "error",
4324
+ rule: rule.id
3621
4325
  });
3622
4326
  }
3623
4327
  }
3624
4328
  return findings;
3625
4329
  }
3626
- var SOURCE_COMMENT_TRANCHE_SLUG_PATTERN = /[a-z0-9]+(?:-[a-z0-9]+)*-v[0-9]+/g;
3627
- var SOURCE_COMMENT_FORGE_NUMBER_PATTERN = /#[0-9]{2,}/g;
4330
+ var SOURCE_COMMENT_TRANCHE_SLUG_PATTERN = readerPattern("source-comment-tranche-slug", "comment");
4331
+ var SOURCE_COMMENT_FORGE_NUMBER_PATTERN = readerPattern("source-comment-forge-number", "comment");
3628
4332
  function extractComments(path, content) {
3629
4333
  if (!path.endsWith(".ts") && !path.endsWith(".tsx"))
3630
4334
  return content.replace(/[^\n]/g, "");
@@ -3721,39 +4425,40 @@ function extractComments(path, content) {
3721
4425
  }
3722
4426
  return out;
3723
4427
  }
3724
- function checkSourceComments(files, allowlist = []) {
4428
+ function checkSourceComments(files, allowlist = [], options = {}) {
3725
4429
  const findings = [];
3726
4430
  const allowed = new Set(allowlist);
3727
- const patterns = [
3728
- { pattern: SOURCE_COMMENT_TRANCHE_SLUG_PATTERN, what: "a tranche-slug citation" },
3729
- { pattern: SOURCE_COMMENT_FORGE_NUMBER_PATTERN, what: "a forge-number citation" }
3730
- ];
4431
+ const set = options.rules ?? DEFAULT_PROSE_RULE_SET;
4432
+ const rules = rulesInScope(set, "source-comment").filter((rule) => rule.group === "reader-resolvable");
3731
4433
  for (const file of files) {
3732
4434
  if (!file.path.endsWith(".ts"))
3733
4435
  continue;
3734
4436
  if (allowed.has(file.path))
3735
4437
  continue;
3736
4438
  const comments = extractComments(file.path, file.content);
3737
- for (const { pattern, what } of patterns) {
3738
- pattern.lastIndex = 0;
3739
- let match = pattern.exec(comments);
3740
- while (match !== null) {
4439
+ for (const rule of rules) {
4440
+ if (!ruleReads(set, rule, file.path))
4441
+ continue;
4442
+ const pattern = rule.patternFor("source-comment");
4443
+ if (!pattern)
4444
+ continue;
4445
+ for (const { cited, index } of citations(pattern, comments)) {
3741
4446
  findings.push({
3742
4447
  file: file.path,
3743
- line: lineAt(comments, match.index),
3744
- message: `comment cites ${what} ("${match[0]}") a reader outside this repo's tracker cannot resolve`,
3745
- blocking: false
4448
+ line: lineAt(comments, index),
4449
+ message: rule.custom ? customMessage(rule, cited) : `comment cites ${rule.message} ("${cited}") a reader outside this repo's tracker cannot resolve`,
4450
+ blocking: rule.severity["source-comment"] === "error",
4451
+ rule: rule.id
3746
4452
  });
3747
- match = pattern.exec(comments);
3748
4453
  }
3749
4454
  }
3750
4455
  }
3751
4456
  return findings;
3752
4457
  }
3753
- function checkReaderResolvableProse(files, glossaryTerms, readerFacingPrefix, readerFacingSuffix, legacySlugs = [], shipsPrefix = SHIPS_PREFIX, specGrandfather = [], specPaths = DEFAULT_SPEC_PATHS) {
4458
+ function checkReaderResolvableProse(files, glossaryTerms, readerFacingPrefix, readerFacingSuffix, legacySlugs = [], shipsPrefix = SHIPS_PREFIX, specGrandfather = [], specPaths = DEFAULT_SPEC_PATHS, options = {}) {
3754
4459
  return [
3755
- ...checkUnresolvableReferences(files, readerFacingPrefix, readerFacingSuffix, legacySlugs, shipsPrefix, specGrandfather, specPaths),
3756
- ...checkUndefinedVocabulary(files, glossaryTerms, readerFacingPrefix, readerFacingSuffix, shipsPrefix)
4460
+ ...checkUnresolvableReferences(files, readerFacingPrefix, readerFacingSuffix, legacySlugs, shipsPrefix, specGrandfather, specPaths, options),
4461
+ ...checkUndefinedVocabulary(files, glossaryTerms, readerFacingPrefix, readerFacingSuffix, shipsPrefix, options)
3757
4462
  ];
3758
4463
  }
3759
4464
  function parseGlossaryTerms(glossaryContent) {
@@ -3956,6 +4661,17 @@ function checkDocClaims(files, fileReader) {
3956
4661
  };
3957
4662
  }
3958
4663
 
4664
+ // ../../packages/aeg-core/src/protected-paths.ts
4665
+ import { posix as posixPath } from "node:path";
4666
+ var PROTECTED_ADMIN_PATHS = ["vinaya.config.json", ".vinaya/doc-owners", ".github/", "aeg-root/"];
4667
+ function normalizeTouchedPath(path) {
4668
+ return posixPath.resolve("/", path.replace(/\\/g, "/")).replace(/^\/+/, "");
4669
+ }
4670
+ function isProtectedAdminPath(path) {
4671
+ const normalized = normalizeTouchedPath(path);
4672
+ return PROTECTED_ADMIN_PATHS.some((prefix) => normalized === prefix || normalized.startsWith(prefix));
4673
+ }
4674
+
3959
4675
  // ../../packages/aeg-core/src/issue-validation.ts
3960
4676
  function hasRationaleField(body, labelPattern) {
3961
4677
  const re = new RegExp(`(?:\\*\\*|^#{1,4}\\s+)\\s*(?:${labelPattern})`, "im");
@@ -4075,13 +4791,20 @@ function globCoversPath(glob, path) {
4075
4791
  return !p.includes("/");
4076
4792
  return g === p || g.startsWith(`${p}/`) || p.startsWith(`${g}/`);
4077
4793
  }
4794
+ function surfaceEntryResolves(entry, resolvesToFile, pinnedFiles) {
4795
+ if (resolvesToFile(entry))
4796
+ return true;
4797
+ const directory = entry.replace(/\/\*\*?$/, "").replace(/\/+$/, "");
4798
+ return pinnedFiles.some((path) => path.startsWith(`${directory}/`));
4799
+ }
4078
4800
  function checkSurfaceGlobsResolve(body, resolvesToFile) {
4079
4801
  const surface = parseIssueSurface(body);
4080
4802
  if (!surface.ok)
4081
4803
  return { status: "pass", errors: [] };
4804
+ const pinnedFiles = boundaryPinnedFiles(body);
4082
4805
  const errors = [];
4083
4806
  for (const glob of surface.value.in) {
4084
- if (!resolvesToFile(glob)) {
4807
+ if (!surfaceEntryResolves(glob, resolvesToFile, pinnedFiles)) {
4085
4808
  errors.push(`issue-validation Surface: \`${glob}\` in \`## Surface\`'s \`in:\` list matches no tracked file — a Surface that cannot resolve cannot render a brief's file list.`);
4086
4809
  }
4087
4810
  }
@@ -4111,6 +4834,14 @@ function recordedBeyondSurfacePaths(body) {
4111
4834
  return paths;
4112
4835
  }
4113
4836
  function checkSurfaceScope(changedFiles, surface, recorded) {
4837
+ for (const path of changedFiles) {
4838
+ if (!isProtectedAdminPath(path))
4839
+ continue;
4840
+ const normalized = normalizeTouchedPath(path);
4841
+ if (!surface.in.some((glob) => globCoversPath(glob, normalized))) {
4842
+ return { ok: false, violation: { path, reason: "protected" } };
4843
+ }
4844
+ }
4114
4845
  const listed = new Set(recorded);
4115
4846
  const violation = beyondSurfacePaths(changedFiles, surface).find((entry) => !listed.has(entry.path));
4116
4847
  return violation ? { ok: false, violation } : { ok: true };
@@ -4166,12 +4897,22 @@ function checkPartsCiteDefinedObjectives(body) {
4166
4897
  }
4167
4898
  return { status: errors.length > 0 ? "fail" : "pass", errors };
4168
4899
  }
4900
+ var ISSUE_LIVE_LINE_RE = /^-\s*\*{2}\[live\]\*{2}(.*)$/gim;
4901
+ function liveCommand(text) {
4902
+ const trimmed = text.trim();
4903
+ const span = /^(`+)(.+)\1$/.exec(trimmed);
4904
+ return span ? span[2].trim() : trimmed;
4905
+ }
4906
+ function liveItemsIn(region) {
4907
+ return [...region.matchAll(ISSUE_LIVE_LINE_RE)].map((m) => liveCommand(m[1] ?? "")).filter(Boolean);
4908
+ }
4909
+ function parseLiveTestPlanItems(body) {
4910
+ const located = locateTestPlanSection(body);
4911
+ return located.found ? liveItemsIn(located.section) : [];
4912
+ }
4169
4913
  function isTaskIssueLabelSet(labels) {
4170
4914
  return hasLabel("tranche", labels);
4171
4915
  }
4172
- function checkTrancheLabelPresence(_body, _labels) {
4173
- return { status: "pass", errors: [] };
4174
- }
4175
4916
  function checkMilestoneAttach(labels, currentMilestoneTitle, resolvedMilestoneTitle) {
4176
4917
  if (!isTaskIssueLabelSet(labels))
4177
4918
  return { status: "pass", errors: [] };
@@ -4187,6 +4928,7 @@ function checkMilestoneAttach(labels, currentMilestoneTitle, resolvedMilestoneTi
4187
4928
  };
4188
4929
  }
4189
4930
  var TYPE_LABEL_IDS = LABELS.filter((l) => l.category === "type").map((l) => l.id);
4931
+ var PATH_TEXT = (body) => stripCode(body, { inlineSpans: "keep" });
4190
4932
  function isControlCodePoint(codePoint) {
4191
4933
  return codePoint <= 31 || codePoint >= 127 && codePoint <= 159;
4192
4934
  }
@@ -4247,8 +4989,14 @@ function checkProjectsRegistered(body, _labels, registeredNames) {
4247
4989
  }
4248
4990
  return errors.length > 0 ? { status: "fail", errors } : { status: "pass", errors: [] };
4249
4991
  }
4992
+ function rationaleFieldText(text, labelPattern) {
4993
+ const re = new RegExp(`(?:\\*\\*|^#{1,4}\\s+)\\s*(?:${labelPattern})[^\\n]*\\n?([\\s\\S]*?)(?=\\n\\s*(?:\\*\\*[A-Z]|#{1,4}\\s)|(?![\\s\\S]))`, "im");
4994
+ const m = re.exec(text);
4995
+ return m ? m[0] : "";
4996
+ }
4250
4997
  var DOC_PATH_RE = /(?:(?:aeg-root|apps|packages|specs|docs|tools|\.claude|\.github)\/[\w./@-]*\.(?:md|mdx)|\.claude\/(?:skills|rules)\/[\w./-]+|\b(?:docs-index|decisions|projects|state-machine|enforcement|process|README|CLAUDE)\.md\b|\b[\w-]+-(?:spec|decisions|backlog)\.md\b)/i;
4251
4998
  var DOC_PATH_RE_GLOBAL = new RegExp(DOC_PATH_RE.source, "gi");
4999
+ var RATIONALE_PATH_RE_GLOBAL = /`([\w.@-]+(?:\/[\w.@-]+)+)`/g;
4252
5000
  function normalizeEdgeId(s) {
4253
5001
  const qualified = splitSlugQualifiedEdge(s);
4254
5002
  return (qualified ? qualified.bareId : s).replace(/^#/, "").trim();
@@ -4256,6 +5004,15 @@ function normalizeEdgeId(s) {
4256
5004
  function edgesNameEachOther(a, b) {
4257
5005
  return a.conflictsWith.map(normalizeEdgeId).includes(normalizeEdgeId(b.ref)) || b.conflictsWith.map(normalizeEdgeId).includes(normalizeEdgeId(a.ref));
4258
5006
  }
5007
+ var BOUNDARY_OUT_RE = /\bOut\s*:\s*([\s\S]*)$/im;
5008
+ function boundaryOutText(body) {
5009
+ const boundary = rationaleFieldText(PATH_TEXT(body), "Boundary");
5010
+ const m = BOUNDARY_OUT_RE.exec(boundary);
5011
+ return m ? m[1] : "";
5012
+ }
5013
+ function namedPathsIn(text) {
5014
+ return [...new Set([...text.matchAll(RATIONALE_PATH_RE_GLOBAL)].map((m) => m[1]))].filter((p) => !/^https?:\/\//i.test(p));
5015
+ }
4259
5016
  var FILE_EXTENSIONS = new Set([
4260
5017
  "ts",
4261
5018
  "tsx",
@@ -4277,6 +5034,11 @@ var FILE_EXTENSIONS = new Set([
4277
5034
  "html",
4278
5035
  "css"
4279
5036
  ]);
5037
+ function boundaryPinnedFiles(body) {
5038
+ const boundary = rationaleFieldText(PATH_TEXT(body), "Boundary");
5039
+ const excluded = new Set(namedPathsIn(boundaryOutText(body)));
5040
+ return namedPathsIn(boundary).filter((p) => looksLikeFilePath(p) && !excluded.has(p));
5041
+ }
4280
5042
  var CI_SHARD_DIR = "apps/cli/tests/ci-shards";
4281
5043
  var CI_SHARD_PROBE = `${CI_SHARD_DIR}/shard-1.txt`;
4282
5044
 
@@ -4301,7 +5063,7 @@ function isGrandfathered(isoDate) {
4301
5063
  return isoDate.slice(0, 10) < COHERENCE_ENFORCED_FROM;
4302
5064
  }
4303
5065
  var R1_GRANDFATHERED_ISSUES = new Set([279, 280, 281, 282]);
4304
- function checkA1(entries, principalAllowlist = PRINCIPAL_ALLOWLIST) {
5066
+ function checkA1(entries, principalAllowlist) {
4305
5067
  const failures = [];
4306
5068
  for (const e of entries) {
4307
5069
  if (!e.facts)
@@ -4331,6 +5093,37 @@ function checkA1(entries, principalAllowlist = PRINCIPAL_ALLOWLIST) {
4331
5093
  note: status === "info" ? `${failures.length} grandfathered (pre-${COHERENCE_ENFORCED_FROM})` : undefined
4332
5094
  };
4333
5095
  }
5096
+ function checkA2(entries, hasProvenanceByKey) {
5097
+ const failures = [];
5098
+ for (const e of entries) {
5099
+ if (!e.facts)
5100
+ continue;
5101
+ if (e.facts.issueState !== "closed" || e.facts.prState !== "merged")
5102
+ continue;
5103
+ const key = `${e.trancheSlug}/${e.task.id}`;
5104
+ const hasProvenance = hasProvenanceByKey.get(key);
5105
+ if (hasProvenance === undefined)
5106
+ continue;
5107
+ if (!hasProvenance) {
5108
+ failures.push({
5109
+ code: "archived-without-provenance",
5110
+ issue: e.task.issue,
5111
+ tranche: e.trancheSlug,
5112
+ task: e.task.id,
5113
+ reason: "Closing PR has no `### AEG provenance` comment (Archivist close-out missing)",
5114
+ grandfathered: isGrandfathered(e.facts.mergedAt)
5115
+ });
5116
+ }
5117
+ }
5118
+ const activeFails = failures.filter((f) => !f.grandfathered);
5119
+ const status = activeFails.length > 0 ? "fail" : failures.length > 0 ? "info" : "pass";
5120
+ return {
5121
+ check: "A2",
5122
+ status,
5123
+ failures,
5124
+ note: status === "info" ? `${failures.length} grandfathered (pre-${COHERENCE_ENFORCED_FROM})` : undefined
5125
+ };
5126
+ }
4334
5127
  function checkA3(entries) {
4335
5128
  const failures = [];
4336
5129
  for (const e of entries) {
@@ -4546,6 +5339,33 @@ function checkL1(files, entriesBySlug) {
4546
5339
  note: failures.length > 0 ? `${failures.length} active tranche(s) with no open task-Issues — consider archiving (advisory)` : undefined
4547
5340
  };
4548
5341
  }
5342
+ function checkL2(files, entriesBySlug) {
5343
+ const failures = [];
5344
+ for (const f of files) {
5345
+ if (!f.archived)
5346
+ continue;
5347
+ const entries = entriesBySlug.get(f.slug) ?? [];
5348
+ for (const e of entries) {
5349
+ if (!e.facts)
5350
+ continue;
5351
+ if (e.facts.issueState === "open") {
5352
+ failures.push({
5353
+ code: "premature-archive",
5354
+ issue: e.task.issue,
5355
+ tranche: f.slug,
5356
+ task: e.task.id,
5357
+ reason: `Archived tranche has open task-Issue #${e.task.issue ?? "?"} (premature archive)`
5358
+ });
5359
+ }
5360
+ }
5361
+ }
5362
+ return {
5363
+ check: "L2",
5364
+ status: "info",
5365
+ failures,
5366
+ note: failures.length > 0 ? `${failures.length} archived tranche(s) with an open task-Issue — investigate (advisory)` : undefined
5367
+ };
5368
+ }
4549
5369
  function checkL3(files) {
4550
5370
  const active = files.filter((f) => !f.archived);
4551
5371
  return {
@@ -4555,6 +5375,51 @@ function checkL3(files) {
4555
5375
  note: `${active.length} active tranche(s): ${active.map((f) => f.slug).join(", ") || "(none)"}`
4556
5376
  };
4557
5377
  }
5378
+ function checkL4(activeTrancheSlugs, issueMilestones) {
5379
+ const activeSet = new Set(activeTrancheSlugs);
5380
+ const failures = [];
5381
+ for (const f of issueMilestones) {
5382
+ if (!activeSet.has(f.tranche))
5383
+ continue;
5384
+ if (f.milestoneTitle === f.tranche)
5385
+ continue;
5386
+ failures.push({
5387
+ code: "milestone-drift",
5388
+ issue: f.issue,
5389
+ tranche: f.tranche,
5390
+ reason: f.milestoneTitle === null ? `Issue #${f.issue} carries ${trancheLabel(f.tranche)} (active) but has no GitHub-native milestone attached` : `Issue #${f.issue} carries ${trancheLabel(f.tranche)} (active) but is attached to Milestone "${f.milestoneTitle}" instead`
5391
+ });
5392
+ }
5393
+ return {
5394
+ check: "L4",
5395
+ status: "info",
5396
+ failures,
5397
+ note: failures.length > 0 ? `${failures.length} open task-Issue(s) in an active tranche whose GitHub-native milestone doesn't match their ${label("tranche")}<slug> label (cosmetic drift, advisory)` : undefined
5398
+ };
5399
+ }
5400
+ function checkL5(activeTrancheSlugs, entriesBySlug) {
5401
+ const failures = [];
5402
+ for (const slug of activeTrancheSlugs) {
5403
+ const entries = entriesBySlug.get(slug) ?? [];
5404
+ const withFacts = entries.filter((e) => e.facts !== undefined);
5405
+ if (withFacts.length === 0)
5406
+ continue;
5407
+ const allClosed = withFacts.every((e) => e.facts?.issueState === "closed");
5408
+ if (allClosed) {
5409
+ failures.push({
5410
+ code: "tranche-not-archived",
5411
+ tranche: slug,
5412
+ reason: "Every task Issue is closed but the tranche is not recorded as complete — archive it"
5413
+ });
5414
+ }
5415
+ }
5416
+ return {
5417
+ check: "L5",
5418
+ status: failures.length > 0 ? "fail" : "pass",
5419
+ failures,
5420
+ note: failures.length > 0 ? `${failures.length} tranche(s) whose task Issues are all closed but were never archived` : undefined
5421
+ };
5422
+ }
4558
5423
  function extractClosesReferences(prBody) {
4559
5424
  const closesPattern = /(?:close[sd]?|fix(?:e[sd])?|resolve[sd]?)\s{0,8}:?\s{0,8}#(\d+)/gi;
4560
5425
  const stripped = stripCode(prBody);
@@ -4650,6 +5515,58 @@ function extractIssue(body) {
4650
5515
  }
4651
5516
  // ../../packages/aeg-core/src/review-input-manifest.ts
4652
5517
  import { createHash as createHash4 } from "node:crypto";
5518
+
5519
+ // ../../packages/aeg-core/src/ruling-ordinal.ts
5520
+ var RULING_MARKER_ORDINAL = /^<!-- aeg:principal:ruling:\d+-(\d+) -->$/;
5521
+ function newestPrincipalRulingOrdinal(comments, allowlist) {
5522
+ let best = 0;
5523
+ for (const c of comments) {
5524
+ if (!isPrincipal(c.author, allowlist))
5525
+ continue;
5526
+ const firstLine = (c.body.split(`
5527
+ `)[0] ?? "").trim();
5528
+ const m = RULING_MARKER_ORDINAL.exec(firstLine);
5529
+ if (!m)
5530
+ continue;
5531
+ const k = Number.parseInt(m[1], 10);
5532
+ if (k > best)
5533
+ best = k;
5534
+ }
5535
+ return best;
5536
+ }
5537
+ function parseRulingIdentity(rulingId) {
5538
+ const m = /^(issue-)?(\d+)-(\d+)$/.exec(rulingId);
5539
+ if (!m)
5540
+ return null;
5541
+ const ref = Number.parseInt(m[2], 10);
5542
+ const ordinal = Number.parseInt(m[3], 10);
5543
+ if (ref <= 0 || ordinal <= 0)
5544
+ return null;
5545
+ return { target: m[1] ? "issue" : "pr", ref, ordinal };
5546
+ }
5547
+ function principalRulingTextById(comments, allowlist, rulingId) {
5548
+ const identity = parseRulingIdentity(rulingId);
5549
+ if (identity === null)
5550
+ return null;
5551
+ const matches = comments.filter((c) => {
5552
+ if (!isPrincipal(c.author, allowlist))
5553
+ return false;
5554
+ const m = RULING_MARKER_ORDINAL.exec((c.body.split(`
5555
+ `)[0] ?? "").trim());
5556
+ return m !== null && Number.parseInt(m[1], 10) === identity.ordinal;
5557
+ });
5558
+ if (matches.length !== 1)
5559
+ return null;
5560
+ const body = matches[0].body;
5561
+ const idx = body.indexOf(`
5562
+ `);
5563
+ return idx === -1 ? "" : body.slice(idx + 1).trim();
5564
+ }
5565
+
5566
+ // ../../packages/aeg-core/src/review-input-manifest.ts
5567
+ function pauseBoundRulingDigest(rulingText) {
5568
+ return createHash4("sha256").update(rulingText).digest("hex");
5569
+ }
4653
5570
  function briefHash(brief) {
4654
5571
  return createHash4("sha256").update(`${brief}
4655
5572
  `).digest("hex");
@@ -4710,14 +5627,19 @@ function compareManifest(echoed, current, patchIdOf) {
4710
5627
  const briefHashBound = isBoundToBriefHash(echoed, current.briefHash);
4711
5628
  const objectivesVersion = isBoundToObjectives(echoed, current.objectivesVersion);
4712
5629
  const rulingOrdinal = isBoundToRulings(echoed, current.rulingOrdinal);
5630
+ const legacyCurrent = current.manifestVersion === undefined;
5631
+ const manifestVersion = legacyCurrent ? echoed.manifestVersion === undefined || echoed.manifestVersion === null : echoed.manifestVersion === current.manifestVersion;
5632
+ const pauseBoundRuling = legacyCurrent ? true : Object.hasOwn(echoed, "pauseBoundRuling") && JSON.stringify(echoed.pauseBoundRuling) === JSON.stringify(current.pauseBoundRuling);
4713
5633
  const policyDigestBound = isBoundToPolicy(echoed, current.policyDigest);
4714
5634
  return {
4715
- bound: head && base && briefHashBound && objectivesVersion && rulingOrdinal && policyDigestBound,
5635
+ bound: head && base && briefHashBound && objectivesVersion && rulingOrdinal && pauseBoundRuling && manifestVersion && policyDigestBound,
4716
5636
  head,
4717
5637
  base,
4718
5638
  briefHash: briefHashBound,
4719
5639
  objectivesVersion,
4720
5640
  rulingOrdinal,
5641
+ pauseBoundRuling,
5642
+ manifestVersion,
4721
5643
  policyDigest: policyDigestBound
4722
5644
  };
4723
5645
  }
@@ -4733,7 +5655,7 @@ function renderGateDeferred(deferred) {
4733
5655
  return ` ${deferred.length} finding(s) deferred, not blocking this round: ${items}.`;
4734
5656
  }
4735
5657
  function checkReviewGate(input) {
4736
- const principalAllowlist = input.principalAllowlist ?? PRINCIPAL_ALLOWLIST;
5658
+ const { principalAllowlist } = input;
4737
5659
  const waived = isWaiverLabelActorVerified({
4738
5660
  label: WAIVER_LABEL_REVIEW,
4739
5661
  labels: input.labels,
@@ -4772,27 +5694,33 @@ function checkReviewGate(input) {
4772
5694
  const codeReviewClean = codeReviewTextClean && codeReviewPolicyClean;
4773
5695
  const securityClean = securityTextClean && securityPolicyClean;
4774
5696
  const currentManifest = {
5697
+ ...input.manifestVersion === undefined ? {} : { manifestVersion: input.manifestVersion },
4775
5698
  headSha: input.headSha,
4776
5699
  baseSha: input.baseSha ?? null,
4777
5700
  briefHash: input.briefHash ?? null,
4778
5701
  objectivesVersion: input.objectivesVersion,
4779
5702
  rulingOrdinal: input.rulingOrdinal,
5703
+ pauseBoundRuling: input.pauseBoundRuling ?? null,
4780
5704
  policyDigest: policyDigest(policy)
4781
5705
  };
4782
5706
  const codeReviewEchoed = {
5707
+ manifestVersion: codeReview.manifestVersion,
4783
5708
  headSha: codeReview.headSha,
4784
5709
  baseSha: codeReview.baseSha,
4785
5710
  briefHash: codeReview.briefHash,
4786
5711
  objectivesVersion: codeReview.objectivesVersion,
4787
5712
  rulingOrdinal: codeReview.rulingOrdinal,
5713
+ pauseBoundRuling: codeReview.pauseBoundRuling,
4788
5714
  policyDigest: codeReview.policyDigest
4789
5715
  };
4790
5716
  const securityEchoed = {
5717
+ manifestVersion: security.manifestVersion,
4791
5718
  headSha: security.headSha,
4792
5719
  baseSha: security.baseSha,
4793
5720
  briefHash: security.briefHash,
4794
5721
  objectivesVersion: security.objectivesVersion,
4795
5722
  rulingOrdinal: security.rulingOrdinal,
5723
+ pauseBoundRuling: security.pauseBoundRuling,
4796
5724
  policyDigest: security.policyDigest
4797
5725
  };
4798
5726
  const codeReviewBinding = compareManifest(codeReviewEchoed, currentManifest, input.patchIdOf);
@@ -4831,6 +5759,10 @@ function checkReviewGate(input) {
4831
5759
  problems.push(`the newest code-review verdict was cast against brief hash ${codeReview.briefHash ?? "none"}, the frozen brief's current hash is ${currentManifest.briefHash ?? "none"}`);
4832
5760
  } else if (!codeReviewBinding.policyDigest) {
4833
5761
  problems.push(`the newest code-review verdict was cast against review policy digest ${codeReview.policyDigest ?? "none"}, this repository's current policy digest is ${currentManifest.policyDigest}`);
5762
+ } else if (!codeReviewBinding.manifestVersion) {
5763
+ problems.push(`the newest code-review verdict echoes manifest version ${codeReview.manifestVersion ?? "none"}, the frozen review-input manifest is version ${currentManifest.manifestVersion ?? "unversioned"}`);
5764
+ } else if (!codeReviewBinding.pauseBoundRuling) {
5765
+ problems.push(`the newest code-review verdict echoes pauseBoundRuling ${renderBinding(codeReview.pauseBoundRuling)}, the frozen review-input manifest binds ${renderBinding(currentManifest.pauseBoundRuling)}`);
4834
5766
  }
4835
5767
  if (!securityTextClean) {
4836
5768
  problems.push(`security-review verdict is not a clean PASS (found: ${security.value})`);
@@ -4848,6 +5780,10 @@ function checkReviewGate(input) {
4848
5780
  problems.push(`the newest security-review verdict was cast against brief hash ${security.briefHash ?? "none"}, the frozen brief's current hash is ${currentManifest.briefHash ?? "none"}`);
4849
5781
  } else if (!securityBinding.policyDigest) {
4850
5782
  problems.push(`the newest security-review verdict was cast against review policy digest ${security.policyDigest ?? "none"}, this repository's current policy digest is ${currentManifest.policyDigest}`);
5783
+ } else if (!securityBinding.manifestVersion) {
5784
+ problems.push(`the newest security-review verdict echoes manifest version ${security.manifestVersion ?? "none"}, the frozen review-input manifest is version ${currentManifest.manifestVersion ?? "unversioned"}`);
5785
+ } else if (!securityBinding.pauseBoundRuling) {
5786
+ problems.push(`the newest security-review verdict echoes pauseBoundRuling ${renderBinding(security.pauseBoundRuling)}, the frozen review-input manifest binds ${renderBinding(currentManifest.pauseBoundRuling)}`);
4851
5787
  }
4852
5788
  const ignoredNote = ignoredCount > 0 ? ` ${ignoredCount} verdict-shaped comment(s) from authors outside the principal allowlist were ignored.` : "";
4853
5789
  return {
@@ -4856,29 +5792,16 @@ function checkReviewGate(input) {
4856
5792
  waived: false
4857
5793
  };
4858
5794
  }
5795
+ function renderBinding(binding) {
5796
+ if (binding === undefined)
5797
+ return "(absent)";
5798
+ return binding === null ? "(none)" : `${binding.rulingId}|${binding.pauseId}|${binding.contentDigest}`;
5799
+ }
4859
5800
  var CHANGESET_RELEASE_BRANCH = "changeset-release/main";
4860
5801
  var DEFAULT_RELEASE_ACTOR = "github-actions[bot]";
4861
5802
  function isChangesetsReleasePr(branch, author, expectedAuthor) {
4862
5803
  return branch === CHANGESET_RELEASE_BRANCH && author === expectedAuthor;
4863
5804
  }
4864
- // ../../packages/aeg-core/src/ruling-ordinal.ts
4865
- var RULING_MARKER_ORDINAL = /^<!-- aeg:principal:ruling:\d+-(\d+) -->$/;
4866
- function newestPrincipalRulingOrdinal(comments, allowlist) {
4867
- let best = 0;
4868
- for (const c of comments) {
4869
- if (!isPrincipal(c.author, allowlist))
4870
- continue;
4871
- const firstLine = (c.body.split(`
4872
- `)[0] ?? "").trim();
4873
- const m = RULING_MARKER_ORDINAL.exec(firstLine);
4874
- if (!m)
4875
- continue;
4876
- const k = Number.parseInt(m[1], 10);
4877
- if (k > best)
4878
- best = k;
4879
- }
4880
- return best;
4881
- }
4882
5805
  // ../../packages/aeg-core/src/markdown-table.ts
4883
5806
  function splitRow(line) {
4884
5807
  const trimmed = line.trim().replace(/^\|/, "").replace(/\|$/, "");
@@ -5030,7 +5953,6 @@ var SCAFFOLD_PLACEHOLDER = "[undocumented — fill in why]";
5030
5953
  var NON_GATE_BIN_NAMES = NON_GATE_BINS;
5031
5954
  var TWIN_CANDIDATE_EXCEPTIONS = {
5032
5955
  "apps/cli/src/checks/bin/check-dead-branch-push.ts": 'Ring 0 "Pushing to a branch whose pull request already resolved" (implementation: check-push-target.ts)',
5033
- "apps/cli/src/checks/bin/check-issue-assignment.ts": `Ring 0 "A task branch's first push (Issue self-assignment)" (implementation: assign-task-issue.ts)`,
5034
5956
  "apps/cli/src/checks/bin/check-closes-n.ts": 'Ring 1 "Closes linkage" (implementation: verify-coherence.ts)'
5035
5957
  };
5036
5958
  var NON_GATE_HOOK_SCRIPTS = [".claude/hooks/track-transcript.sh"];
@@ -5254,72 +6176,10 @@ function compareToBaseline(current, baseline) {
5254
6176
  };
5255
6177
  }
5256
6178
  // ../../packages/aeg-core/src/retired-vocabulary.ts
5257
- var PLAN_ON_DISK_PATTERNS = ["[Tt]opology files?", "aeg-root/tranches/", "aeg-project/"];
5258
- var RETIRED_PATTERNS = [
5259
- String.raw`\bD-[0-9]{3}\b`,
5260
- "D-(###|NNN|nnn|xxx)",
5261
- "decision (entry|logged)",
5262
- "decision-log entry",
5263
- "decision log entry",
5264
- "decision log(s|ged|ging)?([^a-z]|$)",
5265
- "decision-log",
5266
- "decision entr",
5267
- "decisions? (are |is )?logged",
5268
- "log entries",
5269
- String.raw`decisions\.md`,
5270
- "decisions-legacy",
5271
- "CONTRADICTION",
5272
- "assumes Tier 3",
5273
- "Lock: ?YES",
5274
- "Lock: ?NO",
5275
- "lock approvals?",
5276
- "approves locks",
5277
- "Conforms to lock",
5278
- "Challenges lock",
5279
- "checkDecisionNumbersFresh",
5280
- String.raw`roles/team-leader\.md`,
5281
- String.raw`\(,`,
5282
- String.raw`,\)`,
5283
- String.raw`\(\.\)`,
5284
- ...PLAN_ON_DISK_PATTERNS
5285
- ];
5286
- var TRANCHE_MODEL_FILE = "/tranche-model.md";
5287
- var RETIRED_EXEMPT_SUBSTRINGS = [
5288
- "docs/decisions-legacy.md",
5289
- "apps/herald-ai/docs/",
5290
- "apps/vada-ai/docs/",
5291
- "aeg-root/tranches/completed/",
5292
- "packages/aeg-core/src/docs/published-prose",
5293
- "packages/aeg-core/src/retired-vocabulary.test.ts",
5294
- "packages/aeg-core/src/retired-vocabulary.ts",
5295
- "/fixtures/",
5296
- "/node_modules/",
5297
- "/.next/",
5298
- "/.turbo/"
5299
- ];
5300
- var PATTERN_EXEMPT = {
5301
- [String.raw`\bD-[0-9]{3}\b`]: ["./CLAUDE.md"],
5302
- [String.raw`decisions\.md`]: [
5303
- "docs-index.md",
5304
- "apps/vada-ai/specs/legacy/README.md",
5305
- "apps/vada-ai/specs/vada-product-spec.md",
5306
- "apps/vada-ai/web/CLAUDE.md",
5307
- "apps/vada-ai/CLAUDE.md"
5308
- ],
5309
- "decisions-legacy": [
5310
- "packages/aeg-core/src/file-classify.ts",
5311
- "packages/aeg-core/src/file-classify.test.ts",
5312
- "packages/aeg-core/src/pr-tier.test.ts",
5313
- "docs-index.md",
5314
- ".claude/skills/database/SKILL.md",
5315
- ".claude/skills/vada-architecture/SKILL.md",
5316
- "apps/vada-ai/specs/vada-byok-principles.md",
5317
- "apps/vada-ai/web/CLAUDE.md",
5318
- "apps/vada-ai/CLAUDE.md"
5319
- ],
5320
- CONTRADICTION: ["apps/vada-ai/specs/vada-reviewers-spec.md"],
5321
- ...Object.fromEntries(PLAN_ON_DISK_PATTERNS.map((pattern) => [pattern, [TRANCHE_MODEL_FILE]]))
5322
- };
6179
+ var retiredRules = rulesForGroup("retired-vocabulary");
6180
+ var RETIRED_PATTERNS = retiredRules.map((rule) => rule.patterns.repository);
6181
+ var PATTERN_EXEMPT = RETIRED_PATTERN_EXEMPTIONS;
6182
+ var DEFAULT_PATTERN_OF = new Map(retiredRules.map((rule) => [rule.id, rule.patterns.repository]));
5323
6183
  function lineNumbers(content, pattern) {
5324
6184
  const out = [];
5325
6185
  const lines = content.split(`
@@ -5330,22 +6190,29 @@ function lineNumbers(content, pattern) {
5330
6190
  }
5331
6191
  return out;
5332
6192
  }
5333
- function scanRetiredVocabulary(files) {
6193
+ function scanRetiredVocabulary(files, rules = DEFAULT_PROSE_RULE_SET) {
5334
6194
  const findings = [];
6195
+ const retired = rulesOfGroup(rules, "retired-vocabulary");
5335
6196
  for (const file of files) {
5336
- if (RETIRED_EXEMPT_SUBSTRINGS.some((e) => file.path.includes(e)))
5337
- continue;
5338
- for (const pattern of RETIRED_PATTERNS) {
5339
- const patternExempt = PATTERN_EXEMPT[pattern] ?? [];
5340
- if (patternExempt.some((e) => file.path.includes(e)))
6197
+ for (const rule of retired) {
6198
+ if (rule.substringExempt.some((e) => file.path.includes(e)))
6199
+ continue;
6200
+ if (!ruleReads(rules, rule, file.path))
6201
+ continue;
6202
+ const re = rule.patternFor("repository");
6203
+ if (!re)
6204
+ continue;
6205
+ const pattern = rule.custom ? re.source : DEFAULT_PATTERN_OF.get(rule.id) ?? re.source;
6206
+ if (!rule.custom && (PATTERN_EXEMPT[pattern] ?? []).some((e) => file.path.includes(e)))
5341
6207
  continue;
5342
- const re = new RegExp(pattern);
5343
6208
  for (const line of lineNumbers(file.content, re)) {
5344
6209
  findings.push({
5345
6210
  file: file.path,
5346
6211
  line,
5347
6212
  pattern,
5348
- message: `claims a retired AEG mechanism is still live (matches /${pattern}/)`
6213
+ message: rule.custom ? `${rule.id}: ${rule.message} (matches /${pattern}/)` : `claims a retired AEG mechanism is still live (matches /${pattern}/)`,
6214
+ rule: rule.id,
6215
+ blocking: rule.severity.repository === "error"
5349
6216
  });
5350
6217
  }
5351
6218
  }
@@ -5369,7 +6236,7 @@ function isSelfDependency(dep, task, issue) {
5369
6236
  function checkDispatchReadiness(input) {
5370
6237
  const { trancheSlug, task } = input;
5371
6238
  const taskLabel = `task ${task.id} (tranche ${trancheSlug})`;
5372
- const principalAllowlist = input.principalAllowlist ?? PRINCIPAL_ALLOWLIST;
6239
+ const { principalAllowlist } = input;
5373
6240
  const blockerDetails = [];
5374
6241
  const push = (blockerClass, message) => {
5375
6242
  blockerDetails.push({ class: blockerClass, message });
@@ -5461,6 +6328,16 @@ function pushesAnyBranchRef(pushRefs) {
5461
6328
  return pushRefs.split(`
5462
6329
  `).map((line) => line.trim()).filter((line) => line.length > 0).some((line) => line.split(/\s+/)[2]?.startsWith("refs/heads/") === true);
5463
6330
  }
6331
+ function resolveDefaultBranch(facts) {
6332
+ const { originHead, hasOriginMain, hasOriginMaster } = facts;
6333
+ if (originHead !== null && originHead !== "")
6334
+ return originHead;
6335
+ if (hasOriginMain)
6336
+ return "main";
6337
+ if (hasOriginMaster)
6338
+ return "master";
6339
+ return null;
6340
+ }
5464
6341
  function checkMainBranchRefusal(facts) {
5465
6342
  const { currentSymbolicBranch, defaultBranch, pushRefs = null } = facts;
5466
6343
  if (currentSymbolicBranch === null)
@@ -5721,54 +6598,61 @@ function checkFirstPushDispatchGate(input) {
5721
6598
  reason: `verify-dispatch reports READY TO DISPATCH for \`${branch}\`.`
5722
6599
  };
5723
6600
  }
5724
- // ../../packages/aeg-core/src/issue-assignment.ts
5725
- function decideIssueAssignment(input) {
5726
- const { branch, remoteRefExists, issue, assignees, login } = input;
5727
- if (parseTaskBranch(branch) === null) {
5728
- return {
5729
- action: "skip",
5730
- reason: `Branch \`${branch}\` is not a task/<tranche>/<n> branch — Issue self-assignment only applies to task branches.`
5731
- };
5732
- }
5733
- if (remoteRefExists) {
5734
- return {
5735
- action: "skip",
5736
- reason: `Branch \`${branch}\` already exists on the remote — not its first push, nothing to assign.`
5737
- };
5738
- }
5739
- if (issue === null) {
5740
- return {
5741
- action: "skip",
5742
- reason: `No Issue resolved for \`${branch}\` from its topology row — skipping self-assignment (the gate owns refusing an unplanned branch).`
5743
- };
5744
- }
5745
- if (assignees === null) {
5746
- return {
5747
- action: "skip",
5748
- reason: `Could not read Issue #${issue}'s current assignees — skipping rather than risking a double-assign (fail-open, never a guess).`
5749
- };
5750
- }
5751
- if (assignees.length > 0) {
5752
- return {
5753
- action: "skip",
5754
- reason: `Issue #${issue} is already assigned (${assignees.join(", ")}) — no-op.`
5755
- };
5756
- }
5757
- if (login === null) {
5758
- return {
5759
- action: "skip",
5760
- reason: "Could not resolve the authenticated `gh` login — never assigning anyone other than the actual pusher, so skipping."
5761
- };
6601
+ // ../../packages/aeg-core/src/live-record.ts
6602
+ var RECORD_LINE_RE = /^-\s*\[([ xX])\]\s*\*\*\[live\]\*\*\s+(`+) ?(.+?) ?\2(?!`)\s+—\s+(passed|failed|unverified)\s+at\s+`([^`]+)`/;
6603
+ function liveMarkers(body) {
6604
+ const masked = maskCode(body);
6605
+ return [...masked.matchAll(/<!--\s*AEG:LIVE:(?:START|END)\s*-->/g)].map((m) => ({
6606
+ start: m.index,
6607
+ end: m.index + m[0].length
6608
+ }));
6609
+ }
6610
+ var AMBIGUOUS_RECORD_LINE = {
6611
+ line: "- [ ] **[live]** the pull request body carries more than one `AEG:LIVE` marker pair, so the driver's record cannot be told apart",
6612
+ ticked: false,
6613
+ command: "",
6614
+ outcome: "failed",
6615
+ head: ""
6616
+ };
6617
+ function readLiveRecord(body) {
6618
+ const markers = liveMarkers(body).length;
6619
+ if (markers === 0)
6620
+ return [];
6621
+ if (markers !== 2)
6622
+ return [AMBIGUOUS_RECORD_LINE];
6623
+ const region = anchoredRegion(body, "LIVE");
6624
+ if (region === null)
6625
+ return [];
6626
+ const lines = [];
6627
+ for (const raw of region.split(`
6628
+ `)) {
6629
+ const line = raw.trim();
6630
+ const m = RECORD_LINE_RE.exec(line);
6631
+ if (!m)
6632
+ continue;
6633
+ lines.push({
6634
+ line,
6635
+ ticked: m[1].toLowerCase() === "x",
6636
+ command: m[3],
6637
+ outcome: m[4],
6638
+ head: m[5]
6639
+ });
5762
6640
  }
5763
- return {
5764
- action: "assign",
5765
- issue,
5766
- login,
5767
- reason: `First push of \`${branch}\` — assigning Issue #${issue} to @${login} (the authenticated pusher).`
5768
- };
6641
+ return lines;
5769
6642
  }
5770
6643
  // ../../packages/aeg-core/src/test-plan-gate.ts
5771
- function evaluateTestPlanGate(body, branch) {
6644
+ function gradedLiveLines(record, live) {
6645
+ if (live === undefined)
6646
+ return record.map((entry) => entry.line);
6647
+ const commands = new Set(live.liveCommands);
6648
+ const others = record.filter((entry) => !commands.has(entry.command)).map((entry) => entry.line);
6649
+ const graded = live.liveCommands.map((command) => {
6650
+ const atHead = record.filter((entry) => entry.command === command && entry.head === live.head);
6651
+ return (atHead.find((entry) => entry.ticked) ?? atHead[0])?.line ?? `- [ ] **[live]** \`${command}\` — no passed run recorded at \`${live.head || "an unknown head"}\``;
6652
+ });
6653
+ return [...others, ...graded];
6654
+ }
6655
+ function evaluateTestPlanGate(body, branch, live) {
5772
6656
  if (!body) {
5773
6657
  return {
5774
6658
  verdict: "pass",
@@ -5779,7 +6663,9 @@ function evaluateTestPlanGate(body, branch) {
5779
6663
  };
5780
6664
  }
5781
6665
  const located = locateTestPlanSection(body);
5782
- if (!located.found) {
6666
+ const liveLines = gradedLiveLines(readLiveRecord(body), live);
6667
+ const liveUnticked = liveLines.some((line) => /^[-*]\s+\[\s\]/.test(line));
6668
+ if (!located.found && !liveUnticked) {
5783
6669
  if (parseTaskBranchIdentity(branch) !== null) {
5784
6670
  return {
5785
6671
  verdict: "fail",
@@ -5799,15 +6685,18 @@ function evaluateTestPlanGate(body, branch) {
5799
6685
  ]
5800
6686
  };
5801
6687
  }
5802
- const section = located.section;
5803
- if (/unit-tests-only/i.test(section)) {
6688
+ const section = located.found ? located.section : "";
6689
+ if (/unit-tests-only/i.test(section) && !liveUnticked) {
5804
6690
  return {
5805
6691
  verdict: "pass",
5806
6692
  messages: ["Test Plan: unit-tests-only — pure-logic brief, CI unit-tests are the proof.", "PASS."]
5807
6693
  };
5808
6694
  }
5809
- const checkboxLines = section.split(`
5810
- `).map((line) => line.trimStart()).filter((line) => /^[-*]\s+\[[ xX]\]\s*\*{0,2}\[principal\]\*{0,2}/i.test(line));
6695
+ const checkboxLines = [
6696
+ ...section.split(`
6697
+ `).map((line) => line.trimStart()).filter((line) => /^[-*]\s+\[[ xX]\]\s*\*{0,2}\[principal\]\*{0,2}/i.test(line)),
6698
+ ...liveLines
6699
+ ];
5811
6700
  if (checkboxLines.length === 0) {
5812
6701
  return {
5813
6702
  verdict: "pass",
@@ -5824,7 +6713,9 @@ function evaluateTestPlanGate(body, branch) {
5824
6713
  messages.push("", "FAIL — the following [principal] Test Plan items are unticked:");
5825
6714
  for (const line of unchecked)
5826
6715
  messages.push(` ${line}`);
5827
- messages.push("", "Per aeg-root/roles/developer.md (Verification), a PR is not mergeable while any [principal] Test Plan box is unticked.", "The Principal runs the item in a real signed-in browser and ticks the box.", "Note: editing the PR body does not retrigger most workflows. If your PR body changes do not surface here, push an empty commit to re-run.");
6716
+ messages.push("", "Per aeg-root/roles/developer.md (Verification), a PR is not mergeable while any [principal] Test Plan box is unticked.", "The Principal runs the item in a real signed-in browser and ticks the box.", ...liveUnticked ? [
6717
+ "An unticked [live] line is a live run that failed or that the review loop could not verify on its host: a later head re-runs it, or the Principal runs it and ticks the box."
6718
+ ] : [], "Note: editing the PR body does not retrigger most workflows. If your PR body changes do not surface here, push an empty commit to re-run.");
5828
6719
  return { verdict: "fail", messages };
5829
6720
  }
5830
6721
  messages.push("All [principal] Test Plan items ticked — runtime verification complete.", "PASS.");
@@ -6013,9 +6904,11 @@ var LineageSchema = z3.object({
6013
6904
  parent: z3.string().nullable()
6014
6905
  }).strict();
6015
6906
  var InputVersionsSchema = z3.object({
6907
+ manifest_version: z3.literal(2).nullable().optional(),
6016
6908
  objectives_version: z3.string().nullable(),
6017
6909
  brief_hash: z3.string().nullable(),
6018
6910
  ruling_ordinal: z3.number().int().nullable(),
6911
+ pause_bound_ruling: z3.object({ rulingId: z3.string().min(1), pauseId: z3.string().min(1), contentDigest: z3.string().min(1) }).strict().nullable().optional(),
6019
6912
  policy_digest: z3.string().nullable()
6020
6913
  }).strict();
6021
6914
  var ProvenanceSchema = z3.enum(["parent_attributed", "env_correlated", "self_reported", "unavailable"]);
@@ -6053,7 +6946,17 @@ var HeaderMetaV3Schema = z3.object({
6053
6946
  runtime: z3.string().nullable(),
6054
6947
  source: z3.string().nullable()
6055
6948
  }).strict();
6056
- var HeaderMetaSchema = z3.discriminatedUnion("schema", [HeaderMetaV1Schema, HeaderMetaV2Schema, HeaderMetaV3Schema]);
6949
+ var HeaderMetaV4Schema = HeaderMetaV3Schema.extend({
6950
+ schema: z3.literal(4),
6951
+ process: z3.object({ id: z3.string(), version: z3.string().nullable(), digest: z3.string().nullable() }).strict(),
6952
+ runner: z3.object({ id: z3.string(), version: z3.string().nullable() }).strict()
6953
+ }).strict();
6954
+ var HeaderMetaSchema = z3.discriminatedUnion("schema", [
6955
+ HeaderMetaV1Schema,
6956
+ HeaderMetaV2Schema,
6957
+ HeaderMetaV3Schema,
6958
+ HeaderMetaV4Schema
6959
+ ]);
6057
6960
  var SubjectSchema = z3.object({
6058
6961
  issue: z3.number().int().nullable(),
6059
6962
  pr: z3.number().int().optional(),
@@ -6273,6 +7176,75 @@ var DevReviewLoopEventSchema = z3.discriminatedUnion("event", [
6273
7176
  round: z3.number().int(),
6274
7177
  phase: z3.string()
6275
7178
  }).strict(),
7179
+ z3.object({
7180
+ ...loopShared,
7181
+ event: z3.literal("conflict_reentry"),
7182
+ task: z3.number().int(),
7183
+ pr: z3.number().int().positive(),
7184
+ attempt: z3.number().int().positive(),
7185
+ bound: z3.number().int().positive()
7186
+ }).strict(),
7187
+ z3.object({
7188
+ ...loopShared,
7189
+ event: z3.literal("storage_push"),
7190
+ round: z3.number().int(),
7191
+ branch: z3.string(),
7192
+ head: z3.string()
7193
+ }).strict(),
7194
+ z3.object({
7195
+ ...loopShared,
7196
+ event: z3.literal("local_checks_run"),
7197
+ round: z3.number().int(),
7198
+ head: z3.string().nullable(),
7199
+ passed: z3.boolean(),
7200
+ wall_ms: z3.number().nonnegative()
7201
+ }).strict(),
7202
+ z3.object({
7203
+ ...loopShared,
7204
+ event: z3.literal("ready_push"),
7205
+ round: z3.number().int(),
7206
+ head: z3.string(),
7207
+ outcome: z3.enum(["passed", "refused"]),
7208
+ selected: z3.number().int().nonnegative(),
7209
+ failed: z3.number().int().nonnegative(),
7210
+ rerun: z3.boolean(),
7211
+ wall_ms: z3.number().nonnegative()
7212
+ }).strict(),
7213
+ z3.object({
7214
+ ...loopShared,
7215
+ event: z3.literal("failed_tests_rerun"),
7216
+ round: z3.number().int(),
7217
+ head: z3.string(),
7218
+ rerun_of: z3.string(),
7219
+ failed_files: z3.number().int().nonnegative(),
7220
+ affected_files: z3.number().int().nonnegative(),
7221
+ full_count: z3.number().int().nonnegative()
7222
+ }).strict(),
7223
+ z3.object({
7224
+ ...loopShared,
7225
+ event: z3.literal("pr_opened"),
7226
+ round: z3.number().int(),
7227
+ pr: z3.number().int().positive(),
7228
+ head: z3.string()
7229
+ }).strict(),
7230
+ z3.object({
7231
+ ...loopShared,
7232
+ event: z3.literal("ci_result_read"),
7233
+ round: z3.number().int(),
7234
+ pr: z3.number().int().positive(),
7235
+ head: z3.string(),
7236
+ conclusion: z3.enum(["green", "red", "pending", "skipped"]),
7237
+ failing_checks: z3.array(z3.string()),
7238
+ wait_ms: z3.number().nonnegative()
7239
+ }).strict(),
7240
+ z3.object({
7241
+ ...loopShared,
7242
+ event: z3.literal("phase_time"),
7243
+ round: z3.number().int(),
7244
+ phase: z3.enum(["developer", "local_checks", "review", "push", "ci", "other"]),
7245
+ step: z3.string(),
7246
+ wall_ms: z3.number().nonnegative()
7247
+ }).strict(),
6276
7248
  z3.object({
6277
7249
  ...loopShared,
6278
7250
  event: z3.literal("driver_exited"),
@@ -6460,7 +7432,7 @@ var EffectEventSchema = z3.discriminatedUnion("event", [
6460
7432
  ]);
6461
7433
  var CustomFieldValueSchema = z3.union([z3.string().max(CUSTOM_TEXT_MAX_LENGTH), z3.number().finite(), z3.boolean()]);
6462
7434
  var customShared = {
6463
- meta: HeaderMetaV3Schema,
7435
+ meta: HeaderMetaSchema,
6464
7436
  subject: SubjectSchema,
6465
7437
  kind: z3.literal("custom"),
6466
7438
  ...envelopeTail
@@ -6545,7 +7517,7 @@ function buildHeader(input) {
6545
7517
  const issue = subject.issue;
6546
7518
  return {
6547
7519
  meta: {
6548
- schema: 3,
7520
+ schema: 4,
6549
7521
  ts: input.now.toISOString(),
6550
7522
  run_id: input.runId,
6551
7523
  seq: input.seq,
@@ -6563,23 +7535,34 @@ function buildHeader(input) {
6563
7535
  parent: lineageFieldFromEnv(input.env.parent)
6564
7536
  },
6565
7537
  input_versions: {
7538
+ manifest_version: input.inputVersions?.manifestVersion ?? null,
6566
7539
  objectives_version: input.inputVersions?.objectivesVersion ?? null,
6567
7540
  brief_hash: input.inputVersions?.briefHash ?? null,
6568
7541
  ruling_ordinal: input.inputVersions?.rulingOrdinal ?? null,
7542
+ pause_bound_ruling: input.inputVersions?.pauseBoundRuling ?? null,
6569
7543
  policy_digest: input.inputVersions?.policyDigest ?? null
6570
7544
  },
6571
7545
  provenance: provenanceFor(input),
6572
7546
  work: {
6573
7547
  ref: lineageFieldFromEnv(input.env.workRef) ?? (issue === null ? null : String(issue)),
6574
7548
  repo: input.repo,
6575
- change: null,
6576
- revision: null
7549
+ change: pr === undefined ? null : String(pr),
7550
+ revision: input.revision ?? null
6577
7551
  },
6578
7552
  flow: {
6579
7553
  id: lineageFieldFromEnv(input.env.flow) ?? "vinaya",
6580
7554
  version: lineageFieldFromEnv(input.env.flowVersion)
6581
7555
  },
6582
7556
  runtime: lineageFieldFromEnv(input.env.runtime),
7557
+ process: {
7558
+ id: lineageFieldFromEnv(input.env.processId) ?? "vinaya",
7559
+ version: lineageFieldFromEnv(input.env.processVersion),
7560
+ digest: lineageFieldFromEnv(input.env.processDigest)
7561
+ },
7562
+ runner: {
7563
+ id: lineageFieldFromEnv(input.env.runnerId) ?? "standalone",
7564
+ version: lineageFieldFromEnv(input.env.runnerVersion)
7565
+ },
6583
7566
  source: lineageFieldFromEnv(input.env.source)
6584
7567
  },
6585
7568
  subject
@@ -6623,7 +7606,7 @@ function redact(value, home) {
6623
7606
  return value;
6624
7607
  }
6625
7608
  // ../../packages/aeg-core/src/log/store.ts
6626
- var KNOWN_SCHEMA_VERSIONS = [1, 2, 3];
7609
+ var KNOWN_SCHEMA_VERSIONS = [1, 2, 3, 4];
6627
7610
  function metaOf(obj) {
6628
7611
  if (obj === null || typeof obj !== "object")
6629
7612
  return null;
@@ -6761,6 +7744,12 @@ var ManifestRecordSchema = z4.object({
6761
7744
  briefHash: z4.string().min(1).nullable(),
6762
7745
  objectivesVersion: z4.string().min(1).nullable(),
6763
7746
  rulingOrdinal: epochNumber,
7747
+ manifestVersion: z4.literal(2).optional(),
7748
+ pauseBoundRuling: z4.object({
7749
+ rulingId: z4.string().min(1),
7750
+ pauseId: z4.string().min(1),
7751
+ contentDigest: z4.string().min(1)
7752
+ }).strict().nullable().optional(),
6764
7753
  policyDigest: z4.string().min(1),
6765
7754
  recordedAt: isoTimestamp
6766
7755
  }).strict();
@@ -6782,7 +7771,11 @@ var LoopStateRecordSchema = z4.object({
6782
7771
  deliveredFindings: roundHeadIdentity.nullable(),
6783
7772
  repeatMemory: z4.object({
6784
7773
  blockingFindings: z4.array(z4.string()),
6785
- lastFailure: z4.object({ signature: z4.string(), message: z4.string() }).nullable()
7774
+ lastFailure: z4.object({ signature: z4.string(), message: z4.string(), developerAttemptedSince: z4.boolean().optional() }).nullable()
7775
+ }).strict().optional(),
7776
+ developerHandoff: z4.object({
7777
+ findings: z4.array(z4.object({ id: z4.string().min(1), description: z4.string().min(1) }).strict()),
7778
+ failingChecks: z4.array(z4.string().min(1))
6786
7779
  }).strict().optional(),
6787
7780
  publicationExpectedBase: z4.string().regex(/^[0-9a-f]{40}$/).nullable().optional(),
6788
7781
  taskStartedAt: isoTimestamp.optional(),
@@ -6837,6 +7830,16 @@ var ResolutionRecordSchema = z4.object({
6837
7830
  authenticatedFrom: z4.string().min(1),
6838
7831
  consumedAt: isoTimestamp
6839
7832
  }).strict();
7833
+ var ExecutionRoundMirrorRecordSchema = z4.object({
7834
+ version: z4.literal(1),
7835
+ kind: z4.literal("execution_round"),
7836
+ task: taskId,
7837
+ repository: z4.string().min(1),
7838
+ threadId: z4.string().min(1),
7839
+ checkpointId: z4.string().min(1),
7840
+ round: z4.number().int().positive(),
7841
+ recordedAt: isoTimestamp
7842
+ }).strict();
6840
7843
  // ../../packages/aeg-core/src/control-store/local.ts
6841
7844
  var CONTROL_AREA_DIRNAME = "control";
6842
7845
  // src/lib/init-hook-paths.ts
@@ -6885,11 +7888,7 @@ function findCrossingFiles(candidateFiles) {
6885
7888
  import { readFileSync as readFileSync4 } from "node:fs";
6886
7889
  import { join as join2, relative } from "node:path";
6887
7890
 
6888
- // src/lib/test-selector.ts
6889
- import { readdirSync as readdirSync2, readFileSync as readFileSync3, statSync as statSync2 } from "node:fs";
6890
- import { dirname, extname as extname2, isAbsolute, join, resolve } from "node:path";
6891
-
6892
- // src/lib/repo-scanner-tests.ts
7891
+ // src/lib/verification/scanner-inputs.ts
6893
7892
  var TREE_READERS = new Set([
6894
7893
  "readdirSync",
6895
7894
  "readdir",
@@ -6901,8 +7900,56 @@ var TREE_READERS = new Set([
6901
7900
  ]);
6902
7901
  var SPAWN_CALLS = new Set(["execFileSync", "execSync", "spawnSync", "spawn", "exec", "execFile"]);
6903
7902
  var PROCESS_CALLS = new Set([...SPAWN_CALLS, "fork"]);
7903
+ // src/lib/verification/selector.ts
7904
+ import { readdirSync as readdirSync2, readFileSync as readFileSync3, statSync as statSync2 } from "node:fs";
7905
+ import { dirname, extname as extname2, isAbsolute, join, resolve } from "node:path";
6904
7906
 
6905
- // src/lib/test-selector.ts
7907
+ // src/lib/verification/inventory.ts
7908
+ var READER_KINDS = new Set(["code", "raw-bytes", "semantic", "parsed-keys", "schema-policy"]);
7909
+ var EDGE_KINDS = new Set([
7910
+ "import",
7911
+ "preload",
7912
+ "runner-config",
7913
+ "lockfile",
7914
+ "fixture",
7915
+ "schema",
7916
+ "doc",
7917
+ "config",
7918
+ "spawn",
7919
+ "scan",
7920
+ "provider"
7921
+ ]);
7922
+ var POLICY_KINDS = new Set(["always-run", "mandatory", "security", "oracle"]);
7923
+ var RUNNERS = new Set(["bun", "vitest"]);
7924
+
7925
+ // src/lib/verification/selector.ts
7926
+ function diskTree(root) {
7927
+ return {
7928
+ root,
7929
+ readDir: (path) => {
7930
+ try {
7931
+ return readdirSync2(path);
7932
+ } catch {
7933
+ return null;
7934
+ }
7935
+ },
7936
+ kind: (path) => {
7937
+ try {
7938
+ return statSync2(path).isDirectory() ? "directory" : "file";
7939
+ } catch {
7940
+ return null;
7941
+ }
7942
+ },
7943
+ readFile: (path) => {
7944
+ try {
7945
+ return readFileSync3(path, "utf8");
7946
+ } catch {
7947
+ return null;
7948
+ }
7949
+ }
7950
+ };
7951
+ }
7952
+ var MAX_BATCH_BLOB_BYTES = 4 << 20;
6906
7953
  var SOURCE_EXTENSIONS = [".ts", ".tsx", ".mts", ".cts", ".js", ".jsx", ".mjs", ".cjs"];
6907
7954
  var SKIP_DIRS = new Set(["node_modules", "dist", ".git", "build", "coverage"]);
6908
7955
  var OUTPUT_TO_SOURCE_EXTENSIONS = new Map([
@@ -6977,26 +8024,20 @@ function collectRecords(source, includeExportFrom) {
6977
8024
  function extractImportRecords(source) {
6978
8025
  return collectRecords(source, true);
6979
8026
  }
6980
- function walkFiles(root) {
8027
+ function walkTree(tree, root) {
6981
8028
  const out = [];
6982
- let entries;
6983
- try {
6984
- entries = readdirSync2(root);
6985
- } catch {
8029
+ const entries = tree.readDir(root);
8030
+ if (entries === null)
6986
8031
  return out;
6987
- }
6988
8032
  for (const entry of entries) {
6989
8033
  if (SKIP_DIRS.has(entry))
6990
8034
  continue;
6991
8035
  const abs = join(root, entry);
6992
- let s;
6993
- try {
6994
- s = statSync2(abs);
6995
- } catch {
8036
+ const kind = tree.kind(abs);
8037
+ if (kind === null)
6996
8038
  continue;
6997
- }
6998
- if (s.isDirectory()) {
6999
- out.push(...walkFiles(abs));
8039
+ if (kind === "directory") {
8040
+ out.push(...walkTree(tree, abs));
7000
8041
  } else {
7001
8042
  out.push(abs);
7002
8043
  }
@@ -7029,6 +8070,13 @@ function resolveRelativeImport(fromFile, specifier, knownFiles) {
7029
8070
  return resolveFileCandidate(resolve(dirname(fromFile), specifier), knownFiles);
7030
8071
  }
7031
8072
  var TYPE_ONLY_CONDITIONS = new Set(["types", "typings"]);
8073
+ var PACKAGE_TEST_DATA_FOLDERS = new Set(["tests", "test", "__tests__", "specs", "fixtures"]);
8074
+ var PACKAGE_PROSE_FILE_NAMES = new Set(["README.md", "CHANGELOG.md", "LICENSE"]);
8075
+
8076
+ // src/lib/test-selector.ts
8077
+ function walkFiles(root) {
8078
+ return walkTree(diskTree(root), root);
8079
+ }
7032
8080
 
7033
8081
  // src/lib/log-producer-graph.ts
7034
8082
  var CLI_SOURCE_DIR = "apps/cli/src";
@@ -7048,7 +8096,6 @@ var G7_EXEMPTIONS = {
7048
8096
  "packages/aeg-core/bin/check-branch-topology.ts": NOT_REACHED_STANDALONE_SCRIPT,
7049
8097
  "packages/aeg-core/bin/check-push-target.ts": NOT_REACHED_STANDALONE_SCRIPT,
7050
8098
  "packages/aeg-core/bin/check-first-push-dispatch.ts": NOT_REACHED_STANDALONE_SCRIPT,
7051
- "packages/aeg-core/bin/assign-task-issue.ts": NOT_REACHED_STANDALONE_SCRIPT,
7052
8099
  "packages/aeg-core/src/brief-validation.ts": "a pure library outside the CLI package: it makes no call of its own, and the import resolution does not follow a workspace package"
7053
8100
  };
7054
8101
  function blockingGateFiles(ring0Rows, existsFn) {
@@ -7121,6 +8168,7 @@ var REGISTRY = [
7121
8168
  {
7122
8169
  name: "brief-shape",
7123
8170
  validates: "body",
8171
+ requiresOpenPr: true,
7124
8172
  run: bin("check-brief-shape"),
7125
8173
  scope: "diff",
7126
8174
  timeoutMs: 15000,
@@ -7129,7 +8177,9 @@ var REGISTRY = [
7129
8177
  BRANCH: { optional: true },
7130
8178
  PR_NUMBER: { optional: true },
7131
8179
  GITHUB_TOKEN: { optional: true },
7132
- GH_TOKEN: { optional: true }
8180
+ GH_TOKEN: { optional: true },
8181
+ VINAYA_FORGE_SNAPSHOT_DIR: { optional: true },
8182
+ GITHUB_ACTIONS: { optional: true }
7133
8183
  }
7134
8184
  },
7135
8185
  0
@@ -7138,6 +8188,7 @@ var REGISTRY = [
7138
8188
  {
7139
8189
  name: "pr-report-density",
7140
8190
  validates: "body",
8191
+ requiresOpenPr: true,
7141
8192
  run: bin("check-pr-report-density"),
7142
8193
  scope: "diff",
7143
8194
  timeoutMs: 15000,
@@ -7163,7 +8214,9 @@ var REGISTRY = [
7163
8214
  PR_NUMBER: { optional: true },
7164
8215
  GITHUB_REPOSITORY: { optional: true },
7165
8216
  GITHUB_TOKEN: { optional: true },
7166
- GH_TOKEN: { optional: true }
8217
+ GH_TOKEN: { optional: true },
8218
+ VINAYA_FORGE_SNAPSHOT_DIR: { optional: true },
8219
+ GITHUB_ACTIONS: { optional: true }
7167
8220
  }
7168
8221
  },
7169
8222
  0
@@ -7187,6 +8240,7 @@ var REGISTRY = [
7187
8240
  {
7188
8241
  name: "pr-premise-reassert",
7189
8242
  validates: "body",
8243
+ requiresOpenPr: true,
7190
8244
  run: bin("check-pr-premise-reassert"),
7191
8245
  scope: "diff",
7192
8246
  timeoutMs: 15000,
@@ -7207,7 +8261,9 @@ var REGISTRY = [
7207
8261
  BRANCH: { optional: true },
7208
8262
  GITHUB_TOKEN: { optional: true },
7209
8263
  GH_TOKEN: { optional: true },
7210
- PREMISE_FILE: { optional: true }
8264
+ PREMISE_FILE: { optional: true },
8265
+ VINAYA_FORGE_SNAPSHOT_DIR: { optional: true },
8266
+ GITHUB_ACTIONS: { optional: true }
7211
8267
  }
7212
8268
  },
7213
8269
  0
@@ -7259,7 +8315,9 @@ var REGISTRY = [
7259
8315
  PR_BODY: { optional: true },
7260
8316
  PR_BODY_FILE: { optional: true },
7261
8317
  GITHUB_TOKEN: { optional: true },
7262
- GH_TOKEN: { optional: true }
8318
+ GH_TOKEN: { optional: true },
8319
+ VINAYA_FORGE_SNAPSHOT_DIR: { optional: true },
8320
+ GITHUB_ACTIONS: { optional: true }
7263
8321
  }
7264
8322
  },
7265
8323
  1
@@ -7275,7 +8333,13 @@ var REGISTRY = [
7275
8333
  principalOwed: true,
7276
8334
  env: {
7277
8335
  PR_BODY: { optional: true },
7278
- BRANCH: { optional: true }
8336
+ BRANCH: { optional: true },
8337
+ PULL_REQUEST_HEAD_SHA: { optional: true },
8338
+ GITHUB_REPOSITORY: { optional: true },
8339
+ GITHUB_TOKEN: { optional: true },
8340
+ GH_TOKEN: { optional: true },
8341
+ VINAYA_FORGE_SNAPSHOT_DIR: { optional: true },
8342
+ GITHUB_ACTIONS: { optional: true }
7279
8343
  }
7280
8344
  },
7281
8345
  1
@@ -7291,7 +8355,13 @@ var REGISTRY = [
7291
8355
  ownWorkflow: true,
7292
8356
  env: {
7293
8357
  PR_BODY: { optional: true },
7294
- BRANCH: { optional: true }
8358
+ BRANCH: { optional: true },
8359
+ PULL_REQUEST_HEAD_SHA: { optional: true },
8360
+ GITHUB_REPOSITORY: { optional: true },
8361
+ GITHUB_TOKEN: { optional: true },
8362
+ GH_TOKEN: { optional: true },
8363
+ VINAYA_FORGE_SNAPSHOT_DIR: { optional: true },
8364
+ GITHUB_ACTIONS: { optional: true }
7295
8365
  }
7296
8366
  },
7297
8367
  1
@@ -7310,7 +8380,9 @@ var REGISTRY = [
7310
8380
  PR_NUMBER: { optional: true },
7311
8381
  GITHUB_REPOSITORY: { optional: true },
7312
8382
  GITHUB_TOKEN: { optional: true },
7313
- GH_TOKEN: { optional: true }
8383
+ GH_TOKEN: { optional: true },
8384
+ VINAYA_FORGE_SNAPSHOT_DIR: { optional: true },
8385
+ GITHUB_ACTIONS: { optional: true }
7314
8386
  }
7315
8387
  },
7316
8388
  1
@@ -7350,7 +8422,9 @@ var REGISTRY = [
7350
8422
  PR_NUMBER: { optional: true },
7351
8423
  GITHUB_REPOSITORY: { optional: true },
7352
8424
  GITHUB_TOKEN: { optional: true },
7353
- GH_TOKEN: { optional: true }
8425
+ GH_TOKEN: { optional: true },
8426
+ VINAYA_FORGE_SNAPSHOT_DIR: { optional: true },
8427
+ GITHUB_ACTIONS: { optional: true }
7354
8428
  }
7355
8429
  },
7356
8430
  1
@@ -7403,12 +8477,15 @@ var REGISTRY = [
7403
8477
  {
7404
8478
  name: "doc-coverage-push",
7405
8479
  validates: "body",
8480
+ advisory: true,
7406
8481
  run: bin("check-doc-coverage-push"),
7407
8482
  scope: "diff",
7408
8483
  timeoutMs: 15000,
7409
8484
  env: {
7410
8485
  OVERRIDE_DOCS: { optional: true },
7411
8486
  BASE_SHA: { optional: true },
8487
+ GIT_INDEX_FILE: { optional: true },
8488
+ VINAYA_COMMIT_HOOK: { optional: true },
7412
8489
  PR_BODY: { optional: true },
7413
8490
  PR_BODY_FILE: { optional: true },
7414
8491
  PR_LABELS: { optional: true },
@@ -7420,21 +8497,6 @@ var REGISTRY = [
7420
8497
  },
7421
8498
  0
7422
8499
  ],
7423
- [
7424
- {
7425
- name: "issue-assignment",
7426
- run: bin("check-issue-assignment"),
7427
- scope: "full",
7428
- timeoutMs: 30000,
7429
- env: {
7430
- AEG_REPO: { optional: true },
7431
- BRANCH: { optional: true },
7432
- GITHUB_TOKEN: { optional: true },
7433
- GH_TOKEN: { optional: true }
7434
- }
7435
- },
7436
- 0
7437
- ],
7438
8500
  [
7439
8501
  {
7440
8502
  name: "evidence-fresh",
@@ -7448,7 +8510,9 @@ var REGISTRY = [
7448
8510
  PR_BODY: { optional: true },
7449
8511
  BASE_SHA: { optional: true },
7450
8512
  GITHUB_TOKEN: { optional: true },
7451
- GH_TOKEN: { optional: true }
8513
+ GH_TOKEN: { optional: true },
8514
+ VINAYA_FORGE_SNAPSHOT_DIR: { optional: true },
8515
+ GITHUB_ACTIONS: { optional: true }
7452
8516
  }
7453
8517
  },
7454
8518
  1
@@ -7459,7 +8523,11 @@ var REGISTRY = [
7459
8523
  run: bin("check-reader-resolvable-prose"),
7460
8524
  scope: "full",
7461
8525
  timeoutMs: 30000,
7462
- env: {},
8526
+ env: {
8527
+ BASE_SHA: { optional: true },
8528
+ GIT_INDEX_FILE: { optional: true },
8529
+ VINAYA_COMMIT_HOOK: { optional: true }
8530
+ },
7463
8531
  include: [
7464
8532
  "aeg-root/**/*.md",
7465
8533
  "apps/cli/src/**",
@@ -7477,7 +8545,11 @@ var REGISTRY = [
7477
8545
  run: bin("check-retired-vocabulary"),
7478
8546
  scope: "full",
7479
8547
  timeoutMs: 30000,
7480
- env: {},
8548
+ env: {
8549
+ BASE_SHA: { optional: true },
8550
+ GIT_INDEX_FILE: { optional: true },
8551
+ VINAYA_COMMIT_HOOK: { optional: true }
8552
+ },
7481
8553
  include: ["aeg-root/**/*.md"]
7482
8554
  },
7483
8555
  0
@@ -7485,10 +8557,15 @@ var REGISTRY = [
7485
8557
  [
7486
8558
  {
7487
8559
  name: "doctrine-portability",
8560
+ advisory: true,
7488
8561
  run: bin("check-doctrine-portability"),
7489
8562
  scope: "full",
7490
8563
  timeoutMs: 30000,
7491
- env: { BASE_SHA: { optional: true } },
8564
+ env: {
8565
+ BASE_SHA: { optional: true },
8566
+ GIT_INDEX_FILE: { optional: true },
8567
+ VINAYA_COMMIT_HOOK: { optional: true }
8568
+ },
7492
8569
  include: ["aeg-root/**/*.md"]
7493
8570
  },
7494
8571
  0
@@ -7521,7 +8598,11 @@ var REGISTRY = [
7521
8598
  run: bin("check-exec-bits"),
7522
8599
  scope: "diff",
7523
8600
  timeoutMs: 30000,
7524
- env: {}
8601
+ env: {
8602
+ BASE_SHA: { optional: true },
8603
+ GIT_INDEX_FILE: { optional: true },
8604
+ VINAYA_COMMIT_HOOK: { optional: true }
8605
+ }
7525
8606
  },
7526
8607
  0
7527
8608
  ],
@@ -7531,17 +8612,26 @@ var REGISTRY = [
7531
8612
  run: bin("check-ci-shard-coverage"),
7532
8613
  scope: "diff",
7533
8614
  timeoutMs: 15000,
7534
- env: {}
8615
+ env: {
8616
+ BASE_SHA: { optional: true },
8617
+ GIT_INDEX_FILE: { optional: true },
8618
+ VINAYA_COMMIT_HOOK: { optional: true }
8619
+ }
7535
8620
  },
7536
8621
  0
7537
8622
  ],
7538
8623
  [
7539
8624
  {
7540
8625
  name: "workspace-escape",
8626
+ advisory: true,
7541
8627
  run: bin("check-workspace-escape"),
7542
8628
  scope: "full",
7543
8629
  timeoutMs: 30000,
7544
- env: {},
8630
+ env: {
8631
+ BASE_SHA: { optional: true },
8632
+ GIT_INDEX_FILE: { optional: true },
8633
+ VINAYA_COMMIT_HOOK: { optional: true }
8634
+ },
7545
8635
  include: ["aeg-root/**/*.md"]
7546
8636
  },
7547
8637
  0
@@ -7552,17 +8642,23 @@ var REGISTRY = [
7552
8642
  run: bin("check-changeset-coverage"),
7553
8643
  scope: "diff",
7554
8644
  timeoutMs: 15000,
7555
- env: {}
8645
+ env: {
8646
+ BASE_SHA: { optional: true },
8647
+ GIT_INDEX_FILE: { optional: true },
8648
+ VINAYA_COMMIT_HOOK: { optional: true }
8649
+ }
7556
8650
  },
7557
8651
  0
7558
8652
  ],
7559
8653
  [
7560
8654
  {
7561
8655
  name: "quoted-command",
8656
+ advisory: true,
7562
8657
  run: bin("check-quoted-command"),
7563
- scope: "diff",
8658
+ scope: "full",
7564
8659
  timeoutMs: 15000,
7565
- env: {}
8660
+ env: {},
8661
+ include: ["aeg-root/**/*.md"]
7566
8662
  },
7567
8663
  0
7568
8664
  ],
@@ -7570,7 +8666,7 @@ var REGISTRY = [
7570
8666
  {
7571
8667
  name: "main-branch-refusal",
7572
8668
  run: bin("check-main-branch-refusal"),
7573
- scope: "full",
8669
+ scope: "diff",
7574
8670
  timeoutMs: 15000,
7575
8671
  env: { VINAYA_PUSH_REFS: { optional: true } }
7576
8672
  },
@@ -7637,18 +8733,6 @@ var REGISTRY = [
7637
8733
  },
7638
8734
  1
7639
8735
  ],
7640
- [
7641
- {
7642
- name: "issue-tranche-label",
7643
- run: bin("check-issue-tranche-label"),
7644
- validates: "issue",
7645
- scope: "full",
7646
- ownWorkflow: true,
7647
- timeoutMs: 15000,
7648
- env: { ISSUE_BODY: { optional: true }, ISSUE_LABELS: { optional: true } }
7649
- },
7650
- 1
7651
- ],
7652
8736
  [
7653
8737
  {
7654
8738
  name: "issue-milestone-attach",