@attalabs/vinaya 0.35.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 (246) 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 +23 -8
  13. package/aeg-root/roles/planner.md +2 -0
  14. package/aeg-root/roles/principal.md +6 -1
  15. package/aeg-root/roles/reviewer.md +11 -3
  16. package/aeg-root/roles/security.md +19 -9
  17. package/aeg-root/roles/tranche-archivist.md +14 -2
  18. package/aeg-root/state-machine.md +11 -10
  19. package/aeg-root/templates/brief-template.md +10 -4
  20. package/aeg-root/templates/pr-report-template.md +1 -9
  21. package/aeg-root/tranche-model.md +4 -4
  22. package/dist/checks/bin/check-body-bare-digits.js +2081 -1883
  23. package/dist/checks/bin/check-branch-topology.js +1376 -1139
  24. package/dist/checks/bin/check-brief-shape.js +2081 -1883
  25. package/dist/checks/bin/check-changeset-coverage.js +2564 -2025
  26. package/dist/checks/bin/check-closes-n.js +1376 -1139
  27. package/dist/checks/bin/check-coherence.js +1480 -1228
  28. package/dist/checks/bin/check-dead-branch-push.js +1339 -1156
  29. package/dist/checks/bin/check-dispatch-readiness.js +1480 -1228
  30. package/dist/checks/bin/check-doc-coverage-push.js +2563 -2024
  31. package/dist/checks/bin/check-doc-coverage.js +2565 -2026
  32. package/dist/checks/bin/check-doctrine-no-procedures.js +2081 -1883
  33. package/dist/checks/bin/check-doctrine-portability.js +2563 -2024
  34. package/dist/checks/bin/check-evidence-fresh.js +1906 -1536
  35. package/dist/checks/bin/check-exec-bits.js +2136 -1597
  36. package/dist/checks/bin/check-first-push-dispatch.js +1480 -1228
  37. package/dist/checks/bin/check-issue-assignment.js +1376 -1139
  38. package/dist/checks/bin/check-issue-milestone-attach.js +1339 -1156
  39. package/dist/checks/bin/check-issue-objectives-numbering.js +2081 -1883
  40. package/dist/checks/bin/check-issue-parts-coverage.js +1339 -1156
  41. package/dist/checks/bin/check-issue-surface-globs.js +1488 -1227
  42. package/dist/checks/bin/check-issue-title-grammar.js +1339 -1156
  43. package/dist/checks/bin/check-issue-tranche-label.js +1339 -1156
  44. package/dist/checks/bin/check-main-branch-refusal.js +1342 -1159
  45. package/dist/checks/bin/check-no-disk-state.js +1342 -1159
  46. package/dist/checks/bin/check-pr-premise-reassert.js +2081 -1883
  47. package/dist/checks/bin/check-pr-report-density.js +1342 -1159
  48. package/dist/checks/bin/check-principal-test-plan-wait.js +1342 -1159
  49. package/dist/checks/bin/check-quoted-command.js +4063 -3526
  50. package/dist/checks/bin/check-reader-resolvable-prose.js +4082 -3533
  51. package/dist/checks/bin/check-registry-gates.js +1363 -1167
  52. package/dist/checks/bin/check-retired-vocabulary.js +4057 -3520
  53. package/dist/checks/bin/check-review-gate.js +2081 -1883
  54. package/dist/checks/bin/check-single-plan-pr.js +1339 -1156
  55. package/dist/checks/bin/check-surface-scope.js +1376 -1139
  56. package/dist/checks/bin/check-test-plan.js +1339 -1156
  57. package/dist/checks/bin/check-token-collection-wired.js +1342 -1159
  58. package/dist/checks/bin/check-token-report.js +1409 -1342
  59. package/dist/checks/bin/check-workspace-escape.js +2562 -2023
  60. package/dist/index.js +14171 -6490
  61. package/dist/lib/pre-push-cache-test-run.js +1044 -641
  62. package/dist/lib/pre-push-select-tests.js +641 -444
  63. package/package.json +2 -2
  64. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/brief-render.ts +38 -0
  65. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/control-store/records.ts +19 -0
  66. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/assess-round.ts +257 -10
  67. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/fakes.ts +7 -2
  68. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/index.ts +2 -0
  69. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/render-summary.ts +69 -11
  70. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/types.ts +139 -2
  71. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/doc-claim.ts +32 -6
  72. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/index.ts +27 -1
  73. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/issue-validation.ts +757 -0
  74. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/schema.ts +8 -1
  75. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/review-gate.ts +52 -4
  76. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/review-policy.ts +163 -21
  77. package/studio-standalone/apps/vinaya-studio/web/.next/BUILD_ID +1 -1
  78. package/studio-standalone/apps/vinaya-studio/web/.next/app-path-routes-manifest.json +0 -1
  79. package/studio-standalone/apps/vinaya-studio/web/.next/build-manifest.json +3 -3
  80. package/studio-standalone/apps/vinaya-studio/web/.next/prerender-manifest.json +3 -3
  81. package/studio-standalone/apps/vinaya-studio/web/.next/required-server-files.json +0 -5
  82. package/studio-standalone/apps/vinaya-studio/web/.next/routes-manifest.json +0 -6
  83. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error/page.js +1 -1
  84. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error/page.js.nft.json +1 -1
  85. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.html +1 -1
  86. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.rsc +1 -1
  87. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  88. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  89. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  90. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  91. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  92. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_not-found/page/server-reference-manifest.json +2 -2
  93. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_not-found/page.js +1 -1
  94. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_not-found/page.js.nft.json +1 -1
  95. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  96. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/page/server-reference-manifest.json +2 -2
  97. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/page.js +1 -1
  98. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/page.js.nft.json +1 -1
  99. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/page_client-reference-manifest.js +1 -1
  100. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/backlog/page/server-reference-manifest.json +2 -2
  101. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/backlog/page.js +3 -3
  102. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/backlog/page.js.nft.json +1 -1
  103. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/backlog/page_client-reference-manifest.js +1 -1
  104. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/page/server-reference-manifest.json +2 -2
  105. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/page.js +3 -3
  106. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/page.js.nft.json +1 -1
  107. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/page_client-reference-manifest.js +1 -1
  108. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/page/server-reference-manifest.json +2 -2
  109. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/page.js +3 -3
  110. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/page.js.nft.json +1 -1
  111. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/page_client-reference-manifest.js +1 -1
  112. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/page/server-reference-manifest.json +3 -3
  113. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/page.js +5 -5
  114. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/page.js.nft.json +1 -1
  115. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/page_client-reference-manifest.js +1 -1
  116. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/tasks/[taskId]/page/server-reference-manifest.json +2 -2
  117. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/tasks/[taskId]/page.js +3 -3
  118. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/tasks/[taskId]/page.js.nft.json +1 -1
  119. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/tasks/[taskId]/page_client-reference-manifest.js +1 -1
  120. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/page/server-reference-manifest.json +2 -2
  121. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/page.js +3 -3
  122. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/page.js.nft.json +1 -1
  123. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/page_client-reference-manifest.js +1 -1
  124. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/tranches/page/server-reference-manifest.json +2 -2
  125. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/tranches/page.js +3 -3
  126. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/tranches/page.js.nft.json +1 -1
  127. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/tranches/page_client-reference-manifest.js +1 -1
  128. package/studio-standalone/apps/vinaya-studio/web/.next/server/app-paths-manifest.json +0 -1
  129. 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
  130. 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
  131. 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
  132. 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
  133. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/{_15gdg48._.js → [root-of-the-server]__04adkz-._.js} +3 -3
  134. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__05zwn98._.js +14 -0
  135. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__08e39jo._.js +3 -0
  136. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__0ls23oh._.js +1 -1
  137. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__10riywf._.js +3 -0
  138. 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
  139. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/{[root-of-the-server]__0zc_0gx._.js → [root-of-the-server]__14ui9sz._.js} +2 -2
  140. 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
  141. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__1f4bb3_._.js +3 -0
  142. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__1gjqmhq._.js +1 -1
  143. 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
  144. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__1ng2x88._.js +3 -0
  145. 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
  146. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__1snpgaw._.js +56 -0
  147. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__1wc4-ip._.js +2 -2
  148. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_06h3wbl._.js +3 -0
  149. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_08onyya._.js +1 -1
  150. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_096f46i._.js +1 -1
  151. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0af2one._.js +1 -1
  152. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0e5tkdd._.js +1 -1
  153. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0gs4gvl._.js +3 -0
  154. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0kf2g72._.js +1 -1
  155. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0zf4d27._.js +1 -1
  156. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_1-wo68i._.js +1 -1
  157. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_121lrn5._.js +3 -0
  158. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_1achbh9._.js +1 -1
  159. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_1o4v6lb._.js +3 -0
  160. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_1q7h5mz._.js +1 -1
  161. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_1ztd4i3._.js +3 -0
  162. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_209-ugd._.js +3 -0
  163. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_214d71c._.js +3 -0
  164. 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
  165. 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
  166. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/node_modules_next_dist_1lzmr5o._.js +1 -1
  167. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/packages_ui_libraries_animate_components_index_ts_186fje1._.js +1 -1
  168. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/packages_ui_libraries_basic_components_index_ts_0xk1vda._.js +1 -1
  169. package/studio-standalone/apps/vinaya-studio/web/.next/server/middleware-build-manifest.js +3 -3
  170. package/studio-standalone/apps/vinaya-studio/web/.next/server/pages/500.html +1 -1
  171. package/studio-standalone/apps/vinaya-studio/web/.next/server/server-reference-manifest.js +1 -1
  172. package/studio-standalone/apps/vinaya-studio/web/.next/server/server-reference-manifest.json +4 -4
  173. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/09fcolor69bun.js +1 -0
  174. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/0lcwmwzxacdie.js +1 -0
  175. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/0ojry7lrbzkfd.css +1 -0
  176. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/0vtfb0g813gki.js +1 -0
  177. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/1giu47hrbhroj.js +1 -0
  178. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/1shz6lwruld25.js +1 -0
  179. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/1ytvuy1mmnc6j.js +1 -0
  180. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/{3oxhhhm_psozq.js → 21a6_5cr956wj.js} +1 -1
  181. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/2g8mwnydod96u.js +1 -0
  182. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/{3li0ueedy-ozv.js → 2nrnuawd5fwpv.js} +1 -1
  183. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/2nw47832_uvfe.js +1 -0
  184. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/2qdxnj8wk2h0s.js +1 -0
  185. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/3b9q75p-z5ma5.js +1 -0
  186. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/3cv-oe7153242.js +1 -0
  187. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/{3ip5z3cf43bgo.js → 3l56x8wjdzvaw.js} +5 -5
  188. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/3m310lbjj4p5u.js +1 -0
  189. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/{3goaig_rysc6p.js → 3qtt1v3ya-ofe.js} +1 -1
  190. package/studio-standalone/apps/vinaya-studio/web/package.json +2 -2
  191. package/studio-standalone/apps/vinaya-studio/web/server.js +1 -1
  192. 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/aeg-core/bin/verify-coherence.ts +0 -1089
  193. package/studio-standalone/_node_modules/next/dist/compiled/next-server/app-route-turbo.runtime.prod.js +0 -6
  194. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/api/coherence/route/app-paths-manifest.json +0 -3
  195. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/api/coherence/route/build-manifest.json +0 -9
  196. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/api/coherence/route/server-reference-manifest.json +0 -4
  197. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/api/coherence/route.js +0 -6
  198. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/api/coherence/route.js.map +0 -5
  199. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/api/coherence/route.js.nft.json +0 -1
  200. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/api/coherence/route_client-reference-manifest.js +0 -3
  201. 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
  202. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/[externals]__0cki-x_._.js +0 -3
  203. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/[root-of-the-server]__02a-3g8._.js +0 -15
  204. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/[turbopack]_runtime.js +0 -903
  205. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__074w9nf._.js +0 -3
  206. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__0ln09ua._.js +0 -3
  207. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__0oegopp._.js +0 -3
  208. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__13yxbjd._.js +0 -51
  209. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__1duqmtm._.js +0 -3
  210. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__1z7dml9._.js +0 -9
  211. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0bfs_u4._.js +0 -3
  212. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0g8_eot._.js +0 -3
  213. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0hrh_v-._.js +0 -181
  214. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0i4-dea._.js +0 -3
  215. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0o54suy._.js +0 -3
  216. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0rxd7s0._.js +0 -3
  217. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0y1jv16._.js +0 -3
  218. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_151m4rz._.js +0 -3
  219. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_1a9dieq._.js +0 -3
  220. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_1sxsf5q._.js +0 -3
  221. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_1sy_yfr._.js +0 -3
  222. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_219v2an._.js +0 -3
  223. 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
  224. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/packages_ui_libraries_basic_components_form_input_tsx_0es8d8b._.js +0 -3
  225. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/packages_ui_libraries_brutal_components_index_ts_0n_lcc4._.js +0 -3
  226. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/packages_ui_libraries_retro_components_index_ts_0wvpm_z._.js +0 -3
  227. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/0bjnj-5fy4e7l.js +0 -1
  228. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/0c8uwz_-m8s99.js +0 -165
  229. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/0ct0c-xj0baf6.js +0 -1
  230. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/0ko698wh8xx2g.css +0 -1
  231. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/0t5n_r4xm__t-.js +0 -1
  232. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/0vc2u252q5q6o.js +0 -1
  233. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/16r_o07lw0vm0.js +0 -1
  234. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/1cah7_e5a1zvu.js +0 -1
  235. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/1gjo9-6dz7nup.js +0 -1
  236. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/24tz8aro1uto4.js +0 -1
  237. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/2ef2g5fozszw7.js +0 -1
  238. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/2ka8dg687auhj.js +0 -1
  239. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/2pf3f50gbrkyv.js +0 -1
  240. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/2qq49pct3q51-.js +0 -1
  241. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/3et66z7glk65w.js +0 -1
  242. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/3u9emqjwpd0t9.js +0 -1
  243. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/3y6u3prmrkea-.js +0 -1
  244. /package/studio-standalone/apps/vinaya-studio/web/.next/static/{ca66rAHI_w9D7S7ceXDvR → yR5RsCxb1OGnYggiaO09S}/_buildManifest.js +0 -0
  245. /package/studio-standalone/apps/vinaya-studio/web/.next/static/{ca66rAHI_w9D7S7ceXDvR → yR5RsCxb1OGnYggiaO09S}/_clientMiddlewareManifest.js +0 -0
  246. /package/studio-standalone/apps/vinaya-studio/web/.next/static/{ca66rAHI_w9D7S7ceXDvR → yR5RsCxb1OGnYggiaO09S}/_ssgManifest.js +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@attalabs/vinaya",
