devrites 4.0.12 → 4.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 (283) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/README.md +3 -3
  3. package/docs/architecture.md +4 -4
  4. package/docs/command-map.md +4 -3
  5. package/docs/engine/commands.md +65 -6
  6. package/docs/flow.md +2 -1
  7. package/docs/orchestration.md +45 -4
  8. package/docs/skills.md +4 -3
  9. package/engine/go.mod +1 -1
  10. package/engine/internal/devritespaths/paths.go +5 -4
  11. package/engine/internal/gate/gate.go +154 -46
  12. package/engine/internal/gate/gate_test.go +290 -2
  13. package/engine/internal/gate/readiness_binding.go +66 -100
  14. package/engine/internal/gate/readiness_binding_test.go +126 -3
  15. package/engine/internal/hostpack/hostpack.go +9 -4
  16. package/engine/internal/hostpack/hostpack_test.go +16 -7
  17. package/engine/internal/install/install_test.go +5 -0
  18. package/engine/internal/lib/resolve.go +6 -6
  19. package/engine/internal/state/cmd/workflowmanifest/main.go +32 -3
  20. package/engine/internal/state/feature.go +1 -100
  21. package/engine/internal/state/observation.go +584 -0
  22. package/engine/internal/state/observation_open_other.go +9 -0
  23. package/engine/internal/state/observation_open_unix.go +12 -0
  24. package/engine/internal/state/observation_test.go +960 -0
  25. package/engine/internal/state/observation_unix_test.go +68 -0
  26. package/engine/internal/state/schema.go +60 -160
  27. package/engine/internal/state/state_test.go +489 -101
  28. package/engine/internal/state/status.go +67 -48
  29. package/engine/tests/adr_0004_required_by_phase_test.go +16 -13
  30. package/engine/tests/adr_0011_define_plan_test.go +14 -12
  31. package/engine/tests/gate_test.go +403 -28
  32. package/engine/tests/workspace_observation_migration_test.go +1065 -0
  33. package/pack/.claude/agents/devrites-code-reviewer.md +6 -1
  34. package/pack/.claude/agents/devrites-plan-drafter.md +5 -0
  35. package/pack/.claude/agents/devrites-plan-reviewer.md +6 -0
  36. package/pack/.claude/agents/devrites-proof-runner.md +7 -1
  37. package/pack/.claude/agents/devrites-retrospector.md +21 -25
  38. package/pack/.claude/agents/devrites-security-auditor.md +7 -3
  39. package/pack/.claude/agents/devrites-slice-wright.md +30 -4
  40. package/pack/.claude/agents/devrites-spec-reviewer.md +5 -0
  41. package/pack/.claude/agents/devrites-strategy-reviewer.md +3 -4
  42. package/pack/.claude/agents/devrites-test-analyst.md +5 -0
  43. package/pack/.claude/skills/devrites-debug-recovery/SKILL.md +13 -26
  44. package/pack/.claude/skills/devrites-debug-recovery/reference/build-the-loop.md +11 -14
  45. package/pack/.claude/skills/devrites-doubt/SKILL.md +3 -4
  46. package/pack/.claude/skills/devrites-frontend-craft/reference/reuse-first.md +3 -4
  47. package/pack/.claude/skills/devrites-lib/reference/standards/README.md +5 -1
  48. package/pack/.claude/skills/devrites-lib/reference/standards/acceptance-preserving-reslice.md +30 -0
  49. package/pack/.claude/skills/devrites-lib/reference/standards/afk-hitl.md +35 -17
  50. package/pack/.claude/skills/devrites-lib/reference/standards/agents.md +11 -3
  51. package/pack/.claude/skills/devrites-lib/reference/standards/ci-cd.md +19 -0
  52. package/pack/.claude/skills/devrites-lib/reference/standards/code-review.md +1 -1
  53. package/pack/.claude/skills/devrites-lib/reference/standards/core.md +5 -0
  54. package/pack/.claude/skills/devrites-lib/reference/standards/data-integrity.md +95 -0
  55. package/pack/.claude/skills/devrites-lib/reference/standards/developer-experience.md +5 -5
  56. package/pack/.claude/skills/devrites-lib/reference/standards/documentation.md +28 -29
  57. package/pack/.claude/skills/devrites-lib/reference/standards/edge-case-trace.md +70 -10
  58. package/pack/.claude/skills/devrites-lib/reference/standards/integration-reliability.md +79 -0
  59. package/pack/.claude/skills/devrites-lib/reference/standards/loop-operations.md +85 -0
  60. package/pack/.claude/skills/devrites-lib/reference/standards/observability.md +10 -0
  61. package/pack/.claude/skills/devrites-lib/reference/standards/one-shot-actions.md +1 -6
  62. package/pack/.claude/skills/devrites-lib/reference/standards/patterns.md +20 -0
  63. package/pack/.claude/skills/devrites-lib/reference/standards/repository-topology.md +73 -0
  64. package/pack/.claude/skills/devrites-lib/reference/standards/security-checklist.md +6 -2
  65. package/pack/.claude/skills/devrites-lib/reference/standards/security.md +51 -16
  66. package/pack/.claude/skills/devrites-lib/reference/standards/skill-authoring.md +35 -40
  67. package/pack/.claude/skills/devrites-lib/reference/standards/test-proof-checklist.md +4 -0
  68. package/pack/.claude/skills/devrites-lib/reference/standards/testing.md +51 -6
  69. package/pack/.claude/skills/devrites-lib/reference/standards/workflow-artifacts.md +411 -102
  70. package/pack/.claude/skills/rite/SKILL.md +2 -0
  71. package/pack/.claude/skills/rite-adopt/SKILL.md +8 -10
  72. package/pack/.claude/skills/rite-adopt/reference/adoption.md +13 -15
  73. package/pack/.claude/skills/rite-autocomplete/SKILL.md +98 -139
  74. package/pack/.claude/skills/rite-autocomplete/reference/decision-policy.md +11 -5
  75. package/pack/.claude/skills/rite-autocomplete/reference/loop.md +99 -114
  76. package/pack/.claude/skills/rite-autocomplete/reference/stop-conditions.md +92 -124
  77. package/pack/.claude/skills/rite-build/SKILL.md +51 -73
  78. package/pack/.claude/skills/rite-build/reference/phase-contract.md +9 -18
  79. package/pack/.claude/skills/rite-build/reference/wright-dispatch.md +37 -4
  80. package/pack/.claude/skills/rite-clarify/SKILL.md +3 -2
  81. package/pack/.claude/skills/rite-converge/SKILL.md +4 -2
  82. package/pack/.claude/skills/rite-converge/reference/convergence-assessment.md +8 -4
  83. package/pack/.claude/skills/rite-customize/SKILL.md +16 -18
  84. package/pack/.claude/skills/rite-define/SKILL.md +60 -62
  85. package/pack/.claude/skills/rite-define/reference/plan-template.md +88 -71
  86. package/pack/.claude/skills/rite-explain/SKILL.md +2 -1
  87. package/pack/.claude/skills/rite-learn/SKILL.md +28 -32
  88. package/pack/.claude/skills/rite-plan/SKILL.md +53 -56
  89. package/pack/.claude/skills/rite-plan/reference/anti-patterns.md +11 -1
  90. package/pack/.claude/skills/rite-plan/reference/dependency-graph.md +11 -2
  91. package/pack/.claude/skills/rite-plan/reference/replan-and-repair.md +10 -3
  92. package/pack/.claude/skills/rite-plan/reference/task-breakdown.md +2 -0
  93. package/pack/.claude/skills/rite-polish/reference/adr-promotion.md +7 -7
  94. package/pack/.claude/skills/rite-pressure-test/SKILL.md +24 -31
  95. package/pack/.claude/skills/rite-prove/SKILL.md +95 -156
  96. package/pack/.claude/skills/rite-prove/reference/acceptance-proof.md +28 -0
  97. package/pack/.claude/skills/rite-review/SKILL.md +5 -4
  98. package/pack/.claude/skills/rite-review/reference/five-axis-review.md +6 -0
  99. package/pack/.claude/skills/rite-review/reference/security-review.md +7 -2
  100. package/pack/.claude/skills/rite-seal/reference/final-evidence.md +3 -0
  101. package/pack/.claude/skills/rite-seal/reference/risk-and-rollback.md +19 -4
  102. package/pack/.claude/skills/rite-ship/reference/rollout.md +62 -43
  103. package/pack/.claude/skills/rite-spec/SKILL.md +8 -1
  104. package/pack/.claude/skills/rite-spec/reference/ai-spec-template.md +13 -6
  105. package/pack/.claude/skills/rite-spec/reference/spec-checklists.md +14 -2
  106. package/pack/.claude/skills/rite-spec/reference/spec-template.md +33 -4
  107. package/pack/.claude/skills/rite-temper/SKILL.md +5 -1
  108. package/pack/.claude/skills/rite-vet/SKILL.md +121 -174
  109. package/pack/.claude/skills/rite-vet/reference/anti-patterns.md +14 -2
  110. package/pack/.claude/skills/rite-vet/reference/artifacts.md +15 -9
  111. package/pack/.claude/skills/rite-vet/reference/depth.md +10 -3
  112. package/pack/.claude/skills/rite-vet/reference/review-axes.md +75 -77
  113. package/pack/.claude/skills/rite-watch-pr/SKILL.md +85 -0
  114. package/pack/.claude/skills/rite-zoom-out/SKILL.md +4 -5
  115. package/pack/.claude/workflows/devrites-readonly-review.js +194 -0
  116. package/pack/generated/README.md +1 -1
  117. package/pack/generated/claude/agents/devrites-code-reviewer.md +6 -1
  118. package/pack/generated/claude/agents/devrites-plan-drafter.md +5 -0
  119. package/pack/generated/claude/agents/devrites-plan-reviewer.md +6 -0
  120. package/pack/generated/claude/agents/devrites-proof-runner.md +7 -1
  121. package/pack/generated/claude/agents/devrites-retrospector.md +21 -25
  122. package/pack/generated/claude/agents/devrites-security-auditor.md +7 -3
  123. package/pack/generated/claude/agents/devrites-slice-wright.md +30 -4
  124. package/pack/generated/claude/agents/devrites-spec-reviewer.md +5 -0
  125. package/pack/generated/claude/agents/devrites-strategy-reviewer.md +3 -4
  126. package/pack/generated/claude/agents/devrites-test-analyst.md +5 -0
  127. package/pack/generated/claude/skills/devrites-debug-recovery/SKILL.md +13 -26
  128. package/pack/generated/claude/skills/devrites-debug-recovery/reference/build-the-loop.md +11 -14
  129. package/pack/generated/claude/skills/devrites-doubt/SKILL.md +3 -4
  130. package/pack/generated/claude/skills/devrites-frontend-craft/reference/reuse-first.md +3 -4
  131. package/pack/generated/claude/skills/devrites-lib/reference/standards/README.md +5 -1
  132. package/pack/generated/claude/skills/devrites-lib/reference/standards/acceptance-preserving-reslice.md +30 -0
  133. package/pack/generated/claude/skills/devrites-lib/reference/standards/afk-hitl.md +35 -17
  134. package/pack/generated/claude/skills/devrites-lib/reference/standards/agents.md +11 -3
  135. package/pack/generated/claude/skills/devrites-lib/reference/standards/ci-cd.md +19 -0
  136. package/pack/generated/claude/skills/devrites-lib/reference/standards/code-review.md +1 -1
  137. package/pack/generated/claude/skills/devrites-lib/reference/standards/core.md +5 -0
  138. package/pack/generated/claude/skills/devrites-lib/reference/standards/data-integrity.md +95 -0
  139. package/pack/generated/claude/skills/devrites-lib/reference/standards/developer-experience.md +5 -5
  140. package/pack/generated/claude/skills/devrites-lib/reference/standards/documentation.md +28 -29
  141. package/pack/generated/claude/skills/devrites-lib/reference/standards/edge-case-trace.md +70 -10
  142. package/pack/generated/claude/skills/devrites-lib/reference/standards/integration-reliability.md +79 -0
  143. package/pack/generated/claude/skills/devrites-lib/reference/standards/loop-operations.md +85 -0
  144. package/pack/generated/claude/skills/devrites-lib/reference/standards/observability.md +10 -0
  145. package/pack/generated/claude/skills/devrites-lib/reference/standards/one-shot-actions.md +1 -6
  146. package/pack/generated/claude/skills/devrites-lib/reference/standards/patterns.md +20 -0
  147. package/pack/generated/claude/skills/devrites-lib/reference/standards/repository-topology.md +73 -0
  148. package/pack/generated/claude/skills/devrites-lib/reference/standards/security-checklist.md +6 -2
  149. package/pack/generated/claude/skills/devrites-lib/reference/standards/security.md +51 -16
  150. package/pack/generated/claude/skills/devrites-lib/reference/standards/skill-authoring.md +35 -40
  151. package/pack/generated/claude/skills/devrites-lib/reference/standards/test-proof-checklist.md +4 -0
  152. package/pack/generated/claude/skills/devrites-lib/reference/standards/testing.md +51 -6
  153. package/pack/generated/claude/skills/devrites-lib/reference/standards/workflow-artifacts.md +411 -102
  154. package/pack/generated/claude/skills/rite/SKILL.md +2 -0
  155. package/pack/generated/claude/skills/rite-adopt/SKILL.md +8 -10
  156. package/pack/generated/claude/skills/rite-adopt/reference/adoption.md +13 -15
  157. package/pack/generated/claude/skills/rite-autocomplete/SKILL.md +98 -139
  158. package/pack/generated/claude/skills/rite-autocomplete/reference/decision-policy.md +11 -5
  159. package/pack/generated/claude/skills/rite-autocomplete/reference/loop.md +99 -114
  160. package/pack/generated/claude/skills/rite-autocomplete/reference/stop-conditions.md +92 -124
  161. package/pack/generated/claude/skills/rite-build/SKILL.md +51 -73
  162. package/pack/generated/claude/skills/rite-build/reference/phase-contract.md +9 -18
  163. package/pack/generated/claude/skills/rite-build/reference/wright-dispatch.md +37 -4
  164. package/pack/generated/claude/skills/rite-clarify/SKILL.md +3 -2
  165. package/pack/generated/claude/skills/rite-converge/SKILL.md +4 -2
  166. package/pack/generated/claude/skills/rite-converge/reference/convergence-assessment.md +8 -4
  167. package/pack/generated/claude/skills/rite-customize/SKILL.md +16 -18
  168. package/pack/generated/claude/skills/rite-define/SKILL.md +60 -62
  169. package/pack/generated/claude/skills/rite-define/reference/plan-template.md +88 -71
  170. package/pack/generated/claude/skills/rite-explain/SKILL.md +2 -1
  171. package/pack/generated/claude/skills/rite-learn/SKILL.md +28 -32
  172. package/pack/generated/claude/skills/rite-plan/SKILL.md +53 -56
  173. package/pack/generated/claude/skills/rite-plan/reference/anti-patterns.md +11 -1
  174. package/pack/generated/claude/skills/rite-plan/reference/dependency-graph.md +11 -2
  175. package/pack/generated/claude/skills/rite-plan/reference/replan-and-repair.md +10 -3
  176. package/pack/generated/claude/skills/rite-plan/reference/task-breakdown.md +2 -0
  177. package/pack/generated/claude/skills/rite-polish/reference/adr-promotion.md +7 -7
  178. package/pack/generated/claude/skills/rite-pressure-test/SKILL.md +24 -31
  179. package/pack/generated/claude/skills/rite-prove/SKILL.md +95 -156
  180. package/pack/generated/claude/skills/rite-prove/reference/acceptance-proof.md +28 -0
  181. package/pack/generated/claude/skills/rite-review/SKILL.md +5 -4
  182. package/pack/generated/claude/skills/rite-review/reference/five-axis-review.md +6 -0
  183. package/pack/generated/claude/skills/rite-review/reference/security-review.md +7 -2
  184. package/pack/generated/claude/skills/rite-seal/reference/final-evidence.md +3 -0
  185. package/pack/generated/claude/skills/rite-seal/reference/risk-and-rollback.md +19 -4
  186. package/pack/generated/claude/skills/rite-ship/reference/rollout.md +62 -43
  187. package/pack/generated/claude/skills/rite-spec/SKILL.md +8 -1
  188. package/pack/generated/claude/skills/rite-spec/reference/ai-spec-template.md +13 -6
  189. package/pack/generated/claude/skills/rite-spec/reference/spec-checklists.md +14 -2
  190. package/pack/generated/claude/skills/rite-spec/reference/spec-template.md +33 -4
  191. package/pack/generated/claude/skills/rite-temper/SKILL.md +5 -1
  192. package/pack/generated/claude/skills/rite-vet/SKILL.md +121 -174
  193. package/pack/generated/claude/skills/rite-vet/reference/anti-patterns.md +14 -2
  194. package/pack/generated/claude/skills/rite-vet/reference/artifacts.md +15 -9
  195. package/pack/generated/claude/skills/rite-vet/reference/depth.md +10 -3
  196. package/pack/generated/claude/skills/rite-vet/reference/review-axes.md +75 -77
  197. package/pack/generated/claude/skills/rite-watch-pr/SKILL.md +85 -0
  198. package/pack/generated/claude/skills/rite-zoom-out/SKILL.md +4 -5
  199. package/pack/generated/claude/workflows/devrites-readonly-review.js +194 -0
  200. package/pack/generated/codex/agents/devrites-code-reviewer.toml +6 -1
  201. package/pack/generated/codex/agents/devrites-plan-drafter.toml +5 -0
  202. package/pack/generated/codex/agents/devrites-plan-reviewer.toml +6 -0
  203. package/pack/generated/codex/agents/devrites-proof-runner.toml +7 -1
  204. package/pack/generated/codex/agents/devrites-retrospector.toml +21 -25
  205. package/pack/generated/codex/agents/devrites-security-auditor.toml +7 -3
  206. package/pack/generated/codex/agents/devrites-slice-wright.toml +30 -4
  207. package/pack/generated/codex/agents/devrites-spec-reviewer.toml +5 -0
  208. package/pack/generated/codex/agents/devrites-strategy-reviewer.toml +3 -4
  209. package/pack/generated/codex/agents/devrites-test-analyst.toml +5 -0
  210. package/pack/generated/codex/skills/devrites-debug-recovery/SKILL.md +13 -26
  211. package/pack/generated/codex/skills/devrites-debug-recovery/reference/build-the-loop.md +11 -14
  212. package/pack/generated/codex/skills/devrites-doubt/SKILL.md +3 -4
  213. package/pack/generated/codex/skills/devrites-frontend-craft/reference/reuse-first.md +3 -4
  214. package/pack/generated/codex/skills/devrites-lib/reference/standards/README.md +5 -1
  215. package/pack/generated/codex/skills/devrites-lib/reference/standards/acceptance-preserving-reslice.md +30 -0
  216. package/pack/generated/codex/skills/devrites-lib/reference/standards/afk-hitl.md +35 -17
  217. package/pack/generated/codex/skills/devrites-lib/reference/standards/agents.md +11 -3
  218. package/pack/generated/codex/skills/devrites-lib/reference/standards/ci-cd.md +19 -0
  219. package/pack/generated/codex/skills/devrites-lib/reference/standards/code-review.md +1 -1
  220. package/pack/generated/codex/skills/devrites-lib/reference/standards/core.md +5 -0
  221. package/pack/generated/codex/skills/devrites-lib/reference/standards/data-integrity.md +95 -0
  222. package/pack/generated/codex/skills/devrites-lib/reference/standards/developer-experience.md +5 -5
  223. package/pack/generated/codex/skills/devrites-lib/reference/standards/documentation.md +28 -29
  224. package/pack/generated/codex/skills/devrites-lib/reference/standards/edge-case-trace.md +70 -10
  225. package/pack/generated/codex/skills/devrites-lib/reference/standards/integration-reliability.md +79 -0
  226. package/pack/generated/codex/skills/devrites-lib/reference/standards/loop-operations.md +85 -0
  227. package/pack/generated/codex/skills/devrites-lib/reference/standards/observability.md +10 -0
  228. package/pack/generated/codex/skills/devrites-lib/reference/standards/one-shot-actions.md +1 -6
  229. package/pack/generated/codex/skills/devrites-lib/reference/standards/patterns.md +20 -0
  230. package/pack/generated/codex/skills/devrites-lib/reference/standards/repository-topology.md +73 -0
  231. package/pack/generated/codex/skills/devrites-lib/reference/standards/security-checklist.md +6 -2
  232. package/pack/generated/codex/skills/devrites-lib/reference/standards/security.md +51 -16
  233. package/pack/generated/codex/skills/devrites-lib/reference/standards/skill-authoring.md +35 -40
  234. package/pack/generated/codex/skills/devrites-lib/reference/standards/test-proof-checklist.md +4 -0
  235. package/pack/generated/codex/skills/devrites-lib/reference/standards/testing.md +51 -6
  236. package/pack/generated/codex/skills/devrites-lib/reference/standards/workflow-artifacts.md +411 -102
  237. package/pack/generated/codex/skills/rite/SKILL.md +2 -0
  238. package/pack/generated/codex/skills/rite-adopt/SKILL.md +8 -10
  239. package/pack/generated/codex/skills/rite-adopt/reference/adoption.md +13 -15
  240. package/pack/generated/codex/skills/rite-autocomplete/SKILL.md +98 -139
  241. package/pack/generated/codex/skills/rite-autocomplete/reference/decision-policy.md +11 -5
  242. package/pack/generated/codex/skills/rite-autocomplete/reference/loop.md +99 -114
  243. package/pack/generated/codex/skills/rite-autocomplete/reference/stop-conditions.md +92 -124
  244. package/pack/generated/codex/skills/rite-build/SKILL.md +51 -73
  245. package/pack/generated/codex/skills/rite-build/reference/phase-contract.md +9 -18
  246. package/pack/generated/codex/skills/rite-build/reference/wright-dispatch.md +37 -4
  247. package/pack/generated/codex/skills/rite-clarify/SKILL.md +3 -2
  248. package/pack/generated/codex/skills/rite-converge/SKILL.md +4 -2
  249. package/pack/generated/codex/skills/rite-converge/reference/convergence-assessment.md +8 -4
  250. package/pack/generated/codex/skills/rite-customize/SKILL.md +16 -18
  251. package/pack/generated/codex/skills/rite-define/SKILL.md +60 -62
  252. package/pack/generated/codex/skills/rite-define/reference/plan-template.md +88 -71
  253. package/pack/generated/codex/skills/rite-explain/SKILL.md +2 -1
  254. package/pack/generated/codex/skills/rite-learn/SKILL.md +28 -32
  255. package/pack/generated/codex/skills/rite-plan/SKILL.md +53 -56
  256. package/pack/generated/codex/skills/rite-plan/reference/anti-patterns.md +11 -1
  257. package/pack/generated/codex/skills/rite-plan/reference/dependency-graph.md +11 -2
  258. package/pack/generated/codex/skills/rite-plan/reference/replan-and-repair.md +10 -3
  259. package/pack/generated/codex/skills/rite-plan/reference/task-breakdown.md +2 -0
  260. package/pack/generated/codex/skills/rite-polish/reference/adr-promotion.md +7 -7
  261. package/pack/generated/codex/skills/rite-pressure-test/SKILL.md +24 -31
  262. package/pack/generated/codex/skills/rite-prove/SKILL.md +95 -156
  263. package/pack/generated/codex/skills/rite-prove/reference/acceptance-proof.md +28 -0
  264. package/pack/generated/codex/skills/rite-review/SKILL.md +5 -4
  265. package/pack/generated/codex/skills/rite-review/reference/five-axis-review.md +6 -0
  266. package/pack/generated/codex/skills/rite-review/reference/security-review.md +7 -2
  267. package/pack/generated/codex/skills/rite-seal/reference/final-evidence.md +3 -0
  268. package/pack/generated/codex/skills/rite-seal/reference/risk-and-rollback.md +19 -4
  269. package/pack/generated/codex/skills/rite-ship/reference/rollout.md +62 -43
  270. package/pack/generated/codex/skills/rite-spec/SKILL.md +8 -1
  271. package/pack/generated/codex/skills/rite-spec/reference/ai-spec-template.md +13 -6
  272. package/pack/generated/codex/skills/rite-spec/reference/spec-checklists.md +14 -2
  273. package/pack/generated/codex/skills/rite-spec/reference/spec-template.md +33 -4
  274. package/pack/generated/codex/skills/rite-temper/SKILL.md +5 -1
  275. package/pack/generated/codex/skills/rite-vet/SKILL.md +121 -174
  276. package/pack/generated/codex/skills/rite-vet/reference/anti-patterns.md +14 -2
  277. package/pack/generated/codex/skills/rite-vet/reference/artifacts.md +15 -9
  278. package/pack/generated/codex/skills/rite-vet/reference/depth.md +10 -3
  279. package/pack/generated/codex/skills/rite-vet/reference/review-axes.md +75 -77
  280. package/pack/generated/codex/skills/rite-watch-pr/SKILL.md +85 -0
  281. package/pack/generated/codex/skills/rite-zoom-out/SKILL.md +4 -5
  282. package/package.json +1 -1
  283. package/scripts/build-host-artifacts.sh +3 -1
