devrites 3.0.7 → 3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (472) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +67 -47
  3. package/SECURITY.md +31 -29
  4. package/docs/adr/0001-go-engine-as-control-plane.md +1 -1
  5. package/docs/adr/0002-dual-host-harness.md +1 -1
  6. package/docs/adr/0004-state-schema-phases-sections.md +1 -2
  7. package/docs/adr/0006-clock-seam-and-engine-ci-gates.md +3 -4
  8. package/docs/adr/0009-prebuild-decision-coverage-and-readiness.md +67 -0
  9. package/docs/adr/0010-agent-first-fresh-context-orchestration.md +71 -0
  10. package/docs/adr/0011-define-plan-transition-rights.md +28 -0
  11. package/docs/adr/README.md +3 -0
  12. package/docs/agents/triage-labels.md +7 -7
  13. package/docs/architecture.md +157 -140
  14. package/docs/cli.md +41 -12
  15. package/docs/command-map.md +49 -35
  16. package/docs/engine/agent-contract.md +92 -15
  17. package/docs/engine/commands.md +242 -72
  18. package/docs/engine/state-schema.md +52 -23
  19. package/docs/engine/workspace-schema.md +94 -15
  20. package/docs/extensions.md +1 -1
  21. package/docs/flow.md +80 -50
  22. package/docs/harness-compliance.md +29 -5
  23. package/docs/orchestration.md +107 -79
  24. package/docs/quick-reference.md +7 -3
  25. package/docs/release.md +4 -3
  26. package/docs/skills.md +64 -38
  27. package/docs/usage.md +57 -38
  28. package/engine/cmd/releasepack/main.go +219 -0
  29. package/engine/cmd/releasepack/main_test.go +170 -0
  30. package/engine/commands.go +170 -23
  31. package/engine/git_guard.go +187 -0
  32. package/engine/git_guard_test.go +283 -0
  33. package/engine/hookpolicy.go +53 -55
  34. package/engine/hookpolicy_test.go +91 -1
  35. package/engine/hooks.go +296 -75
  36. package/engine/hooks_events_test.go +276 -6
  37. package/engine/hooks_workspace.go +640 -159
  38. package/engine/internal/devritespaths/paths.go +65 -10
  39. package/engine/internal/devritespaths/paths_test.go +110 -0
  40. package/engine/internal/doctor/doctor.go +153 -23
  41. package/engine/internal/doctor/doctor_test.go +74 -0
  42. package/engine/internal/forge/forge.go +940 -0
  43. package/engine/internal/forge/forge_test.go +576 -0
  44. package/engine/internal/forge/git.go +245 -0
  45. package/engine/internal/forge/liveness_unix.go +48 -0
  46. package/engine/internal/forge/liveness_windows.go +67 -0
  47. package/engine/internal/forge/manifest.go +402 -0
  48. package/engine/internal/gate/gate.go +90 -71
  49. package/engine/internal/gate/gate_test.go +71 -2
  50. package/engine/internal/harness/compliance.go +18 -24
  51. package/engine/internal/harness/harness.go +37 -44
  52. package/engine/internal/harness/harness_test.go +21 -5
  53. package/engine/internal/install/install.go +486 -38
  54. package/engine/internal/install/install_test.go +383 -10
  55. package/engine/internal/iohooks/iohooks.go +350 -59
  56. package/engine/internal/iohooks/iohooks_test.go +421 -1
  57. package/engine/internal/lib/buildreadiness.go +35 -18
  58. package/engine/internal/lib/clarifyreturn.go +91 -0
  59. package/engine/internal/lib/clarifyreturn_test.go +123 -0
  60. package/engine/internal/lib/context.go +54 -15
  61. package/engine/internal/lib/cursor_compat_test.go +8 -0
  62. package/engine/internal/lib/extensions.go +2 -3
  63. package/engine/internal/lib/gitauthority.go +601 -0
  64. package/engine/internal/lib/gitauthority_test.go +346 -0
  65. package/engine/internal/lib/jsonout.go +25 -11
  66. package/engine/internal/lib/jsonout_test.go +16 -0
  67. package/engine/internal/lib/lanes.go +14 -8
  68. package/engine/internal/lib/observability_test.go +358 -0
  69. package/engine/internal/lib/packageexistence.go +151 -35
  70. package/engine/internal/lib/packageexistence_test.go +163 -0
  71. package/engine/internal/lib/progress.go +11 -9
  72. package/engine/internal/lib/provenance.go +462 -0
  73. package/engine/internal/lib/provenance_test.go +154 -0
  74. package/engine/internal/lib/readiness_contract.json +111 -0
  75. package/engine/internal/lib/readinessartifact.go +510 -0
  76. package/engine/internal/lib/readinessartifact_test.go +321 -0
  77. package/engine/internal/lib/reconcile.go +712 -88
  78. package/engine/internal/lib/reconcile_test.go +335 -16
  79. package/engine/internal/lib/recoveryattempts.go +298 -0
  80. package/engine/internal/lib/recoveryattempts_test.go +215 -0
  81. package/engine/internal/lib/resolve.go +23 -19
  82. package/engine/internal/lib/runbook_context_test.go +20 -0
  83. package/engine/internal/lib/session.go +701 -9
  84. package/engine/internal/lib/session_test.go +80 -13
  85. package/engine/internal/lib/testintegrity.go +33 -37
  86. package/engine/internal/lib/testintegrity_test.go +63 -1
  87. package/engine/internal/migrate/migrate.go +81 -1
  88. package/engine/internal/migrate/migrate_test.go +22 -1
  89. package/engine/internal/reason/reason.go +180 -0
  90. package/engine/internal/reason/reason_test.go +35 -0
  91. package/engine/internal/rootfacts/facts.go +466 -0
  92. package/engine/internal/rootfacts/facts_test.go +306 -0
  93. package/engine/internal/safepath/safepath.go +55 -0
  94. package/engine/internal/safepath/safepath_test.go +69 -0
  95. package/engine/internal/safepath/safepath_windows_test.go +26 -0
  96. package/engine/internal/state/clarify_transition.go +165 -0
  97. package/engine/internal/state/clarify_transition_test.go +130 -0
  98. package/engine/internal/state/cmd/workflowmanifest/main.go +12 -8
  99. package/engine/internal/state/cursor.go +58 -0
  100. package/engine/internal/state/cursor_test.go +42 -1
  101. package/engine/internal/state/feature.go +35 -48
  102. package/engine/internal/state/schema.go +90 -37
  103. package/engine/internal/state/snapshot.go +18 -2
  104. package/engine/internal/state/state_test.go +187 -7
  105. package/engine/internal/state/status.go +48 -11
  106. package/engine/internal/state/workflow_manifest.json +231 -50
  107. package/engine/internal/toolpolicy/classifier.go +533 -0
  108. package/engine/internal/toolpolicy/classifier_test.go +424 -0
  109. package/engine/internal/toolpolicy/git.go +616 -0
  110. package/engine/internal/toolpolicy/scanner.go +382 -0
  111. package/engine/main.go +160 -77
  112. package/engine/observability_cli_test.go +52 -0
  113. package/engine/root_routing_test.go +277 -0
  114. package/engine/testdata/golden/TestParityBuildReadiness/arg=approved.golden +1 -1
  115. package/engine/testdata/golden/TestParityBuildReadiness/arg=emptystatus.golden +1 -1
  116. package/engine/testdata/golden/TestParityBuildReadiness/arg=noclarify.golden +1 -0
  117. package/engine/testdata/golden/TestParityBuildReadiness/arg=novet.golden +1 -0
  118. package/engine/testdata/golden/TestParityBuildReadiness/arg=stalevet.golden +1 -0
  119. package/engine/testdata/golden/TestParityBuildReadiness/arg=trailhash.golden +1 -1
  120. package/engine/testdata/golden/TestParityBuildReadiness/arg=trailpipe.golden +1 -1
  121. package/engine/testdata/golden/TestParityBuildReadiness/arg=vetnotready.golden +1 -0
  122. package/engine/testdata/golden/TestParityProgress/arg=allbuilt.golden +1 -1
  123. package/engine/testdata/golden/TestParityProgress/arg=done.golden +1 -1
  124. package/engine/testdata/golden/TestParityProgress/arg=mid.golden +1 -1
  125. package/engine/testdata/golden/TestParityProgress/arg=nophase.golden +1 -1
  126. package/engine/testdata/golden/TestParityProgress/arg=noslice.golden +1 -1
  127. package/engine/testdata/golden/TestParityProgress/arg=plan.golden +1 -1
  128. package/engine/testdata/golden/TestParityProgress/arg=seal.golden +1 -1
  129. package/engine/testdata/golden/TestParityReconcile/check-clean.golden +1 -1
  130. package/engine/testdata/golden/TestParityReconcile/inline-fallback.golden +1 -0
  131. package/engine/testdata/golden/TestParityReconcile/snapshot-no-allowlist.golden +1 -0
  132. package/engine/testdata/golden/TestParityWrightScope/devrites-edit-denied.golden +2 -0
  133. package/engine/testdata/golden/TestParityWrightScope/out-of-scope-enforce-denies.golden +1 -1
  134. package/engine/tests/adr_0011_define_plan_test.go +30 -0
  135. package/engine/tests/budget_test.go +19 -8
  136. package/engine/tests/concurrency_cli_test.go +7 -1
  137. package/engine/tests/doctor_cli_test.go +148 -2
  138. package/engine/tests/forge_cli_test.go +463 -0
  139. package/engine/tests/gate_test.go +63 -8
  140. package/engine/tests/hook_test.go +260 -8
  141. package/engine/tests/hooks_io_test.go +94 -3
  142. package/engine/tests/json_contract_test.go +127 -2
  143. package/engine/tests/migrate_cli_test.go +2 -2
  144. package/engine/tests/parity_buildreadiness_test.go +141 -10
  145. package/engine/tests/parity_learnings_test.go +16 -17
  146. package/engine/tests/parity_reconcile_test.go +20 -17
  147. package/engine/tests/parity_resolve_test.go +12 -11
  148. package/engine/tests/parity_test.go +21 -17
  149. package/pack/.claude/agents/devrites-code-reviewer.md +62 -48
  150. package/pack/.claude/agents/devrites-devex-reviewer.md +69 -53
  151. package/pack/.claude/agents/devrites-doubt-reviewer.md +29 -22
  152. package/pack/.claude/agents/devrites-evidence-scout.md +69 -0
  153. package/pack/.claude/agents/devrites-forge-judge.md +74 -61
  154. package/pack/.claude/agents/devrites-frontend-reviewer.md +48 -39
  155. package/pack/.claude/agents/devrites-performance-reviewer.md +49 -40
  156. package/pack/.claude/agents/devrites-plan-drafter.md +71 -0
  157. package/pack/.claude/agents/devrites-plan-reviewer.md +80 -47
  158. package/pack/.claude/agents/devrites-proof-runner.md +74 -0
  159. package/pack/.claude/agents/devrites-retrospector.md +48 -45
  160. package/pack/.claude/agents/devrites-security-auditor.md +46 -36
  161. package/pack/.claude/agents/devrites-simplifier-reviewer.md +50 -46
  162. package/pack/.claude/agents/devrites-slice-wright.md +153 -165
  163. package/pack/.claude/agents/devrites-spec-reviewer.md +34 -32
  164. package/pack/.claude/agents/devrites-strategy-reviewer.md +63 -34
  165. package/pack/.claude/agents/devrites-test-analyst.md +40 -30
  166. package/pack/.claude/settings.json +2 -1
  167. package/pack/.claude/skills/devrites-audit/SKILL.md +40 -61
  168. package/pack/.claude/skills/devrites-debug-recovery/SKILL.md +24 -13
  169. package/pack/.claude/skills/devrites-debug-recovery/reference/build-the-loop.md +24 -21
  170. package/pack/.claude/skills/devrites-debug-recovery/reference/cleanup-and-classify.md +34 -6
  171. package/pack/.claude/skills/devrites-debug-recovery/reference/instrumentation.md +2 -2
  172. package/pack/.claude/skills/devrites-doubt/SKILL.md +25 -17
  173. package/pack/.claude/skills/devrites-interview/SKILL.md +53 -52
  174. package/pack/.claude/skills/devrites-lib/SKILL.md +11 -9
  175. package/pack/.claude/skills/devrites-lib/reference/intent-map.md +3 -2
  176. package/pack/.claude/skills/devrites-lib/reference/parallel-dispatch.md +82 -137
  177. package/pack/.claude/skills/devrites-lib/reference/reply-contract.md +8 -1
  178. package/pack/.claude/skills/devrites-lib/reference/standards/README.md +38 -55
  179. package/pack/.claude/skills/devrites-lib/reference/standards/afk-hitl.md +53 -27
  180. package/pack/.claude/skills/devrites-lib/reference/standards/agents.md +198 -190
  181. package/pack/.claude/skills/devrites-lib/reference/standards/anti-patterns.md +5 -15
  182. package/pack/.claude/skills/devrites-lib/reference/standards/ci-cd.md +27 -58
  183. package/pack/.claude/skills/devrites-lib/reference/standards/code-review.md +16 -52
  184. package/pack/.claude/skills/devrites-lib/reference/standards/coding-style.md +2 -10
  185. package/pack/.claude/skills/devrites-lib/reference/standards/context-hygiene.md +18 -61
  186. package/pack/.claude/skills/devrites-lib/reference/standards/core.md +23 -18
  187. package/pack/.claude/skills/devrites-lib/reference/standards/deprecation.md +17 -57
  188. package/pack/.claude/skills/devrites-lib/reference/standards/development-workflow.md +4 -33
  189. package/pack/.claude/skills/devrites-lib/reference/standards/git-workflow.md +4 -20
  190. package/pack/.claude/skills/devrites-lib/reference/standards/hooks.md +3 -14
  191. package/pack/.claude/skills/devrites-lib/reference/standards/patterns.md +9 -25
  192. package/pack/.claude/skills/devrites-lib/reference/standards/performance.md +0 -9
  193. package/pack/.claude/skills/devrites-lib/reference/standards/principles.md +1 -3
  194. package/pack/.claude/skills/devrites-lib/reference/standards/security.md +17 -7
  195. package/pack/.claude/skills/devrites-lib/reference/standards/testing.md +1 -27
  196. package/pack/.claude/skills/devrites-lib/reference/standards/tooling.md +46 -50
  197. package/pack/.claude/skills/devrites-lib/reference/workspace-artifact-schema.md +23 -10
  198. package/pack/.claude/skills/devrites-source-driven/SKILL.md +23 -22
  199. package/pack/.claude/skills/rite/SKILL.md +8 -6
  200. package/pack/.claude/skills/rite/reference/menu.md +8 -6
  201. package/pack/.claude/skills/rite-adopt/SKILL.md +33 -37
  202. package/pack/.claude/skills/rite-autocomplete/SKILL.md +33 -28
  203. package/pack/.claude/skills/rite-autocomplete/reference/loop.md +21 -21
  204. package/pack/.claude/skills/rite-autocomplete/reference/stop-conditions.md +15 -6
  205. package/pack/.claude/skills/rite-build/SKILL.md +35 -30
  206. package/pack/.claude/skills/rite-build/reference/afk-discipline.md +38 -38
  207. package/pack/.claude/skills/rite-build/reference/evidence-standard.md +10 -0
  208. package/pack/.claude/skills/rite-build/reference/forge.md +186 -156
  209. package/pack/.claude/skills/rite-build/reference/one-slice-cycle.md +4 -3
  210. package/pack/.claude/skills/rite-build/reference/phase-contract.md +96 -175
  211. package/pack/.claude/skills/rite-build/reference/wright-dispatch.md +129 -134
  212. package/pack/.claude/skills/rite-clarify/SKILL.md +89 -0
  213. package/pack/.claude/skills/rite-clarify/reference/decision-coverage.md +59 -0
  214. package/pack/.claude/skills/rite-converge/SKILL.md +35 -25
  215. package/pack/.claude/skills/rite-define/SKILL.md +57 -32
  216. package/pack/.claude/skills/rite-define/reference/gates.md +16 -15
  217. package/pack/.claude/skills/rite-define/reference/plan-template.md +16 -8
  218. package/pack/.claude/skills/rite-frame/reference/failure-modes.md +22 -24
  219. package/pack/.claude/skills/rite-plan/SKILL.md +44 -16
  220. package/pack/.claude/skills/rite-plan/reference/task-breakdown.md +4 -0
  221. package/pack/.claude/skills/rite-polish/SKILL.md +27 -23
  222. package/pack/.claude/skills/rite-prototype/SKILL.md +25 -26
  223. package/pack/.claude/skills/rite-prove/SKILL.md +27 -17
  224. package/pack/.claude/skills/rite-resolve/SKILL.md +12 -11
  225. package/pack/.claude/skills/rite-resolve/reference/answer-protocol.md +3 -0
  226. package/pack/.claude/skills/rite-review/SKILL.md +37 -28
  227. package/pack/.claude/skills/rite-seal/reference/phase-contract.md +27 -92
  228. package/pack/.claude/skills/rite-seal/reference/risk-and-rollback.md +13 -0
  229. package/pack/.claude/skills/rite-ship/reference/design-memory.md +31 -36
  230. package/pack/.claude/skills/rite-spec/SKILL.md +84 -135
  231. package/pack/.claude/skills/rite-spec/reference/investigation.md +37 -33
  232. package/pack/.claude/skills/rite-spec/reference/question-protocol.md +6 -2
  233. package/pack/.claude/skills/rite-spec/reference/spec-checklists.md +25 -24
  234. package/pack/.claude/skills/rite-spec/reference/spec-template.md +9 -2
  235. package/pack/.claude/skills/rite-spec/reference/state-workspace.md +13 -3
  236. package/pack/.claude/skills/rite-temper/SKILL.md +62 -47
  237. package/pack/.claude/skills/rite-temper/reference/review-dimensions.md +24 -22
  238. package/pack/.claude/skills/rite-vet/SKILL.md +110 -113
  239. package/pack/.claude/skills/rite-vet/reference/artifacts.md +42 -9
  240. package/pack/.claude/skills/rite-vet/reference/review-axes.md +39 -37
  241. package/pack/generated/claude/agents/devrites-code-reviewer.md +62 -48
  242. package/pack/generated/claude/agents/devrites-devex-reviewer.md +69 -53
  243. package/pack/generated/claude/agents/devrites-doubt-reviewer.md +29 -22
  244. package/pack/generated/claude/agents/devrites-evidence-scout.md +69 -0
  245. package/pack/generated/claude/agents/devrites-forge-judge.md +74 -61
  246. package/pack/generated/claude/agents/devrites-frontend-reviewer.md +48 -39
  247. package/pack/generated/claude/agents/devrites-performance-reviewer.md +49 -40
  248. package/pack/generated/claude/agents/devrites-plan-drafter.md +71 -0
  249. package/pack/generated/claude/agents/devrites-plan-reviewer.md +80 -47
  250. package/pack/generated/claude/agents/devrites-proof-runner.md +74 -0
  251. package/pack/generated/claude/agents/devrites-retrospector.md +48 -45
  252. package/pack/generated/claude/agents/devrites-security-auditor.md +46 -36
  253. package/pack/generated/claude/agents/devrites-simplifier-reviewer.md +50 -46
  254. package/pack/generated/claude/agents/devrites-slice-wright.md +153 -165
  255. package/pack/generated/claude/agents/devrites-spec-reviewer.md +34 -32
  256. package/pack/generated/claude/agents/devrites-strategy-reviewer.md +63 -34
  257. package/pack/generated/claude/agents/devrites-test-analyst.md +40 -30
  258. package/pack/generated/claude/settings.json +2 -1
  259. package/pack/generated/claude/skills/devrites-audit/SKILL.md +40 -61
  260. package/pack/generated/claude/skills/devrites-debug-recovery/SKILL.md +24 -13
  261. package/pack/generated/claude/skills/devrites-debug-recovery/reference/build-the-loop.md +24 -21
  262. package/pack/generated/claude/skills/devrites-debug-recovery/reference/cleanup-and-classify.md +34 -6
  263. package/pack/generated/claude/skills/devrites-debug-recovery/reference/instrumentation.md +2 -2
  264. package/pack/generated/claude/skills/devrites-doubt/SKILL.md +25 -17
  265. package/pack/generated/claude/skills/devrites-interview/SKILL.md +53 -52
  266. package/pack/generated/claude/skills/devrites-lib/SKILL.md +11 -9
  267. package/pack/generated/claude/skills/devrites-lib/reference/intent-map.md +3 -2
  268. package/pack/generated/claude/skills/devrites-lib/reference/parallel-dispatch.md +82 -137
  269. package/pack/generated/claude/skills/devrites-lib/reference/reply-contract.md +8 -1
  270. package/pack/generated/claude/skills/devrites-lib/reference/standards/README.md +38 -55
  271. package/pack/generated/claude/skills/devrites-lib/reference/standards/afk-hitl.md +53 -27
  272. package/pack/generated/claude/skills/devrites-lib/reference/standards/agents.md +198 -190
  273. package/pack/generated/claude/skills/devrites-lib/reference/standards/anti-patterns.md +5 -15
  274. package/pack/generated/claude/skills/devrites-lib/reference/standards/ci-cd.md +27 -58
  275. package/pack/generated/claude/skills/devrites-lib/reference/standards/code-review.md +16 -52
  276. package/pack/generated/claude/skills/devrites-lib/reference/standards/coding-style.md +2 -10
  277. package/pack/generated/claude/skills/devrites-lib/reference/standards/context-hygiene.md +18 -61
  278. package/pack/generated/claude/skills/devrites-lib/reference/standards/core.md +23 -18
  279. package/pack/generated/claude/skills/devrites-lib/reference/standards/deprecation.md +17 -57
  280. package/pack/generated/claude/skills/devrites-lib/reference/standards/development-workflow.md +4 -33
  281. package/pack/generated/claude/skills/devrites-lib/reference/standards/git-workflow.md +4 -20
  282. package/pack/generated/claude/skills/devrites-lib/reference/standards/hooks.md +3 -14
  283. package/pack/generated/claude/skills/devrites-lib/reference/standards/patterns.md +9 -25
  284. package/pack/generated/claude/skills/devrites-lib/reference/standards/performance.md +0 -9
  285. package/pack/generated/claude/skills/devrites-lib/reference/standards/principles.md +1 -3
  286. package/pack/generated/claude/skills/devrites-lib/reference/standards/security.md +17 -7
  287. package/pack/generated/claude/skills/devrites-lib/reference/standards/testing.md +1 -27
  288. package/pack/generated/claude/skills/devrites-lib/reference/standards/tooling.md +46 -50
  289. package/pack/generated/claude/skills/devrites-lib/reference/workspace-artifact-schema.md +23 -10
  290. package/pack/generated/claude/skills/devrites-source-driven/SKILL.md +23 -22
  291. package/pack/generated/claude/skills/rite/SKILL.md +8 -6
  292. package/pack/generated/claude/skills/rite/reference/menu.md +8 -6
  293. package/pack/generated/claude/skills/rite-adopt/SKILL.md +33 -37
  294. package/pack/generated/claude/skills/rite-autocomplete/SKILL.md +33 -28
  295. package/pack/generated/claude/skills/rite-autocomplete/reference/loop.md +21 -21
  296. package/pack/generated/claude/skills/rite-autocomplete/reference/stop-conditions.md +15 -6
  297. package/pack/generated/claude/skills/rite-build/SKILL.md +35 -30
  298. package/pack/generated/claude/skills/rite-build/reference/afk-discipline.md +38 -38
  299. package/pack/generated/claude/skills/rite-build/reference/evidence-standard.md +10 -0
  300. package/pack/generated/claude/skills/rite-build/reference/forge.md +186 -156
  301. package/pack/generated/claude/skills/rite-build/reference/one-slice-cycle.md +4 -3
  302. package/pack/generated/claude/skills/rite-build/reference/phase-contract.md +96 -175
  303. package/pack/generated/claude/skills/rite-build/reference/wright-dispatch.md +129 -134
  304. package/pack/generated/claude/skills/rite-clarify/SKILL.md +89 -0
  305. package/pack/generated/claude/skills/rite-clarify/reference/decision-coverage.md +59 -0
  306. package/pack/generated/claude/skills/rite-converge/SKILL.md +35 -25
  307. package/pack/generated/claude/skills/rite-define/SKILL.md +57 -32
  308. package/pack/generated/claude/skills/rite-define/reference/gates.md +16 -15
  309. package/pack/generated/claude/skills/rite-define/reference/plan-template.md +16 -8
  310. package/pack/generated/claude/skills/rite-frame/reference/failure-modes.md +22 -24
  311. package/pack/generated/claude/skills/rite-plan/SKILL.md +44 -16
  312. package/pack/generated/claude/skills/rite-plan/reference/task-breakdown.md +4 -0
  313. package/pack/generated/claude/skills/rite-polish/SKILL.md +27 -23
  314. package/pack/generated/claude/skills/rite-prototype/SKILL.md +25 -26
  315. package/pack/generated/claude/skills/rite-prove/SKILL.md +27 -17
  316. package/pack/generated/claude/skills/rite-resolve/SKILL.md +12 -11
  317. package/pack/generated/claude/skills/rite-resolve/reference/answer-protocol.md +3 -0
  318. package/pack/generated/claude/skills/rite-review/SKILL.md +37 -28
  319. package/pack/generated/claude/skills/rite-seal/reference/phase-contract.md +27 -92
  320. package/pack/generated/claude/skills/rite-seal/reference/risk-and-rollback.md +13 -0
  321. package/pack/generated/claude/skills/rite-ship/reference/design-memory.md +31 -36
  322. package/pack/generated/claude/skills/rite-spec/SKILL.md +84 -135
  323. package/pack/generated/claude/skills/rite-spec/reference/investigation.md +37 -33
  324. package/pack/generated/claude/skills/rite-spec/reference/question-protocol.md +6 -2
  325. package/pack/generated/claude/skills/rite-spec/reference/spec-checklists.md +25 -24
  326. package/pack/generated/claude/skills/rite-spec/reference/spec-template.md +9 -2
  327. package/pack/generated/claude/skills/rite-spec/reference/state-workspace.md +13 -3
  328. package/pack/generated/claude/skills/rite-temper/SKILL.md +62 -47
  329. package/pack/generated/claude/skills/rite-temper/reference/review-dimensions.md +24 -22
  330. package/pack/generated/claude/skills/rite-vet/SKILL.md +110 -113
  331. package/pack/generated/claude/skills/rite-vet/reference/artifacts.md +42 -9
  332. package/pack/generated/claude/skills/rite-vet/reference/review-axes.md +39 -37
  333. package/pack/generated/codex/AGENTS.md +5 -2
  334. package/pack/generated/codex/agents/devrites-code-reviewer.toml +69 -47
  335. package/pack/generated/codex/agents/devrites-devex-reviewer.toml +75 -51
  336. package/pack/generated/codex/agents/devrites-doubt-reviewer.toml +35 -20
  337. package/pack/generated/codex/agents/devrites-evidence-scout.toml +75 -0
  338. package/pack/generated/codex/agents/devrites-forge-judge.toml +80 -59
  339. package/pack/generated/codex/agents/devrites-frontend-reviewer.toml +54 -37
  340. package/pack/generated/codex/agents/devrites-performance-reviewer.toml +55 -38
  341. package/pack/generated/codex/agents/devrites-plan-drafter.toml +77 -0
  342. package/pack/generated/codex/agents/devrites-plan-reviewer.toml +82 -47
  343. package/pack/generated/codex/agents/devrites-proof-runner.toml +80 -0
  344. package/pack/generated/codex/agents/devrites-retrospector.toml +54 -43
  345. package/pack/generated/codex/agents/devrites-security-auditor.toml +53 -35
  346. package/pack/generated/codex/agents/devrites-simplifier-reviewer.toml +56 -44
  347. package/pack/generated/codex/agents/devrites-slice-wright.toml +159 -163
  348. package/pack/generated/codex/agents/devrites-spec-reviewer.toml +40 -30
  349. package/pack/generated/codex/agents/devrites-strategy-reviewer.toml +65 -34
  350. package/pack/generated/codex/agents/devrites-test-analyst.toml +46 -28
  351. package/pack/generated/codex/hooks.json +4 -14
  352. package/pack/generated/codex/skills/devrites-api-interface/SKILL.md +7 -3
  353. package/pack/generated/codex/skills/devrites-audit/SKILL.md +47 -64
  354. package/pack/generated/codex/skills/devrites-browser-proof/SKILL.md +7 -3
  355. package/pack/generated/codex/skills/devrites-debug-recovery/SKILL.md +31 -16
  356. package/pack/generated/codex/skills/devrites-debug-recovery/reference/build-the-loop.md +24 -21
  357. package/pack/generated/codex/skills/devrites-debug-recovery/reference/cleanup-and-classify.md +34 -6
  358. package/pack/generated/codex/skills/devrites-debug-recovery/reference/instrumentation.md +2 -2
  359. package/pack/generated/codex/skills/devrites-doubt/SKILL.md +32 -20
  360. package/pack/generated/codex/skills/devrites-frontend-craft/SKILL.md +7 -3
  361. package/pack/generated/codex/skills/devrites-interview/SKILL.md +60 -55
  362. package/pack/generated/codex/skills/devrites-lib/SKILL.md +18 -12
  363. package/pack/generated/codex/skills/devrites-lib/reference/intent-map.md +3 -2
  364. package/pack/generated/codex/skills/devrites-lib/reference/parallel-dispatch.md +82 -137
  365. package/pack/generated/codex/skills/devrites-lib/reference/reply-contract.md +8 -1
  366. package/pack/generated/codex/skills/devrites-lib/reference/standards/README.md +38 -55
  367. package/pack/generated/codex/skills/devrites-lib/reference/standards/afk-hitl.md +53 -27
  368. package/pack/generated/codex/skills/devrites-lib/reference/standards/agents.md +198 -190
  369. package/pack/generated/codex/skills/devrites-lib/reference/standards/anti-patterns.md +5 -15
  370. package/pack/generated/codex/skills/devrites-lib/reference/standards/ci-cd.md +27 -58
  371. package/pack/generated/codex/skills/devrites-lib/reference/standards/code-review.md +16 -52
  372. package/pack/generated/codex/skills/devrites-lib/reference/standards/coding-style.md +2 -10
  373. package/pack/generated/codex/skills/devrites-lib/reference/standards/context-hygiene.md +18 -61
  374. package/pack/generated/codex/skills/devrites-lib/reference/standards/core.md +23 -18
  375. package/pack/generated/codex/skills/devrites-lib/reference/standards/deprecation.md +17 -57
  376. package/pack/generated/codex/skills/devrites-lib/reference/standards/development-workflow.md +4 -33
  377. package/pack/generated/codex/skills/devrites-lib/reference/standards/git-workflow.md +4 -20
  378. package/pack/generated/codex/skills/devrites-lib/reference/standards/hooks.md +3 -14
  379. package/pack/generated/codex/skills/devrites-lib/reference/standards/patterns.md +9 -25
  380. package/pack/generated/codex/skills/devrites-lib/reference/standards/performance.md +0 -9
  381. package/pack/generated/codex/skills/devrites-lib/reference/standards/principles.md +1 -3
  382. package/pack/generated/codex/skills/devrites-lib/reference/standards/security.md +17 -7
  383. package/pack/generated/codex/skills/devrites-lib/reference/standards/testing.md +1 -27
  384. package/pack/generated/codex/skills/devrites-lib/reference/standards/tooling.md +46 -50
  385. package/pack/generated/codex/skills/devrites-lib/reference/workspace-artifact-schema.md +23 -10
  386. package/pack/generated/codex/skills/devrites-prose-craft/SKILL.md +7 -3
  387. package/pack/generated/codex/skills/devrites-refresh-indexes/SKILL.md +7 -3
  388. package/pack/generated/codex/skills/devrites-source-driven/SKILL.md +29 -24
  389. package/pack/generated/codex/skills/devrites-ux-shape/SKILL.md +7 -3
  390. package/pack/generated/codex/skills/rite/SKILL.md +19 -13
  391. package/pack/generated/codex/skills/rite/reference/menu.md +8 -6
  392. package/pack/generated/codex/skills/rite-adopt/SKILL.md +40 -40
  393. package/pack/generated/codex/skills/rite-autocomplete/SKILL.md +40 -31
  394. package/pack/generated/codex/skills/rite-autocomplete/reference/loop.md +21 -21
  395. package/pack/generated/codex/skills/rite-autocomplete/reference/stop-conditions.md +15 -6
  396. package/pack/generated/codex/skills/rite-build/SKILL.md +42 -33
  397. package/pack/generated/codex/skills/rite-build/reference/afk-discipline.md +38 -38
  398. package/pack/generated/codex/skills/rite-build/reference/evidence-standard.md +10 -0
  399. package/pack/generated/codex/skills/rite-build/reference/forge.md +186 -156
  400. package/pack/generated/codex/skills/rite-build/reference/one-slice-cycle.md +4 -3
  401. package/pack/generated/codex/skills/rite-build/reference/phase-contract.md +96 -175
  402. package/pack/generated/codex/skills/rite-build/reference/wright-dispatch.md +129 -134
  403. package/pack/generated/codex/skills/rite-clarify/SKILL.md +105 -0
  404. package/pack/generated/codex/skills/rite-clarify/reference/decision-coverage.md +59 -0
  405. package/pack/generated/codex/skills/rite-converge/SKILL.md +42 -28
  406. package/pack/generated/codex/skills/rite-customize/SKILL.md +7 -3
  407. package/pack/generated/codex/skills/rite-define/SKILL.md +64 -35
  408. package/pack/generated/codex/skills/rite-define/reference/gates.md +16 -15
  409. package/pack/generated/codex/skills/rite-define/reference/plan-template.md +16 -8
  410. package/pack/generated/codex/skills/rite-doctor/SKILL.md +7 -3
  411. package/pack/generated/codex/skills/rite-dogfood/SKILL.md +7 -3
  412. package/pack/generated/codex/skills/rite-explain/SKILL.md +7 -3
  413. package/pack/generated/codex/skills/rite-frame/SKILL.md +7 -3
  414. package/pack/generated/codex/skills/rite-frame/reference/failure-modes.md +22 -24
  415. package/pack/generated/codex/skills/rite-handoff/SKILL.md +7 -3
  416. package/pack/generated/codex/skills/rite-learn/SKILL.md +7 -3
  417. package/pack/generated/codex/skills/rite-plan/SKILL.md +51 -19
  418. package/pack/generated/codex/skills/rite-plan/reference/task-breakdown.md +5 -1
  419. package/pack/generated/codex/skills/rite-polish/SKILL.md +34 -26
  420. package/pack/generated/codex/skills/rite-pov/SKILL.md +7 -3
  421. package/pack/generated/codex/skills/rite-pr-feedback/SKILL.md +7 -3
  422. package/pack/generated/codex/skills/rite-pressure-test/SKILL.md +7 -3
  423. package/pack/generated/codex/skills/rite-prototype/SKILL.md +32 -29
  424. package/pack/generated/codex/skills/rite-prove/SKILL.md +34 -20
  425. package/pack/generated/codex/skills/rite-quick/SKILL.md +7 -3
  426. package/pack/generated/codex/skills/rite-resolve/SKILL.md +19 -14
  427. package/pack/generated/codex/skills/rite-resolve/reference/answer-protocol.md +3 -0
  428. package/pack/generated/codex/skills/rite-review/SKILL.md +44 -31
  429. package/pack/generated/codex/skills/rite-seal/SKILL.md +7 -3
  430. package/pack/generated/codex/skills/rite-seal/reference/phase-contract.md +27 -92
  431. package/pack/generated/codex/skills/rite-seal/reference/risk-and-rollback.md +13 -0
  432. package/pack/generated/codex/skills/rite-ship/SKILL.md +7 -3
  433. package/pack/generated/codex/skills/rite-ship/reference/design-memory.md +31 -36
  434. package/pack/generated/codex/skills/rite-spec/SKILL.md +91 -138
  435. package/pack/generated/codex/skills/rite-spec/reference/investigation.md +37 -33
  436. package/pack/generated/codex/skills/rite-spec/reference/question-protocol.md +6 -2
  437. package/pack/generated/codex/skills/rite-spec/reference/spec-checklists.md +25 -24
  438. package/pack/generated/codex/skills/rite-spec/reference/spec-template.md +9 -2
  439. package/pack/generated/codex/skills/rite-spec/reference/state-workspace.md +13 -3
  440. package/pack/generated/codex/skills/rite-status/SKILL.md +7 -3
  441. package/pack/generated/codex/skills/rite-temper/SKILL.md +69 -50
  442. package/pack/generated/codex/skills/rite-temper/reference/review-dimensions.md +24 -22
  443. package/pack/generated/codex/skills/rite-vet/SKILL.md +117 -116
  444. package/pack/generated/codex/skills/rite-vet/reference/artifacts.md +42 -9
  445. package/pack/generated/codex/skills/rite-vet/reference/review-axes.md +40 -38
  446. package/pack/generated/codex/skills/rite-zoom-out/SKILL.md +7 -3
  447. package/package.json +1 -1
  448. package/scripts/build-release-tarball.sh +32 -15
  449. package/scripts/check-authority-drift.py +125 -0
  450. package/scripts/check-instruction-size-baseline.mjs +19 -11
  451. package/scripts/check-invocation-integrity.py +2 -0
  452. package/scripts/codex-generate.sh +69 -33
  453. package/scripts/grade-feature.sh +121 -40
  454. package/scripts/live-hosts/agent-result.schema.json +230 -0
  455. package/scripts/live-hosts/claude.sh +87 -0
  456. package/scripts/live-hosts/codex.sh +81 -0
  457. package/scripts/live-hosts/common.sh +113 -0
  458. package/scripts/live-hosts/fake-host.py +264 -0
  459. package/scripts/live-hosts/host-transport.py +287 -0
  460. package/scripts/release-check.sh +5 -1
  461. package/scripts/run-agent-contract-evals.py +1380 -0
  462. package/scripts/run-behavioral-evals.sh +24 -30
  463. package/scripts/run-evals.sh +1 -5
  464. package/scripts/run-live-behavioral-evals.py +1274 -144
  465. package/scripts/run-outcome-evals.sh +414 -88
  466. package/scripts/run-tests.mjs +30 -2
  467. package/scripts/skills-inventory.mjs +1 -1
  468. package/scripts/validate-workflow-security.py +39 -20
  469. package/scripts/validate-workspace-schema.py +362 -10
  470. package/scripts/validate.sh +21 -15
  471. package/engine/testdata/golden/TestParityWrightScope/devrites-edit-allowed.golden +0 -1
  472. /package/engine/testdata/golden/{TestParityReconcile/check-no-claimed.golden → TestParityBuildReadiness/arg=clarifyopen.golden} +0 -0
