@attalabs/vinaya 0.37.0 → 0.38.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 (174) hide show
  1. package/aeg-root/enforcement.md +5 -4
  2. package/aeg-root/roles/developer/reference.md +24 -22
  3. package/aeg-root/roles/developer.md +4 -4
  4. package/aeg-root/roles/planner/reference.md +11 -0
  5. package/aeg-root/roles/reviewer.md +5 -3
  6. package/aeg-root/roles/security.md +3 -2
  7. package/aeg-root/state-machine.md +1 -1
  8. package/aeg-root/templates/brief-template.md +4 -4
  9. package/aeg-root/tranche-model.md +6 -0
  10. package/dist/checks/bin/check-body-bare-digits.js +139 -12
  11. package/dist/checks/bin/check-branch-topology.js +171 -13
  12. package/dist/checks/bin/check-brief-shape.js +139 -12
  13. package/dist/checks/bin/check-changeset-coverage.js +177 -17
  14. package/dist/checks/bin/check-closes-n.js +171 -13
  15. package/dist/checks/bin/check-coherence.js +171 -13
  16. package/dist/checks/bin/check-dead-branch-push.js +139 -12
  17. package/dist/checks/bin/check-dispatch-readiness.js +195 -23
  18. package/dist/checks/bin/check-doc-coverage-push.js +173 -13
  19. package/dist/checks/bin/check-doc-coverage.js +180 -13
  20. package/dist/checks/bin/check-doctrine-no-procedures.js +139 -12
  21. package/dist/checks/bin/check-doctrine-portability.js +173 -13
  22. package/dist/checks/bin/check-evidence-fresh.js +173 -13
  23. package/dist/checks/bin/check-exec-bits.js +173 -13
  24. package/dist/checks/bin/check-first-push-dispatch.js +171 -13
  25. package/dist/checks/bin/check-issue-assignment.js +171 -13
  26. package/dist/checks/bin/check-issue-milestone-attach.js +139 -12
  27. package/dist/checks/bin/check-issue-objectives-numbering.js +139 -12
  28. package/dist/checks/bin/check-issue-parts-coverage.js +139 -12
  29. package/dist/checks/bin/check-issue-surface-globs.js +171 -13
  30. package/dist/checks/bin/check-issue-title-grammar.js +139 -12
  31. package/dist/checks/bin/check-issue-tranche-label.js +139 -12
  32. package/dist/checks/bin/check-main-branch-refusal.js +139 -12
  33. package/dist/checks/bin/check-no-disk-state.js +139 -12
  34. package/dist/checks/bin/check-pr-premise-reassert.js +139 -12
  35. package/dist/checks/bin/check-pr-report-density.js +139 -12
  36. package/dist/checks/bin/check-principal-test-plan-wait.js +139 -12
  37. package/dist/checks/bin/check-quoted-command.js +173 -13
  38. package/dist/checks/bin/check-reader-resolvable-prose.js +173 -13
  39. package/dist/checks/bin/check-registry-gates.js +406 -68
  40. package/dist/checks/bin/check-retired-vocabulary.js +173 -13
  41. package/dist/checks/bin/check-review-gate.js +139 -12
  42. package/dist/checks/bin/check-single-plan-pr.js +139 -12
  43. package/dist/checks/bin/check-surface-scope.js +171 -13
  44. package/dist/checks/bin/check-test-plan.js +139 -12
  45. package/dist/checks/bin/check-token-collection-wired.js +139 -12
  46. package/dist/checks/bin/check-workspace-escape.js +173 -13
  47. package/dist/checks/bin/verify-dispatch.js +3849 -0
  48. package/dist/index.js +7348 -2095
  49. package/dist/lib/pre-push-cache-test-run.js +42 -2
  50. package/dist/lib/pre-push-changed-files.js +16 -11
  51. package/dist/lib/pre-push-select-tests.js +177 -21
  52. package/package.json +1 -1
  53. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/anchored-region.ts +7 -6
  54. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/brief-render.ts +33 -15
  55. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/brief-validation.ts +51 -12
  56. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/control-store/index.ts +1 -0
  57. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/control-store/local.ts +31 -0
  58. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/control-store/records.ts +31 -2
  59. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/assess-round.ts +214 -24
  60. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/fakes.ts +11 -3
  61. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/index.ts +5 -4
  62. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/journal-reconstruction.ts +13 -13
  63. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/render-summary.ts +46 -145
  64. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/types.ts +63 -14
  65. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/docs/index.ts +3 -1
  66. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/docs/published-prose.ts +30 -0
  67. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/doctrine-portability.ts +6 -2
  68. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/gate-audience.ts +0 -1
  69. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/index.ts +56 -7
  70. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/issue-validation.ts +7 -7
  71. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/leftover-detection.ts +24 -6
  72. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/custom.ts +157 -0
  73. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/envelope.ts +44 -6
  74. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/fixtures/executions.ts +493 -0
  75. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/fixtures/fact-sheets.ts +111 -0
  76. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/fixtures/generator.ts +155 -0
  77. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/fixtures/index.ts +12 -0
  78. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/index.ts +128 -0
  79. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/questions/catches.ts +63 -0
  80. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/questions/checks.ts +146 -0
  81. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/questions/common.ts +137 -0
  82. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/questions/completion.ts +137 -0
  83. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/questions/convergence.ts +420 -0
  84. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/questions/determinism.ts +65 -0
  85. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/questions/index.ts +69 -0
  86. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/questions/judgment.ts +132 -0
  87. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/questions/labels.ts +21 -0
  88. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/questions/time.ts +167 -0
  89. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/questions/usage.ts +139 -0
  90. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/schema.ts +219 -15
  91. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/store.ts +7 -7
  92. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/sync/cache-contract.ts +207 -0
  93. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/sync/contracts.ts +105 -0
  94. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/sync/engine.ts +308 -0
  95. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/sync/index.ts +34 -0
  96. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/sync/measured.ts +20 -0
  97. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/sync/memory-cache.ts +78 -0
  98. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/sync/normalize.ts +156 -0
  99. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/sync/row.ts +103 -0
  100. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/reader-resolvable-prose.ts +34 -6
  101. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/registry-checks.ts +70 -6
  102. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/review-input-manifest.ts +19 -14
  103. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/review-policy.ts +38 -3
  104. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/review-status.ts +5 -2
  105. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/task-phase-history.ts +46 -0
  106. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/task-tools.ts +15 -28
  107. package/studio-standalone/apps/vinaya-studio/web/.next/BUILD_ID +1 -1
  108. package/studio-standalone/apps/vinaya-studio/web/.next/build-manifest.json +3 -3
  109. package/studio-standalone/apps/vinaya-studio/web/.next/prerender-manifest.json +3 -3
  110. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  111. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.html +1 -1
  112. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.rsc +1 -1
  113. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  114. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  115. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  116. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  117. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  118. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_not-found/page/server-reference-manifest.json +2 -2
  119. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_not-found/page.js.nft.json +1 -1
  120. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  121. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/page/server-reference-manifest.json +2 -2
  122. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/page.js.nft.json +1 -1
  123. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/page_client-reference-manifest.js +1 -1
  124. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/backlog/page/server-reference-manifest.json +2 -2
  125. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/backlog/page.js.nft.json +1 -1
  126. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/backlog/page_client-reference-manifest.js +1 -1
  127. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/page/server-reference-manifest.json +2 -2
  128. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/page.js.nft.json +1 -1
  129. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/page_client-reference-manifest.js +1 -1
  130. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/page/server-reference-manifest.json +2 -2
  131. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/page.js.nft.json +1 -1
  132. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/page_client-reference-manifest.js +1 -1
  133. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/page/server-reference-manifest.json +3 -3
  134. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/page.js.nft.json +1 -1
  135. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/page_client-reference-manifest.js +1 -1
  136. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/tasks/[taskId]/page/server-reference-manifest.json +2 -2
  137. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/tasks/[taskId]/page.js.nft.json +1 -1
  138. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/tasks/[taskId]/page_client-reference-manifest.js +1 -1
  139. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/page/server-reference-manifest.json +2 -2
  140. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/page.js.nft.json +1 -1
  141. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/page_client-reference-manifest.js +1 -1
  142. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/tranches/page/server-reference-manifest.json +2 -2
  143. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/tranches/page.js.nft.json +1 -1
  144. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/tranches/page_client-reference-manifest.js +1 -1
  145. 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
  146. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__04adkz-._.js +1 -1
  147. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__08e39jo._.js +1 -1
  148. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__0h9yhwx._.js +1 -1
  149. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/{[root-of-the-server]__14ui9sz._.js → [root-of-the-server]__0jdjsxe._.js} +1 -1
  150. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__0ls23oh._.js +1 -1
  151. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__1gjqmhq._.js +1 -1
  152. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__1wc4-ip._.js +1 -1
  153. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_08onyya._.js +1 -1
  154. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_096f46i._.js +1 -1
  155. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0af2one._.js +1 -1
  156. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0e5tkdd._.js +1 -1
  157. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0kf2g72._.js +1 -1
  158. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0zf4d27._.js +1 -1
  159. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_1-wo68i._.js +1 -1
  160. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_1achbh9._.js +1 -1
  161. 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
  162. package/studio-standalone/apps/vinaya-studio/web/.next/server/middleware-build-manifest.js +3 -3
  163. package/studio-standalone/apps/vinaya-studio/web/.next/server/pages/500.html +1 -1
  164. package/studio-standalone/apps/vinaya-studio/web/.next/server/server-reference-manifest.js +1 -1
  165. package/studio-standalone/apps/vinaya-studio/web/.next/server/server-reference-manifest.json +4 -4
  166. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/1-acpmtfmrc35.js +1 -0
  167. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/{3qtt1v3ya-ofe.js → 2f2y8xxok8zph.js} +1 -1
  168. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/{3l56x8wjdzvaw.js → 2xevgia1h8g0y.js} +4 -4
  169. package/studio-standalone/apps/vinaya-studio/web/package.json +2 -2
  170. package/dist/checks/bin/check-token-report.js +0 -6526
  171. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/0vtfb0g813gki.js +0 -1
  172. /package/studio-standalone/apps/vinaya-studio/web/.next/static/{yR5RsCxb1OGnYggiaO09S → yNZEFRSjP9BLUfdf96Eol}/_buildManifest.js +0 -0
  173. /package/studio-standalone/apps/vinaya-studio/web/.next/static/{yR5RsCxb1OGnYggiaO09S → yNZEFRSjP9BLUfdf96Eol}/_clientMiddlewareManifest.js +0 -0
  174. /package/studio-standalone/apps/vinaya-studio/web/.next/static/{yR5RsCxb1OGnYggiaO09S → yNZEFRSjP9BLUfdf96Eol}/_ssgManifest.js +0 -0
@@ -89,7 +89,7 @@ The same check implementations run at ring 0 and ring 1 — one codebase, two en
89
89
 
90
90
  | Action | Summary | Category | Description | Gate | What must be true before the action is allowed | Audience | implementation |
91
91
  | --- | --- | --- | --- | --- | --- | --- | --- |
92
- | Editing a governed file | Ever had a teammate change code they clearly never read the docs for? | hook | Couples an edit to a governed code surface to its owning document, so the two cannot drift apart in one change. | **C5 doc-coverage (update-or-waive)** | No session read-gate hook is installed in this repo. The nearest enforcement is C5 doc-coverage: a changed code file matching a `.vinaya/doc-owners` binding must have its owning doc in the same diff (or a `Doc-ack:`/principal-applied `vinaya/waiver:docs` escape) — warn-only at the ring-0 hooks, blocking at ring 1. Dormant until `.vinaya/doc-owners` carries a binding for the surface. | product | `apps/cli/src/checks/bin/check-doc-coverage-push.ts` |
92
+ | Editing a governed file | Ever had a teammate change code they clearly never read the docs for? | hook | Couples an edit to a governed code surface to its owning document, so the two cannot drift apart in one change. | **C5 doc-coverage (update-or-waive)** | No session read-gate hook is installed in this repo. C5 doc-coverage blocks the commit hook: a changed code file matching a `.vinaya/doc-owners` binding must have its owning doc in the branch diff or staged for that commit (or carry a `Doc-ack:`/principal-applied `vinaya/waiver:docs` escape). Git supplies `GIT_INDEX_FILE` to both hooks, so the runner marks only its pre-commit `--skip-full` mode before staged changes are counted; push and CI judge only the committed branch diff. Dormant until `.vinaya/doc-owners` carries a binding for the surface. | product | `apps/cli/src/checks/bin/check-doc-coverage.ts` |
93
93
  | `git commit` | Ever pushed code that didn't even compile? | hook | Refuses a commit that does not build or pass its own checks, before the broken state exists at all. | **Managed `.git/hooks/pre-commit` block** (written by `vinaya init`/`upgrade` through the common-dir hook resolver, so every linked worktree shares it) | The ring-0 check suite passes: the hook runs `vinaya check --all --diff-only --local` (in this vendoring repo, the built `node apps/cli/dist/index.js` invocation, guarded by a build-missing refusal). `--diff-only` skips a `scope: 'diff'` check whose `include` globs match none of the changed files, so pre-commit runs a genuinely narrower set than pre-push/CI for those checks — but a `scope: 'full'` check always runs regardless (an `include` declared on a `scope: 'full'` entry, `apps/cli/src/checks/registry.ts`, is presently pinning/documentation only: `runner.ts`'s skip decision returns before ever consulting it for a non-`'diff'` scope). Build, lint and unit tests are NOT run by this hook here — they run in the repo-own `ci.yml` (ring 1). | repo-own | `apps/cli/src/checks/runner.ts` |
