devrites 3.0.7 → 3.1.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 (472) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +67 -47
  3. package/SECURITY.md +31 -29
  4. package/docs/adr/0001-go-engine-as-control-plane.md +1 -1
  5. package/docs/adr/0002-dual-host-harness.md +1 -1
  6. package/docs/adr/0004-state-schema-phases-sections.md +1 -2
  7. package/docs/adr/0006-clock-seam-and-engine-ci-gates.md +3 -4
  8. package/docs/adr/0009-prebuild-decision-coverage-and-readiness.md +67 -0
  9. package/docs/adr/0010-agent-first-fresh-context-orchestration.md +71 -0
  10. package/docs/adr/0011-define-plan-transition-rights.md +28 -0
  11. package/docs/adr/README.md +3 -0
  12. package/docs/agents/triage-labels.md +7 -7
  13. package/docs/architecture.md +157 -140
  14. package/docs/cli.md +41 -12
  15. package/docs/command-map.md +49 -35
  16. package/docs/engine/agent-contract.md +92 -15
  17. package/docs/engine/commands.md +242 -72
  18. package/docs/engine/state-schema.md +52 -23
  19. package/docs/engine/workspace-schema.md +94 -15
  20. package/docs/extensions.md +1 -1
  21. package/docs/flow.md +80 -50
  22. package/docs/harness-compliance.md +29 -5
  23. package/docs/orchestration.md +107 -79
  24. package/docs/quick-reference.md +7 -3
  25. package/docs/release.md +4 -3
  26. package/docs/skills.md +64 -38
  27. package/docs/usage.md +57 -38
  28. package/engine/cmd/releasepack/main.go +219 -0
  29. package/engine/cmd/releasepack/main_test.go +170 -0
  30. package/engine/commands.go +170 -23
  31. package/engine/git_guard.go +187 -0
  32. package/engine/git_guard_test.go +283 -0
  33. package/engine/hookpolicy.go +53 -55
  34. package/engine/hookpolicy_test.go +91 -1
  35. package/engine/hooks.go +296 -75
  36. package/engine/hooks_events_test.go +276 -6
  37. package/engine/hooks_workspace.go +640 -159
  38. package/engine/internal/devritespaths/paths.go +65 -10
  39. package/engine/internal/devritespaths/paths_test.go +110 -0
  40. package/engine/internal/doctor/doctor.go +153 -23
  41. package/engine/internal/doctor/doctor_test.go +74 -0
  42. package/engine/internal/forge/forge.go +940 -0
  43. package/engine/internal/forge/forge_test.go +576 -0
  44. package/engine/internal/forge/git.go +245 -0
  45. package/engine/internal/forge/liveness_unix.go +48 -0
  46. package/engine/internal/forge/liveness_windows.go +67 -0
  47. package/engine/internal/forge/manifest.go +402 -0
  48. package/engine/internal/gate/gate.go +90 -71
  49. package/engine/internal/gate/gate_test.go +71 -2
  50. package/engine/internal/harness/compliance.go +18 -24
  51. package/engine/internal/harness/harness.go +37 -44
  52. package/engine/internal/harness/harness_test.go +21 -5
  53. package/engine/internal/install/install.go +486 -38
  54. package/engine/internal/install/install_test.go +383 -10
  55. package/engine/internal/iohooks/iohooks.go +350 -59
  56. package/engine/internal/iohooks/iohooks_test.go +421 -1
  57. package/engine/internal/lib/buildreadiness.go +35 -18
  58. package/engine/internal/lib/clarifyreturn.go +91 -0
  59. package/engine/internal/lib/clarifyreturn_test.go +123 -0
  60. package/engine/internal/lib/context.go +54 -15
  61. package/engine/internal/lib/cursor_compat_test.go +8 -0
  62. package/engine/internal/lib/extensions.go +2 -3
  63. package/engine/internal/lib/gitauthority.go +601 -0
  64. package/engine/internal/lib/gitauthority_test.go +346 -0
  65. package/engine/internal/lib/jsonout.go +25 -11
  66. package/engine/internal/lib/jsonout_test.go +16 -0
  67. package/engine/internal/lib/lanes.go +14 -8
  68. package/engine/internal/lib/observability_test.go +358 -0
  69. package/engine/internal/lib/packageexistence.go +151 -35
  70. package/engine/internal/lib/packageexistence_test.go +163 -0
  71. package/engine/internal/lib/progress.go +11 -9
  72. package/engine/internal/lib/provenance.go +462 -0
  73. package/engine/internal/lib/provenance_test.go +154 -0
  74. package/engine/internal/lib/readiness_contract.json +111 -0
  75. package/engine/internal/lib/readinessartifact.go +510 -0
  76. package/engine/internal/lib/readinessartifact_test.go +321 -0
  77. package/engine/internal/lib/reconcile.go +712 -88
  78. package/engine/internal/lib/reconcile_test.go +335 -16
  79. package/engine/internal/lib/recoveryattempts.go +298 -0
  80. package/engine/internal/lib/recoveryattempts_test.go +215 -0
  81. package/engine/internal/lib/resolve.go +23 -19
  82. package/engine/internal/lib/runbook_context_test.go +20 -0
  83. package/engine/internal/lib/session.go +701 -9
  84. package/engine/internal/lib/session_test.go +80 -13
  85. package/engine/internal/lib/testintegrity.go +33 -37
  86. package/engine/internal/lib/testintegrity_test.go +63 -1
  87. package/engine/internal/migrate/migrate.go +81 -1
  88. package/engine/internal/migrate/migrate_test.go +22 -1
  89. package/engine/internal/reason/reason.go +180 -0
  90. package/engine/internal/reason/reason_test.go +35 -0
  91. package/engine/internal/rootfacts/facts.go +466 -0
  92. package/engine/internal/rootfacts/facts_test.go +306 -0
  93. package/engine/internal/safepath/safepath.go +55 -0
  94. package/engine/internal/safepath/safepath_test.go +69 -0
  95. package/engine/internal/safepath/safepath_windows_test.go +26 -0
  96. package/engine/internal/state/clarify_transition.go +165 -0
  97. package/engine/internal/state/clarify_transition_test.go +130 -0
  98. package/engine/internal/state/cmd/workflowmanifest/main.go +12 -8
  99. package/engine/internal/state/cursor.go +58 -0
  100. package/engine/internal/state/cursor_test.go +42 -1
  101. package/engine/internal/state/feature.go +35 -48
  102. package/engine/internal/state/schema.go +90 -37
  103. package/engine/internal/state/snapshot.go +18 -2
  104. package/engine/internal/state/state_test.go +187 -7
  105. package/engine/internal/state/status.go +48 -11
  106. package/engine/internal/state/workflow_manifest.json +231 -50
  107. package/engine/internal/toolpolicy/classifier.go +533 -0
  108. package/engine/internal/toolpolicy/classifier_test.go +424 -0
  109. package/engine/internal/toolpolicy/git.go +616 -0
  110. package/engine/internal/toolpolicy/scanner.go +382 -0
  111. package/engine/main.go +160 -77
  112. package/engine/observability_cli_test.go +52 -0
  113. package/engine/root_routing_test.go +277 -0
  114. package/engine/testdata/golden/TestParityBuildReadiness/arg=approved.golden +1 -1
  115. package/engine/testdata/golden/TestParityBuildReadiness/arg=emptystatus.golden +1 -1
  116. package/engine/testdata/golden/TestParityBuildReadiness/arg=noclarify.golden +1 -0
  117. package/engine/testdata/golden/TestParityBuildReadiness/arg=novet.golden +1 -0
  118. package/engine/testdata/golden/TestParityBuildReadiness/arg=stalevet.golden +1 -0
  119. package/engine/testdata/golden/TestParityBuildReadiness/arg=trailhash.golden +1 -1
  120. package/engine/testdata/golden/TestParityBuildReadiness/arg=trailpipe.golden +1 -1
  121. package/engine/testdata/golden/TestParityBuildReadiness/arg=vetnotready.golden +1 -0
  122. package/engine/testdata/golden/TestParityProgress/arg=allbuilt.golden +1 -1
  123. package/engine/testdata/golden/TestParityProgress/arg=done.golden +1 -1
  124. package/engine/testdata/golden/TestParityProgress/arg=mid.golden +1 -1
  125. package/engine/testdata/golden/TestParityProgress/arg=nophase.golden +1 -1
  126. package/engine/testdata/golden/TestParityProgress/arg=noslice.golden +1 -1
  127. package/engine/testdata/golden/TestParityProgress/arg=plan.golden +1 -1
  128. package/engine/testdata/golden/TestParityProgress/arg=seal.golden +1 -1
  129. package/engine/testdata/golden/TestParityReconcile/check-clean.golden +1 -1
  130. package/engine/testdata/golden/TestParityReconcile/inline-fallback.golden +1 -0
  131. package/engine/testdata/golden/TestParityReconcile/snapshot-no-allowlist.golden +1 -0
  132. package/engine/testdata/golden/TestParityWrightScope/devrites-edit-denied.golden +2 -0
  133. package/engine/testdata/golden/TestParityWrightScope/out-of-scope-enforce-denies.golden +1 -1
  134. package/engine/tests/adr_0011_define_plan_test.go +30 -0
  135. package/engine/tests/budget_test.go +19 -8
  136. package/engine/tests/concurrency_cli_test.go +7 -1
  137. package/engine/tests/doctor_cli_test.go +148 -2
  138. package/engine/tests/forge_cli_test.go +463 -0
  139. package/engine/tests/gate_test.go +63 -8
  140. package/engine/tests/hook_test.go +260 -8
  141. package/engine/tests/hooks_io_test.go +94 -3
  142. package/engine/tests/json_contract_test.go +127 -2
  143. package/engine/tests/migrate_cli_test.go +2 -2
  144. package/engine/tests/parity_buildreadiness_test.go +141 -10
  145. package/engine/tests/parity_learnings_test.go +16 -17
  146. package/engine/tests/parity_reconcile_test.go +20 -17
  147. package/engine/tests/parity_resolve_test.go +12 -11
  148. package/engine/tests/parity_test.go +21 -17
  149. package/pack/.claude/agents/devrites-code-reviewer.md +62 -48
  150. package/pack/.claude/agents/devrites-devex-reviewer.md +69 -53
  151. package/pack/.claude/agents/devrites-doubt-reviewer.md +29 -22
  152. package/pack/.claude/agents/devrites-evidence-scout.md +69 -0
  153. package/pack/.claude/agents/devrites-forge-judge.md +74 -61
  154. package/pack/.claude/agents/devrites-frontend-reviewer.md +48 -39
  155. package/pack/.claude/agents/devrites-performance-reviewer.md +49 -40
  156. package/pack/.claude/agents/devrites-plan-drafter.md +71 -0
  157. package/pack/.claude/agents/devrites-plan-reviewer.md +80 -47
  158. package/pack/.claude/agents/devrites-proof-runner.md +74 -0
  159. package/pack/.claude/agents/devrites-retrospector.md +48 -45
  160. package/pack/.claude/agents/devrites-security-auditor.md +46 -36
  161. package/pack/.claude/agents/devrites-simplifier-reviewer.md +50 -46
  162. package/pack/.claude/agents/devrites-slice-wright.md +153 -165
  163. package/pack/.claude/agents/devrites-spec-reviewer.md +34 -32
  164. package/pack/.claude/agents/devrites-strategy-reviewer.md +63 -34
  165. package/pack/.claude/agents/devrites-test-analyst.md +40 -30
  166. package/pack/.claude/settings.json +2 -1
  167. package/pack/.claude/skills/devrites-audit/SKILL.md +40 -61
  168. package/pack/.claude/skills/devrites-debug-recovery/SKILL.md +24 -13
  169. package/pack/.claude/skills/devrites-debug-recovery/reference/build-the-loop.md +24 -21
  170. package/pack/.claude/skills/devrites-debug-recovery/reference/cleanup-and-classify.md +34 -6
  171. package/pack/.claude/skills/devrites-debug-recovery/reference/instrumentation.md +2 -2
  172. package/pack/.claude/skills/devrites-doubt/SKILL.md +25 -17
  173. package/pack/.claude/skills/devrites-interview/SKILL.md +53 -52
  174. package/pack/.claude/skills/devrites-lib/SKILL.md +11 -9
  175. package/pack/.claude/skills/devrites-lib/reference/intent-map.md +3 -2
  176. package/pack/.claude/skills/devrites-lib/reference/parallel-dispatch.md +82 -137
  177. package/pack/.claude/skills/devrites-lib/reference/reply-contract.md +8 -1
  178. package/pack/.claude/skills/devrites-lib/reference/standards/README.md +38 -55
  179. package/pack/.claude/skills/devrites-lib/reference/standards/afk-hitl.md +53 -27
  180. package/pack/.claude/skills/devrites-lib/reference/standards/agents.md +198 -190
  181. package/pack/.claude/skills/devrites-lib/reference/standards/anti-patterns.md +5 -15
  182. package/pack/.claude/skills/devrites-lib/reference/standards/ci-cd.md +27 -58
  183. package/pack/.claude/skills/devrites-lib/reference/standards/code-review.md +16 -52
  184. package/pack/.claude/skills/devrites-lib/reference/standards/coding-style.md +2 -10
  185. package/pack/.claude/skills/devrites-lib/reference/standards/context-hygiene.md +18 -61
  186. package/pack/.claude/skills/devrites-lib/reference/standards/core.md +23 -18
  187. package/pack/.claude/skills/devrites-lib/reference/standards/deprecation.md +17 -57
  188. package/pack/.claude/skills/devrites-lib/reference/standards/development-workflow.md +4 -33
  189. package/pack/.claude/skills/devrites-lib/reference/standards/git-workflow.md +4 -20
  190. package/pack/.claude/skills/devrites-lib/reference/standards/hooks.md +3 -14
  191. package/pack/.claude/skills/devrites-lib/reference/standards/patterns.md +9 -25
  192. package/pack/.claude/skills/devrites-lib/reference/standards/performance.md +0 -9
  193. package/pack/.claude/skills/devrites-lib/reference/standards/principles.md +1 -3
  194. package/pack/.claude/skills/devrites-lib/reference/standards/security.md +17 -7
  195. package/pack/.claude/skills/devrites-lib/reference/standards/testing.md +1 -27
  196. package/pack/.claude/skills/devrites-lib/reference/standards/tooling.md +46 -50
  197. package/pack/.claude/skills/devrites-lib/reference/workspace-artifact-schema.md +23 -10
  198. package/pack/.claude/skills/devrites-source-driven/SKILL.md +23 -22
  199. package/pack/.claude/skills/rite/SKILL.md +8 -6
  200. package/pack/.claude/skills/rite/reference/menu.md +8 -6
  201. package/pack/.claude/skills/rite-adopt/SKILL.md +33 -37
  202. package/pack/.claude/skills/rite-autocomplete/SKILL.md +33 -28
  203. package/pack/.claude/skills/rite-autocomplete/reference/loop.md +21 -21
  204. package/pack/.claude/skills/rite-autocomplete/reference/stop-conditions.md +15 -6
  205. package/pack/.claude/skills/rite-build/SKILL.md +35 -30
  206. package/pack/.claude/skills/rite-build/reference/afk-discipline.md +38 -38
  207. package/pack/.claude/skills/rite-build/reference/evidence-standard.md +10 -0
  208. package/pack/.claude/skills/rite-build/reference/forge.md +186 -156
  209. package/pack/.claude/skills/rite-build/reference/one-slice-cycle.md +4 -3
  210. package/pack/.claude/skills/rite-build/reference/phase-contract.md +96 -175
  211. package/pack/.claude/skills/rite-build/reference/wright-dispatch.md +129 -134
  212. package/pack/.claude/skills/rite-clarify/SKILL.md +89 -0
  213. package/pack/.claude/skills/rite-clarify/reference/decision-coverage.md +59 -0
  214. package/pack/.claude/skills/rite-converge/SKILL.md +35 -25
  215. package/pack/.claude/skills/rite-define/SKILL.md +57 -32
  216. package/pack/.claude/skills/rite-define/reference/gates.md +16 -15
  217. package/pack/.claude/skills/rite-define/reference/plan-template.md +16 -8
  218. package/pack/.claude/skills/rite-frame/reference/failure-modes.md +22 -24
  219. package/pack/.claude/skills/rite-plan/SKILL.md +44 -16
  220. package/pack/.claude/skills/rite-plan/reference/task-breakdown.md +4 -0
  221. package/pack/.claude/skills/rite-polish/SKILL.md +27 -23
  222. package/pack/.claude/skills/rite-prototype/SKILL.md +25 -26
  223. package/pack/.claude/skills/rite-prove/SKILL.md +27 -17
  224. package/pack/.claude/skills/rite-resolve/SKILL.md +12 -11
  225. package/pack/.claude/skills/rite-resolve/reference/answer-protocol.md +3 -0
  226. package/pack/.claude/skills/rite-review/SKILL.md +37 -28
  227. package/pack/.claude/skills/rite-seal/reference/phase-contract.md +27 -92
  228. package/pack/.claude/skills/rite-seal/reference/risk-and-rollback.md +13 -0
  229. package/pack/.claude/skills/rite-ship/reference/design-memory.md +31 -36
  230. package/pack/.claude/skills/rite-spec/SKILL.md +84 -135
  231. package/pack/.claude/skills/rite-spec/reference/investigation.md +37 -33
  232. package/pack/.claude/skills/rite-spec/reference/question-protocol.md +6 -2
  233. package/pack/.claude/skills/rite-spec/reference/spec-checklists.md +25 -24
  234. package/pack/.claude/skills/rite-spec/reference/spec-template.md +9 -2
  235. package/pack/.claude/skills/rite-spec/reference/state-workspace.md +13 -3
  236. package/pack/.claude/skills/rite-temper/SKILL.md +62 -47
  237. package/pack/.claude/skills/rite-temper/reference/review-dimensions.md +24 -22
  238. package/pack/.claude/skills/rite-vet/SKILL.md +110 -113
  239. package/pack/.claude/skills/rite-vet/reference/artifacts.md +42 -9
  240. package/pack/.claude/skills/rite-vet/reference/review-axes.md +39 -37
  241. package/pack/generated/claude/agents/devrites-code-reviewer.md +62 -48
  242. package/pack/generated/claude/agents/devrites-devex-reviewer.md +69 -53
  243. package/pack/generated/claude/agents/devrites-doubt-reviewer.md +29 -22
  244. package/pack/generated/claude/agents/devrites-evidence-scout.md +69 -0
  245. package/pack/generated/claude/agents/devrites-forge-judge.md +74 -61
  246. package/pack/generated/claude/agents/devrites-frontend-reviewer.md +48 -39
  247. package/pack/generated/claude/agents/devrites-performance-reviewer.md +49 -40
  248. package/pack/generated/claude/agents/devrites-plan-drafter.md +71 -0
  249. package/pack/generated/claude/agents/devrites-plan-reviewer.md +80 -47
  250. package/pack/generated/claude/agents/devrites-proof-runner.md +74 -0
  251. package/pack/generated/claude/agents/devrites-retrospector.md +48 -45
  252. package/pack/generated/claude/agents/devrites-security-auditor.md +46 -36
  253. package/pack/generated/claude/agents/devrites-simplifier-reviewer.md +50 -46
  254. package/pack/generated/claude/agents/devrites-slice-wright.md +153 -165
  255. package/pack/generated/claude/agents/devrites-spec-reviewer.md +34 -32
  256. package/pack/generated/claude/agents/devrites-strategy-reviewer.md +63 -34
  257. package/pack/generated/claude/agents/devrites-test-analyst.md +40 -30
  258. package/pack/generated/claude/settings.json +2 -1
  259. package/pack/generated/claude/skills/devrites-audit/SKILL.md +40 -61
  260. package/pack/generated/claude/skills/devrites-debug-recovery/SKILL.md +24 -13
  261. package/pack/generated/claude/skills/devrites-debug-recovery/reference/build-the-loop.md +24 -21
  262. package/pack/generated/claude/skills/devrites-debug-recovery/reference/cleanup-and-classify.md +34 -6
  263. package/pack/generated/claude/skills/devrites-debug-recovery/reference/instrumentation.md +2 -2
  264. package/pack/generated/claude/skills/devrites-doubt/SKILL.md +25 -17
  265. package/pack/generated/claude/skills/devrites-interview/SKILL.md +53 -52
  266. package/pack/generated/claude/skills/devrites-lib/SKILL.md +11 -9
  267. package/pack/generated/claude/skills/devrites-lib/reference/intent-map.md +3 -2
  268. package/pack/generated/claude/skills/devrites-lib/reference/parallel-dispatch.md +82 -137
  269. package/pack/generated/claude/skills/devrites-lib/reference/reply-contract.md +8 -1
  270. package/pack/generated/claude/skills/devrites-lib/reference/standards/README.md +38 -55
  271. package/pack/generated/claude/skills/devrites-lib/reference/standards/afk-hitl.md +53 -27
  272. package/pack/generated/claude/skills/devrites-lib/reference/standards/agents.md +198 -190
  273. package/pack/generated/claude/skills/devrites-lib/reference/standards/anti-patterns.md +5 -15
  274. package/pack/generated/claude/skills/devrites-lib/reference/standards/ci-cd.md +27 -58
  275. package/pack/generated/claude/skills/devrites-lib/reference/standards/code-review.md +16 -52
  276. package/pack/generated/claude/skills/devrites-lib/reference/standards/coding-style.md +2 -10
  277. package/pack/generated/claude/skills/devrites-lib/reference/standards/context-hygiene.md +18 -61
  278. package/pack/generated/claude/skills/devrites-lib/reference/standards/core.md +23 -18
  279. package/pack/generated/claude/skills/devrites-lib/reference/standards/deprecation.md +17 -57
  280. package/pack/generated/claude/skills/devrites-lib/reference/standards/development-workflow.md +4 -33
  281. package/pack/generated/claude/skills/devrites-lib/reference/standards/git-workflow.md +4 -20
  282. package/pack/generated/claude/skills/devrites-lib/reference/standards/hooks.md +3 -14
  283. package/pack/generated/claude/skills/devrites-lib/reference/standards/patterns.md +9 -25
  284. package/pack/generated/claude/skills/devrites-lib/reference/standards/performance.md +0 -9
  285. package/pack/generated/claude/skills/devrites-lib/reference/standards/principles.md +1 -3
  286. package/pack/generated/claude/skills/devrites-lib/reference/standards/security.md +17 -7
  287. package/pack/generated/claude/skills/devrites-lib/reference/standards/testing.md +1 -27
  288. package/pack/generated/claude/skills/devrites-lib/reference/standards/tooling.md +46 -50
  289. package/pack/generated/claude/skills/devrites-lib/reference/workspace-artifact-schema.md +23 -10
  290. package/pack/generated/claude/skills/devrites-source-driven/SKILL.md +23 -22
  291. package/pack/generated/claude/skills/rite/SKILL.md +8 -6
  292. package/pack/generated/claude/skills/rite/reference/menu.md +8 -6
  293. package/pack/generated/claude/skills/rite-adopt/SKILL.md +33 -37
  294. package/pack/generated/claude/skills/rite-autocomplete/SKILL.md +33 -28
  295. package/pack/generated/claude/skills/rite-autocomplete/reference/loop.md +21 -21
  296. package/pack/generated/claude/skills/rite-autocomplete/reference/stop-conditions.md +15 -6
  297. package/pack/generated/claude/skills/rite-build/SKILL.md +35 -30
  298. package/pack/generated/claude/skills/rite-build/reference/afk-discipline.md +38 -38
  299. package/pack/generated/claude/skills/rite-build/reference/evidence-standard.md +10 -0
  300. package/pack/generated/claude/skills/rite-build/reference/forge.md +186 -156
  301. package/pack/generated/claude/skills/rite-build/reference/one-slice-cycle.md +4 -3
  302. package/pack/generated/claude/skills/rite-build/reference/phase-contract.md +96 -175
  303. package/pack/generated/claude/skills/rite-build/reference/wright-dispatch.md +129 -134
  304. package/pack/generated/claude/skills/rite-clarify/SKILL.md +89 -0
  305. package/pack/generated/claude/skills/rite-clarify/reference/decision-coverage.md +59 -0
  306. package/pack/generated/claude/skills/rite-converge/SKILL.md +35 -25
  307. package/pack/generated/claude/skills/rite-define/SKILL.md +57 -32
  308. package/pack/generated/claude/skills/rite-define/reference/gates.md +16 -15
  309. package/pack/generated/claude/skills/rite-define/reference/plan-template.md +16 -8
  310. package/pack/generated/claude/skills/rite-frame/reference/failure-modes.md +22 -24
  311. package/pack/generated/claude/skills/rite-plan/SKILL.md +44 -16
  312. package/pack/generated/claude/skills/rite-plan/reference/task-breakdown.md +4 -0
  313. package/pack/generated/claude/skills/rite-polish/SKILL.md +27 -23
  314. package/pack/generated/claude/skills/rite-prototype/SKILL.md +25 -26
  315. package/pack/generated/claude/skills/rite-prove/SKILL.md +27 -17
  316. package/pack/generated/claude/skills/rite-resolve/SKILL.md +12 -11
  317. package/pack/generated/claude/skills/rite-resolve/reference/answer-protocol.md +3 -0
  318. package/pack/generated/claude/skills/rite-review/SKILL.md +37 -28
  319. package/pack/generated/claude/skills/rite-seal/reference/phase-contract.md +27 -92
  320. package/pack/generated/claude/skills/rite-seal/reference/risk-and-rollback.md +13 -0
  321. package/pack/generated/claude/skills/rite-ship/reference/design-memory.md +31 -36
  322. package/pack/generated/claude/skills/rite-spec/SKILL.md +84 -135
  323. package/pack/generated/claude/skills/rite-spec/reference/investigation.md +37 -33
  324. package/pack/generated/claude/skills/rite-spec/reference/question-protocol.md +6 -2
  325. package/pack/generated/claude/skills/rite-spec/reference/spec-checklists.md +25 -24
  326. package/pack/generated/claude/skills/rite-spec/reference/spec-template.md +9 -2
  327. package/pack/generated/claude/skills/rite-spec/reference/state-workspace.md +13 -3
  328. package/pack/generated/claude/skills/rite-temper/SKILL.md +62 -47
  329. package/pack/generated/claude/skills/rite-temper/reference/review-dimensions.md +24 -22
  330. package/pack/generated/claude/skills/rite-vet/SKILL.md +110 -113
  331. package/pack/generated/claude/skills/rite-vet/reference/artifacts.md +42 -9
  332. package/pack/generated/claude/skills/rite-vet/reference/review-axes.md +39 -37
  333. package/pack/generated/codex/AGENTS.md +5 -2
  334. package/pack/generated/codex/agents/devrites-code-reviewer.toml +69 -47
  335. package/pack/generated/codex/agents/devrites-devex-reviewer.toml +75 -51
  336. package/pack/generated/codex/agents/devrites-doubt-reviewer.toml +35 -20
  337. package/pack/generated/codex/agents/devrites-evidence-scout.toml +75 -0
  338. package/pack/generated/codex/agents/devrites-forge-judge.toml +80 -59
  339. package/pack/generated/codex/agents/devrites-frontend-reviewer.toml +54 -37
  340. package/pack/generated/codex/agents/devrites-performance-reviewer.toml +55 -38
  341. package/pack/generated/codex/agents/devrites-plan-drafter.toml +77 -0
  342. package/pack/generated/codex/agents/devrites-plan-reviewer.toml +82 -47
  343. package/pack/generated/codex/agents/devrites-proof-runner.toml +80 -0
  344. package/pack/generated/codex/agents/devrites-retrospector.toml +54 -43
  345. package/pack/generated/codex/agents/devrites-security-auditor.toml +53 -35
  346. package/pack/generated/codex/agents/devrites-simplifier-reviewer.toml +56 -44
  347. package/pack/generated/codex/agents/devrites-slice-wright.toml +159 -163
  348. package/pack/generated/codex/agents/devrites-spec-reviewer.toml +40 -30
  349. package/pack/generated/codex/agents/devrites-strategy-reviewer.toml +65 -34
  350. package/pack/generated/codex/agents/devrites-test-analyst.toml +46 -28
  351. package/pack/generated/codex/hooks.json +4 -14
  352. package/pack/generated/codex/skills/devrites-api-interface/SKILL.md +7 -3
  353. package/pack/generated/codex/skills/devrites-audit/SKILL.md +47 -64
  354. package/pack/generated/codex/skills/devrites-browser-proof/SKILL.md +7 -3
  355. package/pack/generated/codex/skills/devrites-debug-recovery/SKILL.md +31 -16
  356. package/pack/generated/codex/skills/devrites-debug-recovery/reference/build-the-loop.md +24 -21
  357. package/pack/generated/codex/skills/devrites-debug-recovery/reference/cleanup-and-classify.md +34 -6
  358. package/pack/generated/codex/skills/devrites-debug-recovery/reference/instrumentation.md +2 -2
  359. package/pack/generated/codex/skills/devrites-doubt/SKILL.md +32 -20
  360. package/pack/generated/codex/skills/devrites-frontend-craft/SKILL.md +7 -3
  361. package/pack/generated/codex/skills/devrites-interview/SKILL.md +60 -55
  362. package/pack/generated/codex/skills/devrites-lib/SKILL.md +18 -12
  363. package/pack/generated/codex/skills/devrites-lib/reference/intent-map.md +3 -2
  364. package/pack/generated/codex/skills/devrites-lib/reference/parallel-dispatch.md +82 -137
  365. package/pack/generated/codex/skills/devrites-lib/reference/reply-contract.md +8 -1
  366. package/pack/generated/codex/skills/devrites-lib/reference/standards/README.md +38 -55
  367. package/pack/generated/codex/skills/devrites-lib/reference/standards/afk-hitl.md +53 -27
  368. package/pack/generated/codex/skills/devrites-lib/reference/standards/agents.md +198 -190
  369. package/pack/generated/codex/skills/devrites-lib/reference/standards/anti-patterns.md +5 -15
  370. package/pack/generated/codex/skills/devrites-lib/reference/standards/ci-cd.md +27 -58
  371. package/pack/generated/codex/skills/devrites-lib/reference/standards/code-review.md +16 -52
  372. package/pack/generated/codex/skills/devrites-lib/reference/standards/coding-style.md +2 -10
  373. package/pack/generated/codex/skills/devrites-lib/reference/standards/context-hygiene.md +18 -61
  374. package/pack/generated/codex/skills/devrites-lib/reference/standards/core.md +23 -18
  375. package/pack/generated/codex/skills/devrites-lib/reference/standards/deprecation.md +17 -57
  376. package/pack/generated/codex/skills/devrites-lib/reference/standards/development-workflow.md +4 -33
  377. package/pack/generated/codex/skills/devrites-lib/reference/standards/git-workflow.md +4 -20
  378. package/pack/generated/codex/skills/devrites-lib/reference/standards/hooks.md +3 -14
  379. package/pack/generated/codex/skills/devrites-lib/reference/standards/patterns.md +9 -25
  380. package/pack/generated/codex/skills/devrites-lib/reference/standards/performance.md +0 -9
  381. package/pack/generated/codex/skills/devrites-lib/reference/standards/principles.md +1 -3
  382. package/pack/generated/codex/skills/devrites-lib/reference/standards/security.md +17 -7
  383. package/pack/generated/codex/skills/devrites-lib/reference/standards/testing.md +1 -27
  384. package/pack/generated/codex/skills/devrites-lib/reference/standards/tooling.md +46 -50
  385. package/pack/generated/codex/skills/devrites-lib/reference/workspace-artifact-schema.md +23 -10
  386. package/pack/generated/codex/skills/devrites-prose-craft/SKILL.md +7 -3
  387. package/pack/generated/codex/skills/devrites-refresh-indexes/SKILL.md +7 -3
  388. package/pack/generated/codex/skills/devrites-source-driven/SKILL.md +29 -24
  389. package/pack/generated/codex/skills/devrites-ux-shape/SKILL.md +7 -3
  390. package/pack/generated/codex/skills/rite/SKILL.md +19 -13
  391. package/pack/generated/codex/skills/rite/reference/menu.md +8 -6
  392. package/pack/generated/codex/skills/rite-adopt/SKILL.md +40 -40
  393. package/pack/generated/codex/skills/rite-autocomplete/SKILL.md +40 -31
  394. package/pack/generated/codex/skills/rite-autocomplete/reference/loop.md +21 -21
  395. package/pack/generated/codex/skills/rite-autocomplete/reference/stop-conditions.md +15 -6
  396. package/pack/generated/codex/skills/rite-build/SKILL.md +42 -33
  397. package/pack/generated/codex/skills/rite-build/reference/afk-discipline.md +38 -38
  398. package/pack/generated/codex/skills/rite-build/reference/evidence-standard.md +10 -0
  399. package/pack/generated/codex/skills/rite-build/reference/forge.md +186 -156
  400. package/pack/generated/codex/skills/rite-build/reference/one-slice-cycle.md +4 -3
  401. package/pack/generated/codex/skills/rite-build/reference/phase-contract.md +96 -175
  402. package/pack/generated/codex/skills/rite-build/reference/wright-dispatch.md +129 -134
  403. package/pack/generated/codex/skills/rite-clarify/SKILL.md +105 -0
  404. package/pack/generated/codex/skills/rite-clarify/reference/decision-coverage.md +59 -0
  405. package/pack/generated/codex/skills/rite-converge/SKILL.md +42 -28
  406. package/pack/generated/codex/skills/rite-customize/SKILL.md +7 -3
  407. package/pack/generated/codex/skills/rite-define/SKILL.md +64 -35
  408. package/pack/generated/codex/skills/rite-define/reference/gates.md +16 -15
  409. package/pack/generated/codex/skills/rite-define/reference/plan-template.md +16 -8
  410. package/pack/generated/codex/skills/rite-doctor/SKILL.md +7 -3
  411. package/pack/generated/codex/skills/rite-dogfood/SKILL.md +7 -3
  412. package/pack/generated/codex/skills/rite-explain/SKILL.md +7 -3
  413. package/pack/generated/codex/skills/rite-frame/SKILL.md +7 -3
  414. package/pack/generated/codex/skills/rite-frame/reference/failure-modes.md +22 -24
  415. package/pack/generated/codex/skills/rite-handoff/SKILL.md +7 -3
  416. package/pack/generated/codex/skills/rite-learn/SKILL.md +7 -3
  417. package/pack/generated/codex/skills/rite-plan/SKILL.md +51 -19
  418. package/pack/generated/codex/skills/rite-plan/reference/task-breakdown.md +5 -1
  419. package/pack/generated/codex/skills/rite-polish/SKILL.md +34 -26
  420. package/pack/generated/codex/skills/rite-pov/SKILL.md +7 -3
  421. package/pack/generated/codex/skills/rite-pr-feedback/SKILL.md +7 -3
  422. package/pack/generated/codex/skills/rite-pressure-test/SKILL.md +7 -3
  423. package/pack/generated/codex/skills/rite-prototype/SKILL.md +32 -29
  424. package/pack/generated/codex/skills/rite-prove/SKILL.md +34 -20
  425. package/pack/generated/codex/skills/rite-quick/SKILL.md +7 -3
  426. package/pack/generated/codex/skills/rite-resolve/SKILL.md +19 -14
  427. package/pack/generated/codex/skills/rite-resolve/reference/answer-protocol.md +3 -0
  428. package/pack/generated/codex/skills/rite-review/SKILL.md +44 -31
  429. package/pack/generated/codex/skills/rite-seal/SKILL.md +7 -3
  430. package/pack/generated/codex/skills/rite-seal/reference/phase-contract.md +27 -92
  431. package/pack/generated/codex/skills/rite-seal/reference/risk-and-rollback.md +13 -0
  432. package/pack/generated/codex/skills/rite-ship/SKILL.md +7 -3
  433. package/pack/generated/codex/skills/rite-ship/reference/design-memory.md +31 -36
  434. package/pack/generated/codex/skills/rite-spec/SKILL.md +91 -138
  435. package/pack/generated/codex/skills/rite-spec/reference/investigation.md +37 -33
  436. package/pack/generated/codex/skills/rite-spec/reference/question-protocol.md +6 -2
  437. package/pack/generated/codex/skills/rite-spec/reference/spec-checklists.md +25 -24
  438. package/pack/generated/codex/skills/rite-spec/reference/spec-template.md +9 -2
  439. package/pack/generated/codex/skills/rite-spec/reference/state-workspace.md +13 -3
  440. package/pack/generated/codex/skills/rite-status/SKILL.md +7 -3
  441. package/pack/generated/codex/skills/rite-temper/SKILL.md +69 -50
  442. package/pack/generated/codex/skills/rite-temper/reference/review-dimensions.md +24 -22
  443. package/pack/generated/codex/skills/rite-vet/SKILL.md +117 -116
  444. package/pack/generated/codex/skills/rite-vet/reference/artifacts.md +42 -9
  445. package/pack/generated/codex/skills/rite-vet/reference/review-axes.md +40 -38
  446. package/pack/generated/codex/skills/rite-zoom-out/SKILL.md +7 -3
  447. package/package.json +1 -1
  448. package/scripts/build-release-tarball.sh +32 -15
  449. package/scripts/check-authority-drift.py +125 -0
  450. package/scripts/check-instruction-size-baseline.mjs +19 -11
  451. package/scripts/check-invocation-integrity.py +2 -0
  452. package/scripts/codex-generate.sh +69 -33
  453. package/scripts/grade-feature.sh +121 -40
  454. package/scripts/live-hosts/agent-result.schema.json +230 -0
  455. package/scripts/live-hosts/claude.sh +87 -0
  456. package/scripts/live-hosts/codex.sh +81 -0
  457. package/scripts/live-hosts/common.sh +113 -0
  458. package/scripts/live-hosts/fake-host.py +264 -0
  459. package/scripts/live-hosts/host-transport.py +287 -0
  460. package/scripts/release-check.sh +5 -1
  461. package/scripts/run-agent-contract-evals.py +1380 -0
  462. package/scripts/run-behavioral-evals.sh +24 -30
  463. package/scripts/run-evals.sh +1 -5
  464. package/scripts/run-live-behavioral-evals.py +1274 -144
  465. package/scripts/run-outcome-evals.sh +414 -88
  466. package/scripts/run-tests.mjs +30 -2
  467. package/scripts/skills-inventory.mjs +1 -1
  468. package/scripts/validate-workflow-security.py +39 -20
  469. package/scripts/validate-workspace-schema.py +362 -10
  470. package/scripts/validate.sh +21 -15
  471. package/engine/testdata/golden/TestParityWrightScope/devrites-edit-allowed.golden +0 -1
  472. /package/engine/testdata/golden/{TestParityReconcile/check-no-claimed.golden → TestParityBuildReadiness/arg=clarifyopen.golden} +0 -0
