devrites 3.0.7 → 3.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 (484) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/README.md +82 -50
  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/0012-semantic-workspace-upgrades.md +77 -0
  12. package/docs/adr/README.md +4 -0
  13. package/docs/agents/triage-labels.md +7 -7
  14. package/docs/architecture.md +179 -141
  15. package/docs/cli.md +47 -12
  16. package/docs/command-map.md +61 -38
  17. package/docs/engine/agent-contract.md +92 -15
  18. package/docs/engine/commands.md +248 -72
  19. package/docs/engine/state-schema.md +52 -23
  20. package/docs/engine/workspace-schema.md +103 -15
  21. package/docs/extensions.md +1 -1
  22. package/docs/flow.md +86 -51
  23. package/docs/harness-compliance.md +29 -5
  24. package/docs/orchestration.md +107 -79
  25. package/docs/quick-reference.md +11 -3
  26. package/docs/release.md +4 -3
  27. package/docs/skills.md +67 -38
  28. package/docs/usage.md +84 -39
  29. package/engine/cmd/releasepack/main.go +219 -0
  30. package/engine/cmd/releasepack/main_test.go +170 -0
  31. package/engine/commands.go +170 -23
  32. package/engine/git_guard.go +187 -0
  33. package/engine/git_guard_test.go +283 -0
  34. package/engine/hookpolicy.go +53 -55
  35. package/engine/hookpolicy_test.go +91 -1
  36. package/engine/hooks.go +296 -75
  37. package/engine/hooks_events_test.go +276 -6
  38. package/engine/hooks_workspace.go +640 -159
  39. package/engine/internal/devritespaths/paths.go +65 -10
  40. package/engine/internal/devritespaths/paths_test.go +110 -0
  41. package/engine/internal/doctor/doctor.go +153 -23
  42. package/engine/internal/doctor/doctor_test.go +74 -0
  43. package/engine/internal/forge/forge.go +940 -0
  44. package/engine/internal/forge/forge_test.go +576 -0
  45. package/engine/internal/forge/git.go +245 -0
  46. package/engine/internal/forge/liveness_unix.go +48 -0
  47. package/engine/internal/forge/liveness_windows.go +67 -0
  48. package/engine/internal/forge/manifest.go +402 -0
  49. package/engine/internal/gate/gate.go +90 -71
  50. package/engine/internal/gate/gate_test.go +71 -2
  51. package/engine/internal/harness/compliance.go +18 -24
  52. package/engine/internal/harness/harness.go +37 -44
  53. package/engine/internal/harness/harness_test.go +21 -5
  54. package/engine/internal/install/install.go +486 -38
  55. package/engine/internal/install/install_test.go +383 -10
  56. package/engine/internal/iohooks/iohooks.go +350 -59
  57. package/engine/internal/iohooks/iohooks_test.go +421 -1
  58. package/engine/internal/lib/buildreadiness.go +43 -18
  59. package/engine/internal/lib/clarifyreturn.go +91 -0
  60. package/engine/internal/lib/clarifyreturn_test.go +123 -0
  61. package/engine/internal/lib/context.go +54 -15
  62. package/engine/internal/lib/cursor_compat_test.go +8 -0
  63. package/engine/internal/lib/extensions.go +2 -3
  64. package/engine/internal/lib/gitauthority.go +601 -0
  65. package/engine/internal/lib/gitauthority_test.go +346 -0
  66. package/engine/internal/lib/jsonout.go +25 -11
  67. package/engine/internal/lib/jsonout_test.go +16 -0
  68. package/engine/internal/lib/lanes.go +14 -8
  69. package/engine/internal/lib/observability_test.go +358 -0
  70. package/engine/internal/lib/packageexistence.go +151 -35
  71. package/engine/internal/lib/packageexistence_test.go +163 -0
  72. package/engine/internal/lib/progress.go +11 -9
  73. package/engine/internal/lib/provenance.go +462 -0
  74. package/engine/internal/lib/provenance_test.go +154 -0
  75. package/engine/internal/lib/readiness_contract.json +118 -0
  76. package/engine/internal/lib/readinessartifact.go +533 -0
  77. package/engine/internal/lib/readinessartifact_test.go +422 -0
  78. package/engine/internal/lib/reconcile.go +712 -88
  79. package/engine/internal/lib/reconcile_test.go +335 -16
  80. package/engine/internal/lib/recoveryattempts.go +298 -0
  81. package/engine/internal/lib/recoveryattempts_test.go +215 -0
  82. package/engine/internal/lib/resolve.go +23 -19
  83. package/engine/internal/lib/runbook_context_test.go +20 -0
  84. package/engine/internal/lib/session.go +701 -9
  85. package/engine/internal/lib/session_test.go +80 -13
  86. package/engine/internal/lib/testintegrity.go +33 -37
  87. package/engine/internal/lib/testintegrity_test.go +63 -1
  88. package/engine/internal/migrate/migrate.go +81 -1
  89. package/engine/internal/migrate/migrate_test.go +22 -1
  90. package/engine/internal/reason/reason.go +180 -0
  91. package/engine/internal/reason/reason_test.go +35 -0
  92. package/engine/internal/rootfacts/facts.go +466 -0
  93. package/engine/internal/rootfacts/facts_test.go +306 -0
  94. package/engine/internal/safepath/safepath.go +55 -0
  95. package/engine/internal/safepath/safepath_test.go +69 -0
  96. package/engine/internal/safepath/safepath_windows_test.go +26 -0
  97. package/engine/internal/state/clarify_transition.go +165 -0
  98. package/engine/internal/state/clarify_transition_test.go +130 -0
  99. package/engine/internal/state/cmd/workflowmanifest/main.go +12 -8
  100. package/engine/internal/state/cursor.go +58 -0
  101. package/engine/internal/state/cursor_test.go +42 -1
  102. package/engine/internal/state/feature.go +35 -48
  103. package/engine/internal/state/schema.go +90 -37
  104. package/engine/internal/state/snapshot.go +18 -2
  105. package/engine/internal/state/state_test.go +187 -7
  106. package/engine/internal/state/status.go +48 -11
  107. package/engine/internal/state/workflow_manifest.json +231 -50
  108. package/engine/internal/toolpolicy/classifier.go +533 -0
  109. package/engine/internal/toolpolicy/classifier_test.go +424 -0
  110. package/engine/internal/toolpolicy/git.go +616 -0
  111. package/engine/internal/toolpolicy/scanner.go +382 -0
  112. package/engine/main.go +160 -77
  113. package/engine/observability_cli_test.go +52 -0
  114. package/engine/root_routing_test.go +277 -0
  115. package/engine/testdata/golden/TestParityBuildReadiness/arg=approved.golden +1 -1
  116. package/engine/testdata/golden/TestParityBuildReadiness/arg=emptystatus.golden +1 -1
  117. package/engine/testdata/golden/TestParityBuildReadiness/arg=legacycontract.golden +1 -0
  118. package/engine/testdata/golden/TestParityBuildReadiness/arg=noclarify.golden +1 -0
  119. package/engine/testdata/golden/TestParityBuildReadiness/arg=novet.golden +1 -0
  120. package/engine/testdata/golden/TestParityBuildReadiness/arg=stalevet.golden +1 -0
  121. package/engine/testdata/golden/TestParityBuildReadiness/arg=trailhash.golden +1 -1
  122. package/engine/testdata/golden/TestParityBuildReadiness/arg=trailpipe.golden +1 -1
  123. package/engine/testdata/golden/TestParityBuildReadiness/arg=vetnotready.golden +1 -0
  124. package/engine/testdata/golden/TestParityProgress/arg=allbuilt.golden +1 -1
  125. package/engine/testdata/golden/TestParityProgress/arg=done.golden +1 -1
  126. package/engine/testdata/golden/TestParityProgress/arg=mid.golden +1 -1
  127. package/engine/testdata/golden/TestParityProgress/arg=nophase.golden +1 -1
  128. package/engine/testdata/golden/TestParityProgress/arg=noslice.golden +1 -1
  129. package/engine/testdata/golden/TestParityProgress/arg=plan.golden +1 -1
  130. package/engine/testdata/golden/TestParityProgress/arg=seal.golden +1 -1
  131. package/engine/testdata/golden/TestParityReconcile/check-clean.golden +1 -1
  132. package/engine/testdata/golden/TestParityReconcile/inline-fallback.golden +1 -0
  133. package/engine/testdata/golden/TestParityReconcile/snapshot-no-allowlist.golden +1 -0
  134. package/engine/testdata/golden/TestParityWrightScope/devrites-edit-denied.golden +2 -0
  135. package/engine/testdata/golden/TestParityWrightScope/out-of-scope-enforce-denies.golden +1 -1
  136. package/engine/tests/adr_0011_define_plan_test.go +30 -0
  137. package/engine/tests/budget_test.go +19 -8
  138. package/engine/tests/concurrency_cli_test.go +7 -1
  139. package/engine/tests/doctor_cli_test.go +148 -2
  140. package/engine/tests/forge_cli_test.go +463 -0
  141. package/engine/tests/gate_test.go +63 -8
  142. package/engine/tests/hook_test.go +260 -8
  143. package/engine/tests/hooks_io_test.go +94 -3
  144. package/engine/tests/json_contract_test.go +127 -2
  145. package/engine/tests/migrate_cli_test.go +2 -2
  146. package/engine/tests/parity_buildreadiness_test.go +167 -10
  147. package/engine/tests/parity_learnings_test.go +16 -17
  148. package/engine/tests/parity_reconcile_test.go +20 -17
  149. package/engine/tests/parity_resolve_test.go +12 -11
  150. package/engine/tests/parity_test.go +21 -17
  151. package/pack/.claude/agents/devrites-code-reviewer.md +62 -48
  152. package/pack/.claude/agents/devrites-devex-reviewer.md +69 -53
  153. package/pack/.claude/agents/devrites-doubt-reviewer.md +29 -22
  154. package/pack/.claude/agents/devrites-evidence-scout.md +69 -0
  155. package/pack/.claude/agents/devrites-forge-judge.md +74 -61
  156. package/pack/.claude/agents/devrites-frontend-reviewer.md +48 -39
  157. package/pack/.claude/agents/devrites-performance-reviewer.md +49 -40
  158. package/pack/.claude/agents/devrites-plan-drafter.md +73 -0
  159. package/pack/.claude/agents/devrites-plan-reviewer.md +80 -47
  160. package/pack/.claude/agents/devrites-proof-runner.md +74 -0
  161. package/pack/.claude/agents/devrites-retrospector.md +48 -45
  162. package/pack/.claude/agents/devrites-security-auditor.md +46 -36
  163. package/pack/.claude/agents/devrites-simplifier-reviewer.md +50 -46
  164. package/pack/.claude/agents/devrites-slice-wright.md +153 -165
  165. package/pack/.claude/agents/devrites-spec-reviewer.md +34 -32
  166. package/pack/.claude/agents/devrites-strategy-reviewer.md +63 -34
  167. package/pack/.claude/agents/devrites-test-analyst.md +40 -30
  168. package/pack/.claude/agents/devrites-upgrade-planner.md +100 -0
  169. package/pack/.claude/settings.json +2 -1
  170. package/pack/.claude/skills/devrites-audit/SKILL.md +40 -61
  171. package/pack/.claude/skills/devrites-debug-recovery/SKILL.md +24 -13
  172. package/pack/.claude/skills/devrites-debug-recovery/reference/build-the-loop.md +24 -21
  173. package/pack/.claude/skills/devrites-debug-recovery/reference/cleanup-and-classify.md +34 -6
  174. package/pack/.claude/skills/devrites-debug-recovery/reference/instrumentation.md +2 -2
  175. package/pack/.claude/skills/devrites-doubt/SKILL.md +25 -17
  176. package/pack/.claude/skills/devrites-interview/SKILL.md +53 -52
  177. package/pack/.claude/skills/devrites-lib/SKILL.md +12 -9
  178. package/pack/.claude/skills/devrites-lib/reference/intent-map.md +4 -2
  179. package/pack/.claude/skills/devrites-lib/reference/parallel-dispatch.md +82 -137
  180. package/pack/.claude/skills/devrites-lib/reference/reply-contract.md +8 -1
  181. package/pack/.claude/skills/devrites-lib/reference/standards/README.md +38 -55
  182. package/pack/.claude/skills/devrites-lib/reference/standards/afk-hitl.md +53 -27
  183. package/pack/.claude/skills/devrites-lib/reference/standards/agents.md +200 -190
  184. package/pack/.claude/skills/devrites-lib/reference/standards/anti-patterns.md +5 -15
  185. package/pack/.claude/skills/devrites-lib/reference/standards/ci-cd.md +27 -58
  186. package/pack/.claude/skills/devrites-lib/reference/standards/code-review.md +16 -52
  187. package/pack/.claude/skills/devrites-lib/reference/standards/coding-style.md +2 -10
  188. package/pack/.claude/skills/devrites-lib/reference/standards/context-hygiene.md +18 -61
  189. package/pack/.claude/skills/devrites-lib/reference/standards/core.md +23 -18
  190. package/pack/.claude/skills/devrites-lib/reference/standards/deprecation.md +17 -57
  191. package/pack/.claude/skills/devrites-lib/reference/standards/development-workflow.md +4 -33
  192. package/pack/.claude/skills/devrites-lib/reference/standards/git-workflow.md +4 -20
  193. package/pack/.claude/skills/devrites-lib/reference/standards/hooks.md +3 -14
  194. package/pack/.claude/skills/devrites-lib/reference/standards/patterns.md +9 -25
  195. package/pack/.claude/skills/devrites-lib/reference/standards/performance.md +0 -9
  196. package/pack/.claude/skills/devrites-lib/reference/standards/principles.md +1 -3
  197. package/pack/.claude/skills/devrites-lib/reference/standards/security.md +17 -7
  198. package/pack/.claude/skills/devrites-lib/reference/standards/testing.md +1 -27
  199. package/pack/.claude/skills/devrites-lib/reference/standards/tooling.md +46 -50
  200. package/pack/.claude/skills/devrites-lib/reference/workspace-artifact-schema.md +40 -10
  201. package/pack/.claude/skills/devrites-source-driven/SKILL.md +23 -22
  202. package/pack/.claude/skills/rite/SKILL.md +10 -6
  203. package/pack/.claude/skills/rite/reference/menu.md +13 -7
  204. package/pack/.claude/skills/rite-adopt/SKILL.md +33 -37
  205. package/pack/.claude/skills/rite-autocomplete/SKILL.md +33 -28
  206. package/pack/.claude/skills/rite-autocomplete/reference/loop.md +21 -21
  207. package/pack/.claude/skills/rite-autocomplete/reference/stop-conditions.md +15 -6
  208. package/pack/.claude/skills/rite-build/SKILL.md +35 -30
  209. package/pack/.claude/skills/rite-build/reference/afk-discipline.md +41 -39
  210. package/pack/.claude/skills/rite-build/reference/evidence-standard.md +10 -0
  211. package/pack/.claude/skills/rite-build/reference/forge.md +186 -156
  212. package/pack/.claude/skills/rite-build/reference/one-slice-cycle.md +4 -3
  213. package/pack/.claude/skills/rite-build/reference/phase-contract.md +96 -175
  214. package/pack/.claude/skills/rite-build/reference/spec-drift-guard.md +10 -4
  215. package/pack/.claude/skills/rite-build/reference/wright-dispatch.md +129 -134
  216. package/pack/.claude/skills/rite-clarify/SKILL.md +90 -0
  217. package/pack/.claude/skills/rite-clarify/reference/decision-coverage.md +61 -0
  218. package/pack/.claude/skills/rite-converge/SKILL.md +35 -25
  219. package/pack/.claude/skills/rite-define/SKILL.md +58 -32
  220. package/pack/.claude/skills/rite-define/reference/gates.md +16 -15
  221. package/pack/.claude/skills/rite-define/reference/plan-template.md +18 -8
  222. package/pack/.claude/skills/rite-frame/reference/failure-modes.md +22 -24
  223. package/pack/.claude/skills/rite-plan/SKILL.md +47 -16
  224. package/pack/.claude/skills/rite-plan/reference/task-breakdown.md +4 -0
  225. package/pack/.claude/skills/rite-polish/SKILL.md +27 -23
  226. package/pack/.claude/skills/rite-prototype/SKILL.md +25 -26
  227. package/pack/.claude/skills/rite-prove/SKILL.md +27 -17
  228. package/pack/.claude/skills/rite-resolve/SKILL.md +12 -11
  229. package/pack/.claude/skills/rite-resolve/reference/answer-protocol.md +3 -0
  230. package/pack/.claude/skills/rite-review/SKILL.md +37 -28
  231. package/pack/.claude/skills/rite-seal/reference/phase-contract.md +27 -92
  232. package/pack/.claude/skills/rite-seal/reference/risk-and-rollback.md +13 -0
  233. package/pack/.claude/skills/rite-ship/reference/design-memory.md +31 -36
  234. package/pack/.claude/skills/rite-spec/SKILL.md +84 -135
  235. package/pack/.claude/skills/rite-spec/reference/investigation.md +37 -33
  236. package/pack/.claude/skills/rite-spec/reference/question-protocol.md +6 -2
  237. package/pack/.claude/skills/rite-spec/reference/spec-checklists.md +25 -24
  238. package/pack/.claude/skills/rite-spec/reference/spec-template.md +9 -2
  239. package/pack/.claude/skills/rite-spec/reference/state-workspace.md +13 -3
  240. package/pack/.claude/skills/rite-temper/SKILL.md +62 -47
  241. package/pack/.claude/skills/rite-temper/reference/review-dimensions.md +24 -22
  242. package/pack/.claude/skills/rite-upgrade/SKILL.md +125 -0
  243. package/pack/.claude/skills/rite-vet/SKILL.md +114 -113
  244. package/pack/.claude/skills/rite-vet/reference/artifacts.md +50 -9
  245. package/pack/.claude/skills/rite-vet/reference/review-axes.md +39 -37
  246. package/pack/generated/claude/agents/devrites-code-reviewer.md +62 -48
  247. package/pack/generated/claude/agents/devrites-devex-reviewer.md +69 -53
  248. package/pack/generated/claude/agents/devrites-doubt-reviewer.md +29 -22
  249. package/pack/generated/claude/agents/devrites-evidence-scout.md +69 -0
  250. package/pack/generated/claude/agents/devrites-forge-judge.md +74 -61
  251. package/pack/generated/claude/agents/devrites-frontend-reviewer.md +48 -39
  252. package/pack/generated/claude/agents/devrites-performance-reviewer.md +49 -40
  253. package/pack/generated/claude/agents/devrites-plan-drafter.md +73 -0
  254. package/pack/generated/claude/agents/devrites-plan-reviewer.md +80 -47
  255. package/pack/generated/claude/agents/devrites-proof-runner.md +74 -0
  256. package/pack/generated/claude/agents/devrites-retrospector.md +48 -45
  257. package/pack/generated/claude/agents/devrites-security-auditor.md +46 -36
  258. package/pack/generated/claude/agents/devrites-simplifier-reviewer.md +50 -46
  259. package/pack/generated/claude/agents/devrites-slice-wright.md +153 -165
  260. package/pack/generated/claude/agents/devrites-spec-reviewer.md +34 -32
  261. package/pack/generated/claude/agents/devrites-strategy-reviewer.md +63 -34
  262. package/pack/generated/claude/agents/devrites-test-analyst.md +40 -30
  263. package/pack/generated/claude/agents/devrites-upgrade-planner.md +100 -0
  264. package/pack/generated/claude/settings.json +2 -1
  265. package/pack/generated/claude/skills/devrites-audit/SKILL.md +40 -61
  266. package/pack/generated/claude/skills/devrites-debug-recovery/SKILL.md +24 -13
  267. package/pack/generated/claude/skills/devrites-debug-recovery/reference/build-the-loop.md +24 -21
  268. package/pack/generated/claude/skills/devrites-debug-recovery/reference/cleanup-and-classify.md +34 -6
  269. package/pack/generated/claude/skills/devrites-debug-recovery/reference/instrumentation.md +2 -2
  270. package/pack/generated/claude/skills/devrites-doubt/SKILL.md +25 -17
  271. package/pack/generated/claude/skills/devrites-interview/SKILL.md +53 -52
  272. package/pack/generated/claude/skills/devrites-lib/SKILL.md +12 -9
  273. package/pack/generated/claude/skills/devrites-lib/reference/intent-map.md +4 -2
  274. package/pack/generated/claude/skills/devrites-lib/reference/parallel-dispatch.md +82 -137
  275. package/pack/generated/claude/skills/devrites-lib/reference/reply-contract.md +8 -1
  276. package/pack/generated/claude/skills/devrites-lib/reference/standards/README.md +38 -55
  277. package/pack/generated/claude/skills/devrites-lib/reference/standards/afk-hitl.md +53 -27
  278. package/pack/generated/claude/skills/devrites-lib/reference/standards/agents.md +200 -190
  279. package/pack/generated/claude/skills/devrites-lib/reference/standards/anti-patterns.md +5 -15
  280. package/pack/generated/claude/skills/devrites-lib/reference/standards/ci-cd.md +27 -58
  281. package/pack/generated/claude/skills/devrites-lib/reference/standards/code-review.md +16 -52
  282. package/pack/generated/claude/skills/devrites-lib/reference/standards/coding-style.md +2 -10
  283. package/pack/generated/claude/skills/devrites-lib/reference/standards/context-hygiene.md +18 -61
  284. package/pack/generated/claude/skills/devrites-lib/reference/standards/core.md +23 -18
  285. package/pack/generated/claude/skills/devrites-lib/reference/standards/deprecation.md +17 -57
  286. package/pack/generated/claude/skills/devrites-lib/reference/standards/development-workflow.md +4 -33
  287. package/pack/generated/claude/skills/devrites-lib/reference/standards/git-workflow.md +4 -20
  288. package/pack/generated/claude/skills/devrites-lib/reference/standards/hooks.md +3 -14
  289. package/pack/generated/claude/skills/devrites-lib/reference/standards/patterns.md +9 -25
  290. package/pack/generated/claude/skills/devrites-lib/reference/standards/performance.md +0 -9
  291. package/pack/generated/claude/skills/devrites-lib/reference/standards/principles.md +1 -3
  292. package/pack/generated/claude/skills/devrites-lib/reference/standards/security.md +17 -7
  293. package/pack/generated/claude/skills/devrites-lib/reference/standards/testing.md +1 -27
  294. package/pack/generated/claude/skills/devrites-lib/reference/standards/tooling.md +46 -50
  295. package/pack/generated/claude/skills/devrites-lib/reference/workspace-artifact-schema.md +40 -10
  296. package/pack/generated/claude/skills/devrites-source-driven/SKILL.md +23 -22
  297. package/pack/generated/claude/skills/rite/SKILL.md +10 -6
  298. package/pack/generated/claude/skills/rite/reference/menu.md +13 -7
  299. package/pack/generated/claude/skills/rite-adopt/SKILL.md +33 -37
  300. package/pack/generated/claude/skills/rite-autocomplete/SKILL.md +33 -28
  301. package/pack/generated/claude/skills/rite-autocomplete/reference/loop.md +21 -21
  302. package/pack/generated/claude/skills/rite-autocomplete/reference/stop-conditions.md +15 -6
  303. package/pack/generated/claude/skills/rite-build/SKILL.md +35 -30
  304. package/pack/generated/claude/skills/rite-build/reference/afk-discipline.md +41 -39
  305. package/pack/generated/claude/skills/rite-build/reference/evidence-standard.md +10 -0
  306. package/pack/generated/claude/skills/rite-build/reference/forge.md +186 -156
  307. package/pack/generated/claude/skills/rite-build/reference/one-slice-cycle.md +4 -3
  308. package/pack/generated/claude/skills/rite-build/reference/phase-contract.md +96 -175
  309. package/pack/generated/claude/skills/rite-build/reference/spec-drift-guard.md +10 -4
  310. package/pack/generated/claude/skills/rite-build/reference/wright-dispatch.md +129 -134
  311. package/pack/generated/claude/skills/rite-clarify/SKILL.md +90 -0
  312. package/pack/generated/claude/skills/rite-clarify/reference/decision-coverage.md +61 -0
  313. package/pack/generated/claude/skills/rite-converge/SKILL.md +35 -25
  314. package/pack/generated/claude/skills/rite-define/SKILL.md +58 -32
  315. package/pack/generated/claude/skills/rite-define/reference/gates.md +16 -15
  316. package/pack/generated/claude/skills/rite-define/reference/plan-template.md +18 -8
  317. package/pack/generated/claude/skills/rite-frame/reference/failure-modes.md +22 -24
  318. package/pack/generated/claude/skills/rite-plan/SKILL.md +47 -16
  319. package/pack/generated/claude/skills/rite-plan/reference/task-breakdown.md +4 -0
  320. package/pack/generated/claude/skills/rite-polish/SKILL.md +27 -23
  321. package/pack/generated/claude/skills/rite-prototype/SKILL.md +25 -26
  322. package/pack/generated/claude/skills/rite-prove/SKILL.md +27 -17
  323. package/pack/generated/claude/skills/rite-resolve/SKILL.md +12 -11
  324. package/pack/generated/claude/skills/rite-resolve/reference/answer-protocol.md +3 -0
  325. package/pack/generated/claude/skills/rite-review/SKILL.md +37 -28
  326. package/pack/generated/claude/skills/rite-seal/reference/phase-contract.md +27 -92
  327. package/pack/generated/claude/skills/rite-seal/reference/risk-and-rollback.md +13 -0
  328. package/pack/generated/claude/skills/rite-ship/reference/design-memory.md +31 -36
  329. package/pack/generated/claude/skills/rite-spec/SKILL.md +84 -135
  330. package/pack/generated/claude/skills/rite-spec/reference/investigation.md +37 -33
  331. package/pack/generated/claude/skills/rite-spec/reference/question-protocol.md +6 -2
  332. package/pack/generated/claude/skills/rite-spec/reference/spec-checklists.md +25 -24
  333. package/pack/generated/claude/skills/rite-spec/reference/spec-template.md +9 -2
  334. package/pack/generated/claude/skills/rite-spec/reference/state-workspace.md +13 -3
  335. package/pack/generated/claude/skills/rite-temper/SKILL.md +62 -47
  336. package/pack/generated/claude/skills/rite-temper/reference/review-dimensions.md +24 -22
  337. package/pack/generated/claude/skills/rite-upgrade/SKILL.md +125 -0
  338. package/pack/generated/claude/skills/rite-vet/SKILL.md +114 -113
  339. package/pack/generated/claude/skills/rite-vet/reference/artifacts.md +50 -9
  340. package/pack/generated/claude/skills/rite-vet/reference/review-axes.md +39 -37
  341. package/pack/generated/codex/AGENTS.md +5 -2
  342. package/pack/generated/codex/agents/devrites-code-reviewer.toml +69 -47
  343. package/pack/generated/codex/agents/devrites-devex-reviewer.toml +75 -51
  344. package/pack/generated/codex/agents/devrites-doubt-reviewer.toml +35 -20
  345. package/pack/generated/codex/agents/devrites-evidence-scout.toml +75 -0
  346. package/pack/generated/codex/agents/devrites-forge-judge.toml +80 -59
  347. package/pack/generated/codex/agents/devrites-frontend-reviewer.toml +54 -37
  348. package/pack/generated/codex/agents/devrites-performance-reviewer.toml +55 -38
  349. package/pack/generated/codex/agents/devrites-plan-drafter.toml +79 -0
  350. package/pack/generated/codex/agents/devrites-plan-reviewer.toml +82 -47
  351. package/pack/generated/codex/agents/devrites-proof-runner.toml +80 -0
  352. package/pack/generated/codex/agents/devrites-retrospector.toml +54 -43
  353. package/pack/generated/codex/agents/devrites-security-auditor.toml +53 -35
  354. package/pack/generated/codex/agents/devrites-simplifier-reviewer.toml +56 -44
  355. package/pack/generated/codex/agents/devrites-slice-wright.toml +159 -163
  356. package/pack/generated/codex/agents/devrites-spec-reviewer.toml +40 -30
  357. package/pack/generated/codex/agents/devrites-strategy-reviewer.toml +65 -34
  358. package/pack/generated/codex/agents/devrites-test-analyst.toml +46 -28
  359. package/pack/generated/codex/agents/devrites-upgrade-planner.toml +106 -0
  360. package/pack/generated/codex/hooks.json +4 -14
  361. package/pack/generated/codex/skills/devrites-api-interface/SKILL.md +7 -3
  362. package/pack/generated/codex/skills/devrites-audit/SKILL.md +47 -64
  363. package/pack/generated/codex/skills/devrites-browser-proof/SKILL.md +7 -3
  364. package/pack/generated/codex/skills/devrites-debug-recovery/SKILL.md +31 -16
  365. package/pack/generated/codex/skills/devrites-debug-recovery/reference/build-the-loop.md +24 -21
  366. package/pack/generated/codex/skills/devrites-debug-recovery/reference/cleanup-and-classify.md +34 -6
  367. package/pack/generated/codex/skills/devrites-debug-recovery/reference/instrumentation.md +2 -2
  368. package/pack/generated/codex/skills/devrites-doubt/SKILL.md +32 -20
  369. package/pack/generated/codex/skills/devrites-frontend-craft/SKILL.md +7 -3
  370. package/pack/generated/codex/skills/devrites-interview/SKILL.md +60 -55
  371. package/pack/generated/codex/skills/devrites-lib/SKILL.md +19 -12
  372. package/pack/generated/codex/skills/devrites-lib/reference/intent-map.md +4 -2
  373. package/pack/generated/codex/skills/devrites-lib/reference/parallel-dispatch.md +82 -137
  374. package/pack/generated/codex/skills/devrites-lib/reference/reply-contract.md +8 -1
  375. package/pack/generated/codex/skills/devrites-lib/reference/standards/README.md +38 -55
  376. package/pack/generated/codex/skills/devrites-lib/reference/standards/afk-hitl.md +53 -27
  377. package/pack/generated/codex/skills/devrites-lib/reference/standards/agents.md +200 -190
  378. package/pack/generated/codex/skills/devrites-lib/reference/standards/anti-patterns.md +5 -15
  379. package/pack/generated/codex/skills/devrites-lib/reference/standards/ci-cd.md +27 -58
  380. package/pack/generated/codex/skills/devrites-lib/reference/standards/code-review.md +16 -52
  381. package/pack/generated/codex/skills/devrites-lib/reference/standards/coding-style.md +2 -10
  382. package/pack/generated/codex/skills/devrites-lib/reference/standards/context-hygiene.md +18 -61
  383. package/pack/generated/codex/skills/devrites-lib/reference/standards/core.md +23 -18
  384. package/pack/generated/codex/skills/devrites-lib/reference/standards/deprecation.md +17 -57
  385. package/pack/generated/codex/skills/devrites-lib/reference/standards/development-workflow.md +4 -33
  386. package/pack/generated/codex/skills/devrites-lib/reference/standards/git-workflow.md +4 -20
  387. package/pack/generated/codex/skills/devrites-lib/reference/standards/hooks.md +3 -14
  388. package/pack/generated/codex/skills/devrites-lib/reference/standards/patterns.md +9 -25
  389. package/pack/generated/codex/skills/devrites-lib/reference/standards/performance.md +0 -9
  390. package/pack/generated/codex/skills/devrites-lib/reference/standards/principles.md +1 -3
  391. package/pack/generated/codex/skills/devrites-lib/reference/standards/security.md +17 -7
  392. package/pack/generated/codex/skills/devrites-lib/reference/standards/testing.md +1 -27
  393. package/pack/generated/codex/skills/devrites-lib/reference/standards/tooling.md +46 -50
  394. package/pack/generated/codex/skills/devrites-lib/reference/workspace-artifact-schema.md +40 -10
  395. package/pack/generated/codex/skills/devrites-prose-craft/SKILL.md +7 -3
  396. package/pack/generated/codex/skills/devrites-refresh-indexes/SKILL.md +7 -3
  397. package/pack/generated/codex/skills/devrites-source-driven/SKILL.md +29 -24
  398. package/pack/generated/codex/skills/devrites-ux-shape/SKILL.md +7 -3
  399. package/pack/generated/codex/skills/rite/SKILL.md +21 -13
  400. package/pack/generated/codex/skills/rite/reference/menu.md +13 -7
  401. package/pack/generated/codex/skills/rite-adopt/SKILL.md +40 -40
  402. package/pack/generated/codex/skills/rite-autocomplete/SKILL.md +40 -31
  403. package/pack/generated/codex/skills/rite-autocomplete/reference/loop.md +21 -21
  404. package/pack/generated/codex/skills/rite-autocomplete/reference/stop-conditions.md +15 -6
  405. package/pack/generated/codex/skills/rite-build/SKILL.md +42 -33
  406. package/pack/generated/codex/skills/rite-build/reference/afk-discipline.md +41 -39
  407. package/pack/generated/codex/skills/rite-build/reference/evidence-standard.md +10 -0
  408. package/pack/generated/codex/skills/rite-build/reference/forge.md +186 -156
  409. package/pack/generated/codex/skills/rite-build/reference/one-slice-cycle.md +4 -3
  410. package/pack/generated/codex/skills/rite-build/reference/phase-contract.md +96 -175
  411. package/pack/generated/codex/skills/rite-build/reference/spec-drift-guard.md +10 -4
  412. package/pack/generated/codex/skills/rite-build/reference/wright-dispatch.md +129 -134
  413. package/pack/generated/codex/skills/rite-clarify/SKILL.md +106 -0
  414. package/pack/generated/codex/skills/rite-clarify/reference/decision-coverage.md +61 -0
  415. package/pack/generated/codex/skills/rite-converge/SKILL.md +42 -28
  416. package/pack/generated/codex/skills/rite-customize/SKILL.md +7 -3
  417. package/pack/generated/codex/skills/rite-define/SKILL.md +65 -35
  418. package/pack/generated/codex/skills/rite-define/reference/gates.md +16 -15
  419. package/pack/generated/codex/skills/rite-define/reference/plan-template.md +18 -8
  420. package/pack/generated/codex/skills/rite-doctor/SKILL.md +7 -3
  421. package/pack/generated/codex/skills/rite-dogfood/SKILL.md +7 -3
  422. package/pack/generated/codex/skills/rite-explain/SKILL.md +7 -3
  423. package/pack/generated/codex/skills/rite-frame/SKILL.md +7 -3
  424. package/pack/generated/codex/skills/rite-frame/reference/failure-modes.md +22 -24
  425. package/pack/generated/codex/skills/rite-handoff/SKILL.md +7 -3
  426. package/pack/generated/codex/skills/rite-learn/SKILL.md +7 -3
  427. package/pack/generated/codex/skills/rite-plan/SKILL.md +54 -19
  428. package/pack/generated/codex/skills/rite-plan/reference/task-breakdown.md +5 -1
  429. package/pack/generated/codex/skills/rite-polish/SKILL.md +34 -26
  430. package/pack/generated/codex/skills/rite-pov/SKILL.md +7 -3
  431. package/pack/generated/codex/skills/rite-pr-feedback/SKILL.md +7 -3
  432. package/pack/generated/codex/skills/rite-pressure-test/SKILL.md +7 -3
  433. package/pack/generated/codex/skills/rite-prototype/SKILL.md +32 -29
  434. package/pack/generated/codex/skills/rite-prove/SKILL.md +34 -20
  435. package/pack/generated/codex/skills/rite-quick/SKILL.md +7 -3
  436. package/pack/generated/codex/skills/rite-resolve/SKILL.md +19 -14
  437. package/pack/generated/codex/skills/rite-resolve/reference/answer-protocol.md +3 -0
  438. package/pack/generated/codex/skills/rite-review/SKILL.md +44 -31
  439. package/pack/generated/codex/skills/rite-seal/SKILL.md +7 -3
  440. package/pack/generated/codex/skills/rite-seal/reference/phase-contract.md +27 -92
  441. package/pack/generated/codex/skills/rite-seal/reference/risk-and-rollback.md +13 -0
  442. package/pack/generated/codex/skills/rite-ship/SKILL.md +7 -3
  443. package/pack/generated/codex/skills/rite-ship/reference/design-memory.md +31 -36
  444. package/pack/generated/codex/skills/rite-spec/SKILL.md +91 -138
  445. package/pack/generated/codex/skills/rite-spec/reference/investigation.md +37 -33
  446. package/pack/generated/codex/skills/rite-spec/reference/question-protocol.md +6 -2
  447. package/pack/generated/codex/skills/rite-spec/reference/spec-checklists.md +25 -24
  448. package/pack/generated/codex/skills/rite-spec/reference/spec-template.md +9 -2
  449. package/pack/generated/codex/skills/rite-spec/reference/state-workspace.md +13 -3
  450. package/pack/generated/codex/skills/rite-status/SKILL.md +7 -3
  451. package/pack/generated/codex/skills/rite-temper/SKILL.md +69 -50
  452. package/pack/generated/codex/skills/rite-temper/reference/review-dimensions.md +24 -22
  453. package/pack/generated/codex/skills/rite-upgrade/SKILL.md +141 -0
  454. package/pack/generated/codex/skills/rite-upgrade/agents/openai.yaml +2 -0
  455. package/pack/generated/codex/skills/rite-vet/SKILL.md +121 -116
  456. package/pack/generated/codex/skills/rite-vet/reference/artifacts.md +50 -9
  457. package/pack/generated/codex/skills/rite-vet/reference/review-axes.md +40 -38
  458. package/pack/generated/codex/skills/rite-zoom-out/SKILL.md +7 -3
  459. package/package.json +1 -1
  460. package/scripts/build-release-tarball.sh +32 -15
  461. package/scripts/check-authority-drift.py +125 -0
  462. package/scripts/check-instruction-size-baseline.mjs +19 -11
  463. package/scripts/check-invocation-integrity.py +2 -0
  464. package/scripts/codex-generate.sh +69 -33
  465. package/scripts/grade-feature.sh +121 -40
  466. package/scripts/live-hosts/agent-result.schema.json +230 -0
  467. package/scripts/live-hosts/claude.sh +87 -0
  468. package/scripts/live-hosts/codex.sh +81 -0
  469. package/scripts/live-hosts/common.sh +113 -0
  470. package/scripts/live-hosts/fake-host.py +264 -0
  471. package/scripts/live-hosts/host-transport.py +287 -0
  472. package/scripts/release-check.sh +5 -1
  473. package/scripts/run-agent-contract-evals.py +1380 -0
  474. package/scripts/run-behavioral-evals.sh +24 -30
  475. package/scripts/run-evals.sh +1 -5
  476. package/scripts/run-live-behavioral-evals.py +1274 -144
  477. package/scripts/run-outcome-evals.sh +445 -88
  478. package/scripts/run-tests.mjs +30 -2
  479. package/scripts/skills-inventory.mjs +1 -1
  480. package/scripts/validate-workflow-security.py +39 -20
  481. package/scripts/validate-workspace-schema.py +362 -10
  482. package/scripts/validate.sh +21 -15
  483. package/engine/testdata/golden/TestParityWrightScope/devrites-edit-allowed.golden +0 -1
  484. /package/engine/testdata/golden/{TestParityReconcile/check-no-claimed.golden → TestParityBuildReadiness/arg=clarifyopen.golden} +0 -0
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: rite
3
- description: User-invoked DevRites menu and router; no args renders the menu, a verb dispatches to the matching `rite-<verb>` skill.
3
+ description: User-invoked DevRites menu and router; no args renders the menu, a verb invokes the matching `rite-<verb>` skill.
4
4
  argument-hint: "[verb [args...]]"
