@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
@@ -2,8 +2,8 @@
2
2
 
3
3
  // ../../packages/aeg-core/bin/verify-docs.ts
4
4
  import { execFileSync as execFileSync2, execSync } from "node:child_process";
5
- import { existsSync, readdirSync, readFileSync as readFileSync2 } from "node:fs";
6
- import { join } from "node:path";
5
+ import { existsSync, readdirSync, readFileSync as readFileSync3 } from "node:fs";
6
+ import { join as join2 } from "node:path";
7
7
 
8
8
  // ../../packages/aeg-core/src/docs/parse-doc.ts
9
9
  import matter from "gray-matter";
@@ -190,6 +190,347 @@ function findHeadingLine(lines, pattern) {
190
190
  return null;
191
191
  }
192
192
 
193
+ // ../../packages/aeg-core/src/prose-rules.ts
194
+ var RETIRED_GLOBAL_EXEMPTIONS = [
195
+ "docs/decisions-legacy.md",
196
+ "apps/herald-ai/docs/",
197
+ "apps/vada-ai/docs/",
198
+ "aeg-root/tranches/completed/",
199
+ "packages/aeg-core/src/docs/published-prose",
200
+ "packages/aeg-core/src/retired-vocabulary.test.ts",
201
+ "packages/aeg-core/src/retired-vocabulary.ts",
202
+ "/fixtures/",
203
+ "/node_modules/",
204
+ "/.next/",
205
+ "/.turbo/"
206
+ ];
207
+ var PLAN_ON_DISK_PATTERNS = ["[Tt]opology files?", "aeg-root/tranches/", "aeg-project/"];
208
+ var TRANCHE_MODEL_FILE = "/tranche-model.md";
209
+ var RETIRED_PATTERN_EXEMPTIONS = {
210
+ [String.raw`\bD-[0-9]{3}\b`]: ["./CLAUDE.md"],
211
+ [String.raw`(^|[^-_a-zA-Z0-9])decisions\.md`]: [
212
+ "docs-index.md",
213
+ "apps/vada-ai/specs/legacy/README.md",
214
+ "apps/vada-ai/specs/vada-product-spec.md",
215
+ "apps/vada-ai/web/CLAUDE.md",
216
+ "apps/vada-ai/CLAUDE.md"
217
+ ],
218
+ "decisions-legacy": [
219
+ "packages/aeg-core/src/file-classify.ts",
220
+ "packages/aeg-core/src/file-classify.test.ts",
221
+ "packages/aeg-core/src/pr-tier.test.ts",
222
+ "docs-index.md",
223
+ ".claude/skills/database/SKILL.md",
224
+ ".claude/skills/vada-architecture/SKILL.md",
225
+ "apps/vada-ai/specs/vada-byok-principles.md",
226
+ "apps/vada-ai/web/CLAUDE.md",
227
+ "apps/vada-ai/CLAUDE.md"
228
+ ],
229
+ CONTRADICTION: ["apps/vada-ai/specs/vada-reviewers-spec.md"],
230
+ ...Object.fromEntries(PLAN_ON_DISK_PATTERNS.map((pattern) => [pattern, [TRANCHE_MODEL_FILE]]))
231
+ };
232
+ var retiredPatterns = [
233
+ String.raw`\bD-[0-9]{3}\b`,
234
+ "D-(###|NNN|nnn|xxx)",
235
+ "decision (entry|logged)",
236
+ "decision-log entry",
237
+ "decision log entry",
238
+ "decision log(s|ged|ging)?([^a-z]|$)",
239
+ "decision-log",
240
+ "decision entr",
241
+ "decisions? (are |is )?logged",
242
+ "log entries",
243
+ String.raw`(^|[^-_a-zA-Z0-9])decisions\.md`,
244
+ "decisions-legacy",
245
+ "CONTRADICTION",
246
+ "assumes Tier 3",
247
+ "Lock: ?YES",
248
+ "Lock: ?NO",
249
+ "lock approvals?",
250
+ "approves locks",
251
+ "Conforms to lock",
252
+ "Challenges lock",
253
+ "checkDecisionNumbersFresh",
254
+ String.raw`roles/team-leader\.md`,
255
+ String.raw`\(,`,
256
+ String.raw`,\)`,
257
+ String.raw`\(\.\)`,
258
+ ...PLAN_ON_DISK_PATTERNS
259
+ ];
260
+ var published = [
261
+ ["decision-id", "a decision id", /\bD-\d{3,}\b/],
262
+ ["section-ref", "a section reference", /§/],
263
+ ["forge-number", "a forge number", /#\d+/],
264
+ ["retired-name", "the retired public name", /\bAEG\b/],
265
+ ["tranche-slug", "a tranche slug", /\b[a-z][a-z0-9]*(?:-[a-z0-9]+)+-v\d+\b/],
266
+ [
267
+ "label-vocabulary",
268
+ "forge label vocabulary",
269
+ /(?:vinaya\/)?\b(?:tranche|iteration|tier|needs|waiver|project|aeg):(?![/\s]|$)/
270
+ ],
271
+ ["internal-path", "a repo-internal path", /\b(?:packages|apps|aeg-root|tools|scripts)\//],
272
+ ["internal-path", "a repo-internal path", /\.(?:claude|husky|github)\//],
273
+ [
274
+ "internal-path",
275
+ "a repo-internal file",
276
+ /(?:^|[\s(`"'[])[\w.-]+(?:\/[\w.-]+)*\.(?:ts|tsx|js|jsx|mjs|cjs|sh|ya?ml|json|md)\b/
277
+ ]
278
+ ];
279
+ var DEFAULT_PROSE_RULES = [
280
+ {
281
+ id: "forge-number",
282
+ group: "reader-resolvable",
283
+ scopes: ["ships", "reader-facing", "spec"],
284
+ patterns: { prose: /#[0-9]{2,4}/g },
285
+ flags: ["global"],
286
+ message: "a forge number",
287
+ severity: { ships: "warning", "reader-facing": "warning", spec: "error" },
288
+ exemptions: []
289
+ },
290
+ {
291
+ id: "tranche-slug",
292
+ group: "reader-resolvable",
293
+ scopes: ["ships", "reader-facing", "product", "spec"],
294
+ patterns: { prose: /[a-z][a-z-]+-v[0-9]/g },
295
+ flags: ["global"],
296
+ message: "an internal tranche slug",
297
+ severity: { ships: "warning", "reader-facing": "warning", product: "error", spec: "error" },
298
+ exemptions: []
299
+ },
300
+ {
301
+ id: "task-number",
302
+ group: "reader-resolvable",
303
+ scopes: ["spec"],
304
+ patterns: { prose: /(^|[^a-z0-9-])(tasks?[ \t]+#?[0-9]+)/gi },
305
+ flags: ["global", "ignore-case"],
306
+ message: "a task number",
307
+ severity: { spec: "error" },
308
+ exemptions: []
309
+ },
310
+ {
311
+ id: "source-comment-tranche-slug",
312
+ group: "reader-resolvable",
313
+ scopes: ["source-comment"],
314
+ patterns: { comment: /[a-z0-9]+(?:-[a-z0-9]+)*-v[0-9]+/g },
315
+ flags: ["global"],
316
+ message: "a tranche-slug citation",
317
+ severity: { "source-comment": "warning" },
318
+ exemptions: []
319
+ },
320
+ {
321
+ id: "source-comment-forge-number",
322
+ group: "reader-resolvable",
323
+ scopes: ["source-comment"],
324
+ patterns: { comment: /#[0-9]{2,}/g },
325
+ flags: ["global"],
326
+ message: "a forge-number citation",
327
+ severity: { "source-comment": "warning" },
328
+ exemptions: []
329
+ },
330
+ {
331
+ id: "legacy-batch-name",
332
+ group: "reader-resolvable",
333
+ scopes: ["ships", "reader-facing", "spec"],
334
+ patterns: {},
335
+ flags: ["built-in"],
336
+ message: "an internal tranche slug",
337
+ severity: { ships: "warning", "reader-facing": "warning", spec: "error" },
338
+ exemptions: [],
339
+ builtIn: true
340
+ },
341
+ {
342
+ id: "coined-term",
343
+ group: "reader-resolvable",
344
+ scopes: ["ships", "reader-facing"],
345
+ patterns: {},
346
+ flags: ["built-in"],
347
+ message: "uses coined term without defining it inline or linking the glossary",
348
+ severity: { ships: "warning", "reader-facing": "warning" },
349
+ exemptions: [],
350
+ builtIn: true
351
+ },
352
+ ...retiredPatterns.map((pattern, index) => ({
353
+ id: `retired-vocabulary-${index + 1}`,
354
+ group: "retired-vocabulary",
355
+ scopes: ["repository"],
356
+ patterns: { repository: pattern },
357
+ flags: [],
358
+ message: "retired vocabulary",
359
+ severity: { repository: "error" },
360
+ exemptions: RETIRED_GLOBAL_EXEMPTIONS,
361
+ patternExemptions: RETIRED_PATTERN_EXEMPTIONS
362
+ })),
363
+ ...published.map(([id, message, pattern]) => ({
364
+ id,
365
+ group: "published-prose",
366
+ scopes: ["published"],
367
+ patterns: { published: pattern },
368
+ flags: [],
369
+ message,
370
+ severity: { published: "error" },
371
+ exemptions: [".worktrees/task/<tranche>/<n>", "task/<tranche>/<n>", ".worktrees/"]
372
+ }))
373
+ ];
374
+ var rulesForGroup = (group) => DEFAULT_PROSE_RULES.filter((rule) => rule.group === group);
375
+ var RESOLVABLE_SCOPES = ["ships", "reader-facing", "product", "spec", "source-comment"];
376
+ var RETIRED_SCOPES = ["repository"];
377
+ var CONFIGURABLE_PROSE_SCOPES = [...RESOLVABLE_SCOPES, ...RETIRED_SCOPES];
378
+ function groupOfScope(scope) {
379
+ if (RESOLVABLE_SCOPES.includes(scope))
380
+ return "reader-resolvable";
381
+ if (RETIRED_SCOPES.includes(scope))
382
+ return "retired-vocabulary";
383
+ return;
384
+ }
385
+ var CONFIGURABLE_DEFAULT_RULES = DEFAULT_PROSE_RULES.filter((rule) => rule.group !== "published-prose");
386
+ function normalizeRepoPath(entry) {
387
+ let out = entry.replace(/\\/g, "/");
388
+ while (out.startsWith("./"))
389
+ out = out.slice(2);
390
+ out = out.replace(/\/{2,}/g, "/");
391
+ while (out.endsWith("/"))
392
+ out = out.slice(0, -1);
393
+ return out;
394
+ }
395
+ var RESOLVABLE_RUN_ORDER = [
396
+ "forge-number",
397
+ "tranche-slug",
398
+ "legacy-batch-name",
399
+ "task-number",
400
+ "source-comment-tranche-slug",
401
+ "source-comment-forge-number",
402
+ "coined-term"
403
+ ];
404
+ var REPORT_GROUPS = { "task-number": 2, "legacy-batch-name": 2 };
405
+ function scopeDefaultSeverity(scope, sourceCommentSeverity) {
406
+ if (scope === "source-comment")
407
+ return sourceCommentSeverity ?? "warning";
408
+ if (scope === "repository")
409
+ return "error";
410
+ return "warning";
411
+ }
412
+ function applySeverity(scopes, base, setting) {
413
+ const out = {};
414
+ for (const scope of scopes) {
415
+ const configured = typeof setting === "string" ? setting : setting?.[scope];
416
+ const value = configured ?? base[scope];
417
+ if (value !== undefined)
418
+ out[scope] = value;
419
+ }
420
+ return out;
421
+ }
422
+ function defaultPatternFor(rule) {
423
+ const cache = new Map;
424
+ return (scope) => {
425
+ if (cache.has(scope))
426
+ return cache.get(scope) ?? null;
427
+ const own = rule.patterns[scope] ?? (scope === "source-comment" ? rule.patterns.comment : rule.patterns.prose) ?? Object.values(rule.patterns)[0];
428
+ const compiled = own === undefined ? null : own instanceof RegExp ? own : new RegExp(own);
429
+ cache.set(scope, compiled);
430
+ return compiled;
431
+ };
432
+ }
433
+ function customPatternFor(rule, global) {
434
+ const cache = new Map;
435
+ return (scope) => {
436
+ if (cache.has(scope))
437
+ return cache.get(scope) ?? null;
438
+ const source = rule.patterns?.[scope] ?? rule.pattern;
439
+ const compiled = source === undefined ? null : new RegExp(source, `${rule.flags ?? ""}${global ? "g" : ""}`);
440
+ cache.set(scope, compiled);
441
+ return compiled;
442
+ };
443
+ }
444
+ function resolveProseRules(config = undefined, options = {}) {
445
+ const rules = [];
446
+ const defaults = config?.defaults ?? {};
447
+ for (const rule of CONFIGURABLE_DEFAULT_RULES) {
448
+ const override = defaults[rule.id];
449
+ if (override === "off")
450
+ continue;
451
+ const group = rule.group;
452
+ const scopes = override?.scopes ?? rule.scopes;
453
+ const base = {};
454
+ for (const scope of scopes) {
455
+ base[scope] = scope === "source-comment" ? options.sourceCommentSeverity ?? rule.severity[scope] ?? "warning" : rule.severity[scope] ?? scopeDefaultSeverity(scope, options.sourceCommentSeverity);
456
+ }
457
+ rules.push({
458
+ id: rule.id,
459
+ group,
460
+ custom: false,
461
+ builtIn: rule.builtIn === true,
462
+ scopes,
463
+ message: rule.message,
464
+ severity: applySeverity(scopes, base, override?.severity),
465
+ exempt: override?.exempt ?? [],
466
+ substringExempt: rule.exemptions,
467
+ reportGroup: REPORT_GROUPS[rule.id],
468
+ patternFor: defaultPatternFor(rule)
469
+ });
470
+ }
471
+ for (const rule of config?.custom ?? []) {
472
+ const group = groupOfScope(rule.scopes[0] ?? "") ?? "reader-resolvable";
473
+ const base = {};
474
+ for (const scope of rule.scopes)
475
+ base[scope] = scopeDefaultSeverity(scope, options.sourceCommentSeverity);
476
+ rules.push({
477
+ id: rule.id,
478
+ group,
479
+ custom: true,
480
+ builtIn: false,
481
+ scopes: rule.scopes,
482
+ message: rule.means,
483
+ severity: applySeverity(rule.scopes, base, rule.severity),
484
+ exempt: rule.exempt ?? [],
485
+ substringExempt: [],
486
+ patternFor: customPatternFor(rule, group === "reader-resolvable")
487
+ });
488
+ }
489
+ if (options.decisionRecordsPath !== undefined)
490
+ rules.push(decisionRecordCitationRule(options.decisionRecordsPath));
491
+ const order = (rule) => {
492
+ const at = RESOLVABLE_RUN_ORDER.indexOf(rule.id);
493
+ return rule.custom || at === -1 ? RESOLVABLE_RUN_ORDER.length : at;
494
+ };
495
+ const resolvable = rules.filter((rule) => rule.group === "reader-resolvable");
496
+ const sorted = resolvable.map((rule, index) => ({ rule, index })).sort((a, b) => order(a.rule) - order(b.rule) || a.index - b.index).map(({ rule }) => rule);
497
+ return {
498
+ rules: [...sorted, ...rules.filter((rule) => rule.group === "retired-vocabulary")],
499
+ exempt: config?.exempt ?? [],
500
+ repoRoot: options.repoRoot
501
+ };
502
+ }
503
+ var DEFAULT_PROSE_RULE_SET = resolveProseRules();
504
+ var DECISION_RECORD_CITATION_ID = "decision-record-citation";
505
+ var DECISION_RECORD_CITATION_SCOPES = ["ships", "product", "spec", "source-comment"];
506
+ var DECISION_RECORD_CITATION_MESSAGE = "a decision-record number";
507
+ function escapeRegExp(text) {
508
+ return text.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
509
+ }
510
+ function decisionRecordCitationPattern(decisionRecordsPath) {
511
+ const folder = escapeRegExp(normalizeRepoPath(decisionRecordsPath));
512
+ return new RegExp(String.raw`\bADR[- ]?[0-9]+\b|(?<![A-Za-z0-9_-])${folder}/[0-9]+[A-Za-z0-9._-]*`, "g");
513
+ }
514
+ function decisionRecordCitationRule(decisionRecordsPath) {
515
+ const folder = normalizeRepoPath(decisionRecordsPath);
516
+ const pattern = decisionRecordCitationPattern(folder);
517
+ const severity = {};
518
+ for (const scope of DECISION_RECORD_CITATION_SCOPES)
519
+ severity[scope] = "error";
520
+ return {
521
+ id: DECISION_RECORD_CITATION_ID,
522
+ group: "reader-resolvable",
523
+ custom: false,
524
+ builtIn: false,
525
+ scopes: DECISION_RECORD_CITATION_SCOPES,
526
+ message: DECISION_RECORD_CITATION_MESSAGE,
527
+ severity,
528
+ exempt: [folder],
529
+ substringExempt: [],
530
+ patternFor: () => pattern
531
+ };
532
+ }
533
+
193
534
  // ../../packages/aeg-core/src/docs/published-prose.ts
194
535
  var SHORT_VERSION_HEADING = "The short version";
195
536
  var SHORT_VERSION_MIN_WORDS = 150;
@@ -201,30 +542,24 @@ var CONTRACT_BLOCKS = [
201
542
  "What it does not carry",
202
543
  "How it physically runs"
203
544
  ];
204
- var ALLOWED_MECHANICS = [
205
- ".worktrees/task/<tranche>/<n>",
206
- "task/<tranche>/<n>",
207
- ".worktrees/"
208
- ];
209
- var PROSE_RULES = [
210
- { id: "decision-id", what: "a decision id", pattern: /\bD-\d{3,}\b/ },
211
- { id: "section-ref", what: "a section reference", pattern: /§/ },
212
- { id: "forge-number", what: "a forge number", pattern: /#\d+/ },
213
- { id: "retired-name", what: "the retired public name", pattern: /\bAEG\b/ },
214
- { id: "tranche-slug", what: "a tranche slug", pattern: /\b[a-z][a-z0-9]*(?:-[a-z0-9]+)+-v\d+\b/ },
215
- {
216
- id: "label-vocabulary",
217
- what: "forge label vocabulary",
218
- pattern: /(?:vinaya\/)?\b(?:tranche|iteration|tier|needs|waiver|project|aeg):(?![/\s]|$)/
219
- },
220
- { id: "internal-path", what: "a repo-internal path", pattern: /\b(?:packages|apps|aeg-root|tools|scripts)\// },
221
- { id: "internal-path", what: "a repo-internal path", pattern: /\.(?:claude|husky|github)\// },
222
- {
223
- id: "internal-path",
224
- what: "a repo-internal file",
225
- pattern: /(?:^|[\s(`"'[])[\w.-]+(?:\/[\w.-]+)*\.(?:ts|tsx|js|jsx|mjs|cjs|sh|ya?ml|json|md)\b/
226
- }
227
- ];
545
+ var ALLOWED_MECHANICS = rulesForGroup("published-prose")[0]?.exemptions ?? [];
546
+ var PROSE_RULES = rulesForGroup("published-prose").map((rule) => ({
547
+ id: rule.id,
548
+ what: rule.message,
549
+ pattern: rule.patterns.published
550
+ }));
551
+ function publishedRules(decisionRecordsPath) {
552
+ if (decisionRecordsPath === undefined)
553
+ return PROSE_RULES;
554
+ return [
555
+ ...PROSE_RULES,
556
+ {
557
+ id: DECISION_RECORD_CITATION_ID,
558
+ what: DECISION_RECORD_CITATION_MESSAGE,
559
+ pattern: decisionRecordCitationPattern(decisionRecordsPath)
560
+ }
561
+ ];
562
+ }
228
563
  function blocksFor(relPath) {
229
564
  if (relPath.startsWith("roles/"))
230
565
  return ROLE_BLOCKS;
@@ -249,9 +584,10 @@ function extractShortVersion(body) {
249
584
  function countWords(text) {
250
585
  return text.split(/\s+/).filter(Boolean).length;
251
586
  }
252
- function maskAllowedMechanics(text) {
587
+ function maskAllowedMechanics(text, allow) {
253
588
  let masked = text;
254
- for (const literal of ALLOWED_MECHANICS) {
589
+ const ordered = [...allow].sort((a, b) => b.length - a.length);
590
+ for (const literal of ordered) {
255
591
  masked = masked.split(literal).join(" ");
256
592
  }
257
593
  return masked;
@@ -280,11 +616,11 @@ function enforcementPublishedText(content) {
280
616
  }
281
617
  return out.filter((text) => text.trim().length > 0);
282
618
  }
283
- function checkReadability(where, texts, errors) {
619
+ function checkReadability(where, texts, errors, allow = ALLOWED_MECHANICS, rules = PROSE_RULES) {
284
620
  const seen = new Set;
285
621
  for (const raw of texts) {
286
- const text = maskAllowedMechanics(raw);
287
- for (const rule of PROSE_RULES) {
622
+ const text = maskAllowedMechanics(raw, allow);
623
+ for (const rule of rules) {
288
624
  const match = text.match(rule.pattern);
289
625
  if (!match)
290
626
  continue;
@@ -319,22 +655,23 @@ function checkStructure(relPath, body, blocks, errors) {
319
655
  errors.push(`C7: "${relPath}" short version is ${words} words, over the ${SHORT_VERSION_MAX_WORDS}-word ceiling — state the rule, don't summarise the reference`);
320
656
  }
321
657
  }
322
- function evaluatePublishedProse(entries, surfacedPaths = new Set) {
658
+ function evaluatePublishedProse(entries, surfacedPaths = new Set, allow = ALLOWED_MECHANICS, options = {}) {
323
659
  const errors = [];
324
660
  const notes = [];
661
+ const rules = publishedRules(options.decisionRecordsPath);
325
662
  const surfaced = entries.filter((e) => isSurfacedDoc(e.relPath, e.frontmatter, surfacedPaths));
326
663
  for (const entry of surfaced) {
327
- checkReadability(entry.relPath, [entry.frontmatter.title ?? "", entry.frontmatter.description ?? ""], errors);
664
+ checkReadability(entry.relPath, [entry.frontmatter.title ?? "", entry.frontmatter.description ?? ""], errors, allow, rules);
328
665
  const blocks = blocksFor(entry.relPath);
329
666
  if (blocks) {
330
667
  checkStructure(entry.relPath, entry.body, blocks, errors);
331
668
  const short = extractShortVersion(entry.body);
332
669
  if (short !== null)
333
- checkReadability(entry.relPath, [short], errors);
670
+ checkReadability(entry.relPath, [short], errors, allow, rules);
334
671
  continue;
335
672
  }
336
673
  if (entry.relPath === "enforcement.md") {
337
- checkReadability(entry.relPath, enforcementPublishedText(entry.body), errors);
674
+ checkReadability(entry.relPath, enforcementPublishedText(entry.body), errors, allow, rules);
338
675
  }
339
676
  }
340
677
  if (surfaced.length === 0)
@@ -1078,29 +1415,11 @@ function trancheSlugsFromLabels(labels) {
1078
1415
  }
1079
1416
  return slugs;
1080
1417
  }
1081
- function listActiveTrancheSlugs(owner, repo) {
1082
- const milestones = ghApiGet(`repos/${owner}/${repo}/milestones?state=all&per_page=100`);
1083
- const labels = ghApiGet(`repos/${owner}/${repo}/labels?per_page=100`);
1084
- const slugs = new Set([...slugShapedTitles(milestones), ...trancheSlugsFromLabels(labels)]);
1085
- const active = [];
1086
- for (const slug of slugs) {
1087
- const legacy = matchesLegacyMilestone(milestones, slug);
1088
- const issues = ghIssueListByLabel(owner, repo, trancheLabel(slug));
1089
- if (legacy) {
1090
- const facts = resolveLegacyFacts(legacy, issues);
1091
- if (facts.lifecycle === "active")
1092
- active.push({ slug, goal: facts.goal });
1093
- continue;
1094
- }
1095
- if (lifecycleFromIssues(issues) === "active")
1096
- active.push({ slug, goal: goalFromMilestones(milestones, slug) });
1097
- }
1098
- return active;
1099
- }
1100
- async function indexTrancheMilestonesAsync(owner, repo) {
1418
+ async function indexTrancheMilestonesAsync(owner, repo, options = {}) {
1419
+ const read = (fetch) => options.retryFailedReads ? retryOnce(fetch) : fetch();
1101
1420
  const [milestones, labels] = await Promise.all([
1102
- ghApiGetAllPagesAsync(`repos/${owner}/${repo}/milestones?state=all&per_page=100`),
1103
- ghApiGetAllPagesAsync(`repos/${owner}/${repo}/labels?per_page=100`)
1421
+ read(() => ghApiGetAllPagesAsync(`repos/${owner}/${repo}/milestones?state=all&per_page=100`)),
1422
+ read(() => ghApiGetAllPagesAsync(`repos/${owner}/${repo}/labels?per_page=100`))
1104
1423
  ]);
1105
1424
  const active = [];
1106
1425
  const archived = [];
@@ -1111,9 +1430,16 @@ async function indexTrancheMilestonesAsync(owner, repo) {
1111
1430
  const uniqueNewPathSlugs = [...new Set(newPathSlugs)];
1112
1431
  const uniqueLegacySlugs = [...legacySlugs];
1113
1432
  const [legacyIssuesBySlug, newPathIssuesBySlug] = await Promise.all([
1114
- Promise.all(uniqueLegacySlugs.map((slug) => ghIssueListByLabelAsync(owner, repo, trancheLabel(slug)))),
1115
- Promise.all(uniqueNewPathSlugs.map((slug) => ghIssueListByLabelAsync(owner, repo, trancheLabel(slug))))
1433
+ Promise.all(uniqueLegacySlugs.map((slug) => read(() => ghIssueListByLabelAsync(owner, repo, trancheLabel(slug))))),
1434
+ Promise.all(uniqueNewPathSlugs.map((slug) => read(() => ghIssueListByLabelAsync(owner, repo, trancheLabel(slug)))))
1116
1435
  ]);
1436
+ const issuesBySlug = new Map;
1437
+ uniqueLegacySlugs.forEach((slug, i) => {
1438
+ issuesBySlug.set(slug, legacyIssuesBySlug[i] ?? []);
1439
+ });
1440
+ uniqueNewPathSlugs.forEach((slug, i) => {
1441
+ issuesBySlug.set(slug, newPathIssuesBySlug[i] ?? []);
1442
+ });
1117
1443
  uniqueLegacySlugs.forEach((slug, i) => {
1118
1444
  const m = legacyMilestoneBySlug.get(slug);
1119
1445
  if (!m)
@@ -1137,7 +1463,14 @@ async function indexTrancheMilestonesAsync(owner, repo) {
1137
1463
  else if (lifecycle === "complete")
1138
1464
  archived.push({ slug, goal });
1139
1465
  });
1140
- return { active, archived, facts, legacySlugs };
1466
+ return { active, archived, facts, legacySlugs, issuesBySlug };
1467
+ }
1468
+ async function retryOnce(fetch) {
1469
+ try {
1470
+ return await fetch();
1471
+ } catch {
1472
+ return fetch();
1473
+ }
1141
1474
  }
1142
1475
  async function tranchesAttachedToMilestone(owner, repo, milestoneNumber) {
1143
1476
  const issues = await ghApiGetAllPagesAsync(`repos/${owner}/${repo}/issues?milestone=${milestoneNumber}&state=all`, { jq: "[.[] | {labels: .labels}]" });
@@ -2160,6 +2493,52 @@ function describeError(err) {
2160
2493
  return err;
2161
2494
  return "unknown error";
2162
2495
  }
2496
+ // ../../packages/aeg-forge-state/src/prior-tranche-archival.ts
2497
+ function defaultPriorTrancheArchivalDeps() {
2498
+ return {
2499
+ activeTranches: async (excludeSlug, repo) => {
2500
+ const index = await indexTrancheMilestonesAsync(repo.owner, repo.repo, { retryFailedReads: true });
2501
+ return index.active.filter((m) => m.slug !== excludeSlug).map((m) => {
2502
+ const issues = index.issuesBySlug?.get(m.slug);
2503
+ if (!issues)
2504
+ throw new Error(`the Milestone index holds no Issue list for tranche \`${m.slug}\``);
2505
+ return { slug: m.slug, issues };
2506
+ });
2507
+ }
2508
+ };
2509
+ }
2510
+ function reason(err) {
2511
+ return err instanceof Error ? err.message.split(`
2512
+ `)[0] ?? "failed" : String(err);
2513
+ }
2514
+ async function resolvePriorTrancheArchival(projects, excludeSlug, repo, deps = defaultPriorTrancheArchivalDeps()) {
2515
+ if (projects.length === 0)
2516
+ return { facts: [], infraFailure: null };
2517
+ let candidates;
2518
+ try {
2519
+ candidates = await deps.activeTranches(excludeSlug, repo);
2520
+ } catch (err) {
2521
+ return {
2522
+ facts: [],
2523
+ infraFailure: `severity:infra — could not read the active tranches (${reason(err)}); whether a prior tranche is archived is unknown.`
2524
+ };
2525
+ }
2526
+ const tasksBySlug = new Map(candidates.map((c) => [c.slug, tasksFromIssues(c.issues)]));
2527
+ const facts = [];
2528
+ for (const project of projects) {
2529
+ let found = null;
2530
+ for (const { slug, issues } of candidates) {
2531
+ if (!(tasksBySlug.get(slug) ?? []).some((t) => t.projects.includes(project)))
2532
+ continue;
2533
+ if (!issues.some((issue) => issue.state === "OPEN")) {
2534
+ found = { project, priorTrancheSlug: slug, archived: false };
2535
+ break;
2536
+ }
2537
+ }
2538
+ facts.push(found ?? { project, priorTrancheSlug: null, archived: false });
2539
+ }
2540
+ return { facts, infraFailure: null };
2541
+ }
2163
2542
  // ../../packages/aeg-forge-state/src/fetch-open-issues.ts
2164
2543
  async function fetchOpenIssuesByLabel(slugs, owner, repo, token) {
2165
2544
  const result = new Map;
@@ -2584,7 +2963,6 @@ var DERIVABLE_STATUSES = DERIVED_STATUSES.filter((s) => s !== "backlog");
2584
2963
  // ../../packages/aeg-core/src/waiver-label.ts
2585
2964
  var WAIVER_LABEL = label("waiver-docs");
2586
2965
  var WAIVER_LABEL_REVIEW = label("waiver-review");
2587
- var PRINCIPAL_ALLOWLIST = ["daniboomerang"];
2588
2966
  function isPrincipal(login, principalAllowlist) {
2589
2967
  if (login === null)
2590
2968
  return false;
@@ -3123,6 +3501,19 @@ var NON_PATH_TOP_SEGMENTS = new Set(["origin", "refs", "HEAD", "vinaya", "fix"])
3123
3501
  var SHELL_LANGS = new Set(["", "sh", "bash", "shell", "console"]);
3124
3502
  // ../../packages/aeg-core/src/reader-resolvable-prose.ts
3125
3503
  var SWEPT_CLASSES = new Set(["ships", "reader-facing"]);
3504
+ var readerRules = rulesForGroup("reader-resolvable");
3505
+ var readerPattern = (id, scope = "prose") => {
3506
+ const pattern = readerRules.find((rule) => rule.id === id)?.patterns[scope];
3507
+ if (!(pattern instanceof RegExp))
3508
+ throw new Error(`default prose rule ${id} has no ${scope} pattern`);
3509
+ return pattern;
3510
+ };
3511
+ var FORGE_NUMBER_PATTERN = readerPattern("forge-number");
3512
+ var TRANCHE_SLUG_VN_PATTERN = readerPattern("tranche-slug");
3513
+ var TASK_NUMBER_PATTERN = readerPattern("task-number");
3514
+ var REFERENCE_CLASSES = new Set(["ships", "reader-facing", "product", "spec"]);
3515
+ var SOURCE_COMMENT_TRANCHE_SLUG_PATTERN = readerPattern("source-comment-tranche-slug", "comment");
3516
+ var SOURCE_COMMENT_FORGE_NUMBER_PATTERN = readerPattern("source-comment-forge-number", "comment");
3126
3517
 
3127
3518
  // ../../packages/aeg-core/src/quoted-command.ts
3128
3519
  var QUOTED_COMMAND_SWEPT_CLASSES = new Set(["ships", "reader-facing"]);
@@ -3607,7 +3998,7 @@ function isGrandfathered(isoDate) {
3607
3998
  return isoDate.slice(0, 10) < COHERENCE_ENFORCED_FROM;
3608
3999
  }
3609
4000
  var R1_GRANDFATHERED_ISSUES = new Set([279, 280, 281, 282]);
3610
- function checkA1(entries, principalAllowlist = PRINCIPAL_ALLOWLIST) {
4001
+ function checkA1(entries, principalAllowlist) {
3611
4002
  const failures = [];
3612
4003
  for (const e of entries) {
3613
4004
  if (!e.facts)
@@ -4495,59 +4886,9 @@ function compareToBaseline(current, baseline) {
4495
4886
  };
4496
4887
  }
4497
4888
  // ../../packages/aeg-core/src/retired-vocabulary.ts
4498
- var PLAN_ON_DISK_PATTERNS = ["[Tt]opology files?", "aeg-root/tranches/", "aeg-project/"];
4499
- var RETIRED_PATTERNS = [
4500
- String.raw`\bD-[0-9]{3}\b`,
4501
- "D-(###|NNN|nnn|xxx)",
4502
- "decision (entry|logged)",
4503
- "decision-log entry",
4504
- "decision log entry",
4505
- "decision log(s|ged|ging)?([^a-z]|$)",
4506
- "decision-log",
4507
- "decision entr",
4508
- "decisions? (are |is )?logged",
4509
- "log entries",
4510
- String.raw`decisions\.md`,
4511
- "decisions-legacy",
4512
- "CONTRADICTION",
4513
- "assumes Tier 3",
4514
- "Lock: ?YES",
4515
- "Lock: ?NO",
4516
- "lock approvals?",
4517
- "approves locks",
4518
- "Conforms to lock",
4519
- "Challenges lock",
4520
- "checkDecisionNumbersFresh",
4521
- String.raw`roles/team-leader\.md`,
4522
- String.raw`\(,`,
4523
- String.raw`,\)`,
4524
- String.raw`\(\.\)`,
4525
- ...PLAN_ON_DISK_PATTERNS
4526
- ];
4527
- var TRANCHE_MODEL_FILE = "/tranche-model.md";
4528
- var PATTERN_EXEMPT = {
4529
- [String.raw`\bD-[0-9]{3}\b`]: ["./CLAUDE.md"],
4530
- [String.raw`decisions\.md`]: [
4531
- "docs-index.md",
4532
- "apps/vada-ai/specs/legacy/README.md",
4533
- "apps/vada-ai/specs/vada-product-spec.md",
4534
- "apps/vada-ai/web/CLAUDE.md",
4535
- "apps/vada-ai/CLAUDE.md"
4536
- ],
4537
- "decisions-legacy": [
4538
- "packages/aeg-core/src/file-classify.ts",
4539
- "packages/aeg-core/src/file-classify.test.ts",
4540
- "packages/aeg-core/src/pr-tier.test.ts",
4541
- "docs-index.md",
4542
- ".claude/skills/database/SKILL.md",
4543
- ".claude/skills/vada-architecture/SKILL.md",
4544
- "apps/vada-ai/specs/vada-byok-principles.md",
4545
- "apps/vada-ai/web/CLAUDE.md",
4546
- "apps/vada-ai/CLAUDE.md"
4547
- ],
4548
- CONTRADICTION: ["apps/vada-ai/specs/vada-reviewers-spec.md"],
4549
- ...Object.fromEntries(PLAN_ON_DISK_PATTERNS.map((pattern) => [pattern, [TRANCHE_MODEL_FILE]]))
4550
- };
4889
+ var retiredRules = rulesForGroup("retired-vocabulary");
4890
+ var RETIRED_PATTERNS = retiredRules.map((rule) => rule.patterns.repository);
4891
+ var DEFAULT_PATTERN_OF = new Map(retiredRules.map((rule) => [rule.id, rule.patterns.repository]));
4551
4892
  // ../../packages/aeg-core/src/dispatch-gate.ts
4552
4893
  function isHandClosedByRecognizedPrincipal(dep, principalAllowlist) {
4553
4894
  return dep.issueState === "closed" && dep.stateReason === "completed" && isPrincipal(dep.closedByActor ?? null, principalAllowlist);
@@ -4561,7 +4902,7 @@ function isSelfDependency(dep, task, issue) {
4561
4902
  function checkDispatchReadiness(input) {
4562
4903
  const { trancheSlug, task } = input;
4563
4904
  const taskLabel = `task ${task.id} (tranche ${trancheSlug})`;
4564
- const principalAllowlist = input.principalAllowlist ?? PRINCIPAL_ALLOWLIST;
4905
+ const { principalAllowlist } = input;
4565
4906
  const blockerDetails = [];
4566
4907
  const push = (blockerClass, message) => {
4567
4908
  blockerDetails.push({ class: blockerClass, message });
@@ -4888,9 +5229,11 @@ var LineageSchema = z3.object({
4888
5229
  parent: z3.string().nullable()
4889
5230
  }).strict();
4890
5231
  var InputVersionsSchema = z3.object({
5232
+ manifest_version: z3.literal(2).nullable().optional(),
4891
5233
  objectives_version: z3.string().nullable(),
4892
5234
  brief_hash: z3.string().nullable(),
4893
5235
  ruling_ordinal: z3.number().int().nullable(),
5236
+ pause_bound_ruling: z3.object({ rulingId: z3.string().min(1), pauseId: z3.string().min(1), contentDigest: z3.string().min(1) }).strict().nullable().optional(),
4894
5237
  policy_digest: z3.string().nullable()
4895
5238
  }).strict();
4896
5239
  var ProvenanceSchema = z3.enum(["parent_attributed", "env_correlated", "self_reported", "unavailable"]);
@@ -4928,7 +5271,17 @@ var HeaderMetaV3Schema = z3.object({
4928
5271
  runtime: z3.string().nullable(),
4929
5272
  source: z3.string().nullable()
4930
5273
  }).strict();
4931
- var HeaderMetaSchema = z3.discriminatedUnion("schema", [HeaderMetaV1Schema, HeaderMetaV2Schema, HeaderMetaV3Schema]);
5274
+ var HeaderMetaV4Schema = HeaderMetaV3Schema.extend({
5275
+ schema: z3.literal(4),
5276
+ process: z3.object({ id: z3.string(), version: z3.string().nullable(), digest: z3.string().nullable() }).strict(),
5277
+ runner: z3.object({ id: z3.string(), version: z3.string().nullable() }).strict()
5278
+ }).strict();
5279
+ var HeaderMetaSchema = z3.discriminatedUnion("schema", [
5280
+ HeaderMetaV1Schema,
5281
+ HeaderMetaV2Schema,
5282
+ HeaderMetaV3Schema,
5283
+ HeaderMetaV4Schema
5284
+ ]);
4932
5285
  var SubjectSchema = z3.object({
4933
5286
  issue: z3.number().int().nullable(),
4934
5287
  pr: z3.number().int().optional(),
@@ -5148,6 +5501,75 @@ var DevReviewLoopEventSchema = z3.discriminatedUnion("event", [
5148
5501
  round: z3.number().int(),
5149
5502
  phase: z3.string()
5150
5503
  }).strict(),
5504
+ z3.object({
5505
+ ...loopShared,
5506
+ event: z3.literal("conflict_reentry"),
5507
+ task: z3.number().int(),
5508
+ pr: z3.number().int().positive(),
5509
+ attempt: z3.number().int().positive(),
5510
+ bound: z3.number().int().positive()
5511
+ }).strict(),
5512
+ z3.object({
5513
+ ...loopShared,
5514
+ event: z3.literal("storage_push"),
5515
+ round: z3.number().int(),
5516
+ branch: z3.string(),
5517
+ head: z3.string()
5518
+ }).strict(),
5519
+ z3.object({
5520
+ ...loopShared,
5521
+ event: z3.literal("local_checks_run"),
5522
+ round: z3.number().int(),
5523
+ head: z3.string().nullable(),
5524
+ passed: z3.boolean(),
5525
+ wall_ms: z3.number().nonnegative()
5526
+ }).strict(),
5527
+ z3.object({
5528
+ ...loopShared,
5529
+ event: z3.literal("ready_push"),
5530
+ round: z3.number().int(),
5531
+ head: z3.string(),
5532
+ outcome: z3.enum(["passed", "refused"]),
5533
+ selected: z3.number().int().nonnegative(),
5534
+ failed: z3.number().int().nonnegative(),
5535
+ rerun: z3.boolean(),
5536
+ wall_ms: z3.number().nonnegative()
5537
+ }).strict(),
5538
+ z3.object({
5539
+ ...loopShared,
5540
+ event: z3.literal("failed_tests_rerun"),
5541
+ round: z3.number().int(),
5542
+ head: z3.string(),
5543
+ rerun_of: z3.string(),
5544
+ failed_files: z3.number().int().nonnegative(),
5545
+ affected_files: z3.number().int().nonnegative(),
5546
+ full_count: z3.number().int().nonnegative()
5547
+ }).strict(),
5548
+ z3.object({
5549
+ ...loopShared,
5550
+ event: z3.literal("pr_opened"),
5551
+ round: z3.number().int(),
5552
+ pr: z3.number().int().positive(),
5553
+ head: z3.string()
5554
+ }).strict(),
5555
+ z3.object({
5556
+ ...loopShared,
5557
+ event: z3.literal("ci_result_read"),
5558
+ round: z3.number().int(),
5559
+ pr: z3.number().int().positive(),
5560
+ head: z3.string(),
5561
+ conclusion: z3.enum(["green", "red", "pending", "skipped"]),
5562
+ failing_checks: z3.array(z3.string()),
5563
+ wait_ms: z3.number().nonnegative()
5564
+ }).strict(),
5565
+ z3.object({
5566
+ ...loopShared,
5567
+ event: z3.literal("phase_time"),
5568
+ round: z3.number().int(),
5569
+ phase: z3.enum(["developer", "local_checks", "review", "push", "ci", "other"]),
5570
+ step: z3.string(),
5571
+ wall_ms: z3.number().nonnegative()
5572
+ }).strict(),
5151
5573
  z3.object({
5152
5574
  ...loopShared,
5153
5575
  event: z3.literal("driver_exited"),
@@ -5335,7 +5757,7 @@ var EffectEventSchema = z3.discriminatedUnion("event", [
5335
5757
  ]);
5336
5758
  var CustomFieldValueSchema = z3.union([z3.string().max(CUSTOM_TEXT_MAX_LENGTH), z3.number().finite(), z3.boolean()]);
5337
5759
  var customShared = {
5338
- meta: HeaderMetaV3Schema,
5760
+ meta: HeaderMetaSchema,
5339
5761
  subject: SubjectSchema,
5340
5762
  kind: z3.literal("custom"),
5341
5763
  ...envelopeTail
@@ -5422,6 +5844,12 @@ var ManifestRecordSchema = z4.object({
5422
5844
  briefHash: z4.string().min(1).nullable(),
5423
5845
  objectivesVersion: z4.string().min(1).nullable(),
5424
5846
  rulingOrdinal: epochNumber,
5847
+ manifestVersion: z4.literal(2).optional(),
5848
+ pauseBoundRuling: z4.object({
5849
+ rulingId: z4.string().min(1),
5850
+ pauseId: z4.string().min(1),
5851
+ contentDigest: z4.string().min(1)
5852
+ }).strict().nullable().optional(),
5425
5853
  policyDigest: z4.string().min(1),
5426
5854
  recordedAt: isoTimestamp
5427
5855
  }).strict();
@@ -5443,7 +5871,11 @@ var LoopStateRecordSchema = z4.object({
5443
5871
  deliveredFindings: roundHeadIdentity.nullable(),
5444
5872
  repeatMemory: z4.object({
5445
5873
  blockingFindings: z4.array(z4.string()),
5446
- lastFailure: z4.object({ signature: z4.string(), message: z4.string() }).nullable()
5874
+ lastFailure: z4.object({ signature: z4.string(), message: z4.string(), developerAttemptedSince: z4.boolean().optional() }).nullable()
5875
+ }).strict().optional(),
5876
+ developerHandoff: z4.object({
5877
+ findings: z4.array(z4.object({ id: z4.string().min(1), description: z4.string().min(1) }).strict()),
5878
+ failingChecks: z4.array(z4.string().min(1))
5447
5879
  }).strict().optional(),
5448
5880
  publicationExpectedBase: z4.string().regex(/^[0-9a-f]{40}$/).nullable().optional(),
5449
5881
  taskStartedAt: isoTimestamp.optional(),
@@ -5498,8 +5930,57 @@ var ResolutionRecordSchema = z4.object({
5498
5930
  authenticatedFrom: z4.string().min(1),
5499
5931
  consumedAt: isoTimestamp
5500
5932
  }).strict();
5933
+ var ExecutionRoundMirrorRecordSchema = z4.object({
5934
+ version: z4.literal(1),
5935
+ kind: z4.literal("execution_round"),
5936
+ task: taskId,
5937
+ repository: z4.string().min(1),
5938
+ threadId: z4.string().min(1),
5939
+ checkpointId: z4.string().min(1),
5940
+ round: z4.number().int().positive(),
5941
+ recordedAt: isoTimestamp
5942
+ }).strict();
5943
+ // ../../packages/aeg-core/src/principals-config.ts
5944
+ import { readFileSync as readFileSync2 } from "node:fs";
5945
+ import { join } from "node:path";
5946
+ var PRINCIPALS_CONFIG_FIX = 'add "principals": [...] to vinaya.config.json';
5947
+ function readConfigPrincipals(repoRoot = ".") {
5948
+ const path = join(repoRoot, "vinaya.config.json");
5949
+ let raw;
5950
+ try {
5951
+ raw = JSON.parse(readFileSync2(path, "utf8"));
5952
+ } catch (err) {
5953
+ const why = err instanceof Error ? err.message : String(err);
5954
+ return { ok: false, reason: `cannot read ${path} as JSON (${why}) — ${PRINCIPALS_CONFIG_FIX}` };
5955
+ }
5956
+ const value = raw !== null && typeof raw === "object" ? raw.principals : undefined;
5957
+ if (value === undefined) {
5958
+ return { ok: false, reason: `${path} declares no Principal list — ${PRINCIPALS_CONFIG_FIX}` };
5959
+ }
5960
+ if (!Array.isArray(value) || value.length === 0 || !value.every((p) => typeof p === "string" && p.length > 0)) {
5961
+ return {
5962
+ ok: false,
5963
+ reason: `${path}'s "principals" must be a non-empty array of login strings — ${PRINCIPALS_CONFIG_FIX}`
5964
+ };
5965
+ }
5966
+ return { ok: true, principals: value };
5967
+ }
5968
+
5501
5969
  // ../../packages/aeg-core/bin/verify-docs.ts
5502
- var REPO_ROOT = join(import.meta.dir, "../../..");
5970
+ var DOCS_INVOCATION_CWD = process.cwd();
5971
+ var REPO_ROOT = (() => {
5972
+ for (const candidate of [DOCS_INVOCATION_CWD, import.meta.dirname]) {
5973
+ try {
5974
+ const root = execFileSync2("git", ["-C", candidate, "rev-parse", "--show-toplevel"], {
5975
+ encoding: "utf8",
5976
+ stdio: ["ignore", "pipe", "ignore"]
5977
+ }).trim();
5978
+ if (root !== "")
5979
+ return root;
5980
+ } catch {}
5981
+ }
5982
+ return join2(import.meta.dirname, "../../..");
5983
+ })();
5503
5984
  process.chdir(REPO_ROOT);
5504
5985
  var args = process.argv.slice(2);
5505
5986
  var mode = args.includes("--pr") ? "pr" : args.includes("--push") ? "push" : "full";
@@ -5524,7 +6005,7 @@ function resolvePrBody() {
5524
6005
  return process.env.PR_BODY;
5525
6006
  if (process.env.PR_BODY_FILE) {
5526
6007
  try {
5527
- return readFileSync2(process.env.PR_BODY_FILE, "utf8");
6008
+ return readFileSync3(process.env.PR_BODY_FILE, "utf8");
5528
6009
  } catch {
5529
6010
  return "";
5530
6011
  }
@@ -5532,16 +6013,21 @@ function resolvePrBody() {
5532
6013
  return "";
5533
6014
  }
5534
6015
  function waiverActiveFromEnv() {
6016
+ const principals = readConfigPrincipals();
6017
+ if (!principals.ok) {
6018
+ console.error(`[verify-docs] FAILED — ${principals.reason}`);
6019
+ process.exit(1);
6020
+ }
5535
6021
  const labels = (process.env.PR_LABELS || "").split(",").map((s) => s.trim()).filter(Boolean);
5536
6022
  return isWaiverLabelActorVerified({
5537
6023
  label: WAIVER_LABEL,
5538
6024
  labels,
5539
6025
  labelActor: process.env.WAIVER_LABEL_ACTOR || null,
5540
- principalAllowlist: PRINCIPAL_ALLOWLIST
6026
+ principalAllowlist: principals.principals
5541
6027
  });
5542
6028
  }
5543
6029
  function runC5(changed, base) {
5544
- const content = existsSync(DOC_OWNERS_PATH) ? readFileSync2(DOC_OWNERS_PATH, "utf8") : null;
6030
+ const content = existsSync(DOC_OWNERS_PATH) ? readFileSync3(DOC_OWNERS_PATH, "utf8") : null;
5545
6031
  const getDiff = (path) => {
5546
6032
  const out = shFile("git", ["diff", `${base}...HEAD`, "--", path]);
5547
6033
  return out === "" ? null : out;
@@ -5589,7 +6075,7 @@ function runPrMode() {
5589
6075
  for (const p of specFiles) {
5590
6076
  if (!existsSync(p))
5591
6077
  continue;
5592
- if (!hasStatusBlock(readFileSync2(p, "utf8"))) {
6078
+ if (!hasStatusBlock(readFileSync3(p, "utf8"))) {
5593
6079
  errors.push(`C1 spec-status: ${p} is missing a \`Status:\` block (accepted values: draft, target, ratified, retired). See state-machine.md Section 5.`);
5594
6080
  }
5595
6081
  }
@@ -5632,7 +6118,7 @@ verify-docs (push mode) — push allowed, but ${errors.length} owned-doc binding
5632
6118
  }
5633
6119
  var AEG_ROOT_PREFIX = "aeg-root/";
5634
6120
  function loadDoctrine() {
5635
- const read = (p) => existsSync(p) ? readFileSync2(p, "utf8") : "";
6121
+ const read = (p) => existsSync(p) ? readFileSync3(p, "utf8") : "";
5636
6122
  const list = (glob) => sh(`git ls-files '${glob}'`).split(`
5637
6123
  `).map((s) => s.trim()).filter(Boolean);
5638
6124
  return {
@@ -5645,7 +6131,7 @@ function runC6() {
5645
6131
  const files = sh("git ls-files 'aeg-root/*.md'").split(`
5646
6132
  `).map((s) => s.trim()).filter(Boolean);
5647
6133
  const entries = files.map((filePath) => {
5648
- const raw = existsSync(filePath) ? readFileSync2(filePath, "utf8") : "";
6134
+ const raw = existsSync(filePath) ? readFileSync3(filePath, "utf8") : "";
5649
6135
  const parsed = parseDocFrontmatter(raw);
5650
6136
  return {
5651
6137
  relPath: filePath.slice(AEG_ROOT_PREFIX.length),
@@ -5661,13 +6147,35 @@ function runC6() {
5661
6147
  for (const n of result.notes)
5662
6148
  notes.push(n);
5663
6149
  }
6150
+ function configuredPublishedAllow() {
6151
+ const path = join2(REPO_ROOT, "vinaya.config.json");
6152
+ if (!existsSync(path))
6153
+ return;
6154
+ try {
6155
+ const allow = JSON.parse(readFileSync3(path, "utf8"))?.proseGates?.published?.allow;
6156
+ return Array.isArray(allow) && allow.every((entry) => typeof entry === "string") ? allow : undefined;
6157
+ } catch {
6158
+ return;
6159
+ }
6160
+ }
6161
+ function configuredDecisionRecordsPath() {
6162
+ const path = join2(REPO_ROOT, "vinaya.config.json");
6163
+ if (!existsSync(path))
6164
+ return;
6165
+ try {
6166
+ const value = JSON.parse(readFileSync3(path, "utf8"))?.decisionRecords?.path;
6167
+ return typeof value === "string" && value.length > 0 ? value : undefined;
6168
+ } catch {
6169
+ return;
6170
+ }
6171
+ }
5664
6172
  function runC7(only) {
5665
6173
  const files = sh("git ls-files 'aeg-root/*.md' 'aeg-root/roles/*.md' 'aeg-root/contracts/*.md'").split(`
5666
6174
  `).map((s) => s.trim()).filter(Boolean).filter((filePath) => only ? only.has(filePath) : true);
5667
6175
  if (files.length === 0)
5668
6176
  return;
5669
6177
  const entries = files.map((filePath) => {
5670
- const raw = existsSync(filePath) ? readFileSync2(filePath, "utf8") : "";
6178
+ const raw = existsSync(filePath) ? readFileSync3(filePath, "utf8") : "";
5671
6179
  const parsed = parseDocFrontmatter(raw);
5672
6180
  return {
5673
6181
  relPath: filePath.slice(AEG_ROOT_PREFIX.length),
@@ -5676,7 +6184,9 @@ function runC7(only) {
5676
6184
  };
5677
6185
  });
5678
6186
  const surfacedPaths = modelBackedDocPaths(deriveDiagramModel(loadDoctrine(), null, null));
5679
- const result = evaluatePublishedProse(entries, surfacedPaths);
6187
+ const result = evaluatePublishedProse(entries, surfacedPaths, configuredPublishedAllow(), {
6188
+ decisionRecordsPath: configuredDecisionRecordsPath()
6189
+ });
5680
6190
  for (const e of result.errors)
5681
6191
  errors.push(e);
5682
6192
  for (const n of result.notes)
@@ -5686,12 +6196,12 @@ var C8_PATHSPECS = ["aeg-root/*.md", "apps/*.ts", "apps/*.md", "packages/*.ts",
5686
6196
  function runC8(only) {
5687
6197
  const tracked = new Set(C8_PATHSPECS.flatMap((pathspec) => shFile("git", ["ls-files", pathspec]).split(`
5688
6198
  `)).map((s) => s.trim()).filter(Boolean));
5689
- const files = [...tracked].filter((filePath) => only ? only.has(filePath) : true).filter((filePath) => existsSync(filePath)).map((filePath) => ({ path: filePath, content: readFileSync2(filePath, "utf8") }));
6199
+ const files = [...tracked].filter((filePath) => only ? only.has(filePath) : true).filter((filePath) => existsSync(filePath)).map((filePath) => ({ path: filePath, content: readFileSync3(filePath, "utf8") }));
5690
6200
  if (files.length === 0)
5691
6201
  return;
5692
6202
  const trackedCited = new Set(shFile("git", ["ls-files"]).split(`
5693
6203
  `).map((s) => s.trim()).filter(Boolean));
5694
- const readCited = (path) => trackedCited.has(path) && existsSync(path) ? readFileSync2(path, "utf8") : null;
6204
+ const readCited = (path) => trackedCited.has(path) && existsSync(path) ? readFileSync3(path, "utf8") : null;
5695
6205
  const { findings, bindingCount } = checkDocClaims(files, readCited);
5696
6206
  for (const f of findings)
5697
6207
  errors.push(`C8 doc-claim: ${f.message}`);
@@ -5705,11 +6215,11 @@ function runFullMode() {
5705
6215
  for (const p of specs) {
5706
6216
  if (!existsSync(p))
5707
6217
  continue;
5708
- if (!hasStatusBlock(readFileSync2(p, "utf8"))) {
6218
+ if (!hasStatusBlock(readFileSync3(p, "utf8"))) {
5709
6219
  errors.push(`F1 spec-status: ${p} is missing a \`Status:\` block.`);
5710
6220
  }
5711
6221
  }
5712
- const docOwnersContent = existsSync(DOC_OWNERS_PATH) ? readFileSync2(DOC_OWNERS_PATH, "utf8") : null;
6222
+ const docOwnersContent = existsSync(DOC_OWNERS_PATH) ? readFileSync3(DOC_OWNERS_PATH, "utf8") : null;
5713
6223
  const { m1Errors, m2Notes, m3Errors, noDocRules } = checkManifestValidity(docOwnersContent, existsSync);
5714
6224
  for (const e of m1Errors)
5715
6225
  errors.push(e);