@@ -37,14 +37,48 @@ services, `localhost`). Defenses, together:
37
37
  - Check authorization on every sensitive action, server-side. Guard against IDOR (acting
38
38
  on another user's object by changing an id).
39
39
 
40
+ ## Authentication, authorization, and tenant isolation
41
+
42
+ - **Authentication establishes identity; authorization permits this action on this
43
+ resource.** A valid session is not an authorization decision. Re-check policy at every
44
+ public entry and background/job boundary using server-owned identity and resource data.
45
+ - Deny by default. Role hierarchy, impersonation, service-to-service identity, admin
46
+ bypasses, and object ownership are explicit policy; do not infer privilege from route
47
+ location, UI visibility, email/domain, or a caller-supplied role/tenant id.
48
+ - Tenant scope applies to queries, writes, caches, search indexes, object storage paths,
49
+ queues/jobs, exports, logs, and model/RAG context. Prove denial with two distinct tenants
50
+ and records; a filter present in source is not evidence that every path applies it.
51
+ - A privilege-changing operation requires re-authorization at use time and an auditable
52
+ event. Prevent confused-deputy flows where a high-privilege service performs an action
53
+ solely because a low-privilege caller supplied an id.
54
+
55
+ ## Files, path traversal, parsing, and request integrity
56
+
57
+ - Resolve filesystem targets beneath an allowed root; reject absolute paths, `..`, encoded
58
+ traversal, alternate separators, symlink escapes, and archive entries that leave it.
59
+ Validate the resolved path, not the raw string. Downloads use server-side object lookup,
60
+ not user-controlled filesystem paths.
61
+ - For uploads, bound body and expanded size, verify content signature rather than trusting
62
+ filename/MIME, generate the storage name server-side, keep files outside executable/public
63
+ roots, enforce tenant/owner access, and scan/quarantine when project risk requires it.
64
+ - Treat deserialization, templates, archive extraction, image/document parsers, and plugin
65
+ formats as code-adjacent boundaries. Use safe/non-executable modes, type/size/depth limits,
66
+ and isolate risky parsers; never deserialize untrusted data into executable objects.
67
+ - Protect state-changing browser requests with the framework's request-forgery control,
68
+ appropriate SameSite cookies, and origin checks where supported. CORS is not CSRF defense.
69
+ - Security-sensitive configuration fails closed in every environment. A missing auth key,
70
+ tenant scope, TLS check, or allowlist is startup/operation failure, never a debug fallback.
71
+
40
72
  ## Secrets
41
73
  - Never hard-code secrets or commit them. Use the project's secret mechanism / env /
42
74
  vault. Never log secrets, tokens, or personal data.
75
+ - Capture only sanitized diagnostics. Replace credentials, cookies, auth headers, personal/
76
+ tenant data with typed markers such as `<redacted:authorization>`; raw secret-bearing material
77
+ never enters scratch, evidence, review, handoff, or output. Use environment-variable command
78
+ shapes. If redaction removes the decisive signal, record `cannot_verify` plus a safe manual step.
43
79
  - Deliver secrets just-in-time and scope them; rotate on exposure.
44
- - Catch a secret **before** it enters history: a leaked secret is compromised the moment it
45
- reaches a remote, so rotate first, then scrub. Cheapest guard is a pre-commit scan of the
46
- staged diff: `git diff --cached | grep -iE 'password|secret|api[_-]?key|token'` (the pack's
47
- own `commit-msg`/pre-commit hooks are the reference: see [`hooks.md`](hooks.md)).
80
+ - Catch secrets before history with the project's staged-diff scan. Once remote, rotate first,
81
+ then scrub; see [`hooks.md`](hooks.md).
48
82
 
49
83
  ## Fail closed
50
84
  On any security-relevant error, deny access and roll back: never default to allow or to
@@ -97,11 +131,8 @@ logs, quotes, attachments, repository prose, and external content remain
97
131
 
98
132
  ## AI / LLM features: the OWASP LLM Top 10
99
133
 
100
- When the feature *itself* calls a model, builds an agent, does RAG, or exposes tool-use, the
101
- attack surface is the model, not just the code around it. The prompt-injection section above is
102
- the defender's baseline. It hardens DevRites' own agents (LLM01 from the inside); apply the same
103
- untrusted-content discipline to the user's LLM surface, plus the rest of the taxonomy. Conditional,
104
- like the rest of this file: it applies when an LLM surface is in scope, not to every change.
134
+ When a feature calls a model, builds an agent/RAG, or exposes tools, apply prompt-injection
135
+ rules plus this taxonomy. This is conditional on an LLM surface.
105
136
 
106
137
  - **Prompt injection (LLM01):** untrusted text (user input, retrieved docs, tool output) is
107
138
  data, never instructions. Don't concatenate it into a privileged prompt; fence it, and never
@@ -110,18 +141,22 @@ like the rest of this file: it applies when an LLM surface is in scope, not to e
110
141
  Never `eval` / render / exec it raw: escape before HTML, parameterize before SQL, validate
111
142
  before a tool call. A model that emits `<script>` or `DROP TABLE` is just another injection
112
143
  vector.
113
- - **Excessive agency (LLM06):** give the model the *least* tools, scopes, and autonomy the task
114
- needs. A destructive or outbound action behind a model decision needs a human gate or a hard
115
- allowlist, not the model's say-so. (DevRites enforces this on itself: reviewers are read-only at
116
- the tool layer; the one writer is scope-fenced.)
144
+ - **Excessive agency (LLM06):** use least tools/scope/autonomy. Agentic plans name isolation,
145
+ network allowlist, execution identity, short-lived credentials, destructive/outbound approvals,
146
+ audit trail, kill switch, memory retention, and data sent to each external model/MCP. A model
147
+ cannot widen its own authority; DevRites reviewers stay read-only and its writer scope-fenced.
117
148
  - **Sensitive-info disclosure (LLM02) / system-prompt leakage (LLM07):** assume the system prompt