@@ -5,20 +5,17 @@ argument-hint: "[path or area to adopt] [+ what you want to build next]"
5
5
  user-invocable: true
6
6
  ---
7
7
 
8
- # /rite-adopt: brownfield on-ramp
8
+ # /rite-adopt: onboard existing code
9
9
 
10
- The **reverse** of `/rite-spec`. `/rite-spec` goes idea spec; `/rite-adopt` goes
11
- **existing code spec + seeded conventions**, so an already-built project can enter the
12
- DevRites lifecycle without hand-writing a spec from nothing. It produces the same
13
- `spec.md` the rest of the lifecycle expects, plus a head start in the conventions ledger
14
- so the very first new slice already knows the project's idioms.
10
+ `/rite-adopt` derives a spec and initial conventions from existing code. It produces the
11
+ same `spec.md` used by the rest of the lifecycle and seeds the conventions ledger with
12
+ observed project idioms.
15
13
 
16
- Use it once, at the start, to onboard a repo (or a sub-area of one). After it, the normal
17
- lifecycle (`/rite-temper` `/rite-define` `/rite-build` …) takes over.
14
+ Use it once when onboarding a repository or one of its sub-areas. Continue with
15
+ `/rite-clarify`, `/rite-temper`, `/rite-define`, and `/rite-build`.
18
16
 
