devrites 4.0.12 → 4.2.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 (283) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/README.md +3 -3
  3. package/docs/architecture.md +4 -4
  4. package/docs/command-map.md +4 -3
  5. package/docs/engine/commands.md +65 -6
  6. package/docs/flow.md +2 -1
  7. package/docs/orchestration.md +45 -4
  8. package/docs/skills.md +4 -3
  9. package/engine/go.mod +1 -1
  10. package/engine/internal/devritespaths/paths.go +5 -4
  11. package/engine/internal/gate/gate.go +154 -46
  12. package/engine/internal/gate/gate_test.go +290 -2
  13. package/engine/internal/gate/readiness_binding.go +66 -100
  14. package/engine/internal/gate/readiness_binding_test.go +126 -3
  15. package/engine/internal/hostpack/hostpack.go +9 -4
  16. package/engine/internal/hostpack/hostpack_test.go +16 -7
  17. package/engine/internal/install/install_test.go +5 -0
  18. package/engine/internal/lib/resolve.go +6 -6
  19. package/engine/internal/state/cmd/workflowmanifest/main.go +32 -3
  20. package/engine/internal/state/feature.go +1 -100
  21. package/engine/internal/state/observation.go +584 -0
  22. package/engine/internal/state/observation_open_other.go +9 -0
  23. package/engine/internal/state/observation_open_unix.go +12 -0
  24. package/engine/internal/state/observation_test.go +960 -0
  25. package/engine/internal/state/observation_unix_test.go +68 -0
  26. package/engine/internal/state/schema.go +60 -160
  27. package/engine/internal/state/state_test.go +489 -101
  28. package/engine/internal/state/status.go +67 -48
  29. package/engine/tests/adr_0004_required_by_phase_test.go +16 -13
  30. package/engine/tests/adr_0011_define_plan_test.go +14 -12
  31. package/engine/tests/gate_test.go +403 -28
  32. package/engine/tests/workspace_observation_migration_test.go +1065 -0
  33. package/pack/.claude/agents/devrites-code-reviewer.md +6 -1
  34. package/pack/.claude/agents/devrites-plan-drafter.md +5 -0
  35. package/pack/.claude/agents/devrites-plan-reviewer.md +6 -0
  36. package/pack/.claude/agents/devrites-proof-runner.md +7 -1
  37. package/pack/.claude/agents/devrites-retrospector.md +21 -25
  38. package/pack/.claude/agents/devrites-security-auditor.md +7 -3
  39. package/pack/.claude/agents/devrites-slice-wright.md +30 -4
  40. package/pack/.claude/agents/devrites-spec-reviewer.md +5 -0
  41. package/pack/.claude/agents/devrites-strategy-reviewer.md +3 -4
  42. package/pack/.claude/agents/devrites-test-analyst.md +5 -0
  43. package/pack/.claude/skills/devrites-debug-recovery/SKILL.md +13 -26
  44. package/pack/.claude/skills/devrites-debug-recovery/reference/build-the-loop.md +11 -14
  45. package/pack/.claude/skills/devrites-doubt/SKILL.md +3 -4
  46. package/pack/.claude/skills/devrites-frontend-craft/reference/reuse-first.md +3 -4
  47. package/pack/.claude/skills/devrites-lib/reference/standards/README.md +5 -1
  48. package/pack/.claude/skills/devrites-lib/reference/standards/acceptance-preserving-reslice.md +30 -0
  49. package/pack/.claude/skills/devrites-lib/reference/standards/afk-hitl.md +35 -17
  50. package/pack/.claude/skills/devrites-lib/reference/standards/agents.md +11 -3
  51. package/pack/.claude/skills/devrites-lib/reference/standards/ci-cd.md +19 -0
  52. package/pack/.claude/skills/devrites-lib/reference/standards/code-review.md +1 -1
  53. package/pack/.claude/skills/devrites-lib/reference/standards/core.md +5 -0
  54. package/pack/.claude/skills/devrites-lib/reference/standards/data-integrity.md +95 -0
  55. package/pack/.claude/skills/devrites-lib/reference/standards/developer-experience.md +5 -5
  56. package/pack/.claude/skills/devrites-lib/reference/standards/documentation.md +28 -29
  57. package/pack/.claude/skills/devrites-lib/reference/standards/edge-case-trace.md +70 -10
  58. package/pack/.claude/skills/devrites-lib/reference/standards/integration-reliability.md +79 -0
  59. package/pack/.claude/skills/devrites-lib/reference/standards/loop-operations.md +85 -0
  60. package/pack/.claude/skills/devrites-lib/reference/standards/observability.md +10 -0
  61. package/pack/.claude/skills/devrites-lib/reference/standards/one-shot-actions.md +1 -6
  62. package/pack/.claude/skills/devrites-lib/reference/standards/patterns.md +20 -0
  63. package/pack/.claude/skills/devrites-lib/reference/standards/repository-topology.md +73 -0
  64. package/pack/.claude/skills/devrites-lib/reference/standards/security-checklist.md +6 -2
  65. package/pack/.claude/skills/devrites-lib/reference/standards/security.md +51 -16
  66. package/pack/.claude/skills/devrites-lib/reference/standards/skill-authoring.md +35 -40
  67. package/pack/.claude/skills/devrites-lib/reference/standards/test-proof-checklist.md +4 -0
  68. package/pack/.claude/skills/devrites-lib/reference/standards/testing.md +51 -6
  69. package/pack/.claude/skills/devrites-lib/reference/standards/workflow-artifacts.md +411 -102
  70. package/pack/.claude/skills/rite/SKILL.md +2 -0
  71. package/pack/.claude/skills/rite-adopt/SKILL.md +8 -10
  72. package/pack/.claude/skills/rite-adopt/reference/adoption.md +13 -15
  73. package/pack/.claude/skills/rite-autocomplete/SKILL.md +98 -139
  74. package/pack/.claude/skills/rite-autocomplete/reference/decision-policy.md +11 -5
  75. package/pack/.claude/skills/rite-autocomplete/reference/loop.md +99 -114
  76. package/pack/.claude/skills/rite-autocomplete/reference/stop-conditions.md +92 -124
  77. package/pack/.claude/skills/rite-build/SKILL.md +51 -73
  78. package/pack/.claude/skills/rite-build/reference/phase-contract.md +9 -18
  79. package/pack/.claude/skills/rite-build/reference/wright-dispatch.md +37 -4
  80. package/pack/.claude/skills/rite-clarify/SKILL.md +3 -2
  81. package/pack/.claude/skills/rite-converge/SKILL.md +4 -2
  82. package/pack/.claude/skills/rite-converge/reference/convergence-assessment.md +8 -4
  83. package/pack/.claude/skills/rite-customize/SKILL.md +16 -18
  84. package/pack/.claude/skills/rite-define/SKILL.md +60 -62
  85. package/pack/.claude/skills/rite-define/reference/plan-template.md +88 -71
  86. package/pack/.claude/skills/rite-explain/SKILL.md +2 -1
  87. package/pack/.claude/skills/rite-learn/SKILL.md +28 -32
  88. package/pack/.claude/skills/rite-plan/SKILL.md +53 -56
  89. package/pack/.claude/skills/rite-plan/reference/anti-patterns.md +11 -1
  90. package/pack/.claude/skills/rite-plan/reference/dependency-graph.md +11 -2
  91. package/pack/.claude/skills/rite-plan/reference/replan-and-repair.md +10 -3
  92. package/pack/.claude/skills/rite-plan/reference/task-breakdown.md +2 -0
  93. package/pack/.claude/skills/rite-polish/reference/adr-promotion.md +7 -7
  94. package/pack/.claude/skills/rite-pressure-test/SKILL.md +24 -31
  95. package/pack/.claude/skills/rite-prove/SKILL.md +95 -156
  96. package/pack/.claude/skills/rite-prove/reference/acceptance-proof.md +28 -0
  97. package/pack/.claude/skills/rite-review/SKILL.md +5 -4
  98. package/pack/.claude/skills/rite-review/reference/five-axis-review.md +6 -0
  99. package/pack/.claude/skills/rite-review/reference/security-review.md +7 -2
  100. package/pack/.claude/skills/rite-seal/reference/final-evidence.md +3 -0
  101. package/pack/.claude/skills/rite-seal/reference/risk-and-rollback.md +19 -4
  102. package/pack/.claude/skills/rite-ship/reference/rollout.md +62 -43
  103. package/pack/.claude/skills/rite-spec/SKILL.md +8 -1
  104. package/pack/.claude/skills/rite-spec/reference/ai-spec-template.md +13 -6
  105. package/pack/.claude/skills/rite-spec/reference/spec-checklists.md +14 -2
  106. package/pack/.claude/skills/rite-spec/reference/spec-template.md +33 -4
  107. package/pack/.claude/skills/rite-temper/SKILL.md +5 -1
  108. package/pack/.claude/skills/rite-vet/SKILL.md +121 -174
  109. package/pack/.claude/skills/rite-vet/reference/anti-patterns.md +14 -2
  110. package/pack/.claude/skills/rite-vet/reference/artifacts.md +15 -9
  111. package/pack/.claude/skills/rite-vet/reference/depth.md +10 -3
  112. package/pack/.claude/skills/rite-vet/reference/review-axes.md +75 -77
  113. package/pack/.claude/skills/rite-watch-pr/SKILL.md +85 -0
  114. package/pack/.claude/skills/rite-zoom-out/SKILL.md +4 -5
  115. package/pack/.claude/workflows/devrites-readonly-review.js +194 -0
  116. package/pack/generated/README.md +1 -1
  117. package/pack/generated/claude/agents/devrites-code-reviewer.md +6 -1
  118. package/pack/generated/claude/agents/devrites-plan-drafter.md +5 -0
  119. package/pack/generated/claude/agents/devrites-plan-reviewer.md +6 -0
  120. package/pack/generated/claude/agents/devrites-proof-runner.md +7 -1
  121. package/pack/generated/claude/agents/devrites-retrospector.md +21 -25
  122. package/pack/generated/claude/agents/devrites-security-auditor.md +7 -3
  123. package/pack/generated/claude/agents/devrites-slice-wright.md +30 -4
  124. package/pack/generated/claude/agents/devrites-spec-reviewer.md +5 -0
  125. package/pack/generated/claude/agents/devrites-strategy-reviewer.md +3 -4
  126. package/pack/generated/claude/agents/devrites-test-analyst.md +5 -0
  127. package/pack/generated/claude/skills/devrites-debug-recovery/SKILL.md +13 -26
  128. package/pack/generated/claude/skills/devrites-debug-recovery/reference/build-the-loop.md +11 -14
  129. package/pack/generated/claude/skills/devrites-doubt/SKILL.md +3 -4
  130. package/pack/generated/claude/skills/devrites-frontend-craft/reference/reuse-first.md +3 -4
  131. package/pack/generated/claude/skills/devrites-lib/reference/standards/README.md +5 -1
  132. package/pack/generated/claude/skills/devrites-lib/reference/standards/acceptance-preserving-reslice.md +30 -0
  133. package/pack/generated/claude/skills/devrites-lib/reference/standards/afk-hitl.md +35 -17
  134. package/pack/generated/claude/skills/devrites-lib/reference/standards/agents.md +11 -3
  135. package/pack/generated/claude/skills/devrites-lib/reference/standards/ci-cd.md +19 -0
  136. package/pack/generated/claude/skills/devrites-lib/reference/standards/code-review.md +1 -1
  137. package/pack/generated/claude/skills/devrites-lib/reference/standards/core.md +5 -0
  138. package/pack/generated/claude/skills/devrites-lib/reference/standards/data-integrity.md +95 -0
  139. package/pack/generated/claude/skills/devrites-lib/reference/standards/developer-experience.md +5 -5
  140. package/pack/generated/claude/skills/devrites-lib/reference/standards/documentation.md +28 -29
  141. package/pack/generated/claude/skills/devrites-lib/reference/standards/edge-case-trace.md +70 -10
  142. package/pack/generated/claude/skills/devrites-lib/reference/standards/integration-reliability.md +79 -0
  143. package/pack/generated/claude/skills/devrites-lib/reference/standards/loop-operations.md +85 -0
  144. package/pack/generated/claude/skills/devrites-lib/reference/standards/observability.md +10 -0
  145. package/pack/generated/claude/skills/devrites-lib/reference/standards/one-shot-actions.md +1 -6
  146. package/pack/generated/claude/skills/devrites-lib/reference/standards/patterns.md +20 -0
  147. package/pack/generated/claude/skills/devrites-lib/reference/standards/repository-topology.md +73 -0
  148. package/pack/generated/claude/skills/devrites-lib/reference/standards/security-checklist.md +6 -2
  149. package/pack/generated/claude/skills/devrites-lib/reference/standards/security.md +51 -16
  150. package/pack/generated/claude/skills/devrites-lib/reference/standards/skill-authoring.md +35 -40
  151. package/pack/generated/claude/skills/devrites-lib/reference/standards/test-proof-checklist.md +4 -0
  152. package/pack/generated/claude/skills/devrites-lib/reference/standards/testing.md +51 -6
  153. package/pack/generated/claude/skills/devrites-lib/reference/standards/workflow-artifacts.md +411 -102
  154. package/pack/generated/claude/skills/rite/SKILL.md +2 -0
  155. package/pack/generated/claude/skills/rite-adopt/SKILL.md +8 -10
  156. package/pack/generated/claude/skills/rite-adopt/reference/adoption.md +13 -15
  157. package/pack/generated/claude/skills/rite-autocomplete/SKILL.md +98 -139
  158. package/pack/generated/claude/skills/rite-autocomplete/reference/decision-policy.md +11 -5
  159. package/pack/generated/claude/skills/rite-autocomplete/reference/loop.md +99 -114
  160. package/pack/generated/claude/skills/rite-autocomplete/reference/stop-conditions.md +92 -124
  161. package/pack/generated/claude/skills/rite-build/SKILL.md +51 -73
  162. package/pack/generated/claude/skills/rite-build/reference/phase-contract.md +9 -18
  163. package/pack/generated/claude/skills/rite-build/reference/wright-dispatch.md +37 -4
  164. package/pack/generated/claude/skills/rite-clarify/SKILL.md +3 -2
  165. package/pack/generated/claude/skills/rite-converge/SKILL.md +4 -2
  166. package/pack/generated/claude/skills/rite-converge/reference/convergence-assessment.md +8 -4
  167. package/pack/generated/claude/skills/rite-customize/SKILL.md +16 -18
  168. package/pack/generated/claude/skills/rite-define/SKILL.md +60 -62
  169. package/pack/generated/claude/skills/rite-define/reference/plan-template.md +88 -71
  170. package/pack/generated/claude/skills/rite-explain/SKILL.md +2 -1
  171. package/pack/generated/claude/skills/rite-learn/SKILL.md +28 -32
  172. package/pack/generated/claude/skills/rite-plan/SKILL.md +53 -56
  173. package/pack/generated/claude/skills/rite-plan/reference/anti-patterns.md +11 -1
  174. package/pack/generated/claude/skills/rite-plan/reference/dependency-graph.md +11 -2
  175. package/pack/generated/claude/skills/rite-plan/reference/replan-and-repair.md +10 -3
  176. package/pack/generated/claude/skills/rite-plan/reference/task-breakdown.md +2 -0
  177. package/pack/generated/claude/skills/rite-polish/reference/adr-promotion.md +7 -7
  178. package/pack/generated/claude/skills/rite-pressure-test/SKILL.md +24 -31
  179. package/pack/generated/claude/skills/rite-prove/SKILL.md +95 -156
  180. package/pack/generated/claude/skills/rite-prove/reference/acceptance-proof.md +28 -0
  181. package/pack/generated/claude/skills/rite-review/SKILL.md +5 -4
  182. package/pack/generated/claude/skills/rite-review/reference/five-axis-review.md +6 -0
  183. package/pack/generated/claude/skills/rite-review/reference/security-review.md +7 -2
  184. package/pack/generated/claude/skills/rite-seal/reference/final-evidence.md +3 -0
  185. package/pack/generated/claude/skills/rite-seal/reference/risk-and-rollback.md +19 -4
  186. package/pack/generated/claude/skills/rite-ship/reference/rollout.md +62 -43
  187. package/pack/generated/claude/skills/rite-spec/SKILL.md +8 -1
  188. package/pack/generated/claude/skills/rite-spec/reference/ai-spec-template.md +13 -6
  189. package/pack/generated/claude/skills/rite-spec/reference/spec-checklists.md +14 -2
  190. package/pack/generated/claude/skills/rite-spec/reference/spec-template.md +33 -4
  191. package/pack/generated/claude/skills/rite-temper/SKILL.md +5 -1
  192. package/pack/generated/claude/skills/rite-vet/SKILL.md +121 -174
  193. package/pack/generated/claude/skills/rite-vet/reference/anti-patterns.md +14 -2
  194. package/pack/generated/claude/skills/rite-vet/reference/artifacts.md +15 -9
  195. package/pack/generated/claude/skills/rite-vet/reference/depth.md +10 -3
  196. package/pack/generated/claude/skills/rite-vet/reference/review-axes.md +75 -77
  197. package/pack/generated/claude/skills/rite-watch-pr/SKILL.md +85 -0
  198. package/pack/generated/claude/skills/rite-zoom-out/SKILL.md +4 -5
  199. package/pack/generated/claude/workflows/devrites-readonly-review.js +194 -0
  200. package/pack/generated/codex/agents/devrites-code-reviewer.toml +6 -1
  201. package/pack/generated/codex/agents/devrites-plan-drafter.toml +5 -0
  202. package/pack/generated/codex/agents/devrites-plan-reviewer.toml +6 -0
  203. package/pack/generated/codex/agents/devrites-proof-runner.toml +7 -1
  204. package/pack/generated/codex/agents/devrites-retrospector.toml +21 -25
  205. package/pack/generated/codex/agents/devrites-security-auditor.toml +7 -3
  206. package/pack/generated/codex/agents/devrites-slice-wright.toml +30 -4
  207. package/pack/generated/codex/agents/devrites-spec-reviewer.toml +5 -0
  208. package/pack/generated/codex/agents/devrites-strategy-reviewer.toml +3 -4
  209. package/pack/generated/codex/agents/devrites-test-analyst.toml +5 -0
  210. package/pack/generated/codex/skills/devrites-debug-recovery/SKILL.md +13 -26
  211. package/pack/generated/codex/skills/devrites-debug-recovery/reference/build-the-loop.md +11 -14
  212. package/pack/generated/codex/skills/devrites-doubt/SKILL.md +3 -4
  213. package/pack/generated/codex/skills/devrites-frontend-craft/reference/reuse-first.md +3 -4
  214. package/pack/generated/codex/skills/devrites-lib/reference/standards/README.md +5 -1
  215. package/pack/generated/codex/skills/devrites-lib/reference/standards/acceptance-preserving-reslice.md +30 -0
  216. package/pack/generated/codex/skills/devrites-lib/reference/standards/afk-hitl.md +35 -17
  217. package/pack/generated/codex/skills/devrites-lib/reference/standards/agents.md +11 -3
  218. package/pack/generated/codex/skills/devrites-lib/reference/standards/ci-cd.md +19 -0
  219. package/pack/generated/codex/skills/devrites-lib/reference/standards/code-review.md +1 -1
  220. package/pack/generated/codex/skills/devrites-lib/reference/standards/core.md +5 -0
  221. package/pack/generated/codex/skills/devrites-lib/reference/standards/data-integrity.md +95 -0
  222. package/pack/generated/codex/skills/devrites-lib/reference/standards/developer-experience.md +5 -5
  223. package/pack/generated/codex/skills/devrites-lib/reference/standards/documentation.md +28 -29
  224. package/pack/generated/codex/skills/devrites-lib/reference/standards/edge-case-trace.md +70 -10
  225. package/pack/generated/codex/skills/devrites-lib/reference/standards/integration-reliability.md +79 -0
  226. package/pack/generated/codex/skills/devrites-lib/reference/standards/loop-operations.md +85 -0
  227. package/pack/generated/codex/skills/devrites-lib/reference/standards/observability.md +10 -0
  228. package/pack/generated/codex/skills/devrites-lib/reference/standards/one-shot-actions.md +1 -6
  229. package/pack/generated/codex/skills/devrites-lib/reference/standards/patterns.md +20 -0
  230. package/pack/generated/codex/skills/devrites-lib/reference/standards/repository-topology.md +73 -0
  231. package/pack/generated/codex/skills/devrites-lib/reference/standards/security-checklist.md +6 -2
  232. package/pack/generated/codex/skills/devrites-lib/reference/standards/security.md +51 -16
  233. package/pack/generated/codex/skills/devrites-lib/reference/standards/skill-authoring.md +35 -40
  234. package/pack/generated/codex/skills/devrites-lib/reference/standards/test-proof-checklist.md +4 -0
  235. package/pack/generated/codex/skills/devrites-lib/reference/standards/testing.md +51 -6
  236. package/pack/generated/codex/skills/devrites-lib/reference/standards/workflow-artifacts.md +411 -102
  237. package/pack/generated/codex/skills/rite/SKILL.md +2 -0
  238. package/pack/generated/codex/skills/rite-adopt/SKILL.md +8 -10
  239. package/pack/generated/codex/skills/rite-adopt/reference/adoption.md +13 -15
  240. package/pack/generated/codex/skills/rite-autocomplete/SKILL.md +98 -139
  241. package/pack/generated/codex/skills/rite-autocomplete/reference/decision-policy.md +11 -5
  242. package/pack/generated/codex/skills/rite-autocomplete/reference/loop.md +99 -114
  243. package/pack/generated/codex/skills/rite-autocomplete/reference/stop-conditions.md +92 -124
  244. package/pack/generated/codex/skills/rite-build/SKILL.md +51 -73
  245. package/pack/generated/codex/skills/rite-build/reference/phase-contract.md +9 -18
  246. package/pack/generated/codex/skills/rite-build/reference/wright-dispatch.md +37 -4
  247. package/pack/generated/codex/skills/rite-clarify/SKILL.md +3 -2
  248. package/pack/generated/codex/skills/rite-converge/SKILL.md +4 -2
  249. package/pack/generated/codex/skills/rite-converge/reference/convergence-assessment.md +8 -4
  250. package/pack/generated/codex/skills/rite-customize/SKILL.md +16 -18
  251. package/pack/generated/codex/skills/rite-define/SKILL.md +60 -62
  252. package/pack/generated/codex/skills/rite-define/reference/plan-template.md +88 -71
  253. package/pack/generated/codex/skills/rite-explain/SKILL.md +2 -1
  254. package/pack/generated/codex/skills/rite-learn/SKILL.md +28 -32
  255. package/pack/generated/codex/skills/rite-plan/SKILL.md +53 -56
  256. package/pack/generated/codex/skills/rite-plan/reference/anti-patterns.md +11 -1
  257. package/pack/generated/codex/skills/rite-plan/reference/dependency-graph.md +11 -2
  258. package/pack/generated/codex/skills/rite-plan/reference/replan-and-repair.md +10 -3
  259. package/pack/generated/codex/skills/rite-plan/reference/task-breakdown.md +2 -0
  260. package/pack/generated/codex/skills/rite-polish/reference/adr-promotion.md +7 -7
  261. package/pack/generated/codex/skills/rite-pressure-test/SKILL.md +24 -31
  262. package/pack/generated/codex/skills/rite-prove/SKILL.md +95 -156
  263. package/pack/generated/codex/skills/rite-prove/reference/acceptance-proof.md +28 -0
  264. package/pack/generated/codex/skills/rite-review/SKILL.md +5 -4
  265. package/pack/generated/codex/skills/rite-review/reference/five-axis-review.md +6 -0
  266. package/pack/generated/codex/skills/rite-review/reference/security-review.md +7 -2
  267. package/pack/generated/codex/skills/rite-seal/reference/final-evidence.md +3 -0
  268. package/pack/generated/codex/skills/rite-seal/reference/risk-and-rollback.md +19 -4
  269. package/pack/generated/codex/skills/rite-ship/reference/rollout.md +62 -43
  270. package/pack/generated/codex/skills/rite-spec/SKILL.md +8 -1
  271. package/pack/generated/codex/skills/rite-spec/reference/ai-spec-template.md +13 -6
  272. package/pack/generated/codex/skills/rite-spec/reference/spec-checklists.md +14 -2
  273. package/pack/generated/codex/skills/rite-spec/reference/spec-template.md +33 -4
  274. package/pack/generated/codex/skills/rite-temper/SKILL.md +5 -1
  275. package/pack/generated/codex/skills/rite-vet/SKILL.md +121 -174
  276. package/pack/generated/codex/skills/rite-vet/reference/anti-patterns.md +14 -2
  277. package/pack/generated/codex/skills/rite-vet/reference/artifacts.md +15 -9
  278. package/pack/generated/codex/skills/rite-vet/reference/depth.md +10 -3
  279. package/pack/generated/codex/skills/rite-vet/reference/review-axes.md +75 -77
  280. package/pack/generated/codex/skills/rite-watch-pr/SKILL.md +85 -0
  281. package/pack/generated/codex/skills/rite-zoom-out/SKILL.md +4 -5
  282. package/package.json +1 -1
  283. package/scripts/build-host-artifacts.sh +3 -1