5
5
  user-invocable: true
6
6
  disable-model-invocation: true
@@ -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
 
@@ -23,7 +27,7 @@ This is the Codex mirror of a DevRites skill. In Codex:
23
27
  You are the DevRites entry point. Two modes:
24
28
 
25
29
  - **No args** → run `devrites-engine first-task`, render one recommended-start line above the menu, then stop. Do not execute a phase or read `state.md`: status is `$rite-status`.
26
- - **Verb arg** → pass-through dispatch to the matching `rite-<verb>` skill (`$rite spec foo` ≡ `$rite-spec foo`); the called skill owns the output.
30
+ - **Verb arg** → pass-through invocation of the matching `rite-<verb>` skill (`$rite spec foo` ≡ `$rite-spec foo`); the called skill owns the output.
27
31
 
28
32
  When the user asks which rite fits, load [`devrites-lib/reference/intent-map.md`](../devrites-lib/reference/intent-map.md).
29
33
  When they ask how phases connect, load [`reference/menu.md`](reference/menu.md).
@@ -39,12 +43,13 @@ F=.agents/skills/rite-$V/SKILL.md
39
43
  # Then Read "$F" and follow its workflow with $ARGS as that skill's $ARGUMENTS.
40
44
  ```
41
45
 
42
- What each verb does lives once, in the Menu below; this table is the dispatch map only.
46
+ What each verb does lives once, in the Menu below; this table is the invocation map only.
43
47
 
44
48
  | Verb | Skill |
45
49
  |---|---|
46
50
  | `spec [feature]` | `$rite-spec` |
47
51
  | `adopt [area]` | `$rite-adopt` |
52
+ | `clarify [feature]` | `$rite-clarify` |
48
53
  | `temper [--mode]` | `$rite-temper` |
49
54
  | `define` | `$rite-define` |
50
55
  | `vet [--cross-model]` | `$rite-vet` |
@@ -58,6 +63,7 @@ What each verb does lives once, in the Menu below; this table is the dispatch ma
58
63
  | `ship` | `$rite-ship` |
59
64
  | `status [slug]` | `$rite-status` |
60
65
  | `doctor [--code | --reindex]` | `$rite-doctor` |
66
+ | `upgrade [slug]` | `$rite-upgrade` |
61
67
  | `learn [--mine \| "<lesson>"]` | `$rite-learn` |
62
68
  | `explain [concept \| diff \| idea \| recap]` | `$rite-explain` |
63
69
  | `pov [candidate]` | `$rite-pov` |
@@ -75,17 +81,17 @@ What each verb does lives once, in the Menu below; this table is the dispatch ma
75
81
  | `quick [change]` | `$rite-quick` |
76
82
  | `frame [task]` | `$rite-frame` |
77
83
 
78
- Both forms hit the same skill: the menu form for discovery, the `/rite-<verb>` shortcut for muscle memory.
84
+ Both forms call the same skill. The menu supports discovery; `/rite-<verb>` is the direct form.
79
85
 
80
86
  `use <slug>` is handled **inline**. There is no `rite-use` skill. Confirm
81
87
  `.devrites/work/<slug>/` exists, then re-point `.devrites/ACTIVE` to `<slug>` and report
82
88
  the now-active feature. It is cheap context-switching only: no re-spec, no phase run. If
83
89
  the workspace is missing, list the slugs under `.devrites/work/` and stop.
84
90
 
85
- `guide` is an inline first-feature walkthrough. Agree on one **real, genuinely small**
86
- change, then run spec → temper → define → vet → build → prove → polish → review → seal →
91
+ `guide` is an inline walkthrough for the first feature. Agree on one **real, small**
92
+ change, then run spec → clarify → temper → define → vet → build → prove → polish → review → seal →
87
93
  ship. Before each phase, say what it decides; after, name what it wrote and why. Pause at
88
- every boundary. Teach without lecturing.
94
+ every boundary and explain only what the user needs for the next decision.
89
95
 
90
96
  Specialist triggers (model-invoked inside the above):
91
97
  `devrites-frontend-craft` (UI) · `devrites-browser-proof` (UI verify) ·
@@ -101,7 +107,7 @@ Reply-contract exception: `$rite` is the menu/router, not a workspace completion
101
107
  Called phase skills own the shared completion reply contract
102
108
  ([`reply-contract.md`](../devrites-lib/reference/reply-contract.md)).
103
109
 
104
- 1. **Verb in `$ARGUMENTS`** → dispatch per the table above.
110
+ 1. **Verb in `$ARGUMENTS`** → invoke the matching skill per the table above.
105
111
  2. **No args** → menu mode, as above.
106
112
  3. **Unrecognized first token** → tell the user the known verbs and stop. Don't guess.
107
113
  4. **No active feature** and the user asked "where am I" or named no verb → point at `$rite spec <feature>` (or `$rite-spec`). Don't summarize state yourself: `$rite status` (or `$rite-status`) owns that.
@@ -114,6 +120,7 @@ Recommended start: <greenfield: $rite spec <feature> | brownfield-unadopted: $ri
114
120
  menu form direct shortcut
115
121
  SPEC $rite spec ≡ $rite-spec investigate deeply → write spec.md
116
122
  ADOPT $rite adopt ≡ $rite-adopt onboard existing code → reverse-derive spec.md + seed conventions
123
+ CLARIFY $rite clarify ≡ $rite-clarify close the complete decision surface before planning
117
124
  TEMPER $rite temper ≡ $rite-temper optional — strategic review: scope mode + pre-mortem, harden the spec
118
125
  PLAN $rite define ≡ $rite-define turn the spec into plan + task slices + state
119
126
  VET $rite vet ≡ $rite-vet mandatory every plan — light/full engineering review by stakes
@@ -127,6 +134,7 @@ SEAL $rite seal ≡ $rite-seal final GO / NO-GO
127
134
  SHIP $rite ship ≡ $rite-ship type-GO + commit/push/tag, then archive + clear ACTIVE
128
135
  STATUS $rite status ≡ $rite-status active feature, next action, evidence, risks
129
136
  DOCTOR $rite doctor ... ≡ $rite-doctor health check; --reindex refreshes structural indexes
137
+ UPGRADE $rite upgrade ... ≡ $rite-upgrade reconcile an active legacy workspace with current contracts
130
138
  LEARN $rite learn ... ≡ $rite-learn review captured lessons → promote to project rules / principles
131
139
  EXPLAIN $rite explain ... ≡ $rite-explain grounded concept/diff/idea/recap explainer
132
140
  POV $rite pov ... ≡ $rite-pov decide adopt / trial / hold / reject for an external option
@@ -143,8 +151,8 @@ UTILITY $rite frame | prototype | handoff | zoom-out | pressure-test (or
143
151
 
144
152
  > **Small one-off change?** A typo, copy tweak, config bump, or one-function fix → **`$rite-quick`**
145
153
  > (express lane: one contract → build → prove → ship, no full workspace). It escalates to
146
- > `$rite-spec` the instant the change grows past small / reversible / unambiguous. The full
147
- > lifecycle above is for real features: don't pay its ceremony for a one-off.
154
+ > `$rite-spec` when the change is no longer small, reversible, and unambiguous. Use the
155
+ > full lifecycle above for features.
148
156
 
149
157
  ## Core operating rules (every DevRites skill enforces)
150
158
 
@@ -7,33 +7,39 @@ what each command does or how phases connect.
7
7
 
8
8
  | Phase | Command | Use when |
9
9
  |---|---|---|
10
- | Spec | `$rite-spec <feature>` | **New feature.** Investigate deeply → write spec.md. Asks with options; gathers attached design references (optional). |
10
+ | Spec | `$rite-spec <feature>` | **New feature.** Investigate → write spec.md. Asks with options; gathers attached design references (optional). |
11
11
  | Adopt | `$rite-adopt` | Onboard an existing codebase instead of starting fresh: reverse-derive spec.md + seed the conventions ledger. |
12
+ | Clarify | `$rite-clarify` | _Required after spec._ Topology-first decision-coverage scan; zero-question fast path when already clear. |
12
13
  | Temper | `$rite-temper` | _Optional, before define._ Strategic review of the spec: scope mode (expand/selective/hold-rigor/reduce) + pre-mortem; hardens the spec. Best on big/risky features; mandatory in `$rite-autocomplete`. |
13
14
  | Plan | `$rite-define` | Turn the approved spec into plan + vertical task slices + state. |
14
15
  | Vet | `$rite-vet` | _Required before build._ Review every plan: scope · architecture · tests · perf; light for simple/reversible, full for high stakes. |
15
16
  | Re-plan | `$rite-plan` | The active plan is too big, wrong, stale, ambiguous, or blocked. |
16
17
  | Build | `$rite-build` | Implement the next single vertical slice. Stops after one slice. |
17
- | Converge | `$rite-converge` | _Recovery._ Code drifted from / falls short of intent (resumed cold, adopted, stalled build): assess live code vs spec/plan/tasks and append the remaining work as new slices for `$rite-build`. |
18
+ | Converge | `$rite-converge` | _Recovery._ Code drifted from or falls short of intent after a resume, adoption, or stalled build: compare live code with spec/plan/tasks and append remaining work as new slices for `$rite-build`. |
18
19
  | Prove | `$rite-prove` | Prove the current scope: tests, build, runtime, browser evidence. |
19
- | Polish | `$rite-polish` | Code polish always; UI normalize + ship-quality polish if UI is in scope. Modes: `bolder/quieter/distill/harden/normalize-only`. |
20
+ | Polish | `$rite-polish` | Code polish always; normalize and polish UI when in scope. Modes: `bolder/quieter/distill/harden/normalize-only`. |
20
21
  | Review | `$rite-review` | Feature-scoped review before sealing. |
21
22
  | Seal | `$rite-seal` | Final GO / NO-GO decision (no git). |
22
23
  | Ship | `$rite-ship` | Type-GO → commit/push/tag, then archive the task + clear ACTIVE. |
23
24
  | Status | `$rite-status` | See where the active feature stands. |
24
25
  | Doctor | `$rite-doctor` | Health check: install integrity, stale ACTIVE, orphaned gates, hook wiring, merge/rebase state. |
26
+ | Upgrade | `$rite-upgrade` | _Explicit recovery._ Reconcile an active legacy workspace with the installed semantic workflow contract; preserve completed work and history. |
25
27
  | Learn | `$rite-learn` | Review the captured learning ledger → promote recurring lessons to project rules / principles. |
26
28
 
27
29
  ## Typical orderings
28
30
 
29
- - **Every feature**: `$rite-spec` (spec) → *(big feature? `$rite-temper`: strategic review)*
31
+ - **Every feature**: `$rite-spec` (spec) → `$rite-clarify` (decision coverage) →
32
+ *(big feature? `$rite-temper`: strategic review)* →
30
33
  `$rite-define` (plan) → `$rite-vet` (engineering review; light or full) →
31
34
  `$rite-build` ×N (all slices) → `$rite-prove` (once all built) →
32
35
  `$rite-polish` (always: code + UI if UI) → `$rite-review` → `$rite-seal` → `$rite-ship`.
33
- - **Existing codebase**: `$rite-adopt` → `$rite-define` → `$rite-vet` → build.
34
- - **Drift mid-build**: stopdrift question `$rite-plan` (repair) → resume build.
36
+ - **Existing codebase**: `$rite-adopt` → `$rite-clarify` → `$rite-define` → `$rite-vet` → build.
37
+ - **Drift mid-build**: classifybounded recovery for objective defects, `$rite-plan`
38
+ repair for a wrong durable plan, or one user decision for real product/risk drift.
39
+ - **Workspace from older DevRites rules**: `$rite-upgrade` → current Clarify/Plan/Vet
40
+ gates → resume the snapshot's next command. Structural migration alone is not enough.
35
41
  - **Resumed / adopted / stalled**: `$rite-converge` (assess live code vs intent → append the
36
- remaining slices) → `$rite-build` ×N → continue at `$rite-prove`.
42
+ remaining slices) → `$rite-vet` → `$rite-build` ×N → continue at `$rite-prove`.
37
43
 
38
44
  ## Rules this menu obeys
39
45
 
@@ -11,26 +11,27 @@ 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-adopt: brownfield on-ramp
24
+ # $rite-adopt: onboard existing code
21
25
 
22
- The **reverse** of `$rite-spec`. `$rite-spec` goes idea spec; `$rite-adopt` goes
23
- **existing code spec + seeded conventions**, so an already-built project can enter the
24
- DevRites lifecycle without hand-writing a spec from nothing. It produces the same
25
- `spec.md` the rest of the lifecycle expects, plus a head start in the conventions ledger
26
- so the very first new slice already knows the project's idioms.
26
+ `$rite-adopt` derives a spec and initial conventions from existing code. It produces the
27
+ same `spec.md` used by the rest of the lifecycle and seeds the conventions ledger with
28
+ observed project idioms.
27
29
 
28
- Use it once, at the start, to onboard a repo (or a sub-area of one). After it, the normal
29
- lifecycle (`$rite-temper` `$rite-define` `$rite-build` …) takes over.
30
+ Use it once when onboarding a repository or one of its sub-areas. Continue with
31
+ `$rite-clarify`, `$rite-temper`, `$rite-define`, and `$rite-build`.
30
32
 
31
- > **Just want a map, not an onboarding?** `$rite-zoom-out` returns a structural map of
32
- > unfamiliar code without creating a workspace or ledger. `$rite-adopt` is the heavier move:
33
- > it *commits the project to the lifecycle*. Pick zoom-out to look, adopt to begin.
33
+ > **Need only a code map?** `$rite-zoom-out` maps unfamiliar code without creating a
34
+ > workspace or ledger. Use `$rite-adopt` when the project should enter the lifecycle.
34
35
 
35
36
  ## Rules consulted (read on demand from `.agents/skills/devrites-lib/reference/standards/`)
36
37
  Pull `documentation.md` when recording the adoption decisions (why-not-what) in
@@ -49,7 +50,7 @@ upholds invariants worth proposing as project principles (step 4a).
49
50
  if stated: what the user wants to build *next* on top of it. If the next-build objective
50
51
  is missing, ask once (it shapes the spec's acceptance); if the area is ambiguous, confirm
51
52
  before investigating the whole tree.
52
- 2. **Reverse-investigate the existing code:** the durable shape of the project. Use a
53
+ 2. **Inspect the existing code** to establish the project's current structure. Use a
53
54
  code-intelligence index if available (codebase-memory-mcp first (its `get_architecture`
54
55
  gives a fast overview), cross-checked with codegraph + graphify, else standard methods
55
56
  (LSP / Read/Grep/Glob); see `.agents/skills/devrites-lib/reference/standards/tooling.md`) for
@@ -64,10 +65,10 @@ upholds invariants worth proposing as project principles (step 4a).
64
65
  **current behavior as the baseline** and the **next objective** (what adoption is for) with
65
66
  measurable acceptance. Also write `decisions.md`, `assumptions.md`, `questions.md`, and
66
67
  `state.md` (phase: spec).
67
- 3a. **Seed the capability ledger** from the baseline. If the reverse-derived `spec.md` carries
68
+ 3a. **Seed the capability ledger** from the baseline. If the derived `spec.md` carries
68
69
  structured `### Requirement:` blocks, fold them into the living
