devrites 3.0.7 → 3.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (484) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/README.md +82 -50
  3. package/SECURITY.md +31 -29
  4. package/docs/adr/0001-go-engine-as-control-plane.md +1 -1
  5. package/docs/adr/0002-dual-host-harness.md +1 -1
  6. package/docs/adr/0004-state-schema-phases-sections.md +1 -2
  7. package/docs/adr/0006-clock-seam-and-engine-ci-gates.md +3 -4
  8. package/docs/adr/0009-prebuild-decision-coverage-and-readiness.md +67 -0
  9. package/docs/adr/0010-agent-first-fresh-context-orchestration.md +71 -0
  10. package/docs/adr/0011-define-plan-transition-rights.md +28 -0
  11. package/docs/adr/0012-semantic-workspace-upgrades.md +77 -0
  12. package/docs/adr/README.md +4 -0
  13. package/docs/agents/triage-labels.md +7 -7
  14. package/docs/architecture.md +179 -141
  15. package/docs/cli.md +47 -12
  16. package/docs/command-map.md +61 -38
  17. package/docs/engine/agent-contract.md +92 -15
  18. package/docs/engine/commands.md +248 -72
  19. package/docs/engine/state-schema.md +52 -23
  20. package/docs/engine/workspace-schema.md +103 -15
  21. package/docs/extensions.md +1 -1
  22. package/docs/flow.md +86 -51
  23. package/docs/harness-compliance.md +29 -5
  24. package/docs/orchestration.md +107 -79
  25. package/docs/quick-reference.md +11 -3
  26. package/docs/release.md +4 -3
  27. package/docs/skills.md +67 -38
  28. package/docs/usage.md +84 -39
  29. package/engine/cmd/releasepack/main.go +219 -0
  30. package/engine/cmd/releasepack/main_test.go +170 -0
  31. package/engine/commands.go +170 -23
  32. package/engine/git_guard.go +187 -0
  33. package/engine/git_guard_test.go +283 -0
  34. package/engine/hookpolicy.go +53 -55
  35. package/engine/hookpolicy_test.go +91 -1
  36. package/engine/hooks.go +296 -75
  37. package/engine/hooks_events_test.go +276 -6
  38. package/engine/hooks_workspace.go +640 -159
  39. package/engine/internal/devritespaths/paths.go +65 -10
  40. package/engine/internal/devritespaths/paths_test.go +110 -0
  41. package/engine/internal/doctor/doctor.go +153 -23
  42. package/engine/internal/doctor/doctor_test.go +74 -0
  43. package/engine/internal/forge/forge.go +940 -0
  44. package/engine/internal/forge/forge_test.go +576 -0
  45. package/engine/internal/forge/git.go +245 -0
  46. package/engine/internal/forge/liveness_unix.go +48 -0
  47. package/engine/internal/forge/liveness_windows.go +67 -0
  48. package/engine/internal/forge/manifest.go +402 -0
  49. package/engine/internal/gate/gate.go +90 -71
  50. package/engine/internal/gate/gate_test.go +71 -2
  51. package/engine/internal/harness/compliance.go +18 -24
  52. package/engine/internal/harness/harness.go +37 -44
  53. package/engine/internal/harness/harness_test.go +21 -5
  54. package/engine/internal/install/install.go +486 -38
  55. package/engine/internal/install/install_test.go +383 -10
  56. package/engine/internal/iohooks/iohooks.go +350 -59
  57. package/engine/internal/iohooks/iohooks_test.go +421 -1
  58. package/engine/internal/lib/buildreadiness.go +43 -18
  59. package/engine/internal/lib/clarifyreturn.go +91 -0
  60. package/engine/internal/lib/clarifyreturn_test.go +123 -0
  61. package/engine/internal/lib/context.go +54 -15
  62. package/engine/internal/lib/cursor_compat_test.go +8 -0
  63. package/engine/internal/lib/extensions.go +2 -3
  64. package/engine/internal/lib/gitauthority.go +601 -0
  65. package/engine/internal/lib/gitauthority_test.go +346 -0
  66. package/engine/internal/lib/jsonout.go +25 -11
  67. package/engine/internal/lib/jsonout_test.go +16 -0
  68. package/engine/internal/lib/lanes.go +14 -8
  69. package/engine/internal/lib/observability_test.go +358 -0
  70. package/engine/internal/lib/packageexistence.go +151 -35
  71. package/engine/internal/lib/packageexistence_test.go +163 -0
  72. package/engine/internal/lib/progress.go +11 -9
  73. package/engine/internal/lib/provenance.go +462 -0
  74. package/engine/internal/lib/provenance_test.go +154 -0
  75. package/engine/internal/lib/readiness_contract.json +118 -0
  76. package/engine/internal/lib/readinessartifact.go +533 -0
  77. package/engine/internal/lib/readinessartifact_test.go +422 -0
  78. package/engine/internal/lib/reconcile.go +712 -88
  79. package/engine/internal/lib/reconcile_test.go +335 -16
  80. package/engine/internal/lib/recoveryattempts.go +298 -0
  81. package/engine/internal/lib/recoveryattempts_test.go +215 -0
  82. package/engine/internal/lib/resolve.go +23 -19
  83. package/engine/internal/lib/runbook_context_test.go +20 -0
  84. package/engine/internal/lib/session.go +701 -9
  85. package/engine/internal/lib/session_test.go +80 -13
  86. package/engine/internal/lib/testintegrity.go +33 -37
  87. package/engine/internal/lib/testintegrity_test.go +63 -1
  88. package/engine/internal/migrate/migrate.go +81 -1
  89. package/engine/internal/migrate/migrate_test.go +22 -1
  90. package/engine/internal/reason/reason.go +180 -0
  91. package/engine/internal/reason/reason_test.go +35 -0
  92. package/engine/internal/rootfacts/facts.go +466 -0
  93. package/engine/internal/rootfacts/facts_test.go +306 -0
  94. package/engine/internal/safepath/safepath.go +55 -0
  95. package/engine/internal/safepath/safepath_test.go +69 -0
  96. package/engine/internal/safepath/safepath_windows_test.go +26 -0
  97. package/engine/internal/state/clarify_transition.go +165 -0
  98. package/engine/internal/state/clarify_transition_test.go +130 -0
  99. package/engine/internal/state/cmd/workflowmanifest/main.go +12 -8
  100. package/engine/internal/state/cursor.go +58 -0
  101. package/engine/internal/state/cursor_test.go +42 -1
  102. package/engine/internal/state/feature.go +35 -48
  103. package/engine/internal/state/schema.go +90 -37
  104. package/engine/internal/state/snapshot.go +18 -2
  105. package/engine/internal/state/state_test.go +187 -7
  106. package/engine/internal/state/status.go +48 -11
  107. package/engine/internal/state/workflow_manifest.json +231 -50
  108. package/engine/internal/toolpolicy/classifier.go +533 -0
  109. package/engine/internal/toolpolicy/classifier_test.go +424 -0
  110. package/engine/internal/toolpolicy/git.go +616 -0
  111. package/engine/internal/toolpolicy/scanner.go +382 -0
  112. package/engine/main.go +160 -77
  113. package/engine/observability_cli_test.go +52 -0
  114. package/engine/root_routing_test.go +277 -0
  115. package/engine/testdata/golden/TestParityBuildReadiness/arg=approved.golden +1 -1
  116. package/engine/testdata/golden/TestParityBuildReadiness/arg=emptystatus.golden +1 -1
  117. package/engine/testdata/golden/TestParityBuildReadiness/arg=legacycontract.golden +1 -0
  118. package/engine/testdata/golden/TestParityBuildReadiness/arg=noclarify.golden +1 -0
  119. package/engine/testdata/golden/TestParityBuildReadiness/arg=novet.golden +1 -0
  120. package/engine/testdata/golden/TestParityBuildReadiness/arg=stalevet.golden +1 -0
  121. package/engine/testdata/golden/TestParityBuildReadiness/arg=trailhash.golden +1 -1
  122. package/engine/testdata/golden/TestParityBuildReadiness/arg=trailpipe.golden +1 -1
  123. package/engine/testdata/golden/TestParityBuildReadiness/arg=vetnotready.golden +1 -0
  124. package/engine/testdata/golden/TestParityProgress/arg=allbuilt.golden +1 -1
  125. package/engine/testdata/golden/TestParityProgress/arg=done.golden +1 -1
  126. package/engine/testdata/golden/TestParityProgress/arg=mid.golden +1 -1
  127. package/engine/testdata/golden/TestParityProgress/arg=nophase.golden +1 -1
  128. package/engine/testdata/golden/TestParityProgress/arg=noslice.golden +1 -1
  129. package/engine/testdata/golden/TestParityProgress/arg=plan.golden +1 -1
  130. package/engine/testdata/golden/TestParityProgress/arg=seal.golden +1 -1
  131. package/engine/testdata/golden/TestParityReconcile/check-clean.golden +1 -1
  132. package/engine/testdata/golden/TestParityReconcile/inline-fallback.golden +1 -0
  133. package/engine/testdata/golden/TestParityReconcile/snapshot-no-allowlist.golden +1 -0
  134. package/engine/testdata/golden/TestParityWrightScope/devrites-edit-denied.golden +2 -0
  135. package/engine/testdata/golden/TestParityWrightScope/out-of-scope-enforce-denies.golden +1 -1
  136. package/engine/tests/adr_0011_define_plan_test.go +30 -0
  137. package/engine/tests/budget_test.go +19 -8
  138. package/engine/tests/concurrency_cli_test.go +7 -1
  139. package/engine/tests/doctor_cli_test.go +148 -2
  140. package/engine/tests/forge_cli_test.go +463 -0
  141. package/engine/tests/gate_test.go +63 -8
  142. package/engine/tests/hook_test.go +260 -8
  143. package/engine/tests/hooks_io_test.go +94 -3
  144. package/engine/tests/json_contract_test.go +127 -2
  145. package/engine/tests/migrate_cli_test.go +2 -2
  146. package/engine/tests/parity_buildreadiness_test.go +167 -10
  147. package/engine/tests/parity_learnings_test.go +16 -17
  148. package/engine/tests/parity_reconcile_test.go +20 -17
  149. package/engine/tests/parity_resolve_test.go +12 -11
  150. package/engine/tests/parity_test.go +21 -17
  151. package/pack/.claude/agents/devrites-code-reviewer.md +62 -48
  152. package/pack/.claude/agents/devrites-devex-reviewer.md +69 -53
  153. package/pack/.claude/agents/devrites-doubt-reviewer.md +29 -22
  154. package/pack/.claude/agents/devrites-evidence-scout.md +69 -0
  155. package/pack/.claude/agents/devrites-forge-judge.md +74 -61
  156. package/pack/.claude/agents/devrites-frontend-reviewer.md +48 -39
  157. package/pack/.claude/agents/devrites-performance-reviewer.md +49 -40
  158. package/pack/.claude/agents/devrites-plan-drafter.md +73 -0
  159. package/pack/.claude/agents/devrites-plan-reviewer.md +80 -47
  160. package/pack/.claude/agents/devrites-proof-runner.md +74 -0
  161. package/pack/.claude/agents/devrites-retrospector.md +48 -45
  162. package/pack/.claude/agents/devrites-security-auditor.md +46 -36
  163. package/pack/.claude/agents/devrites-simplifier-reviewer.md +50 -46
  164. package/pack/.claude/agents/devrites-slice-wright.md +153 -165
  165. package/pack/.claude/agents/devrites-spec-reviewer.md +34 -32
  166. package/pack/.claude/agents/devrites-strategy-reviewer.md +63 -34
  167. package/pack/.claude/agents/devrites-test-analyst.md +40 -30
  168. package/pack/.claude/agents/devrites-upgrade-planner.md +100 -0
  169. package/pack/.claude/settings.json +2 -1
  170. package/pack/.claude/skills/devrites-audit/SKILL.md +40 -61
  171. package/pack/.claude/skills/devrites-debug-recovery/SKILL.md +24 -13
  172. package/pack/.claude/skills/devrites-debug-recovery/reference/build-the-loop.md +24 -21
  173. package/pack/.claude/skills/devrites-debug-recovery/reference/cleanup-and-classify.md +34 -6
  174. package/pack/.claude/skills/devrites-debug-recovery/reference/instrumentation.md +2 -2
  175. package/pack/.claude/skills/devrites-doubt/SKILL.md +25 -17
  176. package/pack/.claude/skills/devrites-interview/SKILL.md +53 -52
  177. package/pack/.claude/skills/devrites-lib/SKILL.md +12 -9
  178. package/pack/.claude/skills/devrites-lib/reference/intent-map.md +4 -2
  179. package/pack/.claude/skills/devrites-lib/reference/parallel-dispatch.md +82 -137
  180. package/pack/.claude/skills/devrites-lib/reference/reply-contract.md +8 -1
  181. package/pack/.claude/skills/devrites-lib/reference/standards/README.md +38 -55
  182. package/pack/.claude/skills/devrites-lib/reference/standards/afk-hitl.md +53 -27
  183. package/pack/.claude/skills/devrites-lib/reference/standards/agents.md +200 -190
  184. package/pack/.claude/skills/devrites-lib/reference/standards/anti-patterns.md +5 -15
  185. package/pack/.claude/skills/devrites-lib/reference/standards/ci-cd.md +27 -58
  186. package/pack/.claude/skills/devrites-lib/reference/standards/code-review.md +16 -52
  187. package/pack/.claude/skills/devrites-lib/reference/standards/coding-style.md +2 -10
  188. package/pack/.claude/skills/devrites-lib/reference/standards/context-hygiene.md +18 -61
  189. package/pack/.claude/skills/devrites-lib/reference/standards/core.md +23 -18
  190. package/pack/.claude/skills/devrites-lib/reference/standards/deprecation.md +17 -57
  191. package/pack/.claude/skills/devrites-lib/reference/standards/development-workflow.md +4 -33
  192. package/pack/.claude/skills/devrites-lib/reference/standards/git-workflow.md +4 -20
  193. package/pack/.claude/skills/devrites-lib/reference/standards/hooks.md +3 -14
  194. package/pack/.claude/skills/devrites-lib/reference/standards/patterns.md +9 -25
  195. package/pack/.claude/skills/devrites-lib/reference/standards/performance.md +0 -9
  196. package/pack/.claude/skills/devrites-lib/reference/standards/principles.md +1 -3
  197. package/pack/.claude/skills/devrites-lib/reference/standards/security.md +17 -7
  198. package/pack/.claude/skills/devrites-lib/reference/standards/testing.md +1 -27
  199. package/pack/.claude/skills/devrites-lib/reference/standards/tooling.md +46 -50
  200. package/pack/.claude/skills/devrites-lib/reference/workspace-artifact-schema.md +40 -10
  201. package/pack/.claude/skills/devrites-source-driven/SKILL.md +23 -22
  202. package/pack/.claude/skills/rite/SKILL.md +10 -6
  203. package/pack/.claude/skills/rite/reference/menu.md +13 -7
  204. package/pack/.claude/skills/rite-adopt/SKILL.md +33 -37
  205. package/pack/.claude/skills/rite-autocomplete/SKILL.md +33 -28
  206. package/pack/.claude/skills/rite-autocomplete/reference/loop.md +21 -21
  207. package/pack/.claude/skills/rite-autocomplete/reference/stop-conditions.md +15 -6
  208. package/pack/.claude/skills/rite-build/SKILL.md +35 -30
  209. package/pack/.claude/skills/rite-build/reference/afk-discipline.md +41 -39
  210. package/pack/.claude/skills/rite-build/reference/evidence-standard.md +10 -0
  211. package/pack/.claude/skills/rite-build/reference/forge.md +186 -156
  212. package/pack/.claude/skills/rite-build/reference/one-slice-cycle.md +4 -3
  213. package/pack/.claude/skills/rite-build/reference/phase-contract.md +96 -175
  214. package/pack/.claude/skills/rite-build/reference/spec-drift-guard.md +10 -4
  215. package/pack/.claude/skills/rite-build/reference/wright-dispatch.md +129 -134
  216. package/pack/.claude/skills/rite-clarify/SKILL.md +90 -0
  217. package/pack/.claude/skills/rite-clarify/reference/decision-coverage.md +61 -0
  218. package/pack/.claude/skills/rite-converge/SKILL.md +35 -25
  219. package/pack/.claude/skills/rite-define/SKILL.md +58 -32
  220. package/pack/.claude/skills/rite-define/reference/gates.md +16 -15
  221. package/pack/.claude/skills/rite-define/reference/plan-template.md +18 -8
  222. package/pack/.claude/skills/rite-frame/reference/failure-modes.md +22 -24
  223. package/pack/.claude/skills/rite-plan/SKILL.md +47 -16
  224. package/pack/.claude/skills/rite-plan/reference/task-breakdown.md +4 -0
  225. package/pack/.claude/skills/rite-polish/SKILL.md +27 -23
  226. package/pack/.claude/skills/rite-prototype/SKILL.md +25 -26
  227. package/pack/.claude/skills/rite-prove/SKILL.md +27 -17
  228. package/pack/.claude/skills/rite-resolve/SKILL.md +12 -11
  229. package/pack/.claude/skills/rite-resolve/reference/answer-protocol.md +3 -0
  230. package/pack/.claude/skills/rite-review/SKILL.md +37 -28
  231. package/pack/.claude/skills/rite-seal/reference/phase-contract.md +27 -92
  232. package/pack/.claude/skills/rite-seal/reference/risk-and-rollback.md +13 -0
  233. package/pack/.claude/skills/rite-ship/reference/design-memory.md +31 -36
  234. package/pack/.claude/skills/rite-spec/SKILL.md +84 -135
  235. package/pack/.claude/skills/rite-spec/reference/investigation.md +37 -33
  236. package/pack/.claude/skills/rite-spec/reference/question-protocol.md +6 -2
  237. package/pack/.claude/skills/rite-spec/reference/spec-checklists.md +25 -24
  238. package/pack/.claude/skills/rite-spec/reference/spec-template.md +9 -2
  239. package/pack/.claude/skills/rite-spec/reference/state-workspace.md +13 -3
  240. package/pack/.claude/skills/rite-temper/SKILL.md +62 -47
  241. package/pack/.claude/skills/rite-temper/reference/review-dimensions.md +24 -22
  242. package/pack/.claude/skills/rite-upgrade/SKILL.md +125 -0
  243. package/pack/.claude/skills/rite-vet/SKILL.md +114 -113
  244. package/pack/.claude/skills/rite-vet/reference/artifacts.md +50 -9
  245. package/pack/.claude/skills/rite-vet/reference/review-axes.md +39 -37
  246. package/pack/generated/claude/agents/devrites-code-reviewer.md +62 -48
  247. package/pack/generated/claude/agents/devrites-devex-reviewer.md +69 -53
  248. package/pack/generated/claude/agents/devrites-doubt-reviewer.md +29 -22
  249. package/pack/generated/claude/agents/devrites-evidence-scout.md +69 -0
  250. package/pack/generated/claude/agents/devrites-forge-judge.md +74 -61
  251. package/pack/generated/claude/agents/devrites-frontend-reviewer.md +48 -39
  252. package/pack/generated/claude/agents/devrites-performance-reviewer.md +49 -40
  253. package/pack/generated/claude/agents/devrites-plan-drafter.md +73 -0
  254. package/pack/generated/claude/agents/devrites-plan-reviewer.md +80 -47
  255. package/pack/generated/claude/agents/devrites-proof-runner.md +74 -0
  256. package/pack/generated/claude/agents/devrites-retrospector.md +48 -45
  257. package/pack/generated/claude/agents/devrites-security-auditor.md +46 -36
  258. package/pack/generated/claude/agents/devrites-simplifier-reviewer.md +50 -46
  259. package/pack/generated/claude/agents/devrites-slice-wright.md +153 -165
  260. package/pack/generated/claude/agents/devrites-spec-reviewer.md +34 -32
  261. package/pack/generated/claude/agents/devrites-strategy-reviewer.md +63 -34
  262. package/pack/generated/claude/agents/devrites-test-analyst.md +40 -30
  263. package/pack/generated/claude/agents/devrites-upgrade-planner.md +100 -0
  264. package/pack/generated/claude/settings.json +2 -1
  265. package/pack/generated/claude/skills/devrites-audit/SKILL.md +40 -61
  266. package/pack/generated/claude/skills/devrites-debug-recovery/SKILL.md +24 -13
  267. package/pack/generated/claude/skills/devrites-debug-recovery/reference/build-the-loop.md +24 -21
  268. package/pack/generated/claude/skills/devrites-debug-recovery/reference/cleanup-and-classify.md +34 -6
  269. package/pack/generated/claude/skills/devrites-debug-recovery/reference/instrumentation.md +2 -2
  270. package/pack/generated/claude/skills/devrites-doubt/SKILL.md +25 -17
  271. package/pack/generated/claude/skills/devrites-interview/SKILL.md +53 -52
  272. package/pack/generated/claude/skills/devrites-lib/SKILL.md +12 -9
  273. package/pack/generated/claude/skills/devrites-lib/reference/intent-map.md +4 -2
  274. package/pack/generated/claude/skills/devrites-lib/reference/parallel-dispatch.md +82 -137
  275. package/pack/generated/claude/skills/devrites-lib/reference/reply-contract.md +8 -1
  276. package/pack/generated/claude/skills/devrites-lib/reference/standards/README.md +38 -55
  277. package/pack/generated/claude/skills/devrites-lib/reference/standards/afk-hitl.md +53 -27
  278. package/pack/generated/claude/skills/devrites-lib/reference/standards/agents.md +200 -190
  279. package/pack/generated/claude/skills/devrites-lib/reference/standards/anti-patterns.md +5 -15
  280. package/pack/generated/claude/skills/devrites-lib/reference/standards/ci-cd.md +27 -58
  281. package/pack/generated/claude/skills/devrites-lib/reference/standards/code-review.md +16 -52
  282. package/pack/generated/claude/skills/devrites-lib/reference/standards/coding-style.md +2 -10
  283. package/pack/generated/claude/skills/devrites-lib/reference/standards/context-hygiene.md +18 -61
  284. package/pack/generated/claude/skills/devrites-lib/reference/standards/core.md +23 -18
  285. package/pack/generated/claude/skills/devrites-lib/reference/standards/deprecation.md +17 -57
  286. package/pack/generated/claude/skills/devrites-lib/reference/standards/development-workflow.md +4 -33
  287. package/pack/generated/claude/skills/devrites-lib/reference/standards/git-workflow.md +4 -20
  288. package/pack/generated/claude/skills/devrites-lib/reference/standards/hooks.md +3 -14
  289. package/pack/generated/claude/skills/devrites-lib/reference/standards/patterns.md +9 -25
  290. package/pack/generated/claude/skills/devrites-lib/reference/standards/performance.md +0 -9
  291. package/pack/generated/claude/skills/devrites-lib/reference/standards/principles.md +1 -3
  292. package/pack/generated/claude/skills/devrites-lib/reference/standards/security.md +17 -7
  293. package/pack/generated/claude/skills/devrites-lib/reference/standards/testing.md +1 -27
  294. package/pack/generated/claude/skills/devrites-lib/reference/standards/tooling.md +46 -50
  295. package/pack/generated/claude/skills/devrites-lib/reference/workspace-artifact-schema.md +40 -10
  296. package/pack/generated/claude/skills/devrites-source-driven/SKILL.md +23 -22
  297. package/pack/generated/claude/skills/rite/SKILL.md +10 -6
  298. package/pack/generated/claude/skills/rite/reference/menu.md +13 -7
  299. package/pack/generated/claude/skills/rite-adopt/SKILL.md +33 -37
  300. package/pack/generated/claude/skills/rite-autocomplete/SKILL.md +33 -28
  301. package/pack/generated/claude/skills/rite-autocomplete/reference/loop.md +21 -21
  302. package/pack/generated/claude/skills/rite-autocomplete/reference/stop-conditions.md +15 -6
  303. package/pack/generated/claude/skills/rite-build/SKILL.md +35 -30
  304. package/pack/generated/claude/skills/rite-build/reference/afk-discipline.md +41 -39
  305. package/pack/generated/claude/skills/rite-build/reference/evidence-standard.md +10 -0
  306. package/pack/generated/claude/skills/rite-build/reference/forge.md +186 -156
  307. package/pack/generated/claude/skills/rite-build/reference/one-slice-cycle.md +4 -3
  308. package/pack/generated/claude/skills/rite-build/reference/phase-contract.md +96 -175
  309. package/pack/generated/claude/skills/rite-build/reference/spec-drift-guard.md +10 -4
  310. package/pack/generated/claude/skills/rite-build/reference/wright-dispatch.md +129 -134
  311. package/pack/generated/claude/skills/rite-clarify/SKILL.md +90 -0
  312. package/pack/generated/claude/skills/rite-clarify/reference/decision-coverage.md +61 -0
  313. package/pack/generated/claude/skills/rite-converge/SKILL.md +35 -25
  314. package/pack/generated/claude/skills/rite-define/SKILL.md +58 -32
  315. package/pack/generated/claude/skills/rite-define/reference/gates.md +16 -15
  316. package/pack/generated/claude/skills/rite-define/reference/plan-template.md +18 -8
  317. package/pack/generated/claude/skills/rite-frame/reference/failure-modes.md +22 -24
  318. package/pack/generated/claude/skills/rite-plan/SKILL.md +47 -16
  319. package/pack/generated/claude/skills/rite-plan/reference/task-breakdown.md +4 -0
  320. package/pack/generated/claude/skills/rite-polish/SKILL.md +27 -23
  321. package/pack/generated/claude/skills/rite-prototype/SKILL.md +25 -26
  322. package/pack/generated/claude/skills/rite-prove/SKILL.md +27 -17
  323. package/pack/generated/claude/skills/rite-resolve/SKILL.md +12 -11
  324. package/pack/generated/claude/skills/rite-resolve/reference/answer-protocol.md +3 -0
  325. package/pack/generated/claude/skills/rite-review/SKILL.md +37 -28
  326. package/pack/generated/claude/skills/rite-seal/reference/phase-contract.md +27 -92
  327. package/pack/generated/claude/skills/rite-seal/reference/risk-and-rollback.md +13 -0
  328. package/pack/generated/claude/skills/rite-ship/reference/design-memory.md +31 -36
  329. package/pack/generated/claude/skills/rite-spec/SKILL.md +84 -135
  330. package/pack/generated/claude/skills/rite-spec/reference/investigation.md +37 -33
  331. package/pack/generated/claude/skills/rite-spec/reference/question-protocol.md +6 -2
  332. package/pack/generated/claude/skills/rite-spec/reference/spec-checklists.md +25 -24
  333. package/pack/generated/claude/skills/rite-spec/reference/spec-template.md +9 -2
  334. package/pack/generated/claude/skills/rite-spec/reference/state-workspace.md +13 -3
  335. package/pack/generated/claude/skills/rite-temper/SKILL.md +62 -47
  336. package/pack/generated/claude/skills/rite-temper/reference/review-dimensions.md +24 -22
  337. package/pack/generated/claude/skills/rite-upgrade/SKILL.md +125 -0
  338. package/pack/generated/claude/skills/rite-vet/SKILL.md +114 -113
  339. package/pack/generated/claude/skills/rite-vet/reference/artifacts.md +50 -9
  340. package/pack/generated/claude/skills/rite-vet/reference/review-axes.md +39 -37
  341. package/pack/generated/codex/AGENTS.md +5 -2
  342. package/pack/generated/codex/agents/devrites-code-reviewer.toml +69 -47
  343. package/pack/generated/codex/agents/devrites-devex-reviewer.toml +75 -51
  344. package/pack/generated/codex/agents/devrites-doubt-reviewer.toml +35 -20
  345. package/pack/generated/codex/agents/devrites-evidence-scout.toml +75 -0
  346. package/pack/generated/codex/agents/devrites-forge-judge.toml +80 -59
  347. package/pack/generated/codex/agents/devrites-frontend-reviewer.toml +54 -37
  348. package/pack/generated/codex/agents/devrites-performance-reviewer.toml +55 -38
  349. package/pack/generated/codex/agents/devrites-plan-drafter.toml +79 -0
  350. package/pack/generated/codex/agents/devrites-plan-reviewer.toml +82 -47
  351. package/pack/generated/codex/agents/devrites-proof-runner.toml +80 -0
  352. package/pack/generated/codex/agents/devrites-retrospector.toml +54 -43
  353. package/pack/generated/codex/agents/devrites-security-auditor.toml +53 -35
  354. package/pack/generated/codex/agents/devrites-simplifier-reviewer.toml +56 -44
  355. package/pack/generated/codex/agents/devrites-slice-wright.toml +159 -163
  356. package/pack/generated/codex/agents/devrites-spec-reviewer.toml +40 -30
  357. package/pack/generated/codex/agents/devrites-strategy-reviewer.toml +65 -34
  358. package/pack/generated/codex/agents/devrites-test-analyst.toml +46 -28
  359. package/pack/generated/codex/agents/devrites-upgrade-planner.toml +106 -0
  360. package/pack/generated/codex/hooks.json +4 -14
  361. package/pack/generated/codex/skills/devrites-api-interface/SKILL.md +7 -3
  362. package/pack/generated/codex/skills/devrites-audit/SKILL.md +47 -64
  363. package/pack/generated/codex/skills/devrites-browser-proof/SKILL.md +7 -3
  364. package/pack/generated/codex/skills/devrites-debug-recovery/SKILL.md +31 -16
  365. package/pack/generated/codex/skills/devrites-debug-recovery/reference/build-the-loop.md +24 -21
  366. package/pack/generated/codex/skills/devrites-debug-recovery/reference/cleanup-and-classify.md +34 -6
  367. package/pack/generated/codex/skills/devrites-debug-recovery/reference/instrumentation.md +2 -2
  368. package/pack/generated/codex/skills/devrites-doubt/SKILL.md +32 -20
  369. package/pack/generated/codex/skills/devrites-frontend-craft/SKILL.md +7 -3
  370. package/pack/generated/codex/skills/devrites-interview/SKILL.md +60 -55
  371. package/pack/generated/codex/skills/devrites-lib/SKILL.md +19 -12
  372. package/pack/generated/codex/skills/devrites-lib/reference/intent-map.md +4 -2
  373. package/pack/generated/codex/skills/devrites-lib/reference/parallel-dispatch.md +82 -137
  374. package/pack/generated/codex/skills/devrites-lib/reference/reply-contract.md +8 -1
  375. package/pack/generated/codex/skills/devrites-lib/reference/standards/README.md +38 -55
  376. package/pack/generated/codex/skills/devrites-lib/reference/standards/afk-hitl.md +53 -27
  377. package/pack/generated/codex/skills/devrites-lib/reference/standards/agents.md +200 -190
  378. package/pack/generated/codex/skills/devrites-lib/reference/standards/anti-patterns.md +5 -15
  379. package/pack/generated/codex/skills/devrites-lib/reference/standards/ci-cd.md +27 -58
  380. package/pack/generated/codex/skills/devrites-lib/reference/standards/code-review.md +16 -52
  381. package/pack/generated/codex/skills/devrites-lib/reference/standards/coding-style.md +2 -10
  382. package/pack/generated/codex/skills/devrites-lib/reference/standards/context-hygiene.md +18 -61
  383. package/pack/generated/codex/skills/devrites-lib/reference/standards/core.md +23 -18
  384. package/pack/generated/codex/skills/devrites-lib/reference/standards/deprecation.md +17 -57
  385. package/pack/generated/codex/skills/devrites-lib/reference/standards/development-workflow.md +4 -33
  386. package/pack/generated/codex/skills/devrites-lib/reference/standards/git-workflow.md +4 -20
  387. package/pack/generated/codex/skills/devrites-lib/reference/standards/hooks.md +3 -14
  388. package/pack/generated/codex/skills/devrites-lib/reference/standards/patterns.md +9 -25
  389. package/pack/generated/codex/skills/devrites-lib/reference/standards/performance.md +0 -9
  390. package/pack/generated/codex/skills/devrites-lib/reference/standards/principles.md +1 -3
  391. package/pack/generated/codex/skills/devrites-lib/reference/standards/security.md +17 -7
  392. package/pack/generated/codex/skills/devrites-lib/reference/standards/testing.md +1 -27
  393. package/pack/generated/codex/skills/devrites-lib/reference/standards/tooling.md +46 -50
  394. package/pack/generated/codex/skills/devrites-lib/reference/workspace-artifact-schema.md +40 -10
  395. package/pack/generated/codex/skills/devrites-prose-craft/SKILL.md +7 -3
  396. package/pack/generated/codex/skills/devrites-refresh-indexes/SKILL.md +7 -3
  397. package/pack/generated/codex/skills/devrites-source-driven/SKILL.md +29 -24
  398. package/pack/generated/codex/skills/devrites-ux-shape/SKILL.md +7 -3
  399. package/pack/generated/codex/skills/rite/SKILL.md +21 -13
  400. package/pack/generated/codex/skills/rite/reference/menu.md +13 -7
  401. package/pack/generated/codex/skills/rite-adopt/SKILL.md +40 -40
  402. package/pack/generated/codex/skills/rite-autocomplete/SKILL.md +40 -31
  403. package/pack/generated/codex/skills/rite-autocomplete/reference/loop.md +21 -21
  404. package/pack/generated/codex/skills/rite-autocomplete/reference/stop-conditions.md +15 -6
  405. package/pack/generated/codex/skills/rite-build/SKILL.md +42 -33
  406. package/pack/generated/codex/skills/rite-build/reference/afk-discipline.md +41 -39
  407. package/pack/generated/codex/skills/rite-build/reference/evidence-standard.md +10 -0
  408. package/pack/generated/codex/skills/rite-build/reference/forge.md +186 -156
  409. package/pack/generated/codex/skills/rite-build/reference/one-slice-cycle.md +4 -3
  410. package/pack/generated/codex/skills/rite-build/reference/phase-contract.md +96 -175
  411. package/pack/generated/codex/skills/rite-build/reference/spec-drift-guard.md +10 -4
  412. package/pack/generated/codex/skills/rite-build/reference/wright-dispatch.md +129 -134
  413. package/pack/generated/codex/skills/rite-clarify/SKILL.md +106 -0
  414. package/pack/generated/codex/skills/rite-clarify/reference/decision-coverage.md +61 -0
  415. package/pack/generated/codex/skills/rite-converge/SKILL.md +42 -28
  416. package/pack/generated/codex/skills/rite-customize/SKILL.md +7 -3
  417. package/pack/generated/codex/skills/rite-define/SKILL.md +65 -35
  418. package/pack/generated/codex/skills/rite-define/reference/gates.md +16 -15
  419. package/pack/generated/codex/skills/rite-define/reference/plan-template.md +18 -8
  420. package/pack/generated/codex/skills/rite-doctor/SKILL.md +7 -3
  421. package/pack/generated/codex/skills/rite-dogfood/SKILL.md +7 -3
  422. package/pack/generated/codex/skills/rite-explain/SKILL.md +7 -3
  423. package/pack/generated/codex/skills/rite-frame/SKILL.md +7 -3
  424. package/pack/generated/codex/skills/rite-frame/reference/failure-modes.md +22 -24
  425. package/pack/generated/codex/skills/rite-handoff/SKILL.md +7 -3
  426. package/pack/generated/codex/skills/rite-learn/SKILL.md +7 -3
  427. package/pack/generated/codex/skills/rite-plan/SKILL.md +54 -19
  428. package/pack/generated/codex/skills/rite-plan/reference/task-breakdown.md +5 -1
  429. package/pack/generated/codex/skills/rite-polish/SKILL.md +34 -26
  430. package/pack/generated/codex/skills/rite-pov/SKILL.md +7 -3
  431. package/pack/generated/codex/skills/rite-pr-feedback/SKILL.md +7 -3
  432. package/pack/generated/codex/skills/rite-pressure-test/SKILL.md +7 -3
  433. package/pack/generated/codex/skills/rite-prototype/SKILL.md +32 -29
  434. package/pack/generated/codex/skills/rite-prove/SKILL.md +34 -20
  435. package/pack/generated/codex/skills/rite-quick/SKILL.md +7 -3
  436. package/pack/generated/codex/skills/rite-resolve/SKILL.md +19 -14
  437. package/pack/generated/codex/skills/rite-resolve/reference/answer-protocol.md +3 -0
  438. package/pack/generated/codex/skills/rite-review/SKILL.md +44 -31
  439. package/pack/generated/codex/skills/rite-seal/SKILL.md +7 -3
  440. package/pack/generated/codex/skills/rite-seal/reference/phase-contract.md +27 -92
  441. package/pack/generated/codex/skills/rite-seal/reference/risk-and-rollback.md +13 -0
  442. package/pack/generated/codex/skills/rite-ship/SKILL.md +7 -3
  443. package/pack/generated/codex/skills/rite-ship/reference/design-memory.md +31 -36
  444. package/pack/generated/codex/skills/rite-spec/SKILL.md +91 -138
  445. package/pack/generated/codex/skills/rite-spec/reference/investigation.md +37 -33
  446. package/pack/generated/codex/skills/rite-spec/reference/question-protocol.md +6 -2
  447. package/pack/generated/codex/skills/rite-spec/reference/spec-checklists.md +25 -24
  448. package/pack/generated/codex/skills/rite-spec/reference/spec-template.md +9 -2
  449. package/pack/generated/codex/skills/rite-spec/reference/state-workspace.md +13 -3
  450. package/pack/generated/codex/skills/rite-status/SKILL.md +7 -3
  451. package/pack/generated/codex/skills/rite-temper/SKILL.md +69 -50
  452. package/pack/generated/codex/skills/rite-temper/reference/review-dimensions.md +24 -22
  453. package/pack/generated/codex/skills/rite-upgrade/SKILL.md +141 -0
  454. package/pack/generated/codex/skills/rite-upgrade/agents/openai.yaml +2 -0
  455. package/pack/generated/codex/skills/rite-vet/SKILL.md +121 -116
  456. package/pack/generated/codex/skills/rite-vet/reference/artifacts.md +50 -9
  457. package/pack/generated/codex/skills/rite-vet/reference/review-axes.md +40 -38
  458. package/pack/generated/codex/skills/rite-zoom-out/SKILL.md +7 -3
  459. package/package.json +1 -1
  460. package/scripts/build-release-tarball.sh +32 -15
  461. package/scripts/check-authority-drift.py +125 -0
  462. package/scripts/check-instruction-size-baseline.mjs +19 -11
  463. package/scripts/check-invocation-integrity.py +2 -0
  464. package/scripts/codex-generate.sh +69 -33
  465. package/scripts/grade-feature.sh +121 -40
  466. package/scripts/live-hosts/agent-result.schema.json +230 -0
  467. package/scripts/live-hosts/claude.sh +87 -0
  468. package/scripts/live-hosts/codex.sh +81 -0
  469. package/scripts/live-hosts/common.sh +113 -0
  470. package/scripts/live-hosts/fake-host.py +264 -0
  471. package/scripts/live-hosts/host-transport.py +287 -0
  472. package/scripts/release-check.sh +5 -1
  473. package/scripts/run-agent-contract-evals.py +1380 -0
  474. package/scripts/run-behavioral-evals.sh +24 -30
  475. package/scripts/run-evals.sh +1 -5
  476. package/scripts/run-live-behavioral-evals.py +1274 -144
  477. package/scripts/run-outcome-evals.sh +445 -88
  478. package/scripts/run-tests.mjs +30 -2
  479. package/scripts/skills-inventory.mjs +1 -1
  480. package/scripts/validate-workflow-security.py +39 -20
  481. package/scripts/validate-workspace-schema.py +362 -10
  482. package/scripts/validate.sh +21 -15
  483. package/engine/testdata/golden/TestParityWrightScope/devrites-edit-allowed.golden +0 -1
  484. /package/engine/testdata/golden/{TestParityReconcile/check-no-claimed.golden → TestParityBuildReadiness/arg=clarifyopen.golden} +0 -0