3
- "version": "0.35.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,8 +57,10 @@ import {
48
57
  SEVERITY_COLUMNS,
49
58
  type Confidence,
50
59
  type Decision,
60
+ type DeferredFindingRow,
51
61
  type DevReviewLoopEventInput,
52
62
  type LoopState,
63
+ type NotReviewedReason,
53
64
  type Observations,
54
65
  type PendingRound,
55
66
  type RoundOutcome,
@@ -172,7 +183,15 @@ function findingsComparedEvent(state: LoopState, fc: FindingsCompared): DevRevie
172
183
  function stopConditionMetEvent(
173
184
  state: LoopState,
174
185
  round: number,
175
- 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'
176
195
  ): DevReviewLoopEventInput {
177
196
  return { ...loopEventEnvelope(state), event: 'stop_condition_met', round, condition }
178
197
  }
@@ -241,14 +260,44 @@ function buildRoundRecord(
241
260
  // nothing rather than a zero a reader would take for a clean round.
242
261
  const countsBySeverity: Record<string, number> = {}
243
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[] = []
244
268
  for (const v of verdicts) {
245
269
  for (const f of v.findings) {
246
270
  const key = f.severity.toLowerCase()
247
- if (!(SEVERITY_COLUMNS as readonly string[]).includes(key)) continue
248
- 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
+ }
249
277
  }
250
278
  }