69
- `.devrites/specs/<capability>/spec.md` ledger so the project's *current* proven behavior is on
70
- record before the first new feature: the ledger the next `$rite-spec` writes deltas against
70
+ `.devrites/specs/<capability>/spec.md` ledger so the project's current proven behavior is
71
+ recorded before the first new feature. The next `$rite-spec` writes deltas against this ledger
71
72
  ([ledger.md](../rite-ship/reference/ledger.md)). A flat baseline folds as all-ADDED into the
72
73
  feature slug's capability; tag capabilities in the spec first if you want finer granularity.
73
74
  ```bash
@@ -75,29 +76,28 @@ upholds invariants worth proposing as project principles (step 4a).
75
76
  devrites-engine ledger sync .devrites/work/<slug> # seed
76
77
  ```
77
78
  Skip when the baseline records no structured requirements (nothing to seed).
78
- 4. **Seed the conventions ledger** from what the investigation *observed*:
79
- [adoption § seeding](reference/adoption.md). This is the deliberate bootstrap exception to
80
- evidence-gated promotion: the seeds start at the base band and are provenance-tagged as
81
- onboarding observations, not sealed-slice proofs, so real slices later corroborate or
82
- (fresh-wins) contradict them.
79
+ 4. **Seed the conventions ledger** from observed behavior:
80
+ [adoption § seeding](reference/adoption.md). This is the bootstrap exception to
81
+ evidence-gated promotion. Seeds start at the base band with onboarding provenance;
82
+ later sealed slices may confirm or contradict them, and fresh evidence wins.
83
83
  **Completion:** every seed names observed evidence, provenance, and the base band.