@@ -1,165 +1,110 @@
1
1
  # Parallel review dispatch
2
2
 
3
- How `/rite-review` and `/rite-seal` fan out the fresh-context review subagents under
4
- `.claude/agents/`. The **single source** for the dispatch + reconciliation contract: loaded on
5
- demand by the calling skill (each points here); not a skill itself.
3
+ This file defines reviewer rosters for `/rite-review` and `/rite-seal`. The shared
4
+ packet, result, capability ladder, concurrency limit, retry, and reconciliation rules live in
5
+ [`standards/agents.md`](standards/agents.md); do not restate them here.
6
6
 
7
- The seal/review fan-out **roster** is the seven post-build reviewers in the table below. This
8
- file is the single source of which reviewer fires when. The seal and the multi-axis review need
9
- them running **at the same time**, on the same workspace + diff, so the verdicts don't
10
- contaminate each other. Every other agent under `.claude/agents/` fires from its own phase, not
11
- here: the roster table below names them under **Not in this fan-out** so the set is unambiguous.
7
+ All reviewers read the same **immutable candidate**, but no more than three run
8
+ concurrently. For a larger panel, use awaited batches of at most three; after resource
9
+ or process errors, reduce the batch or run serially. A batch boundary does not permit a
10
+ write.
12
11
 