19
- > **Just want a map, not an onboarding?** `/rite-zoom-out` returns a structural map of
20
- > unfamiliar code without creating a workspace or ledger. `/rite-adopt` is the heavier move:
21
- > it *commits the project to the lifecycle*. Pick zoom-out to look, adopt to begin.
17
+ > **Need only a code map?** `/rite-zoom-out` maps unfamiliar code without creating a
18
+ > workspace or ledger. Use `/rite-adopt` when the project should enter the lifecycle.
22
19
 
23
20
  ## Rules consulted (read on demand from `.claude/skills/devrites-lib/reference/standards/`)
24
21
  Pull `documentation.md` when recording the adoption decisions (why-not-what) in
@@ -37,7 +34,7 @@ upholds invariants worth proposing as project principles (step 4a).
37
34
  if stated: what the user wants to build *next* on top of it. If the next-build objective
38
35
  is missing, ask once (it shapes the spec's acceptance); if the area is ambiguous, confirm
39
36
  before investigating the whole tree.
40
- 2. **Reverse-investigate the existing code:** the durable shape of the project. Use a
37
+ 2. **Inspect the existing code** to establish the project's current structure. Use a
41
38
  code-intelligence index if available (codebase-memory-mcp first (its `get_architecture`
42
39
  gives a fast overview), cross-checked with codegraph + graphify, else standard methods
43
40
  (LSP / Read/Grep/Glob); see `.claude/skills/devrites-lib/reference/standards/tooling.md`) for
@@ -52,10 +49,10 @@ upholds invariants worth proposing as project principles (step 4a).
52
49
  **current behavior as the baseline** and the **next objective** (what adoption is for) with
53
50
  measurable acceptance. Also write `decisions.md`, `assumptions.md`, `questions.md`, and
54
51
  `state.md` (phase: spec).
55
- 3a. **Seed the capability ledger** from the baseline. If the reverse-derived `spec.md` carries
52
+ 3a. **Seed the capability ledger** from the baseline. If the derived `spec.md` carries
56
53
  structured `### Requirement:` blocks, fold them into the living
57
- `.devrites/specs/<capability>/spec.md` ledger so the project's *current* proven behavior is on
58
- record before the first new feature: the ledger the next `/rite-spec` writes deltas against
54
+ `.devrites/specs/<capability>/spec.md` ledger so the project's current proven behavior is
55
+ recorded before the first new feature. The next `/rite-spec` writes deltas against this ledger
59
56
  ([ledger.md](../rite-ship/reference/ledger.md)). A flat baseline folds as all-ADDED into the
60
57
  feature slug's capability; tag capabilities in the spec first if you want finer granularity.
61
58
  ```bash
@@ -63,29 +60,28 @@ upholds invariants worth proposing as project principles (step 4a).
63
60
  devrites-engine ledger sync .devrites/work/<slug> # seed
64
61
  ```
65
62
  Skip when the baseline records no structured requirements (nothing to seed).
66
- 4. **Seed the conventions ledger** from what the investigation *observed*:
67
- [adoption § seeding](reference/adoption.md). This is the deliberate bootstrap exception to
68
- evidence-gated promotion: the seeds start at the base band and are provenance-tagged as
69
- onboarding observations, not sealed-slice proofs, so real slices later corroborate or
70
- (fresh-wins) contradict them.
63
+ 4. **Seed the conventions ledger** from observed behavior:
64
+ [adoption § seeding](reference/adoption.md). This is the bootstrap exception to
65
+ evidence-gated promotion. Seeds start at the base band with onboarding provenance;
66
+ later sealed slices may confirm or contradict them, and fresh evidence wins.
71
67
  **Completion:** every seed names observed evidence, provenance, and the base band.
72
- 4a. **Propose candidate principles** (human-ratified; optional). Where the investigation found an
73
- invariant the code *consistently and deliberately* upholds (money always in integer cents, PII
74
- always redacted from logs, every v1 endpoint preserved) surface it as a **candidate
75
- principle**, not a seeded convention. Principles are prescriptive and gating, so they are
76
- **ratified by the human, never auto-seeded** the way conventions are: present the candidates via
77
- `AskUserQuestion` with the evidence (where the code upholds it), and write the ones the human
78
- ratifies to `.devrites/principles.md` with a dated Governance entry
79
- ([`principles.md`](../devrites-lib/reference/standards/principles.md)). Propose, don't impose: an unratified candidate
80
- stays a convention, not a gate. Skip cleanly when nothing rises to an invariant (common: a
81
- fresh adopt may declare zero principles, and that's valid).
82
- 5. **Hand off.** Spec and ledger are ready. Next: `/rite-temper` if big/risky,
83
- else `/rite-define`; every plan then runs `/rite-vet` before build. Do not plan/build here.
68
+ 4a. **Propose candidate principles** (optional and human-ratified). When the code
69
+ consistently enforces an invariant, such as integer cents for money, redacted PII in
70
+ logs, or preserved v1 endpoints, propose it as a **candidate principle** rather than a
71
+ convention. Principles are prescriptive gates, so **never seed them automatically**.
72
+ Present each candidate through `AskUserQuestion` with evidence, and write human-ratified
73
+ candidates to `.devrites/principles.md` with a dated Governance entry
74
+ ([`principles.md`](../devrites-lib/reference/standards/principles.md)). An unratified
75
+ candidate remains a convention, not a gate. If no invariant qualifies, declare no
76
+ principles.
77
+ 5. **Hand off.** Continue with `/rite-clarify`. Its topology scan asks no questions when
78
+ the derived contract is already clear. Every plan then runs `/rite-vet` before build.
79
+ Do not plan or build here.
84
80
  **Completion:** one next rite is reported and no plan or application code was written.
85
81
 
86
- > **Mid-flight discipline.** Don't invent conventions the code doesn't follow, don't
87
- > seed an idiom you only assumed, and don't expand scope into a rewrite: adoption documents
88
- > what exists; the *next* feature changes it. See [`anti-patterns`](reference/anti-patterns.md).
82
+ > **Mid-flight discipline.** Do not invent conventions, seed an assumed idiom, or turn
83
+ > adoption into a rewrite. Adoption records existing behavior; a later feature changes it.
84
+ > See [`anti-patterns`](reference/anti-patterns.md).
89
85
 
90
86
  ## Output
91
87
 
@@ -96,8 +92,8 @@ Default success shape:
96
92
  Done: adopted existing behavior into <slug>; baseline spec and placement recorded.
97
93
  Changed: spec.md, decisions.md, conventions ledger, principles proposals <updated|none>
98
94
  Evidence: not applicable; reverse-derived behavior is recorded for review
99
- Open: <none | adoption questions | Alternative: /rite-define for straightforward follow-up>
100
- Next: /rite-temper
95
+ Open: <none | adoption questions>
96
+ Next: /rite-clarify
101
97
  Record: .devrites/work/<slug>/spec.md
102
98
  ↻ Hygiene: /clear before the next phase
103
99
  ```
@@ -7,33 +7,36 @@ user-invocable: true
7
7
 
8
8
  # /rite-autocomplete: full lifecycle, unattended
9
9
 
10
- Drives every DevRites phase in order without stopping for discretionary input. The
11
- prompt may be vague: autocomplete asks its clarifying questions **up front**, then
12
- runs to completion. It does **not** disable the safety gates: hard irreversible-risk,<!-- pack-scan-ignore: negated statement: gates are NOT disabled -->
10
+ Runs every DevRites phase in order without pausing for discretionary input. It asks
11
+ clarifying questions **before** unattended work begins. Safety gates remain active:
12
+ hard irreversible-risk,<!-- pack-scan-ignore: negated statement: gates are NOT disabled -->
13
13
  blocking / escalating gates, and any NO-GO still pause.
14
14
 
15
15
  ## Rules consulted (read on demand from `.claude/skills/devrites-lib/reference/standards/`)
16
16
  **Step 0:** Read `.claude/skills/devrites-lib/reference/standards/core.md` and `.claude/skills/devrites-lib/reference/standards/afk-hitl.md` first.
17
17
 
18
18
  ## Operating rules
19
- - **One human window.** Clarifying questions are batched up front via
20
- `devrites-interview`. After that, discretionary decisions are made automatically and
21
- recorded in `decisions.md`, not asked. See [reference/decision-policy.md](reference/decision-policy.md).
19
+ - **Use one initial human window.** Run spec and topology-first clarify; arm AFK only after
20
+ `Decision coverage: CLEAR`. Later discretionary calls are recorded, not asked
21
+ ([decision policy](reference/decision-policy.md)).
22
22
  - **Safety gates are not bypassable.** AFK never auto-passes destructive migration /
23
- auth-authz change / public-API break / external-contract change / red tests; blocking
23
+ auth-authz change / public-API break / external-contract change; blocking
24
24
  and escalating gates and any open `gate: validating` always pause. `--ship` auto-confirms
25
25
  the **final** type-GO only: nothing else. A change that violates a declared project
26
26
  principle (`.devrites/principles.md`) with no recorded exception pauses too: autocomplete
27
27
  never grants a principle exception on its own (`principles.md`: that's a human decision).
28
- - **Loop budget = the plan's own slice count, not a fixed number.** After `/rite-vet`
28
+ Red checks never advance the loop: autocomplete runs the shared bounded debug recovery, then
29
+ stops as `blocked` if the objective failure remains; it asks only if recovery exposes a
30
+ human-owned decision.
31
+ - **Set the loop budget from the plan's slice count.** After `/rite-vet`
29
32
  (not `/rite-define`: vet may split or add slices, so the count isn't final until then),
30
33
  set the AFK budget to however many slices the plan has, so the loop builds exactly the
31
- task's slices and stops when they're done. `--max-slices N` is an OPTIONAL *lower* safety
32
- cap (partial / babysat run); omit it to run the whole plan. The budget is finite
33
- (= planned slices), so a runaway is still bounded.
34
- - **Best option, recorded.** For each discretionary choice, pick the option the relevant
35
- specialist / reviewer favours and record the rationale. Never silently coin-flip.
36
- - **Strategic review runs, but never auto-grows scope.** After `/rite-spec`, run `/rite-temper`
34
+ planned slices and stops when they are done. `--max-slices N` is an optional lower
35
+ safety cap for a partial run; omit it to run the whole plan. The planned slice count
36
+ keeps the default run finite.
37
+ - **Record each discretionary choice.** Pick the option recommended by the relevant
38
+ specialist or reviewer and record the rationale. Do not choose arbitrarily.
39
+ - **Strategic review runs, but never auto-grows scope.** After `/rite-clarify`, run `/rite-temper`
37
40
  (significance-gated; it skips low-stakes specs in one line). Unattended it auto-applies only
38
41
  `hold-rigor` + `reduce-to-MVP` (these never grow acceptance); **any `expand` is a blocking
39
42
  pause**, and irreversible-risk findings always pause. Autocomplete hardens and may *prune* the
@@ -49,19 +52,22 @@ blocking / escalating gates, and any NO-GO still pause.
49
52
  ## Workflow
50
53
  1. **Orient + parse args.** Run `devrites-engine preamble` for deterministic workspace orientation.
51
54
  The idea + flags: `--ship` / `--yolo` (auto-confirm the final
52
- type-GO), `--max-slices N` (OPTIONAL *lower* safety cap for a partial run; default =
55
+ type-GO), `--max-slices N` (optional lower safety cap for a partial run; default =
53
56
  the plan's slice count, i.e. run all planned slices).
54
- 2. **Clarify up front.** If the idea is underspecified, run `devrites-interview` to
55
- ~95% confidence: the only interactive window. If already clear, skip.
56
- 3. **Arm AFK.** Write `.devrites/AFK` with `allow_gates: [advisory]`; set the slice budget
57
+ 2. **Specify and clarify up front.** Use `devrites-interview`, `/rite-spec`, and
58
+ `/rite-clarify` as one interactive window. Clear specs ask zero questions; Partial/Missing
59
+ coverage never arms AFK. **Completion:** `decision-coverage.md` records `CLEAR`.
60
+ 3. **Arm AFK after clarity.** Require `Decision coverage: CLEAR`, then write `.devrites/AFK`
61
+ with `allow_gates: [advisory]`; set the slice budget
57
62
  from the plan's count after `/rite-vet` (the slice count is only final post-vet), or from
58
63
  an explicit `--max-slices` ([reference/loop.md](reference/loop.md)). validating / blocking / escalating +
59
- irreversible-risk still pause. Also `touch .devrites/CHECKPOINT`: an unattended run is the
60
- case checkpoint mode earns its keep, so each proven slice is committed local-only as
61
- crash-survivable `WIP` ([rite-build/reference/checkpoint.md](../rite-build/reference/checkpoint.md));
64
+ irreversible-risk still pause. Also `touch .devrites/CHECKPOINT`: unattended runs use
65
+ checkpoint mode so each proven slice is committed locally as a crash-survivable `WIP`
66
+ ([rite-build/reference/checkpoint.md](../rite-build/reference/checkpoint.md));
62
67
  `/rite-ship` collapses them into the one feature commit.
63
- 4. **Drive the phases** ([reference/loop.md](reference/loop.md)): `/rite-spec`
64
- **`/rite-temper`**`/rite-define` → **`/rite-vet`** → `/rite-build` (loop until all slices
68
+ 4. **Drive the phases** ([reference/loop.md](reference/loop.md)). The canonical arc is
69
+ `/rite-spec`**`/rite-clarify`** → **`/rite-temper`** → `/rite-define`
70
+ **`/rite-vet`** → `/rite-build` (repeat until all slices
65
71
  built; `devrites-engine tick-afk` each) → `/rite-prove` → `/rite-polish` → `/rite-review` → `/rite-seal`.
66
72
  Run each by Reading its `SKILL.md` and executing its workflow; state is carried by the
67
73
  workspace files, not chat.
@@ -71,12 +77,11 @@ blocking / escalating gates, and any NO-GO still pause.
71
77
  6. **Seal GO → ship.** With `--ship`, proceed to `/rite-ship` and auto-confirm the
72
78
  type-GO. Without it, render the type-GO prompt and stop for the human.
73
79
 
74
- > **Mid-flight discipline.** When tempted to auto-pass a blocking gate "to keep moving",
75
- > answer a material question yourself instead of pausing, or run past red tests: stop.
76
- > Autonomy is for the routine path; the gates exist for everything else.
80
+ > **Mid-flight discipline.** Stop rather than auto-passing a blocking gate, answering a
81
+ > human-owned material question, or continuing past red tests.
77
82
 
78
83
  ## Output
79
- A compact phase-by-phase log, then the final status. **Progress first for the final
84
+ A compact phase log followed by the final status. **Progress first for the final
80
85
  status**: run `devrites-engine progress`, then use the shared typed states from
81
86
  [`devrites-lib/reference/reply-contract.md`](../devrites-lib/reference/reply-contract.md):
82
87
  `Shipped`, `Stopped`, `Awaiting human`, `NO-GO`, or `GO`.
@@ -84,7 +89,7 @@ status**: run `devrites-engine progress`, then use the shared typed states from
84
89
  Keep the log terse:
85
90
  ```
86
91
  Autocomplete: <slug>
87
- spec <done|stopped> · temper <done|skipped|stopped> · define <done|stopped> · vet <done|stopped> · build <n/N|stopped> · prove <done|stopped> · polish <done|stopped> · review <done|stopped> · seal <GO|NO-GO|stopped>
92
+ spec <done|stopped> · clarify <clear|stopped> · temper <done|skipped|stopped> · define <done|stopped> · vet <ready|stopped> · build <n/N|stopped> · prove <done|stopped> · polish <done|stopped> · review <done|stopped> · seal <GO|NO-GO|stopped>
88
93
  ```
89
94
 
90
95
  Final state examples: `Shipped: <feature>`, `Stopped: <reason>`, `Awaiting human:
@@ -1,8 +1,8 @@
1
1
  # The autocomplete loop: arm AFK, drive every phase
2
2
 
3
- Autocomplete is an orchestrator: it runs the existing `/rite-*` skills in order,
4
- exactly as a human would, but without stopping between them. It owns no workflow of
5
- its own: the phases do the work; autocomplete sequences them and enforces stops.
3
+ Autocomplete runs the existing `/rite-*` skills in order without stopping between
4
+ routine phases. Each phase keeps its own workflow; autocomplete only sequences phases
5
+ and enforces stop conditions.
6
6
 
7
7
  ## Arm AFK
8
8
 
@@ -16,34 +16,34 @@ allow_gates: [advisory] # only advisory auto-handles; validating+ pause
16
16
  # caps how many run unattended (default = all the plan's slices).
17
17
  ```
18
18
 
19
- The budget is the plan's own slice count, not a fixed number, so the loop builds exactly
20
- the task's slices and stops when they're done; `--max-slices N` only *lowers* it for a
19
+ The budget is the plan's slice count, so the loop builds the planned slices and stops
20
+ when they are done. `--max-slices N` only lowers that number for a
21
21
  partial run. Arm the gate policy at step 3; write `max_slices` / `AFK slices remaining`
22
22
  **after `/rite-vet`** (it runs before the build loop and may split or add a slice, so the
23
23
  count isn't final until then: vet runs on every plan here, so always set the budget after it).
24
24
 
25
- `allow_gates: [advisory]` is deliberate: an open `gate: validating` is merge-blocking
26
- at seal (`afk-hitl.md`), so autocomplete must *pause* on it rather than queue it and
27
- then hit NO-GO. Widen `allow_gates` only if the caller explicitly asked.
25
+ `allow_gates: [advisory]` prevents an open `gate: validating` from being queued until
26
+ seal, where it would force NO-GO under `afk-hitl.md`. Autocomplete pauses on it instead. Widen
27
+ `allow_gates` only when the caller explicitly asks.
28
28
 
29
29
  ## Drive the phases
30
30
 
31
- Run each by Reading its `SKILL.md` and executing that workflow. State flows through the
32
- workspace files (`state.md`, `tasks.md`, `evidence.md`, …), so each phase picks up where
33
- the last left off. There is nothing to thread through chat.
31
+ Read each phase's `SKILL.md` and execute that workflow. Workspace files such as
32
+ `state.md`, `tasks.md`, and `evidence.md` carry state between phases; chat does not.
34
33
 
35
34
  | Step | Phase | Loop / gate |
36
35
  |---|---|---|
37
- | 1 | `/rite-spec` | feed the interview answers; write `spec.md` |
38
- | 2 | `/rite-temper` | significance-gated strategic review; harden spec + write `strategy.md`. Skip low-stakes specs in one line. AFK: `hold-rigor` / `reduce-to-MVP` auto-apply; **any `expand` pauses (blocking)**; irreversible-risk pauses |
39
- | 3 | `/rite-define` | reads `strategy.md`; `plan.md` + `tasks.md`; record `Plan approved` |
40
- | 4 | `/rite-vet` | engineering plan review on **every** plan (light pass on simple plans, full on big/risky; never skipped); harden `plan.md` / `tasks.md` + write `eng-review.md` + `test-plan.md`. AFK: hardening / coverage findings auto-apply; **any scope-growing / acceptance-changing finding pauses (blocking)**; irreversible-risk pauses. Set the slice budget after this (vet may split a slice) |
41
- | 5 | `/rite-build` ×N | **loop** while any slice is `pending`; build one (the slice-wright reads `test-plan.md` for coverage), then run `devrites-engine tick-afk state.md`: exit 3 (budget hit) STOP |
42
- | 6 | `/rite-prove` | once all slices `built`; walks `test-plan.md`; on failure `devrites-debug-recovery` within scope |
43
- | 7 | `/rite-polish` | re-verify after code edits (evidence must stay fresh) |
44
- | 8 | `/rite-review` | apply in-scope fixes; re-prove if code changed |
45
- | 9 | `/rite-seal` | GO/NO-GO decision (no git here) |
46
- | 10 | `/rite-ship` | only if seal GO; `--ship` auto-confirms type-GO, else stop for human |
36
+ | 1 | `/rite-spec` | interactive window: investigate, feed intent answers, write `spec.md` |
37
+ | 2 | `/rite-clarify` | same interactive window: topology-first scan; write `decision-coverage.md`; proceed only on `CLEAR`, then arm AFK |
38
+ | 3 | `/rite-temper` | significance-gated strategic review; harden spec + write `strategy.md`. Skip low-stakes specs in one line. AFK: `hold-rigor` / `reduce-to-MVP` auto-apply; **any `expand` pauses (blocking)**; irreversible-risk pauses |
39
+ | 4 | `/rite-define` | reads `decision-coverage.md` + `strategy.md`; writes `plan.md` + `tasks.md`; records `Plan approved` |
40
+ | 5 | `/rite-vet` | engineering/readiness review on **every** plan (light pass on simple plans, full on big/risky; never skipped); harden `plan.md` / `tasks.md` + write `eng-review.md` (`Implementation readiness: READY`) + `test-plan.md`. AFK: hardening / coverage findings auto-apply; **any scope-growing / acceptance-changing finding pauses (blocking)**; irreversible-risk pauses. Set the slice budget after this (vet may split a slice) |
41
+ | 6 | `/rite-build` ×N | **loop** while any slice is `pending`; build one (the slice-wright reads `test-plan.md` for coverage), then run `devrites-engine tick-afk state.md`: exit 3 (budget hit) ⇒ STOP |
42
+ | 7 | `/rite-prove` | once all slices `built`; walks `test-plan.md`; on failure `devrites-debug-recovery` within scope |
43
+ | 8 | `/rite-polish` | re-verify after code edits (evidence must stay fresh) |
44
+ | 9 | `/rite-review` | apply in-scope fixes; re-prove if code changed |
45
+ | 10 | `/rite-seal` | GO/NO-GO decision (no git here) |
46
+ | 11 | `/rite-ship` | only if seal GO; `--ship` auto-confirms type-GO, else stop for human |
47
47
 
48
48
  ## Between phases
49
49
 
@@ -1,8 +1,8 @@
1
1
  # Stop conditions: when autocomplete must pause for a human
2
2
 
3
- Autonomy covers the routine path. These are the cases where autocomplete writes
4
- `state.md` (`Status: awaiting_human` or `blocked`), surfaces *why* + the single resume
5
- command, fires `notify` if set, and **stops**. None are bypassable by `--ship`.
3
+ In the cases below, autocomplete writes `state.md` (`Status: awaiting_human` or
4
+ `blocked`), reports the reason and one resume command, fires `notify` if set, and
5
+ **stops**. `--ship` cannot bypass them.
6
6
 
7
7
  ## Always stop (irreversible-risk list: from `afk-hitl.md`)
8
8
 
@@ -12,14 +12,17 @@ Regardless of `allow_gates` or `--ship`:
12
12
  - Public-API break (response shape, removed endpoint, changed status semantics).
13
13
  - External-service contract change.
14
14
  - Filesystem destruction outside the workspace.
15
- - Red tests / types / lint at slice end (fail-on-red).
15
+
16
+ Red tests/types/lint/build/browser proof are hard non-advance gates, not automatically human
17
+ gates. Run bounded `devrites-debug-recovery`; if it exhausts, stop as a technical blocker unless
18
+ the remaining issue is human-owned.
16
19
 
17
20
  ## Stop on gate severity
18
21
 
19
22
  - `blocking` gate fires → synchronous pause.
20
23
  - `escalating` gate fires → pause, route to the specialist tag.
21
24
  - Any `questions.md` entry with `gate: validating` and `status: open` → pause (it is a
22
- seal NO-GO by definition; don't sail into a guaranteed NO-GO).
25
+ seal NO-GO by definition; stop before reaching seal).
23
26
 
24
27
  ## Stop on strategic-review scope expansion (`/rite-temper`)
25
28
 
@@ -29,6 +32,12 @@ Regardless of `allow_gates` or `--ship`:
29
32
  never grow the build's scope); **growing scope unattended is never automatic**. A low-stakes
30
33
  spec that temper skips, or a `hold-rigor` / `reduce-to-MVP` run, does **not** pause.
31
34
 
35
+ ## Stop on incomplete decision coverage (`/rite-clarify`)
36
+
37
+ - Stop on any material Partial/Missing/unowned row or low-confidence, high-consequence
38
+ assumption. Continue the up-front window with the next genuine decision packet; never arm
39
+ AFK or carry it into build. Resolve facts and reversible choices automatically.
40
+
32
41
  ## Stop on workflow state
33
42
 
34
43
  - **NO-GO at seal** → stop; surface every blocker with `file:line` and the fix
@@ -38,7 +47,7 @@ Regardless of `allow_gates` or `--ship`:
38
47
  - **Budget exhausted with slices still pending:** `devrites-engine tick-afk` exit 3 while `tasks.md`
39
48
  still has unbuilt slices (only when an explicit `--max-slices` capped the run below the
40
49
  plan's count) → stop; report slices remaining. Exhausting the default budget = all
41
- planned slices built = normal completion → continue to `/rite-prove`, don't pause.
50
+ planned slices built = normal completion → continue to `/rite-prove` without pausing.
42
51
  - **Still low-confidence after the interview:** the idea can't be pinned to testable
43
52
  acceptance criteria → stop and ask, rather than guessing the product.
44
53
  - **Repeated failure:** a phase fails, `devrites-debug-recovery` can't fix it within
@@ -7,13 +7,13 @@ user-invocable: true
7
7
 
8
8
  # /rite-build: one verified slice
9
9
 
10
- Build the next single slice, leave it working and proven, then **stop**. **Read the
11
- active workspace first**; if none, tell the user to run `/rite-spec <feature>`.
10
+ Build and prove one slice, then **stop**. **Read the active workspace first**; if none,
11
+ tell the user to run `/rite-spec <feature>`.
12
12
 
13
- This skill is the **orchestrator**: it owns the gates and the workspace; a fresh-context
14
- [`devrites-slice-wright`](../../agents/devrites-slice-wright.md) owns the **writing**. You run
15
- pre-flight (readiness, slice select, HITL pause), dispatch the wright for the build core, then
16
- run the post-return gates (doubt, fail-on-red, record, stop). See
13
+ This skill owns the gates and workspace. A fresh-context
14
+ [`devrites-slice-wright`](../../agents/devrites-slice-wright.md) writes source and tests.
15
+ Run the readiness, slice-selection, and HITL checks; dispatch the wright; then run the
16
+ doubt, fail-on-red, recording, and stop checks. See
17
17
  [`reference/wright-dispatch.md`](reference/wright-dispatch.md).
18
18
 
19
19
  ## Rules consulted (read on demand from `.claude/skills/devrites-lib/reference/standards/`)
@@ -23,6 +23,8 @@ writes; read them yourself for the doubt/record gates or in the inline fallback:
23
23
  - `coding-style.md`: naming, function shape, guard clauses, comments, reuse-first.
24
24
  - `error-handling.md`: fail fast, no silent catches, fail closed.
25
25
  - `testing.md`: pyramid, behaviour over implementation, see-it-fail-first.
26
+ - [`reference/tdd.md`](reference/tdd.md): the slice-level Red → Green → Refactor
27
+ and Prove-It contract.
26
28
  - `patterns.md`: composition over inheritance, avoid premature abstraction.
27
29
  - `principles.md`: the project invariants (`.devrites/principles.md`) the slice must honor; the wright reads them as **binding**, not priors.
28
30
  - `security.md`: when the slice touches user input, auth, data, or external integrations.
@@ -33,23 +35,24 @@ writes; read them yourself for the doubt/record gates or in the inline fallback:
33
35
  - **One slice at a time. DO NOT** start the next slice without the user asking.
34
36
  - Evidence over confidence. Prefer existing conventions. Feature scope only: no
35
37
  drive-by refactors.
36
- - **Noticed, not touched.** An adjacent smell the wright sees outside `touched-files.md` is
37
- recorded as an FYI follow-up in `decisions.md`, never fixed inline: the slice's change summary
38
- states what it *deliberately left alone* ([`git-workflow.md`](../devrites-lib/reference/standards/git-workflow.md) "Things
39
- I didn't touch"), so the reviewer reads a feature-scoped diff, not a renovation. The `devrites-engine reconcile`
40
- gate (step 6) enforces this by exit code.
41
- - **Don't re-run an unchanged check.** Re-running the same build/test command on code that hasn't
42
- changed since proves nothing new. It's motion, not evidence. Re-verify after an edit, not before.
43
- - Surface material assumptions; ask before adding dependencies or a second design
44
- system. The [Spec Drift Guard](reference/spec-drift-guard.md) is active throughout.
45
- - **Avoid AI slop while writing.** `devrites-slice-wright` enforces the anti-slop charter **at
46
- the source**: the canonical do-not list is `rite-polish/reference/anti-ai-slop.md` (the
47
- wright reads it; don't restate it here). It writes the code the *project* would write, in its
48
- idiom, reusing before building; **you verify the charter held on return**. You do not re-list
49
- it and you do not fix slop by editing source. Polish catches what slips; build prevents.
38
+ - **Record adjacent issues; do not edit them.** An issue outside the captured
39
+ `.wright-allowlist` becomes an FYI follow-up in `decisions.md`. The slice summary states
40
+ what it deliberately left alone ([`git-workflow.md`](../devrites-lib/reference/standards/git-workflow.md)
41
+ "Things I didn't touch"). The `devrites-engine reconcile` gate enforces this boundary.
42
+ - **Don't re-run an unchanged check.** The same build or test on unchanged code provides
43
+ no new evidence. Re-verify after an edit.
44
+ - Surface material assumptions. Do not introduce an unplanned dependency or second design
45
+ system: route the objective plan gap to `/rite-vet` (or bounded recovery), not to a human.
46
+ Ask only if the newly exposed choice changes licensing/cost/security, product behavior,
47
+ or an explicit architecture policy. The
48
+ [Spec Drift Guard](reference/spec-drift-guard.md) is active throughout.
49
+ - **Avoid AI slop while writing.** `devrites-slice-wright` applies the anti-slop charter
50
+ while writing. The canonical list is `rite-polish/reference/anti-ai-slop.md`; do not
51
+ duplicate it here. The wright follows project idioms and reuses existing code first.
52
+ **Verify the charter on return.** Do not correct source from the orchestrator.
50
53
  The **prose you write yourself** (`evidence.md`, `decisions.md`, the slice report) follows
51
54
  the human-voice charter (`.claude/skills/devrites-lib/reference/standards/prose-style.md`; depth in `devrites-prose-craft`): no
52
- filler openers, no marketing adjectives, exact commands and identifiers kept verbatim.
55
+ filler openers or marketing adjectives; preserve exact commands and identifiers.
53
56
  - **Honor declared project principles.** The wright reads `.devrites/principles.md` and treats
54
57
  each invariant as **binding** (not a prior to weigh like a convention): a slice it cannot build
55
58
  without breaking one is an **Escalation**, not a silent violation. On return **you verify no
@@ -58,15 +61,17 @@ writes; read them yourself for the doubt/record gates or in the inline fallback:
58
61
  `.devrites/principles.md` → none declared → nothing to honor.
59
62
  - **You never edit source: the wright is the only writer of code + tests.** You write only
60
63
  `.devrites/` bookkeeping. On any red gate, doubt finding, or coverage gap your only remedies
61
- are **continue the same wright once** (it fixes in its own context) or **stop + escalate**:
62
- never patch the code yourself. The `devrites-engine reconcile` gate (step 6) enforces this by exit code:
63
- any source file changed outside the wright's claimed set is a hard STOP.
64
- - **A `Forge: yes` slice competes candidates: one author still lands.** When `/rite-vet`
65
- flagged the slice a genuine architecture fork, step 3 runs K=2-3 candidate wrights in
66
- **isolated worktrees** and lands exactly one winner's diff; the single-writer invariant holds
67
- because no tree ever has two authors and only the winner reaches the working tree. You still
68
- never edit source, and reconcile runs against the winner's claimed set. The default slice is
69
- single-path: forge is the rare exception ([`reference/forge.md`](reference/forge.md)).
64
+ are to continue the same wright under bounded `devrites-debug-recovery` (three total attempts
65
+ per root cause) or stop with the correctly classified blocker: never patch the code yourself
66
+ and never ask the human to authorize agent-owned repair work. The `devrites-engine reconcile`
67
+ gate enforces this against the root-owned pre-dispatch allowlist: any source file changed
68
+ outside that exact set is a hard STOP.
69
+ - **Forge is manifest-owned, winner-takes-all.** For a fully typed `Forge: yes`
70
+ slice, follow [`reference/forge.md`](reference/forge.md): `forge plan` precedes
71
+ reconciliation; every candidate is bound to its isolated worktree and live worker;
72
+ the judge records one winner; normal reconciliation and proof pass before manifest-only
73
+ cleanup and the human report. Any stale/ineligible flag uses one serial wright before
74
+ Forge creates state.
70
75
 
71
76
  ## Workflow
72
77
 
@@ -1,19 +1,18 @@
1
- # AFK discipline: running `/rite-build` unattended without burning the trunk
1
+ # AFK discipline for unattended `/rite-build`
2
2
 
3
- AFK mode is `.devrites/AFK` present. It lets `/rite-build` chain slices without per-slice
4
- user input. The discipline below is what keeps an AFK loop from drifting into damage.
3
+ AFK mode is active when `.devrites/AFK` exists. It lets `/rite-build` chain slices
4
+ without per-slice user input. The rules below limit that unattended work.
5
5
 
6
- The core principles are borrowed from established autonomous-coding loops (Ralph Wiggum,
7
- Claude Code auto mode):
6
+ These rules follow established autonomous-coding loops, including Ralph Wiggum and
7
+ Claude Code auto mode:
8
8
 
9
- 1. **Feedback loops are the trust substrate.** No green tests / types / lint → no
10
- "built" status. The loop can't declare victory if the lights are red.
11
- 2. **Always cap iterations.** Stochastic systems + infinite loops = unsafe. `max_slices`
12
- is the hard counter.
13
- 3. **Promote pre-action gates, demote post-action gates.** Code that lands without a
14
- gate is a finding; gates after the fact are review queues.
15
- 4. **AFK widens what's automatic, never what's irreversible.** Destructive work, auth
16
- boundaries, public API breaks always pause regardless of the sentinel.
9
+ 1. **Require green feedback.** Tests, types, and lint must pass before a slice is
10
+ marked `built`.
11
+ 2. **Cap iterations.** `max_slices` is the hard limit.
12
+ 3. **Run gates before the action they control.** A post-action gate is only a review
13
+ queue.
14
+ 4. **Keep irreversible work manual.** Destructive work, auth boundaries, and public
15
+ API breaks always pause regardless of the sentinel.
17
16
 
18
17
  ## The sentinel file
19
18
 
@@ -35,8 +34,7 @@ Defaults when keys are omitted:
35
34
  - `notify`: none.
36
35
  - `allow_gates`: `[advisory]`.
37
36
 
38
- To disable AFK temporarily, delete the file. The next `/rite-build` boots straight back
39
- into HITL.
37
+ To disable AFK, delete the file. The next `/rite-build` runs in HITL.
40
38
 
41
39
  ## Iteration cap
42
40
 
@@ -55,29 +53,31 @@ The cap is enforced by `devrites-engine tick-afk`, not by prose, when it exits 3
55
53
  Step 0 re-derives the remaining budget from `state.md` (seeding it from `.devrites/AFK`
56
54
  `max_slices` on the first AFK build); `max_slices` itself is read-only and never rewritten.
57
55
 
58
- The cap is intentional: a missing or large cap **must be a conscious choice**. Ralph's
59
- rule: 5-10 iterations for small tasks, 30-50 for larger ones. Don't ship "unlimited" as
60
- the default for a job you haven't observed running once HITL.
56
+ Choose a missing or large cap deliberately. Ralph's rule is 5-10 iterations for small
57
+ tasks and 30-50 for larger ones. Do not use `unlimited` for work that has not completed
58
+ successfully in HITL.
61
59
 
62
60
  ## Fail-on-red
63
61
 
64
- The **fail-on-red step** (workflow step 5) refuses to mark a slice `built` if targeted tests /
65
- types / lint are red. The reasoning:
62
+ The **fail-on-red step** (workflow step 5) refuses to mark a slice `built` if targeted
63
+ tests, types, or lint are red:
66
64
 
67
- - A red signal means either the slice's contract is wrong or the failing code is. Neither
68
- is something AFK can resolve.
69
- - Marking it `built` and letting the AFK loop chain to the next slice burns the trunk:
70
- the next slice builds on broken state.
65
+ - A red signal means either the slice's contract is wrong or the implementation/proof path is.
66
+ The slice cannot advance, but an objective root cause is agent-owned recovery work.
67
+ - Marking it `built` would let the next slice build on broken state.
71
68
 
72
69
  The fail-on-red path:
73
70
 
74
- 1. Append a question to `questions.md` with `gate: blocking`, the SLA of the slice, and a
75
- crisp `question:` field naming what failed.
76
- 2. Set `state.md` `Status: awaiting_human` and the `Awaiting human` block.
77
- 3. Fire the `notify:` hook if defined.
78
- 4. STOP.
71
+ 1. Continue the same wright under `devrites-debug-recovery`, carrying exact output and dead
72
+ ends; cap writer + recovery at three total attempts per root cause.
73
+ 2. Green → record the slice. Product-contract/irreversible ambiguity write the genuine
74
+ human gate. Missing human-only credential/permission write a human-intervention gate.
75
+ 3. Any other exhausted objective failure → set `Status: blocked`, preserve the reproduction,
76
+ set `Next step: /rite-plan unblock`, and STOP without a qid.
77
+ 4. Fire `notify:` only for an actual `awaiting_human` transition.
79
78
 
80
- The user resolves via `/rite-resolve` after diagnosing or re-planning.
79
+ AFK never starts the next slice while checks are red and never asks the human to approve
80
+ agent-owned diagnosis or parser/test repair.
81
81
 
82
82
  ## Irreversible-risk list (always pause)
83
83
 
@@ -92,8 +92,8 @@ any of:
92
92
  rewriting `.gitignore`-listed paths, deleting fixtures).
93
93
  - Anything the slice's `Gate: blocking` plus `tasks.md` `Why HITL:` flags as irreversible.
94
94
 
95
- The list is the same one Claude Code auto-mode's transcript classifier protects: adapted
96
- to DevRites's workspace shape.
95
+ This is the Claude Code auto-mode transcript classifier list adapted to the DevRites
96
+ workspace.
97
97
 
98
98
  ## The `notify:` hook contract
99
99
 
@@ -109,7 +109,7 @@ the hook receives:
109
109
  | `DEVRITES_QUESTION` | the checkpoint text |
110
110
  | `DEVRITES_PROPOSED` | the proposed answer |
111
111
 
112
- The hook is best-effort: non-zero exit does **not** roll back the pause. Failures are
112
+ The hook is best effort: a non-zero exit does **not** roll back the pause. Failures are
113
113
  logged to `evidence.md` so the user sees them on return.
114
114
 
115
115
  Example targets:
@@ -117,20 +117,20 @@ Example targets:
117
117
  - `osascript -e "display notification \"$DEVRITES_QUESTION\" with title \"DevRites: $DEVRITES_GATE\""`
118
118
  - `pb push "$DEVRITES_SLUG: $DEVRITES_QUESTION"` (via pushbullet CLI)
119
119
 
120
- DevRites owns no notification logic: the hook is a seam, not a feature.
120
+ DevRites does not implement notifications; the configured hook does.
121
121
 
122
122
  ## When to leave AFK
123
123
 
124
124
  Drop the sentinel before:
125
125
 
126
- - A novel feature where you have not yet seen `/rite-build` work on this codebase HITL:
127
- Ralph's progression: HITL first → refine prompt → AFK once trusted.
126
+ - A new feature when `/rite-build` has not yet completed successfully on this codebase
127
+ in HITL. Ralph's progression is HITL first → refine prompt → AFK after validation.
128
128
  - A risky slice you marked `Mode: HITL` and want to walk through interactively even if
129
129
  the gate is technically `validating`.
130
130
  - Any time you'd rather review per-slice than batch-resolve afterwards.
131
131
 
132
- AFK is a **bias toward continuing**, not a vow. Re-enter it whenever the next stretch of
133
- work is bulk + low-stakes.
132
+ AFK allows routine work to continue automatically. Re-enable it for another batch of
133
+ low-stakes work.
134
134
 
135
135
  ## What AFK does NOT do
136
136