@attalabs/vinaya 0.36.0 → 0.37.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 (243) 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 +9 -10
  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 +13 -16
  10. package/aeg-root/roles/developer.md +7 -3
  11. package/aeg-root/roles/operator.md +18 -18
  12. package/aeg-root/roles/planner/reference.md +4 -4
  13. package/aeg-root/roles/principal.md +6 -1
  14. package/aeg-root/roles/reviewer.md +9 -3
  15. package/aeg-root/roles/security.md +19 -9
  16. package/aeg-root/roles/tranche-archivist.md +14 -2
  17. package/aeg-root/state-machine.md +11 -10
  18. package/aeg-root/templates/brief-template.md +6 -4
  19. package/aeg-root/templates/pr-report-template.md +1 -9
  20. package/aeg-root/tranche-model.md +4 -4
  21. package/dist/checks/bin/check-body-bare-digits.js +685 -584
  22. package/dist/checks/bin/check-branch-topology.js +626 -466
  23. package/dist/checks/bin/check-brief-shape.js +686 -585
  24. package/dist/checks/bin/check-changeset-coverage.js +1161 -731
  25. package/dist/checks/bin/check-closes-n.js +626 -466
  26. package/dist/checks/bin/check-coherence.js +744 -599
  27. package/dist/checks/bin/check-dead-branch-push.js +567 -451
  28. package/dist/checks/bin/check-dispatch-readiness.js +747 -602
  29. package/dist/checks/bin/check-doc-coverage-push.js +1160 -730
  30. package/dist/checks/bin/check-doc-coverage.js +1160 -730
  31. package/dist/checks/bin/check-doctrine-no-procedures.js +683 -582
  32. package/dist/checks/bin/check-doctrine-portability.js +1160 -730
  33. package/dist/checks/bin/check-evidence-fresh.js +1167 -906
  34. package/dist/checks/bin/check-exec-bits.js +1159 -729
  35. package/dist/checks/bin/check-first-push-dispatch.js +747 -602
  36. package/dist/checks/bin/check-issue-assignment.js +626 -466
  37. package/dist/checks/bin/check-issue-milestone-attach.js +567 -451
  38. package/dist/checks/bin/check-issue-objectives-numbering.js +683 -582
  39. package/dist/checks/bin/check-issue-parts-coverage.js +567 -451
  40. package/dist/checks/bin/check-issue-surface-globs.js +755 -601
  41. package/dist/checks/bin/check-issue-title-grammar.js +567 -451
  42. package/dist/checks/bin/check-issue-tranche-label.js +567 -451
  43. package/dist/checks/bin/check-main-branch-refusal.js +567 -451
  44. package/dist/checks/bin/check-no-disk-state.js +567 -451
  45. package/dist/checks/bin/check-pr-premise-reassert.js +683 -582
  46. package/dist/checks/bin/check-pr-report-density.js +567 -451
  47. package/dist/checks/bin/check-principal-test-plan-wait.js +567 -451
  48. package/dist/checks/bin/check-quoted-command.js +1644 -1216
  49. package/dist/checks/bin/check-reader-resolvable-prose.js +1663 -1223
  50. package/dist/checks/bin/check-registry-gates.js +610 -481
  51. package/dist/checks/bin/check-retired-vocabulary.js +1638 -1210
  52. package/dist/checks/bin/check-review-gate.js +694 -593
  53. package/dist/checks/bin/check-single-plan-pr.js +567 -451
  54. package/dist/checks/bin/check-surface-scope.js +626 -466
  55. package/dist/checks/bin/check-test-plan.js +567 -451
  56. package/dist/checks/bin/check-token-collection-wired.js +567 -451
  57. package/dist/checks/bin/check-workspace-escape.js +1160 -730
  58. package/dist/index.js +13507 -7975
  59. package/dist/lib/pre-push-cache-test-run.js +1004 -681
  60. package/dist/lib/pre-push-select-tests.js +609 -480
  61. package/package.json +2 -2
  62. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/brief-render.ts +38 -0
  63. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/control-store/records.ts +19 -0
  64. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/assess-round.ts +233 -8
  65. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/fakes.ts +7 -2
  66. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/index.ts +1 -0
  67. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/render-summary.ts +38 -3
  68. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/types.ts +113 -4
  69. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/doc-claim.ts +32 -6
  70. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/index.ts +26 -1
  71. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/issue-validation.ts +747 -0
  72. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/schema.ts +8 -1
  73. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/review-gate.ts +52 -4
  74. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/review-policy.ts +163 -21
  75. package/studio-standalone/apps/vinaya-studio/web/.next/BUILD_ID +1 -1
  76. package/studio-standalone/apps/vinaya-studio/web/.next/app-path-routes-manifest.json +0 -1
  77. package/studio-standalone/apps/vinaya-studio/web/.next/build-manifest.json +3 -3
  78. package/studio-standalone/apps/vinaya-studio/web/.next/prerender-manifest.json +3 -3
  79. package/studio-standalone/apps/vinaya-studio/web/.next/required-server-files.json +0 -5
  80. package/studio-standalone/apps/vinaya-studio/web/.next/routes-manifest.json +0 -6
  81. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error/page.js +1 -1
  82. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error/page.js.nft.json +1 -1
  83. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.html +1 -1
  84. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.rsc +1 -1
  85. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  86. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  87. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  88. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  89. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  90. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_not-found/page/server-reference-manifest.json +2 -2
  91. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_not-found/page.js +1 -1
  92. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_not-found/page.js.nft.json +1 -1
  93. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  94. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/page/server-reference-manifest.json +2 -2
  95. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/page.js +1 -1
  96. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/page.js.nft.json +1 -1
  97. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/page_client-reference-manifest.js +1 -1
  98. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/backlog/page/server-reference-manifest.json +2 -2
  99. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/backlog/page.js +3 -3
  100. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/backlog/page.js.nft.json +1 -1
  101. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/backlog/page_client-reference-manifest.js +1 -1
  102. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/page/server-reference-manifest.json +2 -2
  103. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/page.js +3 -3
  104. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/page.js.nft.json +1 -1
  105. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/page_client-reference-manifest.js +1 -1
  106. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/page/server-reference-manifest.json +2 -2
  107. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/page.js +3 -3
  108. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/page.js.nft.json +1 -1
  109. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/page_client-reference-manifest.js +1 -1
  110. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/page/server-reference-manifest.json +3 -3
  111. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/page.js +5 -5
  112. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/page.js.nft.json +1 -1
  113. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/page_client-reference-manifest.js +1 -1
  114. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/tasks/[taskId]/page/server-reference-manifest.json +2 -2
  115. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/tasks/[taskId]/page.js +3 -3
  116. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/tasks/[taskId]/page.js.nft.json +1 -1
  117. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/tasks/[taskId]/page_client-reference-manifest.js +1 -1
  118. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/page/server-reference-manifest.json +2 -2
  119. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/page.js +3 -3
  120. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/page.js.nft.json +1 -1
  121. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/page_client-reference-manifest.js +1 -1
  122. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/tranches/page/server-reference-manifest.json +2 -2
  123. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/tranches/page.js +3 -3
  124. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/tranches/page.js.nft.json +1 -1
  125. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/tranches/page_client-reference-manifest.js +1 -1
  126. package/studio-standalone/apps/vinaya-studio/web/.next/server/app-paths-manifest.json +0 -1
  127. 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
  128. 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
  129. 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
  130. 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
  131. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/{_15gdg48._.js → [root-of-the-server]__04adkz-._.js} +3 -3
  132. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__05zwn98._.js +14 -0
  133. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__08e39jo._.js +3 -0
  134. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__0ls23oh._.js +1 -1
  135. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__10riywf._.js +3 -0
  136. 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
  137. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/{[root-of-the-server]__1wy7w66._.js → [root-of-the-server]__14ui9sz._.js} +2 -2
  138. 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
  139. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__1f4bb3_._.js +3 -0
  140. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__1gjqmhq._.js +1 -1
  141. 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
  142. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__1ng2x88._.js +3 -0
  143. 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
  144. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__1snpgaw._.js +56 -0
  145. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__1wc4-ip._.js +2 -2
  146. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_06h3wbl._.js +3 -0
  147. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_08onyya._.js +1 -1
  148. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_096f46i._.js +1 -1
  149. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0af2one._.js +1 -1
  150. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0e5tkdd._.js +1 -1
  151. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0gs4gvl._.js +3 -0
  152. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0kf2g72._.js +1 -1
  153. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0zf4d27._.js +1 -1
  154. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_1-wo68i._.js +1 -1
  155. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_121lrn5._.js +3 -0
  156. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_1achbh9._.js +1 -1
  157. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_1o4v6lb._.js +3 -0
  158. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_1q7h5mz._.js +1 -1
  159. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_1ztd4i3._.js +3 -0
  160. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_209-ugd._.js +3 -0
  161. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_214d71c._.js +3 -0
  162. 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
  163. 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
  164. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/node_modules_next_dist_1lzmr5o._.js +1 -1
  165. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/packages_ui_libraries_animate_components_index_ts_186fje1._.js +1 -1
  166. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/packages_ui_libraries_basic_components_index_ts_0xk1vda._.js +1 -1
  167. package/studio-standalone/apps/vinaya-studio/web/.next/server/middleware-build-manifest.js +3 -3
  168. package/studio-standalone/apps/vinaya-studio/web/.next/server/pages/500.html +1 -1
  169. package/studio-standalone/apps/vinaya-studio/web/.next/server/server-reference-manifest.js +1 -1
  170. package/studio-standalone/apps/vinaya-studio/web/.next/server/server-reference-manifest.json +4 -4
  171. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/09fcolor69bun.js +1 -0
  172. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/0lcwmwzxacdie.js +1 -0
  173. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/0ojry7lrbzkfd.css +1 -0
  174. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/{00z3-ljjd1gj9.js → 0vtfb0g813gki.js} +1 -1
  175. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/1giu47hrbhroj.js +1 -0
  176. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/1shz6lwruld25.js +1 -0
  177. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/1ytvuy1mmnc6j.js +1 -0
  178. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/{3oxhhhm_psozq.js → 21a6_5cr956wj.js} +1 -1
  179. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/2g8mwnydod96u.js +1 -0
  180. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/{3li0ueedy-ozv.js → 2nrnuawd5fwpv.js} +1 -1
  181. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/2nw47832_uvfe.js +1 -0
  182. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/2qdxnj8wk2h0s.js +1 -0
  183. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/3b9q75p-z5ma5.js +1 -0
  184. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/3cv-oe7153242.js +1 -0
  185. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/{3lqjwjrcvq481.js → 3l56x8wjdzvaw.js} +5 -5
  186. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/3m310lbjj4p5u.js +1 -0
  187. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/{2o9l0b7eqbr57.js → 3qtt1v3ya-ofe.js} +1 -1
  188. package/studio-standalone/apps/vinaya-studio/web/package.json +2 -2
  189. package/studio-standalone/apps/vinaya-studio/web/server.js +1 -1
  190. 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
  191. package/studio-standalone/_node_modules/next/dist/compiled/next-server/app-route-turbo.runtime.prod.js +0 -6
  192. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/api/coherence/route/app-paths-manifest.json +0 -3
  193. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/api/coherence/route/build-manifest.json +0 -9
  194. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/api/coherence/route/server-reference-manifest.json +0 -4
  195. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/api/coherence/route.js +0 -6
  196. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/api/coherence/route.js.map +0 -5
  197. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/api/coherence/route.js.nft.json +0 -1
  198. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/api/coherence/route_client-reference-manifest.js +0 -3
  199. 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
  200. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/[externals]__0cki-x_._.js +0 -3
  201. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/[root-of-the-server]__02a-3g8._.js +0 -15
  202. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/[turbopack]_runtime.js +0 -903
  203. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__074w9nf._.js +0 -3
  204. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__0ln09ua._.js +0 -3
  205. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__0oegopp._.js +0 -3
  206. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__13yxbjd._.js +0 -51
  207. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__1duqmtm._.js +0 -3
  208. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__1z7dml9._.js +0 -9
  209. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0bfs_u4._.js +0 -3
  210. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0g8_eot._.js +0 -3
  211. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0hrh_v-._.js +0 -181
  212. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0i4-dea._.js +0 -3
  213. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0o54suy._.js +0 -3
  214. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0rxd7s0._.js +0 -3
  215. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0y1jv16._.js +0 -3
  216. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_151m4rz._.js +0 -3
  217. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_1a9dieq._.js +0 -3
  218. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_1sxsf5q._.js +0 -3
  219. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_1sy_yfr._.js +0 -3
  220. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_219v2an._.js +0 -3
  221. 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
  222. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/packages_ui_libraries_basic_components_form_input_tsx_0es8d8b._.js +0 -3
  223. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/packages_ui_libraries_brutal_components_index_ts_0n_lcc4._.js +0 -3
  224. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/packages_ui_libraries_retro_components_index_ts_0wvpm_z._.js +0 -3
  225. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/0bjnj-5fy4e7l.js +0 -1
  226. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/0c8uwz_-m8s99.js +0 -165
  227. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/0ct0c-xj0baf6.js +0 -1
  228. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/0ko698wh8xx2g.css +0 -1
  229. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/0t5n_r4xm__t-.js +0 -1
  230. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/0vc2u252q5q6o.js +0 -1
  231. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/16r_o07lw0vm0.js +0 -1
  232. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/1cah7_e5a1zvu.js +0 -1
  233. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/1gjo9-6dz7nup.js +0 -1
  234. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/24tz8aro1uto4.js +0 -1
  235. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/2ef2g5fozszw7.js +0 -1
  236. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/2ka8dg687auhj.js +0 -1
  237. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/2pf3f50gbrkyv.js +0 -1
  238. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/2qq49pct3q51-.js +0 -1
  239. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/3et66z7glk65w.js +0 -1
  240. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/3y6u3prmrkea-.js +0 -1
  241. /package/studio-standalone/apps/vinaya-studio/web/.next/static/{z1fTSBP6ZlUjObzFIp-qq → yR5RsCxb1OGnYggiaO09S}/_buildManifest.js +0 -0
  242. /package/studio-standalone/apps/vinaya-studio/web/.next/static/{z1fTSBP6ZlUjObzFIp-qq → yR5RsCxb1OGnYggiaO09S}/_clientMiddlewareManifest.js +0 -0
  243. /package/studio-standalone/apps/vinaya-studio/web/.next/static/{z1fTSBP6ZlUjObzFIp-qq → yR5RsCxb1OGnYggiaO09S}/_ssgManifest.js +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@attalabs/vinaya",
