@attalabs/vinaya 0.36.0 → 0.38.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (292) hide show
  1. package/README.md +6 -6
  2. package/aeg-root/contracts/developer-reviewer.md +1 -1
  3. package/aeg-root/contracts/planner-operator.md +1 -1
  4. package/aeg-root/contracts/principal-operator.md +6 -6
  5. package/aeg-root/contracts/security-archivist.md +1 -1
  6. package/aeg-root/enforcement.md +14 -14
  7. package/aeg-root/process.md +3 -1
  8. package/aeg-root/roles/archivist.md +2 -2
  9. package/aeg-root/roles/developer/reference.md +36 -37
  10. package/aeg-root/roles/developer.md +9 -5
  11. package/aeg-root/roles/operator.md +18 -18
  12. package/aeg-root/roles/planner/reference.md +15 -4
  13. package/aeg-root/roles/principal.md +6 -1
  14. package/aeg-root/roles/reviewer.md +14 -6
  15. package/aeg-root/roles/security.md +22 -11
  16. package/aeg-root/roles/tranche-archivist.md +14 -2
  17. package/aeg-root/state-machine.md +12 -11
  18. package/aeg-root/templates/brief-template.md +8 -6
  19. package/aeg-root/templates/pr-report-template.md +1 -9
  20. package/aeg-root/tranche-model.md +10 -4
  21. package/dist/checks/bin/check-body-bare-digits.js +823 -595
  22. package/dist/checks/bin/check-branch-topology.js +796 -478
  23. package/dist/checks/bin/check-brief-shape.js +824 -596
  24. package/dist/checks/bin/check-changeset-coverage.js +1337 -747
  25. package/dist/checks/bin/check-closes-n.js +796 -478
  26. package/dist/checks/bin/check-coherence.js +914 -611
  27. package/dist/checks/bin/check-dead-branch-push.js +705 -462
  28. package/dist/checks/bin/check-dispatch-readiness.js +941 -624
  29. package/dist/checks/bin/check-doc-coverage-push.js +1332 -742
  30. package/dist/checks/bin/check-doc-coverage.js +1339 -742
  31. package/dist/checks/bin/check-doctrine-no-procedures.js +821 -593
  32. package/dist/checks/bin/check-doctrine-portability.js +1332 -742
  33. package/dist/checks/bin/check-evidence-fresh.js +1339 -918
  34. package/dist/checks/bin/check-exec-bits.js +1331 -741
  35. package/dist/checks/bin/check-first-push-dispatch.js +917 -614
  36. package/dist/checks/bin/check-issue-assignment.js +796 -478
  37. package/dist/checks/bin/check-issue-milestone-attach.js +705 -462
  38. package/dist/checks/bin/check-issue-objectives-numbering.js +821 -593
  39. package/dist/checks/bin/check-issue-parts-coverage.js +705 -462
  40. package/dist/checks/bin/check-issue-surface-globs.js +925 -613
  41. package/dist/checks/bin/check-issue-title-grammar.js +705 -462
  42. package/dist/checks/bin/check-issue-tranche-label.js +705 -462
  43. package/dist/checks/bin/check-main-branch-refusal.js +705 -462
  44. package/dist/checks/bin/check-no-disk-state.js +705 -462
  45. package/dist/checks/bin/check-pr-premise-reassert.js +821 -593
  46. package/dist/checks/bin/check-pr-report-density.js +705 -462
  47. package/dist/checks/bin/check-principal-test-plan-wait.js +705 -462
  48. package/dist/checks/bin/check-quoted-command.js +1816 -1228
  49. package/dist/checks/bin/check-reader-resolvable-prose.js +1835 -1235
  50. package/dist/checks/bin/check-registry-gates.js +993 -526
  51. package/dist/checks/bin/check-retired-vocabulary.js +1810 -1222
  52. package/dist/checks/bin/check-review-gate.js +832 -604
  53. package/dist/checks/bin/check-single-plan-pr.js +705 -462
  54. package/dist/checks/bin/check-surface-scope.js +796 -478
  55. package/dist/checks/bin/check-test-plan.js +705 -462
  56. package/dist/checks/bin/check-token-collection-wired.js +705 -462
  57. package/dist/checks/bin/check-workspace-escape.js +1332 -742
  58. package/dist/checks/bin/verify-dispatch.js +3849 -0
  59. package/dist/index.js +20876 -10091
  60. package/dist/lib/pre-push-cache-test-run.js +1045 -682
  61. package/dist/lib/pre-push-changed-files.js +16 -11
  62. package/dist/lib/pre-push-select-tests.js +785 -500
  63. package/package.json +2 -2
  64. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/anchored-region.ts +7 -6
  65. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/brief-render.ts +71 -15
  66. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/brief-validation.ts +51 -12
  67. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/control-store/index.ts +1 -0
  68. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/control-store/local.ts +31 -0
  69. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/control-store/records.ts +50 -2
  70. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/assess-round.ts +443 -28
  71. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/fakes.ts +18 -5
  72. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/index.ts +6 -4
  73. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/journal-reconstruction.ts +13 -13
  74. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/render-summary.ts +46 -110
  75. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/types.ts +169 -11
  76. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/doc-claim.ts +32 -6
  77. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/docs/index.ts +3 -1
  78. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/docs/published-prose.ts +30 -0
  79. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/doctrine-portability.ts +6 -2
  80. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/gate-audience.ts +0 -1
  81. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/index.ts +82 -8
  82. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/issue-validation.ts +754 -7
  83. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/leftover-detection.ts +24 -6
  84. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/custom.ts +157 -0
  85. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/envelope.ts +44 -6
  86. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/fixtures/executions.ts +493 -0
  87. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/fixtures/fact-sheets.ts +111 -0
  88. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/fixtures/generator.ts +155 -0
  89. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/fixtures/index.ts +12 -0
  90. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/index.ts +128 -0
  91. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/questions/catches.ts +63 -0
  92. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/questions/checks.ts +146 -0
  93. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/questions/common.ts +137 -0
  94. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/questions/completion.ts +137 -0
  95. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/questions/convergence.ts +420 -0
  96. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/questions/determinism.ts +65 -0
  97. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/questions/index.ts +69 -0
  98. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/questions/judgment.ts +132 -0
  99. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/questions/labels.ts +21 -0
  100. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/questions/time.ts +167 -0
  101. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/questions/usage.ts +139 -0
  102. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/schema.ts +226 -15
  103. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/store.ts +7 -7
  104. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/sync/cache-contract.ts +207 -0
  105. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/sync/contracts.ts +105 -0
  106. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/sync/engine.ts +308 -0
  107. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/sync/index.ts +34 -0
  108. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/sync/measured.ts +20 -0
  109. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/sync/memory-cache.ts +78 -0
  110. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/sync/normalize.ts +156 -0
  111. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/sync/row.ts +103 -0
  112. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/reader-resolvable-prose.ts +34 -6
  113. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/registry-checks.ts +70 -6
  114. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/review-gate.ts +52 -4
  115. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/review-input-manifest.ts +19 -14
  116. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/review-policy.ts +201 -24
  117. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/review-status.ts +5 -2
  118. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/task-phase-history.ts +46 -0
  119. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/task-tools.ts +15 -28
  120. package/studio-standalone/apps/vinaya-studio/web/.next/BUILD_ID +1 -1
  121. package/studio-standalone/apps/vinaya-studio/web/.next/app-path-routes-manifest.json +0 -1
  122. package/studio-standalone/apps/vinaya-studio/web/.next/build-manifest.json +3 -3
  123. package/studio-standalone/apps/vinaya-studio/web/.next/prerender-manifest.json +3 -3
  124. package/studio-standalone/apps/vinaya-studio/web/.next/required-server-files.json +0 -5
  125. package/studio-standalone/apps/vinaya-studio/web/.next/routes-manifest.json +0 -6
  126. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error/page.js +1 -1
  127. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error/page.js.nft.json +1 -1
  128. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  129. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.html +1 -1
  130. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.rsc +1 -1
  131. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  132. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  133. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  134. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  135. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  136. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_not-found/page/server-reference-manifest.json +2 -2
  137. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_not-found/page.js +1 -1
  138. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_not-found/page.js.nft.json +1 -1
  139. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  140. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/page/server-reference-manifest.json +2 -2
  141. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/page.js +1 -1
  142. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/page.js.nft.json +1 -1
  143. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/page_client-reference-manifest.js +1 -1
  144. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/backlog/page/server-reference-manifest.json +2 -2
  145. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/backlog/page.js +3 -3
  146. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/backlog/page.js.nft.json +1 -1
  147. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/backlog/page_client-reference-manifest.js +1 -1
  148. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/page/server-reference-manifest.json +2 -2
  149. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/page.js +3 -3
  150. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/page.js.nft.json +1 -1
  151. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/page_client-reference-manifest.js +1 -1
  152. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/page/server-reference-manifest.json +2 -2
  153. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/page.js +3 -3
  154. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/page.js.nft.json +1 -1
  155. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/page_client-reference-manifest.js +1 -1
  156. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/page/server-reference-manifest.json +3 -3
  157. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/page.js +5 -5
  158. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/page.js.nft.json +1 -1
  159. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/page_client-reference-manifest.js +1 -1
  160. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/tasks/[taskId]/page/server-reference-manifest.json +2 -2
  161. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/tasks/[taskId]/page.js +3 -3
  162. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/tasks/[taskId]/page.js.nft.json +1 -1
  163. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/tasks/[taskId]/page_client-reference-manifest.js +1 -1
  164. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/page/server-reference-manifest.json +2 -2
  165. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/page.js +3 -3
  166. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/page.js.nft.json +1 -1
  167. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/page_client-reference-manifest.js +1 -1
  168. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/tranches/page/server-reference-manifest.json +2 -2
  169. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/tranches/page.js +3 -3
  170. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/tranches/page.js.nft.json +1 -1
  171. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/tranches/page_client-reference-manifest.js +1 -1
  172. package/studio-standalone/apps/vinaya-studio/web/.next/server/app-paths-manifest.json +0 -1
  173. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/044u_vinaya-studio_web_src_app_studio_backlog__components_BacklogTable_tsx_0oha0bt._.js +3 -0
  174. 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
  175. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/{[root-of-the-server]__1bh2awk._.js → [root-of-the-server]__038scsm._.js} +2 -2
  176. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/{[root-of-the-server]__1widio3._.js → [root-of-the-server]__03__s45._.js} +2 -2
  177. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/{_15gdg48._.js → [root-of-the-server]__04adkz-._.js} +3 -3
  178. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__05zwn98._.js +14 -0
  179. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__08e39jo._.js +3 -0
  180. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__0h9yhwx._.js +1 -1
  181. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/{[root-of-the-server]__1wy7w66._.js → [root-of-the-server]__0jdjsxe._.js} +2 -2
  182. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__0ls23oh._.js +1 -1
  183. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__10riywf._.js +3 -0
  184. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/{[root-of-the-server]__13znegp._.js → [root-of-the-server]__134x-65._.js} +2 -2
  185. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/{[root-of-the-server]__13eeix2._.js → [root-of-the-server]__1_l_l1u._.js} +2 -2
  186. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__1f4bb3_._.js +3 -0
  187. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__1gjqmhq._.js +1 -1
  188. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/{[root-of-the-server]__1dky4g0._.js → [root-of-the-server]__1my83lt._.js} +2 -2
  189. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__1ng2x88._.js +3 -0
  190. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/{[root-of-the-server]__040smoa._.js → [root-of-the-server]__1qpc6at._.js} +2 -2
  191. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__1snpgaw._.js +56 -0
  192. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__1wc4-ip._.js +2 -2
  193. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_06h3wbl._.js +3 -0
  194. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_08onyya._.js +1 -1
  195. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_096f46i._.js +1 -1
  196. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0af2one._.js +1 -1
  197. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0e5tkdd._.js +1 -1
  198. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0gs4gvl._.js +3 -0
  199. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0kf2g72._.js +1 -1
  200. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0zf4d27._.js +1 -1
  201. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_1-wo68i._.js +1 -1
  202. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_121lrn5._.js +3 -0
  203. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_1achbh9._.js +1 -1
  204. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_1o4v6lb._.js +3 -0
  205. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_1q7h5mz._.js +1 -1
  206. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_1ztd4i3._.js +3 -0
  207. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_209-ugd._.js +3 -0
  208. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_214d71c._.js +3 -0
  209. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/apps_vinaya-studio_web_src_app_studio_projects_[name]_tranches_[slug]_17dho0f._.js +3 -0
  210. 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
  211. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/node_modules_next_dist_1lzmr5o._.js +1 -1
  212. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/packages_ui_libraries_animate_components_index_ts_186fje1._.js +1 -1
  213. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/packages_ui_libraries_basic_components_index_ts_0xk1vda._.js +1 -1
  214. package/studio-standalone/apps/vinaya-studio/web/.next/server/middleware-build-manifest.js +3 -3
  215. package/studio-standalone/apps/vinaya-studio/web/.next/server/pages/500.html +1 -1
  216. package/studio-standalone/apps/vinaya-studio/web/.next/server/server-reference-manifest.js +1 -1
  217. package/studio-standalone/apps/vinaya-studio/web/.next/server/server-reference-manifest.json +4 -4
  218. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/09fcolor69bun.js +1 -0
  219. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/0lcwmwzxacdie.js +1 -0
  220. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/0ojry7lrbzkfd.css +1 -0
  221. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/1-acpmtfmrc35.js +1 -0
  222. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/1giu47hrbhroj.js +1 -0
  223. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/1shz6lwruld25.js +1 -0
  224. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/1ytvuy1mmnc6j.js +1 -0
  225. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/{3oxhhhm_psozq.js → 21a6_5cr956wj.js} +1 -1
  226. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/{2o9l0b7eqbr57.js → 2f2y8xxok8zph.js} +1 -1
  227. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/2g8mwnydod96u.js +1 -0
  228. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/{3li0ueedy-ozv.js → 2nrnuawd5fwpv.js} +1 -1
  229. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/2nw47832_uvfe.js +1 -0
  230. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/2qdxnj8wk2h0s.js +1 -0
  231. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/{3lqjwjrcvq481.js → 2xevgia1h8g0y.js} +2 -2
  232. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/3b9q75p-z5ma5.js +1 -0
  233. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/3cv-oe7153242.js +1 -0
  234. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/3m310lbjj4p5u.js +1 -0
  235. package/studio-standalone/apps/vinaya-studio/web/package.json +2 -2
  236. package/studio-standalone/apps/vinaya-studio/web/server.js +1 -1
  237. package/dist/checks/bin/check-token-report.js +0 -6526
  238. package/studio-standalone/_node_modules/@attalabs/vinaya/studio-standalone/_node_modules/@attalabs/vinaya/studio-standalone/_node_modules/@attalabs/vinaya/studio-standalone/_node_modules/@attalabs/vinaya/studio-standalone/_node_modules/@attalabs/vinaya/studio-standalone/_node_modules/@attalabs/vinaya/studio-standalone/_node_modules/@attalabs/vinaya/studio-standalone/_node_modules/@attalabs/vinaya/studio-standalone/_node_modules/@attalabs/aeg-core/bin/verify-coherence.ts +0 -1089
  239. package/studio-standalone/_node_modules/next/dist/compiled/next-server/app-route-turbo.runtime.prod.js +0 -6
  240. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/api/coherence/route/app-paths-manifest.json +0 -3
  241. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/api/coherence/route/build-manifest.json +0 -9
  242. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/api/coherence/route/server-reference-manifest.json +0 -4
  243. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/api/coherence/route.js +0 -6
  244. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/api/coherence/route.js.map +0 -5
  245. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/api/coherence/route.js.nft.json +0 -1
  246. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/api/coherence/route_client-reference-manifest.js +0 -3
  247. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/044u_vinaya-studio_web__next-internal_server_app_api_coherence_route_actions_1rnzea1.js +0 -3
  248. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/[externals]__0cki-x_._.js +0 -3
  249. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/[root-of-the-server]__02a-3g8._.js +0 -15
  250. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/[turbopack]_runtime.js +0 -903
  251. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__074w9nf._.js +0 -3
  252. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__0ln09ua._.js +0 -3
  253. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__0oegopp._.js +0 -3
  254. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__13yxbjd._.js +0 -51
  255. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__1duqmtm._.js +0 -3
  256. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__1z7dml9._.js +0 -9
  257. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0bfs_u4._.js +0 -3
  258. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0g8_eot._.js +0 -3
  259. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0hrh_v-._.js +0 -181
  260. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0i4-dea._.js +0 -3
  261. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0o54suy._.js +0 -3
  262. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0rxd7s0._.js +0 -3
  263. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0y1jv16._.js +0 -3
  264. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_151m4rz._.js +0 -3
  265. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_1a9dieq._.js +0 -3
  266. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_1sxsf5q._.js +0 -3
  267. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_1sy_yfr._.js +0 -3
  268. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_219v2an._.js +0 -3
  269. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/apps_vinaya-studio_web_src_app_studio_projects_[name]_tranches_[slug]_05ufo8i._.js +0 -3
  270. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/packages_ui_libraries_basic_components_form_input_tsx_0es8d8b._.js +0 -3
  271. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/packages_ui_libraries_brutal_components_index_ts_0n_lcc4._.js +0 -3
  272. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/packages_ui_libraries_retro_components_index_ts_0wvpm_z._.js +0 -3
  273. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/00z3-ljjd1gj9.js +0 -1
  274. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/0bjnj-5fy4e7l.js +0 -1
  275. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/0c8uwz_-m8s99.js +0 -165
  276. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/0ct0c-xj0baf6.js +0 -1
  277. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/0ko698wh8xx2g.css +0 -1
  278. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/0t5n_r4xm__t-.js +0 -1
  279. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/0vc2u252q5q6o.js +0 -1
  280. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/16r_o07lw0vm0.js +0 -1
  281. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/1cah7_e5a1zvu.js +0 -1
  282. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/1gjo9-6dz7nup.js +0 -1
  283. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/24tz8aro1uto4.js +0 -1
  284. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/2ef2g5fozszw7.js +0 -1
  285. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/2ka8dg687auhj.js +0 -1
  286. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/2pf3f50gbrkyv.js +0 -1
  287. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/2qq49pct3q51-.js +0 -1
  288. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/3et66z7glk65w.js +0 -1
  289. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/3y6u3prmrkea-.js +0 -1
  290. /package/studio-standalone/apps/vinaya-studio/web/.next/static/{z1fTSBP6ZlUjObzFIp-qq → yNZEFRSjP9BLUfdf96Eol}/_buildManifest.js +0 -0
  291. /package/studio-standalone/apps/vinaya-studio/web/.next/static/{z1fTSBP6ZlUjObzFIp-qq → yNZEFRSjP9BLUfdf96Eol}/_clientMiddlewareManifest.js +0 -0
  292. /package/studio-standalone/apps/vinaya-studio/web/.next/static/{z1fTSBP6ZlUjObzFIp-qq → yNZEFRSjP9BLUfdf96Eol}/_ssgManifest.js +0 -0
