@attalabs/vinaya 0.40.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 (157) hide show
  1. package/aeg-root/contracts/developer-reviewer.md +2 -2
  2. package/aeg-root/contracts/planner-developer.md +4 -4
  3. package/aeg-root/process.md +3 -3
  4. package/aeg-root/roles/developer/reference.md +3 -0
  5. package/aeg-root/state-machine.md +2 -2
  6. package/aeg-root/templates/brief-template.md +1 -1
  7. package/dist/checks/bin/check-body-bare-digits.js +165 -65
  8. package/dist/checks/bin/check-branch-topology.js +169 -60
  9. package/dist/checks/bin/check-brief-shape.js +165 -65
  10. package/dist/checks/bin/check-changeset-coverage.js +342 -122
  11. package/dist/checks/bin/check-ci-shard-coverage.js +384 -130
  12. package/dist/checks/bin/check-closes-n.js +169 -60
  13. package/dist/checks/bin/check-coherence.js +165 -65
  14. package/dist/checks/bin/check-dead-branch-push.js +142 -59
  15. package/dist/checks/bin/check-dispatch-readiness.js +211 -81
  16. package/dist/checks/bin/check-doc-claims.js +165 -65
  17. package/dist/checks/bin/check-doc-coverage-push.js +342 -122
  18. package/dist/checks/bin/check-doc-coverage.js +344 -124
  19. package/dist/checks/bin/check-doctrine-no-procedures.js +165 -65
  20. package/dist/checks/bin/check-doctrine-portability.js +342 -122
  21. package/dist/checks/bin/check-evidence-fresh.js +376 -129
  22. package/dist/checks/bin/check-exec-bits.js +342 -122
  23. package/dist/checks/bin/check-first-push-dispatch.js +208 -78
  24. package/dist/checks/bin/check-issue-milestone-attach.js +142 -59
  25. package/dist/checks/bin/check-issue-objectives-numbering.js +165 -65
  26. package/dist/checks/bin/check-issue-parts-coverage.js +142 -59
  27. package/dist/checks/bin/check-issue-surface-globs.js +218 -88
  28. package/dist/checks/bin/check-issue-title-grammar.js +142 -59
  29. package/dist/checks/bin/check-main-branch-refusal.js +142 -59
  30. package/dist/checks/bin/check-no-disk-state.js +142 -59
  31. package/dist/checks/bin/check-pr-premise-reassert.js +165 -65
  32. package/dist/checks/bin/check-pr-report-density.js +142 -59
  33. package/dist/checks/bin/check-principal-test-plan-wait.js +165 -65
  34. package/dist/checks/bin/check-quoted-command.js +338 -118
  35. package/dist/checks/bin/check-reader-resolvable-prose.js +338 -118
  36. package/dist/checks/bin/check-registry-gates.js +206 -78
  37. package/dist/checks/bin/check-retired-vocabulary.js +338 -118
  38. package/dist/checks/bin/check-review-gate.js +203 -83
  39. package/dist/checks/bin/check-single-plan-pr.js +142 -59
  40. package/dist/checks/bin/check-surface-scope.js +169 -60
  41. package/dist/checks/bin/check-test-plan.js +165 -65
  42. package/dist/checks/bin/check-token-collection-wired.js +142 -59
  43. package/dist/checks/bin/check-workspace-escape.js +340 -120
  44. package/dist/checks/bin/verify-coherence.js +153 -60
  45. package/dist/checks/bin/verify-dispatch.js +169 -69
  46. package/dist/checks/bin/verify-docs.js +142 -57
  47. package/dist/index.js +16280 -11764
  48. package/dist/lib/pre-push-cache-test-run.js +791 -68
  49. package/dist/lib/pre-push-changed-files.js +65 -19
  50. package/dist/lib/pre-push-mode.js +466 -0
  51. package/dist/lib/pre-push-progress-dir.js +4205 -0
  52. package/dist/lib/pre-push-record-tests.js +446 -0
  53. package/dist/lib/pre-push-select-tests.js +1426 -454
  54. package/dist/lib/push-progress-observer.js +4213 -0
  55. package/package.json +11 -5
  56. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/anchored-region.ts +5 -2
  57. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/brief-render.ts +18 -4
  58. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/brief-validation.ts +3 -3
  59. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/coherence-checks.ts +2 -2
  60. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/control-store/local.ts +88 -5
  61. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/control-store/records.ts +34 -2
  62. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/assess-round.ts +26 -4
  63. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/fakes.ts +7 -2
  64. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/index.ts +7 -1
  65. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/types.ts +17 -2
  66. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dispatch-gate.ts +13 -17
  67. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/docs/index.ts +1 -1
  68. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/docs/published-prose.ts +70 -45
  69. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/gate-audience.ts +1 -4
  70. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/index.ts +77 -7
  71. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/issue-assignment.ts +24 -54
  72. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/issue-validation.ts +221 -56
  73. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/live-record.ts +179 -0
  74. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/envelope.ts +8 -2
  75. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/index.ts +1 -0
  76. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/narration.ts +1 -0
  77. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/schema-digest.ts +225 -0
  78. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/schema.ts +7 -1
  79. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/main-branch-refusal.ts +23 -1
  80. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/principals-config.ts +44 -0
  81. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/prose-rules.ts +532 -0
  82. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/protected-paths.ts +31 -0
  83. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/reader-resolvable-prose.ts +157 -80
  84. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/registry-checks.ts +8 -12
  85. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/retired-vocabulary.ts +52 -109
  86. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/review-gate.ts +46 -17
  87. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/review-input-manifest.ts +85 -1
  88. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/ruling-ordinal.ts +46 -0
  89. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/task-branch-identity.ts +2 -4
  90. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/test-plan-gate.ts +63 -8
  91. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/verdict-extraction.ts +24 -0
  92. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/waiver-label.ts +0 -1
  93. package/studio-standalone/apps/vinaya-studio/web/.next/BUILD_ID +1 -1
  94. package/studio-standalone/apps/vinaya-studio/web/.next/build-manifest.json +3 -3
  95. package/studio-standalone/apps/vinaya-studio/web/.next/prerender-manifest.json +3 -3
  96. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.html +1 -1
  97. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.rsc +1 -1
  98. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  99. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  100. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  101. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  102. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  103. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_not-found/page/server-reference-manifest.json +2 -2
  104. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_not-found/page.js.nft.json +1 -1
  105. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  106. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/page/server-reference-manifest.json +2 -2
  107. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/page.js.nft.json +1 -1
  108. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/page_client-reference-manifest.js +1 -1
  109. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/backlog/page/server-reference-manifest.json +2 -2
  110. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/backlog/page.js.nft.json +1 -1
  111. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/backlog/page_client-reference-manifest.js +1 -1
  112. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/page/server-reference-manifest.json +2 -2
  113. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/page.js.nft.json +1 -1
  114. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/page_client-reference-manifest.js +1 -1
  115. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/page/server-reference-manifest.json +2 -2
  116. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/page.js.nft.json +1 -1
  117. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/page_client-reference-manifest.js +1 -1
  118. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/page/server-reference-manifest.json +3 -3
  119. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/page.js.nft.json +1 -1
  120. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/page_client-reference-manifest.js +1 -1
  121. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/tasks/[taskId]/page/server-reference-manifest.json +2 -2
  122. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/tasks/[taskId]/page.js.nft.json +1 -1
  123. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/tasks/[taskId]/page_client-reference-manifest.js +1 -1
  124. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/page/server-reference-manifest.json +2 -2
  125. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/page.js.nft.json +1 -1
  126. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/page_client-reference-manifest.js +1 -1
  127. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/tranches/page/server-reference-manifest.json +2 -2
  128. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/tranches/page.js.nft.json +1 -1
  129. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/tranches/page_client-reference-manifest.js +1 -1
  130. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/1q96_modules_@clerk_nextjs_dist_esm_app-router_client_keyless-creator-reader_0lom2js.js +1 -1
  131. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__08e39jo._.js +1 -1
  132. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__0ls23oh._.js +1 -1
  133. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__1a3j3n1._.js +1 -1
  134. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/{[root-of-the-server]__1wzfiav._.js → [root-of-the-server]__1d4eth3._.js} +1 -1
  135. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__1gjqmhq._.js +1 -1
  136. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__1snpgaw._.js +3 -3
  137. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__1wc4-ip._.js +1 -1
  138. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_08onyya._.js +2 -2
  139. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_096f46i._.js +1 -1
  140. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0af2one._.js +1 -1
  141. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0e5tkdd._.js +1 -1
  142. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0kf2g72._.js +1 -1
  143. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0zf4d27._.js +3 -3
  144. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_1-wo68i._.js +1 -1
  145. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_1achbh9._.js +1 -1
  146. 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
  147. package/studio-standalone/apps/vinaya-studio/web/.next/server/middleware-build-manifest.js +3 -3
  148. package/studio-standalone/apps/vinaya-studio/web/.next/server/pages/500.html +1 -1
  149. package/studio-standalone/apps/vinaya-studio/web/.next/server/server-reference-manifest.js +1 -1
  150. package/studio-standalone/apps/vinaya-studio/web/.next/server/server-reference-manifest.json +4 -4
  151. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/{38kom-9c-oi65.js → 0x7u6si-ai179.js} +1 -1
  152. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/{1p3vr9qts86_b.js → 2fu7mfsj4oima.js} +1 -1
  153. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/{21tunzmxjvm2a.js → 34b4ruddunn3q.js} +1 -1
  154. package/studio-standalone/apps/vinaya-studio/web/package.json +2 -2
  155. /package/studio-standalone/apps/vinaya-studio/web/.next/static/{Y3oaZSTSP9PivUuJvxK1W → 2ZARxTwpuRew8-SvYsRdU}/_buildManifest.js +0 -0
  156. /package/studio-standalone/apps/vinaya-studio/web/.next/static/{Y3oaZSTSP9PivUuJvxK1W → 2ZARxTwpuRew8-SvYsRdU}/_clientMiddlewareManifest.js +0 -0
  157. /package/studio-standalone/apps/vinaya-studio/web/.next/static/{Y3oaZSTSP9PivUuJvxK1W → 2ZARxTwpuRew8-SvYsRdU}/_ssgManifest.js +0 -0