3
- "version": "0.36.0",
3
+ "version": "0.37.0",
4
4
  "description": "Vinaya — Agentic Engineering Harness. Deterministic checks every AI coding agent must satisfy before merge.",
5
5
  "type": "module",
6
6
  "license": "FSL-1.1-ALv2",
@@ -37,7 +37,7 @@
37
37
  "code-review"
38
38
  ],
39
39
  "engines": {
40
- "node": ">=20"
40
+ "node": ">=22.13"
41
41
  },
42
42
  "scripts": {
43
43
  "build": "bun scripts/build.ts",
@@ -26,6 +26,7 @@ import {
26
26
  globCoversPath,
27
27
  type IssueDocumentation,
28
28
  type IssuePart,
29
+ type IssuePremise,
29
30
  type IssueSurface,
30
31
  type IssueTestPlan
31
32
  } from './issue-validation'
@@ -53,6 +54,32 @@ function renderDocumentation(documentation: IssueDocumentation): string {
53
54
  ].join('\n')
54
55
  }
55
56
 
57
+ /**
58
+ * Renders the Issue's `## Premises` section — one line per premise, under its
59
+ * own heading, so the Developer reads them as **checked facts** rather than as
60
+ * more of the Boundary's prose. Every line here was asserted against the
61
+ * checkout when the Issue was cut (or deferred to a declared dependency) and
62
+ * asserted again against the default branch immediately before this render, so
63
+ * the lead sentence is a statement about what the pipeline did, not an
64
+ * invitation to re-verify by hand.
65
+ *
66
+ * Called only when `facts.premises` is non-empty (see the join in
67
+ * `renderBrief`): the section is optional on the Issue, and a brief with an
68
+ * empty heading would read as "checked, nothing to check".
69
+ */
70
+ function renderPremises(premises: readonly IssuePremise[]): string {
71
+ return [
72
+ '## Premises',
73
+ '',
74
+ 'Checked against the code when this task Issue was cut, and again against the default branch at dispatch — facts, not claims.',
75
+ '',
76
+ ...premises.map((p) => {
77
+ const prefix = p.afterIssue === null ? '' : `after #${p.afterIssue}: `
78
+ return `- ${prefix}\`${p.path}\` contains \`${p.text}\``
79
+ })
80
+ ].join('\n')
81
+ }
82
+
56
83
  export type RationaleFieldKey =
