@attalabs/vinaya 0.33.0 → 0.35.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 (143) hide show
  1. package/LICENSE +104 -201
  2. package/README.md +1 -1
  3. package/aeg-root/enforcement.md +1 -1
  4. package/aeg-root/glossary.md +4 -0
  5. package/aeg-root/roles/developer.md +3 -0
  6. package/aeg-root/roles/operator.md +30 -10
  7. package/aeg-root/roles/planner/reference.md +3 -2
  8. package/aeg-root/roles/planner.md +3 -1
  9. package/aeg-root/templates/brief-template.md +9 -7
  10. package/aeg-root/templates/pr-report-template.md +3 -1
  11. package/dist/checks/bin/check-body-bare-digits.js +107 -28
  12. package/dist/checks/bin/check-branch-topology.js +94 -25
  13. package/dist/checks/bin/check-brief-shape.js +113 -33
  14. package/dist/checks/bin/check-changeset-coverage.js +369 -92
  15. package/dist/checks/bin/check-closes-n.js +94 -25
  16. package/dist/checks/bin/check-coherence.js +124 -29
  17. package/dist/checks/bin/check-dead-branch-push.js +79 -25
  18. package/dist/checks/bin/check-dispatch-readiness.js +122 -28
  19. package/dist/checks/bin/check-doc-coverage-push.js +365 -88
  20. package/dist/checks/bin/check-doc-coverage.js +367 -90
  21. package/dist/checks/bin/check-doctrine-no-procedures.js +107 -28
  22. package/dist/checks/bin/check-doctrine-portability.js +366 -89
  23. package/dist/checks/bin/check-evidence-fresh.js +338 -61
  24. package/dist/checks/bin/check-exec-bits.js +363 -86
  25. package/dist/checks/bin/check-first-push-dispatch.js +122 -28
  26. package/dist/checks/bin/check-issue-assignment.js +94 -25
  27. package/dist/checks/bin/check-issue-milestone-attach.js +79 -25
  28. package/dist/checks/bin/check-issue-objectives-numbering.js +606 -26
  29. package/dist/checks/bin/check-issue-parts-coverage.js +79 -25
  30. package/dist/checks/bin/check-issue-surface-globs.js +162 -34
  31. package/dist/checks/bin/check-issue-title-grammar.js +79 -25
  32. package/dist/checks/bin/check-issue-tranche-label.js +79 -25
  33. package/dist/checks/bin/check-main-branch-refusal.js +79 -25
  34. package/dist/checks/bin/check-no-disk-state.js +79 -25
  35. package/dist/checks/bin/check-pr-premise-reassert.js +107 -28
  36. package/dist/checks/bin/check-pr-report-density.js +79 -25
  37. package/dist/checks/bin/check-principal-test-plan-wait.js +79 -25
  38. package/dist/checks/bin/check-quoted-command.js +282 -39
  39. package/dist/checks/bin/check-reader-resolvable-prose.js +333 -47
  40. package/dist/checks/bin/check-registry-gates.js +79 -25
  41. package/dist/checks/bin/check-retired-vocabulary.js +282 -39
  42. package/dist/checks/bin/check-review-gate.js +111 -31
  43. package/dist/checks/bin/check-single-plan-pr.js +79 -25
  44. package/dist/checks/bin/check-surface-scope.js +94 -25
  45. package/dist/checks/bin/check-test-plan.js +79 -25
  46. package/dist/checks/bin/check-token-collection-wired.js +79 -25
  47. package/dist/checks/bin/check-token-report.js +79 -25
  48. package/dist/checks/bin/check-workspace-escape.js +364 -87
  49. package/dist/index.js +2713 -1609
  50. package/dist/lib/pre-push-cache-test-run.js +226 -16
  51. package/dist/lib/pre-push-select-tests.js +48 -5
  52. package/package.json +2 -2
  53. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/brief-render.ts +153 -37
  54. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/brief-validation.ts +87 -24
  55. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/coherence-checks.ts +9 -2
  56. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/control-store/migration.ts +13 -3
  57. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/assess-round.ts +7 -0
  58. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/index.ts +5 -2
  59. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/journal-reconstruction.ts +116 -20
  60. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/render-summary.ts +100 -4
  61. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/gate-cutovers.ts +49 -0
  62. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/index.ts +60 -4
  63. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/issue-validation.ts +138 -54
  64. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/envelope.ts +26 -3
  65. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/objectives-cutover-config.ts +31 -0
  66. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/objectives.ts +15 -6
  67. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/reader-resolvable-prose.ts +122 -23
  68. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/review-gate.ts +18 -3
  69. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/review-policy.ts +24 -0
  70. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/review-status.ts +15 -10
  71. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/ruling-ordinal.ts +16 -0
  72. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/task-phase-history.ts +194 -0
  73. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/task-tools.ts +312 -53
  74. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/verdict-extraction.ts +62 -8
  75. package/studio-standalone/apps/vinaya-studio/web/.next/BUILD_ID +1 -1
  76. package/studio-standalone/apps/vinaya-studio/web/.next/build-manifest.json +3 -3
  77. package/studio-standalone/apps/vinaya-studio/web/.next/prerender-manifest.json +3 -3
  78. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.html +1 -1
  79. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.rsc +1 -1
  80. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  81. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  82. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  83. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  84. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  85. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_not-found/page/server-reference-manifest.json +2 -2
  86. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_not-found/page.js.nft.json +1 -1
  87. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  88. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/api/coherence/route.js.nft.json +1 -1
  89. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/page/server-reference-manifest.json +2 -2
  90. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/page.js.nft.json +1 -1
  91. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/page_client-reference-manifest.js +1 -1
  92. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/backlog/page/server-reference-manifest.json +2 -2
  93. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/backlog/page.js.nft.json +1 -1
  94. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/backlog/page_client-reference-manifest.js +1 -1
  95. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/page/server-reference-manifest.json +2 -2
  96. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/page.js.nft.json +1 -1
  97. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/page_client-reference-manifest.js +1 -1
  98. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/page/server-reference-manifest.json +2 -2
  99. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/page.js.nft.json +1 -1
  100. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/page_client-reference-manifest.js +1 -1
  101. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/page/server-reference-manifest.json +3 -3
  102. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/page.js.nft.json +1 -1
  103. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/page_client-reference-manifest.js +1 -1
  104. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/tasks/[taskId]/page/server-reference-manifest.json +2 -2
  105. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/tasks/[taskId]/page.js.nft.json +1 -1
  106. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/tasks/[taskId]/page_client-reference-manifest.js +1 -1
  107. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/page/server-reference-manifest.json +2 -2
  108. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/page.js.nft.json +1 -1
  109. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/page_client-reference-manifest.js +1 -1
  110. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/tranches/page/server-reference-manifest.json +2 -2
  111. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/tranches/page.js.nft.json +1 -1
  112. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/tranches/page_client-reference-manifest.js +1 -1
  113. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/[root-of-the-server]__02a-3g8._.js +4 -4
  114. 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
  115. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__074w9nf._.js +1 -1
  116. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__0ls23oh._.js +1 -1
  117. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/{[root-of-the-server]__18paley._.js → [root-of-the-server]__0zc_0gx._.js} +1 -1
  118. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__1gjqmhq._.js +1 -1
  119. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__1wc4-ip._.js +1 -1
  120. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_08onyya._.js +1 -1
  121. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_096f46i._.js +1 -1
  122. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0af2one._.js +1 -1
  123. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0e5tkdd._.js +1 -1
  124. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0kf2g72._.js +1 -1
  125. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0zf4d27._.js +1 -1
  126. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_1-wo68i._.js +1 -1
  127. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_15gdg48._.js +2 -2
  128. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_1achbh9._.js +1 -1
  129. 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
  130. package/studio-standalone/apps/vinaya-studio/web/.next/server/middleware-build-manifest.js +3 -3
  131. package/studio-standalone/apps/vinaya-studio/web/.next/server/pages/500.html +1 -1
  132. package/studio-standalone/apps/vinaya-studio/web/.next/server/server-reference-manifest.js +1 -1
  133. package/studio-standalone/apps/vinaya-studio/web/.next/server/server-reference-manifest.json +4 -4
  134. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/0ko698wh8xx2g.css +1 -0
  135. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/{22s44f5k3ecmj.js → 3goaig_rysc6p.js} +1 -1
  136. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/{1ce2dj27_cgbj.js → 3ip5z3cf43bgo.js} +4 -4
  137. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/{34hhdtbp20krb.js → 3u9emqjwpd0t9.js} +1 -1
  138. package/studio-standalone/apps/vinaya-studio/web/package.json +2 -2
  139. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/0bm4nrrzwc7zi.css +0 -1
  140. /package/studio-standalone/_node_modules/@attalabs/vinaya/studio-standalone/_node_modules/@attalabs/vinaya/studio-standalone/_node_modules/@attalabs/vinaya/studio-standalone/_node_modules/@attalabs/vinaya/studio-standalone/_node_modules/@attalabs/vinaya/studio-standalone/_node_modules/@attalabs/{aeg-core → vinaya/studio-standalone/_node_modules/@attalabs/vinaya/studio-standalone/_node_modules/@attalabs/aeg-core}/bin/verify-coherence.ts +0 -0
  141. /package/studio-standalone/apps/vinaya-studio/web/.next/static/{vl7QVqELe1AQ-9kaOd9mR → ca66rAHI_w9D7S7ceXDvR}/_buildManifest.js +0 -0
  142. /package/studio-standalone/apps/vinaya-studio/web/.next/static/{vl7QVqELe1AQ-9kaOd9mR → ca66rAHI_w9D7S7ceXDvR}/_clientMiddlewareManifest.js +0 -0
  143. /package/studio-standalone/apps/vinaya-studio/web/.next/static/{vl7QVqELe1AQ-9kaOd9mR → ca66rAHI_w9D7S7ceXDvR}/_ssgManifest.js +0 -0