13
- Pattern: delegate to specialized agents with isolated context, brief each one precisely, run
14
- them concurrently, reconcile on return.
12
+ ## Roster
15
13
 
16
- ## The roster: every reviewer the fan-out accounts for
14
+ `/rite-seal` accounts for all seven roles. `/rite-review` runs the first two.
15
+ Conditional triggers use the listed signals.
17
16
 
18
- These seven are the **roster**. `/rite-seal` accounts for **all** of them: the always-on three
19
- plus each conditional, either dispatched or skip-recorded; `/rite-review` runs the two always-on
20
- axes. Each trigger is a *checkable signal*, not a judgement call, so a conditional reviewer is
21
- either fired or consciously skipped: never silently dropped.
22
-
23
- | Reviewer | Fires | Trigger: the checkable signal |
17
+ | Reviewer | Fires | Trigger |
24
18
  |---|---|---|
25
- | `devrites-spec-reviewer` | always | `/rite-review` Spec axis; `/rite-seal` (carry review's verdict forward only if the diff is unchanged) |
26
- | `devrites-code-reviewer` | always | `/rite-review` Code-review axis; `/rite-seal` (carry forward only if the diff is unchanged) |
27
- | `devrites-test-analyst` | always | at `/rite-seal` |
28
- | `devrites-frontend-reviewer` | conditional | the diff touches a UI file: component / template / stylesheet, per the project's UI paths |
29
- | `devrites-security-auditor` | conditional | the diff touches input handling, auth / authz, data storage or access, an external integration, or a secret |
30
- | `devrites-performance-reviewer` | conditional | `spec.md` states a perf budget, **OR** the diff adds a query / a loop over a growing set / hot-path or render work |
31
- | `devrites-devex-reviewer` | conditional | the diff changes a developer-facing surface: public API, CLI, SDK/library export, webhook, config/env contract, error message, or getting-started path |
32
-
33
- ### Hit-rate gating: consult before dispatching conditionals
34
-
35
- Before dispatching, run `devrites-engine reviewer-stats report`. It grades each reviewer from the
36
- cross-feature dispatch ledger (`.devrites/reviewer-stats.jsonl`):
37
-
38
- - `run` / `run (always-on)` / `run (insurance — never gated)`: dispatch per the trigger table above.
39
- - `gate-candidate`: this **conditional** reviewer produced zero surviving findings in its last 10+
40
- dispatches on this project. Skip it as a *recorded* skip:
41
- `devrites-engine footprint log <slug> skip devrites-<x>-reviewer` with the reason
42
- `gated: zero surviving findings in <N> dispatches`. The roster gate stays satisfied: a gated
43
- skip is a conscious skip.
44
-
45
- The verdict is engine-owned and deterministic; never gate by your own judgement of a reviewer's
46
- past usefulness. Two hard bounds: the always-on axes (`spec`, `code-review`, `test-analyst`) and
47
- the insurance reviewers (`security-auditor`, `doubt-reviewer`) are **never** gated: the engine
48
- never grades them `gate-candidate`, and a caller must not skip them on hit-rate grounds. The user
49
- can override gating for one run by asking for a full panel (`--full`): then dispatch every
50
- triggered reviewer regardless of verdict.
51
-
52
- After reconciliation, close the loop: record each **dispatched** reviewer's outcome so the
53
- ledger stays live:
19
+ | `devrites-spec-reviewer` | always | review Spec axis; seal may carry it forward only on the identical candidate |
20
+ | `devrites-code-reviewer` | always | review Code-review axis; seal may carry it forward only on the identical candidate |
21
+ | `devrites-test-analyst` | always at seal | completed feature |
22
+ | `devrites-frontend-reviewer` | conditional | diff touches a component, template, stylesheet, story, route, screen, or design token |
23
+ | `devrites-security-auditor` | conditional | input, auth/authz, data access/storage, external integration, permission, dependency, or secret |
24
+ | `devrites-performance-reviewer` | conditional | spec has a performance budget, or diff adds a query, growing-set loop, render/hot-path work, or material payload |
25
+ | `devrites-devex-reviewer` | conditional | public API, CLI, SDK/export, webhook, config/env, error message, docs, or getting-started path |
54
26
 
55
- ```bash
56
- devrites-engine reviewer-stats record devrites-<x>-reviewer <surviving Critical+Important count> <slug>
57
- ```
27
+ Not in this roster: `devrites-simplifier-reviewer` (polish), `devrites-doubt-reviewer`
28
+ (doubt), `devrites-strategy-reviewer` (temper), `devrites-plan-reviewer` (vet),
29
+ `devrites-forge-judge` (build), and `devrites-retrospector` (ship).
58
30
 
59
- Surviving means it stood after reconciliation and dismissals: a finding the caller dismissed as a
60
- false positive does not count. Record `0` honestly; dry streaks are the signal.
31
+ ## Hit-rate gating
61
32
 
62
- **Not in this fan-out** (named so the roster is unambiguous): `devrites-simplifier-reviewer` fires
63
- at `/rite-polish` Phase 1 (via `devrites-audit simplify`) and `devrites-doubt-reviewer` fires from
64
- `devrites-doubt` when a decision is stood up: neither is a seal reviewer, so neither is part of
65
- the seal accounting. `devrites-strategy-reviewer` (pre-plan, `/rite-temper`), `devrites-plan-reviewer`
66
- (pre-build, `/rite-vet`), `devrites-forge-judge` (`/rite-build` forge), and `devrites-retrospector`
67
- (`/rite-ship` close) are single-agent, phase-locked gates. They fire iff their phase runs, not here.
33
+ Before conditionals, run:
68
34
 
69
- One entity, one name: the `devrites-code-reviewer`'s axis is the **Code-review axis** everywhere
70
- (at both `/rite-review` and `/rite-seal`): don't rename it per caller.
35
+ ```bash
36
+ devrites-engine reviewer-stats report
37
+ ```
71
38
 
72
- ## Dispatch shape
39
+ - `run`, `run (always-on)`, or `run (insurance — never gated)`: apply the roster.
40
+ - `gate-candidate`: a conditional produced zero surviving findings in its last 10+
41
+ dispatches. Record a skip with `gated: zero surviving findings in <N> dispatches`.
42
+ - `--full`: dispatch every triggered reviewer despite gating.
73
43
 
74
- For each chosen subagent, the caller uses the harness's subagent primitive (the `Task` tool on
75
- Claude Code, `spawn_agent` (with the matching `.codex/agents/devrites-*.toml` custom agent) on
76
- Codex) with this prompt shape:
44
+ Always-on reviewers and insurance reviewers (security and doubt) are never hit-rate
45
+ gated. After reconciliation, record each dispatched reviewer's surviving
46
+ Critical+Important count:
77
47
 
