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,36 +1,5 @@
1
1
  # rite-seal phase contract
2
2
 
3
- ## Execution spine
4
-
5
- Run the engine gates at these moments:
6
-
7
- ```bash
8
- devrites-engine preamble
9
-
10
- devrites-engine spec-validate .devrites/work/<slug>; echo "spec-validate rc=$?"
11
- devrites-engine check-acceptance .devrites/work/<slug>; echo "check-acceptance rc=$?"
12
- devrites-engine evidence-fresh <slug>; echo "evidence-fresh rc=$?"
13
- devrites-engine doubt-coverage <slug>; echo "doubt-coverage rc=$?"
14
-
15
- devrites-engine footprint log <slug> reviewer devrites-<x>-reviewer
16
- devrites-engine footprint log <slug> skip devrites-<x>-reviewer
17
- devrites-engine footprint roster <slug>; echo "roster rc=$?"
18
- devrites-engine review-integrity <slug>; echo "review-integrity rc=$?"
19
- devrites-engine review-fingerprints --write <slug>
20
-
21
- devrites-engine footprint render <slug>
22
- devrites-engine learnings add "<slug>" "<dismissed-as-intentional class or dead-end>" dismiss
23
- devrites-engine health record <0..10> "<GO|NO-GO evidence summary>" --note "<top blocker or green proof>"
24
- devrites-engine timeline log completed --skill rite-seal --slug <slug> --outcome "<go|no-go>" --decision "<verdict>"
25
-
26
- devrites-engine progress
27
- ```
28
-
29
- Conditional calls still obey the detailed rules below: reviewer and skip
30
- footprints must account for the whole roster; learnings run only on GO; progress
31
- is rendered before the final response from [`output.md`](output.md). Seal decides
32
- only; `/rite-ship` owns irreversible git/publish/deploy actions.
33
-
34
3
  1. **Run the shared orientation preamble:** it prints `state.md`, the artifacts present,
35
4
  the run mode (HITL/AFK), and the open-question tally by gate, so you orient deterministically
36
5
  instead of re-deriving state from raw Markdown:
@@ -80,50 +49,20 @@ only; `/rite-ship` owns irreversible git/publish/deploy actions.
80
49
  verdicts by hand).
81
50
  Either way, walk the `## Decisions stood` ledger yourself: severity rides the unverified
82
51
  **decision**, never the exit code alone.
