@attalabs/vinaya 0.39.0 → 0.41.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (186) hide show
  1. package/README.md +9 -9
  2. package/aeg-root/contracts/developer-reviewer.md +2 -2
  3. package/aeg-root/contracts/planner-developer.md +5 -5
  4. package/aeg-root/enforcement.md +22 -22
  5. package/aeg-root/process.md +4 -4
  6. package/aeg-root/roles/archivist.md +1 -1
  7. package/aeg-root/roles/developer/reference.md +7 -1
  8. package/aeg-root/roles/developer.md +1 -1
  9. package/aeg-root/roles/planner/reference.md +18 -5
  10. package/aeg-root/roles/principal.md +1 -1
  11. package/aeg-root/roles/reviewer.md +3 -3
  12. package/aeg-root/roles/security.md +4 -4
  13. package/aeg-root/roles/tranche-archivist.md +2 -2
  14. package/aeg-root/skills/aeg/SKILL.md +1 -1
  15. package/aeg-root/state-machine.md +10 -15
  16. package/aeg-root/templates/brief-template.md +5 -2
  17. package/aeg-root/templates/decision-record-template.md +38 -0
  18. package/aeg-root/templates/issue-rationale-template.md +1 -1
  19. package/aeg-root/tranche-model.md +1 -1
  20. package/dist/checks/bin/check-body-bare-digits.js +1974 -354
  21. package/dist/checks/bin/check-branch-topology.js +1296 -243
  22. package/dist/checks/bin/check-brief-shape.js +2038 -460
  23. package/dist/checks/bin/check-changeset-coverage.js +2411 -564
  24. package/dist/checks/bin/check-ci-shard-coverage.js +12391 -15
  25. package/dist/checks/bin/check-closes-n.js +1296 -243
  26. package/dist/checks/bin/check-coherence.js +1914 -1155
  27. package/dist/checks/bin/check-dead-branch-push.js +1242 -230
  28. package/dist/checks/bin/check-dispatch-readiness.js +2222 -460
  29. package/dist/checks/bin/check-doc-claims.js +2233 -260
  30. package/dist/checks/bin/check-doc-coverage-push.js +2436 -550
  31. package/dist/checks/bin/check-doc-coverage.js +2434 -552
  32. package/dist/checks/bin/check-doctrine-no-procedures.js +1776 -353
  33. package/dist/checks/bin/check-doctrine-portability.js +2408 -561
  34. package/dist/checks/bin/check-evidence-fresh.js +2370 -508
  35. package/dist/checks/bin/check-exec-bits.js +2407 -560
  36. package/dist/checks/bin/check-first-push-dispatch.js +1984 -380
  37. package/dist/checks/bin/check-issue-assignment.js +712 -170
  38. package/dist/checks/bin/check-issue-milestone-attach.js +1233 -230
  39. package/dist/checks/bin/check-issue-objectives-numbering.js +1769 -346
  40. package/dist/checks/bin/check-issue-parts-coverage.js +1233 -230
  41. package/dist/checks/bin/check-issue-surface-globs.js +1926 -378
  42. package/dist/checks/bin/check-issue-title-grammar.js +1233 -230
  43. package/dist/checks/bin/check-issue-tranche-label.js +702 -170
  44. package/dist/checks/bin/check-main-branch-refusal.js +1245 -232
  45. package/dist/checks/bin/check-no-disk-state.js +1233 -230
  46. package/dist/checks/bin/check-pr-premise-reassert.js +1769 -346
  47. package/dist/checks/bin/check-pr-report-density.js +1233 -230
  48. package/dist/checks/bin/check-principal-test-plan-wait.js +2489 -259
  49. package/dist/checks/bin/check-quoted-command.js +2391 -544
  50. package/dist/checks/bin/check-reader-resolvable-prose.js +2437 -564
  51. package/dist/checks/bin/check-registry-gates.js +1380 -296
  52. package/dist/checks/bin/check-retired-vocabulary.js +2416 -550
  53. package/dist/checks/bin/check-review-gate.js +2073 -371
  54. package/dist/checks/bin/check-single-plan-pr.js +1297 -235
  55. package/dist/checks/bin/check-surface-scope.js +1531 -252
  56. package/dist/checks/bin/check-test-plan.js +2487 -258
  57. package/dist/checks/bin/check-token-collection-wired.js +1233 -230
  58. package/dist/checks/bin/check-workspace-escape.js +2408 -561
  59. package/dist/checks/bin/verify-coherence.js +597 -97
  60. package/dist/checks/bin/verify-dispatch.js +632 -152
  61. package/dist/checks/bin/verify-docs.js +642 -132
  62. package/dist/index.js +25948 -16630
  63. package/dist/lib/pre-push-cache-test-run.js +1813 -297
  64. package/dist/lib/pre-push-changed-files.js +65 -19
  65. package/dist/lib/pre-push-mode.js +466 -0
  66. package/dist/lib/pre-push-progress-dir.js +4205 -0
  67. package/dist/lib/pre-push-record-tests.js +446 -0
  68. package/dist/lib/pre-push-select-tests.js +2353 -632
  69. package/dist/lib/push-progress-observer.js +4213 -0
  70. package/package.json +22 -5
  71. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/anchored-region.ts +17 -3
  72. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/brief-render.ts +73 -30
  73. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/brief-validation.ts +3 -3
  74. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/coherence-checks.ts +2 -2
  75. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/control-store/local.ts +88 -5
  76. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/control-store/records.ts +34 -2
  77. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/assess-round.ts +26 -4
  78. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/fakes.ts +7 -2
  79. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/index.ts +7 -1
  80. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/types.ts +29 -3
  81. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dispatch-gate.ts +35 -18
  82. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/docs/index.ts +1 -1
  83. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/docs/published-prose.ts +70 -45
  84. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/doctrine-portability.ts +6 -1
  85. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/entry-point.ts +27 -0
  86. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/gate-audience.ts +3 -5
  87. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/index.ts +96 -9
  88. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/issue-assignment.ts +24 -54
  89. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/issue-validation.ts +809 -106
  90. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/live-record.ts +179 -0
  91. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/envelope.ts +8 -2
  92. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/index.ts +1 -0
  93. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/narration.ts +2 -0
  94. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/schema-digest.ts +225 -0
  95. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/schema.ts +7 -1
  96. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/main-branch-refusal.ts +23 -1
  97. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/pr-report-density.ts +6 -4
  98. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/principals-config.ts +44 -0
  99. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/prose-rules.ts +532 -0
  100. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/protected-paths.ts +31 -0
  101. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/reader-resolvable-prose.ts +157 -80
  102. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/registry-checks.ts +8 -12
  103. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/retired-vocabulary.ts +53 -93
  104. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/review-gate.ts +46 -17
  105. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/review-input-manifest.ts +85 -1
  106. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/review-policy.ts +32 -13
  107. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/ruling-ordinal.ts +46 -0
  108. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/task-branch-identity.ts +2 -4
  109. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/test-plan-gate.ts +63 -8
  110. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/verdict-extraction.ts +24 -0
  111. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/waiver-label.ts +0 -1
  112. package/studio-standalone/apps/vinaya-studio/web/.next/BUILD_ID +1 -1
  113. package/studio-standalone/apps/vinaya-studio/web/.next/build-manifest.json +3 -3
  114. package/studio-standalone/apps/vinaya-studio/web/.next/prerender-manifest.json +3 -3
  115. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.html +1 -1
  116. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.rsc +1 -1
  117. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  118. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  119. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  120. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  121. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  122. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_not-found/page/server-reference-manifest.json +2 -2
  123. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_not-found/page.js.nft.json +1 -1
  124. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  125. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/page/server-reference-manifest.json +2 -2
  126. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/page.js.nft.json +1 -1
  127. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/page_client-reference-manifest.js +1 -1
  128. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/backlog/page/server-reference-manifest.json +2 -2
  129. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/backlog/page.js +1 -1
  130. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/backlog/page.js.nft.json +1 -1
  131. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/backlog/page_client-reference-manifest.js +1 -1
  132. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/page/server-reference-manifest.json +2 -2
  133. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/page.js +1 -1
  134. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/page.js.nft.json +1 -1
  135. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/page_client-reference-manifest.js +1 -1
  136. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/page/server-reference-manifest.json +2 -2
  137. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/page.js +1 -1
  138. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/page.js.nft.json +1 -1
  139. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/page_client-reference-manifest.js +1 -1
  140. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/page/server-reference-manifest.json +3 -3
  141. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/page.js +1 -1
  142. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/page.js.nft.json +1 -1
  143. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/page_client-reference-manifest.js +1 -1
  144. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/tasks/[taskId]/page/server-reference-manifest.json +2 -2
  145. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/tasks/[taskId]/page.js +2 -2
  146. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/tasks/[taskId]/page.js.nft.json +1 -1
  147. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/tasks/[taskId]/page_client-reference-manifest.js +1 -1
  148. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/page/server-reference-manifest.json +2 -2
  149. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/page.js +1 -1
  150. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/page.js.nft.json +1 -1
  151. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/page_client-reference-manifest.js +1 -1
  152. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/tranches/page/server-reference-manifest.json +2 -2
  153. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/tranches/page.js +1 -1
  154. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/tranches/page.js.nft.json +1 -1
  155. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/tranches/page_client-reference-manifest.js +1 -1
  156. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/1q96_modules_@clerk_nextjs_dist_esm_app-router_client_keyless-creator-reader_0lom2js.js +1 -1
  157. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__08e39jo._.js +1 -1
  158. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__0ls23oh._.js +1 -1
  159. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__0sxadt2._.js +13 -0
  160. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__1a3j3n1._.js +57 -0
  161. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/{[root-of-the-server]__1ug9syi._.js → [root-of-the-server]__1d4eth3._.js} +1 -1
  162. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__1gjqmhq._.js +1 -1
  163. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__1snpgaw._.js +3 -3
  164. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__1wc4-ip._.js +1 -1
  165. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_08onyya._.js +2 -2
  166. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_096f46i._.js +1 -1
  167. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0af2one._.js +1 -1
  168. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0e5tkdd._.js +1 -1
  169. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0kf2g72._.js +1 -1
  170. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0zf4d27._.js +3 -3
  171. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_1-wo68i._.js +1 -1
  172. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_1achbh9._.js +1 -1
  173. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/node_modules_@clerk_nextjs_dist_esm_app-router_server-actions_1x7vfhn.js +2 -2
  174. package/studio-standalone/apps/vinaya-studio/web/.next/server/middleware-build-manifest.js +3 -3
  175. package/studio-standalone/apps/vinaya-studio/web/.next/server/pages/500.html +1 -1
  176. package/studio-standalone/apps/vinaya-studio/web/.next/server/server-reference-manifest.js +1 -1
  177. package/studio-standalone/apps/vinaya-studio/web/.next/server/server-reference-manifest.json +4 -4
  178. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/{33rszkngkuoko.js → 0x7u6si-ai179.js} +1 -1
  179. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/{06_55xbp7rcbi.js → 2fu7mfsj4oima.js} +1 -1
  180. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/{2brkwv169ygep.js → 34b4ruddunn3q.js} +1 -1
  181. package/studio-standalone/apps/vinaya-studio/web/package.json +2 -2
  182. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__04adkz-._.js +0 -57
  183. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__19jyp3m._.js +0 -13
  184. /package/studio-standalone/apps/vinaya-studio/web/.next/static/{D3LiJNIq5FWZxen7CpOSJ → 2ZARxTwpuRew8-SvYsRdU}/_buildManifest.js +0 -0
  185. /package/studio-standalone/apps/vinaya-studio/web/.next/static/{D3LiJNIq5FWZxen7CpOSJ → 2ZARxTwpuRew8-SvYsRdU}/_clientMiddlewareManifest.js +0 -0
  186. /package/studio-standalone/apps/vinaya-studio/web/.next/static/{D3LiJNIq5FWZxen7CpOSJ → 2ZARxTwpuRew8-SvYsRdU}/_ssgManifest.js +0 -0