@@ -14,6 +14,7 @@ import type {
14
14
  LoopState,
15
15
  Observations,
16
16
  RoundStats,
17
+ TaskClock,
17
18
  VerdictObservation
18
19
  } from './types'
19
20
 
@@ -29,17 +30,22 @@ export function fakeStats(round: number, overrides: Partial<RoundStats> = {}): R
29
30
  }
30
31
  }
31
32
 
32
- /** The CI fake: a round's mechanical-gate result, optionally carrying the developer's confidence. */
33
+ /**
34
+ * The CI fake: a round's mechanical-gate result, optionally carrying the
35
+ * developer's confidence and — for a red gate — the mechanical failure the
36
+ * driver observed, verbatim, exactly as the real one reports it.
37
+ */
33
38
  export function fakeGate(
34
39
  round: number,
35
40
  green: boolean,
36
- opts: { confidence?: Confidence; stats?: Partial<RoundStats> } = {}
41
+ opts: { confidence?: Confidence; stats?: Partial<RoundStats>; failure?: string } = {}
37
42
  ): Observations {
38
43
  return {
39
44
  kind: 'gate',
40
45
  round,
41
46
  green,
42
47
  ...(opts.confidence !== undefined ? { confidence: opts.confidence } : {}),
48
+ ...(opts.failure !== undefined ? { failure: opts.failure } : {}),
43
49
  stats: fakeStats(round, opts.stats)
44
50
  }
45
51
  }
