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
package/CHANGELOG.md CHANGED
@@ -2,6 +2,24 @@
2
2
 
3
3
  All notable changes to DevRites are documented here. The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and DevRites adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). Releases are generated automatically by [semantic-release](https://semantic-release.gitbook.io/) from Conventional Commits on `main`.
4
4
 
5
+ ## [3.2.0](https://github.com/ViktorsBaikers/DevRites/compare/v3.1.0...v3.2.0) (2026-07-24)
6
+
7
+ ### Added
8
+
9
+ * **rite:** add semantic workspace upgrades ([3a7e51d](https://github.com/ViktorsBaikers/DevRites/commit/3a7e51d478fe9ed19c4de1ee4988e43d63ecf9a2))
10
+
11
+ ## [3.1.0](https://github.com/ViktorsBaikers/DevRites/compare/v3.0.7...v3.1.0) (2026-07-24)
12
+
13
+ ### Added
14
+
15
+ * **devrites:** harden planning and agent orchestration ([50be03b](https://github.com/ViktorsBaikers/DevRites/commit/50be03b90f1d5004ea010cf68ff07b74bab491c6))
16
+
17
+ ### Fixed
18
+
19
+ * **ci:** correct invocation and eval discovery gates ([0a0d7d2](https://github.com/ViktorsBaikers/DevRites/commit/0a0d7d27546b90a7f5a2dd72bc9326f29416cc54))
20
+ * **devrites:** clear security and Windows mode gates ([59fcfc6](https://github.com/ViktorsBaikers/DevRites/commit/59fcfc6c1806975e36a69cde4e8a2c504657161a))
21
+ * **devrites:** restore static and Windows engine gates ([8aeb479](https://github.com/ViktorsBaikers/DevRites/commit/8aeb4793adf0ce57ba4dba7ddcb7e56f9f612f40))
22
+
5
23
  ## [3.0.7](https://github.com/ViktorsBaikers/DevRites/compare/v3.0.6...v3.0.7) (2026-07-22)
6
24
 
7
25
  ### Fixed
package/README.md CHANGED
@@ -14,14 +14,18 @@ continues.
14
14
 
15
15
  The core path is:
16
16
 
17
- `SPEC -> DEFINE -> VET -> BUILD -> PROVE -> POLISH -> REVIEW -> SEAL -> SHIP`
17
+ `SPEC -> CLARIFY -> [TEMPER] -> DEFINE -> VET -> BUILD -> PROVE -> POLISH -> REVIEW -> SEAL -> SHIP`
18
+
19
+ Clarify is mandatory but adaptive, so it asks no questions when the contract
20
+ is complete. Temper adds an optional strategic review. Vet is the only final
21
+ readiness phase before Build.
18
22
 
19
23
  Seal decides whether the feature is ready without changing git. Ship owns the
20
24
  final commit, push, and tag, and it requires a typed `GO` confirmation.
21
25
  Unattended runs may create local WIP checkpoint commits along the way, but only
22
26
  Ship collapses and pushes them.
23
27
 
24
- **Status:** [`v3.0.7`](https://github.com/ViktorsBaikers/DevRites/releases/tag/v3.0.7): see [`CHANGELOG.md`](CHANGELOG.md) for release notes.
28
+ **Status:** [`v3.2.0`](https://github.com/ViktorsBaikers/DevRites/releases/tag/v3.2.0): see [`CHANGELOG.md`](CHANGELOG.md) for release notes.
25
29
 
26
30
  ## Quick start
27
31
 
@@ -67,32 +71,39 @@ Claude Code supports both `/rite <verb>` and `/rite-<verb>`. Codex uses the same
67
71
  forms with `$`: `$rite <verb>` and `$rite-<verb>`. The menu and direct forms run
68
72
  the same skill.
69
73
 
70
- | Stage | Direct command | What happens |
71
- |---|---|---|
72
- | Spec | [`/rite-spec <feature>`](pack/.claude/skills/rite-spec/SKILL.md) | Investigates the request and codebase, closes product gaps, and writes `spec.md`. |
73
- | Define | [`/rite-define`](pack/.claude/skills/rite-define/SKILL.md) | Turns the spec into architecture, a plan, traceability, and vertical task slices. |
74
- | Vet | [`/rite-vet`](pack/.claude/skills/rite-vet/SKILL.md) | Reviews every plan before implementation. The depth scales with the risk. |
75
- | Build | [`/rite-build`](pack/.claude/skills/rite-build/SKILL.md) | Implements and verifies exactly one slice, then stops. Repeat for each slice. |
76
- | Prove | [`/rite-prove`](pack/.claude/skills/rite-prove/SKILL.md) | Runs the completed feature's tests, build, runtime checks, and browser proof when UI is involved. |
77
- | Polish | [`/rite-polish`](pack/.claude/skills/rite-polish/SKILL.md) | Cleans up the touched code and normalizes the UI when needed. |
78
- | Review | [`/rite-review`](pack/.claude/skills/rite-review/SKILL.md) | Runs feature-scoped review across the relevant engineering axes. |
79
- | Seal | [`/rite-seal`](pack/.claude/skills/rite-seal/SKILL.md) | Produces a final `GO` or `NO-GO` decision without changing git. |
80
- | Ship | [`/rite-ship`](pack/.claude/skills/rite-ship/SKILL.md) | On `GO`, asks for typed confirmation, performs the approved git actions, and archives the workspace. |
74
+ | # | Stage | Direct command | What happens |
75
+ |---:|---|---|---|
76
+ | 1 | Spec | [`/rite-spec <feature>`](pack/.claude/skills/rite-spec/SKILL.md) | Inspects the request and codebase, asks about product gaps, and writes `spec.md`. |
77
+ | 2 | Clarify | [`/rite-clarify`](pack/.claude/skills/rite-clarify/SKILL.md) | Checks the whole feature for missing decisions before planning. It asks no questions when everything is clear. |
78
+ | 3 | Temper | [`/rite-temper`](pack/.claude/skills/rite-temper/SKILL.md) | Challenges scope and failure modes before Define. It is optional for small work and always runs in `/rite-autocomplete`. |
79
+ | 4 | Define | [`/rite-define`](pack/.claude/skills/rite-define/SKILL.md) | Turns the approved spec into architecture, a plan, traceability, and vertical task slices. |
80
+ | 5 | Vet | [`/rite-vet`](pack/.claude/skills/rite-vet/SKILL.md) | Reviews every plan before implementation. The review depth scales with the risk. |
81
+ | 6 | Build | [`/rite-build`](pack/.claude/skills/rite-build/SKILL.md) | Implements and verifies one slice, then stops. Run it again for each remaining slice. |
82
+ | 7 | Converge | [`/rite-converge`](pack/.claude/skills/rite-converge/SKILL.md) | Runs only when recovery is needed. It compares the code with the recorded intent, adds missing slices, and sends the changed plan back to Vet. |
83
+ | 8 | Prove | [`/rite-prove`](pack/.claude/skills/rite-prove/SKILL.md) | Runs the completed feature's tests, build, runtime checks, and browser proof when the feature has a UI. |
84
+ | 9 | Polish | [`/rite-polish`](pack/.claude/skills/rite-polish/SKILL.md) | Cleans up the touched code and normalizes the UI when needed. |
85
+ | 10 | Review | [`/rite-review`](pack/.claude/skills/rite-review/SKILL.md) | Reviews the completed feature against its spec and engineering standards. |
86
+ | 11 | Seal | [`/rite-seal`](pack/.claude/skills/rite-seal/SKILL.md) | Writes the final `GO` or `NO-GO` decision without changing git. |
87
+ | 12 | Ship | [`/rite-ship`](pack/.claude/skills/rite-ship/SKILL.md) | On `GO`, asks for typed confirmation, performs the approved git actions, and archives the workspace. |
88
+ | n/a | Upgrade *(conditional)* | [`/rite-upgrade [slug]`](pack/.claude/skills/rite-upgrade/SKILL.md) | Brings an active unfinished workspace onto the current planning contract without rewriting completed work or evidence. Build readiness sends stale workspaces here automatically. |
81
89
 
82
90
  Some work needs a different route:
83
91
 
84
92
  - [`/rite-quick`](pack/.claude/skills/rite-quick/SKILL.md) handles a small,
85
93
  reversible change without creating a full feature workspace.
86
- - [`/rite-temper`](pack/.claude/skills/rite-temper/SKILL.md) challenges the
87
- scope and failure modes of a larger spec before Define.
88
- - [`/rite-converge`](pack/.claude/skills/rite-converge/SKILL.md) compares a
89
- resumed, adopted, or stalled feature with the live code and adds the missing
90
- work as new slices.
91
94
  - [`/rite-autocomplete`](pack/.claude/skills/rite-autocomplete/SKILL.md) runs
92
95
  the lifecycle unattended. With `--ship`, it auto-confirms the final typed
93
96
  `GO`; without that flag, it stops and waits for you.
97
+ - [`/rite-upgrade [slug]`](pack/.claude/skills/rite-upgrade/SKILL.md) is a
98
+ maintenance route for an active workspace planned under older DevRites
99
+ rules. It is not a mandatory lifecycle phase.
94
100
  - [`/rite`](pack/.claude/skills/rite/SKILL.md) shows the command menu.
95
101
 
102
+ `devrites-engine update` refreshes the installed engine and pack.
103
+ `devrites-engine migrate` normalizes workspace layout and structural state.
104
+ Neither replaces `/rite-upgrade`, which reconciles unfinished planning
105
+ semantics while preserving completed work.
106
+
96
107
  The [command map](docs/command-map.md) covers every command, trigger, input, and
97
108
  output. The [worked examples](docs/usage.md) show normal features, plan drift,
98
109
  UI work, backend work, and mid-flight handoffs.
@@ -113,9 +124,12 @@ the original decisions and proof.
113
124
  work/<slug>/
114
125
  brief.md
115
126
  spec.md
127
+ decision-coverage.md
116
128
  architecture.md
117
129
  plan.md
118
130
  tasks.md
131
+ eng-review.md
132
+ test-plan.md
119
133
  state.md
120
134
  decisions.md
121
135
  questions.md
@@ -127,20 +141,25 @@ the original decisions and proof.
127
141
  archive/<slug>/
128
142
  ```
129
143
 
130
- Some phases add focused artifacts such as `strategy.md`, `test-plan.md`,
131
- `design-brief.md`, `browser-evidence.md`, `polish-report.md`, `drift.md`, or
132
- `handoff.md`. See the [workspace contract](docs/orchestration.md) for the full
133
- state model.
144
+ Some phases add focused artifacts such as `strategy.md`, `design-brief.md`,
145
+ `browser-evidence.md`, `polish-report.md`, `drift.md`, or `handoff.md`. See the
146
+ [workspace contract](docs/engine/workspace-schema.md) for the full state model.
134
147
 
135
148
  ## Safety rules
136
149
 
137
- - **Plan before code.** Spec, Define, and Vet settle the intended behavior and
138
- implementation path before Build starts.
150
+ - **Settle before code.** Spec and Clarify settle the behavior contract. Define
151
+ and Vet settle the implementation path before Build starts. The engine checks
152
+ the meaning and input digests of fresh `CLEAR` and `READY` artifacts; marker
153
+ text alone does not pass.
139
154
  - **Build one slice.** `/rite-build` implements one vertical slice and records
140
- its proof before returning control.
141
- - **Stop on drift.** If implementation no longer matches the plan, the Spec
142
- Drift Guard records the mismatch in `drift.md` and routes through
143
- [`/rite-plan repair`](pack/.claude/skills/rite-plan/SKILL.md).
155
+ its proof before returning control. Before dispatching the sole writer, the
156
+ root writes an exact `.wright-allowlist`. Reconciliation and integrity gates
157
+ use the same pre-slice baseline.
158
+ - **Classify drift before routing.** The Spec Drift Guard records the mismatch
159
+ in `drift.md`. Build handles objective implementation and tool failures with
160
+ bounded recovery; it uses
161
+ [`/rite-plan repair`](pack/.claude/skills/rite-plan/SKILL.md) only when the
162
+ durable plan is wrong, and asks you only for a real product or risk decision.
144
163
  - **Prove claims.** Tests, commands, output, and opened screenshots support
145
164
  completion claims. A screenshot path by itself is not proof.
146
165
  - **Separate the decision from the action.** Seal makes the release decision.
@@ -178,10 +197,11 @@ The workflow treats this file as configuration and never rewrites it.
178
197
  engine decrements that state after each built slice. Delete `.devrites/AFK` to
179
198
  return to HITL.
180
199
 
181
- AFK still pauses for blocking or escalating gates, destructive migrations,
182
- auth or authorization changes, public API breaks, external service contract
183
- changes, filesystem destruction outside the workspace, and red tests, types,
184
- or lint. The full pause and gate contract is in
200
+ AFK still pauses for product, scope, or policy choices, irreversible risk,
201
+ and access or actions available only to a human. Agents use bounded recovery
202
+ for red tests, type or lint errors, runtime failures, and missing technical
203
+ coverage. If that recovery budget runs out, they record a technical blocker
204
+ instead of asking a question. The full pause and gate contract is in
185
205
  [`afk-hitl.md`](pack/.claude/skills/devrites-lib/reference/standards/afk-hitl.md).
186
206
 
187
207
  ## Install, update, and remove
@@ -207,7 +227,7 @@ Useful install flags:
207
227
  |---|---|
208
228
  | `--target DIR` | Use another project directory. |
209
229
  | `--dry-run` | Show planned file operations without changing anything. |
210
- | `--force` | Replace conflicting files that DevRites does not own. |
230
+ | `--force` | Replace or remove foreign or customized managed files. The installer still rejects symlinks and path escapes. |
211
231
  | `--no-codex` | Skip `.agents`, `.codex`, and `AGENTS.md` integration. |
212
232
  | `--no-agents` | Skip the review agents. |
213
233
  | `--no-skills` | Skip skills and their bundled standards. |
@@ -232,11 +252,22 @@ curl -fsSL https://raw.githubusercontent.com/ViktorsBaikers/DevRites/main/instal
232
252
  curl -fsSL https://raw.githubusercontent.com/ViktorsBaikers/DevRites/main/install.sh | bash -s -- --dry-run
233
253
  ```
234
254
 
235
- The installer records every managed project file in
236
- `.claude/devrites.manifest`. Update and uninstall use that manifest, preserve
237
- `.devrites/`, and avoid removing files they do not own. The optional shared
238
- `devrites-engine` binary is the only artifact that may be installed outside the
239
- project.
255
+ The installer records every managed project file and its SHA-256 in
256
+ `.claude/devrites.manifest`. Before an update or uninstall changes anything, it
257
+ checks every managed path. It preserves customized files and tells the user to
258
+ retry with `--force` before making any changes; legacy manifests without hashes
259
+ also require `--force`.
260
+ `--force --dry-run` lists the exact destructive actions. Marker-merged files
261
+ keep user content outside the DevRites block, and `.devrites/` runtime state
262
+ remains in place. The installer refuses symlinks, junctions, and paths that
263
+ escape the target.
264
+
265
+ The optional shared `devrites-engine` binary is the only artifact installed
266
+ outside the project. Before replacement, the release binary at its staged path
267
+ must report the requested version. After installation, the binary at its final
268
+ path must report that version in a new process. The installer keeps a backup in
269
+ the same directory until the second check passes. On failure, it restores the
270
+ previous binary or removes a bad first install.
240
271
 
241
272
  ## Claude Code and Codex integration
242
273
 
@@ -255,14 +286,15 @@ through Claude Code or Codex plugin stores.
255
286
 
256
287
  ## Skills and agents
257
288
 
258
- The pack ships 42 skills: 30 public and 12 internal. The public surface contains
259
- the `rite` menu and 29 `rite-*` workflows and utilities. Eleven `devrites-*`
289
+ The pack ships 44 skills: 32 public and 12 internal. The public surface contains
290
+ the `rite` menu and 31 `rite-*` workflows and utilities. Eleven `devrites-*`
260
291
  specialists load when a matching task needs them; `devrites-lib` carries the
261
292
  shared contracts and engineering standards.
262
293
 
263
- Fourteen agents ship with the pack. Thirteen are read-only reviewers or
264
- analysts, including `devrites-retrospector`, which reads the shipped archive.
265
- `devrites-slice-wright` is the only agent allowed to edit a feature slice.
294
+ Eighteen fresh-context agents ship with the pack. Seventeen are read-only,
295
+ including the evidence scout, plan drafter, proof runner, reviewers, judges,
296
+ upgrade planner, and retrospector. `devrites-slice-wright` is the only
297
+ source/test writer.
266
298
 
267
299
  The authoritative [skills catalogue](docs/skills.md) lists every skill and
268
300
  agent. The [flow diagrams](docs/flow.md) show routing, reviewer fan-out, and
@@ -293,13 +325,13 @@ traces. DevRites detects these tools but does not install them.
293
325
  ## Security model
294
326
 
295
327
  Installed host artifacts stay in the project. The npm shim prefers an explicitly
296
- configured engine or a local `engine/devrites-engine`, can download a
297
- checksummed release binary, can build a temporary engine from the local Go
298
- source, and finally falls back to an existing `devrites-engine` on `PATH`. Use `--no-binary` or
299
- `DEVRITES_NO_BINARY=1` if you do not want the installer to keep the shared
300
- binary outside the project. `devrites-engine update` also prefers the
301
- checksummed platform release binary and only builds from source as a fallback,
302
- without reading Git metadata from the target project.
328
+ configured engine or a local `engine/devrites-engine`. If neither is available,
329
+ it can download a checksummed release binary or build a temporary engine from
330
+ the local Go source before falling back to `devrites-engine` on `PATH`. Use
331
+ `--no-binary` or `DEVRITES_NO_BINARY=1` to avoid keeping a shared binary outside
332
+ the project. `devrites-engine update` also prefers the checksummed platform
333
+ release and builds from source only as a fallback. It does not read Git metadata
334
+ from the target project.
303
335
 
304
336
  Workflow state is read through the engine rather than shell injection. The
305
337
  installer never writes `defaultMode: bypassPermissions`. Skills use networked
package/SECURITY.md CHANGED
@@ -61,19 +61,19 @@ reviewable; never suppress a hidden-unicode finding you can't explain.
61
61
  ### State loading (engine subcommands, no `!` injection)
62
62
 
63
63
  `/rite-status` and workspace-operating skills load state by running a **read-only
64
- `devrites-engine` subcommand through the `Bash` tool**. It does not use Claude Code's
65
- preprocessing-only `` !`<command>` `` dynamic-context injection, which DevRites
66
- **removed** for cross-harness portability. The no-argument `/rite` menu runs
64
+ `devrites-engine` subcommand through the `Bash` tool**. DevRites does not use
65
+ Claude Code's preprocessing-only `` !`<command>` `` dynamic-context injection
66
+ because that mechanism is not portable across harnesses. The no-argument `/rite` menu runs
67
67
  `devrites-engine first-task` instead; a routed verb hands control to its owning skill.
68
68
 
69
69
  ```bash
70
70
  command -v devrites-engine >/dev/null 2>&1 && devrites-engine preamble || echo "(unavailable: read state.md directly)"
71
71
  ```
72
72
 
73
- `devrites-engine preamble` is a project-local read of DevRites' own `.devrites/`
74
- state: no user input is concatenated into a command, no network access, no write
75
- side effects. The gate subcommands (`build-readiness`, `evidence-fresh`,
76
- `check-acceptance`) are likewise read-only. Mutating commands are explicit and
73
+ `devrites-engine preamble` reads the project's `.devrites/` state. It does not
74
+ concatenate user input into a command, access the network, or write files. The
75
+ gate subcommands (`build-readiness`, `evidence-fresh`, `check-acceptance`) are
76
+ also read-only. Mutating commands are explicit and
77
77
  scoped: for example, `resolve`, `tick-afk`, and `close-out` write only DevRites
78
78
  state, while `/rite use <slug>` deliberately repoints `.devrites/ACTIVE` inline.
79
79
 
@@ -81,7 +81,7 @@ If your environment disallows shell commands started by skills, each skill reads
81
81
  `state.md` directly through the `|| echo "(… unavailable …)"` fallback above.
82
82
  The rest of the pack continues to work.
83
83
 
84
- ### Model invocation is per skill
84
+ ### User and model invocation are separate
85
85
 
86
86
  Public skills are always user-invocable, but model invocation is set per skill.
87
87
  Skills without `disable-model-invocation: true` may be selected when their
@@ -115,22 +115,21 @@ uninstall.
115
115
 
116
116
  Skills, agents, standards, and hook configuration stay in the target project.
117
117
  The installer merges DevRites entries into project-local `.claude/settings.json`
118
- and `.codex/hooks.json` without replacing unrelated user settings. Its only
119
- sanctioned global artifact is the shared `devrites-engine` executable, installed
120
- to `DEVRITES_BIN_DIR`, a writable `~/.local/bin`, or a writable
118
+ and `.codex/hooks.json` without replacing unrelated user settings. The shared
119
+ `devrites-engine` executable is the only allowed artifact outside the project.
120
+ It is installed to `DEVRITES_BIN_DIR`, a writable `~/.local/bin`, or a writable
121
121
  `/usr/local/bin`; `--no-binary` / `DEVRITES_NO_BINARY=1` skips it. The bootstrap
122
122
  path may fetch the release bundle and checksummed engine assets. It never invokes
123
123
  `sudo` or edits shell startup files.
124
124
 
125
125
  ### npx install path
126
126
 
127
- When installed via `npx devrites@latest`, the CLI (`bin/devrites.mjs`) is a thin
128
- Node shim that delegates directly to `devrites-engine`; it does not execute
129
- `install.sh`. The host payload is bundled and pinned to the requested npm package
130
- version. To start the engine, the shim tries the matching release binary plus its
131
- SHA-256 sidecar, then a local Go build, then an existing engine. It has no runtime
132
- npm dependencies. Project-artifact and optional shared-binary boundaries are the
133
- same as the Bash path.
127
+ With `npx devrites@latest`, the CLI (`bin/devrites.mjs`) calls
128
+ `devrites-engine` directly instead of running `install.sh`. The bundled host
129
+ payload is pinned to the requested npm package version. The shim first tries the
130
+ matching release binary and its SHA-256 sidecar, then a local Go build, and then
131
+ an existing engine. It has no runtime npm dependencies. The same project and
132
+ shared-binary boundaries apply to the Bash installer.
134
133
 
135
134
  ### Recommended Claude Code permissions for managed deployments
136
135
 
@@ -148,17 +147,16 @@ For organizations evaluating DevRites under a managed Claude Code policy:
148
147
  }
149
148
  ```
150
149
 
151
- This follows the current
152
- [Claude Code permissions schema](https://code.claude.com/docs/en/permissions)
153
- and surfaces a host confirmation before the git mutation ladder. DevRites'
150
+ Under the current
151
+ [Claude Code permissions schema](https://code.claude.com/docs/en/permissions),
152
+ the host asks for confirmation before the git mutation ladder. DevRites'
154
153
  separate type-`GO` workflow gate still applies.
155
154
 
156
155
  ### Hooks (approval, orientation, and local guards)
157
156
 
158
- DevRites ships JSON-configured hooks installed by the engine-owned flow into the
159
- project-local host artifacts (`.claude/settings.json` for Claude Code and
160
- `.codex/hooks.json` for Codex). They call `devrites-engine` behind an inline
161
- fail-open guard:
157
+ The engine installs JSON-configured hooks in the project-local host artifacts:
158
+ `.claude/settings.json` for Claude Code and `.codex/hooks.json` for Codex. Both
159
+ files call `devrites-engine` behind an inline fail-open guard:
162
160
 
163
161
  - **`allow` (PreToolUse/Bash)**: auto-approves *only* the read-only engine
164
162
  orientation/gate subcommands (`check-acceptance`, `doubt-coverage`,
@@ -193,13 +191,13 @@ bundling them.
193
191
 
194
192
  ### Agentic trust boundaries
195
193
 
196
- Treat every instruction-bearing file as supply chain:
194
+ Treat every instruction-bearing file as a supply-chain input:
197
195
 
198
196
  1. **Shipped pack**: `pack/.claude/**`, generated host artifacts, hooks, and the
199
197
  engine are release-managed and scanned before publish.
200
- 2. **Project-local state**: `.devrites/work/**`, learnings, principles, and
201
- review artifacts are evidence, not authority. Live source and engine gates win
202
- over stale state.
198
+ 2. **Project-local state**: `.devrites/work/**`, learnings, unvalidated
199
+ principles, and review artifacts are evidence, not authority. Live source and
200
+ engine gates win over stale state.
203
201
  3. **User extensions/overrides**: `.devrites/extensions/**` and
204
202
  `.devrites/overrides/**` are untrusted until `devrites-engine extensions
205
203
  validate` / `overrides validate` pass. Extensions may add checks or reviewers;
@@ -210,6 +208,10 @@ Treat every instruction-bearing file as supply chain:
210
208
  missing tools degrade to file-system/engine gates instead of silently changing
211
209
  workflow semantics.
212
210
 
211
+ <!-- authority:principles-trust:start -->
212
+ Project principles may become project policy only after explicit provenance and validation; arbitrary project-local Markdown is never inherently trusted executable instruction.
213
+ <!-- authority:principles-trust:end -->
214
+
213
215
  Never copy untrusted issue text, web content, or model output into a skill,
214
216
  agent, hook, MCP config, or generated artifact without reviewing it as executable
215
217
  instructions. Hidden unicode, prompt-injection phrasing, personal absolute paths,
@@ -30,7 +30,7 @@ framework.
30
30
  | Option | Why not |
31
31
  |--------|---------|
32
32
  | Bookkeeping inside the agent prompt | Non-deterministic, context-hungry, unauditable — the exact failure this system exists to remove. |
33
- | Node/TS engine (like the reference system GSD Core) | Drags a package tree + supply-chain surface; the pure-Go single binary has none and cross-compiles to every target from one runner. |
33
+ | Node/TS engine | Drags a package tree + supply-chain surface; the pure-Go single binary has none and cross-compiles to every target from one runner. |
34
34
  | Cobra / urfave CLI framework | A dependency and a config surface for a switch statement the stdlib already handles. |
35
35
 
36
36
  ## Consequences
@@ -22,7 +22,7 @@ enumerated in code, not open-ended. `harness-matrix --check` keeps
22
22
 
23
23
  | Option | Why not |
24
24
  |--------|---------|
25
- | A generic declarative capability/adapter registry now (the GSD Core model) | Real ceiling-raiser for N hosts, but a large refactor unjustified at N=2. Recorded as a Proposed follow-up, not built. See the adoption study in `docs/research/gsd-core-adoption.md` §3.1. |
25
+ | A generic declarative capability/adapter registry now | Real ceiling-raiser for N hosts, but a large refactor unjustified at N=2. Recorded as a Proposed follow-up, not built. |
26
26
  | Claude-only | Codex users are already real; single-host would strand them. |
27
27
  | Per-host forks of the logic | Duplicates the lifecycle core across edges — the thing the adapter exists to prevent. |
28
28
 
@@ -40,8 +40,7 @@ additively.
40
40
  - Completeness is a table lookup, not a judgment call — cheap and reproducible.
41
41
  - Small files stay context-cheap and make "what's missing" self-evident.
42
42
  - `SchemaVersion = 1` is young; migration is single-version. Hardening the
43
- writer into one pure transition function is a recorded follow-up
44
- (`docs/research/gsd-core-adoption.md` §3.2).
43
+ writer into one pure transition function is a recorded follow-up.
45
44
  - The typed registry in `engine/internal/state/schema.go` is the lifecycle
46
45
  authority. Its invariant tests lock order, aliases, commands, requirements,
47
46
  and cross-format manifest freshness.
@@ -5,16 +5,15 @@
5
5
 
6
6
  ## Context
7
7
 
8
- Two gaps surfaced while studying a more mature peer system (GSD Core; see
9
- `docs/research/gsd-core-adoption.md`):
8
+ Two gaps surfaced during a control-plane reliability audit:
10
9
 
11
10
  1. **Unwired static analysis.** `engine/Makefile` defined `staticcheck` and
12
11
  `govulncheck` targets, but CI ran only `gofmt` + `go vet`. No `-race`, no
13
12
  custom analysis on the trust-root binary.
14
13
  2. **A wall-clock leak.** `resolve next-qid` derived today's date from a raw
15
14
  `time.Now()` with no seam, so its golden snapshot was pinned to the date it
16
- was recorded and failed **every other day** — a latent red the peer system's
17
- clock-seam lint would have caught at author time.
15
+ was recorded and failed **every other day** — a clock-seam check would have
16
+ caught the latent failure at author time.
18
17
 
19
18
  ## Decision
20
19
 
@@ -0,0 +1,67 @@
1
+ # ADR-0009: Pre-build decision coverage and implementation readiness
2
+
3
+ - **Status:** Accepted
4
+ - **Date:** 2026-07-23
5
+
6
+ > This ADR amends the lifecycle order in
7
+ > [ADR-0004](0004-state-schema-phases-sections.md) without changing its
8
+ > phase-relative completeness model.
9
+
10
+ ## Context
11
+
12
+ Real feature runs reached `/rite-build` with product/constraint gaps and incomplete
13
+ tooling/proof prerequisites. The build then repeatedly asked for `rite-resolve` or
14
+ `rite-plan repair`, including approval for bounded technical recovery that an agent should
15
+ own. Earlier phases had good local checklists, but no mandatory whole-feature decision
16
+ coverage artifact, and the engine's build-readiness gate checked only `state.md`.
17
+
18
+ DevRites already had a reusable clarification protocol in `devrites-interview`; the missing
19
+ piece was lifecycle ownership and an executable gate, not another interview implementation.
20
+
21
+ The design review retained multi-dimensional readiness checks, fact-first
22
+ clarification, behavior scenarios, cross-artifact consistency, goal-backward
23
+ plan checking, and an explicit implementation-readiness assessment.
24
+
25
+ We deliberately reject asking the human to approve every technical finding and unbounded
26
+ interview ceremony. Those patterns reproduce the interruption fatigue this change fixes.
27
+
28
+ ## Decision
29
+
30
+ 1. Add one public phase between spec and temper:
31
+ `frame → spec → clarify → temper → define → plan → vet → build → converge → prove → polish → review → seal → ship → done`.
32
+ 2. `/rite-clarify` is mandatory but adaptive. It enumerates the feature topology, searches
33
+ facts before asking, reuses `devrites-interview`, and takes a zero-question fast path when
34
+ the written contract is already complete.
35
+ 3. Clarification writes `decision-coverage.md`. Buildable work must contain
36
+ `Decision coverage: CLEAR`; Partial, Missing, unowned, or blocking rows cannot pass.
37
+ 4. Keep `/rite-vet` as the single final pre-build gate rather than adding a duplicate
38
+ readiness phase. It performs goal-backward implementation-readiness checks and writes
39
+ exactly one typed verdict:
40
+ `READY`, `NEEDS CLARIFICATION`, or `NEEDS REPLAN`.
41
+ 5. The engine requires both `Decision coverage: CLEAR` and
42
+ `Implementation readiness: READY` (plus `test-plan.md`) at build entry. Missing
43
+ clarification routes to `/rite-clarify`; missing vet readiness routes to `/rite-vet`.
44
+ Neither route manufactures a human question.
45
+ 6. Later-phase workspaces may retrofit decision coverage without cursor regression when the
46
+ contract is unchanged. A changed requirement or acceptance criterion still uses the Spec
47
+ Drift Guard and replanning.
48
+
49
+ ## Alternatives considered
50
+
51
+ | Option | Why not |
52
+ |---|---|
53
+ | Strengthen spec/define/vet prose only | Still leaves no auditable proof that the whole feature topology was scanned and no deterministic build-entry gate. |
54
+ | Add a new final `/rite-ready` phase | Duplicates `/rite-vet`, adds ceremony, and splits one readiness source of truth across two phases. |
55
+ | Make clarification optional for small work | Optional gates are exactly how omissions survive; an adaptive zero-question pass has negligible cost while retaining the invariant. |
56
+ | Ask every unresolved item during build | Defers cheap decisions to the most expensive point and turns routine technical recovery into human authorization. |
57
+
58
+ ## Consequences
59
+
60
+ - Planning cannot begin without explicit decision coverage, and build cannot begin without
61
+ both clarification and engineering-readiness verdicts.
62
+ - Small/well-specified work gains one cheap deterministic pass, not an interview tax.
63
+ - Existing active workspaces missing the new artifacts receive actionable `/rite-clarify`
64
+ and `/rite-vet` routes rather than false `/rite-resolve` prompts.
65
+ - `engine/internal/state/schema.go` remains the typed lifecycle/workspace authority. This
66
+ topology is schema v2; migration upgrades declarations without fabricating readiness
67
+ evidence, and generated manifests/host artifacts change with the authority.
@@ -0,0 +1,71 @@
1
+ # ADR-0010: Agent-first fresh-context orchestration
2
+
3
+ - **Status:** Accepted
4
+ - **Date:** 2026-07-23
5
+
6
+ ## Context
7
+
8
+ Lifecycle skills were still doing large searches, planning, proof, and repair work in the
9
+ orchestrator's chat context. That increased context pressure and made delegation
10
+ host-dependent: Codex could treat an unavailable custom role as if no spawn primitive
11
+ existed, while one skill described an unnamed nested writer. Reviewer hooks also guarded
12
+ only selected Bash commands, and the slice writer claimed its own file scope.
13
+
14
+ The design review for
15
+ [ADR-0009](0009-prebuild-decision-coverage-and-readiness.md) also retained
16
+ file-backed fresh task packets, separated planner/checker/executor responsibilities,
17
+ bounded research fan-out, explicit concurrency limits, typed reconciliation, and
18
+ restartable artifact boundaries. We reject persistent swarms and parallel shared-tree
19
+ writers.
20
+
21
+ ## Decision
22
+
23
+ 1. Public `rite-*` skills remain the root orchestrators. They alone own human interaction,
24
+ product/risk decisions, canonical `.devrites/` writes, phase routing, reconciliation,
25
+ gates, and irreversible actions.
26
+ 2. Heavy bounded work uses ephemeral fresh-context leaf agents at depth one. Normally no
27
+ more than three read-only leaves run concurrently; file overlap, dependencies, or
28
+ process/file-descriptor pressure reduce the wave to serial execution.
29
+ 3. Add three read-only roles:
30
+ `devrites-evidence-scout`, `devrites-plan-drafter`, and
31
+ `devrites-proof-runner`. Existing independent reviewers remain critics, not authors.
32
+ 4. `devrites-slice-wright` remains the only source/test writer. Writers never share a
33
+ working tree; accepted proof, polish, or review corrections become one bounded wright
34
+ contract.
35
+ 5. Dispatch uses file-backed `agent-packet/v1` and `agent-result/v1` envelopes with a run
36
+ ID, authoritative artifact paths, exact scope, budgets, immutable base/diff/touched-file
37
+ hashes, side effects, and typed terminal status. The orchestrator rejects malformed,
38
+ stale, or out-of-scope returns before persistence.
39
+ 6. Host fallback is ordered: named project role; generic fresh `explorer`/`worker`
40
+ reading the same role contract only when the host preserves its enforced read/write
41
+ boundary (or isolates the writer); inline discipline when no safe fresh-context rung
42
+ exists. Inline output is labelled non-independent and cannot silently satisfy an
43
+ independence gate.
44
+ 7. Agent security is fail-closed for declared leaf runs. Every role except the exact wright
45
+ is read-only; the wright consumes an orchestrator-created exact path allowlist. Nested
46
+ dispatch, self-claimed scope, installs, git publication, live migrations, and
47
+ `.devrites/` writes are forbidden to leaves.
48
+ 8. Objective failures use bounded technical recovery without asking the human to authorize
49
+ another attempt. Only product/scope/policy choices, irreversible risk, and human-only
50
+ access/actions create a human gate.
51
+
52
+ ## Alternatives considered
53
+
54
+ | Option | Why not |
55
+ |---|---|
56
+ | Keep heavy work in the main chat | Reintroduces context accumulation and makes fresh independent judgment optional. |
57
+ | One agent per lifecycle phase with write access | Duplicates orchestration authority and creates competing canonical writers. |
58
+ | Persistent team/swarm with nested workers | Adds mailbox/watchdog state, amplifies resource pressure, and violates depth-one ownership. |
59
+ | Parallel source writers on one tree | Makes authorship, implicit decisions, rollback, and reconciliation ambiguous. |
60
+ | Inline fallback whenever a custom role is unavailable | Confuses “role unavailable” with “spawn unavailable” and falsely labels self-review independent. |
61
+
62
+ ## Consequences
63
+
64
+ - Main-chat context holds routing and decisions, while agents reread canonical artifacts
65
+ from scratch and return compact typed results.
66
+ - Delegation has deterministic authority, fallback, retry, and stale-result behavior on
67
+ both Claude and Codex.
68
+ - Read-only fan-out can improve throughput, but resource limits are an upper bound rather
69
+ than a target.
70
+ - Agent profiles, host generation, hooks, packet schemas, and composition tests must evolve
71
+ together; generated host artifacts remain derived from `pack/.claude`.
@@ -0,0 +1,28 @@
1
+ # ADR-0011: Separate Define authoring from the Plan checkpoint
2
+
3
+ - **Status:** Accepted
4
+ - **Date:** 2026-07-23
5
+
6
+ ## Context
7
+
8
+ The typed lifecycle gave both `define` and `plan` the same requirements and
9
+ `/rite-define` resume command. Current skills already use `/rite-define` for
10
+ first-pass plan authoring and `/rite-plan` only to repair or reslice an existing
11
+ plan, so the duplicate state behavior made resume routing ambiguous.
12
+
13
+ ## Decision
14
+
15
+ - `define` is in-progress plan authoring and resumes `/rite-define`.
16
+ - `plan` is the approved or repaired plan checkpoint and resumes `/rite-vet`.
17
+ - `/rite-plan` remains an explicit repair/reslice operation; it is not the
18
+ checkpoint's normal resume command.
19
+ - Keep the `plan` phase ID and all phase aliases. Existing schema-v2 and legacy
20
+ workspaces therefore remain readable without migration.
21
+ - The typed phase registry owns a unique transition-right sentence for every
22
+ state; the generated manifest and current lifecycle docs derive from it.
23
+
24
+ ## Consequences
25
+
26
+ An interrupted approved plan continues into engineering review instead of
27
+ re-entering plan authoring. Repair still uses `/rite-plan`, and no compatible
28
+ workspace is rewritten merely because resume routing became unambiguous.