94
94
  | `git push` | Ever had someone accidentally push straight to main? | hook | Refuses a push that would land straight on main, on the machine that attempted it. | **Managed `.git/hooks/pre-push` block** (same generator and common-dir resolver as pre-commit) | No pushing straight to `main` — a direct push cannot be refused for a commit that already landed on `main` some other way (e.g. a repo-admin action outside the hook's reach); that residual class now has a ring-2 detection backstop (see below, task 24 item 1). A task branch's name must exactly match its planned task row in the tranche plan. A task branch whose most recent pull request is already `MERGED` or `CLOSED` is refused outright — closing the class of bug where stale local work lands on an already-resolved branch, silently reopening/confusing forge state (live-fire incident, 2026-07-03: six topology rows landed on a plan PR's branch after that PR had merged); this check is fail-open (hook-dependent), so it too now has a ring-2 report-only audit watching for it (see below, task 24 item 2) — notification only, never a gate, matching that audit's own non-gate classification; nothing at ring 2 actually backstops (blocks) this hook's own fail-open gap. This check is deliberately **fail-open**: if the forge cannot be reached (network flake, auth issue, rate limit) it is treated the same as "no pull request exists yet" and the push is allowed — a transient reachability issue must never block every push. On a task branch's first push (before its PR exists), `verify-dispatch` also runs itself here — see the dedicated row below (task 25). Any changed code that has a designated owning document must have that document updated in the same branch, OR (task 29) carry an actor-verified `vinaya/waiver:docs` label on the open pull request, OR (task 4) carry a `Doc-neutral: <pointer> — <note>` PR-body declaration whose matched-file diff is verified comment/whitespace-only (`isMechanicallyNeutralDiff`) — a waiver is a forge-authenticated human act, never a parseable string, and a Doc-neutral declaration is never sufficient by itself; only diff-confirmed evidence satisfies it. Before a PR exists (first push) no waiver label can exist yet, so an owned-doc violation here is **warn-with-declared-intent, not a hard block**: the push always succeeds, and the printed message states plainly that ring 1 stays red until a principal applies the label, the doc is updated, or a Doc-neutral declaration with confirming evidence is added — this replaces the earlier first-push `Doc-waiver:` commit-trailer self-service, which is now dead code (that path is superseded). `Doc-ack:` (URL-pointer acknowledgment) is unaffected by the waiver change — still read from the branch's own last commit message before a PR exists, or — for a pre-authoring dry run via `verify-dispatch --simulate`, before any commit exists — from a local drafted-PR-body file. | repo-own | `apps/cli/src/checks/runner.ts` |
95
95
  | Creating a pull request, or editing its title/description | Ever opened a PR that was missing half the info reviewers needed? | event | Refuses to open or edit a pull request until it carries everything a reviewer needs to judge it. | **Validated wrapper** (`vinaya pr create`/`edit`), re-checked at ring 1 — no tool-interception layer is installed here, so a raw `gh` write is not refused locally; the CI re-check catches what it lets through | The title follows the naming convention. The description carries every required section of the task brief: the impact tier, the executing model, the project(s) touched, a tagged test plan, the file surface the task may touch, the documentation it must update, the isolated-worktree setup step, the stop conditions, the standing autonomy clause, the Issue this work closes,. A *plan* pull request must never close a task Issue. **The brief itself never reaches this description** — the Developer still pastes it into the body-file's `## Reference` section, but `vinaya pr create` splits that section out before the body ever reaches `gh`, posting it as its own comment marked `<!-- aeg:brief -->`, so the description carries the report (summary, test plan, evidence, scope) only. The documentation required by the change's impact tier is present — a doc-coverage finding here is honored ONLY by an actor-verified `vinaya/waiver:docs` label, never a body field. The branch, its planned task row, and the Issue it closes all agree with each other. **Single-plan-PR guard (task 19):** a diff that touches a tranche's topology file (`aeg-root/tranches/*.md`, excluding `completed/`) is refused outright if another OPEN pull request's diff already touches that SAME tranche's topology file — closing the race that produced two concurrent plan pull requests for the same tranche, each cut before the other's newly-added Issue was visible. Ordinary task pull requests never touch a topology file, so this never fires for them. A PR opened via the web UI bypasses this wrapper entirely, so this predicate (extracted to `packages/aeg-core/src/single-plan-pr.ts`, task 24 item 3) now also has a ring-1 CI backstop (see below) — one implementation, two enforcement points. **`vinaya pr create` also runs every registry check declaring `PR_BODY` over the body before it ever reaches the forge (task 12)** — `brief-shape`, `pr-report-density`, `doc-coverage`, and every other `PR_BODY`-declaring check, with `PR_NUMBER` explicitly unset (no PR exists yet) and `localOnly: true` skipping the `requiresOpenPr` set outright. The same set CI's `vinaya-checks.yml` runs against the live body, so a body that opens here is a body that passes there too. Skipped entirely when `rings.ring1_forgeWriteInterception` is `false` (this repo sets it `true`, so they run) — the same accelerator that already skips `validateForgeWrite`'s config-driven sections. | repo-own | `packages/aeg-core/bin/open-pr.ts` |
@@ -145,24 +145,25 @@ Every pull request, on open and on every push, re-runs the same checks in CI:
145
145
  | G4 — cited forge numbers resolve | Ever read a doc that cited a ticket number that didn't exist? | ci | Re-checks that every Issue and PR number cited in the docs resolves to a real one. | Every `#NNN` cited anywhere in this page's body is a real Issue or PR in the forge — a fabricated citation fails the build. **Currently scans nothing by design** (task 14): this page's body carries zero forge citations, since task 3 banned them from `aeg-root/**` as doctrine and the `reader-resolvable-prose` check (task 15) now enforces that ban directly. G4 is a standing guard against reintroduction, not a live proof of ongoing citation correctness — it fires the moment a `#NNN` reappears here and doesn't resolve, but has nothing to scan while the ban holds. Verified live: `packages/aeg-core/src/registry-checks.test.ts` appends a fabricated citation to this page's real content and asserts `checkG4` catches it. | product | `packages/aeg-core/bin/verify-registry.ts` |
146
146
  | G5 — role/contract integrity | Ever had a process doc reference a role that was never actually defined? | ci | Re-checks that every role and contract the doctrine references is really defined. | Every `aeg-root/contracts/*.md`'s `producer`/`consumer` names a real `role_id` from `aeg-root/roles/*.md`; every role's `performs`/`refuses_when` frontmatter is present and non-empty. | product | `packages/aeg-core/bin/verify-registry.ts` |
147
147
  | G6 — doctrine-registry parity | Ever read a doc that claimed a check ran, when nothing in the registry actually ran it? | ci | Re-checks that every row this page marks `product` actually ships as a real, adopter-runnable check, not just a documented claim. | Every row whose `Audience` cell reads `product` resolves to a real entry in `coreCheckRegistry()` (`apps/cli/src/checks/registry.ts`) — the parity a `product` claim makes but nothing checked before task 8. A `repo-own` row makes no such claim and is never scanned. Evaluated only from `apps/cli`'s `check-registry-gates.ts`, since `coreCheckRegistry()` lives there and `aeg-core`'s standalone `verify-registry.ts` cannot import it without closing a dependency cycle. | product | `packages/aeg-core/bin/verify-registry.ts` |
148
+ | G7 — anything that blocks or writes reaches a log producer | Ever added a gate or a forge write that nobody could see run? | ci | Re-checks that every file able to write to GitHub, and every file implementing a blocking gate, leaves a record in the Vinaya Log. | Every file G3 lists as making a GitHub-writing call, and every Ring-0 row's TypeScript `implementation`, either is a log producer (a CLI source file importing the sink's `log` or `logSync`), imports one directly or through other files within the CLI package, or is named in the rule's exemption list with a stated reason. A file reaching none and unexempted fails and is named; an exemption with no reason, naming a file that no longer exists or is no longer such a file, or naming one that does reach a producer, fails too. Applies to the authoring repository only: it reads this page, so an installation without it reports the rule dormant, never an error. Evaluated only from the CLI's registry-gates check, which holds the import resolution the standalone registry script cannot import. | repo-own | `apps/cli/src/checks/bin/check-registry-gates.ts` |
148
149
  | reader-resolvable-prose | Ever read a doc that assumed you already worked here? | ci | Re-checks reader-facing doctrine, durable specs and configured source comments for unresolvable citations and coined vocabulary. | The configured source-comment sweep is clean; severity is `error`, so new citations fail `check --all`. **The spec class reads four paths with no configuration at all** — a root `SPEC.md`, a root `CONTEXT.md`, every `.md` under `docs/adr/`, and every `apps/<app>/specs/**/*.md` — so a repository with no `apps/` tree of its own, which this class previously never read at all, has its durable documents read from day one; a repository carrying none of those files reports nothing new. `proseGates.specPaths` adds further repository-relative files or folders to the same class; `README.md` is never a default, because the tranche-slug pattern matches an ordinary stack badge. An entry is accepted with a trailing slash or a leading dot-slash and reduced to one spelling, so it cannot be swept and then silently left unclassified; an entry that leaves the repository — absolute, climbing upward, or a folder symlinked outside — is refused rather than read, since this class reads the repository under check and nothing else. In every file it reads, the class blocks an Issue or PR number, an internal tranche slug, an archived-tranche slug, and **a task number** — the word `task` or `tasks` followed by a number — which a durable document copies out of a plan and which stops being true the moment that plan is renumbered; a document's own numbered structure (a section, a step) is never a match. The class blocks, and `proseGates.specGrandfather` is its only exemption, covering a default path exactly as it covers a per-product spec. **The exemption is a per-file limit:** the object form maps each listed spec to the most findings it may carry, and a listed file above its number fails, naming the file, its count and its limit, so a grandfathered spec cannot gain a citation and its number only goes down; the array form still exempts a whole file, now with one warning per entry naming the object form. | product | `apps/cli/src/checks/bin/check-reader-resolvable-prose.ts` |
149
150
  | retired-vocabulary | Ever read a doc that described a mechanism as live after it was retired? | ci | Re-checks that no doctrine page claims a retired mechanism is still live. | The genuinely-retired half of a sibling suite's original scan — never the forge-number/tranche-slug citation half, which is `reader-resolvable-prose`'s own job and would double-report the identical match if duplicated here. Scoped to `<doctrineRoot>/**` only (the same `proseGates.doctrineRoot` key `reader-resolvable-prose` reads), not the whole adopter repo — this vocabulary means something only inside the shipped doctrine tree. Registered in `coreCheckRegistry()` (task 7), report-only like `reader-resolvable-prose`. **Line-scoped under `--diff-only`** (this task): a finding prints only when its own line falls inside a changed hunk of that file's diff against the base. A full sweep is unchanged and still reports every finding in the tree. The hunk parser lives in exactly one place — the shared diff-evidence helper both this and every sibling sweep call — never a second regex per check. Without this, a diff that touched one line of a long doctrine page reported that page's whole standing backlog as if this PR had caused it, and a real new finding was indistinguishable from inherited noise. Registered with `include: ['aeg-root/**/*.md']` (task 12) — pinning/documentation only today, since `runner.ts`'s `shouldSkip` returns before consulting `include` for a `scope: 'full'` entry (out of that task's surface); a future `runner.ts` change extending `--diff-only` skipping to `scope: 'full'` finds this already declared. | product | `apps/cli/src/checks/bin/check-retired-vocabulary.ts` |