118
149
  and context are extractable. Put no secret in them; keep authz server-side, never "the prompt
119
150
  told it not to"; don't feed PII/secrets to a model or log prompts/outputs in the clear.
120
151
  - **Supply chain & poisoning (LLM03 / LLM04 / LLM08):** pin and vet models, weights, and datasets
121
152
  like dependencies; treat third-party models and training/RAG data as untrusted. Embedding and
122
- retrieval sources are an injection and poisoning surface: validate what you index.
153
+ retrieval sources are an injection and poisoning surface: validate provenance before indexing,
154
+ enforce tenant/ACL filters at retrieval, and prevent one corpus from silently contaminating
155
+ another.
123
156
  - **Misinformation / overreliance (LLM09):** the model can be confidently wrong. Ground answers,
124
- cite sources, keep a human in the loop for consequential decisions, and don't present generated
125
- content as verified fact.
157
+ cite only retrieved sources that support the claim, define insufficient-context behavior, keep
158
+ a human in the loop for consequential decisions, and don't present generated content as verified
159
+ fact. Evaluate faithfulness and retrieval relevance on domain slices plus adversarial/empty
160
+ context before and after a prompt/model/index change; a fluent example is not an eval.
126
161
  - **Unbounded consumption (LLM10):** rate-limit, cap tokens/cost, and time-out model calls; an