@@ -7,168 +7,107 @@ user-invocable: true
7
7
 
8
8
  # $rite-prove: prove the completed feature
9
9
 
10
- Prove the **whole feature**. Read the active workspace; if absent, run
11
- `$rite-spec <feature>`.
10
+ Read the active workspace and prove the whole assembled feature once. Without
11
+ one, use `/verify` or `/run`; if any task is pending, stop for `$rite-build`.
12
+ Never report an unobserved pass. After Polish/Review code edits, repeat affected
13
+ criteria and bind evidence to the changed candidate digest.
12
14
 
13
- > **Scope:** `/verify` proves one change; `/run` launches the app. `$rite-prove`
14
- > walks feature acceptance, relevant suite/build/typecheck/lint, and browser
15
- > proof, writing evidence under the active workspace. Without one, use
16
- > `/verify` or `/run`.
15
+ ## Rules
17
16
 
18
- ## Gate: all slices must be built first
19
- Read `tasks.md` + `state.md`. If any slice is pending, stop for `$rite-build`.
20
- This phase proves the assembled feature once, after per-slice tests.
21
-
22
- **Never report an unobserved pass.** If a command could not run, report that and give
23
- exact manual steps.
24
-
25
- After polish/review edits, rerun affected criteria/routes so evidence binds the
26
- changed candidate digest before Seal.
27
-
28
- ## Rules consulted (read on demand from `.agents/skills/devrites-lib/reference/standards/`)
29
- Pull these via `Read` when relevant:
30
- - `testing.md`: pyramid, determinism, no-flake discipline.
31
- - `test-proof-checklist.md`: compact proof-quality gate for tests and recorded evidence.
32
- - `browser-proof-checklist.md`: required UI states and Visual Verdict evidence.
33
- - `spec-grammar.md`: when the spec uses structured `### Requirement:` / `#### Scenario:`
34
- blocks, each scenario (WHEN/THEN) is one observable behavior to walk and prove.
35
- - `performance.md`: measure first when perf is in scope.
36
- - `observability.md`: runtime telemetry must be observed to emit.
37
- - `developer-experience.md`: when the change ships a developer-facing surface (API / CLI / SDK /
38
- webhook / config / error messages / getting-started): **measure** the DX scorecard (run the flow,
39
- measure time-to-hello-world, and capture verbatim error text), rather than asserting it.
40
- - `definition-of-done.md`: acceptance, proof, gates, scope, rollback/docs.
41
- - `one-shot-actions.md`: pre-attempt evidence completeness and no-rerun handling for
42
- consumptive proof actions.
43
- - `workflow-artifacts.md`: exact root-owned executable proof/controller/harness
44
- artifacts under the active feature workspace.
45
-
46
-
47
- ## Operating rules
48
- - Evidence over confidence. Feature scope only: fix within the feature or record a
49
- blocker; don't refactor unrelated code.
50
- - Apply `testing.md`'s positive, discriminating proof rule to every behavioral claim.
51
- A green command without an executing assertion and decisive observed signal is unproven.
52
- - Follow the shared
53
- [`candidate-integrity.md`](../devrites-lib/reference/candidate-integrity.md).
54
- Prove owns proof binding, not manifest grammar or candidate hashing.
55
- - Spec Drift Guard applies: if tests/evidence reveal the spec is wrong, stop and handle
56
- drift (`rite-build/reference/spec-drift-guard.md`).
57
- - **Root executes; runner validates; root records; wright fixes.** Use the native
58
- fresh-context contract in
59
- [`agents.md`](../devrites-lib/reference/standards/agents.md). The root owns exact
60
- vetted gate execution, browser capability, the evidence verdict, and canonical
61
- writes. The proof runner is read-only and validates immutable logs/artifacts.
62
- Every accepted product source/test correction is one bounded
63
- `devrites-slice-wright` task, never an inline edit.
64
- Exact Vet-ready executable workflow artifacts under the active `.devrites/**`
65
- workspace follow `workflow-artifacts.md` and are materialized by the controlling
66
- root; they are not product writer work.
67
- - **Prove remains the controlling caller during technical backtracking.** Save
68
- its return cursor, invoke Plan/Vet or bounded remediation inline, consume each
69
- nested phase boundary, then resume the failed Prove step. Never make the human
70
- submit an agent-owned repair, re-vet, or proof-rerun command. Apply `afk-hitl.md`
71
- progress accounting: only three no-progress attempts on the exact same fingerprint
72
- exhaust recovery; a closed prior finding or a genuinely new
73
- Critical/Important fingerprint continues inside this invocation.
17
+ Read the applicable standards: `testing.md`, `test-proof-checklist.md`,
18
+ `browser-proof-checklist.md` for UI, `spec-grammar.md`, `performance.md`,
19
+ `observability.md`, topology/data/integration rules named by the plan,
20
+ `developer-experience.md`, `definition-of-done.md`, `one-shot-actions.md`, and
21
+ `workflow-artifacts.md`. Developer surfaces require an observed flow, measured
22
+ TTHW, and exact signal-bearing errors; never assert DX.
74
23
 