@@ -783,10 +783,11 @@ function trancheSlugsFromLabels(labels) {
783
783
  }
784
784
  return slugs;
785
785
  }
786
- async function indexTrancheMilestonesAsync(owner, repo) {
786
+ async function indexTrancheMilestonesAsync(owner, repo, options = {}) {
787
+ const read = (fetch) => options.retryFailedReads ? retryOnce(fetch) : fetch();
787
788
  const [milestones, labels] = await Promise.all([
788
- ghApiGetAllPagesAsync(`repos/${owner}/${repo}/milestones?state=all&per_page=100`),
789
- ghApiGetAllPagesAsync(`repos/${owner}/${repo}/labels?per_page=100`)
789
+ read(() => ghApiGetAllPagesAsync(`repos/${owner}/${repo}/milestones?state=all&per_page=100`)),
790
+ read(() => ghApiGetAllPagesAsync(`repos/${owner}/${repo}/labels?per_page=100`))
790
791
  ]);
791
792
  const active = [];
792
793
  const archived = [];
@@ -797,9 +798,16 @@ async function indexTrancheMilestonesAsync(owner, repo) {
797
798
  const uniqueNewPathSlugs = [...new Set(newPathSlugs)];
798
799
  const uniqueLegacySlugs = [...legacySlugs];
799
800
  const [legacyIssuesBySlug, newPathIssuesBySlug] = await Promise.all([
800
- Promise.all(uniqueLegacySlugs.map((slug) => ghIssueListByLabelAsync(owner, repo, trancheLabel(slug)))),
801
- Promise.all(uniqueNewPathSlugs.map((slug) => ghIssueListByLabelAsync(owner, repo, trancheLabel(slug))))
801
+ Promise.all(uniqueLegacySlugs.map((slug) => read(() => ghIssueListByLabelAsync(owner, repo, trancheLabel(slug))))),
802
+ Promise.all(uniqueNewPathSlugs.map((slug) => read(() => ghIssueListByLabelAsync(owner, repo, trancheLabel(slug)))))
802
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
+ });
803
811
  uniqueLegacySlugs.forEach((slug, i) => {
804
812
  const m = legacyMilestoneBySlug.get(slug);
805
813
  if (!m)
@@ -823,7 +831,14 @@ async function indexTrancheMilestonesAsync(owner, repo) {
823
831
  else if (lifecycle === "complete")
824
832
  archived.push({ slug, goal });
825
833
  });
826
- return { active, archived, facts, legacySlugs };
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
+ }
827
842
  }
828
843
  async function indexTrancheMilestonesForSlugAsync(owner, repo, slug) {
829
844
  const [milestones, labels, issues] = await Promise.all([
@@ -1868,15 +1883,16 @@ function describeError(err) {
1868
1883
  }
1869
1884
  // ../../packages/aeg-forge-state/src/prior-tranche-archival.ts
1870
1885
  function defaultPriorTrancheArchivalDeps() {
1871
- let facts = new Map;
1872
1886
  return {
1873
- activeTrancheSlugs: async (excludeSlug, repo) => {
1874
- const index = await indexTrancheMilestonesAsync(repo.owner, repo.repo);
1875
- facts = index.facts;
1876
- return index.active.map((m) => m.slug).filter((slug) => slug !== excludeSlug);
1877
- },
1878
- deriveTranche: (slug, repo) => deriveTrancheFromForge(repo.owner, repo.repo, slug, facts.get(slug)),
1879
- openIssues: async (slug, repo) => (await fetchTrancheIssuesAsync(repo.owner, repo.repo, slug)).filter((issue) => issue.state === "OPEN").map((issue) => ({ number: issue.number }))
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
+ }
1880
1896
  };
1881
1897
  }
1882
1898
  function reason(err) {
@@ -1888,61 +1904,28 @@ async function resolvePriorTrancheArchival(projects, excludeSlug, repo, deps = d
1888
1904
  return { facts: [], infraFailure: null };
1889
1905
  let candidates;
1890
1906
  try {
1891
- candidates = await deps.activeTrancheSlugs(excludeSlug, repo);
1907
+ candidates = await deps.activeTranches(excludeSlug, repo);
1892
1908
  } catch (err) {
1893
1909
  return {
1894
1910
  facts: [],
1895
1911
  infraFailure: `severity:infra — could not read the active tranches (${reason(err)}); whether a prior tranche is archived is unknown.`
1896
1912
  };
1897
1913
  }
1914
+ const tasksBySlug = new Map(candidates.map((c) => [c.slug, tasksFromIssues(c.issues)]));
1898
1915
  const facts = [];
1899
- const unreadable = [];
1900
- const derived = new Map;
1901
- const derive = (slug) => {
1902
- let p = derived.get(slug);
1903
- if (!p) {
1904
- p = deps.deriveTranche(slug, repo);
1905
- derived.set(slug, p);
1906
- }
1907
- return p;
1908
- };
1909
1916
  for (const project of projects) {
1910
1917
  let found = null;
1911
- let unknown = false;
1912
- for (const slug of candidates) {
1913
- let candidateTranche;
1914
- try {
1915
- candidateTranche = await derive(slug);
1916
- } catch {
1917
- unknown = true;
1918
- unreadable.push(`the tasks of tranche \`${slug}\` (project \`${project}\`)`);
1919
- break;
1920
- }
1921
- if (!candidateTranche.tasks.some((t) => t.projects.includes(project)))
1918
+ for (const { slug, issues } of candidates) {
1919
+ if (!(tasksBySlug.get(slug) ?? []).some((t) => t.projects.includes(project)))
1922
1920
  continue;
1923
- let openIssues;
1924
- try {
1925
- openIssues = await deps.openIssues(slug, repo);
1926
- } catch {
1927
- openIssues = null;
1928
- }
1929
- if (openIssues === null) {
1930
- unknown = true;
1931
- unreadable.push(`the open Issues of tranche \`${slug}\` (project \`${project}\`)`);
1932
- break;
1933
- }
1934
- if (openIssues.length === 0) {
1921
+ if (!issues.some((issue) => issue.state === "OPEN")) {
1935
1922
  found = { project, priorTrancheSlug: slug, archived: false };
1936
1923
  break;
1937
1924
  }
1938
1925
  }
1939
- if (!unknown)
1940
- facts.push(found ?? { project, priorTrancheSlug: null, archived: false });
1926
+ facts.push(found ?? { project, priorTrancheSlug: null, archived: false });
1941
1927
  }
1942
- return {
1943
- facts,
1944
- infraFailure: unreadable.length === 0 ? null : `severity:infra — could not read ${unreadable.join(", ")}; whether a prior tranche is archived is unknown.`
1945
- };
1928
+ return { facts, infraFailure: null };
1946
1929
  }
1947
1930
  // ../../packages/aeg-forge-state/src/fetch-open-issues.ts
1948
1931
  async function fetchOpenIssuesByLabel(slugs, owner, repo, token) {
@@ -2768,11 +2751,13 @@ var CODE_REVIEW_SEVERITY_ORDER = ["BLOCKER", "MAJOR", "MINOR"];
2768
2751
  var SECURITY_SEVERITY_ORDER = ["CRITICAL", "HIGH", "MEDIUM", "LOW"];
2769
2752
  var DEFAULT_MAX_ROUNDS = 3;
2770
2753
  var DEFAULT_MAX_TASK_MINUTES = 180;
2754
+ var DEFAULT_READY_PUSH_TIMEOUT_MINUTES = 20;
2771
2755
  var DEFAULT_REVIEW_POLICY = {
2772
2756
  codeReviewThreshold: "BLOCKER",
2773
2757
  securityThreshold: "HIGH",
2774
2758
  maxRounds: DEFAULT_MAX_ROUNDS,
2775
- maxTaskMinutes: DEFAULT_MAX_TASK_MINUTES
2759
+ maxTaskMinutes: DEFAULT_MAX_TASK_MINUTES,
2760
+ readyPushTimeoutMinutes: DEFAULT_READY_PUSH_TIMEOUT_MINUTES
2776
2761
  };
2777
2762
  var FILE_SHAPED_LOCATION = /\.[a-zA-Z0-9]{1,10}(:\d+)?\s*$/;
2778
2763
  var PROSE_LOCATION_PATTERNS = [/\bpr\s*body\b/i, /\bcomment\b/i];
@@ -6961,7 +6946,17 @@ var HeaderMetaV3Schema = z3.object({
6961
6946
  runtime: z3.string().nullable(),
6962
6947
  source: z3.string().nullable()
6963
6948
  }).strict();
6964
- 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
+ ]);
6965
6960
  var SubjectSchema = z3.object({
6966
6961
  issue: z3.number().int().nullable(),
6967
6962
  pr: z3.number().int().optional(),
@@ -7181,6 +7176,75 @@ var DevReviewLoopEventSchema = z3.discriminatedUnion("event", [
7181
7176
  round: z3.number().int(),
7182
7177
  phase: z3.string()
7183
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(),
7184
7248
  z3.object({
7185
7249
  ...loopShared,
7186
7250
  event: z3.literal("driver_exited"),
@@ -7368,7 +7432,7 @@ var EffectEventSchema = z3.discriminatedUnion("event", [
7368
7432
  ]);
7369
7433
  var CustomFieldValueSchema = z3.union([z3.string().max(CUSTOM_TEXT_MAX_LENGTH), z3.number().finite(), z3.boolean()]);
7370
7434
  var customShared = {
7371
- meta: HeaderMetaV3Schema,
7435
+ meta: HeaderMetaSchema,
7372
7436
  subject: SubjectSchema,
7373
7437
  kind: z3.literal("custom"),
7374
7438
  ...envelopeTail
@@ -7453,7 +7517,7 @@ function buildHeader(input) {
7453
7517
  const issue = subject.issue;
7454
7518
  return {
7455
7519
  meta: {
7456
- schema: 3,
7520
+ schema: 4,
7457
7521
  ts: input.now.toISOString(),
7458
7522
  run_id: input.runId,
7459
7523
  seq: input.seq,
@@ -7490,6 +7554,15 @@ function buildHeader(input) {
7490
7554
  version: lineageFieldFromEnv(input.env.flowVersion)
7491
7555
  },
7492
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
+ },
7493
7566
  source: lineageFieldFromEnv(input.env.source)
7494
7567
  },
7495
7568
  subject
@@ -7533,7 +7606,7 @@ function redact(value, home) {
7533
7606
  return value;
7534
7607
  }
7535
7608
  // ../../packages/aeg-core/src/log/store.ts
7536
- var KNOWN_SCHEMA_VERSIONS = [1, 2, 3];
7609
+ var KNOWN_SCHEMA_VERSIONS = [1, 2, 3, 4];
7537
7610
  function metaOf(obj) {
7538
7611
  if (obj === null || typeof obj !== "object")
7539
7612
  return null;
@@ -7757,6 +7830,16 @@ var ResolutionRecordSchema = z4.object({
7757
7830
  authenticatedFrom: z4.string().min(1),
7758
7831
  consumedAt: isoTimestamp
7759
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();
7760
7843
  // ../../packages/aeg-core/src/control-store/local.ts
7761
7844
  var CONTROL_AREA_DIRNAME = "control";
7762
7845
  // src/lib/init-hook-paths.ts
@@ -7805,11 +7888,7 @@ function findCrossingFiles(candidateFiles) {
7805
7888
  import { readFileSync as readFileSync4 } from "node:fs";
7806
7889
  import { join as join2, relative } from "node:path";
7807
7890
 
7808
- // src/lib/test-selector.ts
7809
- import { readdirSync as readdirSync2, readFileSync as readFileSync3, statSync as statSync2 } from "node:fs";
7810
- import { dirname, extname as extname2, isAbsolute, join, resolve } from "node:path";
7811
-
7812
- // src/lib/repo-scanner-tests.ts
7891
+ // src/lib/verification/scanner-inputs.ts
7813
7892
  var TREE_READERS = new Set([
7814
7893
  "readdirSync",
7815
7894
  "readdir",
@@ -7821,8 +7900,56 @@ var TREE_READERS = new Set([
7821
7900
  ]);
7822
7901
  var SPAWN_CALLS = new Set(["execFileSync", "execSync", "spawnSync", "spawn", "exec", "execFile"]);
7823
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";
7824
7906
 
7825
- // 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;
7826
7953
  var SOURCE_EXTENSIONS = [".ts", ".tsx", ".mts", ".cts", ".js", ".jsx", ".mjs", ".cjs"];
7827
7954
  var SKIP_DIRS = new Set(["node_modules", "dist", ".git", "build", "coverage"]);
7828
7955
  var OUTPUT_TO_SOURCE_EXTENSIONS = new Map([
@@ -7897,26 +8024,20 @@ function collectRecords(source, includeExportFrom) {
7897
8024
  function extractImportRecords(source) {
7898
8025
  return collectRecords(source, true);
7899
8026
  }
7900
- function walkFiles(root) {
8027
+ function walkTree(tree, root) {
7901
8028
  const out = [];
7902
- let entries;
7903
- try {
7904
- entries = readdirSync2(root);
7905
- } catch {
8029
+ const entries = tree.readDir(root);
8030
+ if (entries === null)
7906
8031
  return out;
7907
- }
7908
8032
  for (const entry of entries) {
7909
8033
  if (SKIP_DIRS.has(entry))
7910
8034
  continue;
7911
8035
  const abs = join(root, entry);
7912
- let s;
7913
- try {
7914
- s = statSync2(abs);
7915
- } catch {
8036
+ const kind = tree.kind(abs);
8037
+ if (kind === null)
7916
8038
  continue;
7917
- }
7918
- if (s.isDirectory()) {
7919
- out.push(...walkFiles(abs));
8039
+ if (kind === "directory") {
8040
+ out.push(...walkTree(tree, abs));
7920
8041
  } else {
7921
8042
  out.push(abs);
7922
8043
  }
@@ -7949,6 +8070,13 @@ function resolveRelativeImport(fromFile, specifier, knownFiles) {
7949
8070
  return resolveFileCandidate(resolve(dirname(fromFile), specifier), knownFiles);
7950
8071
  }
7951
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
+ }
7952
8080
 
7953
8081
  // src/lib/log-producer-graph.ts
7954
8082
  var CLI_SOURCE_DIR = "apps/cli/src";