@@ -197,8 +197,8 @@ function maskIndentedCode(body, fill) {
197
197
  var SECTION_HEADER = /\*\*Dependency rationale\*\*/i;
198
198
  var NEXT_HEADER = /\*\*[A-Z][^*]*\*\*/;
199
199
  var FIELD_LABEL = /^(Depends-on|Conflicts-with)\s*:\s*(.*)$/i;
200
- var ID_TOKEN = /^(?:[\w.-]+\s+)?#?\d+[a-z]?$/i;
201
- var SLUG_QUALIFIED_ID = /^([\w.-]+)\s+(#?\d+[a-z]?)$/i;
200
+ var ID_TOKEN = /^(?:[\w.-]+\s+)?#?\d+$/i;
201
+ var SLUG_QUALIFIED_ID = /^([\w.-]+)\s+(#?\d+)$/i;
202
202
  function splitSlugQualifiedEdge(edge) {
203
203
  const m = edge.trim().match(SLUG_QUALIFIED_ID);
204
204
  if (!m)
@@ -2619,7 +2619,7 @@ function isIssueNotFoundError(err) {
2619
2619
  return /could not resolve to an (?:issue|pull request)|\b404\b|not found/i.test(haystack);
2620
2620
  }
2621
2621
  function resolveObjectivesSource(prBody, issue, cutoverIssue) {
2622
- if (issue !== null && issue < cutoverIssue)
2622
+ if (issue !== null && cutoverIssue !== null && issue < cutoverIssue)
2623
2623
  return { kind: "none" };
2624
2624
  if (issue !== null)
2625
2625
  return { kind: "issue", issue };
@@ -2895,9 +2895,18 @@ var COMMIT_TYPES = [
2895
2895
  ];
2896
2896
  var COMMIT_TYPE_STYLE = new RegExp(`^(${COMMIT_TYPES.join("|")})(\\([a-z0-9-]+\\))?: \\S`);
2897
2897
  function checkForgeTitle(title) {
2898
- const taskStyle = /^\[[a-z0-9._-]+\] \S+ — \S/;
2898
+ const taskStyle = /^\[[a-z0-9._-]+\] \d+ — \S/;
2899
2899
  if (COMMIT_TYPE_STYLE.test(title) || taskStyle.test(title))
2900
2900
  return { status: "pass", errors: [] };
2901
+ const letteredTaskId = /^\[[a-z0-9._-]+\] (\S+) — \S/.exec(title);
2902
+ if (letteredTaskId) {
2903
+ return {
2904
+ status: "fail",
2905
+ errors: [
2906
+ `brief-validation title: "${title}" names task id \`${letteredTaskId[1]}\` — task ids are whole numbers (\`1\`, \`2\`), never lettered (\`2a\`). \`vinaya task run\` and \`task dispatch\` refuse a non-numeric id, so a plan titled this way names a task that cannot be started.`
2907
+ ]
2908
+ };
2909
+ }
2901
2910
  return {
2902
2911
  status: "fail",
2903
2912
  errors: [
@@ -2930,19 +2939,31 @@ function checkNoAgentBoxes(prBody) {
2930
2939
  ]
2931
2940
  };
2932
2941
  }
2933
- function rolloutThresholdFor(message) {
2942
+ function rolloutRuleFor(message) {
2934
2943
  if (message.startsWith("brief-validation unpinned code claim:") || message.startsWith("brief-validation commands carry output:") || message.startsWith("brief-validation consumer tests:") || message.startsWith("brief-validation defeat cases:")) {
2935
- return BRIEF_RULES_SINCE_PR;
2944
+ return "briefRules";
2936
2945
  }
2937
2946
  if (message.startsWith("brief-validation no agent boxes:"))
2938
- return AGENT_BOXES_REFUSED_SINCE_PR;
2947
+ return "agentBoxes";
2939
2948
  return null;
2940
2949
  }
2941
- function partitionBriefErrorsByRollout(errors, prNumber) {
2950
+ var DEFAULT_BRIEF_ROLLOUT_CUTOVERS = {
2951
+ briefRulesSincePr: BRIEF_RULES_SINCE_PR,
2952
+ agentBoxesRefusedSincePr: AGENT_BOXES_REFUSED_SINCE_PR
2953
+ };
2954
+ function rolloutThresholdFor(message, cutovers) {
2955
+ const rule = rolloutRuleFor(message);
2956
+ if (rule === "briefRules")
2957
+ return cutovers.briefRulesSincePr;
2958
+ if (rule === "agentBoxes")
2959
+ return cutovers.agentBoxesRefusedSincePr;
2960
+ return null;
2961
+ }
2962
+ function partitionBriefErrorsByRollout(errors, prNumber, cutovers = DEFAULT_BRIEF_ROLLOUT_CUTOVERS) {
2942
2963
  const blocking = [];
2943
2964
  const info = [];
2944
2965
  for (const e of errors) {
2945
- const threshold = rolloutThresholdFor(e);
2966
+ const threshold = rolloutThresholdFor(e, cutovers);
2946
2967
  const grandfathered = threshold !== null && prNumber !== null && prNumber < threshold;
2947
2968
  (grandfathered ? info : blocking).push(e);
2948
2969
  }
@@ -3410,8 +3431,8 @@ function checkIssueRationale(body) {
3410
3431
  return { status: errors.length > 0 ? "fail" : "pass", errors };
3411
3432
  }
3412
3433
  var OBJECTIVES_SINCE_ISSUE = 404;
3413
- function checkIssueObjectives(body, issueNumber) {
3414
- if (issueNumber !== null && issueNumber < OBJECTIVES_SINCE_ISSUE)
3434
+ function checkIssueObjectives(body, issueNumber, sinceIssue = OBJECTIVES_SINCE_ISSUE) {
3435
+ if (sinceIssue !== null && issueNumber !== null && issueNumber < sinceIssue)
3415
3436
  return { status: "pass", errors: [] };
3416
3437
  const result = objectivesOf(body);
3417
3438
  if (result.ok)
@@ -3487,6 +3508,8 @@ function parseIssueSurface(body) {
3487
3508
  function globCoversPath(glob, path) {
3488
3509
  const g = glob.replace(/\/\*\*?$/, "").replace(/\/+$/, "");
3489
3510
  const p = path.replace(/\/+$/, "");
3511
+ if (g === "*")
3512
+ return !p.includes("/");
3490
3513
  return g === p || g.startsWith(`${p}/`) || p.startsWith(`${g}/`);
3491
3514
  }
3492
3515
  function checkSurfaceGlobsResolve(body, resolvesToFile) {
@@ -3856,7 +3879,7 @@ function resolveDepEntry(dep, trancheSlug, issueToEntry, taskToEntry) {
3856
3879
  return issueToEntry.get(Number(issueMatch[1]));
3857
3880
  return taskToEntry.get(`${trancheSlug}/${dep}`) ?? taskToEntry.get(dep);
3858
3881
  }
3859
- function checkR1(issuesBySlug, grandfatheredIssues, registeredNames = []) {
3882
+ function checkR1(issuesBySlug, grandfatheredIssues, registeredNames = [], objectivesSinceIssue) {
3860
3883
  const failures = [];
3861
3884
  for (const [slug, issues] of issuesBySlug) {
3862
3885
  for (const issue of issues) {
@@ -3865,7 +3888,7 @@ function checkR1(issuesBySlug, grandfatheredIssues, registeredNames = []) {
3865
3888
  const errors = [
3866
3889
  ...checkIssueRationale(issue.body).errors,
3867
3890
  ...checkProjectsRegistered(issue.body, issue.labels, registeredNames).errors,
3868
- ...checkIssueObjectives(issue.body, issue.number).errors,
3891
+ ...checkIssueObjectives(issue.body, issue.number, objectivesSinceIssue).errors,
3869
3892
  ...checkPartsCiteDefinedObjectives(issue.body).errors
3870
3893
  ];
3871
3894
  if (errors.length === 0)
@@ -4488,13 +4511,27 @@ var SHIPS_PREFIX = "aeg-root/";
4488
4511
  function shipsArchivePrefix(shipsPrefix) {
4489
4512
  return `${shipsPrefix}tranches/completed/`;
4490
4513
  }
4491
- function isSpecFile2(path) {
4492
- return path.startsWith("apps/") && path.includes("/specs/") && path.endsWith(".md");
4514
+ var DEFAULT_SPEC_PATHS = ["SPEC.md", "CONTEXT.md", "docs/adr"];
4515
+ function normalizeSpecPath(entry) {
4516
+ let out = entry.replace(/\\/g, "/");
4517
+ while (out.startsWith("./"))
4518
+ out = out.slice(2);
4519
+ out = out.replace(/\/{2,}/g, "/");
4520
+ while (out.endsWith("/"))
4521
+ out = out.slice(0, -1);
4522
+ return out;
4523
+ }
4524
+ function isSpecFile2(path, specPaths) {
4525
+ if (path.startsWith("apps/") && path.includes("/specs/") && path.endsWith(".md"))
4526
+ return true;
4527
+ if (!path.endsWith(".md"))
4528
+ return false;
4529
+ return specPaths.some((entry) => isUnderOrEqual(path, normalizeSpecPath(entry)));
4493
4530
  }
4494
4531
  function isClaudeMdFile(path) {
4495
4532
  return path === "CLAUDE.md" || path.endsWith("/CLAUDE.md");
4496
4533
  }
4497
- function classifyProseFile(path, readerFacingPrefix, readerFacingSuffix, shipsPrefix = SHIPS_PREFIX) {
4534
+ function classifyProseFile(path, readerFacingPrefix, readerFacingSuffix, shipsPrefix = SHIPS_PREFIX, specPaths = DEFAULT_SPEC_PATHS) {
4498
4535
  if (path.startsWith(shipsPrefix)) {
4499
4536
  return path.startsWith(shipsArchivePrefix(shipsPrefix)) ? "internal" : "ships";
4500
4537
  }
@@ -4503,7 +4540,7 @@ function classifyProseFile(path, readerFacingPrefix, readerFacingSuffix, shipsPr
4503
4540
  }
4504
4541
  if (isClaudeMdFile(path))
4505
4542
  return "internal";
4506
- if (isSpecFile2(path))
4543
+ if (isSpecFile2(path, specPaths))
4507
4544
  return "spec";
4508
4545
  if (isProductScopeFile(path))
4509
4546
  return "product";
@@ -4532,13 +4569,14 @@ function lineAt(content, index) {
4532
4569
  }
4533
4570
  var FORGE_NUMBER_PATTERN = /#[0-9]{2,4}/g;
4534
4571
  var TRANCHE_SLUG_VN_PATTERN = /[a-z][a-z-]+-v[0-9]/g;
4572
+ var TASK_NUMBER_PATTERN = /(^|[^a-z0-9-])(tasks?[ \t]+#?[0-9]+)/gi;
4535
4573
  function legacySlugPattern(legacySlugs) {
4536
4574
  if (legacySlugs.length === 0)
4537
4575
  return null;
4538
4576
  const alternation = legacySlugs.map((s) => s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")).join("|");
4539
4577
  return new RegExp(`(^|[^a-zA-Z0-9\\n-])(${alternation})([^a-zA-Z0-9\\n-]|$)`, "g");
4540
4578
  }
4541
- function checkUnresolvableReferences(files, readerFacingPrefix, readerFacingSuffix, legacySlugs = [], shipsPrefix = SHIPS_PREFIX, specGrandfather = []) {
4579
+ function checkUnresolvableReferences(files, readerFacingPrefix, readerFacingSuffix, legacySlugs = [], shipsPrefix = SHIPS_PREFIX, specGrandfather = [], specPaths = DEFAULT_SPEC_PATHS) {
4542
4580
  const findings = [];
4543
4581
  const legacyPattern = legacySlugPattern(legacySlugs);
4544
4582
  const grandfathered = new Set(specGrandfather);
@@ -4550,8 +4588,12 @@ function checkUnresolvableReferences(files, readerFacingPrefix, readerFacingSuff
4550
4588
  const productPatterns = [
4551
4589
  { pattern: TRANCHE_SLUG_VN_PATTERN, what: "an internal tranche slug in product code" }
4552
4590
  ];
4591
+ const specPatterns = [
4592
+ ...patterns,
4593
+ { pattern: TASK_NUMBER_PATTERN, what: "a task number", group: 2 }
4594
+ ];
4553
4595
  for (const file of files) {
4554
- const cls = classifyProseFile(file.path, readerFacingPrefix, readerFacingSuffix, shipsPrefix);
4596
+ const cls = classifyProseFile(file.path, readerFacingPrefix, readerFacingSuffix, shipsPrefix, specPaths);
4555
4597
  if (!cls || cls === "internal")
4556
4598
  continue;
4557
4599
  if (cls !== "product" && cls !== "spec" && !SWEPT_CLASSES.has(cls))
@@ -4560,15 +4602,16 @@ function checkUnresolvableReferences(files, readerFacingPrefix, readerFacingSuff
4560
4602
  continue;
4561
4603
  const blocking = cls === "product" || cls === "spec";
4562
4604
  const scrubbed = cls === "product" ? stripNonProseForProduct(file.path, file.content) : stripNonProse(file.path, file.content);
4563
- const patternsToRun = cls === "product" ? productPatterns : patterns;
4605
+ const patternsToRun = cls === "product" ? productPatterns : cls === "spec" ? specPatterns : patterns;
4564
4606
  for (const { pattern, what, group } of patternsToRun) {
4565
4607
  pattern.lastIndex = 0;
4566
4608
  let match = pattern.exec(scrubbed);
4567
4609
  while (match !== null) {
4568
4610
  const cited = group !== undefined ? match[group] ?? match[0] : match[0];
4611
+ const citedIndex = match.index + match[0].indexOf(cited);
4569
4612
  findings.push({
4570
4613
  file: file.path,
4571
- line: lineAt(scrubbed, match.index),
4614
+ line: lineAt(scrubbed, citedIndex),
4572
4615
  message: `references ${what} ("${cited}") a reader outside this repo's tracker cannot resolve`,
4573
4616
  blocking
4574
4617
  });
@@ -4754,9 +4797,9 @@ function checkSourceComments(files, allowlist = []) {
4754
4797
  }
4755
4798
  return findings;
4756
4799
  }
4757
- function checkReaderResolvableProse(files, glossaryTerms, readerFacingPrefix, readerFacingSuffix, legacySlugs = [], shipsPrefix = SHIPS_PREFIX, specGrandfather = []) {
4800
+ function checkReaderResolvableProse(files, glossaryTerms, readerFacingPrefix, readerFacingSuffix, legacySlugs = [], shipsPrefix = SHIPS_PREFIX, specGrandfather = [], specPaths = DEFAULT_SPEC_PATHS) {
4758
4801
  return [
4759
- ...checkUnresolvableReferences(files, readerFacingPrefix, readerFacingSuffix, legacySlugs, shipsPrefix, specGrandfather),
4802
+ ...checkUnresolvableReferences(files, readerFacingPrefix, readerFacingSuffix, legacySlugs, shipsPrefix, specGrandfather, specPaths),
4760
4803
  ...checkUndefinedVocabulary(files, glossaryTerms, readerFacingPrefix, readerFacingSuffix, shipsPrefix)
4761
4804
  ];
4762
4805
  }
@@ -5221,7 +5264,8 @@ var TaskStatusItemSchema = z.object({
5221
5264
  }).merge(ObservedSchema);
5222
5265
  var TaskStatusResultSchema = z.object({
5223
5266
  items: z.array(TaskStatusItemSchema),
5224
- nextCursor: z.string().nullable()
5267
+ nextCursor: z.string().nullable(),
5268
+ table: z.string()
5225
5269
  });
5226
5270
  var RequestedAuthoritySchema = z.enum(["planner", "principal", "operator", "self"]);
5227
5271
  var EscalationInputsSchema = z.object({
@@ -5565,6 +5609,14 @@ function findWorkspaceEscapes(files, knownPaths, workspaceDirs = DEFAULT_WORKSPA
5565
5609
  }
5566
5610
  return findings;
5567
5611
  }
5612
+ // ../../packages/aeg-core/src/gate-cutovers.ts
5613
+ var NO_GATE_CUTOVERS = {
5614
+ objectivesSinceIssue: null,
5615
+ briefSectionsSinceIssue: null,
5616
+ documentationSinceIssue: null,
5617
+ briefRulesSincePr: null,
5618
+ agentBoxesRefusedSincePr: null
5619
+ };
5568
5620
  // ../../packages/aeg-core/src/dev-review-loop/types.ts
5569
5621
  var SEVERITY_COLUMNS = ["blocker", "major", "minor", "critical", "high", "medium", "low"];
5570
5622
  // ../../packages/aeg-core/src/dev-review-loop/journal-reconstruction.ts
@@ -6014,6 +6066,8 @@ function attemptFromEnv(value) {
6014
6066
  function provenanceFor(input) {
6015
6067
  if (input.provenance)
6016
6068
  return input.provenance;
6069
+ if (issueFromTask(input.env.task) === null && (input.branchIssue ?? null) !== null)
6070
+ return "unavailable";
6017
6071
  if (input.env.role || input.env.task)
6018
6072
  return "env_correlated";
6019
6073
  return "unavailable";
@@ -6034,7 +6088,7 @@ function buildHeader(input) {
6034
6088
  const role = isRole(input.env.role) ? input.env.role : "unattributed";
6035
6089
  const round = roundFromEnv(input.env.round);
6036
6090
  const subject = {
6037
- issue: issueFromTask(input.env.task),
6091
+ issue: issueFromTask(input.env.task) ?? input.branchIssue ?? null,
6038
6092
  role,
6039
6093
  ...round !== undefined ? { round } : {},
6040
6094
  ...input.subject ?? {}
@@ -6474,7 +6528,12 @@ var VinayaConfigSchema = z4.object({
6474
6528
  allowlist: z4.array(z4.string().min(1)).optional(),
6475
6529
  severity: z4.enum(["warning", "error"]).optional()
6476
6530
  }).optional(),
6477
- specGrandfather: z4.array(z4.string().min(1)).optional()
6531
+ specGrandfather: z4.array(z4.string().min(1)).optional(),
6532
+ specPaths: z4.array(z4.string().min(1).refine((entry) => !entry.startsWith("/") && !/^[A-Za-z]:/.test(entry), {
6533
+ message: "must be a repository-relative path, not an absolute one"
6534
+ }).refine((entry) => !entry.split(/[\\/]/).includes(".."), {
6535
+ message: "must stay inside the repository — no `..` segment"
6536
+ })).optional()
6478
6537
  }).optional(),
6479
6538
  projects: z4.array(ProjectEntrySchema).optional(),
6480
6539
  dispatch: z4.object({
@@ -6488,6 +6547,13 @@ var VinayaConfigSchema = z4.object({
6488
6547
  securityThreshold: z4.string().min(1).optional(),
6489
6548
  maxRounds: z4.number().optional()
6490
6549
  }).optional(),
6550
+ gateCutovers: z4.object({
6551
+ objectivesSinceIssue: z4.number().int().nonnegative().optional(),
6552
+ briefSectionsSinceIssue: z4.number().int().nonnegative().optional(),
6553
+ documentationSinceIssue: z4.number().int().nonnegative().optional(),
6554
+ briefRulesSincePr: z4.number().int().nonnegative().optional(),
6555
+ agentBoxesRefusedSincePr: z4.number().int().nonnegative().optional()
6556
+ }).optional(),
6491
6557
  prePush: z4.object({
6492
6558
  alwaysRun: z4.array(z4.string()).optional()
6493
6559
  }).optional(),
@@ -6625,6 +6691,18 @@ function resolveReviewPolicy(config) {
6625
6691
  maxRounds
6626
6692
  };
6627
6693
  }
6694
+ function resolveGateCutovers(config) {
6695
+ const raw = config?.gateCutovers;
6696
+ if (!raw)
6697
+ return NO_GATE_CUTOVERS;
6698
+ return {
6699
+ objectivesSinceIssue: raw.objectivesSinceIssue ?? null,
6700
+ briefSectionsSinceIssue: raw.briefSectionsSinceIssue ?? null,
6701
+ documentationSinceIssue: raw.documentationSinceIssue ?? null,
6702
+ briefRulesSincePr: raw.briefRulesSincePr ?? null,
6703
+ agentBoxesRefusedSincePr: raw.agentBoxesRefusedSincePr ?? null
6704
+ };
6705
+ }
6628
6706
  function resolveRuntimeDirSetting(config) {
6629
6707
  return config?.runtimeDir ?? null;
6630
6708
  }
@@ -6680,7 +6758,8 @@ async function trustAnchorRepoAsync() {
6680
6758
  try {
6681
6759
  const { stdout } = await execFileAsync4("git", ["remote", "get-url", "origin"], {
6682
6760
  encoding: "utf-8",
6683
- timeout: 1e4
6761
+ timeout: 1e4,
6762
+ killSignal: "SIGKILL"
6684
6763
  });
6685
6764
  return trustAnchorRepoFromRemoteUrl(stdout);
6686
6765
  } catch {
@@ -6741,7 +6820,7 @@ async function ghFetchTrustAnchorConfigAsync() {
6741
6820
  const repo = await trustAnchorRepoAsync();
6742
6821
  if (!repo)
6743
6822
  throw new Error("could not resolve repo identity for the trust-anchor read");
6744
- const { stdout } = await execFileAsync4("gh", ["api", `repos/${repo}/contents/${LOCAL_CONFIG_FILENAME}`, "--jq", ".content"], { encoding: "utf-8", timeout: 1e4 });
6823
+ const { stdout } = await execFileAsync4("gh", ["api", `repos/${repo}/contents/${LOCAL_CONFIG_FILENAME}`, "--jq", ".content"], { encoding: "utf-8", timeout: 1e4, killSignal: "SIGKILL" });
6745
6824
  return stdout;
6746
6825
  }
6747
6826
  function firstLine(err) {