24
+ - Evidence over confidence. Apply positive, discriminating proof to every
25
+ behavioral claim; a green command without executing assertion and decisive
26
+ signal is unproven.
27
+ - Follow `candidate-integrity.md`. Prove owns proof binding, not candidate
28
+ grammar/hashing. Spec Drift Guard owns revealed contract drift.
29
+ - Root executes vetted gates/browser and records evidence. A read-only proof
30
+ runner validates immutable evidence. The sole bounded wright fixes product
31
+ source/tests; root never does.
32
+ - **Prove remains the controlling caller** during technical backtracking. Save
33
+ its cursor; run Plan repair, Recovery Vet, remediation, and re-proof inline;
34
+ consume nested boundaries; resume the failed rung. Recovery exhausts after
35
+ three no-progress attempts on the exact same fingerprint. Closing one or exposing a distinct
36
+ Critical/Important invariant is progress, not a reason to hand work off.
37
+ <!-- workflow-artifact-adapter: {"module":"devrites-lib/reference/standards/workflow-artifacts.md","entry":"Prove consumes installed Workflow Artifact or CLEANED rerun","action":"VERIFY_EXISTING or admitted proof path ending PROVE_AND_RETURN","return":"saved Prove cursor; stop before real action"} -->
75
38
  ## Released-workspace refresh entry