@@ -14,10 +14,11 @@ Before planning, you MUST verify every one of these and explicitly confirm them
14
14
  2. **Every project the work plausibly touches is identified AND its relevant specs/skills/docs have been read (the read obligation).** This is the input-side coherence gate: before cutting a single task, identify the specs, skills, and documentation relevant to each code surface in scope, and read them. The obligation is conditional — if no docs exist for a given surface, it is trivially satisfied; the obligation is the act of identifying and reading whatever exists. AEG assumes no specific folder structure; you determine what exists for the surfaces in scope — e.g. an adopter using an `apps/<project>/specs/*` layout reads that; one that keeps specs elsewhere reads its own equivalent. Read every spec, backlog, and skill your registry/config point at for the surfaces in scope. Planning without having read the relevant docs is a hard gate violation — refuse: *"Read obligation not satisfied — I haven't read the specs/skills/docs for this surface. Planning without reading them leaves me unable to identify which docs each task will make incoherent. Let me read them first."* If a spec exists but cannot be read, STOP: *"I can't plan the X work without reading its spec — it's missing/unreadable. Provide it or point me at the current source of truth."*
15
15
  3. **The code you must dig into is readable.** Sizing requires reading the actual code (call sites, shared packages, schemas — see the deep-dig section). Confirm you can actually access every relevant path. If a task would touch a repo/package/service you cannot read, STOP: *"I can't size the X task — I can't read `<path/repo>`. Sizing blind is forbidden; give me access or the relevant code."*
16
16
  4. **The shared substrate is inspectable.** If the work plausibly touches a shared package, you can read that package AND enumerate its consumers (to compute the blast radius). If you can't enumerate consumers, STOP — you cannot correctly set `Project(s)` without it.
17
- 5. **The relevant prior decisions are known.** You've read the specs and skills that bear on this work, so you don't plan a task that re-litigates a settled call. A past choice's reasoning lives in the spec it governs and in the pull request that made it. If you cannot reach them, STOP.
17
+ 5. **The relevant prior decisions are known.** Follow `state-machine.md` Section 6, "Recording why": read the configured decision-record folder before planning, and stop for the Principal before reversing a record. If you cannot reach the relevant sources, STOP.
18
18
  6. **The registry resolves every project you'll assign** (`.vinaya/projects.md`) — see the entry gate. "Resolves" is a claim about a file, so back it with the file: for each `Project:` name you will declare, quote that name's exact registry row text in your readiness check. A bare "all projects resolve" with no quoted rows is a self-attestation, not a check — the unregistered name it hides surfaces later, when `vinaya issue create` or `vinaya issue edit` refuses it (`checkProjectsRegistered`), after the whole plan is already built on it.
19
19
  7. **Open ambiguities are surfaced, not assumed.** If, after the above, real decisions remain unmade (which DB owns this? is structured output required on all vendors?), collect them and put them to the Principal BEFORE planning — do not pick an answer and plan on top of a guess. A plan built on an unstated assumption is a plan that ships the wrong thing.
20
20
  8. **A finished-but-unarchived prior tranche on each in-scope product is caught.** For every product in scope, check each other active tranche that touches it: if it has **zero open task Issues** (`vinaya/tranche:<slug>`-labeled, `--state open`) — i.e. it is finished — but the Tranche Archivist has not run for it, STOP: *"The previous tranche `<name>` on `<product>` is finished but not archived. Dispatch the Tranche Archivist for it before planning proceeds."* A prior tranche with genuinely open task work is **not** a blocker here — it is an active sibling, not an unarchived one; the correct instrument for it is a declared `conflicts-with` edge wherever the two tranches' surfaces actually overlap (file granularity — strictly better information than product granularity). The contract governing this gate is `aeg-root/contracts/tranche-archivist-planner.md`. **Supersession carve-out:** this gate does NOT apply to a prior tranche that *this* plan is superseding — i.e. absorbing `todo`/backlog tasks from. For that one source tranche you refactor it in-place during this plan (see "Tranche refactor & cross-tranche task-movement" below) and the Tranche Archivist archives it *after* the plan lands; the order is refactor-and-plan → then archive, never archive-then-plan. The gate still fully applies to every *unrelated* prior tranche.
21
+ 9. **Every consumed input has a named source.** For every file, package, dataset, fixture, or suite that a task's objectives consume, name one source: an existing path on the default branch; a `Depends-on` task whose rationale pins that input as something it creates; or a Principal-supplied path and digest written into the task Issue. When no such source exists, STOP and ask the Principal before cutting the Issue. Where it is cheap, try the input before cutting the Issue by opening, packing, installing, or running it; record the path or command and its output in the planning pass.
21
22
 