84
- 4a. **Propose candidate principles** (human-ratified; optional). Where the investigation found an
85
- invariant the code *consistently and deliberately* upholds (money always in integer cents, PII
86
- always redacted from logs, every v1 endpoint preserved) surface it as a **candidate
87
- principle**, not a seeded convention. Principles are prescriptive and gating, so they are
88
- **ratified by the human, never auto-seeded** the way conventions are: present the candidates via
89
- `AskUserQuestion` with the evidence (where the code upholds it), and write the ones the human
90
- ratifies to `.devrites/principles.md` with a dated Governance entry
91
- ([`principles.md`](../devrites-lib/reference/standards/principles.md)). Propose, don't impose: an unratified candidate
92
- stays a convention, not a gate. Skip cleanly when nothing rises to an invariant (common: a
93
- fresh adopt may declare zero principles, and that's valid).
94
- 5. **Hand off.** Spec and ledger are ready. Next: `$rite-temper` if big/risky,
95
- else `$rite-define`; every plan then runs `$rite-vet` before build. Do not plan/build here.
84
+ 4a. **Propose candidate principles** (optional and human-ratified). When the code
85
+ consistently enforces an invariant, such as integer cents for money, redacted PII in
86
+ logs, or preserved v1 endpoints, propose it as a **candidate principle** rather than a
87
+ convention. Principles are prescriptive gates, so **never seed them automatically**.
88
+ Present each candidate through `AskUserQuestion` with evidence, and write human-ratified
89
+ candidates to `.devrites/principles.md` with a dated Governance entry
90
+ ([`principles.md`](../devrites-lib/reference/standards/principles.md)). An unratified
91
+ candidate remains a convention, not a gate. If no invariant qualifies, declare no
92
+ principles.
93
+ 5. **Hand off.** Continue with `$rite-clarify`. Its topology scan asks no questions when
94
+ the derived contract is already clear. Every plan then runs `$rite-vet` before build.
95
+ Do not plan or build here.
96
96
  **Completion:** one next rite is reported and no plan or application code was written.
97
97
 
98
- > **Mid-flight discipline.** Don't invent conventions the code doesn't follow, don't
99
- > seed an idiom you only assumed, and don't expand scope into a rewrite: adoption documents
100
- > what exists; the *next* feature changes it. See [`anti-patterns`](reference/anti-patterns.md).
98
+ > **Mid-flight discipline.** Do not invent conventions, seed an assumed idiom, or turn
99
+ > adoption into a rewrite. Adoption records existing behavior; a later feature changes it.
100
+ > See [`anti-patterns`](reference/anti-patterns.md).
101
101
 
102
102
  ## Output
103
103
 
@@ -108,8 +108,8 @@ Default success shape:
108
108
  Done: adopted existing behavior into <slug>; baseline spec and placement recorded.
109
109
  Changed: spec.md, decisions.md, conventions ledger, principles proposals <updated|none>
110
110
  Evidence: not applicable; reverse-derived behavior is recorded for review
111
- Open: <none | adoption questions | Alternative: $rite-define for straightforward follow-up>
112
- Next: $rite-temper
111
+ Open: <none | adoption questions>
112
+ Next: $rite-clarify
113
113
  Record: .devrites/work/<slug>/spec.md
114
114
  ↻ Hygiene: /clear before the next phase
115
115
  ```
@@ -11,41 +11,48 @@ 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-autocomplete: full lifecycle, unattended
21
25
 
22
- Drives every DevRites phase in order without stopping for discretionary input. The
23
- prompt may be vague: autocomplete asks its clarifying questions **up front**, then
24
- runs to completion. It does **not** disable the safety gates: hard irreversible-risk,<!-- pack-scan-ignore: negated statement: gates are NOT disabled -->
26
+ Runs every DevRites phase in order without pausing for discretionary input. It asks
27
+ clarifying questions **before** unattended work begins. Safety gates remain active:
28
+ hard irreversible-risk,<!-- pack-scan-ignore: negated statement: gates are NOT disabled -->
25
29
  blocking / escalating gates, and any NO-GO still pause.
26
30
 
27
31
  ## Rules consulted (read on demand from `.agents/skills/devrites-lib/reference/standards/`)
28
32
  **Step 0:** Read `.agents/skills/devrites-lib/reference/standards/core.md` and `.agents/skills/devrites-lib/reference/standards/afk-hitl.md` first.
29
33
 
30
34
  ## Operating rules
31
- - **One human window.** Clarifying questions are batched up front via
32
- `devrites-interview`. After that, discretionary decisions are made automatically and
33
- recorded in `decisions.md`, not asked. See [reference/decision-policy.md](reference/decision-policy.md).
35
+ - **Use one initial human window.** Run spec and topology-first clarify; arm AFK only after
36
+ `Decision coverage: CLEAR`. Later discretionary calls are recorded, not asked
37
+ ([decision policy](reference/decision-policy.md)).
34
38
  - **Safety gates are not bypassable.** AFK never auto-passes destructive migration /
35
- auth-authz change / public-API break / external-contract change / red tests; blocking
39
+ auth-authz change / public-API break / external-contract change; blocking
36
40
  and escalating gates and any open `gate: validating` always pause. `--ship` auto-confirms
37
41
  the **final** type-GO only: nothing else. A change that violates a declared project
38
42
  principle (`.devrites/principles.md`) with no recorded exception pauses too: autocomplete
39
43
  never grants a principle exception on its own (`principles.md`: that's a human decision).
40
- - **Loop budget = the plan's own slice count, not a fixed number.** After `$rite-vet`
44
+ Red checks never advance the loop: autocomplete runs the shared bounded debug recovery, then
45
+ stops as `blocked` if the objective failure remains; it asks only if recovery exposes a
46
+ human-owned decision.
47
+ - **Set the loop budget from the plan's slice count.** After `$rite-vet`
41
48
  (not `$rite-define`: vet may split or add slices, so the count isn't final until then),
42
49
  set the AFK budget to however many slices the plan has, so the loop builds exactly the
43
- task's slices and stops when they're done. `--max-slices N` is an OPTIONAL *lower* safety
44
- cap (partial / babysat run); omit it to run the whole plan. The budget is finite
45
- (= planned slices), so a runaway is still bounded.
46
- - **Best option, recorded.** For each discretionary choice, pick the option the relevant
47
- specialist / reviewer favours and record the rationale. Never silently coin-flip.
48
- - **Strategic review runs, but never auto-grows scope.** After `$rite-spec`, run `$rite-temper`
50
+ planned slices and stops when they are done. `--max-slices N` is an optional lower
51
+ safety cap for a partial run; omit it to run the whole plan. The planned slice count
52
+ keeps the default run finite.
53
+ - **Record each discretionary choice.** Pick the option recommended by the relevant
54
+ specialist or reviewer and record the rationale. Do not choose arbitrarily.
55
+ - **Strategic review runs, but never auto-grows scope.** After `$rite-clarify`, run `$rite-temper`
49
56
  (significance-gated; it skips low-stakes specs in one line). Unattended it auto-applies only
50
57
  `hold-rigor` + `reduce-to-MVP` (these never grow acceptance); **any `expand` is a blocking
51
58
  pause**, and irreversible-risk findings always pause. Autocomplete hardens and may *prune* the
@@ -61,19 +68,22 @@ blocking / escalating gates, and any NO-GO still pause.
61
68
  ## Workflow
62
69
  1. **Orient + parse args.** Run `devrites-engine preamble` for deterministic workspace orientation.
63
70
  The idea + flags: `--ship` / `--yolo` (auto-confirm the final
64
- type-GO), `--max-slices N` (OPTIONAL *lower* safety cap for a partial run; default =
71
+ type-GO), `--max-slices N` (optional lower safety cap for a partial run; default =
65
72
  the plan's slice count, i.e. run all planned slices).
66
- 2. **Clarify up front.** If the idea is underspecified, run `devrites-interview` to
67
- ~95% confidence: the only interactive window. If already clear, skip.
68
- 3. **Arm AFK.** Write `.devrites/AFK` with `allow_gates: [advisory]`; set the slice budget
73
+ 2. **Specify and clarify up front.** Use `devrites-interview`, `$rite-spec`, and
74
+ `$rite-clarify` as one interactive window. Clear specs ask zero questions; Partial/Missing
75
+ coverage never arms AFK. **Completion:** `decision-coverage.md` records `CLEAR`.
76
+ 3. **Arm AFK after clarity.** Require `Decision coverage: CLEAR`, then write `.devrites/AFK`
77
+ with `allow_gates: [advisory]`; set the slice budget
69
78
  from the plan's count after `$rite-vet` (the slice count is only final post-vet), or from
70
79
  an explicit `--max-slices` ([reference/loop.md](reference/loop.md)). validating / blocking / escalating +
71
- irreversible-risk still pause. Also `touch .devrites/CHECKPOINT`: an unattended run is the
72
- case checkpoint mode earns its keep, so each proven slice is committed local-only as
73
- crash-survivable `WIP` ([rite-build/reference/checkpoint.md](../rite-build/reference/checkpoint.md));
80
+ irreversible-risk still pause. Also `touch .devrites/CHECKPOINT`: unattended runs use
81
+ checkpoint mode so each proven slice is committed locally as a crash-survivable `WIP`
82
+ ([rite-build/reference/checkpoint.md](../rite-build/reference/checkpoint.md));
74
83
  `$rite-ship` collapses them into the one feature commit.
75
- 4. **Drive the phases** ([reference/loop.md](reference/loop.md)): `$rite-spec`
76
- **`$rite-temper`**`$rite-define` → **`$rite-vet`** → `$rite-build` (loop until all slices
84
+ 4. **Drive the phases** ([reference/loop.md](reference/loop.md)). The canonical arc is
85
+ `$rite-spec`**`$rite-clarify`** → **`$rite-temper`** → `$rite-define`
86
+ **`$rite-vet`** → `$rite-build` (repeat until all slices
77
87
  built; `devrites-engine tick-afk` each) → `$rite-prove` → `$rite-polish` → `$rite-review` → `$rite-seal`.
78
88
  Run each by Reading its `SKILL.md` and executing its workflow; state is carried by the
79
89
  workspace files, not chat.
@@ -83,12 +93,11 @@ blocking / escalating gates, and any NO-GO still pause.
83
93
  6. **Seal GO → ship.** With `--ship`, proceed to `$rite-ship` and auto-confirm the
84
94
  type-GO. Without it, render the type-GO prompt and stop for the human.
85
95
 
86
- > **Mid-flight discipline.** When tempted to auto-pass a blocking gate "to keep moving",
87
- > answer a material question yourself instead of pausing, or run past red tests: stop.
88
- > Autonomy is for the routine path; the gates exist for everything else.
96
+ > **Mid-flight discipline.** Stop rather than auto-passing a blocking gate, answering a
97
+ > human-owned material question, or continuing past red tests.
89
98
 
90
99
  ## Output
91
- A compact phase-by-phase log, then the final status. **Progress first for the final
100
+ A compact phase log followed by the final status. **Progress first for the final
92
101
  status**: run `devrites-engine progress`, then use the shared typed states from
93
102
  [`devrites-lib/reference/reply-contract.md`](../devrites-lib/reference/reply-contract.md):
94
103
  `Shipped`, `Stopped`, `Awaiting human`, `NO-GO`, or `GO`.
@@ -96,7 +105,7 @@ status**: run `devrites-engine progress`, then use the shared typed states from
96
105
  Keep the log terse:
97
106
  ```
98
107
  Autocomplete: <slug>
99
- spec <done|stopped> · temper <done|skipped|stopped> · define <done|stopped> · vet <done|stopped> · build <n/N|stopped> · prove <done|stopped> · polish <done|stopped> · review <done|stopped> · seal <GO|NO-GO|stopped>
108
+ spec <done|stopped> · clarify <clear|stopped> · temper <done|skipped|stopped> · define <done|stopped> · vet <ready|stopped> · build <n/N|stopped> · prove <done|stopped> · polish <done|stopped> · review <done|stopped> · seal <GO|NO-GO|stopped>
100
109
  ```
101
110
 
102
111
  Final state examples: `Shipped: <feature>`, `Stopped: <reason>`, `Awaiting human:
@@ -1,8 +1,8 @@
1
1
  # The autocomplete loop: arm AFK, drive every phase
2
2
 
3
- Autocomplete is an orchestrator: it runs the existing `/rite-*` skills in order,
4
- exactly as a human would, but without stopping between them. It owns no workflow of
5
- its own: the phases do the work; autocomplete sequences them and enforces stops.
3
+ Autocomplete runs the existing `/rite-*` skills in order without stopping between
4
+ routine phases. Each phase keeps its own workflow; autocomplete only sequences phases
5
+ and enforces stop conditions.
6
6
 
7
7
  ## Arm AFK
8
8
 
@@ -16,34 +16,34 @@ allow_gates: [advisory] # only advisory auto-handles; validating+ pause
16
16
  # caps how many run unattended (default = all the plan's slices).
17
17
  ```
18
18
 
19
- The budget is the plan's own slice count, not a fixed number, so the loop builds exactly
20
- the task's slices and stops when they're done; `--max-slices N` only *lowers* it for a
19
+ The budget is the plan's slice count, so the loop builds the planned slices and stops
20
+ when they are done. `--max-slices N` only lowers that number for a
21
21
  partial run. Arm the gate policy at step 3; write `max_slices` / `AFK slices remaining`
22
22
  **after `$rite-vet`** (it runs before the build loop and may split or add a slice, so the
23
23
  count isn't final until then: vet runs on every plan here, so always set the budget after it).
24
24
 
25
- `allow_gates: [advisory]` is deliberate: an open `gate: validating` is merge-blocking
26
- at seal (`afk-hitl.md`), so autocomplete must *pause* on it rather than queue it and
27
- then hit NO-GO. Widen `allow_gates` only if the caller explicitly asked.
25
+ `allow_gates: [advisory]` prevents an open `gate: validating` from being queued until
26
+ seal, where it would force NO-GO under `afk-hitl.md`. Autocomplete pauses on it instead. Widen
27
+ `allow_gates` only when the caller explicitly asks.
28
28
 
29
29
  ## Drive the phases
30
30
 
31
- Run each by Reading its `SKILL.md` and executing that workflow. State flows through the
32
- workspace files (`state.md`, `tasks.md`, `evidence.md`, …), so each phase picks up where
33
- the last left off. There is nothing to thread through chat.
31
+ Read each phase's `SKILL.md` and execute that workflow. Workspace files such as
32
+ `state.md`, `tasks.md`, and `evidence.md` carry state between phases; chat does not.
34
33
 
35
34
  | Step | Phase | Loop / gate |
36
35
  |---|---|---|
37
- | 1 | `$rite-spec` | feed the interview answers; write `spec.md` |
38
- | 2 | `$rite-temper` | significance-gated strategic review; harden spec + write `strategy.md`. Skip low-stakes specs in one line. AFK: `hold-rigor` / `reduce-to-MVP` auto-apply; **any `expand` pauses (blocking)**; irreversible-risk pauses |
39
- | 3 | `$rite-define` | reads `strategy.md`; `plan.md` + `tasks.md`; record `Plan approved` |
40
- | 4 | `$rite-vet` | engineering plan review on **every** plan (light pass on simple plans, full on big/risky; never skipped); harden `plan.md` / `tasks.md` + write `eng-review.md` + `test-plan.md`. AFK: hardening / coverage findings auto-apply; **any scope-growing / acceptance-changing finding pauses (blocking)**; irreversible-risk pauses. Set the slice budget after this (vet may split a slice) |
41
- | 5 | `$rite-build` ×N | **loop** while any slice is `pending`; build one (the slice-wright reads `test-plan.md` for coverage), then run `devrites-engine tick-afk state.md`: exit 3 (budget hit) STOP |
42
- | 6 | `$rite-prove` | once all slices `built`; walks `test-plan.md`; on failure `devrites-debug-recovery` within scope |
43
- | 7 | `$rite-polish` | re-verify after code edits (evidence must stay fresh) |
44
- | 8 | `$rite-review` | apply in-scope fixes; re-prove if code changed |
45
- | 9 | `$rite-seal` | GO/NO-GO decision (no git here) |
46
- | 10 | `$rite-ship` | only if seal GO; `--ship` auto-confirms type-GO, else stop for human |
36
+ | 1 | `$rite-spec` | interactive window: investigate, feed intent answers, write `spec.md` |
37
+ | 2 | `$rite-clarify` | same interactive window: topology-first scan; write `decision-coverage.md`; proceed only on `CLEAR`, then arm AFK |
38
+ | 3 | `$rite-temper` | significance-gated strategic review; harden spec + write `strategy.md`. Skip low-stakes specs in one line. AFK: `hold-rigor` / `reduce-to-MVP` auto-apply; **any `expand` pauses (blocking)**; irreversible-risk pauses |
39
+ | 4 | `$rite-define` | reads `decision-coverage.md` + `strategy.md`; writes `plan.md` + `tasks.md`; records `Plan approved` |
40
+ | 5 | `$rite-vet` | engineering/readiness review on **every** plan (light pass on simple plans, full on big/risky; never skipped); harden `plan.md` / `tasks.md` + write `eng-review.md` (`Implementation readiness: READY`) + `test-plan.md`. AFK: hardening / coverage findings auto-apply; **any scope-growing / acceptance-changing finding pauses (blocking)**; irreversible-risk pauses. Set the slice budget after this (vet may split a slice) |
41
+ | 6 | `$rite-build` ×N | **loop** while any slice is `pending`; build one (the slice-wright reads `test-plan.md` for coverage), then run `devrites-engine tick-afk state.md`: exit 3 (budget hit) ⇒ STOP |
42
+ | 7 | `$rite-prove` | once all slices `built`; walks `test-plan.md`; on failure `devrites-debug-recovery` within scope |
43
+ | 8 | `$rite-polish` | re-verify after code edits (evidence must stay fresh) |
44
+ | 9 | `$rite-review` | apply in-scope fixes; re-prove if code changed |
45
+ | 10 | `$rite-seal` | GO/NO-GO decision (no git here) |
46
+ | 11 | `$rite-ship` | only if seal GO; `--ship` auto-confirms type-GO, else stop for human |
47
47
 
48
48
  ## Between phases
49
49
 
@@ -1,8 +1,8 @@
1
1
  # Stop conditions: when autocomplete must pause for a human
2
2
 
3
- Autonomy covers the routine path. These are the cases where autocomplete writes
4
- `state.md` (`Status: awaiting_human` or `blocked`), surfaces *why* + the single resume
5
- command, fires `notify` if set, and **stops**. None are bypassable by `--ship`.
3
+ In the cases below, autocomplete writes `state.md` (`Status: awaiting_human` or
4
+ `blocked`), reports the reason and one resume command, fires `notify` if set, and
5
+ **stops**. `--ship` cannot bypass them.
6
6
 
7
7
  ## Always stop (irreversible-risk list: from `afk-hitl.md`)
8
8
 
@@ -12,14 +12,17 @@ Regardless of `allow_gates` or `--ship`:
12
12
  - Public-API break (response shape, removed endpoint, changed status semantics).
13
13
  - External-service contract change.
14
14
  - Filesystem destruction outside the workspace.
15
- - Red tests / types / lint at slice end (fail-on-red).
15
+
16
+ Red tests/types/lint/build/browser proof are hard non-advance gates, not automatically human
17
+ gates. Run bounded `devrites-debug-recovery`; if it exhausts, stop as a technical blocker unless
18
+ the remaining issue is human-owned.
16
19
 
17
20
  ## Stop on gate severity
18
21
 
19
22
  - `blocking` gate fires → synchronous pause.
20
23
  - `escalating` gate fires → pause, route to the specialist tag.
21
24
  - Any `questions.md` entry with `gate: validating` and `status: open` → pause (it is a
22
- seal NO-GO by definition; don't sail into a guaranteed NO-GO).
25
+ seal NO-GO by definition; stop before reaching seal).
23
26
 
24
27
  ## Stop on strategic-review scope expansion (`$rite-temper`)
25
28
 
@@ -29,6 +32,12 @@ Regardless of `allow_gates` or `--ship`:
29
32
  never grow the build's scope); **growing scope unattended is never automatic**. A low-stakes
30
33
  spec that temper skips, or a `hold-rigor` / `reduce-to-MVP` run, does **not** pause.
31
34
 
35
+ ## Stop on incomplete decision coverage (`$rite-clarify`)
36
+
37
+ - Stop on any material Partial/Missing/unowned row or low-confidence, high-consequence
38
+ assumption. Continue the up-front window with the next genuine decision packet; never arm
39
+ AFK or carry it into build. Resolve facts and reversible choices automatically.
40
+
32
41
  ## Stop on workflow state
33
42
 
34
43
  - **NO-GO at seal** → stop; surface every blocker with `file:line` and the fix
@@ -38,7 +47,7 @@ Regardless of `allow_gates` or `--ship`:
38
47
  - **Budget exhausted with slices still pending:** `devrites-engine tick-afk` exit 3 while `tasks.md`
39
48
  still has unbuilt slices (only when an explicit `--max-slices` capped the run below the
40
49
  plan's count) → stop; report slices remaining. Exhausting the default budget = all
41
- planned slices built = normal completion → continue to `$rite-prove`, don't pause.
50
+ planned slices built = normal completion → continue to `$rite-prove` without pausing.
42
51
  - **Still low-confidence after the interview:** the idea can't be pinned to testable
43
52
  acceptance criteria → stop and ask, rather than guessing the product.
44
53
  - **Repeated failure:** a phase fails, `devrites-debug-recovery` can't fix it within