127
162
  open-ended prompt loop is both a DoS and a bill.
@@ -1,27 +1,25 @@
1
1
  # Skill authoring
2
2
 
3
- > **Source-checkout only.** In a checkout where `pack/.claude/` exists, edit
4
- > only the canonical source; run `bash scripts/build-host-artifacts.sh`, then validate.
5
- > Installed generated mirrors are not authoring surfaces; never edit them.
3
+ > **Source-checkout only:** where `pack/.claude/` exists, edit canonical source; run
4
+ > `bash scripts/build-host-artifacts.sh`, then validate. Installed generated mirrors are not authoring surfaces.
6
5
 
7
6
  ## Surface lifecycle
8
7
 
9
- - **Promoted:** shipped in `pack/`, documented in `docs/skills.md` +
10
- `docs/command-map.md`, validated.
11
- - **Draft:** local/research outside `pack/`.
12
- - **Deprecated:** compatibility bridge with replacement/removal note.
13
- - **Research:** `docs/research/` notes; never installed.
8
+ - **Promoted:** validated in `pack/`, `docs/skills.md`, and `docs/command-map.md`.
9
+ - **Draft:** local, outside `pack/`.
10
+ - **Deprecated:** bridge with replacement/removal note.
11
+ - **Research:** `docs/research/`, never installed.
14
12
 