57
84
  | 'boundary'
58
85
  | 'dependencyRationale'
@@ -250,6 +277,16 @@ export type BriefFacts = {
250
277
  * legitimate explicit opt-out and is rendered, never treated as absent.
251
278
  */
252
279
  documentation: IssueDocumentation
280
+ /**
281
+ * The Issue's `## Premises` list (`issue-validation.ts`'s
282
+ * `parseIssuePremises`) — the facts about the code this plan rests on, each
283
+ * already re-asserted against the default branch by the caller before this
284
+ * render. `[]` is the absent-section sentinel, same convention as
285
+ * `objectives`/`parts`/`stopConditions`, and the section is genuinely
286
+ * optional: an Issue whose Boundary states nothing about the code as it
287
+ * stands owes no premise.
288
+ */
289
+ premises: IssuePremise[]
253
290
  /**
254
291
  * The resolved gate cutovers (`resolveGateCutovers`, `apps/cli/src/lib/config.ts`).
255
292
  * The renderer's missing-fact refusal for a missing `## Objectives`/
@@ -1005,6 +1042,7 @@ export function renderBrief(facts: BriefFacts, template: string): RenderResult {
1005
1042
  ...(facts.documentation.kind === 'none' || facts.documentation.sources.length > 0
1006
1043
  ? [withCli(renderDocumentation(facts.documentation)), '']
1007
1044
  : []),
1045
+ ...(facts.premises.length > 0 ? [renderPremises(facts.premises), ''] : []),
1008
1046
  withCli(renderSection2(facts)),
1009
1047
  '',
1010
1048
  withCli(renderSection3(facts)),
@@ -204,6 +204,25 @@ export const LoopStateRecordSchema = z
204
204
  heldResult: roundHeadIdentity.nullable(),
205
205
  /** The round+head whose findings have already been delivered to the developer once — `null` until a delivery happens; read back so a later attach never redelivers the same (round, head) pair. */
206
206
  deliveredFindings: roundHeadIdentity.nullable(),
207
+ /**
208
+ * The loop's two repeat detectors, carried across a process boundary:
209
+ * the previous reviewed round's blocking-and-open finding keys, and the
210
+ * previous attempt's mechanical failure. Both live in the driver's
211
+ * in-memory `LoopState`, which a re-exec (the driver replacing itself
212
+ * when the base branch moves over its own code) and an attach both
213
+ * start fresh — so without this field the very next round would re-send
214
+ * the developer at a finding or a failure that had in fact already
215
+ * repeated, the exact outcome the two repeat stops exist to prevent.
216
+ * Optional: a record written before this field existed still parses, and
217
+ * reads back as no memory rather than as a corrupt record.
218
+ */
219
+ repeatMemory: z
220
+ .object({
221
+ blockingFindings: z.array(z.string()),
222
+ lastFailure: z.object({ signature: z.string(), message: z.string() }).nullable()
223
+ })
224
+ .strict()
225
+ .optional(),
207
226
  recordedAt: isoTimestamp
208
227
  })