76
39
 
77
- Only an admitted `$rite-upgrade` assessment that proves a released-format candidate
78
- defect may enter this branch. Normal Prove never reconstructs candidate scope.
79
-
80
- Before proof, require that the legacy touched-file scope, live diff, tasks, and traceability agree unambiguously on every candidate path and state. Missing, unknown, or
81
- ambiguous scope is a recorded gap and HITL stop; never guess from Git alone. When they
82
- agree, preserve unrelated `touched-files.md` content and refresh only its strict manifest
83
- from the currently observed project bytes under the workspace schema.
40
+ Only an admitted `$rite-upgrade` assessment proving a released-format candidate
41
+ defect enters. Require legacy touched-file scope, live diff, tasks, and traceability agree unambiguously
42
+ on every candidate path/state. Missing or
43
+ ambiguous scope stops; never guess from Git. Preserve unrelated manifest content
44
+ and refresh only the strict manifest from observed bytes.
84
45
 
85
- Discard every old pass as proof. Run all current approved real proof from scratch under
86
- the positive, discriminating rules below, and establish the pre-proof and post-proof engine digest
87
- with `devrites-engine check candidate <slug>`. Require an identical digest,
88
- then write one fresh exact binding in `evidence.md` and in `browser-evidence.md` when it
89
- exists. Historical evidence cannot substitute for any current gate. A current proof
90
- failure is a blocker; this Upgrade admission never authorizes source or test changes.
46
+ Discard old passes. Run all current approved real proof from scratch. Establish
47
+ pre-proof and post-proof engine digest with `devrites-engine check candidate
48
+ <slug>` and require equality, then write one fresh exact binding in evidence and
49
+ browser evidence. Current failure blocks; Upgrade does not authorize source or
50
+ test changes.
91
51
 