@@ -92,16 +98,23 @@ export function notMetVerdict(role: 'reviewer' | 'security', objectiveIds: strin
92
98
  * state forward and concatenating every emitted event — the shape Part 1's
93
99
  * byte-for-byte event-list assertion needs. Returns the final state, the flat
94
100
  * event list, and every decision returned along the way (in order).
101
+ *
102
+ * `clockAt` is the task's wall clock as the real driver would read it before
103
+ * each step, by step index — the scripted equivalent of a run whose elapsed
104
+ * time grows between observations. Omitted, no clock is passed at all, which
105
+ * is exactly a caller that cannot measure the task's first start: the time
106
+ * budget is then never armed and every existing scenario behaves as before.
95
107
  */
96
108
  export function runScenario(
97
109
  initial: LoopState,
98
- steps: Observations[]
110
+ steps: Observations[],
111
+ clockAt?: (index: number) => TaskClock | undefined
99
112
  ): { state: LoopState; events: DevReviewLoopEventInput[]; decisions: Decision[] } {
100
113
  let state = initial
101
114
  const events: DevReviewLoopEventInput[] = []
102
115
  const decisions: Decision[] = []
103
- for (const step of steps) {
104
- const result = assessRound(state, step)
116
+ for (const [index, step] of steps.entries()) {
117
+ const result = assessRound(state, step, clockAt?.(index))
105
118
  state = result.state
106
119
  events.push(...result.events)
107
120
  decisions.push(result.decision)
@@ -1,5 +1,5 @@
1
- export { assessRound } from './assess-round'
2
- export { parseSummaryConfidenceRows, renderSummary } from './render-summary'
1
+ export { assessRound, renderPhaseBreakdown, renderTaskBudgetDetail, taskBudgetExceeded } from './assess-round'
2
+ export { parseSummaryConfidenceRows, renderPublishedMarker } from './render-summary'
3
3
  export type { SummaryConfidenceRow } from './render-summary'
4
4
  export { initialLoopState } from './types'
5
5
  export {
@@ -7,13 +7,14 @@ export {
7
7
  isConcludedJournal,
8
8
  isPublishedSummaryComment,
9
9
  nextRoundNumber,
10
- reconstructRounds,
11
- SUMMARY_TABLE_HEADER
10
+ PUBLISHED_MARKER_LINE,
11
+ reconstructRounds
12
12
  } from './journal-reconstruction'
13
13
  export type { ReconstructedJournal, ReconstructionInput, ReviewGateFact } from './journal-reconstruction'
14
14
  export type {
15
15
  Confidence,
16
16
  Decision,
17
+ DeferredFindingRow,
17
18
  DevReviewLoopEventInput,
18
19
  FindingObservation,
19
20
  FindingState,
@@ -27,5 +28,6 @@ export type {
27
28
  RoundOutcome,
28
29
  RoundRecord,
29
30
  RoundStats,
31
+ TaskClock,
30
32
  VerdictObservation
31
33
  } from './types'
@@ -35,23 +35,23 @@
35
35
  * what the numbering and the "already published?" decision need.
36
36
  */
37
37
 
38
- import { SEVERITY_COLUMNS, type RoundRecord } from './types'
38
+ import type { RoundRecord } from './types'
39
39
 
40
40
  /**
41
- * The published summary's own header row, byte-for-byte as `render-summary.ts`
42
- * emits it — both derived from `SEVERITY_COLUMNS`, so the detector here and
43
- * the renderer there can never drift about what a summary comment looks like.
44
- * A principal-authored comment carrying this line is the ready-for-merge
45
- * summary itself: the one honest "the summary was actually published" signal,
41
+ * The published marker line — `<!-- aeg:loop:published head=<sha>
42
+ * confidence=<round>:<cell>,… -->`, as `render-summary.ts` emits it. A
43
+ * principal-authored comment carrying this line is the ready-for-merge
44
+ * publication itself: the one honest "the loop actually published" signal,
46
45
  * distinct from a round merely deciding `publish` (the control store's own
47
46
  * `loop_state.phase === 'publish'` is written before `publishRound` runs, so
48
- * it can never stand in for this).
47
+ * it can never stand in for this). Group 1 is the published head, group 2 the
48
+ * confidence entries.
49
49
  */
50
- export const SUMMARY_TABLE_HEADER = `| round | ${SEVERITY_COLUMNS.join(' | ')} | confidence | outcome |`
50
+ export const PUBLISHED_MARKER_LINE = /^<!-- aeg:loop:published head=([0-9a-f]{7,64}) confidence=([^\s]*) -->$/
51
51
 
52
- /** True when `body` is (or contains, verbatim on its own line) the published summary's header — the caller has already confirmed the comment is principal-authored. */
52
+ /** True when `body` carries the published marker verbatim on its own line — the caller has already confirmed the comment is principal-authored. */
53
53
  export function isPublishedSummaryComment(body: string): boolean {
54
- return body.split('\n').some((line) => line.trim() === SUMMARY_TABLE_HEADER)
54
+ return body.split('\n').some((line) => PUBLISHED_MARKER_LINE.test(line.trim()))
55
55
  }
56
56
 
57
57
  /**
@@ -112,15 +112,15 @@ export type ReconstructedJournal = {
112
112
  reviewGate: ReviewGateFact
113
113
  /**
114
114
  * `{ result: 'merged_ready' }` while a principal-authored ready-for-merge
115
- * summary comment is actually on the forge AND the review gate has not
115
+ * publication comment is actually on the forge AND the review gate has not
116
116
  * FAILED against the pull request's CURRENT state (`ReviewGateFact`, whose
117
117
  * own doc explains why an `'unknown'` gate is not a reopen). Concluded is a
118
118
  * property of the pull request now, not a one-way latch it once passed
119
119
  * through.
120
120
  *
121
121
  * The summary alone was the old signal, and it is sticky in a way the forge
122
- * is not: the summary table records no head, so a summary posted for an
123
- * older head keeps reading "done forever" after a red gate, a newer
122
+ * is not: the published marker comment is never edited, so a publication posted
123
+ * for an older head keeps reading "done forever" after a red gate, a newer
124
124
  * Principal ruling, a superseded brief or a moved head — observed on an
125
125
  * adopter pull request whose every `--resume` was refused while the gate was
126
126
  * red and a ruling sat unaddressed. The gate is the one evaluation already
@@ -1,146 +1,82 @@
1
1
  /**
2
- * `renderSummary(journal)` — the publication comment. One markdown table, rows per round, counts and the
3
- * outcome only — no finding prose, and no line either verdict extractor
4
- * (`../verdict-extraction`) would read as a real verdict: no `VERDICT:`,
5
- * `Judged head:`, or `Objectives version:` label anywhere in the output.
2
+ * `renderPublishedMarker(journal, head)` — the publication comment. A single
3
+ * HTML comment line, invisible on the pull request, carrying what the loop's
4
+ * own readers need: that the loop published, the head it published, and each
5
+ * round's confidence. The round table is not posted — the Vinaya Log is the
6
+ * record of each round's findings and outcome. The line carries no `VERDICT:`,
7
+ * `Judged head:`, or `Objectives version:` label, so neither verdict extractor
8
+ * (`../verdict-extraction`) can read it as a real verdict.
6
9
  */
7
10
 
8
- import { SUMMARY_TABLE_HEADER } from './journal-reconstruction'
9
- import { SEVERITY_COLUMNS, type Confidence, type Journal, type NotReviewedReason, type RoundRecord } from './types'
11
+ import { PUBLISHED_MARKER_LINE } from './journal-reconstruction'
12
+ import type { Confidence, Journal } from './types'
10
13
 
11
- /**
12
- * The two non-numeric cells this table writes, named once so the parser below
13
- * reads the same literals the renderer wrote. They are DIFFERENT facts: the
14
- * loop never asked this round for a confidence at all (round 1 never is), or
15
- * it asked and the developer stated nothing readable.
16
- *
17
- * `CONFIDENCE_NOT_ASKED_CELL`'s glyph is also the count columns' own
18
- * "nothing to report" cell (`countCells` below) — one glyph for one meaning
19
- * across the table, rather than a second literal saying the same thing. Only
20
- * the confidence column is read back out of a posted table, so the shared
21
- * glyph never makes a count cell parseable as a confidence.
22
- */
23
- export const CONFIDENCE_NOT_ASKED_CELL = '—'
14
+ /** The cell a round the loop never asked for a confidence at all (round 1 never is) writes. */
15
+ export const CONFIDENCE_NOT_ASKED_CELL = '-'
16
+ /** The cell a round that was asked, with no readable statement, writes. */
24
17
  export const CONFIDENCE_ABSENT_CELL = 'absent'
25
18
 
26
- /** The highest percentage this table ever records — the same ceiling `CONFIDENCE_LINE`'s own `0-100` grammar accepts, named here because the parser below refuses a row that exceeds it. */
19
+ /** The highest percentage the marker ever records — the same ceiling `CONFIDENCE_LINE`'s own `0-100` grammar accepts, named here because the parser below refuses a figure that exceeds it. */
27
20
  export const CONFIDENCE_MAX_PERCENT = 100
28
21
 
29
22
  function confidenceCell(confidence: Confidence | null): string {
30
23
  if (confidence === null) return CONFIDENCE_NOT_ASKED_CELL
31
24
  if (confidence === 'absent') return CONFIDENCE_ABSENT_CELL
32
- return `${confidence.value}%`
33
- }
34
-
35
- /**
36
- * One round's count cells — numbers when the loop recorded this round's
37
- * findings, the not-reported glyph when it never recorded them at all.
38
- *
39
- * A round the loop ASSESSED records every severity column, zeros included
40
- * (`buildRoundRecord`, `assess-round.ts`), so a record carrying none of them
41
- * is one whose counts have no source. Two kinds carry none: a round rebuilt
42
- * from the pull request's own round markers after a restart, which name a
43
- * round's number and head and carry no finding breakdown at all
44
- * (`journal-reconstruction.ts`); and a round no reviewer ever saw — its gate
45
- * was red, or a low confidence sent the developer back — which records no
46
- * counts on purpose (`buildUnreviewedRecord`, `assess-round.ts`) and names why
47
- * in its outcome cell (`outcomeCell` below). Writing `0` for those cells told a
48
- * reader the round was clean — four rounds of a real task's published table
49
- * read as zero findings when the truth was that nobody knew, and an unreviewed
50
- * round read as a clean review that never ran. The distinction is whether the
51
- * counts were recorded, never whether they are zero: a round the loop assessed
52
- * and found nothing in still reads `0`, because that zero is a measurement.
53
- */
54
- function countCells(record: RoundRecord): string[] {
55
- const recorded = SEVERITY_COLUMNS.some((key) => record.countsBySeverity[key] !== undefined)
56
- if (!recorded) return SEVERITY_COLUMNS.map(() => CONFIDENCE_NOT_ASKED_CELL)
57
- return SEVERITY_COLUMNS.map((key) => String(record.countsBySeverity[key] ?? 0))
25
+ return String(confidence.value)
58
26
  }
59
27
 
60
28
  /**
61
- * The outcome cell. A round the loop assessed (or one rebuilt from a marker)
62
- * prints its own `outcome` verbatim — the vocabulary `render-summary.test.ts`
63
- * pins (`green`, `changes_requested`, `escalated`, `stopped`). A round no
64
- * reviewer saw (`notReviewed` set, `buildUnreviewedRecord` in
65
- * `assess-round.ts`) instead states that no review ran and why, so a reader
66
- * never takes its `—` counts for a clean round the way the old `0` /
67
- * `changes_requested` row read.
29
+ * The published marker: `<!-- aeg:loop:published head=<sha> confidence=1:-,2:80,3:absent -->`.
30
+ * Each round contributes `<round>:<cell>` — a percentage, `absent` (asked, no
31
+ * readable statement) or `-` (never asked).
68
32
  */
69
- const NOT_REVIEWED_REASON_TEXT: Record<NotReviewedReason, string> = {
70
- checks_red: 'checks red',
71
- low_confidence: 'low confidence'
72
- }
73
-
74
- function outcomeCell(record: RoundRecord): string {
75
- if (record.notReviewed !== undefined) return `not reviewed — ${NOT_REVIEWED_REASON_TEXT[record.notReviewed]}`
76
- return record.outcome
77
- }
78
-
79
- function row(record: RoundRecord): string {
80
- return `| ${record.round} | ${countCells(record).join(' | ')} | ${confidenceCell(record.confidence)} | ${outcomeCell(record)} |`
81
- }
82
-
83
- export function renderSummary(journal: Journal): string {
84
- const header = SUMMARY_TABLE_HEADER
85
- const divider = `| --- | ${SEVERITY_COLUMNS.map(() => '---').join(' | ')} | --- | --- |`
86
- const rows = journal.rounds.map(row)
87
- return [header, divider, ...rows].join('\n')
33
+ export function renderPublishedMarker(journal: Journal, head: string): string {
34
+ const confidence = journal.rounds.map((record) => `${record.round}:${confidenceCell(record.confidence)}`).join(',')
35
+ return `<!-- aeg:loop:published head=${head} confidence=${confidence} -->`
88
36
  }
89
37
 
90
38
  /**
91
- * One round's confidence as this table records it, in three distinguishable
39
+ * One round's confidence as the marker records it, in three distinguishable
92
40
  * states rather than two:
93
41
  *
94
42
  * - `asked: true` with a `percent` — the developer stated that figure;
95
43
  * - `asked: true`, `percent: null` — the round WAS asked and the statement
96
- * was missing or unreadable (the table's own `absent` cell);
44
+ * was missing or unreadable (the `absent` cell);
97
45
  * - `asked: false`, `percent: null` — the loop never asked this round at all
98
- * (its `—` cell; round 1 is never asked), so the round has no confidence
99
- * to report and a reader must not be told the developer skipped one.
46
+ * (the `-` cell; round 1 is never asked), so a reader must not be told the
47
+ * developer skipped a statement.
100
48
  */
101
49
  export type SummaryConfidenceRow = { round: number; percent: number | null; asked: boolean }
102
50
 
103
51
  /**
104
- * The inverse of `row` above — the confidence column read back out of a
105
- * posted summary table. Kept here, beside the renderer, so the column's
106
- * position is written down once: a reader elsewhere would have to hand-copy
107
- * the table's shape and would drift the first time a column moved.
52
+ * The inverse of `renderPublishedMarker` — the confidence entries read back out
53
+ * of a posted marker. Kept beside the renderer so the entry shape is written
54
+ * down once.
108
55
  *
109
- * Only rows this renderer could have produced are read: a leading round
110
- * number, then one cell per severity column, then the confidence cell, then
111
- * the outcome. Anything else in the comment — prose above or below the table,
112
- * a differently-shaped table — yields no row at all rather than a guess.
113
- *
114
- * This function is the boundary between pull-request comment text (which
115
- * anybody with write access to a fork's branch can shape) and the confidence
116
- * figure a tool result publishes, so the percentage is bounded HERE: a cell
117
- * claiming more than `CONFIDENCE_MAX_PERCENT` is dropped rather than carried
118
- * out of range into a caller that declares `0-100`.
56
+ * This is the boundary between pull-request comment text (which anybody with
57
+ * write access to a fork's branch can shape) and the confidence figure a tool
58
+ * result publishes, so the percentage is bounded HERE: an entry claiming more
59
+ * than `CONFIDENCE_MAX_PERCENT` is dropped rather than carried out of range. A
60
+ * comment with no marker line, and any entry not shaped `<round>:<cell>`,
61
+ * yields no row at all rather than a guess.
119
62
  */
120
63
  export function parseSummaryConfidenceRows(body: string): SummaryConfidenceRow[] {
121
- const cellCount = SEVERITY_COLUMNS.length + 3
122
64
  const rows: SummaryConfidenceRow[] = []
123
65
  for (const line of body.split('\n')) {
124
- const trimmed = line.trim()
125
- if (!trimmed.startsWith('|') || !trimmed.endsWith('|')) continue
126
- const cells = trimmed.slice(1, -1).split('|')
127
- if (cells.length !== cellCount) continue
128
- const round = Number((cells[0] as string).trim())
129
- if (!Number.isInteger(round) || round <= 0) continue
130
- const confidenceCellText = (cells[cellCount - 2] as string).trim()
131
- if (confidenceCellText === CONFIDENCE_NOT_ASKED_CELL) {
132
- rows.push({ round, percent: null, asked: false })
133
- continue
134
- }
135
- if (confidenceCellText === CONFIDENCE_ABSENT_CELL) {
136
- rows.push({ round, percent: null, asked: true })
137
- continue
66
+ const match = PUBLISHED_MARKER_LINE.exec(line.trim())
67
+ if (!match) continue
68
+ for (const entry of (match[2] as string).split(',')) {
69
+ const [roundText, cell] = entry.split(':')
70
+ const round = Number(roundText)
71
+ if (!Number.isInteger(round) || round <= 0 || cell === undefined) continue
72
+ if (cell === CONFIDENCE_NOT_ASKED_CELL) {
73
+ rows.push({ round, percent: null, asked: false })
74
+ } else if (cell === CONFIDENCE_ABSENT_CELL) {
75
+ rows.push({ round, percent: null, asked: true })
76
+ } else if (/^\d{1,3}$/.test(cell) && Number(cell) <= CONFIDENCE_MAX_PERCENT) {
77
+ rows.push({ round, percent: Number(cell), asked: true })
78
+ }
138
79
  }
139
- const percentMatch = /^(\d{1,3})%$/.exec(confidenceCellText)
140
- if (!percentMatch) continue
141
- const percent = Number(percentMatch[1])
142
- if (percent > CONFIDENCE_MAX_PERCENT) continue
143
- rows.push({ round, percent, asked: true })
144
80
  }
145
81
  return rows
146
82
  }
@@ -6,6 +6,7 @@
6
6
  */
7
7
 
8
8
  import type { DevReviewLoopEvent } from '../log'
9
+ import type { DeferralReason } from '../review-policy'
9
10
 
10
11
  type Envelope = { meta: unknown; subject: unknown }
11
12
  /**
@@ -18,7 +19,7 @@ type Envelope = { meta: unknown; subject: unknown }
18
19
  type StripEnvelope<T> = T extends Envelope ? Omit<T, 'meta' | 'subject'> : never
19
20
  export type DevReviewLoopEventInput = StripEnvelope<DevReviewLoopEvent>
20
21
 
21
- /** O4's fixed column order — shared by `assess-round.ts` (counting) and `render-summary.ts` (rendering) so the two never drift apart. */
22
+ /** O4's fixed column order — shared by `assess-round.ts` (counting) so every round records the same columns. */
22
23
  export const SEVERITY_COLUMNS = ['blocker', 'major', 'minor', 'critical', 'high', 'medium', 'low'] as const
23
24
 
24
25
  /** The built form's finding identity (spec §0 item 1) — no fingerprint hashing. */
@@ -40,9 +41,23 @@ export type FindingState = 'open' | 'fix-claimed' | 'reproduced' | 'resolved' |
40
41
  export type FindingObservation = {
41
42
  id: string
42
43
  severity: string
44
+ /**
45
+ * The finding's own `file:line` (O4) — carried so the round record can name
46
+ * every deferred finding's location. Optional: an older extraction shape, or
47
+ * a finding with none, simply has none to report.
48
+ */
49
+ location?: string
43
50
  state: FindingState
44
51
  severityScale?: string
45
52
  policyTreatment?: 'blocking' | 'non_blocking' | 'unavailable'
53
+ /**
54
+ * Set only when the round set this finding aside rather than let it block
55
+ * (O2/O3): `'unchanged-line'` (round 2 on, a line that did not change) or
56
+ * `'outside-surface'` (any round, a file the Surface `in:` does not cover).
57
+ * Absent means the finding was NOT deferred — it blocked, or was below
58
+ * threshold. `policyTreatment` reads `non_blocking` whenever this is set.
59
+ */
60
+ deferred?: DeferralReason
46
61
  confidence?: number
47
62
  confidenceScale?: string
48
63
  confidenceSource?: string
@@ -77,11 +92,42 @@ export type RoundStats = {
77
92
  * round, before the loop pauses (spec §6.7's bounded re-ask).
78
93
  */
79
94
  export type Observations =
80
- | ({ kind: 'gate' } & { round: number; green: boolean; confidence?: Confidence; stats: RoundStats })
95
+ | ({ kind: 'gate' } & {
96
+ round: number
97
+ green: boolean
98
+ confidence?: Confidence
99
+ stats: RoundStats
100
+ /**
101
+ * The mechanical failure that made this gate red, verbatim — the
102
+ * failing check-run names and premise re-assert messages the driver
103
+ * already holds, exactly as it would print them. Read only when
104
+ * `green` is false, and only to match this attempt's failure against
105
+ * the previous one's (`normalizeFailureSignature`, `assess-round.ts`);
106
+ * a red gate whose cause the driver could not name omits it, which
107
+ * breaks the repeat chain rather than matching an unknown to an
108
+ * unknown.
109
+ */
110
+ failure?: string
111
+ })
81
112
  | ({ kind: 'verdicts' } & {
82
113
  round: number
83
114
  verdicts: VerdictObservation[]
84
115
  })
116
+ /**
117
+ * A mechanical failure that ended an attempt WITHOUT producing a head for
118
+ * the gate to read — a push the developer could not land (refused by a
119
+ * pre-push hook, or by the remote), or a turn that pushed nothing at all.
120
+ * There is no gate result to report for such an attempt, so it cannot
121
+ * arrive as a `gate` observation; it carries only the failure the driver
122
+ * observed, which the same `'repeat_failure'` rule matches against the
123
+ * previous attempt's. Unlike a `gate` observation, a non-repeat here
124
+ * records nothing but the signature: no round record, no events, no round
125
+ * accounting — the attempt produced no head, so there is nothing about it
126
+ * to publish, and the driver's own bounds (one resume then `'no_push'`,
127
+ * the stalled-head bound then `'infrastructure'`) still govern a first
128
+ * occurrence.
129
+ */
130
+ | ({ kind: 'mechanical_failure' } & { round: number; failure: string; stats: RoundStats })
85
131
 
86
132
  /**
87
133
  * `'infrastructure'`: a review
@@ -136,6 +182,23 @@ export type Observations =
136
182
  * what the merge gate (which DOES re-resolve policy fresh on every run)
137
183
  * already checks.
138
184
  *
185
+ * `'repeat_finding'`: the same blocking finding — same reviewer role, same
186
+ * finding id — was still open in two consecutive reviewed rounds. Unlike
187
+ * `'reappearance'` (an id the reviewer itself marked `resolved` and then
188
+ * reported again), nothing here was ever claimed fixed: the finding simply
189
+ * never left, and a third developer turn on it is a turn the loop has no
190
+ * reason to expect anything new from. Decided by `assessRound`, which
191
+ * carries the repeated key(s) in the pause's own `detail`.
192
+ *
193
+ * `'repeat_failure'`: two consecutive attempts ended on the same mechanical
194
+ * failure — a refused push, a premise re-check mismatch, a forge or network
195
+ * error, a failed pre-push test — matched by the normalised signature
196
+ * `normalizeFailureSignature` derives (`assess-round.ts`), never by raw
197
+ * string equality: the volatile parts of such a message (timestamps,
198
+ * temporary paths, process ids, durations) differ between two runs of the
199
+ * SAME failure. The driver reports the failure text it already has on the
200
+ * gate observation; the pause's `detail` is that exact message, unnormalised.
201
+ *
139
202
  * `'no_push'`: a developer turn
140
203
  * ended with a dirty worktree or local commits ahead of the remote, and no
141
204
  * new head appeared on the branch even after one foreground resume asking
@@ -146,6 +209,17 @@ export type Observations =
146
209
  * vocabulary and rendering path every other pause reason already uses.
147
210
  * `detail` is set for this reason too, naming the branch and the dirty
148
211
  * file(s) observed.
212
+ *
213
+ * `'time_budget'`: the task's ACTIVE working time — the sum of the phases a
214
+ * driver spent developing, reviewing and awaiting confidence, never the hours
215
+ * it sat paused, published or driverless — passed `ReviewPolicy.maxTaskMinutes`.
216
+ * Unlike every other bound here it counts neither rounds nor attempts, so it is
217
+ * the one stop a loop cannot outrun by never advancing: time spent pushing,
218
+ * rebasing, waiting on checks and retrying all counts toward it (it is recorded
219
+ * as developing), while time waiting on a Principal does not. Decided by
220
+ * `assessRound` from the clock its caller reads (this module has none of its
221
+ * own); `detail` names the budget, the active time spent, and the active phases
222
+ * that time was summed from.
149
223
  */
150
224
  export type PauseReason =
151
225
  | 'escalation'
@@ -153,6 +227,9 @@ export type PauseReason =
153
227
  | 'no_progress'
154
228
  | 'confidence'
155
229
  | 'reappearance'
230
+ | 'repeat_finding'
231
+ | 'repeat_failure'
232
+ | 'time_budget'
156
233
  | 'infrastructure'
157
234
  | 'no_push'
158
235
  | 'objectives_changed'
@@ -169,12 +246,22 @@ export type Decision =
169
246
  | {
170
247
  type: 'pause'
171
248
  reason: PauseReason
172
- /** Set only for `'infrastructure'` — the role and missing artifact(s) the driver observed; every other reason omits it. */
249
+ /**
250
+ * The pause's own narration, when the deciding component has one:
251
+ * `'infrastructure'` (the role and missing artifact(s) the driver
252
+ * observed), `'max_rounds'` (the configured cap), `'repeat_finding'`
253
+ * (the reviewer-qualified finding key(s) open two rounds running),
254
+ * `'repeat_failure'` (the exact failure message, unnormalised), and
255
+ * `'time_budget'` (the budget, the active time spent, and the active
256
+ * phases it was summed from). Every
257
+ * other reason omits it here — the driver narrates several of them
258
+ * itself from facts it already holds (`deriveVerdictPauseDetail`).
259
+ */
173
260
  detail?: string
174
261
  }
175
262
 
176
263
  /**
177
- * The summary's own outcome vocabulary — wider than `round_ended`'s
264
+ * The journal's own outcome vocabulary — wider than `round_ended`'s
178
265
  * schema-constrained `green | changes_requested | escalated`: a round whose
179
266
  * processing triggered one of the assessment exits (max_rounds, confidence,
180
267
  * reappearance) records `'stopped'` here, even though the log
@@ -185,9 +272,9 @@ export type Decision =
185
272
  export type RoundOutcome = 'green' | 'changes_requested' | 'escalated' | 'stopped'
186
273
 
187
274
  /**
188
- * Why a round ended before any reviewer ran, for the published table's outcome
275
+ * Why a round ended before any reviewer ran, for the journal's outcome
189
276
  * cell. A round no reviewer saw has no findings from any source, so it records
190
- * no counts at all (an empty `countsBySeverity`, `render-summary.ts`' own `—`)
277
+ * no counts at all (an empty `countsBySeverity`)
191
278
  * rather than a zero that reads as a clean review — and this names the reason
192
279
  * the outcome cell states instead of the log-parity `outcome` a reviewed round
193
280
  * carries:
@@ -195,24 +282,45 @@ export type RoundOutcome = 'green' | 'changes_requested' | 'escalated' | 'stoppe
195
282
  * - `'checks_red'` — the round's gate observation was not green, so reviewers
196
283
  * were never dispatched;
197
284
  * - `'low_confidence'` — a below-threshold confidence sent the developer back
198
- * without dispatching reviewers.
285
+ * without dispatching reviewers;
286
+ * - `'mechanical_failure'` — the same mechanical failure ended two
287
+ * consecutive attempts that never produced a head (`'repeat_failure'`),
288
+ * so no gate ever judged one and no reviewer ever saw it;
289
+ * - `'time_budget'` — the task's wall-clock budget ran out before this
290
+ * round reached review, so reviewers were never dispatched for it.
199
291
  *
200
292
  * `outcome` stays whatever the round would otherwise carry (both reasons are
201
293
  * `changes_requested` today), so the `round_ended` log event a reader parses is
202
- * unaffected — only the summary table's rendering changes.
294
+ * unaffected — only the `RoundRecord` the journal carries changes.
203
295
  */
204
- export type NotReviewedReason = 'checks_red' | 'low_confidence'
296
+ export type NotReviewedReason = 'checks_red' | 'low_confidence' | 'mechanical_failure' | 'time_budget'
297
+
298
+ /** One deferred finding, as the journal records it (O4) — its original severity, its `file:line`, and why this round set it aside, never its reported severity mutated. */
299
+ export type DeferredFindingRow = {
300
+ severity: string
301
+ /** The finding's own `file:line`, or `''` when it carried none. */
302
+ location: string
303
+ reason: DeferralReason
304
+ }
205
305
 
206
- /** One row of the published summary (`renderSummary`, O4) — counts only, no finding prose. */
306
+ /** One round of the journal (O4) — counts only, no finding prose. */
207
307
  export type RoundRecord = {
208
308
  round: number
209
309
  countsBySeverity: Record<string, number>
210
310
  confidence: Confidence | null
211
311
  outcome: RoundOutcome
312
+ /**
313
+ * Every finding this round set aside rather than let it block (O2/O3),
314
+ * carried so a reader can list each with its original severity,
315
+ * location and reason (O4). Absent/`[]` for a round that deferred none, and
316
+ * for a marker-reconstructed round (its findings are unknown — see
317
+ * `journal-reconstruction.ts`).
318
+ */
319
+ deferred?: DeferredFindingRow[]
212
320
  /**
213
321
  * Set only for a round no reviewer saw (`buildUnreviewedRecord`,
214
322
  * `assess-round.ts`): its counts are absent (empty `countsBySeverity`) and the
215
- * table's outcome cell names this reason. Absent for every round the loop
323
+ * the round's outcome names this reason. Absent for every round the loop
216
324
  * assessed and for a round rebuilt from a marker — a marker-reconstructed
217
325
  * round's counts are likewise unknown, but the round DID reach review, so it
218
326
  * keeps its `outcome`, not a not-reviewed reason.
@@ -230,6 +338,39 @@ export type LoopConfig = {
230
338
  models: Record<string, string>
231
339
  /** The round cap — resolved by the driver from `ReviewPolicy.maxRounds` (repository config), never read here: this module has no config read of its own. */
232
340
  maxRounds: number
341
+ /** The task's wall-clock budget in minutes — resolved by the driver from `ReviewPolicy.maxTaskMinutes`, same discipline as `maxRounds` above. `0` turns the budget off. */
342
+ maxTaskMinutes: number
343
+ }
344
+
345
+ /**
346
+ * How long this task has been running, and where that time went — read by the
347
+ * DRIVER and handed to `assessRound`, never measured here: this module has no
348
+ * clock, the same way it has no config read.
349
+ *
350
+ * `elapsedMs` is the task's ACTIVE working time: the sum of the phases a driver
351
+ * spent working the task forward (`activeBudgetMs` over `byPhaseMs` —
352
+ * developing, reviewing, awaiting confidence), and nothing else. Time the task
353
+ * sat `paused` waiting for a Principal, time it spent `publishing` an approved
354
+ * pull request, and any stretch with no driver running at all are excluded — so
355
+ * a task first started days ago is measured by the minutes it worked, not by
356
+ * its age. It is a sum over per-phase times the durable control records carry
357
+ * across a restart, so a driver that was killed, taken over, or re-execed
358
+ * itself continues one budget rather than beginning a fresh one.
359
+ *
360
+ * `byPhaseMs` is the FULL record of what the loop recorded against each phase
361
+ * it worked in, keyed by the phase names the loop persists (`dispatch_developer`,
362
+ * `dispatch_reviewers`, and so on) — inactive phases (`pause`, `publish`)
363
+ * included, so it is a faithful account of where all the time went. The budget
364
+ * is decided on `elapsedMs`, which sums only the active subset; a breakdown
365
+ * that is thin — a run whose earlier phases were recorded by a driver that has
366
+ * since died — still stops on time and simply reports less about where the
367
+ * time went. The `'time_budget'` pause's detail names only the active phases
368
+ * (`renderTaskBudgetDetail`), so the phases it lists sum to the time it reports
369
+ * as spent.
370
+ */
371
+ export type TaskClock = {
372
+ elapsedMs: number
373
+ byPhaseMs: Record<string, number>
233
374
  }
234
375
 
235
376
  /** A round awaiting its `verdicts` observation, or awaiting a confidence re-ask — never both logged twice. */
@@ -250,6 +391,21 @@ export type LoopState = {
250
391
  extraTurnUsed: boolean
251
392
  /** The most recent round's combined id → state map, carried forward for the next round's comparison. */
252
393
  lastIds: Map<string, string | null>
394
+ /**
395
+ * The previous REVIEWED round's blocking-and-open finding keys
396
+ * (`<role>:<id>`, sorted), for the `'repeat_finding'` stop. Rounds no
397
+ * reviewer saw (a red gate, a low-confidence turn) never touch it: two
398
+ * consecutive rounds means two consecutive rounds that produced verdicts,
399
+ * not two iterations of the driver's loop.
400
+ */
401
+ lastBlockingFindings: string[]
402
+ /**
403
+ * The previous attempt's mechanical failure — its normalised `signature`
404
+ * (what two attempts are matched on) and the `message` as reported (what
405
+ * the pause names). `null` whenever the last attempt reached a green gate,
406
+ * or failed with no reported cause: either breaks the repeat chain.
407
+ */
408
+ lastFailure: { signature: string; message: string } | null
253
409
  /** Running sums for `journal_finalized` — updated once per concluded round, never recomputed from `rounds` (which carries counts only, not diff stats). */
254
410
  totalWallMs: number
255
411
  totalFilesChanged: number
@@ -262,6 +418,8 @@ export function initialLoopState(config: LoopConfig): LoopState {
262
418
  pending: null,
263
419
  extraTurnUsed: false,
264
420
  lastIds: new Map(),
421
+ lastBlockingFindings: [],
422
+ lastFailure: null,
265
423
  totalWallMs: 0,
266
424
  totalFilesChanged: 0
267
425
  }