150
151
  | doctrine-portability | Ever shipped doctrine that named a file only you could see? | ci | Re-checks that shipped doctrine doesn't cite a path that exists only in the authoring repository. | A cited path's top segment judged against an allow-list: the caller-supplied ships prefix itself (`<doctrineRoot>/`, `aeg-root/` by default — doctrine citing its own tree, wherever that tree actually lives for the caller, checked dynamically so a non-default `doctrineRoot` never falsely flags an adopter's own self-citations), plus a fixed set of static portable prefixes (`roles/`, `contracts/`, `skills/`, and adopter-owned `.github/`, `.vinaya/`, `.claude/`, `.git/`, `.husky/`) — an unclassified prefix is a finding, never a silent pass, so a never-seen author-repo directory (e.g. a build artifact under `apps/*/dist/`) cannot slip through the way it would under a deny-list. Zero I/O in `@attalabs/aeg-core`'s `checkDoctrinePortability`; the bin supplies the only I/O, reading `<doctrineRoot>/**` twice — once from the working tree, once from `BASE_SHA` (`origin/main` by default) via `git show`/`git ls-tree` — and reports only citations present in the former and absent from the latter, so day-one install of an unfixed backlog never turns every adopter's CI red. Registered in `coreCheckRegistry()`, report-only like `reader-resolvable-prose`/`retired-vocabulary`. **Line-scoped under `--diff-only`** (this task): a finding prints only when its own line falls inside a changed hunk of that file's diff against the base. A full sweep is unchanged and still reports every finding in the tree. The hunk parser lives in exactly one place — the shared diff-evidence helper both this and every sibling sweep call — never a second regex per check. Without this, a diff that touched one line of a long doctrine page reported that page's whole standing backlog as if this PR had caused it, and a real new finding was indistinguishable from inherited noise. Registered with `include: ['aeg-root/**/*.md']` (task 12) — pinning/documentation only today, since `runner.ts`'s `shouldSkip` returns before consulting `include` for a `scope: 'full'` entry (out of that task's surface); a future `runner.ts` change extending `--diff-only` skipping to `scope: 'full'` finds this already declared. | product | `apps/cli/src/checks/bin/check-doctrine-portability.ts` |
151
152
  | doctrine-no-procedures | Ever pasted a copy-paste runbook into doctrine, and it rotted the moment the real command changed? | ci | Re-checks that doctrine (`roles/*.md`, `contracts/*.md`, …) describes commands rather than scripting them (task 9/task 10's rule). | A fenced code block anywhere under `<doctrineRoot>/**/*.md`, tagged with no language or an explicit `sh`/`bash`/`shell`/`console`, containing two or more lines that each start with a shell command word (`export`/`bun`/`gh`/`git`/`grep`/`sed`/`cat`/`diff`/`vinaya`) is a finding — a runbook, not an illustration. A block tagged with any other language (` ```ts `, ` ```json `, …) is never a candidate at all, however many command-word-shaped lines it contains — a two-line ` ```ts ` excerpt whose lines both start with `export` is TypeScript, not shell. Two further exemptions: a block sitting inside the existing `AEG:VENDOR-EXAMPLE` anchor pair (`tranche-model.md` §12's one sanctioned fenced home for a real command sequence), and any file under a `templates/` directory. Zero I/O in `@attalabs/aeg-core`'s `checkDoctrineNoProcedures`; the bin supplies the only I/O, walking `<doctrineRoot>` once. Unlike its sibling `doctrine-portability` above, this is **blocking, not baseline** (`severity: error`, exit 1 on any finding) — a fresh rule with an expected-zero corpus after this task's own sweep-and-fix, not a 200+-finding backlog needing a report-only rollout. Registered in `coreCheckRegistry()`. Registered with `include: ['aeg-root/**/*.md']` (task 12) — pinning/documentation only today, since `runner.ts`'s `shouldSkip` returns before consulting `include` for a `scope: 'full'` entry (out of that task's surface); a future `runner.ts` change extending `--diff-only` skipping to `scope: 'full'` finds this already declared. | product | `apps/cli/src/checks/bin/check-doctrine-no-procedures.ts` |
152
153
  | No new on-disk state | Ever had a file and the forge disagree about the same fact? | ci | Blocks a diff that creates a new on-disk state file duplicating what the forge already derives. | No live per-tranche topology file appears under `aeg-root/tranches/` (a top-level file there fails on add or edit; under `completed/**` only genuinely NEW files are refused, so the legacy archives stay editable), and no new `*.tokens.md` appears anywhere — token figures live in the PR body, and the ledger row is appended post-merge. Status-aware (`git diff --name-status`), never fired by a deletion; a rename counts as an addition at its new path. The registered `no-disk-state` check runs the same `isNewDiskStateFile` predicate at ring 0 (the managed hooks) and here; this row names the standalone CLI shim of that gate. | product | `packages/aeg-core/bin/check-no-disk-state.ts` |
153
154
  | workspace-escape | Ever deleted a package only to break a sibling's tests through a path nobody's dependency graph saw? | ci | Re-checks that no source file's constructed filesystem reference reaches outside its own workspace package, or points at a path that does not exist. | Every `readFileSync`/`readFile` call with a literal relative-path argument, and every `new URL('…', import.meta.url)`, across every `.ts`/`.tsx` file under `apps/*`/`packages/*` — resolved against the citing file's own directory and judged against its own two-segment workspace-package prefix (`apps/<name>`, `packages/<name>`), never against `import`/`require` module specifiers (the dependency graph already owns those). Zero I/O in `@attalabs/aeg-core`'s `findWorkspaceEscapes`; the bin supplies the only I/O, walking the working tree once for source content and once for the existence-check universe (files AND directories, so a reference to a directory itself resolves as existing). Registered in `coreCheckRegistry()` (task 17), report-only like `reader-resolvable-prose`/`retired-vocabulary`/`doctrine-portability`. `*.test.ts`/`*.test.tsx` files are excluded from the swept surface entirely (O2, found live 2026-09-04) — this repo's own corpus carried a genuine escape at `packages/sources/src/commands-router-coverage.test.ts` reaching into `apps/cli/src/index.ts`, structurally the same incident this check exists to catch, until that exclusion silenced it alongside `workspace-escape.test.ts`'s own fixture-string false positive; report-only severity stays regardless, since an ordinary (non-test) source file's constructed reference can still exist with nobody having triaged it yet. **Line-scoped under `--diff-only`** (this task): a finding prints only when its own line falls inside a changed hunk of that file's diff against the base. A full sweep is unchanged and still reports every finding in the tree. The hunk parser lives in exactly one place — the shared diff-evidence helper both this and every sibling sweep call — never a second regex per check. Without this, a diff that touched one line of a long doctrine page reported that page's whole standing backlog as if this PR had caused it, and a real new finding was indistinguishable from inherited noise. Registered with `include: ['aeg-root/**/*.md']` (task 12) — pinning/documentation only today, since `runner.ts`'s `shouldSkip` returns before consulting `include` for a `scope: 'full'` entry (out of that task's surface); a future `runner.ts` change extending `--diff-only` skipping to `scope: 'full'` finds this already declared. (this sweep's real domain is `apps`/`packages`, not `aeg-root` — named per the Issue's own list; harmless either way while `include` has no runtime effect on a `scope: 'full'` entry.) | product | `apps/cli/src/checks/bin/check-workspace-escape.ts` |
154
- | changeset-coverage | Ever shipped a change to a published package and the release train never picked it up? | ci | Re-checks that a diff touching a published package's own shipped files also carries a changeset in the same diff. | For each member of `.changeset/config.json`'s `fixed` group, a changed path counts as SHIPPED iff it falls under that member's own `package.json` `files` allowlist, read live from every workspace member's own manifest — never a hardcoded path list, never a directory heuristic. A diff that hits at least one shipped path with no `.changeset/*.md` entry (excluding `README.md`) in the same diff is a finding, naming the shipped paths hit. The Changesets-release branch itself is exempt by construction (its diff IS the changesets being consumed) — the exemption reuses `@attalabs/aeg-core`'s own release-branch constant, the same one `body-bare-digits`'s Changesets-release exemption is keyed on, rather than inventing a second branch-name special-case; unlike that check it never live-fetches a PR author, since a report-only, always-exit-`0` check has no gate for a spoofed branch name to bypass. Written after four separate published-package pull requests, over the course of one day, each merged with no changeset and caught only by a human after the fact — the obligation existed in no enforceable place before this check: not in `roles/developer.md`'s deliverable conventions (now amended alongside this row), not in any registered check. Zero I/O in the pure predicate (`changeset-coverage-logic.ts`); the bin supplies the only I/O — reading the config, every fixed-group member's own manifest, and the diff. Registered in `coreCheckRegistry()`, report-only like `reader-resolvable-prose`/`retired-vocabulary`/`doctrine-portability`/`workspace-escape` above — graduating to a blocking check, and any waiver-label escape that would need, is a later, separately-dispatched decision once the false-positive rate is observed; v1 carries no such escape. | product | `apps/cli/src/checks/bin/check-changeset-coverage.ts` |
155
+ | changeset-coverage | Ever shipped a change to a published package and the release train never picked it up? | ci | Re-checks that a diff touching a published package's own shipped files also carries a changeset in the same diff. | For each member of `.changeset/config.json`'s `fixed` group, a changed path counts as SHIPPED iff it falls under that member's own `package.json` `files` allowlist, read live from every workspace member's own manifest — never a hardcoded path list, never a directory heuristic. A diff that hits at least one shipped path with no `.changeset/*.md` entry (excluding `README.md`) in the same diff is a finding, naming the shipped paths hit. The Changesets-release branch itself is exempt by construction (its diff IS the changesets being consumed) — the exemption reuses `@attalabs/aeg-core`'s own release-branch constant, the same one `body-bare-digits`'s Changesets-release exemption is keyed on, rather than inventing a second branch-name special-case; unlike that check it never live-fetches a PR author and reads the branch from local git only, never from an env var. Written after four separate published-package pull requests, over the course of one day, each merged with no changeset and caught only by a human after the fact — the obligation existed in no enforceable place before this check: not in `roles/developer.md`'s deliverable conventions (now amended alongside this row), not in any registered check. Zero I/O in the pure predicate (`changeset-coverage-logic.ts`); the bin supplies the only I/O — reading the config, every fixed-group member's own manifest, and the diff. Registered in `coreCheckRegistry()`. Blocking: a finding is `error` severity and exits non-zero, so the pre-push hook refuses the push and CI fails the pull request. The one waiver is an empty changeset (`bunx changeset add --empty`) — a file in the diff, so it cannot be forgotten; there is no label or pull-request-body escape. The failure message names both remedies: add a changeset describing the change, or add an empty one when the change ships nothing users see. | product | `apps/cli/src/checks/bin/check-changeset-coverage.ts` |
155
156
  | quoted-command | Ever read a doc that quoted a command as "what runs today", and the command changed underneath it? | ci | Re-checks that a doc's explicitly marked quote of a command or config line still matches, verbatim, the file it names as its source. | Marker-based only, by explicit Principal decision, not inferred from command-looking spans: a doc opts a span in with `<!-- AEG:QUOTES-FILE:START:<path> -->…<!-- AEG:QUOTES-FILE:END -->` (the same invisible-on-render, code-blind HTML-comment idiom `anchored-region.ts` uses for its own seven PR/Issue-body fields, reusing that file's masking primitive rather than a second parser — but a distinct marker kind, since the cited path is free text, not one of that file's seven closed field names). An adopter-facing command in a README with no marker is instruction, not a claim, and is never flagged — inference over command-looking spans was explicitly rejected as the false-positive shape that gets a gate disabled. `findCitedQuotes` sweeps the identical `ships`/`reader-facing` corpus `reader-resolvable-prose` sweeps (never a second notion of "governed doc"); `evaluateCitedQuotes` then checks each marked span against its cited file's live content, wherever that file lives in the repo, naming both sides in a finding — what the doc claims, and which file no longer contains it verbatim. Zero I/O in `@attalabs/aeg-core`'s pure predicate (`quoted-command.ts`), corpus-tested against the real `aeg-root/**` tree; the bin supplies the only I/O. Ships with one real, live annotation (this very paragraph's own sibling callout above, quoting the CI invocation this page names) rather than only synthetic fixtures. Written after a measured incident: a CI invocation was pinned to a version in one pull request; this page quoted the pre-pin form verbatim as current fact; every registered check passed, `doctor` reported healthy, security passed, and a code-review agent found the drift only after independent re-derivation. Registered in `coreCheckRegistry()`, report-only like `reader-resolvable-prose`/`retired-vocabulary`/`doctrine-portability`/`workspace-escape`/`changeset-coverage` above — graduating to a blocking check is a later, separately-dispatched decision once the false-positive rate is observed against real adopter corpora; v1 carries no waiver escape. | product | `apps/cli/src/checks/bin/check-quoted-command.ts` |
156
157
  | Bare code-fact digits in a PR body | Ever had a PR body cite a line number that drifted the moment the file changed? | ci | Re-checks that a pull request's narrative prose carries no bare `<path>.<ext>:<digits>` code-fact pointer outside a fenced code span or a `Premise:` pin. | A bare digit anywhere in the body outside a fenced/indented code block or a documented anchor (`Closes`/`Project`/`Tier`/`Evidence`) — an Issue/PR ref, a date, a version, a path, a section number, a pass count, a duration, all need their own backticks or a fenced block, never bare prose. Reports every violation the body carries in one pass, not only the first (O12) — a mechanically-fixable body is corrected in one round, not one round-trip per digit. Its own workflow (`ownWorkflow: true`), `pull_request_target`-triggered only, never `pull_request` — a live-fetched author/branch check a `pull_request`-triggered run of this same file could otherwise spoof via the PR's own workflow YAML. | product | `apps/cli/src/checks/bin/check-body-bare-digits.ts` |
157
158
  | Evidence-block freshness | Ever seen a PR's own "tests pass" claim go stale the moment someone pushed again? | ci | Re-checks that a PR's Evidence block still matches a fresh recompute at the PR's current head. | Group A (the diff stat) is recomputed exactly and byte-compared — a hand-typed or stale diff stat cannot survive this. Group B (the real gate run) and Group C (the `[agent]` fenced command list `vinaya pr report` runs) are checked for staleness against the current head, never re-run here — this closes fabrication for the two facts a checker can cheaply recompute, never for the Decisions section's prose. Resolves the real PR head via `gh pr view --json headRefOid`, never `HEAD` (the merge commit in CI). | product | `apps/cli/src/checks/bin/check-evidence-fresh.ts` |