15
13
  ## Routing metadata
16
14
 
17
- The description routes; it is not documentation.
15
+ Description routes; it is not documentation.
18
16
 
19
17
  - **Model-invoked:** omit `disable-model-invocation`; use a trigger-bearing
20
18
  description.
21
19
  - **Explicit-only:** set `disable-model-invocation: true`, use a human summary,
22
20
  expose through `/rite`; generate Codex
23
21
  `policy.allow_implicit_invocation: false` without a stub description.
24
- - Description caps: public model-invoked 90 words; internal 75; explicit-only
22
+ - Caps: public model-invoked 90 words; internal 75; explicit-only
25
23
  30; `devrites-lib` 60. Agent descriptions: 45 words.
26
24
  - Model-visible `name` + `description` ≤5,200 routing characters;
27
25
  `explicit-only` and bodies/references do not count.
@@ -44,15 +42,11 @@ Optional flags obey `core.md` rule 10.
44
42
 
45
43
  ## Body and placement
46
44
 
47
- - Ordered steps end in checkable completion criteria.
48
- - Active bodies show in one read: outcome/owner; `Use when`/`Not for`;
49
- preconditions/context; ordered decisions + failure/escalation; artifact/write
50
- owner; proof; exit/next route. Omit inapplicable fields; headings may vary.
51
- Examples/anti-examples distinguish branches/misuse.
52
- - Split only for an independent activation/read path or fresh evals proving inline
53
- premature exit; otherwise keep one owner.
54
- - Co-locate a concept's definition, rule, caveat, and example at one load tier;
55
- branch references carry whole clusters.
45
+ - Ordered steps end in checkable criteria.
46
+ - One read shows outcome, triggers, preconditions, decisions/failure, write owner,
47
+ proof, exit; omit irrelevant fields. Examples distinguish branches.
48
+ - Split only for independent load path or eval-proven inline failure; keep one owner;
49
+ move each definition/rule/caveat/example cluster together.
56
50
  - Every public optional-flag skill obeys the shared