@@ -0,0 +1,105 @@
1
+ ---
2
+ name: rite-clarify
3
+ description: Run the topology-first decision-coverage scan after rite-spec and before strategy or architecture. Audit actors, journeys, states, data, integrations, operations, proof, assumptions, and must-NOT boundaries; close Partial/Missing rows and emit decision-coverage.md CLEAR. Use for missing/stale coverage or a missed pre-build product decision.
4
+ argument-hint: "[feature-slug]"
5
+ user-invocable: true
6
+ ---
7
+
8
+ ## Codex compatibility
9
+
10
+ This is the Codex mirror of a DevRites skill. In Codex:
11
+
12
+ - Load DevRites engineering standards from `.agents/skills/devrites-lib/reference/standards/`. Read `.agents/skills/devrites-lib/reference/standards/core.md` before workflow work, then load the other `.agents/skills/devrites-lib/reference/standards/*.md` files exactly when this skill asks for them.
13
+ - Use the installed `devrites-engine` binary as the canonical runtime helper surface for orientation, gates, and state mutation.
14
+ - **Invocation and dispatch are different:** invoke means run a skill in this context; dispatch means start a fresh agent with `spawn_agent`, await it, and reconcile its result. Never describe inline skill work as a dispatch.
15
+ - For every DevRites specialist or writer dispatch, first call `spawn_agent` with the named `devrites-<role>` custom role. The matching project contract is `.codex/agents/devrites-<role>.toml`.
16
+ - If `spawn_agent` is callable but a named read-only role is unavailable, use generic `explorer` only when the host proves that run has a runtime-enforced read-only sandbox. Tell it to read `.codex/agents/devrites-<role>.toml`, follow its `developer_instructions`, and execute the unchanged packet. A missing read-only custom role is not evidence that spawning is unavailable.
17
+ - Never dispatch generic `worker` for `devrites-slice-wright` unless the host proves that worker run carries exact DevRites identity and the same `.wright-allowlist` enforcement as the named role. Codex reports a generic run as `agent_type=worker`, so the generated global hooks cannot prove that binding. Reject that unsafe rung and use the documented labelled inline wright path with `.reconcile-inline` plus the full reconcile gate.
18
+ - If the host cannot prove the generic explorer is runtime read-only, reject that rung too. Only when no spawn primitive exists or a higher-priority policy rejects a safe spawn may the root run the documented discipline inline. Label it `independence: fallback`, never call it independent, and apply every fallback risk gate. An unbound generic wright or unconfined generic explorer is such a safety rejection, not evidence that no agents exist.
19
+ - Wait for every required fresh-context dispatch before reconciling or advancing. A backgrounded or lost result is incomplete.
20
+ - Codex project hooks are installed in `.codex/hooks.json`; declared-leaf hooks are scoped inside `.codex/agents/devrites-*.toml`. Review and trust them with `/hooks` before relying on hook enforcement.
21
+ - When this skill asks a HITL question via `AskUserQuestion`: Codex's equivalent (`request_user_input`) exists only in Plan mode. Outside Plan mode, render the option set as a plain numbered list in chat and **end the turn** so the human answers: NEVER silently pick an option yourself; auto-picking is AFK's contract, gated by the `.devrites/AFK` sentinel.
22
+
23
+
24
+ # $rite-clarify: resolve product decisions
25
+
26
+ Run this required pass between spec and strategy. If the spec covers every material
27
+ decision, ask no questions. Otherwise stay until each material decision has an
28
+ owner. This phase settles behavior and constraints; `$rite-define` settles
29
+ implementation.
30
+
31
+ Reuse [`devrites-interview`](../devrites-interview/SKILL.md) in `/clarify mode`. Write
32
+ `decision-coverage.md` as scan evidence, not an interview transcript.
33
+
34
+ ## Rules consulted
35
+
36
+ Read `devrites-lib/reference/standards/core.md`, its `afk-hitl.md`, and
37
+ [`reference/decision-coverage.md`](reference/decision-coverage.md). Fresh evidence
38
+ dispatch uses
39
+ [`agents.md`](../devrites-lib/reference/standards/agents.md).
40
+
41
+ ## Rules
42
+
43
+ - Search code/docs/contracts first. Facts and reversible implementation/test choices
44
+ are agent-owned; ask only about product, scope, policy, irreversible risk, or human-only access.
45
+ - Enumerate the full topology before details so no sibling surface is omitted.
46
+ - Ask one coherent human-owned decision packet at a time. One packet may close several rows
47
+ only when owner and trade-off match; never ask permission for routine repair/retry.
48
+ - One scan may cap at five packets for cognitive load, but readiness has no question cap:
49
+ re-scan until clear.
50
+ - Material assumptions carry evidence, confidence, owner, validation, and consequence.
51
+
52
+ ## Workflow
53
+
54
+ 0. **Orient.** Run `devrites-engine preamble` and `snapshot`. Require `spec.md` plus
55
+ `Spec gate: passed`; otherwise STOP → `$rite-spec`. For a later-phase retrofit, run
56
+ `devrites-engine clarify-return enter <slug>` **before any pause**; this persists the
57
+ return cursor and enters `Phase: clarify`.
58
+ 1. **Enumerate topology** from the spec, references, live code, and prior decisions: actors,
59
+ journeys/components, states, data lifecycles, interfaces/integrations, operations, and
60
+ proof. Add omitted surfaces to the spec. **Completion:** every material surface appears
61
+ once with a source or canonical spec reference.
62
+ 2. **Scan coverage** with `devrites-interview /clarify mode` and the reference taxonomy.
63
+ Mark each surface Clear/Partial/Missing with evidence; include must-NOT and out-of-scope
64
+ behavior. Unmentioned never means not applicable. **Completion:** the matrix records every
65
+ surface with evidence.
66
+ 3. **Eliminate factual unknowns** through code intelligence, project/decision docs,
67
+ manifests/lockfiles, and authoritative external docs. Dispatch independent topology/fact
68
+ questions to `devrites-evidence-scout` (maximum three at once), await the cited dossiers,
69
+ and reconcile them in the root context. The root folds accepted facts into `spec.md` or
70
+ `assumptions.md`; the scout never asks or writes. **Completion:** each factual unknown is
71
+ source-backed or reclassified as an owned decision/assumption.
72
+ 4. **Audit assumptions and decisions.** Record the fields required above. For high-cost or
73
+ hard-to-reverse product/constraint choices, present two or three viable options, recommendation
74
+ first. A genuinely undecidable behavior may take one bounded `$rite-prototype` detour.
75
+ 5. **Close human-owned gaps** using the shared option-set contract: one highest-impact packet
76
+ per turn. Persist answers immediately in `spec.md` plus `decisions.md`/`questions.md`.
77
+ AFK remains within its gate ceiling; irreversible risk and principle exceptions pause.
78
+ 6. **Re-scan after edits** until each material row is `closed`, `agent-owned`,
79
+ `not-applicable`, or justified `deferred-nonblocking` with owner and validation gate.
80
+ Partial/Missing, an unowned material assumption, or an open blocking/escalating question
81
+ means `NEEDS CLARIFICATION`.
82
+ 7. **Write the verdict.** Update `decision-coverage.md`; success requires exactly
83
+ `Decision coverage: CLEAR`. Normal state is `Phase: clarify`, `Next step: $rite-temper`.
84
+ A contract-neutral retrofit runs `devrites-engine clarify-return restore <slug>`; a
85
+ changed behavior/acceptance contract leaves the return cursor unconsumed, writes
86
+ `drift.md`, and routes `$rite-plan repair`. Normal first-pass flow sets `$rite-temper`.
87
+ 8. **STOP.** Run `devrites-engine progress`; hand off only on `CLEAR`.
88
+
89
+ ## Output
90
+
91
+ Run `devrites-engine progress`, then use the shared completion reply contract
92
+ ([`devrites-lib/reference/reply-contract.md`](../devrites-lib/reference/reply-contract.md)):
93
+
94
+ ```text
95
+ Done: decision coverage closed for <slug>; <n> topology surfaces scanned.
96
+ Changed: decision-coverage.md, spec.md, decisions.md, assumptions.md, questions.md
97
+ Evidence: Decision coverage: CLEAR; human packets <n>; agent-owned facts <n>
98
+ Open: none blocking; deferred-nonblocking <n>
99
+ Next: $rite-temper
100
+ Record: .devrites/work/<slug>/decision-coverage.md
101
+ ↻ Hygiene: /clear before $rite-temper
102
+ ```
103
+
104
+ If not clear, name the exact rows and next genuine decision packet. An objective spec defect
105
+ or factual search task never routes through `$rite-resolve`.
@@ -0,0 +1,59 @@
1
+ # Decision coverage contract
2
+
3
+ `decision-coverage.md` proves a topology-first scan ran; reference canonical IDs instead of
4
+ duplicating their prose.
5
+
6
+ ## Coverage taxonomy
7
+
8
+ For each material surface scan: outcome/scope/must-NOT; behavior, permissions, and all states;
9
+ domain/data lifecycle/invariants/order/concurrency; interfaces/integrations and failure
10
+ contracts; security/privacy/compliance/accessibility/performance/reliability/compatibility;
11
+ configuration/observability/support/rollout/rollback; and executable acceptance proof,
12
+ environment, credentials/approvals, and evidence limits.
13
+
14
+ ## Status vocabulary
15
+
16
+ - `closed`: the canonical artifact records the decision.
17
+ - `agent-owned`: a reversible technical choice is explicitly delegated to define/vet.
18
+ - `not-applicable`: evidence shows the dimension does not apply.
19
+ - `deferred-nonblocking`: pre-code evidence is impossible or the item is an explicit
20
+ non-goal; owner and validation gate are named.
21
+
22
+ `Partial`, `Missing`, open, unknown, or ownerless rows never produce `CLEAR`.
23
+
24
+ ## Artifact shape
25
+
26
+ ```markdown
27
+ # Decision coverage
28
+
29
+ Decision coverage: <CLEAR | NEEDS CLARIFICATION>
30
+ Coverage inputs SHA-256: <exact value from `devrites-engine readiness-digest coverage <slug>`>
31
+
32
+ ## Topology
33
+ | Surface | Kind | Related IDs | Evidence |
34
+ | --- | --- | --- | --- |
35
+
36
+ ## Coverage matrix
37
+ | Surface | Dimension | Status | Canonical reference | Owner / validation gate | Consequence if wrong |
38
+ | --- | --- | --- | --- | --- | --- |
39
+
40
+ ## Assumption audit
41
+ | Assumption | Evidence | Confidence | Owner | Validation | Consequence if wrong |
42
+ | --- | --- | --- | --- | --- | --- |
43
+
44
+ ## Residual uncertainty
45
+ | Item | Why nonblocking | Owner | Validation gate |
46
+ | --- | --- | --- | --- |
47
+
48
+ ## Readiness verdict
49
+ No Partial, Missing, unowned material assumption, or unresolved blocking/escalating
50
+ question remains.
51
+ ```
52
+
53
+ Combine rows only when one decision and owner genuinely close them.
54
+
55
+ Run the digest command only after `brief.md`, `spec.md`, `decisions.md`,
56
+ `assumptions.md`, and `questions.md` are final for this clarification pass, then
57
+ copy its complete field line verbatim. The build gate recomputes the digest and
58
+ rejects stale coverage. Any open blocking, validating, or escalating question
59
+ also prevents `CLEAR`.
@@ -11,26 +11,29 @@ This is the Codex mirror of a DevRites skill. In Codex:
11
11
 