92
52
  ## Workflow
93
- 0. Read core, load relevant rules above, then resolve the active slug,
94
- require its `state.md`, and read the cursor directly. On a blocked Prove cold
95
- resume, reconcile any retained consumptive-action artifact against recorded
96
- no-progress corrections before accepting `next_action: none`; a distinct
97
- fingerprint below its cap resumes offline triage without another real action.
98
- 1. **Confirm all slices built.** Read `spec.md`, `tasks.md`, `state.md`,
99
- `test-plan.md`, and the full diff.
100
- A missing `test-plan.md` enters caller-owned Vet backtracking; invoke Vet
101
- inline and resume this step. It never authorizes ad hoc proof.
102
- 2. **Discover commands** if not recorded:
103
- [test-command-discovery](reference/test-command-discovery.md): README, package
104
- scripts, Makefile, CI configs, Gemfile/Rakefile, pyproject, go.mod, Cargo.toml.
105
- Discovery only supplies evidence. `test-plan.md` is the sole approved runtime
106
- command list. If a discovered command is absent from it, do not run or
107
- silently approve the command: return to the current Vet contract to add and
108
- vet it inline, refresh readiness, then return to Prove without a user handoff.
109
- **Completion:** exact commands are approved in `test-plan.md` or unavailable.
110
- 3. **Execute proof against a frozen candidate.** Run
111
- `devrites-engine check candidate <slug>` before any approved proof and retain
112
- its exact digest. The root runs only commands declared by `test-plan.md`,
113
- byte-for-byte, with exact cwd and prerequisites, capturing exit code and
114
- decisive output in secure external scratch. Run the full relevant test suite
115
- plus **build / typecheck / lint**. Then rerun the candidate check: require the
116
- identical digest and no candidate-source mutation. Reject synthesized or
117
- substituted commands, malformed manifests, zero-test/skipped/filtered results used as
118
- behavioral proof, success inferred only from exit status, and any source drift. Static
119
- gates prove only their named static criterion.
120
- Immediately before any consumptive action, apply `one-shot-actions.md` to the
121
- live candidate: require the vetted retained-artifact identity, bounds,
122
- sanitization, injective boundary map, per-seam fault fixtures, collision mutant,
123
- terminal-path fixtures, and cleanup-survival proof. A missing,
124
- stale, or disposable-only evidence surface returns to Vet inline and consumes
125
- no attempt. Record the admitted artifact identity before execution. After a
126
- failed consumptive action, triage from that artifact; never reproduce it by
127
- rerunning the action. Consuming its authorization blocks only another real
128
- execution. If the artifact identifies a new Critical/Important fingerprint,
129
- continue offline recovery inside this Prove invocation; do not label the new
130
- fingerprint exhausted because the action budget is zero.
131
- 4. **UI feature?** The root applies the browser proof ladder with
132
- `design-brief.md`, `references.md`, the requested routes, browser harness, and
133
- allowed scratch path:
134
- [proof-ladder](reference/proof-ladder.md) + [browser-proof](reference/browser-proof.md)
135
- (`devrites-browser-proof`): routes, viewports, screenshots (opened + described),
136
- console, network, interaction paths, and the brief's proof targets. Compare screenshots
137
- with target references and record deltas. An unresolved material mismatch is a failed
138
- result; the root handles any accepted correction at step 7 before re-rendering.
139
- 5. **Validate proof in fresh context.** In parallel, dispatch the exact read-only
140
- `devrites-proof-runner` on candidate identity, approved commands, immutable
141
- root evidence, and acceptance map, and `devrites-spec-reviewer` on the same
142
- candidate. Wait for both; reject missing/stale, invented-ID, label-only, or
143
- self-attested evidence. Neither executes commands.
144
- 6. **Map proof completely.** Reconcile both exact verdicts, then follow
145
- [`reference/acceptance-proof.md`](reference/acceptance-proof.md) for acceptance/scenario
146
- coverage and the conditional critical-path, observability, developer-surface, and wiring
147
- branches. Completion: every criterion, planned interaction, and declared key link has a
148
- proof class plus positive, discriminating passing evidence, or is recorded as a blocker.
149
- 7. **On failure** → [failure-triage](reference/failure-triage.md) +
150
- `devrites-debug-recovery`. The root reconciles the reproduction. Send an accepted,
151
- in-scope correction to the sole writer, `devrites-slice-wright`; update the
152
- manifest from its actual scoped diff, rerun affected real proof and both
153
- candidate checks, then dispatch a fresh proof runner. If a fix would exceed
154
- scope, record a blocker.
155
- If triage shows an agent-owned durable-plan error, apply the Spec Drift
156
- Guard's inline return contract: preserve Prove as the origin, run repair and
157
- Vet inside this invocation, and resume the exact failed proof rung. Ask only
158
- for a human-owned decision; causal-fingerprint exhaustion stops once with a
159
- technical blocker rather than another phase command.
160
- For a consumptive-action failure, use fixtures or another non-consumptive
161
- reproduction to fix and re-vet the retained fingerprint. Once the failure
162
- condition is demonstrably changed, stop at the fresh-authorization boundary;
163
- only a new human GO may admit the next real attempt.
164
- If the retained fingerprint is missing or ambiguous, the lost past evidence
165
- does not prove that no safe future acquisition design exists. Treat an in-scope
166
- discriminator as a diagnostic-amplification Plan gap: repair and narrow-Vet the
167
- boundary map and collision proof inline, then stop for fresh GO before one
168
- evidence-acquisition attempt. Do not guess the runtime fix or reuse the old GO.
169
- 8. The root updates `evidence.md`, `browser-evidence.md` (when present),
170
- `traceability.md`, and `state.md`. Record exactly one binding for the observed
171
- digest in evidence and browser evidence. New proof goes to canonical
172
- `evidence.md`.
173
53
 