57
51
  [`core.md`](core.md#operating-rules-every-phase): declare its
58
52
  complete flag surface in `argument-hint`,
@@ -92,17 +86,15 @@ regresses.
92
86
  External sources are references, not authority. Promote only when one
93
87
  `docs/research/` admission record contains:
94
88
 
95
- - **Provenance:** source, commit/date, files, license/attribution. Unclear rights
96
- reference-only, independently written DevRites prose.
97
- - **Gap + owner:** observed DevRites failure and existing canonical owner; extend
98
- before adding a surface.
99
- - **Adaptation + cost:** exact DevRites delta without foreign brands/paths/chains/
100
- host assumptions; justify dependency/context/process/hook/agent/command. Prefer
101
- native/existing/stdlib/CLI.
102
- - **Proof + disposition:** distinguishing positive/negative checks, host/package
103
- parity, and rejection reasons.
89
+ - **Provenance:** origin, review date/files, adaptation, and derived targets; external assets add
90
+ source URL/SHA/path/license, local/user assets add relative path/digest/owner. Unverified
91
+ external origin/rights reference-only, independently written prose.
92
+ - **Gap + owner:** observed failure and existing canonical owner; extend before adding.
93
+ - **Adaptation + cost:** native delta, no foreign brands/paths/host assumptions; justify every
94
+ dependency, context, process, hook, agent, or command.
95
+ - **Proof + disposition:** positive/negative checks, host/package parity, rejection reasons.
104
96
 
105
- A missing field means no promotion.
97
+ Missing field no promotion.
106
98
 
107
99
  ## Match form to failure
108
100
 
@@ -115,9 +107,15 @@ A missing field means no promotion.
115
107
 
116
108
  Behavior-shaping prose is code:
117
109
 
118
- 1. Run a no-guidance baseline; if it does not fail, do not add guidance.
119
- 2. Run at least five fresh-context reps per variant; inspect every flagged run.
120
- 3. Treat divergent interpretations as a rewrite signal, never an average.
110
+ 1. Baseline without guidance; if it passes, add none.
111
+ 2. Run ≥5 fresh-context reps/variant; inspect every flagged run.
112
+ 3. Divergent interpretations require rewrite, not averaging.
113
+ 4. Pin host/model/build, corpus, grader, and candidate digest or commit+path. Report tasks/trials,
114
+ arms, same-build A/A noise before A/B, sanitized per-trial verdicts/metrics, invalid/null results,
115
+ variance, process versus job outcome, and supported/unproved claims. Never capture raw transcripts;
116
+ lost grading signal is `cannot_verify`.
117
+
118
+ CI validates only corpora/deterministic artifacts—never paid sessions or lexical-as-model claims.
121
119
 
122
120
  ## Pruning
123
121
 
@@ -126,11 +124,8 @@ guards. Fill omitted decisions or mark a deliberate branch.
126
124
 
127
125
  ## Contribution preflight
128
126
 
129
- Record catalog search, why an existing owner fails, evals, host parity, and
130
- public/internal surface.
131
- Public commands need docs/generated hosts/reply marker;
132
- internal skills need trigger/not-for plus proof they are not an agent/reference.
133
- Agents need role/scope/mode/output/composition and
134
- [`agents.md` § Result admission](agents.md#result-admission) for review roles.
135
- Only `devrites-slice-wright` writes product source/tests. The controlling root's
136
- path-bounded `.devrites/**` workflow artifacts follow `workflow-artifacts.md`.
127
+ Record catalog search, owner gap, evals, host parity, and public/internal surface. Public
128
+ commands need docs/generated hosts/reply marker; internal skills need trigger/exclusion and
129
+ skill-not-agent proof. Agents need role/scope/mode/output/composition plus
130
+ [Result admission](agents.md#result-admission) for reviewers. Only `devrites-slice-wright`
131
+ writes product source/tests; root-owned bounded `.devrites/**` follows `workflow-artifacts.md`.
@@ -4,6 +4,10 @@
4
4
  - The test was seen fail for the right reason.
5
5
  - Verification commands and relevant output are recorded.
6
6
  - Regression, edge, and error paths match the acceptance criteria.
7
+ - Applicable data, integration, topology, compatibility, concurrency, retry, interruption,
8
+ and time-zone risks have discriminating cases or a recorded dismissal.
9
+ - Mocks do not remove the risk being claimed; wiring proof follows real data to the promised surface.
10
+ - A claimed pre-existing/environment-only failure has a same-command baseline.
7
11
  - Passing existing tests alone is not proof of the change.
8
12
 
9
13
  Detailed standard: `testing.md`.
@@ -24,6 +24,10 @@ covered, not lines executed: 100% line coverage can still leave a button's click
24
24
  and a button with one asserting unit test is "covered" at far less than 100% lines. Chase the
25
25
  behavior, not the number.
26
26
 
27
+ Poor test coverage or missing tests in a brownfield area is baseline risk, not permission to leave
28
+ the changed behavior unproven. Add the smallest surface-anchored regression test and separate
29
+ pre-existing failures with same-command evidence.
30
+
27
31
  Acceptance and tests are **surface-anchored**: assert the outermost surface the intent names. If the feature promised an API response, assert the API response; a database row behind it is supporting evidence, not proof.
28
32
 
29
33
  Put each test at the level that proves it cheapest and most reliably (the pyramid above):
@@ -54,14 +58,14 @@ runtime behavior. Explicit shell assertions and golden/text comparisons remain v
54
58
  criterion genuinely concerns a textual or command-line artifact and the assertion
55
59
  discriminates the required result.
56
60
 
57
- - **No tautological assertions.** `expect(result).toBeDefined()` / `.not.toBeNull()` /
58
- `assert x is not None` pass for almost any return value. Assert the **actual value or
59
- observable effect**: `expect(total).toBe(42)`, the specific error thrown, the state changed,
60
- the row written, the event emitted.
61
+ - **Preserve producer failure.** `test-command | tail` may hide a failed producer. Require
62
+ upstream-failure semantics or separately check its status; truncated output is not a pass.
63
+ - **No tautologies.** Defined/non-null passes for almost anything; assert exact value, error,
64
+ state change, row, or event.
61
65
  - **Don't assert the mock.** A test that stubs a dependency to return `X` then asserts `X` came
62
66
  back tests the stub, not your code. Assert the real effect on real (or realistic) data.
63
- - **Cover the unhappy edges, not just the happy path.** AI is strong on "valid input → success"
64
- and weak on empty / boundary / invalid-state / long-or-weird input: write those explicitly.
67
+ - **Cover unhappy edges:** empty/missing input, omitted fields, boundaries, invalid state, and
68
+ long/weird input; assert the promised rejection/default.
65
69
  - **Prove it can fail.** For a critical or regression path, break the code deliberately and confirm the test goes red; use the project's mutation runner when one exists.
66
70
  - **Don't mirror the implementation.** A test whose assertions restate the code under test
67
71
  (same constant, same formula, same branch) stays green even when the logic is wrong. Assert
@@ -126,6 +130,44 @@ breaks, because it tested the stubs, not the code (see "Don't assert the mock" a
126
130
  | A third-party API or paid/rate-limited service | Your own internal utilities and transforms |
127
131
  | Anything non-deterministic or slow | Validation and mapping under test |
128
132
 
133
+ ## Prove the risk the design actually introduces
134
+
135
+ Select cases from the accepted spec and applicable standards, not a generic count:
136
+
137
+ - Durable data changes apply [`data-integrity.md`](data-integrity.md): invalid write,
138
+ duplicate/retry, concurrent update, interrupted migration/backfill, old/new version
139
+ coexistence, tenant denial, and rollback/forward recovery as relevant.
140
+ - API/webhook/queue/cache work applies
141
+ [`integration-reliability.md`](integration-reliability.md): invalid/partial response,
142
+ auth failure, timeout/unknown outcome, rate limit, outage, duplicate, out-of-order,
143
+ poison/backlog, and stale-cache/partition behavior as relevant.
144
+ - Multi-root/service work applies [`repository-topology.md`](repository-topology.md):
145
+ provider and consumer both consume the canonical contract and run from their proven
146
+ roots. One member's green suite cannot prove another member.
147
+ - Compatibility/delivery work drives both feature-flag states and old/new caller or
148
+ schema combinations. Migration-before-code and code-before-migration order each need a
149
+ declared expected result.
150
+
151
+ Dismiss an irrelevant case with a reason; silently omitting an applicable case is a gap.
152
+
153
+ ## False-positive and coincidental-reliance checks
154
+
155
+ - **Trace cause to effect.** A test proves wiring only when real input reaches the new
156
+ implementation and its distinct output reaches the promised surface. Registration,
157
+ file existence, a spy call, or a fixture containing the expected text can pass while
158
+ production still uses the old path.
159
+ - **Change the load-bearing input or implementation.** For a critical link, perturb the
160
+ input or break the link and observe the surface assertion fail. If another path happens
161
+ to produce the same output, the test relies on coincidence and needs a discriminating
162
+ fixture/assertion.
163
+ - **Do not mock away the named risk.** A timeout test whose mock cannot time out, a
164
+ transaction test without transaction boundaries, or a tenant test with one tenant is
165
+ mislabeled coverage. Use a contract-capable fake, local integration surface, sandbox,
166
+ or authorized real boundary appropriate to the risk.
167
+ - **Baseline environmental claims.** "Pre-existing", "only fails in CI", or "works in one
168
+ region/time zone" requires a before-candidate run or other dated baseline on the same
169
+ command and environment. Without it, classify the result as unresolved.
170
+
129
171
  ## Determinism: no flaky tests
130
172
  - A flaky test is a broken test. Isolate and fix it immediately; don't paper over it with
131
173
  retries or `sleep`.
@@ -137,6 +179,9 @@ breaks, because it tested the stubs, not the code (see "Don't assert the mock" a
137
179
  output is pinned in tests. A raw `time.Now()` feeding output makes a golden snapshot rot at the
138
180
  next day boundary: green today, red tomorrow, for no code change. The test must control time so
139
181
  its result depends on behavior, not when the suite runs.
182
+ - Pin the time zone and locale independently of the instant. Cover offset/date rollover,
183
+ daylight-saving gap/fold where the product supports it, and serialization round trips;
184
+ a UTC-only unit test does not prove local-calendar behavior.
140
185
  - **No elapsed-time assertions.** `assert elapsed < 200ms` / `took` under a threshold tests the
141
186
  CI runner's load, not your code: flaky by construction. Assert the *result*, not the duration;
142
187
  for ordering or concurrency use a deterministic signal (a fake clock, a channel), never a `sleep`.