78
- ```
79
- Audit the active DevRites feature.
80
-
81
- Workspace: .devrites/work/<slug>/
82
- Read (yourself, fresh context):
83
- - spec.md (+ acceptance criteria)
84
- - touched-files.md
85
- - the git diff
86
- - <any axis-specific files: decisions.md, evidence.md, references/...>
87
-
88
- Before judging the diff, derive the expected behaviour from the spec
89
- yourself, then compare it against what the code does. Anchor every finding
90
- to file:line plus the spec criterion or command output that proves it —
91
- an unanchored finding is a Suggestion at most. The order or length of the
92
- diff is not evidence.
93
-
94
- Apply your documented discipline. Return labeled findings (Critical /
95
- Important / Suggestion / Nit / FYI) using your documented output format,
96
- ONE FINDING PER LINE, cite file:line.
97
-
98
- Feature scope only. No edits. Do not summarize or re-rank — the caller
99
- reconciles.
48
+ ```bash
49
+ devrites-engine reviewer-stats record devrites-<x>-reviewer <count> <slug>
100
50
  ```
101
51
 
102
- Rules:
103
-
104
- - **One Task call per subagent, awaited in the same turn.** Send them in a single message with multiple `Task` invocations so the runtime dispatches concurrently. Never background/detach reviewers in `/rite-autocomplete` or AFK; there is no event loop that guarantees a later result is reconciled.
105
- - **No cross-pollination.** Each subagent gets only its narrow brief and the workspace path. Do not pass another subagent's findings into a sibling's prompt, that recreates the masking problem.
106
- - **No author context.** Do not include the caller's analysis or the user's framing of the change; the point is a fresh, adversarial read.
107
- - **Never coach a reviewer.** No "do not flag X", "treat Y as at most Minor", or "the plan
108
- chose this" in a dispatch prompt: pre-judging findings is how a known defect sails through.
109
- A plan-mandated quirk still gets reported; the caller (or the human) grades it, not the prompt.
110
- - **Feature scope only.** Each subagent must stay inside `touched-files.md` + the diff.
111
- - **Can't-verify is a verdict, not a pass.** A reviewer that cannot verify a spec requirement
112
- from the diff + its allowed reads returns it as a `CANNOT-VERIFY: <requirement> — <why>` line.
113
- The caller resolves each one itself before the gate; an unresolved CANNOT-VERIFY on an
114
- acceptance-mapped requirement stands as a gap, not a pass.
52
+ ## Reviewer packet
53
+
54
+ Create `agent-packet/v1` per `standards/agents.md`. In addition to the common fields:
55
+
56
+ ```yaml
57
+ objective: Audit the active feature on <axis>; derive expected behavior independently.
58
+ inputs:
59
+ - path: .devrites/work/<slug>/spec.md
60
+ purpose: acceptance contract
61
+ - path: .devrites/work/<slug>/touched-files.md
62
+ purpose: feature boundary
63
+ - path: <scratch_root>/candidate.diff
64
+ purpose: reviewed candidate
65
+ scope:
66
+ in: [<axis-specific workspace paths>, <touched source/test paths>]
67
+ out: [author reasoning, sibling findings, unrelated repository debt]
68
+ allowed_repo_writes: []
69
+ ```
115
70
 
116
- ## Account for every reviewer: the roster gate
71
+ Tell the role to apply its documented discipline and return `payload.type:
72
+ review-findings`, one finding per line, labeled Critical / Important / Suggestion /
73
+ Nit / FYI and anchored to `file:line` plus the spec criterion or observed command.
74
+ The exact result `CANNOT-VERIFY: <requirement> — <why>` is never a pass.
117
75
 
118
- The fan-out is done only when **every roster reviewer is accounted for**: dispatched, or
119
- consciously skipped with a one-line reason. A conditional reviewer that genuinely does not apply
120
- (no UI in the diff → `frontend-reviewer`) is a *recorded* skip, not a silent no-op. That record
121
- is the difference between "reviewed" and "declared done after firing three of seven": the silent
122
- skip is exactly how a needed reviewer never runs.
76
+ Dispatch rules:
123
77
 
124
- Record each decision to the footprint as you make it (via `devrites-engine footprint`, as in `/rite-build`). Log the reviewer's
125
- **exact agent name**: the `.claude/agents/` stem, e.g. `devrites-frontend-reviewer`; the `roster`
126
- gate matches on it (stripping the `devrites-` prefix), so a freehand label like `frontend` or
127
- `Spec axis` will not match and the gate reads that reviewer as unaccounted:
78
+ - Fresh-context dispatch through the capability ladder; one packet per reviewer.
79
+ - No author context, sibling findings, severity coaching, or plan justification.
80
+ - Feature scope is `touched-files.md` plus the frozen diff.
81
+ - Await every required batch before any write or verdict. Never background/detach.
128
82
 
129
- - dispatched `devrites-engine footprint log <slug> reviewer devrites-<x>-reviewer` (the dispatch record itself)
130
- - skipped → `devrites-engine footprint log <slug> skip devrites-<x>-reviewer` # e.g. `skip devrites-frontend-reviewer`: no UI in the diff
83
+ ## Account for every reviewer
131
84
 
132
- Then, **before the verdict**, prove the roster is complete:
85
+ Log exact agent names as decisions are made:
133
86
 
134
87
  ```bash