251
- return { round, countsBySeverity, confidence, outcome }
279
+ return { round, countsBySeverity, confidence, outcome, ...(deferred.length > 0 ? { deferred } : {}) }
280
+ }
281
+
282
+ /**
283
+ * A round that ended before any reviewer ran — its gate was not green, or a
284
+ * below-threshold confidence sent the developer back — has no findings from any
285
+ * source. Unlike `buildRoundRecord`, it records NO counts (an empty
286
+ * `countsBySeverity`, the shape a marker-reconstructed round also carries), so
287
+ * the published table reports `—` for every severity column through the
288
+ * renderer's existing "counts have no source" path, never a `0` a reader would
289
+ * take for a clean review (`countCells`, `render-summary.ts`). `outcome` is left
290
+ * exactly as this round would otherwise carry — the `round_ended` log event is
291
+ * unchanged — and `notReviewed` names why no reviewer saw it for the table's
292
+ * outcome cell.
293
+ */
294
+ function buildUnreviewedRecord(
295
+ round: number,
296
+ confidence: Confidence | null,
297
+ outcome: RoundOutcome,
298
+ reason: NotReviewedReason
299
+ ): RoundRecord {
300
+ return { round, countsBySeverity: {}, confidence, outcome, notReviewed: reason }
252
301
  }