83
- 5. Check **security, data, migration, rollback** risk:
84
- [risk-and-rollback](risk-and-rollback.md). If `strategy.md` exists (from
85
- `/rite-temper`), confirm its **top pre-mortem risks are mitigated** in the diff/evidence and
86
- that no **Non-goal / deferred item crept into the diff** (scope creep): either is a finding
87
- (an unmitigated top risk or smuggled-in out-of-scope work).
88
- - **Principles** (`principles.md`): score the final diff against each declared invariant in
89
- `.devrites/principles.md`. A violation with no matching, human-approved exception in the
90
- register is a **Critical** finding and a NO-GO; an exception that is stale (past its review
91
- trigger) or wider than its stated scope is itself a finding. No file / no principles → skip.
92
- - **Observability** (`observability.md`): if the diff added a runtime surface (endpoint,
93
- job, integration, user flow, error path), a feature shipping with no way to debug it in
94
- prod is an **Important** finding, not a pass: `evidence.md` should show telemetry observed
95
- to emit (`/rite-prove` step 5b).
96
- - **Developer experience** (`developer-experience.md`): if the diff ships a developer-facing
97
- surface, reconcile `devex.md` (the `/rite-vet` predicted scorecard vs the `/rite-prove`
98
- measured one: the boomerang). A broken public dev contract (a documented command that errors,
99
- a getting-started flow that can't complete) or an unexplained measured DX regression is
100
- **Important**. **Critical** on a frozen public surface (`principles.md`). No surface → skip.
101
- - **Removal / migration** (`deprecation.md`): if the diff deletes or migrates code, an API,
102
- or data, confirm it followed expand→contract, proved the old path unused before removing it,
103
- and carries a rollback for every destructive step. A surprise deletion or a one-shot
104
- breaking migration is a finding (and trips the irreversible-risk gate, `afk-hitl.md`).
52
+ 5. Check **security, data, migration, rollback**, strategy scope, principles,
53
+ observability, developer experience, and removal using
54
+ [risk-and-rollback](risk-and-rollback.md) and the named standards. Unmitigated top risks,
55
+ scope creep, missing runtime diagnostics, broken developer contracts, or unsafe removals
56
+ are findings. An unexcepted declared-principle violation is Critical and NO-GO.
105
57
  6. Check **frontend polish** if UI is involved (states, a11y, responsive, design-system,
106
58
  browser evidence).
107
- 7. **Independent review:** seal is the final gate, not a re-run of `/rite-review`.
108
- It **always re-spawns** the axes `/rite-review` did not cover: `devrites-test-analyst`,
109
- `devrites-security-auditor`, `devrites-performance-reviewer`, and
110
- `devrites-frontend-reviewer` (UI). It **only re-runs the Spec and Code-review axes**
111
- (`devrites-spec-reviewer`, `devrites-code-reviewer`) when the diff changed since
112
- `/rite-review` ran (compare against `review.md`); if the diff is unchanged, carry
113
- review's verdicts on those axes forward rather than re-litigating them.
114
- If subagents are available, fan out **in parallel** (one `Task` block, multiple tool
115
- calls) to the **roster**: the seven reviewers and their checkable triggers are the single
116
- source in [`parallel-dispatch.md`](../../devrites-lib/reference/parallel-dispatch.md) (dispatch
117
- shape + reconciliation there too; `.claude/skills/devrites-lib/reference/standards/agents.md`. "Run independent reviewers in
118
- parallel"). Dispatch every always-on reviewer and every conditional whose trigger the diff
119
- meets; `devrites-devex-reviewer` runs in **measure mode**: grade the measured DX scorecard
120
- and reconcile the boomerang against the `/rite-vet` prediction. Give each the workspace path +
121
- diff *without the author's reasoning*. If subagents are unavailable, run the equivalent
122
- reviews sequentially yourself and flag each as a fallback.
123
- The reviewer **AGENTS** here (fresh context, no author reasoning) are the seal
124
- GATE; `devrites-audit` is the inline single-axis pass run during build/polish.
125
- The two paths are intentional, not divergent: the inline audit catches issues
126
- early; the fresh-context agents are the independent gate before ship.
59
+ 7. **Independent review:** apply the complete roster, triggers, dispatch shape, and
60
+ reconciliation from
61
+ [`parallel-dispatch.md`](../../devrites-lib/reference/parallel-dispatch.md). Await
62
+ fresh-context batches of at most three and give reviewers only the workspace path plus
63
+ immutable diff, without author reasoning. Use named role → safely enforced generic fresh
64
+ agent labelled inline; inline output is never independent. Carry Spec/Code verdicts only
65
+ for an unchanged post-review diff; rerun the other applicable axes.
127
66
  **Footprint: account for the whole roster.** For each reviewer you dispatch, append
128
67
  `devrites-engine footprint log <slug> reviewer devrites-<x>-reviewer` (the reviewer's **exact agent name**:
129
68
  the roster gate matches on it, so a freehand label like `spec` will read as unaccounted); for
@@ -131,13 +70,12 @@ only; `/rite-ship` owns irreversible git/publish/deploy actions.
131
70
  `devrites-engine footprint log <slug> skip devrites-<x>-reviewer` and note the one-line reason in `seal.md`.
132
71
  A conditional reviewer that does not apply is a *recorded skip*, never a silent omission: step 7b
133
72
  proves the roster complete before the verdict.
134
- 7a. **Reconcile findings: confidence over volume.** Band each reviewer finding by confidence
73
+ 7a. **Reconcile findings by confidence.** Band each reviewer finding by confidence
135
74
  (1-10); a low-confidence (≤4) finding that can't be verified against the diff is **suppressed**
136
75
  to a `Suppressed (low-confidence): n` line, not a blocker. Every Critical/Important must cite
137
76
  the `file:line` (or spec line) that proves it. Surface genuine cross-reviewer disagreement
138
77
  **explicitly** rather than averaging it away, and don't let a pile of low-confidence nits
139
- inflate the verdict: the gate is `Critical == 0` + acceptance + drift, not "few findings".
140
- (A seal that fires noise teaches the next one to be ignored.)
78
+ inflate the verdict. The gate is `Critical == 0` + acceptance + drift, not "few findings".
141
79
  7b. **Account for the roster: no reviewer silently skipped.** Before the verdict, prove every
142
80
  roster reviewer carries a decision (dispatched or skip-recorded in step 7's footprint):
143
81
  ```bash
@@ -158,7 +96,7 @@ only; `/rite-ship` owns irreversible git/publish/deploy actions.
158
96
  ```
159
97
  - **rc=1:** an axis in `review.md` is silent (no finding, no justification): **Important** on the
160
98
  review's completeness. Re-run that axis or record its `No-findings:` account, then re-seal.
161
- - **rc=0:** every axis has findings or a justified clean bill; proceed. (No `review.md`, or a
99
+ - **rc=0:** every axis has findings or a justified no-findings result; proceed. (No `review.md`, or a
162
100
  freeform one, is a clean pass: the gate keys on per-axis sections.)
163
101
  Then write stable finding IDs for learning and recurring-dismissal correlation:
164
102
  ```bash
@@ -178,20 +116,10 @@ only; `/rite-ship` owns irreversible git/publish/deploy actions.
178
116
  "acceptance": "<proven>/<total>", "test_integrity": "ok | weakened", "mutation": "<score | n/a>",
179
117
  "blockers": ["<one line each, empty on GO>"] }
180
118
  ```
181
- 9. **On GO only: record proven conventions** to the local ledger
182
- (`.devrites/conventions.md`) so later slices stop re-deriving this project's idioms:
183
- the durable, *evidence-proven* commands / idioms / placement / gotchas this feature
184
- established. Evidence-gated like the seal itself; the band is earned, not guessed; the
185
- step degrades gracefully when unavailable. Full contract + command:
186
- [conventions-ledger](conventions-ledger.md). (Skip entirely on NO-GO.)
187
- 9a. **On GO only: auto-capture learnings** (`.devrites/learnings.md`). Learning is automatic, not a
188
- command anyone must remember: append this feature's durable signal so the **next** feature's
189
- review starts warmer: (a) any reviewer finding the gate **dismissed as intentional here** (a
190
- "don't re-flag X in this project" class, tag `dismiss`); (b) a recurring correction or dead-end
191
- worth not repeating (tag `note`). The review skills load this ledger **before** they fan out, so a
192
- dismissed-finding class stops recurring. It is an untrusted prior: live code always overrides
193
- (`.claude/skills/devrites-lib/reference/standards/security.md`). Promotion of a recurring lesson to a *project rule* stays the
194
- human's call (`/rite-learn`: propose, don't impose). Skip on NO-GO.
119
+ 9. **On GO only:** record evidence-proven conventions through
120
+ [conventions-ledger](conventions-ledger.md).
121
+ 9a. **On GO only:** append durable dismissed-finding or dead-end learnings as untrusted
122
+ priors. Promotion to a project rule remains human-owned.
195
123
  ```bash
196
124
  devrites-engine learnings add "<slug>" "<dismissed-as-intentional class or dead-end>" dismiss
197
125
  ```
@@ -200,7 +128,14 @@ only; `/rite-ship` owns irreversible git/publish/deploy actions.
200
128
  lower for NO-GO or unresolved blockers.
201
129
  ```bash
202
130
  devrites-engine health record <0..10> "<GO|NO-GO evidence summary>" --note "<top blocker or green proof>"
203
- devrites-engine timeline log completed --skill rite-seal --slug <slug> --outcome "<go|no-go>" --decision "<verdict>"
131
+ devrites-engine timeline log run-finished \
132
+ --slug <slug> \
133
+ --outcome "<passed|blocked>" \
134
+ --execution-mode named \
135
+ --guard-strength n/a \
136
+ --reason-id "<DRV-GATE-SEAL-PASSED on GO; otherwise the blocking DRV-* reason>" \
137
+ --host "<claude|codex>" \
138
+ --evidence .devrites/work/<slug>/seal.md
204
139
  ```
205
140
 
206
141
  ## `seal.md` template
@@ -25,6 +25,19 @@ For each risky step, state how to back it out:
25
25
  - A new external dependency with no failure handling is at least **Important**.
26
26
  - Record the chosen rollback path in `seal.md` → "Rollback / Recovery".
27
27
 
28
+ ## Fresh-context fallback weighting
29
+
30
+ An inline final-rung review is useful signal but **not independent evidence**:
31
+
32
+ - Record `independence: fallback` and a roster skip reason; never log it as a dispatched
33
+ reviewer or a clean fresh-context pass.
34
+ - Preserve its findings at their normal severity. A clean inline result still leaves an
35
+ **Important assurance gap** and cannot silently satisfy a required axis.
36
+ - Seal remains NO-GO until that axis runs through a fresh-context spawn, or the human
37
+ explicitly accepts the reduced assurance in `seal.md`. AFK never auto-accepts it.
38
+ - Security or irreversible-risk scope has no reduced-assurance override: unavailable
39
+ independent review remains NO-GO.
40
+
28
41
  ## Destructive operations
29
42
  Confirm any destructive step with the user before shipping. Verify backups exist where
30
43
  relevant. Never treat an irreversible action as routine.
@@ -1,69 +1,64 @@
1
- # Design memory: roll proven design language into project `DESIGN.md`
1
+ # Design memory: record proven design rules in `DESIGN.md`
2
2
 
3
- Optional, UI-only step at `/rite-ship`. A feature's design decisions live in its
4
- feature-scoped `design-brief.md` and are thrown away when the workspace archives. **Design
5
- memory** is the deliberate exception: when a UI feature ships, roll the design language it
6
- *proved* up into a project-level `DESIGN.md`, so the next feature's `devrites-ux-shape`
7
- inherits the system instead of re-discovering it.
3
+ This optional `/rite-ship` step applies only to UI features. Feature design decisions
4
+ live in `design-brief.md` and archive with the workspace. With the user's approval,
5
+ copy proven, reusable design rules into the project-level `DESIGN.md` for later
6
+ features.
8
7
 
9
- The consumers already exist: `devrites-ux-shape` §1 and
10
- `devrites-frontend-craft/reference/design-references.md` both read `DESIGN.md` when present.
11
- This step is the missing **producer**. It closes the loop: feature N seals its design
12
- language → feature N+1 builds to it.
8
+ `devrites-ux-shape` §1 and
9
+ `devrites-frontend-craft/reference/design-references.md` read `DESIGN.md` when present.
10
+ This step writes that file from sealed feature evidence.
13
11
 
14
12
  ## When it runs
15
13
  - **UI features only.** No UI in the diff → skip silently.
16
14
  - **At ship, GO sealed, after the git plan, before type-GO** (step 2a), so the user sees
17
15
  the full staged change set (code + `DESIGN.md`) under the single type-GO that ships it.
18
- - **Opt-in and confirmed.** Persisting to a project-wide artifact is outside feature scope
19
- (`standards/core.md` rule 7), so it is *never silent*. Present a ranked option set
16
+ - **Opt in and confirm.** A project-wide artifact is outside feature scope
17
+ (`standards/core.md` rule 7), so never write it silently. Present a ranked option set
20
18
  (see [`afk-hitl.md`](../../devrites-lib/reference/standards/afk-hitl.md), "Option set");
21
19
  **default is skip**. The user opts to persist.
22
- - **AFK**: first-time `DESIGN.md` *creation* is treated as a `validating` gate (a new
23
- persistent project artifact): propose + queue, don't auto-create. An *append* to an
20
+ - **AFK:** first-time `DESIGN.md` creation is a `validating` gate because it adds a
21
+ persistent project artifact. Propose and queue it; do not create it automatically. An append to an
24
22
  existing `DESIGN.md` is `advisory` and may auto-proceed when `allow_gates` permits, since
25
23
  it only adds evidence-proven entries.
26
24
 
27
25
  ## Inputs (proven only)
28
26
  - `design-brief.md`: direction, color strategy, **calibration** (density / motion), key
29
27
  states, named anchors, and the per-slice **Build-time refinements**.
30
- - The **final diff** + `touched-files.md`: what tokens / components / states *shipped* (the evidence). Roll up only what the diff proves, not what the brief intended.
28
+ - The **final diff** and `touched-files.md`: the tokens, components, and states that
29
+ shipped. Record only what the diff proves, not everything the brief intended.
31
30
  - Existing `DESIGN.md` if present: the merge target.
32
31
 
33
- ## What to roll up: the project's *converged* system, evidence-gated
34
- Only entries the shipped, proven feature establishes. Each is durable, cross-feature design
35
- language, not this feature's one-off choices.
32
+ ## What to record
33
+ Record only reusable rules established by the shipped, proven feature. Exclude choices
34
+ that apply only to this feature.
36
35
  - **Tokens introduced + used:** new color roles / spacing steps / type steps / elevation
37
36
  / radius that shipped and are reusable. Names and values, mirrored from the code.
38
- - **Color strategy + calibration baseline:** the strategy (Restrained / Committed / …) and
39
- density / motion the project keeps landing on; note a deviation as a deviation, not a new
37
+ - **Color strategy and calibration baseline:** the strategy (Restrained / Committed / …) and
38
+ established density / motion; record a deviation as a deviation, not a new
40
39
  default.
41
40
  - **Type & spacing scales** in actual use; **motion** classes + easing; **materiality**
42
41
  (elevation set, hairline usage, glass / texture policy).
43
- - **Component behaviors:** for each shared component this feature established or extended:
44
- the states it ships and its interaction model. Grows one feature at a time.
45
- - **Named-anchor lineage:** the anchors features steered toward, so later work stays
46
- coherent with what's already built.
42
+ - **Component behaviors:** for each shared component established or extended by the
43
+ feature, record its shipped states and interaction model.
44
+ - **Named-anchor lineage:** the anchors used by shipped features.
47
45
  - **Anti-slop exceptions:** any banned default the project *intentionally* uses (with the
48
46
  why), so build / polish don't "correct" a deliberate choice.
49
47
 
50
48
  ## Merge discipline
51
49
  - **Append, don't overwrite.** Add proven entries; never silently rewrite an existing one.
52
- - **Conflict is a question, not an edit.** A new token / font / strategy that contradicts an
53
- existing `DESIGN.md` entry surface it to the user (the option set), don't resolve it
54
- yourself. One design system per project.
55
- - **Never invent.** If the feature didn't prove it, it doesn't go in. `DESIGN.md` is design
56
- *memory*, not design *aspiration*.
57
- - **Attribute + keep lean.** Tag each new entry with the feature slug so the lineage is
58
- legible; one good line beats a paragraph. The file is read every future spec: keep it
59
- scannable.
50
+ - **Ask about conflicts.** If a new token, font, or strategy contradicts an existing
51
+ `DESIGN.md` entry, present the option set to the user. Do not resolve it yourself.
52
+ Keep one design system per project.
53
+ - **Never invent.** Include only rules proven by the feature.
54
+ - **Attribute and keep it short.** Tag each new entry with the feature slug. Future
55
+ specs read this file, so use concise entries.
60
56
 
61
57
  ## How it commits
62
- `DESIGN.md` is a tracked project artifact, so it ships **in the feature commit**:
58
+ `DESIGN.md` is a tracked project artifact and ships **in the feature commit**:
63
59
  1. Write / update `<project-root>/DESIGN.md` from the template below.
64
- 2. **Append `DESIGN.md` to `touched-files.md`** so the existing ship commit-scoping (SKILL
65
- steps 2 + 4) stages it: the design-memory write rides the same commit and the same
66
- type-GO, no second commit.
60
+ 2. **Append `DESIGN.md` to `touched-files.md`** so the existing commit scope (SKILL
61
+ steps 2 and 4) stages it under the same type-GO. Do not create a second commit.
67
62
  3. Note the rollup in `ship.md` (what was added, or "design-memory: skipped by user").
68
63
 
69
64
  ## `DESIGN.md` template (project-level, stack-agnostic)
@@ -5,18 +5,17 @@ argument-hint: "<feature or idea>"
5
5
  user-invocable: true
6
6
  ---
7
7
 
8
- # /rite-spec: investigate deeply, write the spec
8
+ # /rite-spec: investigate and write the spec
9
9
 
10
- The spec phase. Turn a request (even a vague one) into a **fully-covered, correctly-placed
11
- `spec.md`** by investigating deeply and closing every material gap with the human, so
12
- `/rite-define` can plan it and nothing is missed. **No plan, tasks, or code here**. Those
13
- are `/rite-define` and `/rite-build`.
10
+ Turn a request into a **fully covered, correctly placed `spec.md`** by investigating
11
+ the existing system and resolving every material gap found during authoring.
12
+ `/rite-clarify` audits the full topology before `/rite-define` plans it. **Do not write
13
+ a plan, tasks, or code here.** Those belong to `/rite-define` and `/rite-build`.
14
14
 
15
- > **Too small to spec? Use `/rite-quick`.** A typo, copy tweak, config bump, or one-function
16
- > fix does **not** need a full workspace + lifecycle. Stop and run `/rite-quick <change>`: its
17
- > express lane (one contract TDD build scoped prove ship) escalates back here the moment
18
- > the change turns out to touch auth / data / a migration / a public API / more than one slice.
19
- > Spec is for real features; don't pay its ceremony for a one-off.
15
+ > **Use `/rite-quick` for a small change.** A typo, copy edit, config bump, or
16
+ > one-function fix does not need a full workspace and lifecycle. Run
17
+ > `/rite-quick <change>`. It returns here if the work touches auth, data, a migration, a
18
+ > public API, or more than one slice.
20
19
 
21
20
  ## Rules consulted (read on demand from `.claude/skills/devrites-lib/reference/standards/`)
22
21
  Pull `documentation.md` via `Read`
@@ -27,35 +26,34 @@ Pull `spec-grammar.md` and `devrites-lib/reference/workspace-artifact-schema.md`
27
26
  acceptance for a behavioral / high-risk requirement (auth,
28
27
  data model, state machine, public API, money, migration): the structured `### Requirement:` /
29
28
  `#### Scenario:` (SHALL · WHEN/THEN) form, lint-checked by `devrites-engine spec-validate`. Simple criteria
30
- stay flat `AC-###` bullets; the grammar is opt-in by rigor, never forced.
29
+ stay flat `AC-###` bullets; the grammar is opt-in by rigor, never forced. Use
30
+ [`reference/acceptance-criteria.md`](reference/acceptance-criteria.md) to keep each
31
+ criterion independently observable and binary.
31
32
 
32
33
  ## Operating rules (DevRites core)
33
34
  - No silent assumptions · no guessing through confusion · prefer existing conventions ·
34
35
  ask the human when an answer changes scope, placement, data model, UX, security,
35
36
  migration risk, or acceptance.
36
- - **Author section by section, not in one dump.** Draft the spec one section at a time
37
- (problem goal requirements acceptance edge cases), and pause after each: a section
38
- that carries real risk (a contested requirement, a boundary, an unstated assumption) can be
39
- deepened right there with a fitting technique from
40
- [`elicitation.md`](../devrites-lib/reference/standards/elicitation.md) before moving on. A spec
41
- written a section at a time is where sharper thinking lands cheaply; a wall-of-text spec hides
42
- the weak section.
37
+ - **Root authority:** the controlling chat asks every human question, makes decisions, and
38
+ writes the workspace. Read-only evidence work follows the fresh-context contract in
39
+ [`agents.md`](../devrites-lib/reference/standards/agents.md).
40
+ - **Author one section at a time.** Draft problem → goal → requirements → acceptance →
41
+ edge cases, pausing after each section. If a section contains a contested requirement,
42
+ boundary, or unstated assumption, apply a relevant technique from
43
+ [`elicitation.md`](../devrites-lib/reference/standards/elicitation.md) before continuing.
43
44
 
44
45
  ## Workflow
45
46
  0. **Read `.claude/skills/devrites-lib/reference/standards/core.md`:** the always-on operating rules and anti-rationalizations.
46
47
  Then run `devrites-engine preamble` for deterministic workspace orientation.
47
- 0a. **Brownfield check: onboard before speccing onto un-adopted existing code.** If this is an
48
- **existing codebase** (real source predating DevRites) that has **never been adopted** (no
48
+ 0a. **Check whether existing code needs adoption.** If this is an
49
+ **existing codebase** that has **never been adopted** (no
49
50
  `.devrites/conventions.md`, no prior `.devrites/work`, `.devrites/features`, or `.devrites/archive`) the build has no
50
- conventions ledger to follow and the first slice would guess the project's idioms. Route
51
- through `/rite-adopt` **first**, carrying `$ARGUMENTS` as its *next objective*: adopt
52
- reverse-derives the baseline `spec.md`, **seeds the conventions ledger**, and proposes
53
- principles, so this feature is specced on top of an onboarded project (adopt owns the
54
- onboarding; `/rite-spec` only detects and routes: no duplicated logic). In **HITL** present a
55
- ranked option (recommended: *adopt first, then spec this on top*; escape hatch: *spec-only, skip
56
- onboarding*); in **AFK** (adoption allowed) run `/rite-adopt` first automatically. **Greenfield
57
- (no pre-existing source) or an already-onboarded project → skip silently**: never block a spec
58
- for the absence of adoption (the same no-op discipline as the principles gate). Cheap probe:
51
+ conventions ledger, route through `/rite-adopt` **first** and pass `$ARGUMENTS` as its
52
+ next objective. Adopt derives the baseline `spec.md`, seeds conventions, and proposes
53
+ principles; `/rite-spec` only detects and routes. In **HITL**, present a ranked option:
54
+ recommend adoption first and include a spec-only escape hatch. In **AFK**, when adoption
55
+ is allowed, run `/rite-adopt` automatically. **Skip this check silently for greenfield or
56
+ already-onboarded projects.** Never block a spec only because adoption is absent. Probe:
59
57
  ```bash
60
58
  if [ ! -f .devrites/conventions.md ] && [ ! -d .devrites/archive ] \
61
59
  && [ -z "$(ls .devrites/work .devrites/features 2>/dev/null)" ] \
@@ -63,137 +61,88 @@ stay flat `AC-###` bullets; the grammar is opt-in by rigor, never forced.
63
61
  echo "brownfield, not yet adopted → recommend /rite-adopt first (carry this idea as its next objective)"
64
62
  else echo "greenfield or already onboarded → continue spec"; fi
65
63
  ```
66
- 1. **Understand the request** (`$ARGUMENTS`). Restate the goal and the *real problem
67
- behind it* in a sentence or two.
68
- **Completion:** one sentence states both requested outcome and underlying problem.
64
+ 1. **Understand the request** (`$ARGUMENTS`). State the requested outcome and the
65
+ underlying problem in one or two sentences.
66
+ **Completion:** one sentence includes both.
69
67
  1a. **Local dedupe.** Search local issues/PRDs and archived specs before creating a new workspace:
70
68
  ```bash
71
69
  devrites-engine spec-dedupe "$ARGUMENTS"
72
70
  ```
73
71
  If it finds a close match, ask the user: extend existing / adopt / new spec. Record the choice in
74
72
  `decisions.md` once the workspace exists. No match → continue silently.
75
- 2. **Investigate deeply:** [investigation](reference/investigation.md). Produce, and
76
- later write into the spec: **current behavior**; **placement** (which module/layer/
77
- file/component should own it, the seam, patterns to reuse, and integration points:
78
- callers, dependents, data, APIs/events); **what it resolves**; **issues**
79
- (conflicts/constraints); **gaps** (unknowns); **blast radius**. Use a code-intelligence
80
- index **if available**: `codebase-memory-mcp` first, cross-checked with `codegraph`
81
- (`.codegraph/` / `codegraph_*`) + `graphify` (`graphify-out/`), else standard methods
82
- (LSP / `Read`/`Grep`/`Glob`); see `.claude/skills/devrites-lib/reference/standards/tooling.md`:
83
- for placement/callers/impact instead of broad file reads; fall back to reading files. For
84
- uncertain external library/framework facts that bear on placement or feasibility, consult
85
- context7 if available. When a material decision turns on a fact outside the codebase: a
86
- common UX pattern, a standard, a prevailing best practice, how comparable products solve it:
87
- **search the web if available** (brave MCP preferred; see `.claude/skills/devrites-lib/reference/standards/tooling.md`), and
88
- carry the cited finding into the option you put to the human at step 4.
89
- Also discover the project's **test / build/typecheck/lint** commands and the
90
- frontend/backend systems; read `PRODUCT.md` / `DESIGN.md` / `CLAUDE.md` / `AGENTS.md` if
91
- present (`AGENTS.md` is the cross-tool agent-conventions standard (treat it as project
92
- conventions the build must follow, same standing as `CLAUDE.md`), and read
93
- `.devrites/principles.md` if present) the declared invariants the feature must respect.
94
- **Consult the capability ledger**: the living record of what the system already does
73
+ 2. **Investigate:** follow [investigation](reference/investigation.md) through its
74
+ complete findings and done-when gate. Also discover the project's **test /
75
+ build/typecheck/lint** commands, frontend/backend systems, and declared project guidance
76
+ (`PRODUCT.md`, `DESIGN.md`, `CLAUDE.md`, `AGENTS.md`, and `.devrites/principles.md` when
77
+ present).
78
+ **Consult the capability ledger**, which records current system behavior
95
79
  ([`ledger.md`](../rite-ship/reference/ledger.md)): `devrites-engine ledger list` for the
96
80
  capabilities on record, then `devrites-engine ledger show <capability>` for any this feature
97
81
  touches. Also search prior decisions with `devrites-engine decisions search "<2-4 feature nouns>"`
98
- before asking the human to re-decide a settled architecture/API/auth choice. Starting from the proven contract (not a cold re-derive) is what makes the spec store
99
- compound across features; it also tells you which requirements are new vs a change to existing
100
- behavior, which decides the delta kind in step 5.
101
- 3. **Gather design references (optional):** [references-intake](reference/references-intake.md).
102
- The human **may** attach screenshots, mockups, a Figma link, a video, or links, or
103
- **none at all** (perfectly normal; skip this step then). If any are given: **view/fetch**
82
+ before asking the human to revisit a settled architecture, API, or auth choice. The
83
+ ledger shows whether each requirement is new or changes existing behavior, which
84
+ determines the delta kind in step 5.
85
+ Identify proof constraints now: human-only credentials, unavailable environments, approval
86
+ windows, or acceptance not observable through existing test/runtime/browser surfaces.
87
+ Split independent placement, blast-radius, and external-fact questions into at most three
88
+ bounded `devrites-evidence-scout` packets on one frozen baseline. Await and reconcile every
89
+ cited dossier before step 4. The scout supplies facts only; it never asks the human or writes
90
+ the spec.
91
+ 3. **Gather design references when provided:** [references-intake](reference/references-intake.md).
92
+ The human may attach screenshots, mockups, a Figma link, a video, links, or nothing.
93
+ Skip this step when none are provided. Otherwise, **view or fetch**
104
94
  them, **save local files** into `.devrites/work/<slug>/references/`, and index them in
105
95
  `references.md` as target, constraint, or inspiration. Later phases honor that role
106
96
  rather than treating every reference as a fidelity target.
107
97
  **Completion:** every supplied reference is saved and classified, or absence is explicit.
108
- 3a. **Shape the UX/UI before code (if the feature touches UI)**, when this feature is
109
- frontend ([frontend-trigger](../rite-build/reference/frontend-trigger.md)), apply
110
- `devrites-ux-shape` **now**, woven into the spec, not as a separate phase. It turns the
111
- references + the spec into a feature-level **`design-brief.md`** (design direction, key
98
+ 3a. **Shape UX/UI before code when the feature is frontend**
99
+ ([frontend-trigger](../rite-build/reference/frontend-trigger.md)). Apply
100
+ `devrites-ux-shape` within the spec phase. It turns the
101
+ references and spec into a feature-level **`design-brief.md`** (design direction, key
112
102
  states, interaction model, optional Figma/image visual-direction probe) that `/rite-build`
113
- targets so the UI is built to plan, not guessed. In HITL it pauses for the human to
103
+ targets for the build. In HITL it pauses for the human to
114
104
  confirm the direction; in AFK it asserts the best guess and logs it. Pure
115
105
  backend/data/CLI features skip this.
116
- 4. **Close the gaps with the human. You recommend, the human decides.** Every material gap
117
- (one that moves **objective · scope · placement · data model · UX · integration ·
118
- non-functional · security · migration risk · acceptance**) is **put to the human as a ranked
119
- option set**, one gap at a time, via the harness `AskUserQuestion` in HITL: **2-4 concrete
120
- options, your recommended one first and marked `(Recommended)`**, each with a one-line
121
- rationale + trade-off tagged by the dimensions that matter, plus an escape hatch (*Something
122
- else. I'll describe it*). Render contract + AFK behaviour: the **Option set** section of
123
- [`afk-hitl.md`](../devrites-lib/reference/standards/afk-hitl.md); spec-phase question discipline:
124
- [question-protocol](reference/question-protocol.md). Your job is to **investigate, rank, and
125
- recommend**, not to settle a material decision yourself. **Confidence changes the *cost* of
126
- the question, not its *owner*:** when you're near-certain, you still present the set (the
127
- human just confirms your `(Recommended)` option in one pick) you do **not** silently decide
128
- it because you predicted the answer. Only a **genuinely reversible, low-impact** detail is
129
- auto-decided and logged to `assumptions.md`; when unsure whether a gap is material, ask.
130
- (Vague ask `devrites-interview`; rough idea → `/rite-pressure-test`.) For a vague ask,
131
- load [`reference/interview-patterns.md`](reference/interview-patterns.md), **map the decision
132
- tree**, and resolve each branch depth-first; **cover every dimension**:
133
- each resolved by a human pick or explicitly deferred (logged, non-blocking), never silently
134
- skipped. Aim for **zero blocking gaps**. *If a gap is genuinely undecidable on paper (state
135
- machine that may deadlock, data shape ambiguity, "which UX wins") → suggest a
136
- scoped detour to `/rite-prototype` to answer that ONE question before
137
- continuing.* **Invariant conflict is a blocking gap:** if a requirement or acceptance
138
- criterion can only be satisfied by breaking a declared principle (`.devrites/principles.md`),
139
- surface it: the principle wins by default; breaking it needs a recorded, scoped exception a
140
- human approves, never a spec that silently contradicts an invariant.
141
- 5. **Create the workspace** + set `.devrites/ACTIVE`
142
- ([state-workspace](reference/state-workspace.md)). Write compact `README.md`,
143
- `brief.md`, and `spec.md` ([spec-template](reference/spec-template.md)). WHAT/WHY,
144
- technology-agnostic, with requirements, acceptance, edge cases, scope boundaries, links
145
- to future `architecture.md` / `traceability.md`, and measurable acceptance
146
- ([acceptance-criteria](reference/acceptance-criteria.md)). For a
147
- behavioral / high-risk requirement, write the acceptance as a structured
148
- `### Requirement:` (SHALL) + `#### Scenario:` (WHEN/THEN) block per
149
- [`spec-grammar.md`](../devrites-lib/reference/standards/spec-grammar.md), nesting the `AC-###` id inside each scenario
150
- so `/rite-seal` still grades it; routine criteria stay flat `AC-###` bullets. **When a
151
- capability the ledger already holds is changing, write those requirements as deltas**:
152
- `## ADDED / MODIFIED / REMOVED Requirements — capability: <c>` (spec-grammar.md § Delta form):
153
- so the change, not just the end state, is explicit and `/rite-ship` folds it cleanly; a
154
- capability with no ledger entry stays flat (the first sync seeds it). Also
155
- write `brief.md`, `references.md`, `questions.md`, `decisions.md`, `assumptions.md`,
156
- and an initial compact `state.md` (phase: spec) from
157
- [state-workspace](reference/state-workspace.md). When the feature touches
158
- UI, `design-brief.md` is written here too (by `devrites-ux-shape`, step 3a).
159
- Populate `## Edge Coverage` with the deterministic boundary classes implied by each requirement
160
- (empty/huge input, rounding, timezone, ordering, permissions, races, migration) and `## Prohibitions (must-NOT)`
161
- only for bespoke constraints. If the feature touches model calls, RAG, agents, evals, or LLM output,
162
- also create `ai-spec.md` from [ai-spec-template](reference/ai-spec-template.md). Then refresh any
163
- managed project context block so `AGENTS.md` / `CLAUDE.md` point at the new active workspace:
106
+ 4. **Resolve human-owned gaps.** Recommend an option and let the human decide. Apply
107
+ [question-protocol](reference/question-protocol.md), the shared
108
+ [`afk-hitl.md` option-set and decision-ownership rules](../devrites-lib/reference/standards/afk-hitl.md#decision-ownership-search-before-asking),
109
+ and [`interview-patterns.md`](reference/interview-patterns.md) for a vague ask. Every
110
+ material dimension is resolved by a human pick or explicitly deferred as non-blocking;
111
+ only genuinely reversible, low-impact details go to `assumptions.md`. A paper-only
112
+ uncertainty may take one scoped `/rite-prototype` detour. A declared-principle conflict
113
+ remains blocking until the human approves a recorded, scoped exception.
114
+ 4a. **Build-interruption forecast.** Search first, then list and close foreseeable human needs:
115
+ product/acceptance ambiguity, irreversible/external approval, or human-only access. Record
116
+ owned prerequisites. Keep a build checkpoint only for unavailable pre-code evidence or a
117
+ mandatory action-time approval. **Completion:** no foreseeable human choice is deferred.
118
+ 5. **Create the workspace** + set `.devrites/ACTIVE` from
119
+ [state-workspace](reference/state-workspace.md). Write every required artifact and
120
+ conditional annex exactly from [spec-template](reference/spec-template.md), including its
121
+ grammar/delta, coverage-seed, edge/prohibition, UI, and AI rules. Then refresh any managed
122
+ project context block so `AGENTS.md` / `CLAUDE.md` point at the new active workspace:
164
123
  ```bash
165
124
  devrites-engine context sync || true
166
125
  ```
167
- 5a. **Score the spec prose: "unit tests for English"** ([spec-checklists](reference/spec-checklists.md)).
168
- Emit `.devrites/work/<slug>/checklists/<domain>.md` (one per requirement domain the spec covers:
169
- functional · data-model · interaction · non-functional · edge-cases). Each tests the *requirement
170
- prose* for completeness / clarity / measurability: "is 'prominent' quantified?", "is every
171
- enumeration closed?", **not** the implementation. Fix each CRITICAL fail by editing the spec
172
- (not by softening the question); minor fails are logged. The checklists feed the readiness gate.
173
- 6. **Run the spec readiness gate** (bottom of spec-template): no blocking
174
- `[NEEDS CLARIFICATION]`, placement decided, all material gaps resolved, any design
175
- references provided are saved, **UX/UI shaped into `design-brief.md` if the feature is
176
- UI**, requirements testable, success criteria measurable, **one-sentence intent** (the whole
177
- change states its intent in a single sentence (if it can't, it is two features: split it or
178
- narrow the scope), **every `checklists/<domain>.md` at
179
- `Verdict: pass`**, and **any structured requirement blocks are grammar-valid**) run
180
- `devrites-engine spec-skeleton` first, then `devrites-engine spec-validate` with
181
- `--against .devrites/specs` so any delta sections are also
182
- reconciled against the ledger (an ADDED that already exists, or a MODIFIED/REMOVED that doesn't,
183
- is a blocking failure to fix, not soften):
126
+ 5a. **Check the spec prose** with [spec-checklists](reference/spec-checklists.md).
127
+ Emit every applicable domain checklist and fix each CRITICAL by correcting the spec,
128
+ never by softening the question.
129
+ 6. **Run the complete readiness gate** at the bottom of
130
+ [spec-template](reference/spec-template.md), then validate structure and ledger deltas:
184
131
  ```bash
185
132
  devrites-engine spec-skeleton ".devrites/work/<slug>"
186
133
  devrites-engine spec-validate ".devrites/work/<slug>" --against .devrites/specs
187
134
  ```
188
135
  **Do not run `devrites-engine analyze` in this phase:** `tasks.md` deliberately does not
189
136
  exist yet. `/rite-define` owns the first analyze pass after it writes the slices.
190
- Treat edge/prohibition findings as blocking just like grammar findings. When it passes, write `Spec gate: passed <iso>` to `state.md`.
191
- 6a. **Review-before-code digest.** Before handing off to planning, render the cheap human review:
137
+ Any failure blocks. The interruption forecast must be resolved, owned, or a justified
138
+ action-time gate. Then write `Spec gate: passed <iso>`.
139
+ 6a. **Review-before-code digest.** Before planning, render the compact human review:
192
140
  `Intent` (one sentence), `Done means` (top acceptance/scenario IDs), `Scope/risk` (what is in/out
193
141
  plus the hard gates), and `Build exactly this?` (yes → next phase; no → revise now). The digest
194
142
  is a view over `spec.md`, not a new artifact. **Stop** after the digest.
195
143
 
196
- > **Mid-flight discipline.** When tempted to skip investigation depth, gap-closing, or placement decisions: see [`anti-patterns`](reference/anti-patterns.md) (Common Rationalizations + Red Flags). Load it the moment you reach for the excuse.
144
+ > **Mid-flight discipline.** Do not skip investigation, gap resolution, or placement
145
+ > decisions. See [`anti-patterns`](reference/anti-patterns.md).
197
146
 
198
147
  ## Output
199
148
 
@@ -204,12 +153,12 @@ Default success shape:
204
153
  Done: spec ready for <slug>; placement decided and gaps closed.
205
154
  Changed: spec.md, decisions.md, assumptions.md, questions.md, references/ <updated|n/a>
206
155
  Evidence: checklists passed; grammar <valid | n/a flat acceptance>; design brief <path | n/a>
207
- Open: <none | n non-blocking questions | Alternative: /rite-define for small reversible work>; review digest: intent + done-means + scope/risk rendered
208
- Next: /rite-temper
156
+ Open: <none | n non-blocking questions | Alternative: /rite-quick if express-lane eligible>; review digest: intent + done-means + scope/risk rendered
157
+ Next: /rite-clarify
209
158
  Record: .devrites/work/<slug>/spec.md
210
- ↻ Hygiene: /clear before the next phase; /rite-handoff if away > a few hours
159
+ ↻ Hygiene: /clear before /rite-clarify; /rite-handoff if away > a few hours
211
160
  ```
212
- If a workspace with the slug already exists, update its spec rather than overwriting blindly:
161
+ If a workspace with the slug already exists, update its spec rather than overwriting it,
213
162
  and **show the human a short diff of what changed** in `spec.md` (acceptance criteria added /
214
163
  removed / reworded) before proceeding. A spec edit reviewed as a diff catches silent scope
215
164
  drift that a full re-read buries; this is the spec-review view (`/rite-spec --review` renders