135
- devrites-engine footprint roster <slug> # rc=0 complete · rc=3 a reviewer was neither dispatched nor skipped · rc=1 an always-on reviewer was skipped
88
+ devrites-engine footprint log <slug> reviewer devrites-<x>-reviewer
89
+ devrites-engine footprint log <slug> skip devrites-<x>-reviewer
90
+ devrites-engine footprint roster <slug>
136
91
  ```
137
92
 
138
- `rc=3` is the silent omission the gate exists to catch: resolve it by dispatching the reviewer or
139
- recording why it does not apply: never by proceeding with it unaccounted. `rc=1` means an
140
- always-on axis (Spec / Code-review) was skip-recorded; that is legitimate only as a carry-forward
141
- of `/rite-review`'s verdict on an **unchanged** diff: confirm that, don't wave it through.
93
+ `roster` rc=3 means an unaccounted reviewer: dispatch or record why it does not apply.
94
+ rc=1 means an always-on skip; this is valid only for an unchanged-candidate carry-forward
95
+ or the explicit independence fallback in
96
+ [`../../rite-seal/reference/risk-and-rollback.md`](../../rite-seal/reference/risk-and-rollback.md).
142
97
 
143
98
  ## Reconciliation
144
99
 
145
- When the subagents return:
146
-
147
- 1. **Quote verbatim.** Place each subagent's findings under its own `## <axis>` heading in `review.md` / `seal.md`. Do not merge, re-rank, or summarize. `devrites-code-reviewer` runs its **full** documented discipline (tests-first, correctness, readability, architecture, maintainability, standards); the inline lead **reconciles** the returned reports. It does not re-run those same axes itself.
148
- 2. **Surface contradictions explicitly.** "Spec axis says complete, Code-review axis says untestable" is a finding, not noise. The caller decides at the gate.
149
- 3. **Severity is the gate, not a score.** Sum the labels (`Critical / Important / Suggestion / Nit / FYI`) and apply the caller's gate (`/rite-seal` blocks on `Critical == 0`; `/rite-review` reports counts).
150
- 4. **One scale.** All subagents use the same five-label scale (Critical / Important / Suggestion / Nit / FYI). Reject any subagent output that invents its own. **Exception:** `devrites-simplifier-reviewer` deliberately emits only Suggestion / Nit / FYI (it is non-blocking by design), that is a valid subset of the scale, not an invented one; do not reject it during reconciliation.
151
- 5. **Consensus roll-up (after the verbatim per-axis record).** Keep every axis's findings verbatim under its `## <axis>` heading (above), then add one deduped roll-up the gate reads: where **≥2 axes flag the same `file:line`**, raise it to the top and mark it *consensus*: independent corroboration raises confidence. A lone low-confidence finding with no `file:line` or evidence anchor drops out of the roll-up (it stays in its per-axis section). The roll-up reduces noise without hiding any axis: the verbatim sections are the audit trail; the roll-up is the actionable summary the gate acts on.
152
-
153
- ## Model tier
154
-
155
- Every reviewer in this fan-out runs at **ceiling tier**: the orchestrator's own model, inherited
156
- by declaring no `model:` in the agent definition (see
157
- [`model-tiers.md`](model-tiers.md)). Adversarial review is exactly where a cheaper model costs the
158
- most: a missed Critical is far more expensive than the tokens saved. Do not downgrade a reviewer to
159
- save cost. Extraction-tier savings belong to scouts (archive-search, footprint), not to the panel.
160
-
161
- ## Fallback
162
-
163
- If the harness has **no subagent primitive at all** (neither Claude's `Task` nor Codex's
164
- `spawn_agent`: an absent tool on one harness while the other's equivalent exists does NOT
165
- qualify), the caller runs the relevant subagent discipline **inline** in its own context and flags the result as a fallback (not an independent review). The seal weighs the fallback differently: see [`../../rite-seal/reference/risk-and-rollback.md`](../../rite-seal/reference/risk-and-rollback.md). This is the [`model-tiers.md`](model-tiers.md) degradation rule applied to the review panel: no subagent primitive → run inline under the same discipline and budget.
100
+ 1. Preserve each valid report verbatim under `## <axis>` in `review.md`/`seal.md`.
101
+ 2. Surface contradictions explicitly; the root decides them.
102
+ 3. Keep the shared five-label scale. The simplifier's Suggestion/Nit/FYI subset is valid.
103
+ 4. Resolve every `CANNOT-VERIFY` before the gate or retain it as a gap.
104
+ 5. Add a deduped roll-up only after the verbatim record. Mark matching `file:line`
105
+ findings from two or more axes as consensus; do not hide lone findings.
106
+ 6. Apply the caller's gate; do not invent a composite score.
107
+
108
+ Every panel reviewer runs at the ceiling or inherited tier. If the named role is
109
+ unavailable, use the universal ladder. Record an inline fallback as non-independent
110
+ under the seal risk rule, never as a fresh-context pass.
@@ -9,7 +9,14 @@ Before the final reply, persist the phase event, then render the deterministic
9
9
  progress chrome:
10
10
 
11
11
  ```bash
12
- devrites-engine timeline log completed --skill <skill> --slug "$(cat .devrites/ACTIVE 2>/dev/null)" --outcome "<ok|blocked|no-go|go>" --decision "<one-line result>"
12
+ devrites-engine timeline log run-finished \
13
+ --slug "$(cat .devrites/ACTIVE 2>/dev/null)" \
14
+ --outcome "<passed|blocked>" \
15
+ --execution-mode named \
16
+ --guard-strength n/a \
17
+ --reason-id "<stable DRV-* reason for the result>" \
18
+ --host "<claude|codex>" \
19
+ --evidence "<project-relative primary artifact>"
13
20
  devrites-engine budget
14
21
  devrites-engine progress
15
22
  ```
@@ -1,61 +1,44 @@
1
1
  # DevRites rules
2
2
 
3
- Stack-agnostic engineering rules that DevRites installs to `.claude/skills/devrites-lib/reference/standards/`. They encode
4
- the standards the DevRites workflow holds code to: quality, safety, testing, and review
5
- discipline that apply in any language.
3
+ These stack-agnostic rules ship under `.claude/skills/devrites-lib/reference/standards/`. Project-specific conventions win where they exist.
6
4
 
7
- These are **common** by design: nothing here assumes a specific framework or language.
8
- Project-specific conventions always win where they exist (DevRites reads the codebase and
9
- prefers what's already there).
5
+ ## Loading model
10
6
 
11
- ## Loading model: progressive disclosure
7
+ Every workspace-operating `rite-*` skill reads [`core.md`](core.md) first. Load the smallest topic file needed for the current step; each file owns its full rule.
12
8
 
13
- To keep context lean, the rules follow progressive disclosure: each DevRites `rite-*`
14
- skill Reads `.claude/skills/devrites-lib/reference/standards/core.md` as its first step;
15
- the remaining rule files load on demand by the phase that needs them.
16
-
17
- ### Always-on (read by each `rite-*` skill as step 0)
18
-
19
- | Rule | Covers |
9
+ | Rule | Load when |
20
10
  |---|---|
21
- | `core.md` | Operating rules, universal anti-rationalizations, one-line craft disciplines (fail-fast, reuse-first, test-behaviour-not-impl, trust boundary, measure-first), persistence + hygiene reminders. |
22
-
23
- ### On-demand (read by the phase / topic that needs it)
24
-
25
- | Rule | Covers | Typical phase |
26
- |---|---|---|
27
- | `coding-style.md` | Naming, function shape, guard clauses, comments, simplicity, reuse-first. | `/rite-build`, `/rite-polish` Phase 1. |
28
- | `prose-style.md` | Human-voice writing for artifacts + replies; two registers (prose vs technical); the LLM-tell cut-list. Depth in the `devrites-prose-craft` skill. | Any phase that writes prose: `/rite-spec`, `/rite-define`, `/rite-review`, `/rite-seal`, `/rite-ship`; `/rite-polish` Phase 1 as the catch. |
29
- | `error-handling.md` | Fail fast, no silent catches, meaningful messages, fail closed. | `/rite-build`, `/rite-polish` (backend), `/rite-review`. |
30
- | `testing.md` | Pyramid, behavior over implementation, determinism. | `/rite-build`, `/rite-prove`, `/rite-review`. |
31
- | `spec-grammar.md` | Optional, recommended structure for behavioral acceptance: `### Requirement:` (SHALL/MUST) + `#### Scenario:` (WHEN/THEN), validated deterministically by `devrites-engine spec-validate`. Progressive rigor; flat `AC-###` bullets stay valid. | `/rite-spec` readiness gate; `/rite-prove`, `/rite-review` consume the scenario hooks. |
32
- | `code-review.md` | Small PRs, severity labels, what to check, actionable feedback. | `/rite-review`, `/rite-seal`. |
33
- | `edge-case-trace.md` | Mechanical branch/boundary sweep, fixed-set siblings, and deletion-contract checks. | `/rite-review`, `/rite-seal`, `devrites-doubt`. |
34
- | `security.md` | Untrusted input, least privilege, secrets, three-tier trust boundary, fail closed. | When input / auth / data / integrations are in scope. |
35
- | `performance.md` | Measure first, common pitfalls, prove the win. | When perf is in scope. |
36
- | `observability.md` | Structured logs, metrics/SLIs, traces, symptom-based alerts, verify-the-telemetry-fires: proof a feature works in prod. | When the change has a runtime surface (endpoint, job, integration, user flow); `/rite-prove`, `/rite-seal`. |
37
- | `developer-experience.md` | DX as a measured axis: the predict-at-vet / measure-at-prove / reconcile-at-seal boomerang; scorecard (TTHW, getting-started, error-message quality, ergonomics, docs); severity by who-pays. Conditional + greenfield no-op. | When a developer-facing surface is in scope (public API, CLI, SDK/library, webhook, config, error messages, getting-started); `/rite-vet`, `/rite-prove`, `/rite-seal`. |
38
- | `patterns.md` | SOLID, composition, loose coupling, avoid over-engineering. | `/rite-build`, simplification audit. |
39
- | `git-workflow.md` | Conventional Commits, atomic commits, small PRs. | `/rite-ship` commit / push / tag steps. |
40
- | `hooks.md` | Stage checks by cost, fast local hooks, secret scanning. | Reference-only: read when setting up the project's git hooks; not auto-loaded by any phase. |
41
- | `ci-cd.md` | Shift-left + faster-is-safer, the no-skip gate pipeline, the CI-failure loop, Build Cop, feature-flags decouple deploy from release, secret tiers, the pipeline-speed ladder. | Reference: read when setting up or changing a build/deploy pipeline; `/rite-ship` when CI/CD is in scope. |
42
- | `documentation.md` | Explain why, keep current, record decisions. | `/rite-spec`, `/rite-define`, `/rite-seal`. |
43
- | `elicitation.md` | A move-set of named reasoning techniques (Steelman, Delphi, Red-Team/Blue-Team, Assumption Audit, Pre-Mortem…) selected per section by risk, to deepen a spec or plan on demand. | `/rite-temper`, `/rite-vet`; any section that needs sharper thinking. |
44
- | `development-workflow.md` | Small batches, trunk-always-green, definition of done. | `/rite-define`, `/rite-plan`. |
45
- | `principles.md` | The four knowledge layers; project invariants (`.devrites/principles.md`) as a *trusted, gating* pass/fail (vs conventions' untrusted prior); justified-exception register; dated-amendment governance. | `/rite-define`, `/rite-vet`, `/rite-build`, `/rite-review`, `/rite-seal`; seeded by `/rite-adopt`, grown by `/rite-learn`. |
46
- | `deprecation.md` | Code-as-liability, Hyrum's law, prove-unused-before-remove, expand→contract, deprecate-before-delete. The safe path behind the irreversible-migration gate. | When removing / replacing / migrating code, a feature, an API, or data. |
47
- | `agents.md` | DevRites review subagents + specialist skills, when to fan out. | `/rite-review`, `/rite-seal`. |
48
- | `context-hygiene.md` | `/clear` vs `/compact`, lost-in-the-middle, phase-aware hygiene footer. | Phase-end hygiene footer; choosing `/clear` vs `/compact`. |
49
- | `anti-patterns.md` | Pack-wide rationalizations + red flags the agent reaches for. | Loaded by each `rite-*/reference/anti-patterns.md`; loaded directly when reluctance is broader than the active phase. |
50
- | `afk-hitl.md` | AFK vs HITL contract: `.devrites/AFK` sentinel format, `questions.md` schema, four-gate taxonomy (advisory / validating / blocking / escalating), AFK-never-silently-accepts boundaries. | `/rite-build`, `/rite-status`, `/rite-resolve`, `devrites-doubt`; anywhere a pause-or-proceed decision happens. |
51
- | `tooling.md` | Optional external tools: code intelligence (codebase-memory-mcp first → cross-verify with codegraph + graphify → standard methods LSP / `Read`/`Grep`/`Glob`), up-to-date library docs (context7), architecture/ADR memory. Recommended, not required. | Any phase doing structural lookups (callers / impact / placement) or relying on external library/framework facts. |
52
- | `skill-authoring.md` | Skill descriptions, progressive disclosure, completion criteria, and pruning rules for keeping DevRites skills predictable and cheap. | When creating or editing DevRites skills or reviewing skill pack quality. |
53
- | `definition-of-done.md` | Done means acceptance proven, evidence recorded, drift resolved, and handoff/ship state clean. | `/rite-prove`, `/rite-seal`, `/rite-ship`. |
54
- | `review-checklist.md` | Compact reviewer pass/fail checklist. | `/rite-review`, `/rite-seal`. |
55
- | `test-proof-checklist.md` | Proof-quality checklist for tests and evidence. | `/rite-prove`, `/rite-seal`. |
56
- | `browser-proof-checklist.md` | Browser/UI proof checklist. | UI features in `/rite-prove`, `/rite-polish`, `/rite-seal`. |
57
- | `security-checklist.md` | Security review checklist. | Auth/input/data/integration changes. |
58
-
59
- How they're used: DevRites skills follow these rules; you and Claude can reference them
60
- directly. They are guidance, not enforced gates: the enforced gates live in the
61
- workflow skills (Spec Drift Guard, readiness gates, the seal).
11
+ | `core.md` | Every workflow phase: operating, persistence, evidence, and precedence rules. |
12
+ | `coding-style.md` | Writing or simplifying code. |
13
+ | `prose-style.md` | Writing prose artifacts or user replies. |
14
+ | `error-handling.md` | Adding or reviewing failure paths. |
15
+ | `testing.md` | Designing tests or judging proof quality. |
16
+ | `spec-grammar.md` | Structuring high-risk behavioral requirements or capability deltas. |
17
+ | `code-review.md` | Reviewing a change or sealing review findings. |
18
+ | `edge-case-trace.md` | Sweeping branches, boundaries, fixed-set siblings, or deletion contracts. |
19
+ | `security.md` | Handling input, auth, data, secrets, dependencies, or integrations. |
20
+ | `performance.md` | A measured performance concern is in scope. |
21
+ | `observability.md` | A changed runtime path must be diagnosed in production. |
22
+ | `developer-experience.md` | A public API, CLI, SDK, webhook, config, error, or getting-started surface changes. |
23
+ | `patterns.md` | Choosing or simplifying architecture. |
24
+ | `git-workflow.md` | Preparing commits, branches, tags, or changelog entries. |
25
+ | `hooks.md` | Creating or changing repository hooks. |
26
+ | `ci-cd.md` | Creating or changing a build/deploy pipeline. |
27
+ | `documentation.md` | Behavior, commands, contracts, or durable decisions change. |
28
+ | `elicitation.md` | Temper or Vet needs a sharper reasoning move for one section. |
29
+ | `development-workflow.md` | Planning batch size, integration, or the standing done bar. |
30
+ | `principles.md` | Authoring or checking project invariants and approved exceptions. |
31
+ | `deprecation.md` | Removing, replacing, or migrating behavior, code, APIs, or data. |
32
+ | `agents.md` | Dispatching, awaiting, validating, or reconciling fresh-context agents. |
33
+ | `context-hygiene.md` | Choosing `/clear`, `/compact`, or a handoff. |
34
+ | `anti-patterns.md` | A pack-wide rationalization or red flag appears. |
35
+ | `afk-hitl.md` | A pause, question, resume, or AFK decision is possible. |
36
+ | `tooling.md` | Structural lookup, current external facts, or architecture memory is needed. |
37
+ | `skill-authoring.md` | Creating, editing, routing, evaluating, or pruning a DevRites skill. |
38
+ | `definition-of-done.md` | Prove, Seal, Ship, or Quick must decide whether work is finished. |
39
+ | `review-checklist.md` | A compact review pass/fail sweep is enough. |
40
+ | `test-proof-checklist.md` | Test and evidence quality needs a compact sweep. |
41
+ | `browser-proof-checklist.md` | UI behavior needs browser proof. |
42
+ | `security-checklist.md` | Auth, input, data, or integration work needs a compact security sweep. |
43
+
44
+ These files guide judgment. Workflow skills and engine gates own enforcement.
@@ -1,10 +1,10 @@
1
1
  # AFK & HITL: the pause/resume contract
2
2
 
3
- The rule layer for DevRites's two run modes. Every `rite-*` and `devrites-*` skill that
3
+ This file defines DevRites's two run modes. Every `rite-*` and `devrites-*` skill that
4
4
  might pause for a human reads from this contract; `/rite-build`, `/rite-status`,
5
5
  `/rite-resolve`, and `devrites-doubt` are the primary callers.
6
6
 
7
- The contract is intentionally small: one sentinel, one queue, one verb.
7
+ The contract uses one sentinel, one queue, and one resume verb.
8
8
 
9
9
  ## Run modes
10
10
 
@@ -14,9 +14,9 @@ The contract is intentionally small: one sentinel, one queue, one verb.
14
14
  human picks; the skill records the pick to `questions.md` (`answered`) + `decisions.md` and
15
15
  **continues in place: no `/rite-resolve` round-trip**. `/rite-resolve` is only for answering
16
16
  **async** (a pause that already stopped the session) or in **batch**.
17
- **No interactive question tool in the current surface?** (Codex outside Plan mode:
17
+ **If the current surface has no interactive question tool** (Codex outside Plan mode:
18
18
  `request_user_input` is Plan-mode-only.) Render the same option set as a plain numbered
19
- list in chat and **end the turn**; the human's reply is the pick. Auto-picking an option
19
+ list in chat and **end the turn**. The human's reply is the selection. Auto-picking an option
20
20
  is **AFK's contract, gated by the `.devrites/AFK` sentinel**: a missing tool never
21
21
  converts a HITL gap into a self-answered one.
22
22
  - **AFK:** `.devrites/AFK` is present. For any gate AFK may auto-handle (severity in
@@ -67,8 +67,7 @@ for the full taxonomy. Summary:
67
67
  | blocking | high | sync | 15m | **no** (always pauses) |
68
68
  | escalating | novel pattern | sync to specialist | 24h | **no** (always pauses) |
69
69
 
70
- `blocking` and `escalating` always pause regardless of `allow_gates`. They are the
71
- "AFK never silently accepts" guarantees in protocol form.
70
+ `blocking` and `escalating` always pause regardless of `allow_gates`.
72
71
 
73
72
  An open `gate: validating` entry is **merge-blocking by definition**: at `/rite-seal` any
74
73
  `questions.md` entry with `gate: validating` and `status: open` is a NO-GO, regardless of
@@ -77,14 +76,14 @@ validating gate resolves.
77
76
 
78
77
  ## Option set: how every gap is presented
79
78
 
80
- Wherever a gap, checkpoint, or non-trivial decision surfaces (`/rite-spec`, `/rite-define`,
79
+ Wherever a gap, checkpoint, or non-trivial decision surfaces (`/rite-spec`, `/rite-clarify`, `/rite-define`,
81
80
  `/rite-build`, `/rite-temper`, `/rite-vet`, `devrites-doubt`, `devrites-interview`), present a
82
81
  **ranked option set**, never a single bare guess:
83
82
 
84
83
  - **2-4 concrete options**, the **recommended one first**, labelled `(Recommended)`.
85
84
  - Each option carries a **one-line rationale tagged by the dimensions that matter**:
86
85
  `logic · infra · business · architecture` (add `security` / `UX` / `risk` when in scope).
87
- Name the trade-off, not just the choice.
86
+ Name the trade-off as well as the choice.
88
87
  - Always include an escape hatch (`Something else — I'll describe it`).
89
88
  - The recommendation reflects what's best for *this* project (its conventions, stack, scale,
90
89
  domain), not a generic default.
@@ -92,8 +91,21 @@ Wherever a gap, checkpoint, or non-trivial decision surfaces (`/rite-spec`, `/ri
92
91
  **HITL** renders the set via `AskUserQuestion` (recommended option first; rationale in each
93
92
  option's description); the human's pick resolves the gate **in place**. **AFK** auto-picks
94
93
  option 1 (the recommendation) for gates it may auto-handle. Either way the chosen option is
95
- recorded verbatim and the **rejected options stay in `questions.md`** as the considered-alternatives
96
- trail: the audit shows what was weighed, not just what was decided.
94
+ recorded verbatim. Keep the **rejected options in `questions.md`** so the record includes
95
+ the alternatives considered.
96
+
97
+ ## Decision ownership: search before asking
98
+
99
+ A gate is human only when its remaining choice is human-owned. First search live code,
100
+ project/decision docs, and authoritative dependency sources; make and record reversible
101
+ implementation/test choices. Ask only about product, scope, acceptance, architecture policy,
102
+ irreversible risk, or human-only access/action.
103
+
104
+ Objective test/build/tool failure runs bounded `devrites-debug-recovery`; fix it or record a
105
+ technical blocker. Never ask permission for another attempt, test, parser repair, or probe.
106
+ Close decisions at the earliest informed phase: product in spec, coverage in clarify,
107
+ scope/risk in temper, architecture/dependencies in define, and proof/toolchain in vet. Build
108
+ keeps only unavailable-pre-code or mandatory action-time checkpoints.
97
109
 
98
110
  ## Irreversible-risk list (always pause)
99
111
 
@@ -105,16 +117,18 @@ The following always invoke the checkpoint protocol, regardless of `Mode`, `Gate
105
117
  - Public API break (response shape, removed endpoint, changed status code semantics).
106
118
  - External-service contract change.
107
119
  - Filesystem destruction outside the workspace.
108
- - Red tests / types / lint on slice completion (fail-on-red).
109
120
 
110
121
  When a pause clears and you proceed with a destructive migration, a removal, or a
111
122
  public-API break, take the **safe path** the gate stopped you for: expand→contract,
112
123
  prove the old path unused before removing it, and a rollback for every destructive step
113
- ([`deprecation.md`](deprecation.md)). The gate exists to make you do it right, not to
114
- abandon the work.
124
+ ([`deprecation.md`](deprecation.md)). The gate requires the safe path; it does not
125
+ cancel the work.
115
126
 
116
127
  By default, AFK widens what's *automatic*; it never widens what's *irreversible*.
117
128
 
129
+ Red checks remain hard non-advance build gates, but are not inherently irreversible or
130
+ human-owned; bounded recovery owns them.
131
+
118
132
  ## `questions.md` schema
119
133
 
120
134
  Append-only. One entry per qid. Format:
@@ -142,6 +156,15 @@ Rules:
142
156
  - The file is the audit trail. Don't edit answered/dropped entries: open a new qid that
143
157
  references the old one (`supersedes: q-...-OLD`) and resolve it.
144
158
 
159
+ Destructive Git uses a narrower engine-owned question:
160
+ `schema: devrites-git-authority/v1`, `kind: destructive-git-once`, the exact
161
+ operation digest, sorted classifier reason IDs, `requested_at`, `expires_at`, and
162
+ `answer_contract: Authorize once`. Run `/rite-resolve <qid> "Authorize once"`;
163
+ then retry within 15 minutes. `git-guard` consumes the grant before the tool runs,
164
+ so a failed tool call still spends it. Never hand-edit, broaden, reuse, or copy
165
+ this authority record. Ambiguous shell forms cannot use it: rewrite them as a
166
+ direct literal Git command.
167
+
145
168
  ## `state.md` `Awaiting human` block
146
169
 
147
170
  When a HITL gate fires, `/rite-build` writes:
@@ -177,8 +200,8 @@ walked away from), plus `--batch`. In an **interactive HITL** session the skill
177
200
  `AskUserQuestion` pick **in place** (the same `questions.md` `answered` write + `state.md`
178
201
  clear), so you don't type `/rite-resolve` for gaps you answer live. Both paths flip
179
202
  `status: open → answered` and clear `Awaiting human` through the **same `devrites-engine resolve` writer**:
180
- one source of truth, two entry points (live pick vs typed verb). Manual edits work but the
181
- script is the contract: use it.
203
+ one source of truth, two entry points (live pick vs typed verb). Use the writer;
204
+ manual edits are never destructive-operation authority.
182
205
 
183
206
  When `/rite-resolve` does resume a stopped session, the skill does **not** auto-run the next
184
207
  `/rite-build`. The user types the next command explicitly so:
@@ -198,24 +221,27 @@ When `/rite-resolve` does resume a stopped session, the skill does **not** auto-
198
221
  log to `questions.md` as `gate: blocking`, set `state.md` `Status: awaiting_human`,
199
222
  fire `notify:`, STOP.
200
223
 
201
- The loop limits of the calling skill still apply: after the limit, the unresolved
202
- doubt becomes a blocking question regardless of AFK config.
224
+ The loop limits of the calling skill still apply. At the limit, classify the unresolved
225
+ finding by the decision-ownership rule above: human-owned uncertainty becomes a blocking
226
+ question; an objective technical finding becomes a recorded blocker with its required
227
+ changes, not a request for permission to retry.
203
228
 
204
229
  ## Retry cap, stuck loops, and self-resolve
205
230
 
206
- - **Cap retries.** At most **3 attempts** on the same failing check (test, lint, type, build).
207
- On the third failure, stop guessing and convert it to a `gate: blocking` question: a fourth
208
- identical attempt is thrash, not progress.
209
- - **Stuck loops pause even in AFK.** A detected loop (the same action repeating, or an
210
- action↔error ping-pong) pauses regardless of `allow_gates` (`devrites-engine stuck`), the same standing as
211
- the irreversible-risk list. AFK widens what's automatic, never what's looping.
212
- - **Bias to self-resolve.** Before raising a question, try to answer it from the code, the docs,
231
+ - **Cap retries:** three total attempts per root cause across wright and recovery, carrying the
232
+ failure and dead ends; never rerun an unchanged check.
233
+ - **Classify exhaustion:** human-owned contract/risk/access gaps open their gate. Otherwise
234
+ preserve reproduction/dead ends, set `Status: blocked` and `Next step: /rite-plan unblock`,
235
+ with no question or `/rite-resolve`.
236
+ - **Stop loops even in AFK:** `devrites-engine stuck` ends the build and applies that same
237
+ classification regardless of `allow_gates`.
238
+ - **Resolve agent-owned questions first.** Before raising a question, try to answer it from the code, the docs,
213
239
  or `decisions.md`. Communicate only for a blocked environment, a deliverable to hand over,
214
240
  critical info you genuinely can't access, or a credential / permission you lack. This narrows
215
241
  needless pauses and never weakens the blocking / escalating / irreversible gates.
216
- - **Human time is for human-only work.** A `human_intervention` pause is for what the agent
242
+ - **Use human intervention only for human-owned work.** A `human_intervention` pause is for what the agent
217
243
  literally cannot do (create a cloud account, click a console button): never for writing code,
218
- writing tests, or reviewing. Punting the agent's own job to the human is not a valid gate.
244
+ writing tests, or reviewing. The agent's own work is not a valid human gate.
219
245
 
220
246
  ## What the rule does NOT cover
221
247
 
@@ -228,7 +254,7 @@ This contract is about **human pauses**. It does not weaken or replace:
228
254
  are unproven at `/rite-prove`.
229
255
  - `/clear` / `/compact` advice: context-hygiene rules are unchanged.
230
256
 
231
- AFK shifts the boundary between automatic and "ask"; nothing else.
257
+ AFK changes which decisions are automatic. It changes nothing else.
232
258
 
233
259
  ## Cross-reference
234
260