174
- > **Mid-flight discipline.** When tempted to claim an un-observed pass, skip a rung of the browser-proof ladder, or proceed with slices pending: see [`anti-patterns`](reference/anti-patterns.md). Load it the moment you reach for the excuse.
54
+ 1. **Orient.** Read core, resolve active slug, require `state.md`, and read its
55
+ cursor. On blocked Prove cold resume, reconcile retained consumptive evidence
56
+ and no-progress corrections before accepting terminal none; a distinct
57
+ fingerprint below cap resumes offline triage without another real action.
58
+ 2. **Freeze scope.** Read spec, tasks, state, test plan, and full diff. Require
59
+ every slice built. Missing `test-plan.md` invokes caller-owned Vet and returns
60
+ here; it never authorizes ad hoc proof.
61
+ 3. **Approve commands.** If absent, use
62
+ [test-command-discovery](reference/test-command-discovery.md) over repository
63
+ manifests/CI. Discovery is evidence only: `test-plan.md` is the sole approved runtime
64
+ command list. A newly found command must return to the current Vet contract,
65
+ refresh readiness, then resume without user handoff.
66
+ 4. **Execute a frozen candidate.** Run candidate check and retain its digest.
67
+ The root runs only commands declared by `test-plan.md`, with exact approved
68
+ command, cwd, prerequisites, exit, and sanitized
69
+ decisive output. Run relevant suite plus build/typecheck/lint. Recheck the
70
+ candidate and require identical digest/no source mutation. Reject substituted
71
+ commands, malformed manifests, zero-test/skipped/filtered behavioral claims,
72
+ exit-status-only claims, and source drift. Static gates prove only their named
73
+ static criterion.
74
+ 5. **Gate consumptive actions.** Immediately before execution, apply
75
+ `one-shot-actions.md`: current retained identity, bounds/sanitization,
76
+ injective boundary map, per-seam fault fixtures, collision mutant, terminal
77
+ fixtures, and cleanup-survival proof must be green. Missing/stale/disposable-
78
+ only evidence returns to Vet without spending an attempt. Record the admitted artifact identity before execution.
79
+ After failure, retained evidence is the
80
+ reproduction; never rerun for diagnosis. Spent authorization blocks another
81
+ action, but when action budget is zero it does not exhaust a newly identified
82
+ offline fingerprint.
83
+ 6. **Prove UI when applicable.** Use design brief/references, browser harness,
84
+ allowed scratch path, [proof ladder](reference/proof-ladder.md), and
85
+ [browser proof](reference/browser-proof.md): routes, viewports, opened and
86
+ described screenshots, console/network, interaction, target comparisons, and
87
+ every required state. Material mismatch fails.
88
+ 7. **Independent validation.** Dispatch exact fresh read-only
89
+ `devrites-proof-runner` and `devrites-spec-reviewer` on the same candidate,
90
+ commands, immutable evidence, and acceptance map. Reject missing/stale,
91
+ invented-ID, label-only, or self-attested reports; neither executes commands.
92
+ 8. **Map proof.** Reconcile both verdicts and
93
+ [acceptance-proof.md](reference/acceptance-proof.md). Every criterion,
94
+ scenario, interaction, and planned key link gets positive discriminating
95
+ evidence or a blocker, including applicable critical-path, observability,
96
+ developer, and wiring branches.
97
+ 9. **Recover red.** Use [failure triage](reference/failure-triage.md) and Debug
98
+ Recovery. Reconcile reproduction; send accepted in-scope source/test correction
99
+ to the sole wright; update actual manifest; rerun affected proof, both candidate
100
+ checks, and fresh proof runner. Scope growth blocks.
101
+
102
+ Agent-owned durable-plan errors run Spec Drift Guard, Plan, and Vet inline,
103
+ preserving Prove as origin. Consumptive failures use retained fixtures, repair,
104
+ and Vet, then stop for fresh GO after changed conditions. Ambiguous retained
105
+ evidence does not prove that no safe future acquisition design exists: treat
106
+ an in-scope discriminator as diagnostic-amplification Plan gap, repair its
107
+ finite map/collision proof, narrow-Vet, then seek fresh GO before one evidence
108
+ attempt. Never guess the runtime fix or reuse old GO.
109
+ 10. **Record.** Root updates `evidence.md`, optional `browser-evidence.md`,
110
+ traceability, and state, with exactly one observed candidate binding.
111
+
112
+ > Do not claim an unobserved pass, skip browser proof, or proceed with pending
113
+ > slices. Load `reference/anti-patterns.md` when tempted to do so.
@@ -25,6 +25,23 @@ Undefined/unavailable signal: `cannot_verify`, evidence
25
25
  `insufficient_spec: <missing fact or evidence surface>`, then Spec Drift; never
26
26
  judgment or pass.
27
27
 
28
+ ## Applicable system-risk proof
29
+
30
+ Reconcile `spec.md`'s applicability map with the final diff. For each triggered owner:
31
+
32
+ - `repository-topology.md`: prove commands ran at every affected root and both provider
33
+ and consumer used the same canonical contract; identify generated/vendor sources.
34
+ - `data-integrity.md`: prove declared invariants plus relevant duplicate/retry,
35
+ concurrency, interruption/resume, old/new coexistence, tenant isolation, and
36
+ rollback/forward-recovery cases with recorded scale/counts.
37
+ - `integration-reliability.md`: prove relevant invalid/partial response, auth failure,
38
+ timeout/unknown outcome, rate limit/outage, duplicate/order, poison/backlog, cache/partition,
39
+ degradation, and recovery behavior.
40
+
41
+ An evidence-backed dismissal is valid for an irrelevant case. An applicable case with no
42
+ executable proof surface is `cannot_verify`; do not infer it from an implementation review
43
+ or a mock that cannot produce the risk.
44
+
28
45
  ## Critical-path assertion strength
29
46
 
30
47
  For regression-Critical, irreversible, and data-loss paths, inject a small break,
@@ -49,3 +66,14 @@ Browser-capture docs/quickstarts when applicable. Write the scorecard to
49
66
 
50
67
  Exercise/follow every key `plan.md` link in the assembled feature; record each as
51
68
  `EVID-###`, or record none declared. An unwired link blocks.
69
+
70
+ For every critical link, perturb or break the load-bearing input/link and observe the
71
+ promised surface fail. Existence/registration/spy-call evidence is insufficient when a
72
+ different path can coincidentally produce the expected result.
73
+
74
+ ## Baseline and environment claims
75
+
76
+ Classify a failure as pre-existing or environment-specific only with a dated
77
+ before-candidate result for the same command, working directory, prerequisites, and
78
+ material environment. Otherwise record it as an unresolved candidate result. For time/local
79
+ behavior, bind the instant, time zone, locale, and relevant old/new configuration.
@@ -28,6 +28,8 @@ Pull these via `Read` when the diff demands them:
28
28
  - `agents.md`: when to fan out to which review subagent.
29
29
  - `security.md`: when input / auth / data / integrations / secrets are in scope.
30
30
  - `security-checklist.md`: for the same security-sensitive scope, the compact trust-boundary sweep.
31
+ - `repository-topology.md`, `data-integrity.md`, `integration-reliability.md`: only
32
+ when the spec applicability map or final diff triggers their ownership/failure/proof checks.
31
33
  - `performance.md`: only when perf is relevant or a regression risk is visible.
32
34
 
33
35
  ## Operating rules
@@ -53,10 +55,9 @@ Pull these via `Read` when the diff demands them:
53
55
  1. Read `spec.md`, `tasks.md`, `state.md`, `decisions.md`, `evidence.md`,
54
56
  `touched-files.md`, `.devrites/principles.md` (if present: the binding invariants to score
55
57
  the diff against), and the `git diff`. For "what would this change break"
56
- questions, prefer a code-intelligence index if available (codebase-memory-mcp first,
57
- cross-checked with codegraph + graphify, else standard methods (LSP / Read/Grep/Glob); see
58
- `.agents/skills/devrites-lib/reference/standards/tooling.md`) over file reads;
59
- they answer impact/callers in one call. When a finding hinges on an external library's
58
+ questions, apply `.agents/skills/devrites-lib/reference/standards/tooling.md`: use
59
+ the primary available index and cross-check only one named unresolved predicate before
60
+ falling back to LSP/file search. When a finding hinges on an external library's
60
61
  current API, context7 if available can confirm the signature. Run
61
62
  `devrites-engine check candidate <slug>` and require its digest to match the
62
63
  single `evidence.md` binding and the `browser-evidence.md` binding when that