158
- | Documentation gate (PR open/edit) | Ever opened a PR, watched the doc-coverage gate pass, then pushed a second commit that broke it? | ci | Re-checks C5 doc-coverage — the SAME code→doc binding the push-time row above enforces — again at PR create/edit time, not only on push. | Every code change matching a `.vinaya/doc-owners` binding carries its owning doc in the same diff, a `Doc-ack:`/`Doc-neutral:` declaration, or an actor-verified `vinaya/waiver:docs` label, resolved live via `gh` from `PR_NUMBER` (fixing a prior silent-unreachable label lookup in an adopter's CI, where the label was never actually forwarded to this check). `roles/developer.md` names this as one of two chokepoints "at every push... and again at pull-request creation and editing" — this row is the second, previously undocumented despite already shipping and already running from `vinaya pr create`'s own pre-flight. | product | `apps/cli/src/checks/bin/check-doc-coverage.ts` |
159
+ | Documentation gate (PR open/edit) | Ever opened a PR, watched the doc-coverage gate pass, then pushed a second commit that broke it? | ci | Re-checks C5 doc-coverage — the SAME code→doc binding the commit-time row above enforces — again at PR create/edit time, not only on push. | Every code change matching a `.vinaya/doc-owners` binding carries its owning doc in the same diff, a `Doc-ack:`/`Doc-neutral:` declaration, or an actor-verified `vinaya/waiver:docs` label, resolved live via `gh` from `PR_NUMBER` (fixing a prior silent-unreachable label lookup in an adopter's CI, where the label was never actually forwarded to this check). Git's `GIT_INDEX_FILE` is insufficient on its own because pre-push receives it too: only the runner's pre-commit `--skip-full` mode supplies `VINAYA_COMMIT_HOOK=1`, which makes staged changes count there; at PR open/edit, pre-push, and CI the check judges exactly the committed branch diff. `roles/developer.md` names this as one of two chokepoints "at every push... and again at pull-request creation and editing" — this row is the second, previously undocumented despite already shipping and already running from `vinaya pr create`'s own pre-flight. | product | `apps/cli/src/checks/bin/check-doc-coverage.ts` |
159
160
  | Surface-scope (out-of-boundary file) | Ever had a "small" task quietly touch a file its own plan said it wouldn't? | ci | Re-checks that a task branch's changed files stay inside its own Issue's declared `## Surface` — never inside a declared `out:` glob. | Every file in the branch's diff against `origin/main` is checked against the task's own Issue (resolved from the branch name → forge topology → Issue number → `## Surface` `out:` list) with the same `globCoversPath` predicate the Issue-authoring gate and the blast-radius check (O4) both already use — an undeclared boundary crossing is caught mechanically, naming the file and the glob it crosses, rather than depending on a reviewer noticing. Same check runs at the `git push` hook (ring 0) and again here — same runner, one codebase, two enforcement points. Dormant (never blocks) when the branch is not a task branch, the forge/repo cannot be resolved or reached, the task's row carries no Issue yet, the Issue's `## Surface` doesn't parse (below the brief-sections cutover, or malformed — caught at authoring time instead), or the Issue declares no `out:` globs at all. | product | `apps/cli/src/checks/bin/check-surface-scope.ts` |
160
161
  | PR-body premise reassertion | Ever had a brief's pinned fact quietly go stale, and the merge never noticed? | ci | Re-checks, in CI, that a pull request body's `Premise:` pins still hold against the PR's own current tree — not only at Step 0, authoring time. | Every `contains`/`absent`/`sha256` pin `parsePremiseBlock` extracts from the PR body, re-asserted via the same frozen `checkPremises`/`reassertPremiseFile` (`apps/cli/src/checks/premise-reassert-logic.ts`) `verify-dispatch --premise` already uses at Step 0 — a second caller, not a second implementation, so a pin the PR's own diff falsifies fails CI instead of merging as decoration. Trigger is the block's presence alone: a body with no `Premise:` header parses to zero pins and this check is silent, on every branch — there is no branch-name condition anywhere in it. | product | `apps/cli/src/checks/bin/check-pr-premise-reassert.ts` |
161
162
  **G-checks rollout (task 3):** G1/G2 shipped report-only at first — they could only ever print an `info` finding, never fail CI, so pre-existing gaps (four orphan hooks, several orphan `bin/*.ts` CLIs found on first run) surfaced as visible debt without retroactively failing in-flight work. G3/G4/G5 have been blocking since that same tranche. **G1 flipped to blocking in task 8**, once its report-only window had let the orphan backlog get cleaned up — a permanent `info` finding on every run is indistinguishable from silence, which is exactly how the gap task 8 closes (G6, below) stayed invisible for as long as it did. **G2 flipped to blocking in this same wave**, the same way: its remaining backlog was fourteen files that were never orphans at all, only the second physical form of an already-documented mechanism G2's own string-equality test was too narrow to see (closed by the twin-form recognition described in G2's own row, above) plus two genuinely non-gate files (`NON_GATE_BINS` already named them) — a standing `info` finding on every run had become exactly the same silence-by-permanence G1's report-only window risked, which is the failure a gate that "trains its readers to ignore warnings" produces. **G6 — doctrine-registry parity**, also added in task 8, ships blocking from the start: it checks that every row this page marks `product` (the `Audience` column, above) actually resolves to a real `coreCheckRegistry()` entry, closing the gap where a row could claim shipped enforcement that no adopter's `vinaya check` ever actually ran.
162
163
 
163
164
  **reader-resolvable-prose / retired-vocabulary rollout (task 15; task 7 registered both in `coreCheckRegistry()`):** both ship report-only, same precedent as G1/G2 above — each can only ever print a `warning` finding, never fail CI (the check's own exit code stays `0`), so any real backlog surfaces as visible debt rather than a wave of newly-red pull requests (161 findings, all class 2, across `aeg-root` on the day `reader-resolvable-prose` first shipped). A later, separately-dispatched task flips either to blocking once its own backlog is cleared. **`reader-resolvable-prose`'s `ships`/`reader-facing`/vocabulary classes stay report-only under this rollout; `retired-vocabulary` is unaffected in full.** Only `reader-resolvable-prose`'s fourth, `product` class (see the row above) graduated to blocking, ahead of the rest: a tranche-slug citation in product code fails outright, at both `git push` and CI. **Exception, both checks (checkout-independent doctrine-root resolution):** the unconfigured doctrine-root default now resolves relative to the repo actually under check (its own real repository root) first, falling back to the check's own package-relative "shipped copy" resolution only when the repo under check has no local doctrine tree of its own — so the same commit sweeps identically regardless of where it happens to be checked out. When NEITHER resolves (no doctrine tree findable at all, relative to either anchor), that is not a `warning` finding and not a clean pass — it is reported as its own distinct outcome, with a non-`0`/non-`1` exit code, so a scan that never ran cannot be mistaken for a scan that ran and found nothing.
164
165
 
165
- **changeset-coverage rollout:** ships report-only, same precedent as the report-only rows above — the check's own exit code always stays `0`, so registering it cannot newly redden any existing install. Graduating to blocking, and the waiver-label escape that graduation would need, are both deliberately deferred to a later, separately-dispatched task once the check's own false-positive rate is observed in practice; v1 carries no self-serve or principal-applied escape at all.
166
+ **changeset-coverage rollout:** blocks. It shipped report-only until its false-positive rate was known; it now exits non-zero on a shipped-file diff with no changeset. An intentional no-release change passes by carrying an empty changeset (`bunx changeset add --empty`); there is no waiver label.
166
167
 
167
168
  **quoted-command rollout:** ships report-only, same precedent as every row above — findings print at `warning` severity and the check's own exit code always stays `0`, so registering it cannot newly redden any existing install, and coverage starts at exactly one annotated quote (this page's own CI-invocation callout, above) rather than a retroactive sweep. Graduating to blocking, and any waiver-label escape that graduation would need, are both deliberately deferred to a later, separately-dispatched task once the marker's real-world false-positive rate is observed; v1 carries no such escape.
168
169
 
@@ -26,6 +26,8 @@ Working manually, with no driver behind you, you do all of it yourself, exactly
26
26
 
27
27
  **Opening the PR with a complete description.** The PR description must (1) **carry the report only** — the brief itself never rides in this body at all; it is already posted, frozen, as the task Issue's `aeg:brief:v1` comment by `vinaya task dispatch`, before your worktree even exists, and that comment is the brief's permanent, durable home — the Reviewer and Archivist read it there; (2) follow the canonical form in [§ PR body — canonical form](#pr-body--canonical-form) below — that section holds the verbatim copy-pasteable template, including the **exact `Tier:` field syntax** the `verify-docs` gate requires; (3) reference the task's Issue (`Closes #N`) so the merge auto-closes it. The description is not optional — the reviews depend on it. Opening the PR is itself the `in-flight → in-review` transition; you write no status field. **The body is authored once, at open.** After the PR is open, you never hand-edit it again — not to append a response to a review round, not to record a decision, not for any reason. One write is sanctioned after open, machine-regenerated and never typed: the Evidence block (see [§ Evidence is emitted, never typed](#evidence-is-emitted-never-typed)). Everything else a review round produces — your response to findings, re-run `[agent]` evidence, any disclosure the brief didn't anticipate — is a PR comment.
28
28
 
29
+ **Re-pin a premise you legitimately change.** A brief's premise records the state at dispatch, not a requirement to preserve that state. When the task removes or renames text a premise pins, update the PR body's anchored `Premise` block in the same publication to a true post-change pin: use `absent` for removed text, or pin the replacement text. Record what changed and why under `## Decisions`. Do not leave the old pin for the re-check to reject, and do not invent a command: `premise-recheck` reads the body's premise assertions.
30
+
29
31
 
30
32
  ---
31
33
 
@@ -119,17 +121,16 @@ After open, the Developer changes nothing in the PR body at all — the driver's
119
121
 
120
122
  Documentation is not post-implementation optional cleanup. It is part of the task. A brief is not done until all tier-required documentation artifacts exist and pass verification. Your brief carries an explicit documentation-update list (by file name) — treat it as a DoD obligation, not a suggestion. A task that ships passing tests but incoherent docs is incomplete in the same way a task that ships with failing tests is incomplete. Every doc named in that list must be updated before opening the PR; a named doc not in the diff is a BLOCKER at review.
121
123
 
122
- **Update-or-waive is a DoD gate.** Beyond that list, `verify-docs` C5 mechanically enforces code → doc coverage from `.vinaya/doc-owners`. Whenever your diff touches a code surface bound in that file, you must do exactly one of: (a) update the bound doc in the same PR; (b) for URL bindings, add a `Doc-ack: <pointer> — <note>` body field; (c) have a principal apply the actor-verified `vinaya/waiver:docs` label to the PR — you cannot self-serve this one; it is not a body field and not something you can write yourself. Doing none of these is not an option; the gate will fail CI. The seam is dormant when `.vinaya/doc-owners` is absent or no binding matches, so a PR that touches no bound surface has no obligation.
124
+ **Update-or-waive is a DoD gate.** Beyond that list, `verify-docs` C5 mechanically enforces code → doc coverage from `.vinaya/doc-owners`. Whenever your diff touches a code surface bound in that file, you must do exactly one of: (a) update the bound doc in the same PR; (b) for URL bindings, add a `Doc-ack: <pointer> — <note>` body field; (c) have a principal apply the actor-verified `vinaya/waiver:docs` label to the PR — you cannot self-serve this one; it is not a body field and not something you can write yourself. Doing none of these is not an option; the gate will fail CI. This coverage seam — the documented handoff between code ownership and documentation ownership — is dormant when `.vinaya/doc-owners` is absent or no binding matches, so a PR that touches no bound surface has no obligation.
123
125
 
124
- > The commands shown below are **this repo's** toolchain (Bun/JS). Substitute your repo's declared equivalents; the *obligations* (typecheck, lint, test, verify-docs) are the same everywhere.
126
+ > The commands shown below are **this repo's** toolchain (Bun/JS). Substitute your repo's declared equivalents. Under the review loop, the controller runs static gates: the commit hook formats and lints staged files with safe fixes, typechecks affected packages, and runs Vinaya checks; the push hook runs affected tests; `run_checks` and CI provide authoritative results. A dispatched Developer does not hand-run, paste, or block on typecheck, lint/format, build, or documentation-gate output. Working manually, with no driver, run the commands named below yourself.
125
127
 
126
128
  ### Tier 0 checklist
127
129
 
128
130
  All of the following must pass before the PR is opened:
129
131
 
130
- - [ ] Code passes typecheck (this repo: `bun run typecheck`)
131
- - [ ] Code passes lint/format (this repo: `bun run format-and-lint`)
132
- - [ ] Tests pass if applicable — the pre-push hook's own affected-selection run, on your one push; never hand-run before pushing (see [§ Verification before reporting done](#verification-before-reporting-done) item 3)
132
+ - [ ] Under the review loop, the controller's commit hook, push hook, `run_checks`, and CI report the static gates passing; a dispatched Developer does not run them by hand.
133
+ - [ ] Working manually: code passes typecheck (this repo: `bun run typecheck`) and lint/format (this repo: `bun run format-and-lint`); the pre-push hook runs affected tests on the one push.
133
134
  - [ ] PR description follows the template, carries the report, and declares `Tier: 0`
134
135
 
135
136
  ### Tier 1 checklist
@@ -138,7 +139,7 @@ All Tier 0 items, plus:
138
139
 
139
140
  - [ ] Specs updated to reflect new behavior (if new patterns introduced or existing patterns changed)
140
141
  - [ ] Skills updated if conventions shifted in the area being changed
141
- - [ ] `verify-docs --pr` passes (this is a real gate now, not a stub; this repo: `bun run verify-docs --pr`)
142
+ - [ ] Under the review loop, `run_checks` reports the documentation gate passing; working manually, `verify-docs --pr` passes (this repo: `bun run verify-docs --pr`).
142
143
  - [ ] `docs-index.md` updated if files were added, removed, or renamed
143
144
 
144
145
  ### Tier 3 checklist
@@ -150,7 +151,7 @@ All Tier 1 items, plus:
150
151
 
151
152
  **Hard rule:** If any tier-required item fails, the PR is not ready. Do not open it. Do not say "I'll fix the doc issues after merge." Fix them before.
152
153
 
153
- **Pre-PR gate (mandatory for every PR):** Before opening, confirm the Tier checklist above is genuinely satisfied — every item ticked, evidence in hand, not merely believed — and separately confirm doc-owners coverage: `vinaya check doc-coverage` locally with `PR_BODY` set to the intended PR body text (`PR_BODY="$(cat /tmp/pr-body.md)" vinaya check doc-coverage`). Fix any failure from either. Never open a PR that would fail either. **On this repo's toolchain**, `bun packages/aeg-core/bin/verify-docs.ts --pr` runs both checks — the tier checklist and doc-owners coverage — as one composite command; no shipped `vinaya` subcommand currently automates the tier-checklist half for an adopter, so self-verify it against the checklist above where this script isn't available.
154
+ **Pre-PR gate (mandatory for every PR):** Under the review loop, use the controller's `run_checks`, publication hooks, and CI as the evidence that the Tier checklist and doc-owners coverage are satisfied; fix a failure returned by one of those authorities. Working manually, confirm the Tier checklist and doc-owners coverage yourself with `PR_BODY` set to the intended PR body text (`PR_BODY="$(cat /tmp/pr-body.md)" vinaya check doc-coverage`). **On this repo's toolchain**, `bun packages/aeg-core/bin/verify-docs.ts --pr` runs both checks — the tier checklist and doc-owners coverage — as one composite command; no shipped `vinaya` subcommand currently automates the tier-checklist half for an adopter, so self-verify it against the checklist above where this script isn't available.
154
155
 
155
156
  ---
156
157
 
@@ -173,11 +174,14 @@ Your turn ends once your work is published: dispatched, when `publish_changes` h
173
174
  This is a change from before. It used to take four more steps — merge main if behind, regenerate the Evidence block, post a `Head: <sha>` comment carrying the round marker, tick nothing — and the second of those, a full re-run of the real gate suite, could take past ten minutes on a real Test Plan and stall the whole loop waiting on your one tool call to finish. None of those four steps are yours any more:
174
175
 
175
176
  - **The `AEG:EVIDENCE` block** is regenerated by the driver itself, in-process, the moment your head's required CI turns green — the same engine module `vinaya pr report --push` always called, now also called directly by the loop's own driver rather than shelled out to as a subprocess.
176
- - **The round marker comment** — `Head: <sha>`, `<!-- aeg:developer:round-<n> -->`, and (starting from round 2) the ids of the findings you addressed — is composed and posted by the driver too, from a small side-channel file you write before your turn ends: see the next paragraph.
177
+ - **The round marker comment** — `Head: <sha>`, `<!-- aeg:developer:round-<n> -->`, and (starting from round 2) the ids of the findings you addressed — is composed and posted by the driver too, from the turn result you end your turn with: see the next paragraph.
177
178
  - **A branch behind its base** is caught by the driver's own mergeability check before it ever dispatches a reviewer or runs the report — you never need to check this yourself; a conflicting head is sent back to you with the conflicting files named, same as before.
178
179
  - **Ticking `[agent]`/`[principal]` boxes** was never yours to begin with (task 12; Principal ruling: an agent never ticks a box or edits a PR body) — nothing changes there.
179
180
 
180
- **Citing which findings you addressed, from round 2 on.** When your resumed turn is sent back to fix review findings, write a `FINDING_IDS:` line — the same comma-separated grammar the reviewer's own `report.txt` already uses — naming the ids (e.g. `F1`, `F2`) you addressed this round, before your turn ends. Your own prompt this round names the exact absolute path to write it to — under that round's own Developer folder inside your task's folder, never at the root of your worktree, and never the same path an earlier round used. The driver reads and clears this file itself once your push lands and the head goes green, and folds it into the round comment it composes. This file is best-effort by design: if you forget it, or your turn crashes before writing it, the driver still posts the round comment — with no citation line — and the round is never judged stalled for want of one. You are never resumed a second time just to write it. Your confidence line (see the confidence instruction your own resumed prompt carries, from round 2 on) follows the identical convention: an absolute path your prompt names each round, never a fixed worktree-relative one.
181
+ <!-- AEG:CLAIM: apps/cli/src/lib/dev-review-loop/turn-result.ts contains:export function turnResultInstruction( -->
182
+ **Your turn result — how every turn ends.** Every dispatched turn, round 1 and every resume alike, ends with one structured turn result, returned as your coding agent's own structured final output (Claude Code `--json-schema`, Codex `--output-schema`, which the driver passes for you): the driver reads nothing else as your result, so you write no confidence or round-response file. Its `status` is `completed` when the turn's work is done — with a one-sentence `summary`, your `confidence` (a whole number from 0 to 100), a `confidenceExplanation` of one short sentence, `addressedFindingIds`, `sourceUses` and, optionally, `reportedChecks`; `blocked` when a stop condition halts you — with a typed `blocker`; or `needs_ruling` when only the Principal can decide — with your `question` and the permissible `decisions` to choose between. Your prompt spells out each field. `addressedFindingIds` is empty in round 1; from round 2 on, a turn sent back to fix review findings names the finding ids it addressed, from the list its prompt carries (e.g. `R1-CR-1`, `R1-SEC-2`). `sourceUses` names, for every required source in the brief's `## Documentation`, the decision it informed — and a URL source counts only when the driver recorded your read of it (the `fetch_documentation` tool is the sure route). `reportedChecks` is your own account of what you ran: the driver shows it as context, never as evidence. The driver alone accepts the result: one it rejects is sent back to the SAME session once, naming only the failures, for a corrected result — change and publish nothing for that — and a second rejection pauses the round. A `blocked` or `needs_ruling` result pauses the round for the Principal.
183
+
184
+ **Use the file-writing tool for round files.** Until the turn result replaces them, write the round's confidence and round-response files with the file-writing tool, never a shell redirect. The sandboxed shell often cannot write the round folder; the tool can write the exact prompt-provided path and preserves the driver hand-off.
181
185
 
182
186
  Then stop. Review is a separate invocation.
183
187
 
@@ -227,6 +231,7 @@ Every brief includes stop conditions. Honor them unconditionally. Common reasons
227
231
  - You are about to touch files outside the brief's stated scope — stop and ask first
228
232
  - Any destructive action (force push, file deletion, database mutation) not explicitly authorized by the brief
229
233
  - You discover a decision that should be Type 1 (irreversible) but the brief doesn't mention it
234
+ - A link or file the task references cannot be opened — stop at once and return a `blocked` turn result with kind `preflight_failed`, naming the reference. For a URL under the review loop, "cannot be opened" means the driver's `fetch_documentation` tool failed to read it; a `curl` or other network call your sandbox blocks never counts, so read the URL with `fetch_documentation` before deciding. Working without the driver's tools, it means your own fetch failed. Never develop around it: the task named it because the work needs what it holds.
230
235
 
231
236
  ---
232
237
 
@@ -275,7 +280,7 @@ After every commit: `git log --oneline -3` to confirm the new commit is a direct
275
280
  - Reference the task's Issue in the PR body (`Closes #N`), not necessarily in every commit message
276
281
  - Do not include agent self-attribution / "generated by" trailers in commit messages
277
282
  - Never skip verification hooks on commits unless the brief explicitly authorizes it
278
- - A change to a published package's shipped files carries its `.changeset/*.md` entry in the same PR — the `changeset-coverage` check (`aeg-root/enforcement.md`) reports, but does not yet block, a diff that misses this
283
+ - A change to a published package's shipped files carries its `.changeset/*.md` entry in the same PR — the `changeset-coverage` check (`aeg-root/enforcement.md`) blocks a push and fails CI on a diff that misses this; a change that ships nothing users see declares that with an empty changeset (`bunx changeset add --empty`)
279
284
 
280
285
  ---
281
286
 
@@ -300,20 +305,15 @@ A code comment, a pull-request body, and a doctrine page each describe the thing
300
305
 
301
306
  ## Verification before reporting done
302
307
 
303
- Before you say you are done or open a PR, run all of the following (substitute your repo's toolchain commands — shown here in this repo's Bun/JS form). Paste the actual output when reporting — not a summary.
308
+ Under the review loop, static gates are controller work. Do not hand-run typecheck, lint/format, the build, `verify-docs`, or the affected-test selection; do not paste their output. The commit hook applies safe format/lint fixes to staged files, typechecks affected packages, and runs Vinaya checks. The pre-push hook runs `bun apps/cli/src/lib/pre-push-select-tests.ts | xargs -r bun test --timeout=30000 --` on the one push; `run_checks` and CI are the authoritative reports. CI runs `bun run test`, and the controller runs `bun packages/aeg-core/bin/verify-task.ts` when opening a task PR. A check you ran by hand is never a reason to return a `blocked` turn result. Treat only a failure returned by `run_checks`, a hook, or CI as a gate failure, and fix it before continuing.
304
309
 
305
- 0. **Commit message length** — for every commit on this branch: `git log origin/main..HEAD --format="%s" | awk '{ if (length > 72) print NR": "length" chars (OVER LIMIT): "$0 }'` — must return nothing. If any commit header exceeds 72 chars, amend it before opening the PR.
306
- 1. `typecheck` (this repo: `bun run typecheck`) — paste the result line ("X successful, X total" or the error)
307
- 2. `lint/format` (this repo: `bun run format-and-lint`) — paste "No fixes applied" or the violations
308
- 3. **the affected tests — run exactly once, by the pre-push hook, on your one push; never a hand-run of the selection first and never a hand-run full suite.** The hook (this repo: `bun apps/cli/src/lib/pre-push-select-tests.ts | xargs -r bun test --timeout=30000 --`) IS this run — it selects and runs the depth-one suite itself and refuses the push on failure, so running that same selection yourself beforehand duplicates work the hook is about to do anyway, for no earlier catch: a failure the hand-run would have caught, the hook catches at the same push, at the same cost. Paste the hook's own "selected N of M" / "X pass, 0 fail" lines from your push's own terminal output as your evidence here — never a second, separately-run copy. Never hand-run the whole suite (`bun run test` with no file arguments) either: CI's own shards run every test regardless of what the hook selected, so a full local run only duplicates work CI already does, costing real minutes on a change to a widely-imported module.
309
- 4. `verify-docs --pr` (this repo: `bun run verify-docs --pr`) — paste the result (real gate now — pass, or the specific failure to fix)
310
- 5. `git status` — must be clean (everything committed) or explain what's uncommitted and why
311
- 6. `git log --oneline -3` — confirm commit ancestry is correct (new commit is direct child of expected parent)
312
- 7. `git diff main --stat` — paste the full change list; confirm only expected files changed
310
+ Before you say you are done or open a PR under the review loop:
313
311
 
314
- If any of these fail: fix the failure, then re-verify. Do not report done until all pass. Do not say "tests pass" without running the test command and seeing the output.
312
+ 0. **Commit message length** — for every commit on this branch: `git log origin/main..HEAD --format="%s" | awk '{ if (length > 72) print NR": "length" chars (OVER LIMIT): "$0 }'` — must return nothing. If any commit header exceeds 72 chars, amend it before opening the PR.
313
+ 1. Publish through the driver and read the publication hooks' result; use `run_checks` for the current head and read its result.
314
+ 2. Confirm `git status` is clean and `git log --oneline -3` has the expected ancestry. `git diff origin/main...HEAD --stat` is context for the report only; judge Surface through the driver's `surface-scope` check, never a diff run by hand.
315
315
 
316
- Items 1–4 are also composed into one command, `bun packages/aeg-core/bin/verify-task.ts` (plus a build step and the premise coverage/recheck pair) — **`open-pr.ts` now runs this composite itself** for task branches (task 25), so it also runs mechanically at PR-open time. Running it yourself first remains the cheaper, earlier catch.
316
+ Working manually, with no driver, run the same static gates yourself before opening: `bun run typecheck`, `bun run format-and-lint`, the repository's production build, and `bun run verify-docs --pr`. The pre-push hook runs the affected suite once on the push; do not separately hand-run that selection or the full suite.
317
317
 
318
318
  ---
319
319
 
@@ -323,6 +323,8 @@ The checks above are **static**: they prove the change compiles, lints, types an
323
323
 
324
324
  **It is a phase, not an actor.** There is no Verifier to dispatch. The plan splits by who can structurally execute it: `vinaya pr report` runs the `[agent]` half's fenced command list from the PR head and writes it into `AEG:EVIDENCE`; the Principal runs the `[principal]` half in a real signed-in browser and ticks its boxes. Both halves must be satisfied before a merge is allowed — the `[agent]` half by the Evidence block existing and matching a fresh recompute (`evidence-fresh`), the `[principal]` half by every unticked `[principal]` box in the PR body, which `review-gate` refuses a merge while any remain unticked — `test-plan` grades the `[agent]` half and the plan's structure only; it is `principalOwed`, so its own `pending` failure never blocks the loop's mechanical gate, and enforcement of the unticked box lives at `review-gate` instead.
325
325
 
326
+ **Live proofs needing an operator login stay on the host.** Never run a proof command that starts a real subscription-authenticated coding-agent session from inside the Developer sandbox: the operator's login is unreachable there. Build the command and its tests, list the exact command lines in the pull request's `[principal]` test-plan items, and leave the operator to run them on the host and add the resulting output.
327
+
326
328
  **Why it exists:** four consecutive features once merged with green CI and were broken at runtime — a missing migration, a missing environment variable, a missing provider, an unexecuted test plan. The static gates ran and passed; the reviews read the diff; nobody booted the app. Verification is the phase that closes that gap.
327
329
 
328
330
  ### Refuse if it isn't your turn
@@ -378,7 +380,7 @@ If any fails: post a comment listing the exact items missing, and STOP. The Prin
378
380
 
379
381
  These are failures the Developer must actively avoid. Several come from real incidents.
380
382
 
381
- **Trusting your own self-report without diff inspection.** Run `git diff main --stat` and read it before reporting done.
383
+ **Trusting your own self-report without the authoritative surface gate.** Read the driver’s `surface-scope` result; a hand-run `git diff origin/main...HEAD --stat` is context, never the Surface verdict.
382
384
 
383
385
  **Reviewing your own work instead of handing off.** The code-reviewer and security passes are separate invocations for a reason — fresh eyes catch what the author's context hides.
384
386
 
@@ -33,7 +33,7 @@ summary: Ever had someone review their own work?
33
33
  ---
34
34
  # Developer — Role Reference
35
35
 
36
- **Read receipt — do this first.** `vinaya doctrine --role developer --print`'s output begins with a fixed acknowledgement token, one line, before anything else. Your first message in this session must repeat that exact token verbatim — e.g. `ACK: <token>` — so a transcript proves this doctrine was read, checked with one grep. The token lives only in this file's frontmatter, never in this paragraph, so editing this paragraph never invalidates a past session's proof.
36
+ **Read receipt — do this first.** `vinaya doctrine --role developer --print`'s output begins with a fixed acknowledgement token, one line, before anything else. Your first message in this session must repeat that exact token verbatim — e.g. `ACK: <token>` — so a transcript proves this doctrine was read, checked with one grep. The token lives only in this file's frontmatter, never in this paragraph, so editing this paragraph never invalidates a past session's proof. A session the review loop dispatched gives no receipt: the driver puts this role's short version and checklist in your prompt itself and reads only your turn's result or output files.
37
37
 
38
38
  ## The short version
39
39
 
@@ -49,10 +49,10 @@ You execute **one** brief, on **one** branch, and answer for it. You are the onl
49
49
 
50
50
  **Who commits and publishes.** Under the review loop, Claude and Codex alike, you hold no forge credential and run no `git push` or `gh`: you publish, open and read your pull request, and run its checks only through tools the driver runs outside your sandbox — `publish_changes`, `open_pull_request`, `read_pull_request`, `run_checks` — each returning a success or a refusal you act on. Working manually, you do it all yourself (reference).
51
51
 
52
-
53
52
  ---
54
53
 
55
54
  ## Reference
55
+ **Surface:** judge it by the driver's `surface-scope` check, never by a diff run by hand.
56
56
 
57
57
  **Audience:** the coding agent (whatever CLI/IDE agent the team uses), executing a dispatched brief.
58
58
 
@@ -106,9 +106,9 @@ Before writing any code, validate the following — and refuse if any fails:
106
106
  5. **Prior-tranche-archival precondition.** Before opening a PR against any product, confirm each product named in the brief's `Project:` field has its previous tranche archived. For each product, check whether a prior tranche for that product has an open Milestone (forge-native) — or, for a tranche still carrying a pre-cutover topology file, exists in `aeg-root/tranches/` but NOT in `aeg-root/tranches/completed/` (legacy exception; a forge-native tranche carries no such file to check). If any such unarchived tranche exists and all its task PRs are merged, the Tranche Archivist has not run. STOP: *"Product `<X>`'s previous tranche `<name>` is complete but not archived — the Tranche Archivist must run before new work on this product. Dispatch it first."* If there is no prior tranche on a product, this gate passes trivially. The contract governing this gate is `aeg-root/contracts/tranche-archivist-planner.md`.
107
107
  6. **Branch-ID verification (hard STOP before step 0).** Before executing step 0, confirm via the forge (`vinaya/tranche:<slug>`-labeled Issue titled `[<slug>] <n> — …`, and its Milestone) — not `aeg-root/tranches/<name>.md` — that the branch-name suffix in the Step 0 command you were just handed literal-matches this task's forge-derived id `<n>` — character for character: no added prefix, no case change, no truncation. If it doesn't: *"The Step 0 branch name `task/<tranche>/<X>` doesn't match this task's topology ID `<Y>` — STOP, do not create the worktree/branch; report the mismatch to the Planner/Principal rather than silently using either name."* Do not begin work.
108
108
  7. **Row-existence precondition (hard STOP before step 0).** Before executing step 0, confirm via the forge (`vinaya/tranche:<slug>`-labeled Issue titled `[<slug>] <n> — …`, and its Milestone) — not `aeg-root/tranches/<name>.md` — that this task's row exists **at all**. This is distinct from and prior to item 3's `#TBD`/blank check: a missing row means the plan/Issue for this task has not merged/opened yet, and there is nothing to inspect — no Issue, no dependencies, no `Project(s)` value. If the row is absent: STOP: *"Task <id> is not present in tranche `<name>`'s forge-derived task list (no `vinaya/tranche:<name>`-labeled Issue with this task id yet) — the plan/Issue for this task hasn't merged/opened. Not dispatchable until it does."* Do not begin work.
109
- 8. **Documentation sources, read before step 0.** Before executing step 0, fetch every source named in the brief's own `## Documentation` section — each one fetched (a URL) or read (an in-repo path) in full, not skimmed from its own summary. For each, record two facts (in the PR body's Decisions section at open — see [§ PR body — canonical form](developer/reference.md#pr-body--canonical-form)): the mechanism you confirmed it governs, and the specific supported runtime/protocol version that source states — a real value read off the page (as `[task-operator-v1] 2` recorded `2.1.197`, verified live), never copied from training-data memory and never invented. When the host you're running on genuinely cannot confirm a version (the source doesn't state one, or nothing on this host can check it live), record that explicitly — `unverifiable: <why>` — rather than a guessed number; an explicit unverifiable marker is honest, a plausible-looking invented one is not. This is never your own judgement call to skip: for every URL-shaped source, the driver mechanically records whether your session actually fetched it, and refuses to let your turn end while one remains unfetched — an honest miss is always caught, and you never get to decide you read "enough." **What this does not do:** it is a mechanical backstop against an inattentive skip, not a sandboxed guarantee against a session that deliberately tampers with the record files it reads (round 2 security review, CRITICAL) — this dispatch's own Bash access reaches the same files the hooks trust, the same trust model every other self-reported artifact in this contract already carries (your confidence line, your token report, your test output: reviewed and re-verified independently, never sandboxed against you). Fetching the source honestly is always the faster path; do that, and the gate clears itself. A `## Documentation` section carrying only the `None` sentinel, or only in-repo paths, owes nothing to this gate — an in-repo path's own read is never mechanically observed this way, so read it anyway; the obligation is the same, only the enforcement differs. **On this repo's toolchain**, this is a `PostToolUse` hook (matcher `WebFetch`) plus a `Stop` hook wired into the dispatched session's own settings (`apps/cli/src/lib/dispatch.ts`'s `writeDispatchSettings`) — the Stop hook exits 2, which on Claude Code "prevents Claude from stopping, continues the conversation," naming every unfetched source; see this repo's own `apps/cli/specs/loop.md`, "The Documentation read-gate," for the mechanism's wiring. On another host, satisfy the paragraph above by whatever means that host offers for observing a fetch and blocking a stop — reusing this exact hook shape is not required.
109
+ 8. **Documentation sources, read before step 0.** Before executing step 0, fetch every source named in the brief's own `## Documentation` section — each one fetched (a URL) or read (an in-repo path) in full, not skimmed from its own summary. For each, record two facts (in the PR body's Decisions section at open — see [§ PR body — canonical form](developer/reference.md#pr-body--canonical-form)): the mechanism you confirmed it governs, and the specific supported runtime/protocol version that source states — a real value read off the page (as `[task-operator-v1] 2` recorded `2.1.197`, verified live), never copied from training-data memory and never invented. When the host you're running on genuinely cannot confirm a version (the source doesn't state one, or nothing on this host can check it live), record that explicitly — `unverifiable: <why>` — rather than a guessed number; an explicit unverifiable marker is honest, a plausible-looking invented one is not. This is never your own judgement call to skip: for every URL-shaped source, the driver mechanically records whether your session actually fetched it, and refuses to let your turn end while one remains unfetched — an honest miss is always caught, and you never get to decide you read "enough." **What this does not do:** it is a mechanical backstop against an inattentive skip, not a sandboxed guarantee against a session that deliberately tampers with the record files it reads (round 2 security review, CRITICAL) — this dispatch's own Bash access reaches the same files the hooks trust, the same trust model every other self-reported artifact in this contract already carries (your turn result's reported checks, your test output: reviewed and re-verified independently, never sandboxed against you). Fetching the source honestly is always the faster path; do that, and the gate clears itself. A `## Documentation` section carrying only the `None` sentinel, or only in-repo paths, owes nothing to this gate — an in-repo path's own read is never mechanically observed this way, so read it anyway; the obligation is the same, only the enforcement differs. **On this repo's toolchain**, this is a `PostToolUse` hook (matcher `WebFetch`) plus a `Stop` hook wired into the dispatched session's own settings (`apps/cli/src/lib/dispatch.ts`'s `writeDispatchSettings`) — the Stop hook exits 2, which on Claude Code "prevents Claude from stopping, continues the conversation," naming every unfetched source; see this repo's own `apps/cli/specs/loop.md`, "The Documentation read-gate," for the mechanism's wiring. On another host, satisfy the paragraph above by whatever means that host offers for observing a fetch and blocking a stop — reusing this exact hook shape is not required.
110
110
 
111
- **Mechanized version of items 3, 5, and 7 — the driver's job now, never a sandboxed `gh` call of your own.** Items 3, 5, and 7 above (Issue-existence, prior-tranche-archival, row-existence) are all re-derivable in one run — the shipped `check dispatch-readiness` gate, and on this repo's toolchain, its fuller `verify-dispatch.ts` derivation (closing the shipped gate's own prior-tranche-archival parity gap). **Under `vinaya dispatch`/the review loop**, the driver runs BOTH itself, from its own unsandboxed process, against a freshly-fetched `origin/main` and the live forge, before your turn ever starts — and stages the combined verdict plus full output in this round's own Developer folder (`dispatch-readiness.txt`) — read that file rather than running either check yourself. Neither script's own `gh` call is excluded from your sandbox the way a `gh` command YOU type directly is (it is spawned BY `bun`, not typed by you), so running either one yourself inside a dispatched turn hits the denied forge-token file (`isolation.md` §4a) and fails regardless of how careful you are — found live, CI, Linux. A `NOT READY` verdict means the driver already refused this turn before you were ever dispatched; you will not see one. Item 6 (branch-ID verification) is a static check against the brief's own Step 0 text, not a mechanized command, and stays yours to confirm regardless. Item 4 is superseded and no longer part of this composed check. **This gate also runs mechanically at push time** (task 25) — the `first-push-dispatch` check, wired into every adopter's generated CI and managed `.git/hooks/pre-push`, invokes the same derivation on a task branch's first push, before its PR exists — a last-resort catch, since the hook fires only at push time, after the work is already done. **Working manually, with no driver behind you** (this brief pasted into a bare terminal session, outside `vinaya dispatch`): there is no staged file to read, so fall back to items 3, 5, and 7's own prose above, each a complete, hand-run forge check in its own right — the mechanized gate above is a convenience over them, never their only form.
111
+ **Mechanized version of items 3, 5, and 7 — the driver's job now, never a sandboxed `gh` call of your own.** Items 3, 5, and 7 above (Issue-existence, prior-tranche-archival, row-existence) are all re-derivable in one run — the shipped `check dispatch-readiness` gate, and on this repo's toolchain, its fuller `verify-dispatch.ts` derivation (closing the shipped gate's own prior-tranche-archival parity gap). **Under the review loop (`vinaya task run`)**, the driver runs BOTH itself, from its own unsandboxed process, against a freshly-fetched `origin/main` and the live forge, before your turn ever starts — and dispatches you only when that verdict is READY, so being dispatched is the verdict: look for no output file and run neither check yourself. Neither script's own `gh` call is excluded from your sandbox the way a `gh` command YOU type directly is (it is spawned BY `bun`, not typed by you), so running either one yourself inside a dispatched turn hits the denied forge-token file (`isolation.md` §4a) and fails regardless of how careful you are — found live, CI, Linux. A `NOT READY` verdict means the driver already refused this turn before you were ever dispatched; you will not see one. Item 6 (branch-ID verification) is a static check against the brief's own Step 0 text, not a mechanized command, and stays yours to confirm regardless. Item 4 is superseded and no longer part of this composed check. **This gate also runs mechanically at push time** (task 25) — the `first-push-dispatch` check, wired into every adopter's generated CI and managed `.git/hooks/pre-push`, invokes the same derivation on a task branch's first push, before its PR exists — a last-resort catch, since the hook fires only at push time, after the work is already done. **Working manually, with no driver behind you** (this brief pasted into a bare terminal session, outside `vinaya dispatch`): there is no staged file to read, so fall back to items 3, 5, and 7's own prose above, each a complete, hand-run forge check in its own right — the mechanized gate above is a convenience over them, never their only form.
112
112
 
113
113
  If the brief carries a `Premise:` block, also re-assert it before step 0: confirm by hand that the brief's stated facts still hold against the live forge/codebase (a stale premise means the surface moved since the brief was rendered — STOP and re-dig; see `aeg-root/contracts/planner-developer.md`). **On this repo's toolchain**, `bun packages/aeg-core/bin/verify-dispatch.ts <tranche> <n> --premise <body-file>` (the body-file being the dispatched brief text) automates that re-assertion.
114
114
 
@@ -149,6 +149,11 @@ A task Issue's body must carry all eight fields in one of these two forms. **Can
149
149
  - `checkIntroducedConfigKeysCovered` — the same rule for a **backticked** dotted configuration key the reference does not carry and the tree does not already ship, against the two files a new key forces: the configuration reference and the configuration schema. The refusal names whichever of the two globs is still missing. It reads the token, never the sentence around it: any backticked dotted token counts, including one whose **root segment** the reference has never carried, so there is no wording that evades the rule and none you have to remember to use. What excuses a token is a fact, not a phrase — the reference already documents it (as its own row, as the row of the key it instantiates like `checks.<your-check>.timeoutMs`, or inside its parent's prose), or the tracked tree already spells it out, which is what every dotted token about existing code does. What is left is a dotted token naming something this repository has never had.
150
150
  - `checkPinnedFileImportersCovered` — a Boundary that pins a file other tracked sources import, where **none** of those importers is reachable from `in:` and none is named in the Boundary's own `Out:` clause. Changing a file almost always forces its call sites to change with it; the rule asks you to decide — widen `in:`, or write in the Boundary that the importer stays out — rather than leaving the Developer to discover the contradiction after Step 0. A `## Surface` `out:` glob is **not** that decision: it claims the directory is untouched, which is exactly what a forced call-site edit contradicts, so only the Boundary's own `Out:` clause excuses an importer. One importer inside the Surface is enough: the task already reaches its call sites.
151
151
 
152
+ Three write checks cover the other files a change is forced to touch or to read:
153
+ - **A new CLI test file** needs the CI shard directory (`apps/cli/tests/ci-shards`) in the Surface `in:` globs, because the shard list must name the file in the same commit.
154
+ - **A `Documentation:` URL** must answer an unauthenticated fetch with a success status on its own host; a redirect to another host, a login page or an error status is refused.
155
+ - **A new loop module or loop test file** needs the loop invariant map's fixture and spec in the Surface `in:` globs, because the map must list it.
156
+
152
157
  A further check, `checkConflictCompleteness`, **warns and never blocks**: two open task Issues naming the same collision *domain* — a whole package — with no mutual `Conflicts-with` edge. Kept alongside the file-count check above, not replaced by it: a domain overlap that shares no pinned file at all is still worth a hint, and it is only ever a hint, because naming a package is not the same as naming a file.
153
158
  - **Ring 1/2 (continuous oracle):** `vinaya check coherence`'s **R1** check re-runs the same function against the live stock of open task Issues, catching bodies edited by ungated writers or predating the gate. Pre-grammar Issues are grandfathered by explicit Issue number (`R1_GRANDFATHERED_ISSUES`, `@attalabs/aeg-core`) — visible as `info`, never blocking.
154
159
 
@@ -158,6 +163,8 @@ R1 checks **presence/structure only**; whether the content is correct (sizing ac
158
163
  **Four more sections, below the eight fields, since `BRIEF_SECTIONS_SINCE_ISSUE`** — judgment sections as data, so `vinaya brief render` can fill §4/§6/§9/§10 mechanically instead of a hand-authored placeholder. Each is parsed by its own function in `@attalabs/aeg-core`, and a well-formed one is directory-level/outcome-level only — never a file path:
159
164
 
160
165
  - **`## Surface`** — a directory-level `in:`/`out:` glob list, comma-separated on each of its own line, naming what this task's surface touches and explicitly does not. The repository-root files (`README.md`, `LICENSE`, and any other tracked path with no `/`) are named by the **root glob `*`**: a bare `*` in `in:` admits every root-level file and only those — it never reaches a nested path, so the common `in: *, out: apps` shape still excludes `apps/…` — and a `*` in `out:` excludes only root-level files.
166
+ <!-- AEG:CLAIM: packages/aeg-core/src/issue-validation.ts contains:glob === '.changeset' || glob.split('/')[0] === '.changeset' -->
167
+ - **Shared by construction.** Test directories and spec directories may appear in multiple tasks in the same Milestone without a `Conflicts-with` edge. Root `.changeset` globs may do the same because each task writes a uniquely named changeset file. The changeset exemption applies only when `.changeset` is the whole glob or its first path segment; every other overlapping glob still needs serialization.
161
168
  - **`## Parts`** — numbered `Part <k> (O<n>[, O<m>]) — <outcome>` lines, one per Part, naming outcomes and symbols only, never a path.
162
169
  - **`## Test plan`** — either the `Test plan: unit-tests-only` sentinel, or a fenced command list (one command per line, each with `→ <expected observable>`) plus any `**[principal]**` items.
163
170
  - **`## Stop conditions`** — a bullet list of the conditions under which the executing agent must stop and escalate.
@@ -234,6 +241,10 @@ When you raise a warning, state the specific signal, give your recommendation (u
234
241
 
235
242
  The rationale you write onto an Issue, and any doctrine page you edit, describes the thing itself — the boundary, the trap, the reason for an edge — never an internal batch-of-work label or a forge number standing in for that description. A future reader of that Issue (a Developer dispatched against it, a Reviewer months later, someone auditing why a decision was made) has no forge history to resolve a bare citation against; write what you concluded, not where you concluded it. `reader-resolvable-prose` enforces this mechanically for doctrine pages and, via its source-comment class, for `.ts` comments — treat a flagged citation the same as any other gate failure, not a style nit.
236
243
 
244
+ ## References — explain the task, point at the rest
245
+
246
+ The task explains everything specific to it. Anything defined elsewhere is referenced by its exact location — a repository file and section, or an official public documentation page and section — and never copied into the task, where the copy would drift from its source. Every reference must be readable from the Developer's sandbox, which has no credentials: a private tracker or document store is never referenced, so put what it holds into an in-repository spec and cite the spec. Articles and blog posts are never the governing source. Every link a task gives is required reading, so each belongs in `## Documentation`; the Issue gate refuses a link outside that section that is not also listed there, and refuses any link that does not answer an unauthenticated fetch with a success status on its own host. This repository's own Issue and pull-request links are references to planning records, not sources: they need not be listed, but they are still checked for readability.
247
+
237
248
  ## Naming the tranche
238
249
 
239
250
  Name the tranche (its `vinaya/tranche:<slug>` label) after its **center of gravity — the durable, highest-leverage work — not its narrowest downstream feature.** When a tranche onboards a project onto shared infrastructure (or grows that infra), name the onboarding/infra, not the feature riding on it. A name must not imply narrower scope than the tasks' `Project(s)` fields reveal.
@@ -30,7 +30,7 @@ summary: Ever had a PR reviewed by someone who never read what it was supposed t
30
30
  ---
31
31
  # Reviewer — Role Reference
32
32
 
33
- **Read receipt — do this first.** `vinaya doctrine --role reviewer --print`'s output begins with a fixed acknowledgement token, one line, before anything else. Your first message in this session must repeat that exact token verbatim — e.g. `ACK: <token>` — so a transcript proves this doctrine was read, checked with one grep. The token lives only in this file's frontmatter, never in this paragraph, so editing this paragraph never invalidates a past session's proof.
33
+ **Read receipt — do this first.** `vinaya doctrine --role reviewer --print`'s output begins with a fixed acknowledgement token, one line, before anything else. Your first message in this session must repeat that exact token verbatim — e.g. `ACK: <token>` — so a transcript proves this doctrine was read, checked with one grep. The token lives only in this file's frontmatter, never in this paragraph, so editing this paragraph never invalidates a past session's proof. A session the review loop dispatched gives no receipt: the driver puts this role's short version and checklist in your prompt itself and reads only your turn's result or output files.
34
34
 
35
35
  ## The short version
36
36
 
@@ -129,7 +129,8 @@ vinaya review post --role code-reviewer --pr <n> --verdict APPROVE|REQUEST_CHANG
129
129
  <!-- AEG:CLAIM: apps/cli/src/commands/review-post.ts contains:export function checkDocCorrectnessSearch(description: string, lineNumber: number): void { -->
130
130
  The findings file is one finding per line, `SEVERITY|file:line|description` (`|`-delimited: `file:line` already contains a colon), severity one of `BLOCKER|MAJOR|MINOR`. The `description` field begins with the finding's id and class, `F<n> <class>: <what is wrong>` — class is one of `correctness`, `type-safety`, `performance`, `resource-leak`, `maintainability`, `scope`, `test-honesty`, `doc-correctness`, or `other:<slug>` when none fits. A `doc-correctness` finding carries a `Search:` pattern — a repo-wide `git grep -n -iE` pattern, with no path filter — and is resolved only when every hit it returns at the new head is a true statement. It goes at the end of the description; run it before writing it down and confirm it matches the anchored line. The pattern carries no `|` character — this file is `|`-delimited — so reach for a character class, or the stem the copies share, rather than alternation. `vinaya review post` refuses the finding outright when the pattern is missing or path-filtered: a false sentence is a text-duplication defect, not a location defect. What no check can judge, and what stays yours, is whether the pattern really matches the claim and whether each hit it returns is true. This is free text that carries no `|` character inside the existing field, not a grammar change. Omit `--findings-file` for zero findings.
131
131
 
132
- The objectives file is one line per objective, `O<n>|MET|<evidence>` or `O<n>|NOT MET|<evidence>` — the same `|`-delimited shape, evidence being the rest of the line. **Judge MET/NOT MET from `git diff`, never from the Developer's own report** — the objective is a fact about the code, and the Developer's Decisions section is not evidence for it, the same discipline check 3's `SCOPE:` line already holds you to. **`NOT MET` requires a code or test location as its evidence** — a real `file:line`, the same shape a finding's own location takes, naming where the objective is unmet in the diff. Evidence that names only a PR body section, a comment, or a role file is not a location the objective's own unmetness lives at — the dev-review-loop's own report parser reclassifies such a line `MET (prose note)` before it ever reaches a round's outcome, the same `isProseLocation` predicate (`@attalabs/aeg-core`) the body-located `MINOR` cap already applies to a finding's location, so writing one costs the round nothing but a wasted line: it never blocks, it is never re-litigated next round, and it is not what you intended. If the objective is genuinely unmet, point at the code that fails to meet it. **`NOT MET` means you verified the objective is not met — never a decline.** An objective outside your own lens (a security-shaped objective reaching a code-reviewer verdict, or the reverse) is `MET`, citing the other reviewer's evidence or verifying it yourself directly — never `NOT MET` with an out-of-scope note; a reviewer that declines an objective this way forces a review round over nothing. `--objectives-file` is required whenever the closed Issue (or the PR body's own `## Objectives` section, when the PR closes none) has a list to judge; its ids must cover that list exactly — a missing or extra `O<n>` is refused before posting. An Issue that predates the objectives cutover renders no `Objectives version:` line and no block at all, matching the gate's own skip for that stock. The command renders this exact shape (kept here so a human or a debugging agent can still read what it produces — this is documentation, not something to write by hand):
132
+ <!-- AEG:CLAIM: apps/cli/src/lib/dev-review-loop/reviewer-dispatch.ts contains:An objective you find unmet is reported as NOT MET in objectives.txt with code or test evidence -->
133
+ The objectives file is one line per objective, `O<n>|MET|<evidence>` or `O<n>|NOT MET|<evidence>` — the same `|`-delimited shape, evidence being the rest of the line. **Judge MET/NOT MET from `git diff`, never from the Developer's own report** — the objective is a fact about the code, and the Developer's Decisions section is not evidence for it, the same discipline check 3's `SCOPE:` line already holds you to. **`NOT MET` requires a code or test location as its evidence** — a real `file:line`, the same shape a finding's own location takes, naming where the objective is unmet in the diff. Evidence that names only a PR body section, a comment, or a role file is not a location the objective's own unmetness lives at — the dev-review-loop's own report parser reclassifies such a line `MET (prose note)` before it ever reaches a round's outcome, the same `isProseLocation` predicate (`@attalabs/aeg-core`) the body-located `MINOR` cap already applies to a finding's location, so writing one costs the round nothing but a wasted line: it never blocks, it is never re-litigated next round, and it is not what you intended. If the objective is genuinely unmet, point at the code that fails to meet it. An unmet objective is decided only in the objectives file: a finding on the pull request body that says an objective is not met is capped to `MINOR` like any other PR-body finding and never fails that objective, so report the objective `NOT MET` there with its code or test evidence, never only as a finding on the body. **`NOT MET` means you verified the objective is not met — never a decline.** An objective outside your own lens (a security-shaped objective reaching a code-reviewer verdict, or the reverse) is `MET`, citing the other reviewer's evidence or verifying it yourself directly — never `NOT MET` with an out-of-scope note; a reviewer that declines an objective this way forces a review round over nothing. `--objectives-file` is required whenever the closed Issue (or the PR body's own `## Objectives` section, when the PR closes none) has a list to judge; its ids must cover that list exactly — a missing or extra `O<n>` is refused before posting. An Issue that predates the objectives cutover renders no `Objectives version:` line and no block at all, matching the gate's own skip for that stock. The command renders this exact shape (kept here so a human or a debugging agent can still read what it produces — this is documentation, not something to write by hand):
133
134
 
134
135
  ```
135
136
  VERDICT: APPROVE | REQUEST CHANGES
@@ -169,7 +170,8 @@ The `SCOPE:` line, and any blast-radius assertion under check 7, are evidence-ba
169
170
 
170
171
  VERDICT is `REQUEST CHANGES` if and only if at least one BLOCKER finding exists. Otherwise VERDICT is `APPROVE`, with every MAJOR and MINOR finding still listed under FINDINGS — an APPROVE is not silence about them, it is a statement that none of them blocks. (A REQUEST CHANGES sets the PR's review decision to `CHANGES_REQUESTED`, which is the derived `changes-requested` status — no one writes it down.) You do not type that decision by hand: `vinaya review post` derives it from the findings file you pass it — REQUEST CHANGES iff a BLOCKER is present, APPROVE otherwise — and renders the bare `VERDICT:` line and the `Judged head:` binding itself. `--verdict` is optional; if you pass one anyway, the command refuses before posting anything when it disagrees with the derivation, naming the derived value. It refuses to exit 0 unless its own post re-parses clean through the gate's extractors. The severity you assign to each finding is caller-asserted and not checked — the derivation trusts your severities, not your arithmetic. A finding whose own `file:line` names the PR body, a comment, or a role file is capped to MINOR by the policy evaluator before it counts toward the threshold, regardless of the severity you assign it — write its real severity anyway; the cap is applied for you, never something to pre-empt by under-reporting.
171
172
 
172
- **A finding blocks only where the Developer can act on it this round (`convergence-v1` task 1).** Beyond the prose cap above, the dev-review-loop and the merge gate defer — report, but do not let block — two kinds of finding, through one shared decision (`classifyFinding`, `@attalabs/aeg-core`). A finding whose file the task's `## Surface` `in:` list does not cover is deferred in ANY round, with no exception: a finding outside the Surface never blocks. And from round 2 on, a finding on a line that did not change between the previous round's head and the current head is deferred too — EXCEPT a security finding at or above HIGH, which blocks wherever it sits. A deferred finding keeps the severity you assigned it — it is real, this round just cannot act on it — and is listed, with its severity, `file:line` and the reason it was deferred, in the round's published summary and (when the gate is given the same context) the gate's own output. This is why you still write a finding's real severity: whether it blocks THIS round is decided for you, from the Surface and the round-to-round diff, never from how you rank it. Opening a follow-up Issue for a deferred finding is a separate step, not yours to do here.
173
+ <!-- AEG:CLAIM: apps/cli/src/lib/dev-review-loop/reviewer-dispatch.ts contains:location: line === null ? 'PR body' -->
174
+ **A finding blocks only where the Developer can act on it this round (`convergence-v1` task 1).** Beyond the prose cap above, the dev-review-loop and the merge gate defer — report, but do not let block — two kinds of finding, through one shared decision (`classifyFinding`, `@attalabs/aeg-core`). A finding whose file the task's `## Surface` `in:` list does not cover is deferred in ANY round, with no exception: a finding outside the Surface never blocks. And from round 2 on, a finding on a line that did not change between the previous round's head and the current head is deferred too — EXCEPT a security finding at or above HIGH, which blocks wherever it sits. A deferred finding keeps the severity you assigned it — it is real, this round just cannot act on it — and is listed, with its severity, `file:line` and the reason it was deferred, in the round's published summary and (when the gate is given the same context) the gate's own output. This is why you still write a finding's real severity: whether it blocks THIS round is decided for you, from the Surface and the round-to-round diff, never from how you rank it. Opening a follow-up Issue for a deferred finding is a separate step, not yours to do here. A finding located on the pull request body the driver stages for you is never deferred: the body is the Developer's own output, so the loop re-locates such a finding at `PR body` and it reaches the Developer in the round's verdict findings, capped at `MINOR` like any PR-body finding.
173
175
 
174
176
  <!-- AEG:CLAIM: packages/aeg-core/src/review-policy.ts contains:export const DEFAULT_MAX_ROUNDS = 3 -->
175
177
  <!-- AEG:CLAIM: packages/aeg-core/src/dev-review-loop/assess-round.ts contains:if (obs.round >= state.config.maxRounds) { -->
@@ -28,7 +28,7 @@ summary: Ever shipped a change nobody checked for leaked secrets?
28
28
  ---
29
29
  # Security Reviewer — Role Reference
30
30
 
31
- **Read receipt — do this first.** `vinaya doctrine --role security --print`'s output begins with a fixed acknowledgement token, one line, before anything else. Your first message in this session must repeat that exact token verbatim — e.g. `ACK: <token>` — so a transcript proves this doctrine was read, checked with one grep. The token lives only in this file's frontmatter, never in this paragraph, so editing this paragraph never invalidates a past session's proof.
31
+ **Read receipt — do this first.** `vinaya doctrine --role security --print`'s output begins with a fixed acknowledgement token, one line, before anything else. Your first message in this session must repeat that exact token verbatim — e.g. `ACK: <token>` — so a transcript proves this doctrine was read, checked with one grep. The token lives only in this file's frontmatter, never in this paragraph, so editing this paragraph never invalidates a past session's proof. A session the review loop dispatched gives no receipt: the driver puts this role's short version and checklist in your prompt itself and reads only your turn's result or output files.
32
32
 
33
33
  ## The short version
34
34
 
@@ -123,7 +123,8 @@ vinaya review post --role security --pr <n> --verdict PASS|FAIL \
123
123
 
124
124
  The findings file is one finding per line, `SEVERITY|file:line|description` (`|`-delimited: `file:line` already contains a colon), severity one of `CRITICAL|HIGH|MEDIUM|LOW`. Omit `--findings-file` for zero findings.
125
125
 
126
- The objectives file is one line per objective, `O<n>|MET|<evidence>` or `O<n>|NOT MET|<evidence>` — the same `|`-delimited shape, evidence being the rest of the line. **Judge MET/NOT MET from the diff, never from the Developer's own report.** **`NOT MET` requires a code or test location as its evidence** — a real `file:line`, the same shape a finding's own location takes, naming where the objective is unmet in the diff. Evidence that names only a PR body section, a comment, or a role file is not a location the objective's own unmetness lives at — the dev-review-loop's own report parser reclassifies such a line `MET (prose note)` before it ever reaches a round's outcome, the same `isProseLocation` predicate (`@attalabs/aeg-core`) the body-located `MINOR` cap already applies to a finding's location, so writing one costs the round nothing but a wasted line: it never blocks, it is never re-litigated next round, and it is not what you intended. If the objective is genuinely unmet, point at the code that fails to meet it. **`NOT MET` means you verified the objective is not met — never a decline.** An objective outside your own lens (a code-reviewer-shaped objective reaching a security verdict, or the reverse) is `MET`, citing the other reviewer's evidence or verifying it yourself directly — never `NOT MET` with an out-of-scope note; a reviewer that declines an objective this way forces a review round over nothing. `--objectives-file` is required whenever the closed Issue (or the PR body's own `## Objectives` section) has a list to judge; its ids must cover that list exactly. An Issue that predates the objectives cutover renders no `Objectives version:` line and no block at all. The command renders this exact shape (kept here so a human or a debugging agent can still read what it produces — this is documentation, not something to write by hand):
126
+ <!-- AEG:CLAIM: apps/cli/src/lib/dev-review-loop/reviewer-dispatch.ts contains:An objective you find unmet is reported as NOT MET in objectives.txt with code or test evidence -->
127
+ The objectives file is one line per objective, `O<n>|MET|<evidence>` or `O<n>|NOT MET|<evidence>` — the same `|`-delimited shape, evidence being the rest of the line. **Judge MET/NOT MET from the diff, never from the Developer's own report.** **`NOT MET` requires a code or test location as its evidence** — a real `file:line`, the same shape a finding's own location takes, naming where the objective is unmet in the diff. Evidence that names only a PR body section, a comment, or a role file is not a location the objective's own unmetness lives at — the dev-review-loop's own report parser reclassifies such a line `MET (prose note)` before it ever reaches a round's outcome, the same `isProseLocation` predicate (`@attalabs/aeg-core`) the body-located `MINOR` cap already applies to a finding's location, so writing one costs the round nothing but a wasted line: it never blocks, it is never re-litigated next round, and it is not what you intended. If the objective is genuinely unmet, point at the code that fails to meet it. An unmet objective is decided only in the objectives file: a finding on the pull request body that says an objective is not met is capped to `MINOR` like any other PR-body finding and never fails that objective, so report the objective `NOT MET` there with its code or test evidence, never only as a finding on the body. **`NOT MET` means you verified the objective is not met — never a decline.** An objective outside your own lens (a code-reviewer-shaped objective reaching a security verdict, or the reverse) is `MET`, citing the other reviewer's evidence or verifying it yourself directly — never `NOT MET` with an out-of-scope note; a reviewer that declines an objective this way forces a review round over nothing. `--objectives-file` is required whenever the closed Issue (or the PR body's own `## Objectives` section) has a list to judge; its ids must cover that list exactly. An Issue that predates the objectives cutover renders no `Objectives version:` line and no block at all. The command renders this exact shape (kept here so a human or a debugging agent can still read what it produces — this is documentation, not something to write by hand):
127
128
 
128
129
  ```
129
130
  VERDICT: PASS | FAIL
@@ -13,7 +13,7 @@ If you are unsure whether an action is permitted, the answer is here. If a role
13
13
 
14
14
  For the prose walkthrough (thirteen phases), see `process.md`. For the tranche/task model, see `tranche-model.md`. For role-specific instructions, see `roles/`. For the role-seam contracts, see `contracts/`.
15
15
 
16
- **`vinaya doctrine --role <name> --print` is a seat's one-hop entry.** An agent's generated skill or slash command shells out to this exact invocation and treats its output as the session's own operating instructions — no second file to read. For an agent role (every `actor: agent`/`either` role, `principal` excluded — it is `actor: human` and never resolves through `--role` at all), that output's first line is a fixed, per-role acknowledgement token declared in the role file's own frontmatter; the role's text requires the agent's first session message to echo that token verbatim, so a transcript proves the doctrine was actually read with one search. Every agent role but the Operator — whose grant is already the mechanical `allowed-tools` list checked at `roles/operator.md` §"you never invent authority" — also declares the verbs its prose forbids as denied tools in its frontmatter; the generated skill carries that list forward as a disallowed-tools grant where the host enforces one, and as a plain body line naming the denial where it does not.
16
+ **`vinaya doctrine --role <name> --print` is a seat's one-hop entry.** An agent's generated skill or slash command shells out to this exact invocation and treats its output as the session's own operating instructions — no second file to read. For an agent role (every `actor: agent`/`either` role, `principal` excluded — it is `actor: human` and never resolves through `--role` at all), that output's first line is a fixed, per-role acknowledgement token declared in the role file's own frontmatter; the role's text requires the agent's first session message to echo that token verbatim, so a transcript proves the doctrine was actually read with one search — in an interactive session; a Developer, reviewer or security session the review loop dispatched gives no receipt, since the driver supplies the doctrine and reads only the turn's result or output files. Every agent role but the Operator — whose grant is already the mechanical `allowed-tools` list checked at `roles/operator.md` §"you never invent authority" — also declares the verbs its prose forbids as denied tools in its frontmatter; the generated skill carries that list forward as a disallowed-tools grant where the host enforces one, and as a plain body line naming the denial where it does not.
17
17
 
18
18
  ---
19
19
 
@@ -70,7 +70,7 @@ git worktree add .worktrees/task/[tranche-slug]/[n] -b task/[tranche-slug]/[n] -
70
70
  ```
71
71
 
72
72
  1. Clean status; parent `origin/main`; branch suffix literal-matches topology `#` column (`[n]`).
73
- 2. Under `vinaya dispatch`/the review loop, the driver has already run the dispatch-readiness gate (the shipped check, plus this repository's own fuller derivation where it ships one) from its own unsandboxed process before dispatching you, and staged the combined verdict in this round's own Developer folder — read it there; either script's own `gh` call fails inside your sandbox. Working manually, with no driver behind you, fall back to `roles/developer.md`'s own items 3/5/7 prose — each a complete, hand-run forge check in its own right.
73
+ 2. Under the review loop (`vinaya task run`), the driver has already run the dispatch-readiness gate (the shipped check, plus this repository's own fuller derivation where it ships one) from its own unsandboxed process before dispatching you, and dispatches you only when that verdict is READY — a NOT READY verdict refuses the turn before it starts, so being dispatched is the verdict: look for no file and run neither script, whose own `gh` call fails inside your sandbox. Working manually, with no driver behind you, fall back to `roles/developer.md`'s own items 3/5/7 prose — each a complete, hand-run forge check in its own right.
74
74
  3. [any task-specific pre-flight checks — required tools present, reference files readable, re-digs to confirm the §2 citations]
75
75
 
76
76
  On any failure: STOP and report.
@@ -91,9 +91,9 @@ On any failure: STOP and report.
91
91
 
92
92
  <!-- AEG:CLAIM: apps/cli/src/lib/artifacts.ts contains:pre-push-select-tests.ts -->
93
93
 
94
- - [the repo's static gates, by command, and nothing else — this repo: `bun run typecheck`, `bun run format-and-lint`, and the production build. Do NOT ask for a test-suite run per Part: the managed `pre-push` hook selects the test files the changed files' own import graph could affect and runs them itself, once, on the one push, refusing the push when it fails. A brief that also asks for it per Part buys nothing and pays the suite's full wall-clock on every Part.]
94
+ - [Under the review loop, the controller runs static gates through the commit hook, the managed `pre-push` hook, `run_checks`, and CI. Do NOT list hand-run static-gate commands or ask for a test-suite run per Part: the push hook selects and runs affected tests once, on the one push, refusing it on failure. Working manually, the Developer uses the repository's declared static-gate commands.]
95
95
  - [every blast-radius consumer named in §4 re-verified, by name]
96
- - The tier checklist in `vinaya doctrine --role developer --print` genuinely satisfied, and `PR_BODY="$(cat <body-file>)" vinaya check doc-coverage` green. (In this repo the render also names `PR_BODY="$(cat <body-file>)" bun packages/aeg-core/bin/verify-docs.ts --pr`, which additionally evaluates the spec-status and code-requires-docs contracts.)
96
+ - The tier checklist in `vinaya doctrine --role developer --print` genuinely satisfied; use the controller's `run_checks` result, hooks, and CI as gate evidence.
97
97
 
98
98
  ## 9. Test Plan
99
99
 
@@ -127,5 +127,5 @@ STOP and report if: pre-flight fails; [the Planner's stop-and-escalate condition
127
127
  - PR body = the Developer's PR report (print it with `vinaya doctrine --template pr-report --print`), with this entire brief pasted as the reference copy inside a collapsed `<details>` block, and `Closes #[N]` at the top of the header block.
128
128
  - [what to state in the PR body: decisions made, confirmations required by §8]
129
129
  - Pre-open gate: tier checklist satisfied, and `PR_BODY="$(cat <body-file>)" vinaya check doc-coverage` green (in this repo the render also names `PR_BODY="$(cat <body-file>)" bun packages/aeg-core/bin/verify-docs.ts --pr`).
130
- - Include `git diff main --stat`. Token use needs no report here — it is recorded as the Vinaya log's own `usage` event.
130
+ - Include `git diff origin/main...HEAD --stat` as scope context only; the Developer judges Surface through the driver’s `surface-scope` check, never this hand-run diff. Token use needs no report here — it is recorded as the Vinaya log's own `usage` event.
131
131
  - Then STOP. Review and Verification are separate invocations.
@@ -72,6 +72,12 @@ A task **is** a forge Issue. Its status is not a field anyone writes — it is *
72
72
 
73
73
  **A closed-without-merge Issue never resolves to `todo`**. `todo` implies not-started; a closed Issue is terminal. The derivation reads GitHub's native `stateReason`: `NOT_PLANNED` → `dropped`; anything else (`COMPLETED`, or no reason) → `incoherent`. The one law: a task-Issue reaches *done* only via a merged PR that names it (`Closes #N`); a `COMPLETED` close without that merge is incoherent, not done.
74
74
 
75
+ **One task number, several Issues.** A re-cut task leaves its closed `NOT_PLANNED` Issue (a `dropped` task) in the tranche beside the open replacement. Readers that need one Issue per task number — the dispatch-readiness check — resolve an open Issue over a closed one, and refuse when two open Issues claim the same number; forge facts are read and keyed by Issue number, then mapped back to the task.
76
+
77
+ <!-- AEG:CLAIM: packages/aeg-forge-state/src/list-tasks.ts contains:export function resolveDuplicateTasks -->
78
+ <!-- AEG:CLAIM: packages/aeg-forge-state/src/fetch-forge-facts.ts contains:export async function fetchForgeFactsByIssue -->
79
+ <!-- AEG:CLAIM: apps/cli/src/checks/bin/check-dispatch-readiness.ts contains:resolveDuplicateTasks( -->
80
+
75
81
  So: there is **no status column anywhere.** The Developer does not "flip to in-review" — *opening the PR is the in-review signal*. The close-out does not "flip to merged" — *the merge is that signal*. The branch-name convention `task/<tranche>/<n>` is what links a task number to its branch and PR, so any role finds a task's live status with one forge query and writes nothing. `blocked` is the one state with no native forge fact, so it is a label (cheap, native, doesn't race).
76
82
 
77
83
  **Retry is free:** a Reviewer's REQUEST CHANGES makes the PR's `reviewDecision` = `CHANGES_REQUESTED` → derived status `changes-requested`. The Developer pushes fixes → the PR returns to open review → `in-review`. No status reset, because nothing was stored.