209
228
  .strict()
@@ -31,6 +31,15 @@
31
31
  * progress; it is removed. The `no_progress` condition and pause reason
32
32
  * survive only for the driver's own attach-redelivery pause and for
33
33
  * already-written journals, never as an assessment exit here.
34
+ * - Two further exits, each with its own `condition` value and pause reason,
35
+ * stop a loop that is repeating itself rather than converging: the same
36
+ * BLOCKING finding — same reviewer role, same finding id — still open in
37
+ * two consecutive reviewed rounds (`condition: 'repeat_finding'`), and two
38
+ * consecutive attempts ending on the same mechanical failure
39
+ * (`condition: 'repeat_failure'`). Neither revives `no_progress`: a round
40
+ * that resolves nothing but raises only new findings still continues, and
41
+ * a round whose repeated finding is non-blocking continues too. Both name
42
+ * what repeated in the pause's own `detail`.
34
43
  *
35
44
  * Reuse, not a second counter: the id-state map for each round is built by
36
45
  * calling `groupRounds` (`../review-status`) with synthetic same-key
@@ -48,6 +57,7 @@ import {
48
57
  SEVERITY_COLUMNS,
49
58
  type Confidence,
50
59
  type Decision,
60
+ type DeferredFindingRow,
51
61
  type DevReviewLoopEventInput,
52
62
  type LoopState,
53
63
  type NotReviewedReason,
@@ -173,7 +183,15 @@ function findingsComparedEvent(state: LoopState, fc: FindingsCompared): DevRevie
173
183
  function stopConditionMetEvent(
174
184
  state: LoopState,
175
185
  round: number,
176
- condition: 'green' | 'max_rounds' | 'no_progress' | 'escalated' | 'confidence' | 'reappearance'
186
+ condition:
187
+ | 'green'
188
+ | 'max_rounds'
189
+ | 'no_progress'
190
+ | 'escalated'
191
+ | 'confidence'
192
+ | 'reappearance'
193
+ | 'repeat_finding'
194
+ | 'repeat_failure'
177
195
  ): DevReviewLoopEventInput {
178
196
  return { ...loopEventEnvelope(state), event: 'stop_condition_met', round, condition }
179
197
  }
@@ -242,14 +260,23 @@ function buildRoundRecord(
242
260
  // nothing rather than a zero a reader would take for a clean round.
243
261
  const countsBySeverity: Record<string, number> = {}
244
262
  for (const key of SEVERITY_COLUMNS) countsBySeverity[key] = 0
263
+ // O4: the findings this round set aside rather than let them block, in the
264
+ // order the verdicts reported them, each with its original severity and
265
+ // location — never its reported severity mutated (that is the whole point
266
+ // of a deferral: the finding is real, this round just cannot act on it).
267
+ const deferred: DeferredFindingRow[] = []
245
268
  for (const v of verdicts) {
246
269
  for (const f of v.findings) {
247
270
  const key = f.severity.toLowerCase()
248
- if (!(SEVERITY_COLUMNS as readonly string[]).includes(key)) continue
249
- countsBySeverity[key] = (countsBySeverity[key] ?? 0) + 1
271
+ if ((SEVERITY_COLUMNS as readonly string[]).includes(key)) {
272
+ countsBySeverity[key] = (countsBySeverity[key] ?? 0) + 1
273
+ }
274
+ if (f.deferred !== undefined) {
275
+ deferred.push({ severity: f.severity, location: f.location ?? '', reason: f.deferred })
276
+ }
250
277
  }
251
278
  }
252
- return { round, countsBySeverity, confidence, outcome }
279
+ return { round, countsBySeverity, confidence, outcome, ...(deferred.length > 0 ? { deferred } : {}) }
253
280
  }
254
281
 
255
282
  /**
@@ -310,6 +337,87 @@ function computeFindingsCompared(
310
337
  return { round, open, resolved, new: newIds, recurring }
311
338
  }
312
339
 
340
+ /**
341
+ * A round's BLOCKING, still-open findings as `<role>:<id>` keys, sorted and
342
+ * de-duplicated — the identity the `'repeat_finding'` stop compares across
343
+ * rounds. Two deliberate narrowings: a finding counts as the same one only by
344
+ * reviewer role AND id (the same id from the two roles is two findings, since
345
+ * each role numbers its own report), and only a finding the effective policy
346
+ * treated as `blocking` counts at all — a `non_blocking` finding never sent
347
+ * the developer back, so its repeat is not a loop failing to converge. A
348
+ * finding whose treatment the observation does not state is not counted
349
+ * either: the stop pauses a task, and an unstated treatment is not evidence.
350
+ * A deferred finding is excluded by the same test, without naming deferral at
351
+ * all: `policyTreatment` reads `non_blocking` whenever `deferred` is set
352
+ * (`types.ts`), and a finding the round never asked the developer to act on
353
+ * cannot be one the developer failed to close.
354
+ */
355
+ function blockingOpenKeys(verdicts: VerdictObservation[]): string[] {
356
+ const keys = new Set<string>()
357
+ for (const v of verdicts) {
358
+ for (const f of v.findings) {
359
+ if (f.policyTreatment !== 'blocking') continue
360
+ if (f.state === 'resolved') continue
361
+ keys.add(`${v.role}:${f.id}`)
362
+ }
363
+ }
364
+ return [...keys].sort()
365
+ }
366
+
367
+ /**
368
+ * The fixed volatile-token list the `'repeat_failure'` stop matches on —
369
+ * everything that naturally differs between two runs of the SAME failure and
370
+ * nothing that distinguishes two DIFFERENT ones. Timestamps, temporary
371
+ * directories, process ids, durations and commit shas become a fixed
372
+ * placeholder; the message's own words — which check failed, which premise
373
+ * pin is absent — survive untouched, so `absent: maxRounds` and
374
+ * `absent: reviewers` never collapse into one signature.
375
+ */
376
+ const VOLATILE_TOKENS: readonly { pattern: RegExp; replacement: string }[] = [
377
+ // ISO-8601 timestamps, with or without fractional seconds and zone.
378
+ { pattern: /\d{4}-\d{2}-\d{2}[t ]\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:z|[+-]\d{2}:?\d{2})?/g, replacement: '<ts>' },
379
+ // A bare clock time — a log line's own prefix.
380
+ { pattern: /\b\d{1,2}:\d{2}:\d{2}\b/g, replacement: '<ts>' },
381
+ // Temporary directories — the per-run scratch paths a retry never reuses.
382
+ { pattern: /(?:\/private)?\/(?:tmp|var\/folders)\/[^\s,;)'"]*/g, replacement: '<tmp>' },
383
+ // Process ids, however the producer spells them.
384
+ { pattern: /\b(?:pid|process)[ =:]+\d+/g, replacement: 'pid <pid>' },
385
+ // Durations: 1200ms, 1.2s, 90 seconds, 3m.
386
+ { pattern: /\b\d+(?:\.\d+)?\s*(?:ms|s|m|h|milliseconds?|seconds?|minutes?|hours?)\b/g, replacement: '<dur>' },
387
+ // Commit shas and other long hex runs.
388
+ { pattern: /\b[0-9a-f]{7,40}\b/g, replacement: '<sha>' }
389
+ ]
390
+
391
+ /**
392
+ * What the `'repeat_failure'` rule makes of one reported failure: the
393
+ * `{signature, message}` pair to remember (`null` for a failure the driver
394
+ * could not name — nothing left after normalisation), and whether it matches
395
+ * the previous attempt's. Shared by both observation kinds that can carry a
396
+ * mechanical failure, so a repeat means the same thing whether or not the
397
+ * attempt produced a head.
398
+ */
399
+ function matchFailure(
400
+ state: LoopState,
401
+ reported: string | undefined
402
+ ): { failure: { signature: string; message: string } | null; repeat: boolean } {
403
+ const message = reported?.trim() ?? ''
404
+ const signature = message === '' ? '' : normalizeFailureSignature(message)
405
+ if (signature === '') return { failure: null, repeat: false }
406
+ return { failure: { signature, message }, repeat: state.lastFailure?.signature === signature }
407
+ }
408
+
409
+ /**
410
+ * One mechanical failure's matching signature (O3) — lower-cased, volatile
411
+ * tokens replaced per the fixed list above, whitespace collapsed. Pure and
412
+ * total: any string in, a signature out; the empty string for a message with
413
+ * nothing left, which the caller treats as no signature at all.
414
+ */
415
+ export function normalizeFailureSignature(message: string): string {
416
+ let out = message.toLowerCase()
417
+ for (const { pattern, replacement } of VOLATILE_TOKENS) out = out.replace(pattern, replacement)
418
+ return out.replace(/\s+/g, ' ').trim()
419
+ }
420
+
313
421
  function mergedIds(
314
422
  priorIds: Map<string, string | null>,
315
423
  currentIds: Map<string, string | null>
@@ -321,7 +429,7 @@ function mergedIds(
321
429
 
322
430
  function assessGate(
323
431
  state: LoopState,
324
- obs: { round: number; green: boolean; confidence?: Confidence; stats: RoundStats }
432
+ obs: { round: number; green: boolean; confidence?: Confidence; stats: RoundStats; failure?: string }
325
433
  ): { decision: Decision; state: LoopState; events: DevReviewLoopEventInput[] } {
326
434
  const events: DevReviewLoopEventInput[] = []
327
435
  const isNewRound = state.pending === null || state.pending.round !== obs.round
@@ -338,17 +446,52 @@ function assessGate(
338
446
  events.push(gateResultReadEvent(state, obs.round, obs.stats.head, obs.green, obs.confidence))
339
447
 
340
448
  if (!obs.green) {
449
+ // The mechanical failure that ended this attempt, matched against the
450
+ // previous attempt's by normalised signature — never by raw equality,
451
+ // which two runs of the same failure never satisfy (different
452
+ // timestamps, scratch paths, process ids, durations). A failure the
453
+ // driver could not name at all (`undefined`, or nothing left after
454
+ // normalisation) is no signature: it breaks the chain rather than
455
+ // matching one unknown to another.
456
+ const { failure, repeat } = matchFailure(state, obs.failure)
457
+ if (repeat && failure !== null) {
458
+ events.push(stopConditionMetEvent(state, obs.round, 'repeat_failure'))
459
+ events.push(pausedEvent(state, obs.round, 'principal_item'))
460
+ events.push(roundEndedEvent(state, obs.round, obs.stats, 'changes_requested'))
461
+ const record = buildUnreviewedRecord(obs.round, null, 'stopped', 'checks_red')
462
+ const preFinalize: LoopState = {
463
+ ...state,
464
+ rounds: [...state.rounds, record],
465
+ pending: null,
466
+ lastFailure: failure,
467
+ ...withRoundStats(state, obs.stats)
468
+ }
469
+ events.push(journalFinalizedEvent(preFinalize, obs.stats.head, 'stopped'))
470
+ // The pause carries the failure as reported, not the signature: the
471
+ // normalised form exists only to match two attempts, never to be read.
472
+ return {
473
+ decision: { type: 'pause', reason: 'repeat_failure', detail: failure.message },
474
+ state: preFinalize,
475
+ events
476
+ }
477
+ }
341
478
  events.push(roundEndedEvent(state, obs.round, obs.stats, 'changes_requested'))
342
479
  const record = buildUnreviewedRecord(obs.round, null, 'changes_requested', 'checks_red')
343
480
  const newState: LoopState = {
344
481
  ...state,
345
482
  rounds: [...state.rounds, record],
346
483
  pending: null,
484
+ lastFailure: failure,
347
485
  ...withRoundStats(state, obs.stats)
348
486
  }
349
487
  return { decision: { type: 'dispatch_developer' }, state: newState, events }
350
488
  }
351
489
 
490
+ // Past the red branch the gate is green: whatever mechanical failure the
491
+ // previous attempt hit is over, so the repeat chain starts again from
492
+ // nothing. Every state this function returns below carries that.
493
+ const clearedFailure = { lastFailure: null } as const
494
+
352
495
  if (obs.round === 1) {
353
496
  const pending: PendingRound = {
354
497
  round: obs.round,
@@ -357,7 +500,7 @@ function assessGate(
357
500
  confidence: obs.confidence ?? null,
358
501
  priorIds: state.lastIds
359
502
  }
360
- return { decision: { type: 'dispatch_reviewers' }, state: { ...state, pending }, events }
503
+ return { decision: { type: 'dispatch_reviewers' }, state: { ...state, ...clearedFailure, pending }, events }
361
504
  }
362
505
 
363
506
  // Round ≥ 2: the confidence gate.
@@ -372,6 +515,7 @@ function assessGate(
372
515
  const record = buildRoundRecord(obs.round, [], null, 'stopped')
373
516
  const preFinalize: LoopState = {
374
517
  ...state,
518
+ ...clearedFailure,
375
519
  rounds: [...state.rounds, record],
376
520
  pending: null,
377
521
  ...withRoundStats(state, obs.stats)
@@ -386,7 +530,7 @@ function assessGate(
386
530
  confidence: null,
387
531
  priorIds: state.lastIds
388
532
  }
389
- return { decision: { type: 'ask_confidence' }, state: { ...state, pending }, events }
533
+ return { decision: { type: 'ask_confidence' }, state: { ...state, ...clearedFailure, pending }, events }
390
534
  }
391
535
 
392
536
  if (confidence.value < 50) {
@@ -397,6 +541,7 @@ function assessGate(
397
541
  const record = buildRoundRecord(obs.round, [], confidence, 'stopped')
398
542
  const preFinalize: LoopState = {
399
543
  ...state,
544
+ ...clearedFailure,
400
545
  rounds: [...state.rounds, record],
401
546
  pending: null,
402
547
  ...withRoundStats(state, obs.stats)
@@ -408,6 +553,7 @@ function assessGate(
408
553
  const record = buildUnreviewedRecord(obs.round, confidence, 'changes_requested', 'low_confidence')
409
554
  const newState: LoopState = {
410
555
  ...state,
556
+ ...clearedFailure,
411
557
  rounds: [...state.rounds, record],
412
558
  pending: null,
413
559
  extraTurnUsed: true,
@@ -423,7 +569,7 @@ function assessGate(
423
569
  confidence,
424
570
  priorIds: state.lastIds
425
571
  }
426
- return { decision: { type: 'dispatch_reviewers' }, state: { ...state, pending }, events }
572
+ return { decision: { type: 'dispatch_reviewers' }, state: { ...state, ...clearedFailure, pending }, events }
427
573
  }
428
574
 
429
575
  function assessVerdicts(
@@ -441,6 +587,12 @@ function assessVerdicts(
441
587
  events.push(findingsComparedEvent(state, fc))
442
588
 
443
589
  const carriedIds = mergedIds(pending.priorIds, currentIds)
590
+ // This round's blocking-and-open finding keys, compared against the
591
+ // PREVIOUS reviewed round's before any exit below can consume them, and
592
+ // carried into every state this function returns — a round the loop pauses
593
+ // on still records what it saw, exactly as `lastIds` does.
594
+ const currentBlocking = blockingOpenKeys(obs.verdicts)
595
+ const repeatedBlocking = currentBlocking.filter((key) => state.lastBlockingFindings.includes(key))
444
596
  const confidence = pending.confidence
445
597
 
446
598
  const hasEscalate = obs.verdicts.some((v) => v.verdict === 'ESCALATE')
@@ -454,6 +606,7 @@ function assessVerdicts(
454
606
  rounds: [...state.rounds, record],
455
607
  pending: null,
456
608
  lastIds: carriedIds,
609
+ lastBlockingFindings: currentBlocking,
457
610
  ...withRoundStats(state, pending.stats)
458
611
  }
459
612
  events.push(journalFinalizedEvent(preFinalize, pending.stats.head, 'stopped'))
@@ -473,6 +626,7 @@ function assessVerdicts(
473
626
  rounds: [...state.rounds, record],
474
627
  pending: null,
475
628
  lastIds: carriedIds,
629
+ lastBlockingFindings: currentBlocking,
476
630
  ...withRoundStats(state, pending.stats)
477
631
  }
478
632
  events.push(journalFinalizedEvent(preFinalize, pending.stats.head, 'merged_ready'))
@@ -489,12 +643,40 @@ function assessVerdicts(
489
643
  rounds: [...state.rounds, record],
490
644
  pending: null,
491
645
  lastIds: carriedIds,
646
+ lastBlockingFindings: currentBlocking,
492
647
  ...withRoundStats(state, pending.stats)
493
648
  }
494
649
  events.push(journalFinalizedEvent(preFinalize, pending.stats.head, 'stopped'))
495
650
  return { decision: { type: 'pause', reason: 'reappearance' }, state: preFinalize, events }
496
651
  }
497
652
 
653
+ if (repeatedBlocking.length > 0) {
654
+ events.push(stopConditionMetEvent(state, obs.round, 'repeat_finding'))
655
+ events.push(pausedEvent(state, obs.round, 'principal_item'))
656
+ events.push(roundEndedEvent(state, obs.round, pending.stats, 'changes_requested'))
657
+ const record = buildRoundRecord(obs.round, obs.verdicts, confidence, 'stopped')
658
+ const preFinalize: LoopState = {
659
+ ...state,
660
+ rounds: [...state.rounds, record],
661
+ pending: null,
662
+ lastIds: carriedIds,
663
+ lastBlockingFindings: currentBlocking,
664
+ ...withRoundStats(state, pending.stats)
665
+ }
666
+ events.push(journalFinalizedEvent(preFinalize, pending.stats.head, 'stopped'))
667
+ // The pause names the finding(s), so a Principal reading it never has to
668
+ // diff two rounds' reports to learn what the developer could not close.
669
+ return {
670
+ decision: {
671
+ type: 'pause',
672
+ reason: 'repeat_finding',
673
+ detail: `open after two consecutive rounds: ${repeatedBlocking.join(', ')}`
674
+ },
675
+ state: preFinalize,
676
+ events
677
+ }
678
+ }
679
+
498
680
  if (obs.round > state.config.maxRounds) {
499
681
  events.push(stopConditionMetEvent(state, obs.round, 'max_rounds'))
500
682
  events.push(pausedEvent(state, obs.round, 'principal_item'))
@@ -505,6 +687,7 @@ function assessVerdicts(
505
687
  rounds: [...state.rounds, record],
506
688
  pending: null,
507
689
  lastIds: carriedIds,
690
+ lastBlockingFindings: currentBlocking,
508
691
  ...withRoundStats(state, pending.stats)
509
692
  }
510
693
  events.push(journalFinalizedEvent(preFinalize, pending.stats.head, 'stopped'))
@@ -523,11 +706,52 @@ function assessVerdicts(
523
706
  rounds: [...state.rounds, record],
524
707
  pending: null,
525
708
  lastIds: carriedIds,
709
+ lastBlockingFindings: currentBlocking,
526
710
  ...withRoundStats(state, pending.stats)
527
711
  }
528
712
  return { decision: { type: 'dispatch_developer' }, state: newState, events }
529
713
  }
530
714
 
715
+ /**
716
+ * An attempt that ended on a mechanical failure without producing a head.
717
+ * The SAME `'repeat_failure'` rule the gate path applies, on an observation
718
+ * that has no gate result to carry: a second consecutive attempt whose
719
+ * failure normalises to the previous one's signature pauses, naming the
720
+ * failure exactly as the driver reported it. A first occurrence — or an
721
+ * attempt whose failure differs from the previous one's — records the
722
+ * signature and nothing else: no round record, no events, no diff-stat
723
+ * accounting, since no head was produced and the driver's own first-occurrence
724
+ * bounds still govern what happens next.
725
+ */
726
+ function assessMechanicalFailure(
727
+ state: LoopState,
728
+ obs: { round: number; failure: string; stats: RoundStats }
729
+ ): { decision: Decision; state: LoopState; events: DevReviewLoopEventInput[] } {
730
+ const { failure, repeat } = matchFailure(state, obs.failure)
731
+ if (repeat && failure !== null) {
732
+ const events: DevReviewLoopEventInput[] = [
733
+ stopConditionMetEvent(state, obs.round, 'repeat_failure'),
734
+ pausedEvent(state, obs.round, 'principal_item'),
735
+ roundEndedEvent(state, obs.round, obs.stats, 'changes_requested')
736
+ ]
737
+ const record = buildUnreviewedRecord(obs.round, null, 'stopped', 'mechanical_failure')
738
+ const preFinalize: LoopState = {
739
+ ...state,
740
+ rounds: [...state.rounds, record],
741
+ pending: null,
742
+ lastFailure: failure,
743
+ ...withRoundStats(state, obs.stats)
744
+ }
745
+ events.push(journalFinalizedEvent(preFinalize, obs.stats.head, 'stopped'))
746
+ return {
747
+ decision: { type: 'pause', reason: 'repeat_failure', detail: failure.message },
748
+ state: preFinalize,
749
+ events
750
+ }
751
+ }
752
+ return { decision: { type: 'dispatch_developer' }, state: { ...state, lastFailure: failure }, events: [] }
753
+ }
754
+
531
755
  /**
532
756
  * `assessRound(state, observations) → { decision, state, events }` — pure,
533
757
  * no I/O. `events` is the `DevReviewLoopEventInput[]` the caller passes,
@@ -539,5 +763,6 @@ export function assessRound(
539
763
  observations: Observations
540
764
  ): { decision: Decision; state: LoopState; events: DevReviewLoopEventInput[] } {
541
765
  if (observations.kind === 'gate') return assessGate(state, observations)
766
+ if (observations.kind === 'mechanical_failure') return assessMechanicalFailure(state, observations)
542
767
  return assessVerdicts(state, observations)
543
768
  }
@@ -29,17 +29,22 @@ export function fakeStats(round: number, overrides: Partial<RoundStats> = {}): R
29
29
  }
30
30
  }
31
31
 
32
- /** The CI fake: a round's mechanical-gate result, optionally carrying the developer's confidence. */
32
+ /**
33
+ * The CI fake: a round's mechanical-gate result, optionally carrying the
34
+ * developer's confidence and — for a red gate — the mechanical failure the
35
+ * driver observed, verbatim, exactly as the real one reports it.
36
+ */
33
37
  export function fakeGate(
34
38
  round: number,
35
39
  green: boolean,
36
- opts: { confidence?: Confidence; stats?: Partial<RoundStats> } = {}
40
+ opts: { confidence?: Confidence; stats?: Partial<RoundStats>; failure?: string } = {}
37
41
  ): Observations {
38
42
  return {
39
43
  kind: 'gate',
40
44
  round,
41
45
  green,
42
46
  ...(opts.confidence !== undefined ? { confidence: opts.confidence } : {}),
47
+ ...(opts.failure !== undefined ? { failure: opts.failure } : {}),
43
48
  stats: fakeStats(round, opts.stats)
44
49
  }
45
50
  }
@@ -14,6 +14,7 @@ export type { ReconstructedJournal, ReconstructionInput, ReviewGateFact } from '
14
14
  export type {
15
15
  Confidence,
16
16
  Decision,
17
+ DeferredFindingRow,
17
18
  DevReviewLoopEventInput,
18
19
  FindingObservation,
19
20
  FindingState,
@@ -5,8 +5,16 @@
5
5
  * `Judged head:`, or `Objectives version:` label anywhere in the output.
6
6
  */
7
7
 
8
+ import { DEFERRAL_REASON_TEXT } from '../review-policy'
8
9
  import { SUMMARY_TABLE_HEADER } from './journal-reconstruction'
9
- import { SEVERITY_COLUMNS, type Confidence, type Journal, type NotReviewedReason, type RoundRecord } from './types'
10
+ import {
11
+ SEVERITY_COLUMNS,
12
+ type Confidence,
13
+ type DeferredFindingRow,
14
+ type Journal,
15
+ type NotReviewedReason,
16
+ type RoundRecord
17
+ } from './types'
10
18
 
11
19
  /**
12
20
  * The two non-numeric cells this table writes, named once so the parser below
@@ -68,7 +76,8 @@ function countCells(record: RoundRecord): string[] {
68
76
  */
69
77
  const NOT_REVIEWED_REASON_TEXT: Record<NotReviewedReason, string> = {
70
78
  checks_red: 'checks red',
71
- low_confidence: 'low confidence'
79
+ low_confidence: 'low confidence',
80
+ mechanical_failure: 'mechanical failure'
72
81
  }
73
82
 
74
83
  function outcomeCell(record: RoundRecord): string {
@@ -80,11 +89,37 @@ function row(record: RoundRecord): string {
80
89
  return `| ${record.round} | ${countCells(record).join(' | ')} | ${confidenceCell(record.confidence)} | ${outcomeCell(record)} |`
81
90
  }
82
91
 
92
+ /** The heading that opens the deferred-findings block, so a reader (and a test) can find it without matching a whole line. */
93
+ export const DEFERRED_FINDINGS_HEADING = 'Deferred findings (reported, not blocking this round):'
94
+
95
+ /** One deferred finding as the summary lists it (O4): its original severity, its `file:line` (or `(no location)` when it carried none), and why. */
96
+ export function renderDeferredFindingLine(round: number, f: DeferredFindingRow): string {
97
+ const where = f.location.length > 0 ? f.location : '(no location)'
98
+ return `- round ${round} — ${f.severity} ${where} — ${DEFERRAL_REASON_TEXT[f.reason]}`
99
+ }
100
+
101
+ /**
102
+ * The deferred-findings block appended below the table (O4) — one line per
103
+ * deferred finding across every round, in round then report order. Empty
104
+ * string when no round deferred anything, so the summary is byte-identical to
105
+ * what it was before this task on a run that deferred nothing. Deliberately
106
+ * NOT a `|`-delimited table: `parseSummaryConfidenceRows` reads the table by
107
+ * its pipe-delimited rows, so a plain-list block can never be misread as a
108
+ * round row.
109
+ */
110
+ function renderDeferredBlock(journal: Journal): string[] {
111
+ const lines: string[] = []
112
+ for (const record of journal.rounds) {
113
+ for (const f of record.deferred ?? []) lines.push(renderDeferredFindingLine(record.round, f))
114
+ }
115
+ return lines.length === 0 ? [] : ['', DEFERRED_FINDINGS_HEADING, ...lines]
116
+ }
117
+
83
118
  export function renderSummary(journal: Journal): string {
84
119
  const header = SUMMARY_TABLE_HEADER
85
120
  const divider = `| --- | ${SEVERITY_COLUMNS.map(() => '---').join(' | ')} | --- | --- |`
86
121
  const rows = journal.rounds.map(row)
87
- return [header, divider, ...rows].join('\n')
122
+ return [header, divider, ...rows, ...renderDeferredBlock(journal)].join('\n')
88
123
  }
89
124
 
90
125
  /**