@@ -11,11 +11,15 @@ is complete, and to scope anything the agent could not (e.g. UI-only lenses belo
11
11
  - Do tests exist for the changed behavior, and do they prove the acceptance criteria?
12
12
  - Would they fail if the code were wrong? (No assertion-free or tautological tests.)
13
13
  - Edge cases: empty, boundary, error, permission-denied, concurrency.
14
+ - Applicable data/integration/topology cases use a risk-capable boundary; no
15
+ risk-erasing mock, one-tenant isolation claim, or one-root proof for another root.
14
16
 
15
17
  ## 1. Correctness
16
18
  - Does it do what the spec says? Off-by-one, null/undefined, error paths, race
17
19
  conditions, incorrect assumptions about inputs.
18
20
  - Does it handle the states the slice promised (loading/empty/error for UI)?
21
+ - Does retry/interruption converge without duplicate effects; do partial/unknown external
22
+ outcomes, migrations, old/new versions, tenant scope, and rollback follow the accepted plan?
19
23
 
20
24
  ## 2. Readability
21
25
  - Can the next engineer understand it without the author? Naming, function length,
@@ -35,6 +39,8 @@ is complete, and to scope anything the agent could not (e.g. UI-only lenses belo
35
39
  dispatcher, separate orchestration from business logic, move feature logic to its owning
36
40
  package, delete a pass-through wrapper, split a large file. Prefer the move that removes
37
41
  moving pieces over one that re-centralizes the same complexity.
42
+ - Are repository/deployable roots, canonical contract and mutable-state owners, shared
43
+ resources, and synchronous/asynchronous consistency boundaries preserved without a cycle?
38
44
 
39
45
  ## 4. Security
40
46
  - Trust boundaries, input validation, authz checks, secrets handling. Hand off to
@@ -12,7 +12,8 @@ This is the **single-sourced OWASP-web checklist** both `$rite-review` and the
12
12
  - **Injection:** parameterized queries; no string-built SQL/shell/HTML; validate &
13
13
  encode at boundaries.
14
14
  - **Broken access control:** every sensitive action checks authz server-side; no
15
- trusting client-supplied IDs/roles; no IDOR.
15
+ trusting client-supplied IDs/roles/tenant; no IDOR, cross-tenant read/write/cache/search,
16
+ confused-deputy path, or privilege change without re-authorization.
16
17
  - **Auth / session:** secure session handling; no credentials in code/logs; correct
17
18
  password/token handling.
18
19
  - **Sensitive data:** PII/secrets not logged or returned; encryption where required;
@@ -21,8 +22,12 @@ This is the **single-sourced OWASP-web checklist** both `$rite-review` and the
21
22
  untrusted input into requests.
22
23
  - **Misconfiguration:** safe defaults; debug off; CORS scoped; security headers as the
23
24
  project uses them.
25
+ - **Files / request integrity:** resolved paths remain below the allowed root across
26
+ traversal/encoding/symlink/archive cases; state-changing browser requests use the
27
+ framework's forgery protection; CORS is not treated as CSRF defense.
24
28
  - **Vulnerable dependencies:** new/updated deps audited; no known-vuln versions added.
25
- - **Integrity / deserialization:** don't deserialize untrusted data unsafely.
29
+ - **Integrity / deserialization:** safe non-executable parsing with type/size/depth limits;
30
+ untrusted data cannot instantiate executable objects.
26
31
 
27
32
  ## Trust boundary
28
33
  Apply the three-tier discipline (untrusted → boundary → trusted) per the canonical rule
@@ -18,6 +18,9 @@ discriminating shell/golden/text assertions remain valid for textual or CLI acce
18
18
 
19
19
  Require built slices, resolved or accepted findings, no drift/open validating
20
20
  question, required UI/boundary proof, and an exact doubt verdict per stood decision.
21
+ Reconcile the final diff with the spec applicability map. Every triggered topology,
22
+ data, integration, security, and delivery owner needs its relevant observed failure/
23
+ recovery evidence or an evidence-backed dismissal; a generic green suite cannot close it.
21
24
 
22
25
  ## Candidate binding and test integrity
23
26
 
@@ -4,25 +4,40 @@ Before GO, know how to undo the change and what could go wrong in production.
4
4
 
5
5
  ## Risk scan
6
6
  Rank risks; for each, note likelihood × impact and any mitigation:
7
- - **Data**: schema changes, data migration, destructive operations, backfills.
7
+ - **Topology/ownership**: affected roots/deployables, shared contracts/state/resources,
8
+ dependency cycles, and intermediate deployment combinations.
9
+ - **Data**: schema changes, migration/backfill interruption, concurrent/duplicate writes,
10
+ tenant/retention boundaries, destructive operations, and invariant reconciliation.
8
11
  - **Security**: new trust boundaries, auth/authz changes, secret handling, new deps.
9
12
  - **Compatibility**: API contract changes, breaking changes for existing clients,
10
13
  feature interactions.
11
- - **Operational**: new external dependency, config/env requirements, rate limits.
14
+ - **Integration/operational**: timeouts/unknown outcomes, retry/idempotency, duplicate/order,
15
+ partial/invalid responses, provider/queue/cache outage, config/env, and rate limits.
16
+ - **Delivery**: schema/config/application/worker/flag order, environment mismatch,
17
+ monitoring gap, exposure stages, and time to detect/recover.
12
18
  - **UX**: changed flows users rely on; unverified UI.
13
19
 
14
20
  ## Rollback plan (required for risky changes)
15
21
  For each risky step, state how to back it out:
16
22
  - **Migrations**: is there a reversible `down` / a documented manual revert? Is data
17
- loss possible on rollback?
23
+ loss possible on rollback? If rollback is unsafe, is bounded forward recovery rehearsed?
18
24
  - **Feature flag**: can it be disabled without a deploy?
19
25
  - **Revert boundary**: can the change be `git revert`-ed cleanly, or does it entangle
20
26
  with other work?
21
27
  - **Data**: is there a backup / a way to restore prior state?
28
+ - **External/async effects**: can an unknown outcome be reconciled without duplicating it;
29
+ who drains/replays/quarantines work and repairs partial state?
30
+ - **Configuration/deployables**: what order restores compatible versions and values at
31
+ every root/environment?
22
32
 
23
33
  ## Blocking rules
24
34
  - A **destructive or data-migration change with no rollback plan** is a **NO-GO**.
25
- - A new external dependency with no failure handling is at least **Important**.
35
+ - A data change with unknown invariant/tenant impact, no interruption/retry proof, or no
36
+ rollback/forward-recovery rehearsal is **NO-GO**.
37
+ - A new/changed external or asynchronous boundary with blind retry, silent partial success,
38
+ or no outage/backlog recovery and monitoring is **NO-GO**.
39
+ - Unsafe intermediate deployment order, unvalidated required configuration, or no watched
40
+ rollout signal/owner is **NO-GO** for live exposure.
26
41
  - Record the chosen rollback path in `seal.md` → "Rollback / Recovery".
27
42
 
28
43
  ## Fresh-context availability
@@ -1,43 +1,62 @@
1
- # Staged rollout & rollback: when the ship includes a live deploy
2
-
3
- Opt-in. `$rite-ship`'s job ends at the git ladder (commit → push → tag / PR) and archiving the
4
- workspace; most projects deploy from CI on merge, and their pipeline owns the rollout. Reach for
5
- this reference only when the ship *itself* drives a live, staged production rollout the agent is
6
- responsible for. When it doesn't apply, skip it: the same no-op discipline as the rest of the pack.
7
-
8
- The governing idea is the one already in [`git-workflow.md`](../../devrites-lib/reference/standards/git-workflow.md) and
9
- [`deprecation.md`](../../devrites-lib/reference/standards/deprecation.md): **a launch is only done when it's reversible,
10
- observable, and incremental.** Write the rollback plan *before* you deploy, not after it breaks.
11
-
12
- ## The rollback plan is a pre-condition
13
- Before the first byte ships, the plan exists, with a measured **time-to-rollback** per mechanism:
14
- feature flag < 1 min, redeploy < 5 min, DB rollback < 15 min. If the fastest reversal is slow, that
15
- is a launch risk to fix (add a flag) before shipping, not after. A destructive/migration step ships
16
- only with its rollback proven (expand→contract, [`deprecation.md`](../../devrites-lib/reference/standards/deprecation.md)).
17
-
18
- ## Advance on evidence: the rollout decision thresholds
19
- Stage the exposure and, at each stage, read the signals ([`observability.md`](../../devrites-lib/reference/standards/observability.md))
20
- against a fixed table: advance on green, hold on yellow, roll back on red. Don't eyeball it.
21
-
22
- | Signal | Green (advance) | Yellow (hold, investigate) | Red (roll back now) |
23
- |---|---|---|---|
24
- | Error rate | within ~10% of baseline | 10-100% over baseline | > 2× baseline |
25
- | p95 latency | within ~20% of baseline | 20-50% over | > 50% over |
26
- | Client JS errors | none new | < 0.1% of sessions | > 0.1% of sessions |
27
- | Business metric on the path | neutral or up | < 5% decline | > 5% decline |
28
-
29
- ## Stage the exposure, with a monitoring window at each step
30
- Internal/team → canary ~5% (hold 24-48h) 25% → 50% → 100%, advancing only when **all** thresholds
31
- are green and you can still roll back to the previous percentage at any point. Data integrity or a
32
- security regression is an **immediate** rollback regardless of the table.
33
-
34
- ## Feature-flag hygiene
35
- Every flag has an owner and an expiry; test both states in CI; don't nest flags (state explodes);
36
- remove the flag and its dead branch within ~2 weeks of full rollout: a lingering flag is the
37
- deprecation debt [`deprecation.md`](../../devrites-lib/reference/standards/deprecation.md) exists to prevent.
38
-
39
- ## Verify in the first hour (a runbook, not a vibe)
40
- Health endpoint returns 200 · the error dashboard is flat · latency within budget · one critical
41
- user flow driven by hand · logs/metrics/traces flowing ([`observability.md`](../../devrites-lib/reference/standards/observability.md)
42
- "verify the telemetry fires") · a rollback dry-run confirmed reversible. Record the observations in
43
- `ship.md` / `evidence.md`: an un-watched launch is an unproven one.
1
+ # Staged rollout and recovery: live deploys only
2
+
3
+ Load this only when `$rite-ship` itself is explicitly authorized to drive a live
4
+ deployment. Git-only Ship stops before rollout; CI-owned deployment follows the pipeline's
5
+ runbook. A Seal GO or AFK setting never authorizes production action.
6
+
7
+ ## Preconditions before exposure
8
+
9
+ Record one rollout sheet in `ship.md`/`evidence.md`:
10
+
11
+ | Item | Required decision/evidence |
12
+ | --- | --- |
13
+ | Units and order | Repository/deployable, schema, config, application, worker, contract, and flag order; safe old/new combinations. |
14
+ | Exposure stages | Project-native internal/canary/cohort/percentage/region stages and hold window. |
15
+ | Advance/hold/abort signals | Project baseline or SLO, measurement window, minimum sample, exact threshold, and owner. |
16
+ | Recovery | Fastest safe mechanism, steps, owner, measured/rehearsed time, and data/external-effect reconciliation. |
17
+ | Observability | Watched dashboard/query/alert, failure signal, and executable first action. |
18
+ | Authorization | Exact target/action approved for this attempt; no inferred retry permission. |
19
+
20
+ Do not import generic percentage, latency, error-rate, or time-to-rollback numbers. Use
21
+ accepted product risk, current baseline/SLO, traffic volume, and platform capability. If the
22
+ project has no defensible threshold or signal, the monitoring gap blocks live exposure.
23
+
24
+ ## Choose the smallest reversible mechanism
25
+
26
+ - A feature flag is useful only when the off path preserves current behavior, both states
27
+ are tested, disabling it stops the risky effect, and it has an owner/removal trigger.
28
+ Do not add a flag to a change already reversible by a safe atomic deploy.
29
+ - A flag cannot reverse destructive data/schema effects. Apply
30
+ [`data-integrity.md`](../../devrites-lib/reference/standards/data-integrity.md) and prove
31
+ restore or forward recovery separately.
32
+ - External APIs, webhooks, queues, jobs, and caches apply
33
+ [`integration-reliability.md`](../../devrites-lib/reference/standards/integration-reliability.md):
34
+ reconcile unknown outcomes, drain/quarantine/replay safely, and protect downstream capacity.
35
+ - Multi-root/service rollout follows
36
+ [`repository-topology.md`](../../devrites-lib/reference/standards/repository-topology.md);
37
+ references to another repository never grant write/deploy authority there.
38
+
39
+ ## Stage, observe, decide
40
+
41
+ At each authorized stage:
42
+
43
+ 1. Verify the intended versions/config/schema and candidate identity on the exact target.
44
+ 2. Exercise one critical success path and the declared degradation/recovery signal.
45
+ 3. Observe for the recorded window and sample; bind results to the stage and baseline.
46
+ 4. **Advance** only when every advance condition holds. **Hold** on ambiguous or
47
+ insufficient evidence. **Abort/recover** immediately on an abort condition, security or
48
+ tenant breach, data-integrity violation, unreconciled duplicate/unknown effect, or loss of
49
+ observability.
50
+ 5. Re-verify after recovery; record partial effects and reconciliation. A rollback command
51
+ exiting zero is not proof the prior state or data was restored.
52
+
53
+ Never compress stages because an early sample "looks fine," continue through a monitoring
54
+ gap, or retry a failed live action without fresh authorization when the attempt/target changes.
55
+
56
+ ## Completion
57
+
58
+ Rollout is complete only when full intended exposure meets the recorded window/signals,
59
+ telemetry is still watched, migrations/backfills and queues/reconciliation are settled,
60
+ documentation matches deployed behavior, and temporary flags/compatibility paths have a
61
+ dated removal owner. Otherwise report the exact current stage and remaining risk; do not call
62
+ the launch done.
@@ -19,6 +19,10 @@ declared invariants; an unavoidable principle violation is blocking.
19
19
  For behavioral/high-risk acceptance, use `spec-grammar.md` plus workspace schema;
20
20
  simple criteria stay flat `AC-###`. Apply
21
21
  [`acceptance-criteria.md`](reference/acceptance-criteria.md) so each is binary and observable.
22
+ Use [`edge-case-trace.md`](../devrites-lib/reference/standards/edge-case-trace.md)
23
+ to populate only relevant edge/prohibition rows. The spec's applicability map routes
24
+ topology, data, integration, security, and delivery concerns to their focused standard;
25
+ load a routed standard to discover required behavior, not to prescribe implementation.
22
26
 
23
27
  ## Operating rules (DevRites core)
24
28
  - No silent assumptions or guessing; prefer conventions; ask on scope,
@@ -65,6 +69,8 @@ simple criteria stay flat `AC-###`. Apply
65
69
  template's specific justification.
66
70
  Identify proof constraints now: human-only credentials, unavailable environments, approval
67
71
  windows, or acceptance not observable through existing test/runtime/browser surfaces.
72
+ An unfamiliar framework/version routes to `devrites-source-driven`; missing or
73
+ contradictory documentation is evidence to reconcile, never a license to guess.
68
74
  Split independent placement, blast-radius, and external-fact questions into at most three
69
75
  bounded `devrites-evidence-scout` tasks on one frozen candidate. Wait for and reconcile every
70
76
  cited dossier before step 4. The scout supplies facts only; it never asks the human or writes
@@ -102,7 +108,8 @@ simple criteria stay flat `AC-###`. Apply
102
108
  unrelated settled content. Write every required artifact and conditional
103
109
  annex exactly from [spec-template](reference/spec-template.md), including its
104
110
  capability impact, existing-behavior preservation, grammar/delta,
105
- coverage-seed, qualified backstops, edge/prohibition, UI, and AI rules. Native
111
+ stakeholder/constraint/invariant, failure/recovery, applicability, coverage-seed,
112
+ qualified backstop, edge/prohibition, UI, and AI rules. Native
106
113
  hierarchical instructions remain stable; do not rewrite `AGENTS.md` or
107
114
  `CLAUDE.md` for the active workspace.
108
115
  5a. **Check the spec prose** with [spec-checklists](reference/spec-checklists.md).
@@ -17,17 +17,24 @@ or LLM output.
17
17
  - Fallback/degradation: <what users see when AI is unavailable>
18
18
 
19
19
  ## Domain evals
20
- | Eval ID | Scenario | Expected signal | Gate |
21
- | --- | --- | --- | --- |
22
- | EVAL-001 | <domain-specific case> | <pass condition> | build/seal |
20
+ | Eval ID | Scenario / slice | Dataset provenance | Expected signal + threshold | Gate |
21
+ | --- | --- | --- | --- | --- |
22
+ | EVAL-001 | <representative/adversarial/empty-context case> | <held-out source/version> | <pass condition and baseline delta> | build/seal |
23
+
24
+ For RAG, cover retrieval relevance/context recall, context precision, answer
25
+ faithfulness, citation support, tenant/ACL isolation, poisoned or conflicting documents,
26
+ and insufficient-context fallback as applicable. A single polished example is not an eval.
23
27
 
24
28
  ## Guardrails
25
29
  - Inputs: <validation, prompt-injection boundaries, tenant/data limits>
26
- - Outputs: <schema checks, refusals, human review, citations>
30
+ - Retrieval: <source provenance, indexing validation, tenant/ACL filter, freshness/deletion>
31
+ - Outputs: <schema checks, refusals, human review, citations only to supporting retrieved sources>
27
32
  - Privacy/security: <data sent to model, retention, secrets policy>
33
+ - Unknown/insufficient context: <abstain, clarify, or bounded fallback; never fabricate>
28
34
 
29
35
  ## Monitoring
30
- - Runtime metrics/logs: <latency, cost, quality, refusal/error rates>
36
+ - Runtime metrics/logs: <latency, cost, retrieval/quality, refusal/error/fallback rates>
31
37
  - Alerts or manual review: <trigger>
32
- - Rollback/kill switch: <mechanism>
38
+ - Rollback/kill switch: <prompt/model/index version and reversible mechanism>
39
+ - Drift evaluation: <reference set, schedule/trigger, regression threshold, owner>
33
40
  ```