22
23
  **State the readiness check explicitly at the top of your planning pass** — a short "Readiness: I have X, Y, Z; I verified I can read A, B; the following are unresolved and I need answers before I proceed: …". This makes it visible that the gate was run, not skipped. A plan emitted without a passed readiness check is malformed. (This is also conversational-protocol step 6 — announce the gate's result before moving on.)
23
24
 
@@ -112,7 +113,7 @@ This rationale is the **producer side of the `aeg-root/contracts/planner-develop
112
113
  - **Dependency rationale** — *why* each `depends-on` / `conflicts-with` edge exists (not just that it does). For a `conflicts-with` edge, "why" means the overlap itself: name the specific file(s) or path both tasks touch — on both sides of the edge, so either task's reader can see what it collides with. An edge with no nameable overlap is not a valid edge: drop it, or, if you suspect a coupling you cannot yet name, raise it as a calibrated warning ("Possible undeclared cross-package coupling" below) instead of hard-serializing on a hunch. **Write it bold-inline only, exactly `**Dependency rationale** — …`** — no colon inside the bold, no heading form. The edge parser and `amendRationaleDeps` both locate this one field by that exact anchor; see "Rationale grammar" below for why, and for how to edit an edge after creation.
113
114
  - **Traps to avoid** — concrete pitfalls the dig surfaced that would otherwise bite the executing agent (e.g. "do NOT use `loadYamlFromCatalog` — it hardcodes another project's directory; use `loadFlow(readFileSync(...))`"). This single field is often the highest-value thing the planner produces.
114
115
  - **Suggested agent-class** — high / mid / fast capability, with a one-line reason (this is plan-time; the dispatch act confirms the final model pick at dispatch — see "Agent/model selection" below).
115
- - **Stop-and-escalate** — the conditions under which the executing agent stops and escalates rather than improvises (e.g. "if making it work requires changing the shared contract, escalate `severity:strategy`").
116
+ - **Stop-and-escalate** — the conditions under which the executing agent stops and escalates rather than improvises (e.g. "if making it work requires changing the shared contract, escalate `severity:strategy`"). Every condition must be decidable by the Developer from code, tests, or tool output available inside its own sandbox. A check that needs a live run, a subscription login, or an observation only the Principal can make belongs in a `**[principal]**` Test plan line, never in a stop condition. A contradiction with the Boundary is a stop condition only when it meets the Developer doctrine's definition of a contradiction the Developer cannot reconcile: the fix needs a path outside the Surface, a protected administrative path the Surface does not cover, or a change of the task's objectives. Never write a stop condition that pauses the Developer for a file inside the Surface.
116
117
  - **Docs to keep coherent** — which specs/skills/docs this task will make incoherent and therefore must update, each by its repository path. Derived from the read you did at the readiness gate. A task that touches no documented surface writes the `no-doc-surface` sentinel with its reason. This field is what the dispatch act's render turns into the brief's documentation-update list. **Derive it mechanically:** take the task's intended surface globs, match them against `.vinaya/doc-owners` bindings (segment-wise glob overlap, not exact-string match — e.g. a task surface of `packages/ui/topbar/**` matches a binding on the same or an overlapping glob), and the union of matched pointers is the floor for this field. You may still add docs the derivation misses (cross-cutting judgment) or mark a derived pointer as "not in scope" — but every such override carries a one-line reason. Silent overrides are a regression. The actual derivation runs at dispatch time against the live manifest (this repo's implementation lives in `@attalabs/aeg-core`'s `deriveSection7`); here you name the intended surfaces, not resolved doc pointers. **Run it, don't just cite it:** the exact command and when to run it live under "Plan-integrity gates" below ("A `Docs to keep coherent` field written without the derivation run"). Fold every pointer it prints into this field.
117
118
 
118
119
  ### Rationale grammar
@@ -142,7 +143,7 @@ R1 checks **presence/structure only**; whether the content is correct (sizing ac
142
143
  <!-- AEG:CLAIM: packages/aeg-core/src/brief-render.ts contains:export function renderBrief(facts: BriefFacts, template: string): RenderResult { -->
143
144
  **Four more sections, below the eight fields** — 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 the template shows each one's shape:
144
145
 
145
- - **`## 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 reaches no nested path, so the common `in: *, out: apps` shape still excludes `apps/…` — and a `*` in `out:` excludes only root-level files.
146
+ - **`## 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. An `in:` entry may name a new directory that has no tracked files yet when the Boundary pins at least one file inside that directory. 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 reaches no nested path, so the common `in: *, out: apps` shape still excludes `apps/…` — and a `*` in `out:` excludes only root-level files.
146
147
  - **`## Parts`** — numbered `Part <k> (O<n>[, O<m>]) — <outcome>` lines, one per Part, naming outcomes and symbols only.
147
148
  - **`## 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.
148
149
  - **`## Stop conditions`** — a bullet list of the conditions under which the executing agent stops and escalates.
@@ -242,9 +243,21 @@ This follows the locked task-movement rule: a moved task is neither *done* nor *
242
243
 
243
244
  ## Hand-off — governed by the Planner→Developer contract
244
245
 
246
+ ### Independent plan review
247
+
248
+ A newly cut tranche is not planned until a separate, fresh-context Planner session has reviewed it and every finding has been fixed. The reviewing session reads the default branch and the newly cut Issues but writes no forge state. Give it this fixed prompt:
249
+
250
+ > Independently review the newly cut tranche. For every Issue, answer four questions and support each answer with either a `file:line` on the default branch or a command and its output: What is the named source of every file, package, dataset, fixture, or suite its objectives consume? What Developer-runnable command observes each stop condition inside the Developer sandbox? Is every premise already true on the default branch? For every declared dependency or conflict edge, are the shared files it names really edited by both tasks? Report findings only; write no forge state.
251
+
252
+ After cutting the Issues, hand the Principal exactly this line to paste into a fresh `/vinaya planner` session:
253
+
254
+ > `/vinaya planner Independently review the newly cut tranche using the fixed review prompt in aeg-root/roles/planner/reference.md, and name the tranche label I provide.`
255
+
256
+ Fix every finding before declaring the plan complete. Only then close the planning session out loud: "Planning complete — Issues cut, independent plan review findings fixed, dispatch order is […]. Next stage is dispatch."
257
+
245
258
  Your output (Issues, each task carrying its Planner's rationale) is the **producer side** of the **`aeg-root/contracts/planner-developer.md`** contract — the single source of truth for what crosses the Planner→Developer seam. That contract maps every field of your rationale to the exact brief section the dispatch act's render produces from it. Do not describe the hand-off differently here than the contract does — the contract owns the seam; this role doc points at it.
246
259
 
247
- Once an Issue is assigned (`todo`), the dispatch act (below) picks it up: `vinaya task brief` or `vinaya task run` renders the brief mechanically from the Issue's own sections and posts it, frozen, as the Issue's `aeg:brief:v1` comment — before the Developer's worktree exists. The Developer then opens a branch (`in-flight`) and a PR carrying its report, never the brief (`in-review`). You do not track any of that — the forge does. Your artifacts are the plan; the forge is the truth of what happens to it. **Close the planning session out loud (conversational-protocol step 6): "Planning complete — Issues cut, dispatch order is […]. Next stage is dispatch."**
260
+ Once an Issue is assigned (`todo`), the dispatch act (below) picks it up: `vinaya task brief` or `vinaya task run` renders the brief mechanically from the Issue's own sections and posts it, frozen, as the Issue's `aeg:brief:v1` comment — before the Developer's worktree exists. The Developer then opens a branch (`in-flight`) and a PR carrying its report, never the brief (`in-review`). You do not track any of that — the forge does. Your artifacts are the plan; the forge is the truth of what happens to it. The independent plan review above governs when the conversational protocol may declare planning complete.
248
261
 
249
262
  ---
250
263
 
@@ -265,7 +278,7 @@ These four are the same shape as `roles/developer.md`'s entry gate items 2, 3, a
265
278
 
266
279
  ### Running the dispatch
267
280
 
268
- `vinaya task brief <tranche> <n>` performs preparation only — the render, the refusals, and the frozen post — and starts no agent. `vinaya task run <tranche> <n> --agent <claude|codex|gemini>` composes that same preparation with starting the Developer and running the full review loop unattended — the operator's normal way to run the dispatch act end to end, one command from a planned Issue to a reviewed pull request. Use `task brief` when the act is freeze-only — confirming a brief renders cleanly, or handing it to a human to paste. Either way, posting the frozen comment **is** the `todo → in-flight` transition once the Developer's own worktree opens — nobody writes a status field.
281
+ `vinaya task brief <tranche> <n>` performs preparation only — the render, the refusals, and the frozen post — and starts no agent. `vinaya task run <tranche> <n> --agent <claude|codex>` composes that same preparation with starting the Developer and running the full review loop unattended — the operator's normal way to run the dispatch act end to end, one command from a planned Issue to a reviewed pull request. Use `task brief` when the act is freeze-only — confirming a brief renders cleanly, or handing it to a human to paste. Either way, posting the frozen comment **is** the `todo → in-flight` transition once the Developer's own worktree opens — nobody writes a status field.
269
282
 
270
283
  **Announce the act on entry, the same way the plan act does (conversational protocol, above).** *"I'm dispatching task <n>. Checking the four gates first, then running `vinaya task run`."* Confirm the render's output looks right before handing it over — a rendered brief that inherited a stale or malformed rationale field is still your responsibility to catch, the same way a code review catches a bug the linter didn't.
271
284
 
@@ -58,7 +58,7 @@ The Principal holds final authority over:
58
58
  - **Ruling on a contested finding.** `vinaya pr rule <pr> --file <ruling.md>` posts the Principal's decision as its own marked, versioned PR comment — never mistaken for a code-review or security verdict, since it refuses a file carrying verdict grammar. A ruling posted after a clean verdict already exists voids it (`review-validity-v1` task 3, O2): every rendered verdict carries the newest ruling ordinal it was judged against on a `Ruling ordinal:` line, and the merge gate compares that ordinal to the PR's actual newest ruling — a mismatch reads as unbound, the same fail-closed shape `objectives moved — re-review required` already uses, until reviewers re-cast against the new ruling. If a `dev-review-loop` is running that task and a ruling lands between a round's reviewer dispatch and its verdicts coming back, the loop discards that round's verdicts unheld and unpublished and pauses with reason `ruling_posted`, naming the superseded ordinal, the new ordinal, and the ruling's own marker identifier — resume it the same way as any other pause, with `vinaya dev-review-loop --resume <pr>`.
59
59
  <!-- AEG:CLAIM: apps/cli/src/lib/dev-review-loop.ts contains:never force-pushes -->
60
60
  <!-- AEG:CLAIM: apps/cli/src/lib/dev-review-loop.ts contains:'push', 'origin', `HEAD:refs/heads/${branch}` -->
61
- - **Ruling on default-branch drift.** When a ruling asks a task branch to take the default branch's changes, it asks the Developer to merge the default branch into the task branch, never to rebase it. The driver publishes with a fast-forward-only push, so rewriting the task branch would make the governed publication path refuse it.
61
+ - **Ruling on default-branch drift.** When a ruling asks a task branch to take the default branch's changes, it asks the Developer to merge the default branch into the task branch, never to rebase it. The driver publishes the Developer's work with a fast-forward-only push, so a Developer rewriting the task branch would make the governed publication path refuse it; the driver's one force-with-lease push follows only its own rebase over default-branch drift on a protected path.
62
62
 
63
63
  ---
64
64
 
@@ -42,7 +42,7 @@ You judge one open pull request against the brief it came from, and say plainly
42
42
 
43
43
  **You never** edit the code, merge, expand the change's scope, request improvements unrelated to correctness, safety or conformance, or approve something to be agreeable. You report; the author fixes; the Principal merges.
44
44
 
45
- **How it physically runs** — you run with fresh context. In the unattended loop, the driver stages the brief, pull-request body, diff and prior findings; the code and security passes run in parallel, and each writes the three result files named in its prompt. In an interactive review, the result is posted through the review command. CI and the staged artifacts are your evidence; inspect them rather than reproducing the gate suite.
45
+ **How it physically runs** — you run with fresh context. In the unattended loop, the driver stages the brief, pull-request body, diff and prior findings; the code and security passes run in parallel, and each ends its turn with one structured review result, writing no file. In an interactive review, the result is posted through the review command. CI and the staged artifacts are your evidence; inspect them rather than reproducing the gate suite.
46
46
 
47
47
 
48
48
  ---
@@ -67,7 +67,7 @@ A review turn started via `vinaya dispatch code-reviewer --agent <vendor>` carri
67
67
  - The task Issue carries the brief, frozen on its `aeg:brief:v1` comment, posted by the Planner's dispatch act before the Developer started.
68
68
  - Your job is to judge whether the PR does what the brief said, safely and honestly — not to improve it yourself.
69
69
 
70
- **Dispatched by `vinaya dev-review-loop` (unattended)?** You do not run `vinaya review post` yourself — write `findings.txt` and `report.txt` to the work directory the dispatch names, plus `objectives.txt` (one `O<n>|MET|<evidence>` or `O<n>|NOT MET|<evidence>` line per objective) whenever the task carries objectives; leave `findings.txt` empty if there are none. A work directory still missing a required file after the dispatch is an infrastructure failure, not a clean approval. You hold no GitHub credential for this dispatch, and your tool grant carries no `gh` command at all — never attempt `gh pr view`, `gh pr diff`, `gh issue view`, or any other `gh` subcommand; it will refuse. The driver stages what you need as four files inside your own checkout instead, named in your own prompt: the task's own frozen brief — named first and explicitly as the standard to judge the PR against — then the pull request's body, the diff of the judged head against its base, and the prior round's findings. Read the brief file for the intent this role judges against (the same brief your entry gate otherwise reads from the Issue's `aeg:brief:v1` comment), and the other three for the facts `gh` would otherwise have given you — a human running this role at their own terminal keeps using `gh` as described elsewhere in this doc; only the dispatched, unattended case changes.
70
+ **Dispatched by `vinaya dev-review-loop` (unattended)?** You do not run `vinaya review post` yourself, and you write no file — end your turn with the one structured review result your prompt asks for: your findings (an empty list if there are none), one objective result per objective the task carries, and a summary. A dispatch that delivers no valid result is an infrastructure failure, not a clean approval. You hold no GitHub credential for this dispatch, and your tool grant carries no `gh` command at all — never attempt `gh pr view`, `gh pr diff`, `gh issue view`, or any other `gh` subcommand; it will refuse. The driver stages what you need as four files inside your own checkout instead, named in your own prompt: the task's own frozen brief — named first and explicitly as the standard to judge the PR against — then the pull request's body, the diff of the judged head against its base, and the prior round's findings. Read the brief file for the intent this role judges against (the same brief your entry gate otherwise reads from the Issue's `aeg:brief:v1` comment), and the other three for the facts `gh` would otherwise have given you — a human running this role at their own terminal keeps using `gh` as described elsewhere in this doc; only the dispatched, unattended case changes.
71
71
 
72
72
  ## Entry gate (self-locating) — refuse if it isn't your turn
73
73
 
@@ -111,7 +111,7 @@ vinaya review post --role code-reviewer --pr <n> --verdict APPROVE|REQUEST_CHANG
111
111
 
112
112
  For a documentation-correctness finding, choose a repository-wide search pattern that reaches every copy of the false claim, then judge every match rather than only the first location.
113
113
 
114
- <!-- 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 -->
114
+ <!-- AEG:CLAIM: apps/cli/src/lib/dev-review-loop/reviewer-dispatch.ts contains:An objective you find unmet is reported as NOT MET in its objective result with code or test evidence -->
115
115
  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):
116
116
 
117
117
  ```
@@ -40,7 +40,7 @@ You ask one question of an open pull request that a correctness review does not:
40
40
 
41
41
  **You never** fix what you find, merge, write status, weaken a finding to be agreeable, or quote a discovered secret in full — you name where it lives and enough characters to identify it, so the report does not become the second leak. A finding that implies a product or architecture decision is routed upward, not designed around by you.
42
42
 
43
- **How it physically runs** — you run with fresh context. In the unattended loop, the driver stages the brief, pull-request body, diff and prior findings; the code and security passes run in parallel, and each writes the three result files named in its prompt. In an interactive review, the result is posted through the review command. CI and the staged artifacts are your evidence; inspect them rather than reproducing the gate suite.
43
+ **How it physically runs** — you run with fresh context. In the unattended loop, the driver stages the brief, pull-request body, diff and prior findings; the code and security passes run in parallel, and each ends its turn with one structured review result, writing no file. In an interactive review, the result is posted through the review command. CI and the staged artifacts are your evidence; inspect them rather than reproducing the gate suite.
44
44
 
45
45
 
46
46
  ---
@@ -65,7 +65,7 @@ A pass started via `vinaya dispatch security --agent <vendor>` carries its role
65
65
  - The task Issue carries the brief, frozen on its `aeg:brief:v1` comment.
66
66
  - Your single question: **could this change leak a secret, widen an attack surface, or misconfigure auth/permissions/agent tooling?**
67
67
 
68
- **Dispatched by `vinaya dev-review-loop` (unattended)?** You do not run `vinaya review post` yourself — write `findings.txt` and `report.txt` to the work directory the dispatch names, plus `objectives.txt` (one `O<n>|MET|<evidence>` or `O<n>|NOT MET|<evidence>` line per objective) whenever the task carries objectives; leave `findings.txt` empty if there are none. A work directory still missing a required file after the dispatch is an infrastructure failure, not a clean pass. You hold no GitHub credential for this dispatch, and your tool grant carries no `gh` command at all — never attempt `gh pr view`, `gh pr diff`, `gh issue view`, or any other `gh` subcommand; it will refuse. The driver stages what you need as four files inside your own checkout instead, named in your own prompt: the task's own frozen brief — named first and explicitly as the standard to judge the PR against — then the pull request's body, the diff of the judged head against its base, and the prior round's findings. Read the brief file for the intent this role judges against (the same brief your entry gate otherwise reads from the Issue's `aeg:brief:v1` comment), and the other three for the facts `gh` would otherwise have given you, including the `SECRETS:` check below — a human running this role at their own terminal keeps using `gh` as described elsewhere in this doc; only the dispatched, unattended case changes.
68
+ **Dispatched by `vinaya dev-review-loop` (unattended)?** You do not run `vinaya review post` yourself, and you write no file — end your turn with the one structured review result your prompt asks for: your findings (an empty list if there are none), one objective result per objective the task carries, and a summary. A dispatch that delivers no valid result is an infrastructure failure, not a clean pass. You hold no GitHub credential for this dispatch, and your tool grant carries no `gh` command at all — never attempt `gh pr view`, `gh pr diff`, `gh issue view`, or any other `gh` subcommand; it will refuse. The driver stages what you need as four files inside your own checkout instead, named in your own prompt: the task's own frozen brief — named first and explicitly as the standard to judge the PR against — then the pull request's body, the diff of the judged head against its base, and the prior round's findings. Read the brief file for the intent this role judges against (the same brief your entry gate otherwise reads from the Issue's `aeg:brief:v1` comment), and the other three for the facts `gh` would otherwise have given you, including the `SECRETS:` check below — a human running this role at their own terminal keeps using `gh` as described elsewhere in this doc; only the dispatched, unattended case changes.
69
69
 
70
70
  ## Entry gate (self-locating) — refuse if it isn't your turn
71
71
 
@@ -109,7 +109,7 @@ vinaya review post --role security --pr <n> --verdict PASS|FAIL \
109
109
 
110
110
  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.
111
111
 
112
- <!-- 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 -->
112
+ <!-- AEG:CLAIM: apps/cli/src/lib/dev-review-loop/reviewer-dispatch.ts contains:An objective you find unmet is reported as NOT MET in its objective result with code or test evidence -->
113
113
  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):
114
114
 
115
115
  ```
@@ -147,7 +147,7 @@ A re-pass reports the verified state of every prior finding id and judges new fi
147
147
 
148
148
  <!-- AEG:CLAIM: apps/cli/src/commands/review-post.ts contains:export function noneFoundClaimCitesScanCheck( -->
149
149
  <!-- AEG:CLAIM: apps/cli/src/commands/review-post.ts contains:function scanCheckConclusionPasses(line: string): boolean { -->
150
- <!-- AEG:CLAIM: apps/cli/src/lib/dev-review-loop/reviewer-dispatch.ts contains:if (!noneFoundClaimCitesScanCheck(report.SECRETS, null)) { -->
150
+ <!-- AEG:CLAIM: apps/cli/src/lib/dev-review-loop/reviewer-dispatch.ts contains:if (!noneFoundClaimCitesScanCheck(secrets, null)) { -->
151
151
  Treat the secret scan as evidence, not as a substitute for reading the diff and judging whether credentials or sensitive values were exposed.
152
152
 
153
153
  ## Escalation
@@ -118,7 +118,7 @@ If you don't have the information to fill a field, write "unknown — Principal
118
118
  ### 3. Close the Milestone
119
119
 
120
120
  - `vinaya milestone close --slug <slug>` — never the raw `gh api` recipe this step used to carry. It resolves the tranche's Milestone (legacy exact-title match, or an intent-declared match), verifies every Issue carrying `vinaya/tranche:<slug>` is actually attached to it via GitHub's native `milestone` field, and refuses — naming each unattached or foreign Issue and its repair path — before closing anything. Closing the Milestone IS the tranche's lifecycle transition to `complete`. This is a forge action, not a repo commit.
121
- - **A Milestone stays open while any tranche it declares is unfinished.** A Milestone is a product goal, and its own `### Tranche intents` section declares every tranche that goal is committed to — including tranches nobody has cut Issues for yet. Those are `planned` work, invisible to any count of attached Issues, and a Milestone whose declared tranches are not all `complete` does not close, however finished this tranche is. Closing it anyway marks most of a product done the first time one slice of it lands. Read `vinaya milestone status <milestone-number>` before closing: it prints each declared tranche's lifecycle, derived from that tranche's own labeled Issues. Every one `complete` is the only state that permits the close; otherwise this tranche's close-out ends at step 2 with the retrospective recorded and the Milestone left open. `vinaya archive tranche <slug>` applies this rule itself — it records the retrospective either way and names every unfinished tranche it is leaving the Milestone open for — while `vinaya milestone close --slug <slug>` verifies attachment alone and will close whatever Milestone it resolves, so the declared-scope read above is yours to make before invoking it.
121
+ - **A Milestone stays open while any tranche it declares is unfinished.** A Milestone is a product goal, and its own `### Tranche intents` section declares every tranche that goal is committed to — including tranches nobody has cut Issues for yet. Those are `planned` work, invisible to any count of attached Issues, and a Milestone whose declared tranches are not all `complete` does not close, however finished this tranche is. Closing it anyway marks most of a product done the first time one slice of it lands. `vinaya milestone status <milestone-number>` prints each declared tranche's lifecycle, derived from that tranche's own labeled Issues; every one `complete` is the only state that permits the close, otherwise this tranche's close-out ends at step 2 with the retrospective recorded and the Milestone left open. Both commands apply this rule themselves: `vinaya archive tranche <slug>` records the retrospective either way and names every unfinished tranche it is leaving the Milestone open for, and `vinaya milestone close --slug <slug>` refuses, naming each unfinished tranche and its lifecycle, before anything is written — `--validate-only` included. A Milestone with no `### Tranche intents` section closes on attachment alone.
122
122
  - The Issues themselves are already closed (verified in step 1) and, once `milestone close` has run, are verified attached to the closed Milestone — not merely assumed to be — which is what makes that attachment the durable historical record.
123
123
  - **Legacy exception:** a tranche planned before the forge-native cutover is also archived as `tranche-model.md` §4 records — never deleted, the rationale is durable history. Confirm the archive step landed.
124
124
 
@@ -130,7 +130,7 @@ Read the pull requests merged during this tranche for decisions that were record
130
130
 
131
131
  For each: list it explicitly in your output as `PENDING RATIFICATION — requires Principal action at next ratification window.` Do NOT mark them ratified yourself — ratification is a Principal act. You surface; they decide.
132
132
 
133
- If a Tier 3 task merged with its reasoning recorded nowhere — not in its pull request, not in the spec it governs — flag as `DANGLING — Tier 3 task N has no durable record of why.`
133
+ Follow `state-machine.md` Section 6, "Recording why": list each merged Tier 3 change that added no decision record. This is a report and blocks nothing.
134
134
 
135
135
  ### 7. Update `docs-index.md`
136
136
 
@@ -71,7 +71,7 @@ Principal → Planner → Developer → Reviewer (code + security) → merge, pl
71
71
  ## 9. Tiers, decisions, ratification (the governance layer)
72
72
 
73
73
  - **Tiers**: Tier 0 trivial · Tier 1 implementation · Tier 3 project/roadmap. No Tier 2. When in doubt, Tier 3.
74
- - **Decisions** are recorded in the change that makes them — the pull-request body is the durable record. Historical entries sit in a frozen archive outside the harness; nothing reads it and no new entries are added.
74
+ - **Decisions** follow `state-machine.md` Section 6, "Recording why."
75
75
  - **Ratification windows**: 1–2 daily; the Principal resolves Type 1s, Tier 3 merges, `severity:product` escalations.
76
76
  - **verify-docs** (`packages/aeg-core/bin/verify-docs.ts`; in this repo it runs at authoring time — `open-pr.ts` / `bun run verify-docs --pr` — with its CI counterparts the `brief-shape`/`doc-coverage` checks in `.github/workflows/vinaya-checks.yml`; in the attalabs reference implementation it is a step of that repo's consolidated gate job) is a real blocking gate: changed specs need a `Status:` block, Tier 1+ code needs a doc change, Tier 3 states its reasoning in the pull request.
77
77
 
@@ -136,7 +136,7 @@ Rows = artifact types. Columns = roles. "—" means no authority. The Reviewer i
136
136
  | **Task status** | — | — | — | — *(nobody writes it — derived from the forge)* |
137
137
  | **Provenance block** (on the merged PR) | Reads (audit) | Reads (audit) | — | Assembles + posts at close-out (append-only; from frozen facts) |
138
138
  | **Token ledger** (the archived per-tranche ledgers, `tranche-model.md` §12) | Fills a previously-`—` cell left by an operator-metered role, from whatever usage view its host shows a human (forward-reference exception, §13); approves PR | Reports tokens at turn-end, does not append — the plan act in the plan PR (or planning report if none), the dispatch act in its dispatch report | Reports no token figures anywhere: a dispatched turn's usage is collected from the agent host and written to the Vinaya log as its own `usage` event (`tranche-model.md` §12); does not append the ledger row either | **Sole writer** of the ledger — collects every role's token report for the task and appends all rows at close-out; flags missing-row drift |
139
- | **Test Plan execution** (Verification phase, on the open PR) | Runs the `[principal]` half (auth-gated/key-dependent/visual items) in a browser and ticks those checkboxes on the PR | — | Runs the `[agent]` half (scriptable items) against the booted app and posts evidence comments on the PR; reports `[agent]` failures back to itself via new commits on the same branch | Flags an unticked checkbox / missing evidence comment as a merge-gate failure at close-out time (won't happen if discipline holds — merge is gated on ticked boxes) |
139
+ | **Test Plan execution** (Verification phase, on the open PR) | Runs the `[principal]` half (auth-gated/key-dependent/visual items) in a browser and ticks those checkboxes on the PR | — | Runs the `[agent]` half (scriptable items) against the booted app and reports the output in its turn result, which the controller records as evidence on the PR; reports `[agent]` failures back to itself via new commits on the same branch | Flags an unticked checkbox / missing evidence comment as a merge-gate failure at close-out time (won't happen if discipline holds — merge is gated on ticked boxes) |
140
140
  | **Worktrees** | Removes after merge | — | Works in (created at dispatch) | Flags merged worktrees as cleanup candidates |
141
141
  | **Orchestration-tool runtime** (if used) | Edits config; reads (audit) | Reads | Appends events via the tool | — |
142
142
  | **CI/forge Actions** | Approves workflow changes via PR | Proposes workflow changes via PR | — | Runs as forge-CI automation |
@@ -214,14 +214,9 @@ Most specs are `draft` — no deliberate ratification pass has been done. Future
214
214
 
215
215
  ## Section 6: Recording why
216
216
 
217
- The harness requires no standing record of decisions. A change's reasoning lives in the pull
218
- request that makes it — frozen at merge, dated, attributed, and read by both
219
- the reviewer and the close-out. A rule that still binds belongs in the spec
220
- for the surface it governs, where a doc-ownership binding keeps it current.
217
+ A change's reasoning lives in the pull request that makes it. A repository may also keep decision records: one short, numbered file per architecturally significant decision, in the folder its configuration names. When it does, the Planner reads them before planning and stops for the Principal before reversing one; the change that makes a significant decision adds its record; the Tranche Archivist lists merged Tier 3 changes that added none; and specifications, doctrine and code state each rule in plain words, never citing a record. A record, once accepted, changes only to name the record that supersedes it.
221
218
 
222
- A team that wants a standing record of past choices is free to keep one in
223
- whatever form suits it. Nothing here reads it, requires it, numbers it, or
224
- checks its shape.
219
+ A decision is significant when it concerns structure, a quality attribute such as security or reliability, a dependency, an interface, or a tool or process, and at least two real options existed or no standard settled the choice.
225
220
 
226
221
  ## Section 7: Escalation Paths
227
222
 
@@ -307,13 +302,13 @@ The lowest-commitment way to run AEG: read-only over a team's existing process.
307
302
  - **Typecheck, tests** — standard CI gates; always blocking.
308
303
  - **Issue template / no forbidden fields** — a required Issue template + a CI check reject planning metadata (priority/estimates/points) on task Issues, keeping them execution-only.
309
304
  - **Brief validation** — the Archivist's `brief-validation` job runs `packages/aeg-core/bin/verify-brief.ts` against the PR body and checks presence of every required brief section (Tier, `For:` model attribution, `Project:` — both read from the PR body's header block, before the first `##` heading, the same region the post-merge Archivist's provenance assembly reads — tagged Test Plan, surface map, doc-update list, worktree Step 0, stop conditions, autonomy clause, `Closes #N`); flags malformed briefs (`vinaya/needs:brief-correction`) and fails CI. **The trigger is the body, not the branch (`fix/brief-gate-nontask`):** the gate runs when the branch is `task/<tranche>/<n>` **or** the body is brief-shaped (`isBriefShaped` — ≥2 of surface map / doc-update list / stop conditions / autonomy clause, matched on `stripCode`'d text so a brief *quoted inside a fence* stays exempt). Bodies that are neither still bypass — that exemption is for an ordinary non-AEG PR (a one-line dependency bump) which carries no brief and must not be forced to grow one. The old branch-only bypass was the wrong proxy for it: a standalone `fix/*` brief **is** a brief, and it skipped every section check — confirmed live on `fix/studio-tranche-href`, which shipped with no §7 documentation-update list because `checkDocUpdateList`, the checker that exists for exactly that, never ran. `Closes #N` remains **task-branch-only** (`BriefSectionsOptions.requireClosesN`): a standalone fix brief has no task Issue to close, and a `plan/*` PR is *forbidden* to carry one by the plan-PR guard below — requiring it there would make the two gates jointly unsatisfiable. The same validator also runs at **authoring time** as the `brief-shape` check — `PR_BODY="$(cat brief.md)" vinaya check brief-shape` (on this repo's toolchain, also `bun packages/aeg-core/bin/verify-brief.ts --body-file <brief.md>`) — before a PR or even a branch exists, so the Planner's dispatch act gates a brief before dispatch rather than after the Developer has done the work (`roles/planner/reference.md` § The dispatch act); with no `BRANCH`, the branch is read from the brief's own Step 0 `git worktree add … -b` line. **Includes the plan-PR Closes guard**: a `plan/*` branch whose PR body carries `Closes #N` fails CI before the non-task bypass even runs — a plan PR creates Issues, it does not resolve one (`roles/planner.md`); this closed a confirmed pattern of plan PRs prematurely closing task Issues on merge. **Real**, now the `Brief Validation` step (9/9) of the AEG gate suite job in `.github/workflows/forge-lifecycle.yml`. Presence-only — it cannot judge whether a Test Plan item is truly scriptable or whether a declared `unit-tests-only` is justified by the surface map; those remain Reviewer + Verification judgment. Same enforcement substrate as above.
310
- - **Per-task Archivist close-out** — `.github/workflows/vinaya-archivist.yml::post-merge` (`packages/aeg-core/bin/archive-task.ts`) runs on every push to `main`, resolves the merge commit's PR via `gh api repos/{owner}/{repo}/commits/{sha}/pulls`, and — for task-branch PRs only — assembles and posts the Archivist provenance block (`roles/archivist.md` item 8) and explicitly closes the task's Issue, confirming the closed state before exiting. Idempotent **per PR**, not per Issue (an Issue can legitimately accrue multiple merged PRs over its life; idempotency never spans PRs): skips silently if the PR already carries a provenance comment. Skips silently on non-task branches (`plan/*`, `fix/*`, …). Fails loud (non-zero exit) on any `gh`/permission error — never a silent no-op. Real, installed with `contents: read`, `issues: write`, `pull-requests: write` permissions. Does not automate the Tranche Archivist or items 2–7 of per-task close-out (docs coherence, `docs-index.md`, token ledger) — those remain dispatched-Archivist judgment work.
305
+ - **Per-task Archivist close-out** — `.github/workflows/vinaya-archivist.yml::post-merge` (`bun apps/cli/src/index.ts archive`) runs on every push to `main`, resolves the merge commit's PR via `gh api repos/{owner}/{repo}/commits/{sha}/pulls`, and — for task-branch PRs only — assembles and posts the Archivist provenance block (`roles/archivist.md` item 8) and explicitly closes the task's Issue, confirming the closed state before exiting. Idempotent **per PR**, not per Issue (an Issue can legitimately accrue multiple merged PRs over its life; idempotency never spans PRs): skips silently if the PR already carries a provenance comment. Skips silently on non-task branches (`plan/*`, `fix/*`, …). Fails loud (non-zero exit) on any `gh`/permission error — never a silent no-op. Real, installed with `contents: read`, `issues: write`, `pull-requests: write` permissions. Does not automate the Tranche Archivist or items 2–7 of per-task close-out (docs coherence, `docs-index.md`, token ledger) — those remain dispatched-Archivist judgment work.
311
306
  - **Manifest integrity** — `verify-docs --full` and the coherence oracle validate the doc-owners manifest: pointer existence (M1), glob syntax (M2 advisory), and duplicate globs (M3). There is no decision-number sequencing: the log it validated is gone.
312
307
  - **Closes #N gate** — task-branch PRs must declare `Closes #<its-issue>` in the PR body; absence fails CI. Non-task branches bypass this forward direction automatically. Real, installed at `.github/workflows/forge-lifecycle.yml::closes-n-gate`. Same enforcement substrate as above. **Forge-native-tranche fix (`fix/closes-n-forge-native`):** the gate's scoped `loadTrancheFiles(null, onlySlug)` call once discovered which tranches exist from the pre-cutover files alone (`tranche-model.md` §4) — a tranche planned as a Milestone plus labeled Issues never entered that enumeration, so the forge derivation was never invoked for it, and the gate failed every such PR with a misleading "not found." Fixed by falling back to a direct forge derivation (the Milestone-existence check plus the file-and-forge composition, today `indexTrancheMilestonesAsync` + `mergeFileTopology`) when the requested `onlySlug` isn't found via files, gated on an actual open Milestone existing so an unrecognized branch slug still fails honestly — the scoped-path counterpart to `verify-dispatch.ts`'s `otherActiveTrancheSlugs` fix. **Reverse direction (`fix/closes-n-reverse`):** a `Closes #N` that resolves to a real AEG task Issue (title matches the `[<tranche-slug>] <task-id>...` convention and carries a `vinaya/tranche:<slug>` label) now requires the branch to actually be named `task/<tranche-slug>/<task-id>`, regardless of what the branch itself is called — closing the blind spot that let a mis-named branch implement a real task Issue with zero forge-visible status. One batched forge query (`fetchTaskIssueRefs`) resolves each referenced Issue's task identity before `checkClosesN` runs. **Code-span hardening (`fix/closes-gate-hardening`):** both the pre-merge gate (`checkClosesN` in `brief-validation.ts`) and the coherence-side parse (`extractClosesReferences` in `coherence-checks.ts`) now `stripCode` the body before matching the closing keyword, as GitHub's own auto-close parser ignores `Closes #N` inside a code span or fenced block. Inline spans of **any backtick-run length** are covered (`` `x` ``, `` ``x`` ``, …) via CommonMark's `(`+)…\1` matched-run rule — the double-backtick form was a false-green in the first cut (peeled as two empty spans). Fenced blocks are matched by a line scanner that pairs a fence with its own closer by **character and run length**: `~~~` tilde fences, info strings (```` ```js ````), and runs longer than three (```` `````` ````) all strip correctly, and an unclosed fence runs to end of body as GitHub renders it — the earlier `` /```[\s\S]*?```/g `` regex missed all three. The keyword set matches GitHub's own: `close`/`closes`/`closed`, `fix`/`fixes`/`fixed`, `resolve`/`resolves`/`resolved`. Before this, a body whose only `Closes #N` was backticked passed the gate **green** yet merged **without** closing its Issue, then read red on every open PR via A3 `auto-close-misfire`; "verify-docs green" now implies "GitHub will auto-close" for fenced + inline-code forms. 4-space **indented** code blocks are stripped too, conservatively: a ≥4-column-indented run counts as code only when it follows a blank line *and* is not inside a list — since within a list item that indentation is the item's own content indent, which GitHub *does* auto-close (blanking it would be a false-red, the brief's over-strip stop condition). The strip runs on the **whole body, before any region is sliced out of it** — never on a slice. Every rule in it is block-structural (a fence pairs with its own closer; an indented run is code only after a blank line and outside list context), so a fragment strips differently from the same text in place: stripping the sliced `AEG:CLOSES` region blanked an anchor indented inside a list item — list content GitHub *does* auto-close — and the Archivist's `extractIssue` returned no Issue, stranding it on merge exactly as before. Markers are HTML comments and survive the strip, so selecting the region from stripped text loses nothing and subsumes the decoy protection: a decoy anchor inside code never survives to be sliced. The same grammar governs `maskCode`, the index-preserving variant `anchoredRegion` runs to find the `AEG:*` markers themselves — it is **upstream** of every `stripCode` call, so while it stayed on the naive fence/inline regexes a decoy `AEG:CLOSES` anchor inside a tilde fence, a ≥4-backtick fence, a double-backtick span, or an indented block won the region outright and the gate resolved a **wrong** Issue number (worse than the strandings above: the post-merge Archivist's `extractIssue` would explicitly close an unrelated Issue). Both now delegate to one pair of scanners, differing only in what they emit per code line — nothing for `stripCode`, same-length filler for `maskCode` — so a divergence is a compile-level impossibility rather than a convention. This hardens all five anchored fields (`CLOSES`, `PROJECT`, `TIER`, `PREMISE`, `TEST-PLAN`) at once, not just the closing reference. `stripCode` normalises `\r\n`/`\r` to `\n` before any of these scanners run: the fence scanners anchor per line, and JS's `.`/`$` never match `\r`, so a CRLF body opened no fence at all and let a fenced `Closes #N` walk free — the same false-green along a new axis, and it hit exactly the web-UI-authored bodies this CI backstop exists for (HTML normalises textarea newlines to CRLF on submit). The closing-keyword separator is **bounded** (`\s{0,8}:?\s{0,8}`, identical in both parsers): two adjacent unbounded `\s*` groups backtrack quadratically on `closes` + long whitespace + no `#` — ~2.0 s at GitHub's 65,536-char body cap, run twice on the fail path — where the bound is 0.1 ms. **Known residual:** a genuine indented code block *nested inside a list* is therefore left unstripped — the deliberately safe direction of that trade. A `Closes #N` surviving only inside code fails with an actionable message pointing at a bare reference in the `AEG:CLOSES` anchor. `stripCode` is the one shared stripper, exported from `anchored-region.ts` (no duplicated regex).
313
308
  - *(The practitioner-facing map of every enforcement mechanism — prevention, detection, audit — lives in `aeg-root/enforcement.md`; this section remains the normative gate registry.)*
314
309
  - **Validated forge writes (ring 0)** — the earliest enforcement point this repo has: the validated wrappers `packages/aeg-core/bin/open-pr.ts` (runs verify-brief + verify-docs `--pr` + the Closes #N gate locally, calls `gh` only on green) and `bin/open-issue.ts` (a task Issue with a `vinaya/tranche:*` label must carry the full eight-field Planner rationale — `checkIssueRationale`, planner-developer contract, **and pass three content checks on what those fields say, `checkBlastRadiusScope` (the declared surface may not reach a shared collision domain — live-derived `packages/*` workspace members, built-in cross-cutting defaults, plus any `vinaya.config.json` `blastRadius.extraDomains` entries — that no declared project owns, absent a second **registered** project or a `blast-radius-ack:` line), `checkNoBriefContent` (no brief-shaped section in the Issue), `checkRationaleNamesDocs` (the rationale names a concrete doc/skill path, or the `no-doc-surface` sentinel). `checkConflictCompleteness` warns on an undeclared collision-domain overlap and never blocks**). Prevention, not detection: a malformed PR/Issue body sent through a wrapper is refused locally and never reaches the forge; no hook refuses a raw `gh` write, so the CI gates below re-run the identical aeg-core checks against whatever landed, and a dispatched reviewer's permissions additionally deny raw `gh pr` writes. Also enforced at the same layer: title grammar (`checkForgeTitle`, both wrappers), the single-plan-PR guard (`checkSinglePlanPr` — dormant, see the CI backstop below), and a `.husky/pre-push` gate refusing `task/<tranche>/<id>` pushes whose id has no task in that tranche's forge-derived plan (mechanical). This repo ships no tool-interception hook, so nothing at the agent's own tool call refuses a raw forge write. Operational rule: restart running agent sessions after merging hook/settings changes — hooks load at session start.
315
310
  - **Single-plan-PR CI backstop** — `checkSinglePlanPr` (`packages/aeg-core/src/single-plan-pr.ts`) was extracted from `open-pr.ts` (previously private to that wrapper) so the identical predicate could also run forge-side: `.github/workflows/forge-lifecycle.yml::single-plan-pr-gate` re-fetches this PR's touched files plus every other open PR's touched files and fails CI on the same violation the validated `open-pr.ts` wrapper refuses locally. Closes the gap where a PR opened directly via the GitHub web UI bypasses `open-pr.ts` entirely. **Dormant, as of the forge-native cutover:** it refuses two open PRs editing the same tranche's plan file, and a plan is now a Milestone plus labeled Issues — no diff carries a plan file to collide over (`tranche-model.md` §4 records the retired form). The guard is kept, not deleted, but nothing can trip it, and a gate that cannot fire should say so rather than read as active protection. One implementation, two enforcement points — no second copy of the predicate.
316
- - **Coherence oracle (A1/A2/A3/T1/T2/T3/D1/M1/M3)** — `packages/aeg-core/bin/verify-coherence.ts` runs against every PR and genuinely blocks CI — the CLI's own exit code, non-zero on any `fail`-status check, is what the `coherence-gate` job exits with. Failures in A1 (closed-without-merge), A2 (archived-without-provenance), A3 (auto-close-misfire), T1 (phantom-issue-ref), T2 (orphan-task — **plan PRs only, see below**), T3 (tbd-in-active-tranche), D1 (dispatched-on-unmet-deps), M1 (manifest-dangling), and M3 (manifest-duplicate-glob) fail CI. L1–L5 and M2 are advisory (info-only) — every `checkL*` returns `status: info`, so a premature-archive, lifecycle-hygiene, Milestone-attachment-drift, or open-Milestone-all-closed finding is surfaced for a human to investigate but never fails CI. On A1 failures the relevant Issues receive the `vinaya/incoherent` label (Section 14). Real, installed at `.github/workflows/forge-lifecycle.yml::coherence-gate`. Same enforcement substrate as above. **The job's repo-state inputs (the tranche list) are read from a freshly-fetched `origin/main` — not the checkout's `refs/pull/N/merge`, which GitHub materializes lazily and can lag behind main (5+ false-red cycles, 2026-07-03/04). A plan PR's own diff still reads from its head ref.**
311
+ - **Coherence oracle (A1/A2/A3/T1/T2/T3/D1/M1/M3)** — `packages/aeg-core/bin/verify-coherence.ts` runs against every PR and genuinely blocks CI — the CLI's own exit code, non-zero on any `fail`-status check, is what the `coherence-gate` job exits with. Failures in A1 (closed-without-merge), A2 (archived-without-provenance), A3 (auto-close-misfire), T1 (phantom-issue-ref), T2 (orphan-task — **plan PRs only, see below**), T3 (tbd-in-active-tranche), D1 (dispatched-on-unmet-deps), M1 (manifest-dangling), and M3 (manifest-duplicate-glob) fail CI. L1–L4 and M2 are advisory (info-only) — `checkL1` through `checkL4` return `status: info`, so a premature-archive, lifecycle-hygiene, or Milestone-attachment-drift finding is surfaced for a human to investigate but never fails CI. L5 (tranche-not-archived) blocks: `checkL5` returns `status: fail` for an active tranche whose every task Issue is closed, so a finished tranche that was never archived fails CI the same as A2. On A1 failures the relevant Issues receive the `vinaya/incoherent` label (Section 14). Real, installed at `.github/workflows/forge-lifecycle.yml::coherence-gate`. Same enforcement substrate as above. **The job's repo-state inputs (the tranche list) are read from a freshly-fetched `origin/main` — not the checkout's `refs/pull/N/merge`, which GitHub materializes lazily and can lag behind main (5+ false-red cycles, 2026-07-03/04). A plan PR's own diff still reads from its head ref.**
317
312
  - **Planner→Developer rationale completeness (R1)** — the same coherence oracle's **R1** check re-runs `checkIssueRationale` **and `checkProjectsRegistered`** (`packages/aeg-core`) against every open task Issue's body, batched per active tranche alongside T2. A non-grandfathered Issue missing any of the eight `contracts/planner-developer.md` rationale fields — or whose `Project:` field names a project with no row in the project registry — fails CI. Paired with the ring-0 creation gate (`bin/open-issue.ts`, the validated forge writes bullet above) — R1 is the continuous half, `bin/open-issue.ts` is the point-of-creation half; one grammar, two enforcement points (`aeg-root/enforcement.md`). Pre- Issues are grandfathered by explicit Issue number (`R1_GRANDFATHERED_ISSUES`), reported `info`, never blocking — see Section 15b. **Real.** Moves this seam's rationale-completeness half from Trusted (below) to Enforced; the "role doc matches contract prose" half of contract conformance remains Trusted.
318
313
  - **Review gate — code-review + security-review verdicts, bound to the commit they judged** — `packages/aeg-core/bin/verify-review-gate.ts`, a step of the AEG gate suite job, blocks merge on a task-branch PR unless a clean code-reviewer `APPROVE` verdict comment AND a clean security-review `PASS` verdict comment both exist AND both cover the PR's current head commit — `REQUEST CHANGES`, `FAIL`, a missing verdict, an unclear one, or a clean verdict bound to a superseded commit (or carrying no binding at all) all fail CI (reviewed-commit binding). Reuses `extractCodeReviewVerdict`/`extractSecurityReviewVerdict` (`verdict-extraction.ts`) — the exact detection the post-merge Archivist's provenance assembly already ran, previously advisory-only (a DANGLING note on the merged PR, never a block) — now also parsing a same-comment `Judged head: <sha>` line and comparing it against `gh pr view --json headRefOid`, resolved from GitHub, never an env var or local git. A principal can waive it for one PR with an actor-verified `vinaya/waiver:review` label (the same `isWaiverLabelActorVerified` pattern, parameterized by label — see the waiver-label-actor row above); label presence alone is never sufficient. **Real, installed at `.github/workflows/forge-lifecycle.yml::aeg-gate-suite`.** Closes the gap where task PRs could previously merge with no review pass at all, and the second gap where a clean verdict could still merge stale code because nothing checked which commit it covered. **What remains Trusted, not Enforced: *dispatching* the code-reviewer/security-reviewer subagents in the first place** — see below; this gate only verifies a dispatched review's verdict is clean and current, it cannot make a review happen.
319
314
  - **Verification phase — `[principal]` Test Plan checkbox state** — `packages/aeg-core/bin/verify-test-plan.ts` (`evaluateTestPlanGate`, `test-plan-gate.ts`), the registered `test-plan` check, runs in the same blocking suite as every other check above and fails CI on any unticked `- [ ] **[principal]**` line, or on a missing Test Plan section for a task branch. **Real.** Moves the `[principal]`-checkbox-state half of the Verification phase from Trusted (below) to Enforced; the `[agent]` half is no longer a checkbox at all (task 12) — it is a fenced command list `vinaya pr report` executes, graded by the Evidence block's own freshness check instead.
@@ -324,7 +319,7 @@ The lowest-commitment way to run AEG: read-only over a team's existing process.
324
319
  ### Trusted (agent discipline — no CI enforcement in V0)
325
320
 
326
321
  - **Dispatching code-review and security-review passes** — Phase 10 requires them, including the spec-conformance check, but no CI bot dispatches the Reviewer subagents automatically yet; Principal + agent discipline decides when to invoke them. Automating dispatch is future work. **Once a review IS dispatched and posts a verdict, that verdict's existence and cleanliness is mechanically enforced pre-merge — see the Review gate row above.** This is the same shape as the Verification phase below: doctrine + one enforced half + one still-trusted half.
327
- - **Verification phase — runtime Test Plan execution**. Phase 11 requires the brief's §9 Test Plan to be executed before merge: the Developer-agent runs the `[agent]` items against the booted app and posts evidence on the PR; the Principal runs the `[principal]` items in a real signed-in browser and ticks the checkboxes. **Merge is gated on every checkbox being ticked AND the review verdicts being clean** — the runtime Test Plan executed-and-passing is a merge precondition alongside CI passing. The doctrine is mechanical (an unticked checkbox = not mergeable); the `[principal]`-checkbox-state half of that mechanism is now Enforced (see the Enforced list above — `verify-test-plan` fails CI on any unticked `[principal]` box). What remains trusted discipline: that the Developer-agent genuinely ran each `[agent]` command against a booted app rather than fabricating its output, and that the Principal genuinely exercised each `[principal]` item in a browser before ticking it — no CI can watch either happen. `Test Plan: unit-tests-only` (a first-class allowed value for pure-logic briefs whose §4 surface has no runtime path) satisfies the phase by the CI unit-test gate alone. **Parser hardening:** the section locator (`locateTestPlanSection`, `packages/aeg-core/src/test-plan-section.ts`) now recognizes both the inline `**Test Plan:**` marker and the `## N. Test Plan` heading form — the original inline-only regex is what let a heading-form body advisory-PASS with an unticked `[principal]` box, since "no section found" (a parser miss, not a genuinely missing section) read as PASS. A task-branch PR with no Test Plan section in either form now FAILs loud instead, naming what was searched for; non-task branches keep the advisory bypass. The runtime Test Plan check — now the `Runtime Test Plan checkbox state` step (4/9) of the AEG gate suite job in `.github/workflows/forge-lifecycle.yml` — now also passes `BRANCH` (previously only `PR_BODY`), without which the task-branch distinction could never fire in real CI.
322
+ - **Verification phase — runtime Test Plan execution**. Phase 11 requires the brief's §9 Test Plan to be executed before merge: the Developer-agent runs the `[agent]` items against the booted app and reports the output in its turn result, which the controller records as evidence on the PR; the Principal runs the `[principal]` items in a real signed-in browser and ticks the checkboxes. **Merge is gated on every checkbox being ticked AND the review verdicts being clean** — the runtime Test Plan executed-and-passing is a merge precondition alongside CI passing. The doctrine is mechanical (an unticked checkbox = not mergeable); the `[principal]`-checkbox-state half of that mechanism is now Enforced (see the Enforced list above — `verify-test-plan` fails CI on any unticked `[principal]` box). What remains trusted discipline: that the Developer-agent genuinely ran each `[agent]` command against a booted app rather than fabricating its output, and that the Principal genuinely exercised each `[principal]` item in a browser before ticking it — no CI can watch either happen. `Test Plan: unit-tests-only` (a first-class allowed value for pure-logic briefs whose §4 surface has no runtime path) satisfies the phase by the CI unit-test gate alone. **Parser hardening:** the section locator (`locateTestPlanSection`, `packages/aeg-core/src/test-plan-section.ts`) now recognizes both the inline `**Test Plan:**` marker and the `## N. Test Plan` heading form — the original inline-only regex is what let a heading-form body advisory-PASS with an unticked `[principal]` box, since "no section found" (a parser miss, not a genuinely missing section) read as PASS. A task-branch PR with no Test Plan section in either form now FAILs loud instead, naming what was searched for; non-task branches keep the advisory bypass. The runtime Test Plan check — now the `Runtime Test Plan checkbox state` step (4/9) of the AEG gate suite job in `.github/workflows/forge-lifecycle.yml` — now also passes `BRANCH` (previously only `PR_BODY`), without which the task-branch distinction could never fire in real CI.
328
323
  - **Dispatch gates** (depends-on merged / no conflicting PR open) — read from the forge and complied with; mechanical enforcement arrives when an automation tool runs dispatch (`tranche-model.md` §8).
329
324
  - **Label discipline** (Section 14) — `vinaya/tier:*` present on every task Issue and kept in sync with the PR-body `Tier:`; `vinaya/needs:*-input` / `vinaya/blocked` present-when-true *and removed when false*; no `status:*` labels; no `project:*` labels; no label outside the closed set. Trusted discipline; the Archivist drift cron asserts the tier label/field match and flags stale `vinaya/needs:*` labels.
330
325
  - **Contract conformance** (a role doc matches its `contracts/*.md` seam) — trusted discipline; the Archivist drift cron flags a role doc that contradicts its contract. The contract is the source of truth; a divergent role doc is the bug. (The Planner's own rationale grammar's *field-completeness* — every task Issue body carries all eight fields (`roles/planner/reference.md` § Rationale grammar) — moved to Enforced via R1 above; only the "role doc text matches contract prose" half remains trusted here.)
@@ -511,7 +506,7 @@ The seam between **the tranche plan** (a Milestone plus its `vinaya/tranche:*`-l
511
506
 
512
507
  ### The oracle: `packages/aeg-core/bin/verify-coherence.ts`
513
508
 
514
- Sibling to `verify-docs.ts`, both in `packages/aeg-core/bin/`. Runnable as the `coherence` check (`vinaya check coherence`; on this repo's toolchain also standalone as `bun packages/aeg-core/bin/verify-coherence.ts`) and in CI (`GITHUB_TOKEN` required). Zero LLM calls; stateless — each run is a fresh read of forge + files.
509
+ Sibling to `verify-docs.ts`, both in `packages/aeg-core/bin/`. Runnable standalone on this repo's toolchain as `bun packages/aeg-core/bin/verify-coherence.ts` and in CI (`GITHUB_TOKEN` required). The `coherence` check (`vinaya check coherence`) is its branch-scoped sibling, shipped in the CLI: on a `task/<slug>/<n>` branch it runs A1, A2, A3, T1, T2, T3, D1, R1, L1, L3 and L5 over that branch's own tranche only, with A2 and L5 blocking like the rest, and L2 and L4 as warnings; it also runs L5 over every other open Milestone titled exactly a tranche slug, printing those findings as warnings that never change its exit code, because a task pull request can neither cause nor cure another tranche's archival. A forge read A2 or the branch tranche's L5 depends on that fails, fails the check as `severity:infra`, never as a pass. Zero LLM calls; stateless — each run is a fresh read of forge + files.
515
510
 
516
511
  **Both CLI shims are CWD-independent by design** — each `chdir()`s to the repo root immediately on load (before any file-system or git call). This is load-bearing, not cosmetic: `apps/vinaya/web`'s `/api/coherence` route spawns `verify-coherence.ts` as a subprocess without an explicit `cwd`, inheriting the Next.js server's own working directory rather than the repo root — every bare `existsSync`/git-shell-out call would otherwise silently resolve against the wrong base (confirmed live: false M1 `manifest-dangling` findings for files that plainly exist). Direct CLI/CI invocation already ran from the repo root, so the bug was invisible until the Studio's subprocess spawn surfaced it.
517
512
 
@@ -537,7 +532,7 @@ Sibling to `verify-docs.ts`, both in `packages/aeg-core/bin/`. Runnable as the `
537
532
  | L1 | `stale-active-tranche` | Active tranche with zero open Issues → should archive |
538
533
  | L2 | `premature-archive` | Archived tranche with any open Issue → investigate |
539
534
  | L3 | informational | Active tranche count (does not affect exit code) |
540
- | L5 | `open-milestone-all-closed` | Open Milestone whose every task Issue is closed → close/archive. Advisory forge-native analogue of L1, for a tranche that is a Milestone plus labeled Issues |
535
+ | L5 | `tranche-not-archived` | Active tranche whose every task Issue is closed → archive. Blocking forge-native analogue of L1, for a tranche that is a Milestone plus labeled Issues |
541
536
  | N/M | delegate | Decision-number + manifest integrity (delegate to T2) |
542
537
 
543
538
  **A2's provenance-detection mechanism:** `fetchProvenance` (in `packages/aeg-forge-state/src/fetch-provenance.ts` — moved out of `verify-coherence.ts` so Studio's dispatch-readiness badge shares the single implementation with `verify-coherence.ts`/`verify-dispatch.ts`, then extracted to the shared package; behavior unchanged) resolves the *most recent* `ClosedEvent` per Issue (`timelineItems(last: 1, ...)`, not `first: 1`) — a reopened-then-reclosed Issue's real closer is the last event, not the first. When the resolved event has no PR `closer` at all — confirmed for Issues closed via an explicit `gh issue close`, where GitHub's `closer` field never populates even though a real merged PR did the work — `fetchProvenance` falls back to the Issue's `CROSS_REFERENCED_EVENT` timeline items (populated for *any* PR mentioning `#<issueNum>`, not only an unresolved `Closes #N` link — necessary because the real closing PRs for this null-closer case frequently never carried a `Closes #N` link at all, which is exactly why they needed an explicit close). Each merged candidate's body/comments are checked for a provenance block whose own `Issue:` field names this Issue — required because an unrelated cross-referenced PR can legitimately carry genuine provenance for a *different* task.
@@ -614,7 +609,7 @@ The seam between **a task's dispatch preconditions** (row-existence, Issue-exist
614
609
 
615
610
  Sibling to `verify-docs.ts`/`verify-coherence.ts`, same thin-CLI-shim discipline: resolves args, fetches git/forge state, and calls the pure evaluators in `packages/aeg-core/src/` (`dispatch-gate.ts`, `leftover-detection.ts`, `baseline-capture.ts`, `premise-check.ts`). No check logic lives in the `bin/` file.
616
611
 
617
- **The default-mode composite ships as the `dispatch-readiness` check** (`vinaya check dispatch-readiness`, branch-scoped) — see `enforcement.md`'s dispatch row for its known parity gap (prior-tranche-archival always reports empty). The `--premise`/`--simulate`/`--check-baseline` modes below have no shipped `vinaya` equivalent yet.
612
+ **The default-mode composite ships as the `dispatch-readiness` check** (`vinaya check dispatch-readiness`, branch-scoped) — see `enforcement.md`'s dispatch row for how it resolves the prior-tranche-archival predicate. The `--premise`/`--simulate`/`--check-baseline` modes below have no shipped `vinaya` equivalent yet.
618
613
 
619
614
  **Usage (this repo's toolchain)** — five independent invocation forms, not a sequence:
620
615
  - Default mode: `bun packages/aeg-core/bin/verify-dispatch.ts <tranche> <n>`
@@ -625,7 +620,7 @@ Sibling to `verify-docs.ts`/`verify-coherence.ts`, same thin-CLI-shim discipline
625
620
 
626
621
  **Default mode composes three checks:**
627
622
 
628
- 1. **`checkDispatchReadiness` (`src/dispatch-gate.ts`)** — one `{ ready, blockers }` verdict from: Issue-existence + phantom-reference detection; the Planner-rationale gate (`checkIssueRationale`, reused, not re-implemented); every `depends-on` edge's PR-merged state — OR a dependency Issue hand-closed directly by a recognized Principal (`PRINCIPAL_ALLOWLIST`/an adopter's configured `principals`), with `stateReason: 'completed'` — a second, narrower "done" path for the documented exception where a dependency's technical premise dissolved and no PR was ever going to land; every `conflicts-with` edge's open/in-flight state; and, per project named in the task's `Project(s)`, whether a prior active tranche for that project is fully closed but unarchived. (2026-07-13: the immediately-prior task's three-predicate row-adjacency archival bar — Issue closed, PR merged, provenance block present — was removed as a blocking predicate; automated post-merge provenance posting made the signal it protected moot. `DispatchGateInput.priorTask` still exists as a dormant field for caller compatibility, but the gate no longer reads it.) As of the forge-native cutover, the task's own row/Issue is derived live from the forge (`@attalabs/aeg-forge-state`'s `deriveTrancheFromForge` — a Milestone + `vinaya/tranche:<slug>`-labeled Issues), not read from a repo file on a freshly-fetched `origin/main` — there is no separate "fetched" copy of the forge to go stale.
623
+ 1. **`checkDispatchReadiness` (`src/dispatch-gate.ts`)** — one `{ ready, blockers }` verdict from: Issue-existence + phantom-reference detection; the Planner-rationale gate (`checkIssueRationale`, reused, not re-implemented); every `depends-on` edge's PR-merged state — OR a dependency Issue hand-closed directly by a recognized Principal (the repository's configured `principals`, read from its default branch — the gate's checks refuse when none is configured), with `stateReason: 'completed'` — a second, narrower "done" path for the documented exception where a dependency's technical premise dissolved and no PR was ever going to land; every `conflicts-with` edge's open/in-flight state; and, per project named in the task's `Project(s)`, whether a prior active tranche for that project is fully closed but unarchived. (2026-07-13: the immediately-prior task's three-predicate row-adjacency archival bar — Issue closed, PR merged, provenance block present — was removed as a blocking predicate; automated post-merge provenance posting made the signal it protected moot. `DispatchGateInput.priorTask` still exists as a dormant field for caller compatibility, but the gate no longer reads it.) As of the forge-native cutover, the task's own row/Issue is derived live from the forge (`@attalabs/aeg-forge-state`'s `deriveTrancheFromForge` — a Milestone + `vinaya/tranche:<slug>`-labeled Issues), not read from a repo file on a freshly-fetched `origin/main` — there is no separate "fetched" copy of the forge to go stale.
629
624
  2. **`classifyLeftover` (`src/leftover-detection.ts`)** — `clean | resume | stop` from the task branch's remote existence, local worktree existence, and commits already ahead of `origin/main` (this is the one remaining check in this seam that genuinely needs a freshly-fetched `origin/main` — `verify-dispatch` still runs `git fetch origin main --quiet` for it). `stop` blocks dispatch — Step 0 never creates a commit, so any commit ahead of main is real prior work that re-running Step 0 would orphan.
630
625
  3. **`captureBaseline`/`compareToBaseline` (`src/baseline-capture.ts`)** — the current `verify-docs --full` and `verify-coherence` finding counts, printed as an **informational** capture, never a blocking "must be green" bar (live-fire: a brief once asserted "verify-docs full mode must be green" as a pre-flight condition without ever running it — full mode carried 44 pre-existing, unrelated findings and had never been green). The standing contract this seam establishes is **"no worse than the captured baseline,"** re-checkable later via `--check-baseline <file>`.
631
626
 
@@ -70,7 +70,7 @@ Under the review loop the driver has already created this worktree, outside any
70
70
  git worktree add .worktrees/task/[tranche-slug]/[n] -b task/[tranche-slug]/[n] --no-track origin/main && cd .worktrees/task/[tranche-slug]/[n] && git config push.autoSetupRemote true && bun install --frozen-lockfile --silent
71
71
  ```
72
72
 
73
- 1. Clean status; parent `origin/main`; branch suffix literal-matches topology `#` column (`[n]`).
73
+ 1. Clean status; parent `origin/main`; branch suffix literal-matches topology `#` column (`[n]`). One exception: when the driver's prompt names kept work — this task's own unpublished work, kept in the worktree by an earlier pause — exactly those files and commits are accepted; any other uncommitted change still fails this check.
74
74
  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.
75
75
  3. [any task-specific pre-flight checks — required tools present, reference files readable, re-digs to confirm the §2 citations]
76
76
 
@@ -106,6 +106,9 @@ On any failure: STOP and report.
106
106
  ```
107
107
 
108
108
  - [ ] **[principal]** [auth-gated / vendor-key / visual check — what the Principal does and what they should observe]
109
+ - **[live]** `[<command that needs real signed-in agent sessions, e.g. a live conformance test switched on by an environment variable>]`
110
+
111
+ [Each kind has one use. A command line is one the Developer runs in its sandbox. A `[live]` line is a command a machine can judge by its exit code but that needs real signed-in agent sessions, so it is skipped in the Developer's runs, the push hook and CI: the review loop runs it on its own host only once both reviewers have approved the head, because it runs the pull request's own code outside any sandbox; a non-zero exit sends the Developer back as a new round, and the next head is reviewed before its line runs again. Where the host has no subscription sign-in for a vendor the line names, the loop records the line unverified on the pull request and the merge gate holds it like an unticked `[principal]` item. A `[principal]` item is what only a person can judge — a visual check, a judgment call. Never list a `[live]` line in CI.]
109
112
 
110
113
  [Pure-logic tasks with no runtime surface in §4 declare the `unit-tests-only` sentinel on the Test Plan field instead of a command list — one form or the other, never both.]
111
114
 
@@ -122,7 +125,7 @@ STOP and report if: pre-flight fails; [the Planner's stop-and-escalate condition
122
125
  - [forbidden patterns for this task — deferred features, off-limits paths]
123
126
  - Never write status anywhere; never add execution metadata to the tranche file.
124
127
 
125
- > **Autonomy:** Do not stop to ask clarifying questions. For any ambiguity not covered by a Section 10 stop condition, choose the most reasonable option consistent with this brief, record the choice in the PR body at open, or in a PR comment after open, and continue. Halt only for the explicit Section 10 stop conditions — and when you halt, record the blocker in a PR comment or an Issue comment rather than waiting interactively for input.
128
+ > **Autonomy:** Do not stop to ask clarifying questions. For any ambiguity not covered by a Section 10 stop condition, choose the most reasonable option consistent with this brief, record the choice in the PR body at open, and continue. Halt only for the explicit Section 10 stop conditions — and when you halt, report the blocker in your turn result (the loop posts it); post no PR or Issue comment yourself, and do not wait interactively for input.
126
129
 
127
130
  ## 12. Deliverable
128
131
 
@@ -0,0 +1,38 @@
1
+ ---
2
+ sidebar_title: "Template: Decision record"
3
+ ---
4
+ # Template — Decision record
5
+
6
+ **`vinaya new adr <title>` copies the block below the divider into the next numbered file of the folder `decisionRecords.path` names, and fills in its number, its title and today's date.** The command refuses while that key is unset. A record is short — one decision, the forces behind it, and what follows from it — written for someone who joins long after the decision was made and needs to know why things are the way they are.
7
+
8
+ Records are numbered in order from `0001`, and a number is never reused. A record starts as `Proposed`, becomes `Accepted` once it is agreed, and is never deleted: a decision that is reversed stays in the folder, marked `Superseded`, and names the record that replaced it. Only a record inside the folder may name another record by its number. Every other page states the decision itself, because a number means nothing to a reader without the folder in front of them.
9
+
10
+ Replace every `[…]` placeholder with real content, in full sentences. Name no ticket, change request or work item: a record outlives all three, so it says what was decided instead of where.
11
+
12
+ ---
13
+
14
+ # {{NUMBER}}. {{TITLE}}
15
+
16
+ **Status:** Proposed
17
+
18
+ **Date:** {{DATE}}
19
+
20
+ ## Context
21
+
22
+ [The forces at play — technical, organisational, the constraints of this project — stated as plain facts, including the ones in tension with each other.]
23
+
24
+ ## Decision
25
+
26
+ [The response to those forces, in full sentences and the active voice: "We will …".]
27
+
28
+ ## Considered options
29
+
30
+ [Each option that was weighed, with what it would have cost and why it was not chosen. The chosen option appears here too.]
31
+
32
+ ## Consequences
33
+
34
+ [What becomes easier and what becomes harder once this decision is applied — every consequence, not only the welcome ones.]
35
+
36
+ ## Where it is applied
37
+
38
+ [The files, modules, commands or settings that carry this decision out, so a reader can find it in the code.]
@@ -55,7 +55,7 @@ O2. [SECOND OBJECTIVE — numbered contiguously from O1, one line per objective,
55
55
 
56
56
  **Suggested agent-class** — [AGENT CLASS — high, mid or fast, with a one-line reason tied to this task's real difficulty.]
57
57
 
58
- **Stop-and-escalate** — [STOP-AND-ESCALATE — the conditions under which the executing agent stops and escalates rather than improvises, e.g. "if making X work requires changing shared contract Y, escalate severity:strategy".]
58
+ **Stop-and-escalate** — [STOP-AND-ESCALATE — conditions the Developer can decide from code, tests or tool output inside its own sandbox. A check that needs a live run, a subscription login or an observation only the Principal can make belongs in a `**[principal]**` Test plan line, never here. A contradiction with the Boundary is a stop condition only when the fix needs a path outside the Surface, a protected administrative path the Surface does not cover, or a change of the task's objectives — never for a file inside the Surface.]
59
59
 
60
60
  **Docs to keep coherent** — [DOCS — each spec, skill or doc this task will make incoherent, by its repository path, derived from reading them; for a surface no doc covers, the `no-doc-surface` sentinel followed by the reason.]
61
61
 
@@ -186,7 +186,7 @@ Two gates make parallel developers safe — both **forge-answerable, zero stored
186
186
 
187
187
  With a single principal these rules live in one head; with a team they must be a **lock**, not a whiteboard. In manual mode they are preconditions each Developer checks against the forge before beginning. A dispatch tool can enforce them in code. Either way the conflict is declared at planning time and enforced at dispatch time — never discovered at merge time, which is too late.
188
188
 
189
- **v1 honesty:** before Step 0, checking these gates is still *trusted, not enforced* — the Developer reads and complies, but nothing mechanically stops starting anyway. By the first push, though, they are mechanically enforced: the `.vinaya/hooks/pre-push` `first-push-dispatch` check runs the same `checkDispatchReadiness` derivation the `dispatch-readiness` check uses, on a task branch's first push, and refuses it outright if the dependency's PR isn't merged or the conflicting sibling's PR is open (it fails open only when the forge itself is unreachable). It shares that check's narrower parity, though — its prior-tranche-archival predicate always reports empty, the same gap `roles/developer.md` documents, so it does not run the full `verify-dispatch.ts` derivation. What remains trusted discipline is catching it earlier, before any work is done, with the unabridged derivation — the hook is the backstop, not the first line.
189
+ **v1 honesty:** before Step 0, checking these gates is still *trusted, not enforced* — the Developer reads and complies, but nothing mechanically stops starting anyway. By the first push, though, they are mechanically enforced: the `.vinaya/hooks/pre-push` `first-push-dispatch` check runs the same `checkDispatchReadiness` derivation the `dispatch-readiness` check uses, on a task branch's first push, and refuses it outright if the dependency's PR isn't merged or the conflicting sibling's PR is open (it fails open only when the forge itself is unreachable). It reads the same prior-tranche-archival predicate the `dispatch-readiness` check does, and treats a failed archival read as an unreachable forge. What remains trusted discipline is catching it earlier, before any work is done, with the unabridged derivation — the hook is the backstop, not the first line.
190
190
 
191
191
  ---
192
192