12
12
  - Load DevRites engineering standards from `.agents/skills/devrites-lib/reference/standards/`. Read `.agents/skills/devrites-lib/reference/standards/core.md` before workflow work, then load the other `.agents/skills/devrites-lib/reference/standards/*.md` files exactly when this skill asks for them.
13
13
  - Use the installed `devrites-engine` binary as the canonical runtime helper surface for orientation, gates, and state mutation.
14
- - When this skill asks for a DevRites specialist or writer agent, **explicitly** spawn the matching Codex custom agent from `.codex/agents/devrites-*.toml` through Codex subagents (`spawn_agent`), then wait for its result and reconcile it as the skill instructs. Do not do the review inline just because the instruction to spawn is embedded here: Codex under-fires embedded spawn/skill instructions (openai/codex #23496), so treat the spawn as required, not optional.
15
- - The independence of a fresh-context subagent is the point. If Codex genuinely cannot spawn subagents in the current surface, run the documented inline fallback and **label the result an inline fallback, not an independent review**: an inline pass shares the calling context and is weaker evidence.
16
- - Codex project hooks are installed in `.codex/hooks.json`. Review and trust them with `/hooks` before relying on hook enforcement.
14
+ - **Invocation and dispatch are different:** invoke means run a skill in this context; dispatch means start a fresh agent with `spawn_agent`, await it, and reconcile its result. Never describe inline skill work as a dispatch.
15
+ - For every DevRites specialist or writer dispatch, first call `spawn_agent` with the named `devrites-<role>` custom role. The matching project contract is `.codex/agents/devrites-<role>.toml`.
16
+ - If `spawn_agent` is callable but a named read-only role is unavailable, use generic `explorer` only when the host proves that run has a runtime-enforced read-only sandbox. Tell it to read `.codex/agents/devrites-<role>.toml`, follow its `developer_instructions`, and execute the unchanged packet. A missing read-only custom role is not evidence that spawning is unavailable.
17
+ - Never dispatch generic `worker` for `devrites-slice-wright` unless the host proves that worker run carries exact DevRites identity and the same `.wright-allowlist` enforcement as the named role. Codex reports a generic run as `agent_type=worker`, so the generated global hooks cannot prove that binding. Reject that unsafe rung and use the documented labelled inline wright path with `.reconcile-inline` plus the full reconcile gate.
18
+ - If the host cannot prove the generic explorer is runtime read-only, reject that rung too. Only when no spawn primitive exists or a higher-priority policy rejects a safe spawn may the root run the documented discipline inline. Label it `independence: fallback`, never call it independent, and apply every fallback risk gate. An unbound generic wright or unconfined generic explorer is such a safety rejection, not evidence that no agents exist.
19
+ - Wait for every required fresh-context dispatch before reconciling or advancing. A backgrounded or lost result is incomplete.
20
+ - Codex project hooks are installed in `.codex/hooks.json`; declared-leaf hooks are scoped inside `.codex/agents/devrites-*.toml`. Review and trust them with `/hooks` before relying on hook enforcement.
17
21
  - When this skill asks a HITL question via `AskUserQuestion`: Codex's equivalent (`request_user_input`) exists only in Plan mode. Outside Plan mode, render the option set as a plain numbered list in chat and **end the turn** so the human answers: NEVER silently pick an option yourself; auto-picking is AFK's contract, gated by the `.devrites/AFK` sentinel.
18
22
 
19
23
 
20
- # $rite-converge: make the code and the intent converge
24
+ # $rite-converge: compare live code with intent
21
25
 
22
- Read `spec.md` + `plan.md` + `tasks.md` as the **sole source of intent** (with
26
+ Read `spec.md`, `plan.md`, and `tasks.md` as the **sole source of intent** (with
23
27
  `.devrites/principles.md` as governing constraints), assess what the **live codebase**
24
28
  implements, and **append every unmet piece as a new traceable `SLICE-###`** at the
25
- bottom of `tasks.md` so `$rite-build` can finish it. The recovery bridge for work that fell
26
- out of sync with its plan: a half-built feature picked up cold, a `$rite-adopt`'d codebase
27
- that drifted from its derived spec, or a build that stalled mid-slice. **Read the active
29
+ bottom of `tasks.md` so `$rite-build` can finish it. Use this for a resumed half-built
30
+ feature, an adopted codebase that drifted from its derived spec, or a build that stalled
31
+ mid-slice. **Read the active
28
32
  workspace first**; if there's no `spec.md`/`plan.md`/`tasks.md`, tell the user which
29
33
  prerequisite skill to run.
30
34
 
31
- > **Not a diff tool.** `$rite-converge` assesses the **present state** of the code against
32
- > intent: no git, no branch comparison, no history. "What does this codebase do *now* vs
33
- > what the artifacts asked for", not "what changed since commit X". For a change-scoped
35
+ > **This is not a diff tool.** `$rite-converge` compares current code with intent. It
36
+ > does not use git history or compare branches. For a change-scoped
34
37
  > review use `$rite-review`; to prove a finished feature use `$rite-prove`.
35
38
 
36
39
  ## Rules consulted (read on demand from `.agents/skills/devrites-lib/reference/standards/`)
@@ -53,16 +56,20 @@ Pull on demand:
53
56
  - **Clean means byte-for-byte unchanged.** When the code already satisfies everything, leave
54
57
  `tasks.md` untouched (no empty convergence header) and report a clean result. Recommend
55
58
  `$rite-prove`.
56
- - **Intent is the artifacts, not your memory.** The spec/plan/tasks (+ principles) are the
59
+ - **Use artifacts as intent.** The spec, plan, tasks, and principles are the
57
60
  contract. If assessing reveals the *spec* is wrong (the code is right and the requirement is
58
61
  stale), that's **Spec Drift**: stop and route it through the Spec Drift Guard
59
62
  (`rite-build/reference/spec-drift-guard.md`) + a recorded decision; never paper over a spec
60
- bug by appending a task that "fixes" the code to a wrong requirement.
63
+ bug by appending a task that changes correct code to match a wrong requirement.
61
64
  - **Partial is not done.** Code that exists but is untested, half-wired, or covers only the
62
65
  happy path is an unmet gap: enqueue the remainder, don't round it up.
63
66
  - **Principles are non-negotiable.** A live violation of a declared invariant with no recorded
64
67
  exception is the top-severity gap, walked first. Absent/empty principles file → none declared
65
68
  → skip the check gracefully, never block for its absence.
69
+ - **Scout observes; root classifies and writes.** Use
70
+ [`agents.md`](../devrites-lib/reference/standards/agents.md). The evidence scout returns
71
+ live-code citations only; the controlling chat owns built/partial/absent calls and append-only
72
+ workspace changes.
66
73
 
67
74
  ## Workflow
68
75
  0. **Read `.agents/skills/devrites-lib/reference/standards/core.md`** first (the always-on
@@ -71,14 +78,16 @@ Pull on demand:
71
78
  any is missing, **STOP** and name the prerequisite (`$rite-spec` for a missing spec,
72
79
  `$rite-define` for a missing plan/tasks, `$rite-adopt` to onboard existing code). Do not
73
80
  produce partial output.
81
+ Require `decision-coverage.md` with `Decision coverage: CLEAR`; otherwise STOP →
82
+ `$rite-clarify`.
74
83
  2. **Load intent:** [`reference/convergence-assessment.md`](reference/convergence-assessment.md).
75
84
  From `spec.md`: buildable `AC-###` / `### Requirement:` scenarios (skip `## Success metrics`);
76
85
  from `plan.md`: architecture decisions + named touch-points (files/components the plan says
77
86
  get built); from `tasks.md`: existing slices + their `Satisfies:`; from
78
87
  `.devrites/principles.md`: the invariants.
79
88
  **Completion:** every buildable criterion, touch-point, slice output, and principle is in the assessment inventory.
80
- 3. **Run the mechanical backbone**, then read the code. `devrites-engine analyze` gives coverage +
81
- consistency; `devrites-engine coverage` gives the AC→slice→proven matrix. They catch *unmapped*
89
+ 3. **Run the mechanical checks**, then read the code. `devrites-engine analyze` gives coverage
90
+ and consistency; `devrites-engine coverage` gives the AC→slice→proven matrix. They catch *unmapped*
82
91
  criteria; they do **not** see whether mapped code is built and correct, for that,
83
92
  read the live code (code-intelligence index per `tooling.md`).
84
93
  ```bash
@@ -90,7 +99,9 @@ Pull on demand:
90
99
  [`reference/convergence-assessment.md`](reference/convergence-assessment.md)): every
91
100
  acceptance criterion / scenario, every plan touch-point, and every existing slice's stated
92
101
  Produces. A principle violated in the current code is its own top-severity gap.
93
- **Completion:** every inventory unit is classified once with live-code evidence.
102
+ Dispatch up to three independent inventory partitions to `devrites-evidence-scout` on the
103
+ same frozen candidate, await their dossiers, then reconcile the cited facts in the root
104
+ context. **Completion:** every inventory unit is classified once with live-code evidence.
94
105
  5. **Enqueue the remainder as new slices.** For each *partial* or *absent* unit, append a
95
106
  `## SLICE-###` (continue the numbering after the highest existing id) in the `rite-define`
96
107
  slice grammar, each with a `Satisfies:` line tracing to the AC/REQ it closes and a
@@ -99,10 +110,14 @@ Pull on demand:
99
110
  **Completion:** every partial/absent unit has one traceable appended slice, or the file is byte-for-byte unchanged.
100
111
  6. **Write append-only + bookkeeping.** Append the slice batch to `tasks.md` (nothing else in
101
112
  that file changes); refresh `traceability.md` (`devrites-engine coverage` → new rows for the
102
- appended slices); update `state.md` (`Phase: converge`, `Next step: $rite-build`; or, when
103
- nothing was unmet, `Next step: $rite-prove`). Append `decisions.md` for any material call.
113
+ appended slices). Appending a slice changes the plan input, so invalidate the prior vet:
114
+ update `state.md` to `Phase: plan`, `Next step: $rite-vet`, and set an existing
115
+ `eng-review.md` field to `Implementation readiness: NEEDS REPLAN`. When nothing was unmet,
116
+ leave the plan/vet verdict untouched and set `Next step: $rite-prove`. Append
117
+ `decisions.md` for any material call.
104
118
  7. **STOP.** Report units assessed, built / partial / absent counts, slices appended, and any
105
- principle violation found; recommend `$rite-build` (or `$rite-prove` if the code already
119
+ principle violation found; recommend `$rite-vet` when slices were appended (or
120
+ `$rite-prove` if the code already
106
121
  converged).
107
122
 
108
123
  ## Appended slice format
@@ -117,11 +132,9 @@ Convergence: 2026-07-07 # marks this as a convergence-appended slice, not a
117
132
  <all remaining canonical slice fields>
118
133
  ```
119
134
 
120
- > **Mid-flight discipline.** When tempted to rewrite an existing slice instead of appending, to
121
- > edit the code directly "while you're in there", to mark a happy-path-only implementation as
122
- > built, or to enqueue a task that bends the code to a spec you suspect is wrong: see
123
- > [`reference/anti-patterns.md`](reference/anti-patterns.md). Load it the moment you reach for
124
- > the excuse.
135
+ > **Mid-flight discipline.** Do not rewrite an existing slice, edit source, mark a
136
+ > happy-path-only implementation as built, or add work for a spec you suspect is wrong.
137
+ > See [`reference/anti-patterns.md`](reference/anti-patterns.md).
125
138
 
126
139
  ## Output
127
140
 
@@ -130,14 +143,15 @@ Convergence: 2026-07-07 # marks this as a convergence-appended slice, not a
130
143
  Default success shape:
131
144
  ```
132
145
  Done: convergence assessed for <slug>; <n> slices appended.
133
- Changed: tasks.md <appended|unchanged>, traceability.md, state.md
146
+ Changed: tasks.md <appended|unchanged>, traceability.md, state.md, eng-review.md <invalidated|unchanged>
134
147
  Evidence: units <built>/<total> built · <partial> partial · <absent> absent · principle violations 0
135
148
  Open: none
136
- Next: $rite-build
149
+ Next: $rite-vet
137
150
  Record: .devrites/work/<slug>/tasks.md
138
- ↻ Hygiene: /clear before $rite-build
151
+ ↻ Hygiene: /clear before $rite-vet
139
152
  ```
140
153
  When nothing was unmet, render the same green form with `Next: $rite-prove`.
141
154
  If spec drift or another blocker remains, use the shared `Stopped / blocked` form
142
155
  and route `Fix:` to `$rite-plan`; do not recommend `$rite-build`.
143
- **DO NOT write application code, rewrite existing slices, or edit spec.md/plan.md here**: convergence assesses and enqueues; `$rite-build` implements.
156
+ **DO NOT write application code, rewrite existing slices, or edit spec.md/plan.md here.**
157
+ This phase assesses and enqueues; `$rite-build` implements.
@@ -12,9 +12,13 @@ This is the Codex mirror of a DevRites skill. In Codex:
12
12
 
13
13
  - Load DevRites engineering standards from `.agents/skills/devrites-lib/reference/standards/`. Read `.agents/skills/devrites-lib/reference/standards/core.md` before workflow work, then load the other `.agents/skills/devrites-lib/reference/standards/*.md` files exactly when this skill asks for them.
14
14
  - Use the installed `devrites-engine` binary as the canonical runtime helper surface for orientation, gates, and state mutation.
15
- - When this skill asks for a DevRites specialist or writer agent, **explicitly** spawn the matching Codex custom agent from `.codex/agents/devrites-*.toml` through Codex subagents (`spawn_agent`), then wait for its result and reconcile it as the skill instructs. Do not do the review inline just because the instruction to spawn is embedded here: Codex under-fires embedded spawn/skill instructions (openai/codex #23496), so treat the spawn as required, not optional.
16
- - The independence of a fresh-context subagent is the point. If Codex genuinely cannot spawn subagents in the current surface, run the documented inline fallback and **label the result an inline fallback, not an independent review**: an inline pass shares the calling context and is weaker evidence.
17
- - Codex project hooks are installed in `.codex/hooks.json`. Review and trust them with `/hooks` before relying on hook enforcement.
15
+ - **Invocation and dispatch are different:** invoke means run a skill in this context; dispatch means start a fresh agent with `spawn_agent`, await it, and reconcile its result. Never describe inline skill work as a dispatch.
16
+ - For every DevRites specialist or writer dispatch, first call `spawn_agent` with the named `devrites-<role>` custom role. The matching project contract is `.codex/agents/devrites-<role>.toml`.
17
+ - If `spawn_agent` is callable but a named read-only role is unavailable, use generic `explorer` only when the host proves that run has a runtime-enforced read-only sandbox. Tell it to read `.codex/agents/devrites-<role>.toml`, follow its `developer_instructions`, and execute the unchanged packet. A missing read-only custom role is not evidence that spawning is unavailable.
18
+ - Never dispatch generic `worker` for `devrites-slice-wright` unless the host proves that worker run carries exact DevRites identity and the same `.wright-allowlist` enforcement as the named role. Codex reports a generic run as `agent_type=worker`, so the generated global hooks cannot prove that binding. Reject that unsafe rung and use the documented labelled inline wright path with `.reconcile-inline` plus the full reconcile gate.
19
+ - If the host cannot prove the generic explorer is runtime read-only, reject that rung too. Only when no spawn primitive exists or a higher-priority policy rejects a safe spawn may the root run the documented discipline inline. Label it `independence: fallback`, never call it independent, and apply every fallback risk gate. An unbound generic wright or unconfined generic explorer is such a safety rejection, not evidence that no agents exist.
20
+ - Wait for every required fresh-context dispatch before reconciling or advancing. A backgrounded or lost result is incomplete.
21
+ - Codex project hooks are installed in `.codex/hooks.json`; declared-leaf hooks are scoped inside `.codex/agents/devrites-*.toml`. Review and trust them with `/hooks` before relying on hook enforcement.
18
22
  - When this skill asks a HITL question via `AskUserQuestion`: Codex's equivalent (`request_user_input`) exists only in Plan mode. Outside Plan mode, render the option set as a plain numbered list in chat and **end the turn** so the human answers: NEVER silently pick an option yourself; auto-picking is AFK's contract, gated by the `.devrites/AFK` sentinel.
19
23
 
20
24
 
@@ -11,19 +11,23 @@ This is the Codex mirror of a DevRites skill. In Codex:
11
11
 
12
12
  - Load DevRites engineering standards from `.agents/skills/devrites-lib/reference/standards/`. Read `.agents/skills/devrites-lib/reference/standards/core.md` before workflow work, then load the other `.agents/skills/devrites-lib/reference/standards/*.md` files exactly when this skill asks for them.
13
13
  - Use the installed `devrites-engine` binary as the canonical runtime helper surface for orientation, gates, and state mutation.
14
- - When this skill asks for a DevRites specialist or writer agent, **explicitly** spawn the matching Codex custom agent from `.codex/agents/devrites-*.toml` through Codex subagents (`spawn_agent`), then wait for its result and reconcile it as the skill instructs. Do not do the review inline just because the instruction to spawn is embedded here: Codex under-fires embedded spawn/skill instructions (openai/codex #23496), so treat the spawn as required, not optional.
15
- - The independence of a fresh-context subagent is the point. If Codex genuinely cannot spawn subagents in the current surface, run the documented inline fallback and **label the result an inline fallback, not an independent review**: an inline pass shares the calling context and is weaker evidence.
16
- - Codex project hooks are installed in `.codex/hooks.json`. Review and trust them with `/hooks` before relying on hook enforcement.
14
+ - **Invocation and dispatch are different:** invoke means run a skill in this context; dispatch means start a fresh agent with `spawn_agent`, await it, and reconcile its result. Never describe inline skill work as a dispatch.
15
+ - For every DevRites specialist or writer dispatch, first call `spawn_agent` with the named `devrites-<role>` custom role. The matching project contract is `.codex/agents/devrites-<role>.toml`.
16
+ - If `spawn_agent` is callable but a named read-only role is unavailable, use generic `explorer` only when the host proves that run has a runtime-enforced read-only sandbox. Tell it to read `.codex/agents/devrites-<role>.toml`, follow its `developer_instructions`, and execute the unchanged packet. A missing read-only custom role is not evidence that spawning is unavailable.
17
+ - Never dispatch generic `worker` for `devrites-slice-wright` unless the host proves that worker run carries exact DevRites identity and the same `.wright-allowlist` enforcement as the named role. Codex reports a generic run as `agent_type=worker`, so the generated global hooks cannot prove that binding. Reject that unsafe rung and use the documented labelled inline wright path with `.reconcile-inline` plus the full reconcile gate.
18
+ - If the host cannot prove the generic explorer is runtime read-only, reject that rung too. Only when no spawn primitive exists or a higher-priority policy rejects a safe spawn may the root run the documented discipline inline. Label it `independence: fallback`, never call it independent, and apply every fallback risk gate. An unbound generic wright or unconfined generic explorer is such a safety rejection, not evidence that no agents exist.
19
+ - Wait for every required fresh-context dispatch before reconciling or advancing. A backgrounded or lost result is incomplete.
20
+ - Codex project hooks are installed in `.codex/hooks.json`; declared-leaf hooks are scoped inside `.codex/agents/devrites-*.toml`. Review and trust them with `/hooks` before relying on hook enforcement.
17
21
  - When this skill asks a HITL question via `AskUserQuestion`: Codex's equivalent (`request_user_input`) exists only in Plan mode. Outside Plan mode, render the option set as a plain numbered list in chat and **end the turn** so the human answers: NEVER silently pick an option yourself; auto-picking is AFK's contract, gated by the `.devrites/AFK` sentinel.
18
22
 
19
23
 
20
24
  # $rite-define: plan from the spec
21
25
 
22
- Read the active feature's `spec.md` and turn it into a buildable workspace: feature
23
- architecture, approach, a dependency-ordered set of **vertical slices**, traceability, and
24
- the state cursor. The spec is the WHAT/WHY (from `$rite-spec`); this is the HOW. Splitting
25
- spec, architecture, plan, tasks, and traceability keeps each file small and phase-owned.
26
- **No code here.**
26
+ Turn the active feature's `spec.md` into a buildable workspace with architecture, an
27
+ implementation approach, dependency-ordered **vertical slices**, traceability, and a
28
+ state cursor. The spec defines what and why; this phase defines how. Keep spec,
29
+ architecture, plan, tasks, and traceability in their phase-owned files. **Do not write
30
+ code here.**
27
31
 
28
32
  ## Rules consulted (read on demand from `.agents/skills/devrites-lib/reference/standards/`)
29
33
  Pull these via `Read` when shaping the plan:
@@ -36,14 +40,16 @@ Pull these via `Read` when shaping the plan:
36
40
  - **Requires a readied spec.** Read the active workspace first; if `.devrites/ACTIVE` is empty,
37
41
  the workspace has no `spec.md`, its readiness gate hasn't passed, or any spec-quality
38
42
  `checklists/<domain>.md` has an open CRITICAL → **STOP** and tell the user to run
39
- `$rite-spec <feature>` first. **DO NOT plan from a missing or unreadied spec.**
40
- - Prefer existing conventions; ask before adding a dependency or a second design system.
41
- - **Author section by section, not in one dump.** Write `architecture.md` / `plan.md` one section
42
- at a time and pause after each; a section resting on an open design choice or a shaky estimate can
43
- be deepened right there with a technique from
43
+ `$rite-spec <feature>` first. A missing or non-`CLEAR` `decision-coverage.md` routes to
44
+ `$rite-clarify`. **DO NOT plan from a missing, unreadied, or unclarified spec.**
45
+ - Apply `afk-hitl.md` decision ownership. Prefer conventions; source-check new dependencies or
46
+ design systems, asking only about licensing/cost/security or explicit policy.
47
+ - **Author one section at a time.** Write `architecture.md` and `plan.md` section by
48
+ section, pausing after each. For an open design choice or uncertain estimate, use a
49
+ relevant technique from
44
50
  [`elicitation.md`](../devrites-lib/reference/standards/elicitation.md) (Tournament for two viable
45
51
  designs, Delphi for the estimate) before it hardens into slices.
46
- - **Slice count is derived, never dictated.** The number of slices falls out of the work.
52
+ - **Derive the slice count from the work.**
47
53
  One per independently-shippable increment, sized by `slicing.md`, every acceptance
48
54
  criterion mapped to ≥1 slice. A user-named count is a hint at most: slice logically and,
49
55
  if your honest count differs, present it and why. Never pad or compress to hit a figure.
@@ -52,6 +58,9 @@ Pull these via `Read` when shaping the plan:
52
58
  crosses many files, don't fake vertical slices. Add a compatibility/adapter slice, migrate
53
59
  small green batches, then remove the old path. If a batch cannot stay green, use an
54
60
  integration branch plus a final verify slice.
61
+ - **Root writes; drafter proposes.** Use the file-backed fresh-context contract in
62
+ [`agents.md`](../devrites-lib/reference/standards/agents.md). The root owns architecture
63
+ decisions, human questions, approval, and every canonical artifact write.
55
64
 
56
65
  ## Workflow
57
66
  0. **Read `.agents/skills/devrites-lib/reference/standards/core.md`:** the always-on operating rules and anti-rationalizations.
@@ -65,30 +74,46 @@ Pull these via `Read` when shaping the plan:
65
74
  ```
66
75
  If there is no active workspace, no `spec.md`, `spec-skeleton` blocks, or its readiness gate hasn't passed →
67
76
  **STOP** and tell the user to run `$rite-spec <feature>` first.
77
+ If `decision-coverage.md` is absent or does not say `Decision coverage: CLEAR`,
78
+ **STOP** → `$rite-clarify`.
68
79
  1. **Read the spec:** `spec.md` (objective, requirements, acceptance, **placement**,
69
80
  design references, gaps/decisions), plus `references.md`, `decisions.md`,
70
- `assumptions.md`, **`strategy.md` if present** (the scope mode, deferred / out-of-scope
81
+ `assumptions.md`, `decision-coverage.md`, **`strategy.md` if present** (the scope mode, deferred / out-of-scope
71
82
  register, and pre-mortem risks from `$rite-temper`: cut slices to mitigate the top risks
72
83
  and respect the IN/OUT line; map coverage against the **hardened** spec), and
73
84
  **`design-brief.md` if the feature touches UI** (the UX/UI contract `$rite-spec` shaped:
74
85
  its key states, interaction model, and proof targets drive how UI slices are cut). If a blocking
75
- `[NEEDS CLARIFICATION]` remains, stop → `$rite-spec`.
76
- 2. **Decide the architecture + approach** (the HOW the spec deliberately omitted): write
86
+ `[NEEDS CLARIFICATION]` remains, stop → `$rite-clarify`.
87
+ 1a. **Draft from fresh context.** Freeze the planning inputs and dispatch
88
+ `devrites-plan-drafter` in `define` mode for one atomic candidate bundle:
89
+ `architecture.md`, `plan.md`, `tasks.md`, and `traceability.md`, including proof mapping.
90
+ Await and validate `agent-result/v1`. The drafter does not write or ask; any human-owned
91
+ choice returns to this root context.
92
+ 2. **Reconcile and decide the architecture + approach** (the HOW the spec deliberately
93
+ omitted). Validate the candidate against live seams and the following rules; the root writes
94
+ accepted content at step 6. Shape
77
95
  `architecture.md` for owning layer, boundaries, integration points, data/API/events,
78
96
  dependencies, risks, and affected areas; write only the build strategy in `plan.md`.
79
97
  Use a
80
98
  code-intelligence index if available (see
81
99
  `.agents/skills/devrites-lib/reference/standards/tooling.md`) for structure/impact; for the current API or behaviour of
82
100
  an external library/framework the architecture will rely on, consult context7 if available.
83
- Record significant options in `decisions.md` as `DEC-###` ADR entries.
84
- **Deep-modules check**, while sketching the major modules, look for opportunities
101
+ Record significant options as `DEC-###`. For high-cost/hard-to-reverse boundaries, data
102
+ models, public contracts, or dependencies, compare ≥2 viable approaches by drivers,
103
+ trade-offs, and consequences. Specify cross-boundary interfaces for independent work:
104
+ invariants, I/O, ordering/idempotency, errors, versioning, config, and relevant budgets.
105
+ **Deep-module check:** while sketching the major modules, look for opportunities
85
106
  to extract a **deep module**: a small, stable interface that hides a meaningful chunk
86
- of behavior, and is therefore independently testable. A *shallow* module (interface
87
- nearly as complex as its implementation) earns nothing; either deepen it or delete
88
- it. Where a slice will produce a deep module, confirm with the user which deep
89
- modules they want unit-tested in isolation (this informs the slice's "Tests to
90
- write/run" field).
91
- 3. **Slice into vertical tasks:** each delivers one observable capability end-to-end and
107
+ of behavior and is independently testable. A *shallow* module whose interface is
108
+ nearly as complex as its implementation adds no value; deepen it or delete
109
+ it. Put independently testable deep-module behavior in the slice's `Tests/proof`;
110
+ `$rite-vet` confirms the level.
111
+ 2a. **Foreseeable-decision sweep.** Inspect questions, assumptions, architecture, dependencies,
112
+ proof prerequisites, and proposed checkpoints. Search facts and decide reversible technical
113
+ calls. New product/acceptance/policy/irreversible-risk gaps return to `$rite-clarify`; a build
114
+ checkpoint survives only for unavailable pre-code evidence or mandatory action-time approval.
115
+ **Completion:** no known implementation choice is postponed for build to ask later.
116
+ 3. **Create vertical tasks:** each delivers one observable capability end to end and
92
117
  is verifiable on its own; the **count emerges from the work, not a target number**;
93
118
  first slice = thinnest useful end-to-end path; order by dependency (risk-first within a
94
119
  tier). For a broad mechanical refactor, use expand → migrate batches → contract instead
@@ -99,12 +124,14 @@ Pull these via `Read` when shaping the plan:
99
124
  first, see `devrites-frontend-craft/reference/fullstack.md`). **For UI slices, name which
100
125
  of `design-brief.md`'s key states + interaction the slice delivers, and give it a binary
101
126
  **Visual acceptance** target (state × viewport × input + target R-id/brief rule)**, so
102
- the design contract maps onto slices, not just acceptance criteria.
103
- 4. **Map coverage:** every `AC-###` spec acceptance criterion maps to ≥1 `SLICE-###`
127
+ the design contract maps to slices as well as acceptance criteria.
128
+ `Tests/proof` names exact command, cwd, expected signal, prerequisites, and mutable
129
+ provenance inputs; `$rite-vet` preflights them.
130
+ 4. **Map coverage and wiring:** every `AC-###` spec acceptance criterion maps to ≥1 `SLICE-###`
104
131
  (`rite-spec/reference/acceptance-criteria.md`); no orphaned criteria, no slice without a
105
132
  criterion. Lift covered/backstop `Edge Coverage` rows and resolved `Prohibitions (must-NOT)`
106
- rows into `traceability.md` and `test-plan.md`; unresolved rows go to `assumptions.md` with
107
- their gate/owner.
133
+ rows into `traceability.md` and `test-plan.md`; unresolved rows get a gate/owner. Each
134
+ cross-slice boundary names producer, consumer, invariant, integration step, and proof.
108
135
  4a. **Parallel-lane sanity check**: after drafting `tasks.md` but before asking for plan
109
136
  approval, run the advisory lane planner:
110
137
  ```bash
@@ -121,7 +148,7 @@ Pull these via `Read` when shaping the plan:
121
148
  S="$(cat .devrites/ACTIVE 2>/dev/null)"
122
149
  devrites-engine coverage "$S" > ".devrites/work/$S/traceability.md"
123
150
  ```
124
- 5. **Complexity & deviations gate:** justify anything off DevRites defaults (new dep,
151
+ 5. **Complexity and deviations gate:** justify anything outside DevRites defaults (new dep,
125
152
  extra abstraction, second design system) in the plan; if you can't justify it, simplify.
126
153
  **Principles conformance:** read `.devrites/principles.md` (if present) and confirm the
127
154
  approach honors every declared invariant. A plan that conflicts with one is not "a deviation
@@ -137,11 +164,12 @@ Pull these via `Read` when shaping the plan:
137
164
  S="$(cat .devrites/ACTIVE 2>/dev/null)"
138
165
  devrites-engine analyze "$S"
139
166
  ```
140
- 7. **Readiness gate** (bottom of plan-template): every acceptance criterion covered by a
141
- slice, dependency order acyclic + risk-first, no unjustified deviation, rollback for
142
- every destructive/migration step. **Stop and confirm** before code. Render the review-before-code
167
+ 7. **Readiness gate** (plan-template): require CLEAR coverage, complete acceptance and
168
+ cross-slice wiring/proof, risk-first acyclic order, justified deviations, rollback, and a
169
+ closed decision sweep. **Stop and confirm** before code. Render the review-before-code
143
170
  digest first: `Intent` (one sentence from the spec), `Done means` (acceptance coverage x/y),
144
- `Plan sanity` (slice count + riskiest boundary/gate), and `Build exactly this?` (yes → approve;
171
+ `Plan sanity` (slice count + riskiest boundary/gate), `Expected build interruptions`
172
+ (`none` or only justified action-time gates), and `Build exactly this?` (yes → approve;
145
173
  no → `$rite-plan revise`). When the human confirms the plan, write `Plan approved: <iso>` to
146
174
  `state.md` (see [state-workspace](../rite-spec/reference/state-workspace.md)); `$rite-build`
147
175
  checks this exists before building.
@@ -153,7 +181,8 @@ Use the canonical slice grammar in
153
181
  Every slice must satisfy that complete field set; phase-specific gate details live in
154
182
  [`reference/gates.md`](reference/gates.md).
155
183
 
156
- > **Mid-flight discipline.** When tempted to skip vertical slicing, coverage mapping, or dependency-order discipline: see [`anti-patterns`](reference/anti-patterns.md) (Common Rationalizations + Red Flags). Load it the moment you reach for the excuse.
184
+ > **Mid-flight discipline.** Do not skip vertical slicing, coverage mapping, or
185
+ > dependency ordering. See [`anti-patterns`](reference/anti-patterns.md).
157
186
 
158
187
  ## Output
159
188
 
@@ -1,12 +1,10 @@
1
1
  # Gate taxonomy: advisory · validating · blocking · escalating
2
2
 
3
- DevRites uses a four-gate model for HITL pauses, adapted from the regulated-agentic-workflow
4
- governance pattern. Picking the right gate for each `Mode: HITL` slice is the difference
5
- between a workflow that catches real risk and one that becomes a review queue.
3
+ DevRites uses four HITL gates, adapted from the regulated-agentic-workflow governance
4
+ pattern. Choose the gate for each `Mode: HITL` slice by its risk and review needs.
6
5
 
7
- > **Default failure mode:** marking every HITL slice as `blocking`. The same reviewer ends
8
- > up approving low-stakes and high-stakes items at the same priority and the gate becomes
9
- > a queue. Mix gate types per slice; most plans use 2-3 of the 4.
6
+ > **Do not mark every HITL slice as `blocking`.** That gives low-stakes and high-stakes
7
+ > items the same priority. Most plans use 2 or 3 gate types.
10
8
 
11
9
  ## The four gates
12
10
 
@@ -39,7 +37,7 @@ validating question; the feature does not seal until the entry is resolved. An o
39
37
  **Example:** "Schema migration adds a non-null column with a default. Backfill plan is
40
38
  recorded; reviewer should confirm the default is the right one for archived rows."
41
39
 
42
- **SLA:** `4h`: the work continues but the validating queue should drain within hours,
40
+ **SLA:** `4h`: the work continues, but the validating queue should clear within hours,
43
41
  not days.
44
42
 
45
43
  ### blocking
@@ -56,8 +54,8 @@ STOPs. The slice is not built until `$rite-resolve` lands.
56
54
  - Auth/authz boundary change.
57
55
  - Public API break.
58
56
  - Spec drift that changes acceptance criteria.
59
- - Tests / types / lint are red and the agent cannot tell whether the slice's contract is
60
- wrong or the failing code is.
57
+ - Bounded debug recovery proved the remaining red test/type/lint failure is a genuine
58
+ product-contract ambiguity the human must decide.
61
59
 
62
60
  **SLA:** `15m`: synchronous gates demand fast turnaround; otherwise treat the work as
63
61
  genuinely blocked and re-plan around it.
@@ -79,7 +77,9 @@ it's `blocking`.
79
77
 
80
78
  ## Picking the gate
81
79
 
82
- Apply this decision tree per HITL slice:
80
+ First apply `afk-hitl.md` decision ownership: an objective implementation/tooling failure
81
+ or reversible technical choice is agent work and gets no human gate. Then apply this
82
+ decision tree per HITL slice:
83
83
 
84
84
  1. **Can the slice ship safely without the answer?**
85
85
  - Yes → `advisory`.
@@ -117,8 +117,9 @@ defaults and the always-pause rules:
117
117
  | `[advisory, validating]` | log + proceed | build + queue | pause | pause |
118
118
  | `[advisory, validating, blocking]` | log + proceed | build + queue | log + proceed* | pause |
119
119
 
120
- \* but **never** for destructive migrations, auth/authz boundary changes, public API
121
- breaks, or red tests/types/lint. Those always pause. See
120
+ \* but **never** for destructive migrations, auth/authz boundary changes, or public API
121
+ breaks. Red tests/types/lint remain hard build gates and must clear bounded recovery before
122
+ the next slice; only a resulting human-owned ambiguity becomes a pause. See
122
123
  [`.agents/skills/devrites-lib/reference/standards/afk-hitl.md`](../../devrites-lib/reference/standards/afk-hitl.md) for the irreversible-risk
123
124
  list.
124
125
 
@@ -127,8 +128,7 @@ shortcut.
127
128
 
128
129
  ## Anti-patterns
129
130
 
130
- - **One gate for everything.** Validates becomes a queue, blocks all work behind one
131
- reviewer. Pick gates per slice.
131
+ - **One gate for everything.** This puts all work behind one reviewer. Pick gates per slice.
132
132
  - **Marking a destructive migration `validating` to "keep the loop moving".** Destructive
133
133
  work is `blocking` regardless of the urge to ship.
134
134
  - **`advisory` as a synonym for "I'm not sure but I don't want to ask".** If the slice
@@ -143,7 +143,8 @@ shortcut.
143
143
  Mode: HITL
144
144
  Gate: blocking
145
145
  SLA: 15m
146
- Checkpoint: Confirm (user_id, created_at) composite index choice vs two single-col indexes.
146
+ Checkpoint: Approve irreversible deletion of legacy records after the dry-run count exists;
147
+ that evidence cannot exist before the migration rehearsal.
147
148
  Blocked by: SLICE-002
148
149
  ...
149
150
  ```