253
302
 
254
303
  /** Folds one round's diff stats into the running totals `journal_finalized` reports — never recomputed from `rounds`. */
@@ -288,6 +337,87 @@ function computeFindingsCompared(
288
337
  return { round, open, resolved, new: newIds, recurring }
289
338
  }
290
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
+
291
421
  function mergedIds(
292
422
  priorIds: Map<string, string | null>,
293
423
  currentIds: Map<string, string | null>
@@ -299,7 +429,7 @@ function mergedIds(
299
429
 
300
430
  function assessGate(
301
431
  state: LoopState,
302
- obs: { round: number; green: boolean; confidence?: Confidence; stats: RoundStats }
432
+ obs: { round: number; green: boolean; confidence?: Confidence; stats: RoundStats; failure?: string }
303
433
  ): { decision: Decision; state: LoopState; events: DevReviewLoopEventInput[] } {
304
434
  const events: DevReviewLoopEventInput[] = []
305
435
  const isNewRound = state.pending === null || state.pending.round !== obs.round
@@ -316,17 +446,52 @@ function assessGate(
316
446
  events.push(gateResultReadEvent(state, obs.round, obs.stats.head, obs.green, obs.confidence))
317
447
 
318
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
+ }
319
478
  events.push(roundEndedEvent(state, obs.round, obs.stats, 'changes_requested'))
320
- const record = buildRoundRecord(obs.round, [], null, 'changes_requested')
479
+ const record = buildUnreviewedRecord(obs.round, null, 'changes_requested', 'checks_red')
321
480
  const newState: LoopState = {
322
481
  ...state,
323
482
  rounds: [...state.rounds, record],
324
483
  pending: null,
484
+ lastFailure: failure,
325
485
  ...withRoundStats(state, obs.stats)
326
486
  }
327
487
  return { decision: { type: 'dispatch_developer' }, state: newState, events }
328
488
  }
329
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
+
330
495
  if (obs.round === 1) {
331
496
  const pending: PendingRound = {
332
497
  round: obs.round,
@@ -335,7 +500,7 @@ function assessGate(
335
500
  confidence: obs.confidence ?? null,
336
501
  priorIds: state.lastIds
337
502
  }
338
- return { decision: { type: 'dispatch_reviewers' }, state: { ...state, pending }, events }
503
+ return { decision: { type: 'dispatch_reviewers' }, state: { ...state, ...clearedFailure, pending }, events }
339
504
  }
340
505
 
341
506
  // Round ≥ 2: the confidence gate.
@@ -350,6 +515,7 @@ function assessGate(
350
515
  const record = buildRoundRecord(obs.round, [], null, 'stopped')
351
516
  const preFinalize: LoopState = {
352
517
  ...state,
518
+ ...clearedFailure,
353
519
  rounds: [...state.rounds, record],
354
520
  pending: null,
355
521
  ...withRoundStats(state, obs.stats)
@@ -364,7 +530,7 @@ function assessGate(
364
530
  confidence: null,
365
531
  priorIds: state.lastIds
366
532
  }
367
- return { decision: { type: 'ask_confidence' }, state: { ...state, pending }, events }
533
+ return { decision: { type: 'ask_confidence' }, state: { ...state, ...clearedFailure, pending }, events }
368
534
  }
369
535
 
370
536
  if (confidence.value < 50) {
@@ -375,6 +541,7 @@ function assessGate(
375
541
  const record = buildRoundRecord(obs.round, [], confidence, 'stopped')
376
542
  const preFinalize: LoopState = {
377
543
  ...state,
544
+ ...clearedFailure,
378
545
  rounds: [...state.rounds, record],
379
546
  pending: null,
380
547
  ...withRoundStats(state, obs.stats)
@@ -383,9 +550,10 @@ function assessGate(
383
550
  return { decision: { type: 'pause', reason: 'confidence' }, state: preFinalize, events }
384
551
  }
385
552
  events.push(roundEndedEvent(state, obs.round, obs.stats, 'changes_requested'))
386
- const record = buildRoundRecord(obs.round, [], confidence, 'changes_requested')
553
+ const record = buildUnreviewedRecord(obs.round, confidence, 'changes_requested', 'low_confidence')
387
554
  const newState: LoopState = {
388
555
  ...state,
556
+ ...clearedFailure,
389
557
  rounds: [...state.rounds, record],
390
558
  pending: null,
391
559
  extraTurnUsed: true,
@@ -401,7 +569,7 @@ function assessGate(
401
569
  confidence,
402
570
  priorIds: state.lastIds
403
571
  }
404
- return { decision: { type: 'dispatch_reviewers' }, state: { ...state, pending }, events }
572
+ return { decision: { type: 'dispatch_reviewers' }, state: { ...state, ...clearedFailure, pending }, events }
405
573
  }
406
574
 
407
575
  function assessVerdicts(
@@ -419,6 +587,12 @@ function assessVerdicts(
419
587
  events.push(findingsComparedEvent(state, fc))
420
588
 
421
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))
422
596
  const confidence = pending.confidence
423
597
 
424
598
  const hasEscalate = obs.verdicts.some((v) => v.verdict === 'ESCALATE')
@@ -432,6 +606,7 @@ function assessVerdicts(
432
606
  rounds: [...state.rounds, record],
433
607
  pending: null,
434
608
  lastIds: carriedIds,
609
+ lastBlockingFindings: currentBlocking,
435
610
  ...withRoundStats(state, pending.stats)
436
611
  }
437
612
  events.push(journalFinalizedEvent(preFinalize, pending.stats.head, 'stopped'))
@@ -451,6 +626,7 @@ function assessVerdicts(
451
626
  rounds: [...state.rounds, record],
452
627
  pending: null,
453
628
  lastIds: carriedIds,
629
+ lastBlockingFindings: currentBlocking,
454
630
  ...withRoundStats(state, pending.stats)
455
631
  }
456
632
  events.push(journalFinalizedEvent(preFinalize, pending.stats.head, 'merged_ready'))
@@ -467,12 +643,40 @@ function assessVerdicts(
467
643
  rounds: [...state.rounds, record],
468
644
  pending: null,
469
645
  lastIds: carriedIds,
646
+ lastBlockingFindings: currentBlocking,
470
647
  ...withRoundStats(state, pending.stats)
471
648
  }
472
649
  events.push(journalFinalizedEvent(preFinalize, pending.stats.head, 'stopped'))
473
650
  return { decision: { type: 'pause', reason: 'reappearance' }, state: preFinalize, events }
474
651
  }
475
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
+
476
680
  if (obs.round > state.config.maxRounds) {
477
681
  events.push(stopConditionMetEvent(state, obs.round, 'max_rounds'))
478
682
  events.push(pausedEvent(state, obs.round, 'principal_item'))
@@ -483,6 +687,7 @@ function assessVerdicts(
483
687
  rounds: [...state.rounds, record],
484
688
  pending: null,
485
689
  lastIds: carriedIds,
690
+ lastBlockingFindings: currentBlocking,
486
691
  ...withRoundStats(state, pending.stats)
487
692
  }
488
693
  events.push(journalFinalizedEvent(preFinalize, pending.stats.head, 'stopped'))
@@ -501,11 +706,52 @@ function assessVerdicts(
501
706
  rounds: [...state.rounds, record],
502
707
  pending: null,
503
708
  lastIds: carriedIds,
709
+ lastBlockingFindings: currentBlocking,
504
710
  ...withRoundStats(state, pending.stats)
505
711
  }
506
712
  return { decision: { type: 'dispatch_developer' }, state: newState, events }
507
713
  }
508
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
+
509
755
  /**
510
756
  * `assessRound(state, observations) → { decision, state, events }` — pure,
511
757
  * no I/O. `events` is the `DevReviewLoopEventInput[]` the caller passes,
@@ -517,5 +763,6 @@ export function assessRound(
517
763
  observations: Observations
518
764
  ): { decision: Decision; state: LoopState; events: DevReviewLoopEventInput[] } {
519
765
  if (observations.kind === 'gate') return assessGate(state, observations)
766
+ if (observations.kind === 'mechanical_failure') return assessMechanicalFailure(state, observations)
520
767
  return assessVerdicts(state, observations)
521
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,12 +14,14 @@ 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,
20
21
  Journal,
21
22
  LoopConfig,
22
23
  LoopState,
24
+ NotReviewedReason,
23
25
  Observations,
24
26
  PauseReason,
25
27
  PendingRound,