devrites 5.10.2 → 5.11.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 (250) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/README.md +24 -10
  3. package/bin/devrites.mjs +2 -0
  4. package/docs/command-map.md +5 -4
  5. package/docs/skills.md +10 -4
  6. package/engine/internal/devritespaths/paths.go +2 -0
  7. package/engine/internal/hostpack/hostpack.go +39 -5
  8. package/engine/internal/hostpack/hostpack_test.go +27 -13
  9. package/engine/internal/install/apply.go +17 -4
  10. package/engine/internal/install/install.go +9 -2
  11. package/engine/internal/install/install_test.go +15 -2
  12. package/engine/internal/install/preflight.go +8 -2
  13. package/engine/internal/install/update.go +1 -1
  14. package/install.sh +4 -1
  15. package/pack/generated/README.md +4 -2
  16. package/pack/generated/devin/AGENTS.md +23 -0
  17. package/pack/generated/devin/agents/devrites-code-reviewer.md +145 -0
  18. package/pack/generated/devin/agents/devrites-devex-reviewer.md +126 -0
  19. package/pack/generated/devin/agents/devrites-doubt-reviewer.md +91 -0
  20. package/pack/generated/devin/agents/devrites-evidence-scout.md +77 -0
  21. package/pack/generated/devin/agents/devrites-frontend-reviewer.md +119 -0
  22. package/pack/generated/devin/agents/devrites-performance-reviewer.md +117 -0
  23. package/pack/generated/devin/agents/devrites-plan-drafter.md +102 -0
  24. package/pack/generated/devin/agents/devrites-plan-reviewer.md +144 -0
  25. package/pack/generated/devin/agents/devrites-proof-runner.md +76 -0
  26. package/pack/generated/devin/agents/devrites-retrospector.md +64 -0
  27. package/pack/generated/devin/agents/devrites-security-auditor.md +112 -0
  28. package/pack/generated/devin/agents/devrites-simplifier-reviewer.md +97 -0
  29. package/pack/generated/devin/agents/devrites-slice-wright.md +219 -0
  30. package/pack/generated/devin/agents/devrites-spec-reviewer.md +99 -0
  31. package/pack/generated/devin/agents/devrites-strategy-reviewer.md +102 -0
  32. package/pack/generated/devin/agents/devrites-test-analyst.md +97 -0
  33. package/pack/generated/devin/agents/devrites-upgrade-planner.md +91 -0
  34. package/pack/generated/devin/skills/devrites-api-interface/SKILL.md +64 -0
  35. package/pack/generated/devin/skills/devrites-audit/SKILL.md +51 -0
  36. package/pack/generated/devin/skills/devrites-browser-proof/SKILL.md +77 -0
  37. package/pack/generated/devin/skills/devrites-browser-proof/reference/browser-performance.md +15 -0
  38. package/pack/generated/devin/skills/devrites-browser-proof/reference/visual-verdict.md +34 -0
  39. package/pack/generated/devin/skills/devrites-debug-recovery/SKILL.md +97 -0
  40. package/pack/generated/devin/skills/devrites-debug-recovery/reference/build-the-loop.md +58 -0
  41. package/pack/generated/devin/skills/devrites-debug-recovery/reference/cleanup-and-classify.md +34 -0
  42. package/pack/generated/devin/skills/devrites-debug-recovery/reference/hypotheses.md +17 -0
  43. package/pack/generated/devin/skills/devrites-debug-recovery/reference/instrumentation.md +21 -0
  44. package/pack/generated/devin/skills/devrites-debug-recovery/reference/regression-test.md +30 -0
  45. package/pack/generated/devin/skills/devrites-debug-recovery/reference/trace.md +25 -0
  46. package/pack/generated/devin/skills/devrites-doubt/SKILL.md +80 -0
  47. package/pack/generated/devin/skills/devrites-frontend-craft/SKILL.md +87 -0
  48. package/pack/generated/devin/skills/devrites-frontend-craft/reference/craft.md +63 -0
  49. package/pack/generated/devin/skills/devrites-frontend-craft/reference/design-references.md +116 -0
  50. package/pack/generated/devin/skills/devrites-frontend-craft/reference/fullstack.md +46 -0
  51. package/pack/generated/devin/skills/devrites-frontend-craft/reference/quality-standards.md +294 -0
  52. package/pack/generated/devin/skills/devrites-frontend-craft/reference/reuse-first.md +53 -0
  53. package/pack/generated/devin/skills/devrites-frontend-craft/reference/shape.md +56 -0
  54. package/pack/generated/devin/skills/devrites-interview/SKILL.md +103 -0
  55. package/pack/generated/devin/skills/devrites-lib/SKILL.md +57 -0
  56. package/pack/generated/devin/skills/devrites-lib/reference/candidate-integrity.md +42 -0
  57. package/pack/generated/devin/skills/devrites-lib/reference/intent-map.md +64 -0
  58. package/pack/generated/devin/skills/devrites-lib/reference/orchestration-profiles.md +27 -0
  59. package/pack/generated/devin/skills/devrites-lib/reference/parallel-dispatch.md +73 -0
  60. package/pack/generated/devin/skills/devrites-lib/reference/reply-contract.md +88 -0
  61. package/pack/generated/devin/skills/devrites-lib/reference/standards/README.md +60 -0
  62. package/pack/generated/devin/skills/devrites-lib/reference/standards/acceptance-preserving-reslice.md +30 -0
  63. package/pack/generated/devin/skills/devrites-lib/reference/standards/afk-hitl.md +415 -0
  64. package/pack/generated/devin/skills/devrites-lib/reference/standards/agents.md +99 -0
  65. package/pack/generated/devin/skills/devrites-lib/reference/standards/anti-patterns.md +48 -0
  66. package/pack/generated/devin/skills/devrites-lib/reference/standards/browser-proof-checklist.md +24 -0
  67. package/pack/generated/devin/skills/devrites-lib/reference/standards/ci-cd.md +50 -0
  68. package/pack/generated/devin/skills/devrites-lib/reference/standards/code-navigation.md +43 -0
  69. package/pack/generated/devin/skills/devrites-lib/reference/standards/code-review.md +108 -0
  70. package/pack/generated/devin/skills/devrites-lib/reference/standards/coding-style.md +48 -0
  71. package/pack/generated/devin/skills/devrites-lib/reference/standards/context-hygiene.md +109 -0
  72. package/pack/generated/devin/skills/devrites-lib/reference/standards/core.md +167 -0
  73. package/pack/generated/devin/skills/devrites-lib/reference/standards/data-integrity.md +118 -0
  74. package/pack/generated/devin/skills/devrites-lib/reference/standards/debug-recovery.md +28 -0
  75. package/pack/generated/devin/skills/devrites-lib/reference/standards/definition-of-done.md +19 -0
  76. package/pack/generated/devin/skills/devrites-lib/reference/standards/deprecation.md +31 -0
  77. package/pack/generated/devin/skills/devrites-lib/reference/standards/developer-experience.md +119 -0
  78. package/pack/generated/devin/skills/devrites-lib/reference/standards/development-workflow.md +29 -0
  79. package/pack/generated/devin/skills/devrites-lib/reference/standards/documentation.md +43 -0
  80. package/pack/generated/devin/skills/devrites-lib/reference/standards/edge-case-trace.md +92 -0
  81. package/pack/generated/devin/skills/devrites-lib/reference/standards/elicitation.md +85 -0
  82. package/pack/generated/devin/skills/devrites-lib/reference/standards/error-handling.md +47 -0
  83. package/pack/generated/devin/skills/devrites-lib/reference/standards/git-workflow.md +49 -0
  84. package/pack/generated/devin/skills/devrites-lib/reference/standards/hooks.md +25 -0
  85. package/pack/generated/devin/skills/devrites-lib/reference/standards/integration-reliability.md +102 -0
  86. package/pack/generated/devin/skills/devrites-lib/reference/standards/loop-operations.md +85 -0
  87. package/pack/generated/devin/skills/devrites-lib/reference/standards/observability.md +88 -0
  88. package/pack/generated/devin/skills/devrites-lib/reference/standards/one-shot-actions.md +97 -0
  89. package/pack/generated/devin/skills/devrites-lib/reference/standards/patterns.md +68 -0
  90. package/pack/generated/devin/skills/devrites-lib/reference/standards/performance.md +51 -0
  91. package/pack/generated/devin/skills/devrites-lib/reference/standards/principles.md +42 -0
  92. package/pack/generated/devin/skills/devrites-lib/reference/standards/prose-style.md +123 -0
  93. package/pack/generated/devin/skills/devrites-lib/reference/standards/release/ship-checklist.md +8 -0
  94. package/pack/generated/devin/skills/devrites-lib/reference/standards/repository-topology.md +80 -0
  95. package/pack/generated/devin/skills/devrites-lib/reference/standards/review-checklist.md +12 -0
  96. package/pack/generated/devin/skills/devrites-lib/reference/standards/security-checklist.md +25 -0
  97. package/pack/generated/devin/skills/devrites-lib/reference/standards/security.md +202 -0
  98. package/pack/generated/devin/skills/devrites-lib/reference/standards/skill-authoring.md +209 -0
  99. package/pack/generated/devin/skills/devrites-lib/reference/standards/spec-grammar.md +197 -0
  100. package/pack/generated/devin/skills/devrites-lib/reference/standards/test-proof-checklist.md +13 -0
  101. package/pack/generated/devin/skills/devrites-lib/reference/standards/testing.md +212 -0
  102. package/pack/generated/devin/skills/devrites-lib/reference/standards/tooling.md +92 -0
  103. package/pack/generated/devin/skills/devrites-lib/reference/standards/workflow-artifacts.md +427 -0
  104. package/pack/generated/devin/skills/devrites-lib/reference/visual-playbooks/code.md +44 -0
  105. package/pack/generated/devin/skills/devrites-lib/reference/visual-playbooks/comparison.md +42 -0
  106. package/pack/generated/devin/skills/devrites-lib/reference/visual-playbooks/diagram.md +51 -0
  107. package/pack/generated/devin/skills/devrites-lib/reference/visual-playbooks/index.md +66 -0
  108. package/pack/generated/devin/skills/devrites-lib/reference/visual-playbooks/input.md +46 -0
  109. package/pack/generated/devin/skills/devrites-lib/reference/visual-playbooks/outline-template.md +106 -0
  110. package/pack/generated/devin/skills/devrites-lib/reference/visual-playbooks/plan.md +48 -0
  111. package/pack/generated/devin/skills/devrites-lib/reference/visual-playbooks/slides.md +40 -0
  112. package/pack/generated/devin/skills/devrites-lib/reference/visual-playbooks/table.md +42 -0
  113. package/pack/generated/devin/skills/devrites-lib/reference/workspace-artifact-schema.md +267 -0
  114. package/pack/generated/devin/skills/devrites-prose-craft/SKILL.md +74 -0
  115. package/pack/generated/devin/skills/devrites-prose-craft/reference/banned-phrases.md +132 -0
  116. package/pack/generated/devin/skills/devrites-prose-craft/reference/examples.md +131 -0
  117. package/pack/generated/devin/skills/devrites-prose-craft/reference/structures.md +196 -0
  118. package/pack/generated/devin/skills/devrites-source-driven/SKILL.md +53 -0
  119. package/pack/generated/devin/skills/devrites-ux-shape/SKILL.md +135 -0
  120. package/pack/generated/devin/skills/devrites-ux-shape/reference/brief-template.md +108 -0
  121. package/pack/generated/devin/skills/devrites-ux-shape/reference/visual-direction-probe.md +48 -0
  122. package/pack/generated/devin/skills/rite/SKILL.md +148 -0
  123. package/pack/generated/devin/skills/rite/reference/menu.md +48 -0
  124. package/pack/generated/devin/skills/rite-adopt/SKILL.md +51 -0
  125. package/pack/generated/devin/skills/rite-adopt/reference/adoption.md +19 -0
  126. package/pack/generated/devin/skills/rite-adopt/reference/anti-patterns.md +19 -0
  127. package/pack/generated/devin/skills/rite-autocomplete/SKILL.md +142 -0
  128. package/pack/generated/devin/skills/rite-autocomplete/reference/decision-policy.md +43 -0
  129. package/pack/generated/devin/skills/rite-autocomplete/reference/loop.md +151 -0
  130. package/pack/generated/devin/skills/rite-autocomplete/reference/stop-conditions.md +97 -0
  131. package/pack/generated/devin/skills/rite-build/SKILL.md +102 -0
  132. package/pack/generated/devin/skills/rite-build/reference/afk-discipline.md +148 -0
  133. package/pack/generated/devin/skills/rite-build/reference/anti-patterns.md +27 -0
  134. package/pack/generated/devin/skills/rite-build/reference/checkpoint-protocol.md +120 -0
  135. package/pack/generated/devin/skills/rite-build/reference/checkpoint.md +56 -0
  136. package/pack/generated/devin/skills/rite-build/reference/frontend-trigger.md +39 -0
  137. package/pack/generated/devin/skills/rite-build/reference/one-slice-cycle.md +51 -0
  138. package/pack/generated/devin/skills/rite-build/reference/output.md +33 -0
  139. package/pack/generated/devin/skills/rite-build/reference/parallel-batch.md +214 -0
  140. package/pack/generated/devin/skills/rite-build/reference/phase-contract.md +89 -0
  141. package/pack/generated/devin/skills/rite-build/reference/spec-drift-guard.md +84 -0
  142. package/pack/generated/devin/skills/rite-build/reference/tdd.md +27 -0
  143. package/pack/generated/devin/skills/rite-build/reference/wright-dispatch.md +96 -0
  144. package/pack/generated/devin/skills/rite-clarify/SKILL.md +98 -0
  145. package/pack/generated/devin/skills/rite-clarify/reference/anti-patterns.md +24 -0
  146. package/pack/generated/devin/skills/rite-clarify/reference/decision-coverage.md +55 -0
  147. package/pack/generated/devin/skills/rite-converge/SKILL.md +144 -0
  148. package/pack/generated/devin/skills/rite-converge/reference/anti-patterns.md +35 -0
  149. package/pack/generated/devin/skills/rite-converge/reference/convergence-assessment.md +65 -0
  150. package/pack/generated/devin/skills/rite-customize/SKILL.md +60 -0
  151. package/pack/generated/devin/skills/rite-define/SKILL.md +168 -0
  152. package/pack/generated/devin/skills/rite-define/reference/anti-patterns.md +26 -0
  153. package/pack/generated/devin/skills/rite-define/reference/gates.md +159 -0
  154. package/pack/generated/devin/skills/rite-define/reference/plan-template.md +149 -0
  155. package/pack/generated/devin/skills/rite-doctor/SKILL.md +68 -0
  156. package/pack/generated/devin/skills/rite-dogfood/SKILL.md +55 -0
  157. package/pack/generated/devin/skills/rite-explain/SKILL.md +152 -0
  158. package/pack/generated/devin/skills/rite-explain/reference/intake.md +89 -0
  159. package/pack/generated/devin/skills/rite-frame/SKILL.md +114 -0
  160. package/pack/generated/devin/skills/rite-frame/reference/failure-modes.md +66 -0
  161. package/pack/generated/devin/skills/rite-handoff/SKILL.md +97 -0
  162. package/pack/generated/devin/skills/rite-handoff/reference/handoff-template.md +44 -0
  163. package/pack/generated/devin/skills/rite-learn/SKILL.md +72 -0
  164. package/pack/generated/devin/skills/rite-plan/SKILL.md +185 -0
  165. package/pack/generated/devin/skills/rite-plan/reference/anti-patterns.md +34 -0
  166. package/pack/generated/devin/skills/rite-plan/reference/dependency-graph.md +48 -0
  167. package/pack/generated/devin/skills/rite-plan/reference/replan-and-repair.md +105 -0
  168. package/pack/generated/devin/skills/rite-plan/reference/slicing.md +168 -0
  169. package/pack/generated/devin/skills/rite-plan/reference/task-breakdown.md +42 -0
  170. package/pack/generated/devin/skills/rite-polish/SKILL.md +105 -0
  171. package/pack/generated/devin/skills/rite-polish/reference/adr-promotion.md +11 -0
  172. package/pack/generated/devin/skills/rite-polish/reference/anti-ai-slop.md +187 -0
  173. package/pack/generated/devin/skills/rite-polish/reference/anti-patterns.md +30 -0
  174. package/pack/generated/devin/skills/rite-polish/reference/backend-polish.md +80 -0
  175. package/pack/generated/devin/skills/rite-polish/reference/browser-polish-evidence.md +33 -0
  176. package/pack/generated/devin/skills/rite-polish/reference/code.md +82 -0
  177. package/pack/generated/devin/skills/rite-polish/reference/design-memory.md +117 -0
  178. package/pack/generated/devin/skills/rite-polish/reference/design-system-discovery.md +8 -0
  179. package/pack/generated/devin/skills/rite-polish/reference/harden-checklist.md +109 -0
  180. package/pack/generated/devin/skills/rite-polish/reference/ledger.md +65 -0
  181. package/pack/generated/devin/skills/rite-polish/reference/ui.md +137 -0
  182. package/pack/generated/devin/skills/rite-pov/SKILL.md +57 -0
  183. package/pack/generated/devin/skills/rite-pr-feedback/SKILL.md +54 -0
  184. package/pack/generated/devin/skills/rite-pressure-test/SKILL.md +66 -0
  185. package/pack/generated/devin/skills/rite-prototype/SKILL.md +104 -0
  186. package/pack/generated/devin/skills/rite-prove/SKILL.md +122 -0
  187. package/pack/generated/devin/skills/rite-prove/reference/acceptance-proof.md +88 -0
  188. package/pack/generated/devin/skills/rite-prove/reference/anti-patterns.md +25 -0
  189. package/pack/generated/devin/skills/rite-prove/reference/browser-proof.md +51 -0
  190. package/pack/generated/devin/skills/rite-prove/reference/failure-triage.md +43 -0
  191. package/pack/generated/devin/skills/rite-prove/reference/proof-ladder.md +28 -0
  192. package/pack/generated/devin/skills/rite-prove/reference/test-command-discovery.md +30 -0
  193. package/pack/generated/devin/skills/rite-quick/SKILL.md +81 -0
  194. package/pack/generated/devin/skills/rite-resolve/SKILL.md +98 -0
  195. package/pack/generated/devin/skills/rite-resolve/reference/answer-protocol.md +118 -0
  196. package/pack/generated/devin/skills/rite-review/SKILL.md +171 -0
  197. package/pack/generated/devin/skills/rite-review/reference/anti-patterns.md +32 -0
  198. package/pack/generated/devin/skills/rite-review/reference/cognitive-load.md +90 -0
  199. package/pack/generated/devin/skills/rite-review/reference/feature-scoped-review.md +26 -0
  200. package/pack/generated/devin/skills/rite-review/reference/five-axis-review.md +66 -0
  201. package/pack/generated/devin/skills/rite-review/reference/nielsen-heuristics.md +126 -0
  202. package/pack/generated/devin/skills/rite-review/reference/performance-checklist.md +80 -0
  203. package/pack/generated/devin/skills/rite-review/reference/performance-review.md +14 -0
  204. package/pack/generated/devin/skills/rite-review/reference/security-review.md +42 -0
  205. package/pack/generated/devin/skills/rite-seal/SKILL.md +74 -0
  206. package/pack/generated/devin/skills/rite-seal/reference/anti-patterns.md +29 -0
  207. package/pack/generated/devin/skills/rite-seal/reference/final-evidence.md +41 -0
  208. package/pack/generated/devin/skills/rite-seal/reference/go-no-go.md +29 -0
  209. package/pack/generated/devin/skills/rite-seal/reference/output.md +5 -0
  210. package/pack/generated/devin/skills/rite-seal/reference/phase-contract.md +47 -0
  211. package/pack/generated/devin/skills/rite-seal/reference/risk-and-rollback.md +56 -0
  212. package/pack/generated/devin/skills/rite-seal/reference/seal-template.md +27 -0
  213. package/pack/generated/devin/skills/rite-ship/SKILL.md +87 -0
  214. package/pack/generated/devin/skills/rite-ship/reference/anti-patterns.md +28 -0
  215. package/pack/generated/devin/skills/rite-ship/reference/close-out.md +68 -0
  216. package/pack/generated/devin/skills/rite-ship/reference/git-ship.md +120 -0
  217. package/pack/generated/devin/skills/rite-ship/reference/rollout.md +62 -0
  218. package/pack/generated/devin/skills/rite-ship/reference/ship-template.md +39 -0
  219. package/pack/generated/devin/skills/rite-spec/SKILL.md +149 -0
  220. package/pack/generated/devin/skills/rite-spec/reference/acceptance-criteria.md +31 -0
  221. package/pack/generated/devin/skills/rite-spec/reference/ai-spec-template.md +40 -0
  222. package/pack/generated/devin/skills/rite-spec/reference/anti-patterns.md +27 -0
  223. package/pack/generated/devin/skills/rite-spec/reference/interview-patterns.md +56 -0
  224. package/pack/generated/devin/skills/rite-spec/reference/investigation.md +83 -0
  225. package/pack/generated/devin/skills/rite-spec/reference/question-protocol.md +36 -0
  226. package/pack/generated/devin/skills/rite-spec/reference/references-intake.md +62 -0
  227. package/pack/generated/devin/skills/rite-spec/reference/spec-checklists.md +89 -0
  228. package/pack/generated/devin/skills/rite-spec/reference/spec-template.md +154 -0
  229. package/pack/generated/devin/skills/rite-spec/reference/state-workspace.md +227 -0
  230. package/pack/generated/devin/skills/rite-status/SKILL.md +57 -0
  231. package/pack/generated/devin/skills/rite-temper/SKILL.md +129 -0
  232. package/pack/generated/devin/skills/rite-temper/reference/anti-patterns.md +30 -0
  233. package/pack/generated/devin/skills/rite-temper/reference/review-dimensions.md +66 -0
  234. package/pack/generated/devin/skills/rite-temper/reference/scope-modes.md +53 -0
  235. package/pack/generated/devin/skills/rite-temper/reference/significance.md +46 -0
  236. package/pack/generated/devin/skills/rite-temper/reference/strategy-template.md +90 -0
  237. package/pack/generated/devin/skills/rite-upgrade/SKILL.md +121 -0
  238. package/pack/generated/devin/skills/rite-vet/SKILL.md +192 -0
  239. package/pack/generated/devin/skills/rite-vet/reference/anti-patterns.md +43 -0
  240. package/pack/generated/devin/skills/rite-vet/reference/artifacts.md +202 -0
  241. package/pack/generated/devin/skills/rite-vet/reference/cross-model.md +19 -0
  242. package/pack/generated/devin/skills/rite-vet/reference/depth.md +59 -0
  243. package/pack/generated/devin/skills/rite-vet/reference/eng-lenses.md +48 -0
  244. package/pack/generated/devin/skills/rite-vet/reference/review-axes.md +201 -0
  245. package/pack/generated/devin/skills/rite-watch-pr/SKILL.md +84 -0
  246. package/pack/generated/devin/skills/rite-zoom-out/SKILL.md +69 -0
  247. package/package.json +4 -2
  248. package/scripts/build-host-artifacts.sh +48 -5
  249. package/scripts/devin-generate.sh +222 -0
  250. package/update.sh +2 -1
@@ -0,0 +1,427 @@
1
+ # Workflow Artifact identity
2
+
3
+ Workflow Artifact plans/isolates/proves; never enters product candidate/readiness/
4
+ built count or authorizes consumption. Module owns semantics; callers retain only
5
+ link and entry/return.
6
+
7
+ ## Contents
8
+
9
+ - [Vet admission](#vet-admission)
10
+ - [Workflow Artifact admission](#workflow-artifact-admission)
11
+ - [Owner, namespace, promotion, and reads](#owner-namespace-promotion-and-reads)
12
+ - [Frozen source and identity](#frozen-source-and-identity)
13
+ - [Journal and complete writes](#journal-and-complete-writes)
14
+ - [Workflow Artifact journal](#workflow-artifact-journal)
15
+ - [Canonical operation table](#canonical-operation-table)
16
+ - [State, proof, and retry](#state-proof-and-retry)
17
+ - [Route classifier](#route-classifier)
18
+ - [Public diagnostics](#public-diagnostics)
19
+ - [Phase adapters](#phase-adapters)
20
+
21
+ ## Vet admission
22
+
23
+ Vet admits one `test-plan.md` block when a target is active; when no active
24
+ target, record `Workflow Artifact admission: not applicable — no active target
25
+ admitted` instead.
26
+
27
+ ```markdown
28
+ ## Workflow Artifact admission
29
+ DevRites contract: devrites.workflow-artifact-admission.v1
30
+
31
+ | Field | Value |
32
+ | --- | --- |
33
+ | active_slug | `<validated slug>` |
34
+ | readiness_binding_command | `devrites-engine check readiness --emit-binding <slug>` |
35
+ | return_phase | `<phase>` |
36
+ | return_next_action | `<exact action>` |
37
+ | target_order | `utf8-bytewise-path-ascending` |
38
+ | target_count_limit | `<positive base-10>` |
39
+ | per_target_bytes_limit | `<positive base-10>` |
40
+ | aggregate_bytes_limit | `<positive base-10>` |
41
+ | transaction_file_limit | `<positive base-10>` |
42
+ | diagnostic_bytes_limit | `256` |
43
+ | journal_line_limit | `<positive base-10>` |
44
+ | attempt_epoch_limit | `<base-10 integer at least 3>` |
45
+ | proof_command_timeout_seconds | `<positive base-10>` |
46
+ | proof_aggregate_timeout_seconds | `<positive base-10>` |
47
+ | proof_terminate_grace_seconds | `<positive base-10>` |
48
+
49
+ | Index | Path | Mode | Behavior ref | Interface ref | Positive fixture | Failure fixtures | Proof command | Proof cwd | Proof signal | Rollback | Evidence fields |
50
+ | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
51
+ | `<8hex>` | `<workspace-relative path>` | `<0[0-7]{3}>` | `<WA-BEH-ID>` | `<WA-IF-ID>` | `<WA-FIX-ID>` | `<comma-separated IDs>` | `<single command>` | `<logical cwd>` | `<fixed signal>` | `<fixed relation>` | `<comma-separated fields>` |
52
+ ```
53
+
54
+ Row order=normalized-path UTF-8; `Index`=zero-based `8hex`. Path=normalized active-
55
+ workspace-relative UTF-8; reject absolute/traversal/newline, duplicate, directory,
56
+ glob, symlink, product/dependency, or unresolved. Mode=base-8 `0[0-7]{3}`. Markdown
57
+ `|` delimits after an even backslash run; odd escapes; decoding removes only that
58
+ backslash.
59
+
60
+ IDs occur once in behavior/interface/positive/listed-failure order:
61
+ `WA-BEH-[A-Z0-9][A-Z0-9-]*`; `WA-IF-[A-Z0-9][A-Z0-9-]*`;
62
+ `WA-FIX-P[A-Z0-9][A-Z0-9-]*`; `WA-FIX-F[A-Z0-9][A-Z0-9-]*`. Each `## <ID>` plus
63
+ `DevRites workflow reference: <behavior|interface|positive-fixture|failure-fixture>`
64
+ precedes an exact ordered `Field | Value` table: behavior
65
+ `success,observable_effect`; interface `inputs,invariants,ordering,errors,
66
+ configuration,performance`; positive `setup,action,expected`; failure
67
+ `setup,fault,expected`. Values are nonempty single-line backtick cells. Before
68
+ mutation reject placeholders, missing/extra/reordered fields, duplicates, and
69
+ referenced-empty blocks.
70
+
71
+ Proof command=one unchanged trusted Vet-approved repository command; exclude `;`,
72
+ `&&`, `||`, newline, unescaped/list-separator `|`. Cwd=`repository-root` or
73
+ `active-workspace`. Signal=fixed printable ASCII without CR/LF, 1..128 bytes.
74
+ Rollback=`restore-preimage-or-absence`. Evidence=unique comma-separated lowercase
75
+ identifiers. `return_phase`=lifecycle phase; `return_next_action`=exact slash action
76
+ bound to `active_slug`. Malformed admission/reference routes Plan/Vet before mutation.
77
+
78
+ Checked nonnegative arithmetic rejects overflow. Bounds: rows
79
+ `1..target_count_limit`; per-target/aggregate content; `transaction_file_limit >=
80
+ 3*target_count_limit+6`; `diagnostic_bytes_limit=256` including LF;
81
+ `attempt_epoch_limit>=3`; `journal_line_limit >=
82
+ 30+target_count_limit+attempt_epoch_limit`; complete evidence <=280 lines;
83
+ `command_timeout>terminate_grace>0`; `aggregate_timeout>=command_timeout`.
84
+ Transaction-file/journal minima use declared `target_count_limit`, never row count.
85
+ Fixtures: minima/minimum-1, overflow, sparse/high-limit, content/row limits,
86
+ evidence headroom.
87
+
88
+ ## Frozen source and identity
89
+
90
+ Disposable same-layout preflight authors exact bytes. `slug_bytes` is validated
91
+ slug UTF-8; `binding_bytes` decodes current 64-lowercase-hex binding:
92
+
93
+ ```text
94
+ handle_digest = SHA-256(
95
+ "devrites.workflow-source.v1\0" ||
96
+ uint32-be(len(slug_bytes)) || slug_bytes || binding_bytes
97
+ )
98
+ source_handle = "wsrc:" || lowercase-hex(handle_digest)
99
+ resolver_path = ".workflow-artifact-sources/" || lowercase-hex(handle_digest)
100
+ ```
101
+
102
+ `\0` is one NUL; lengths are uint32-be byte counts; concatenation adds nothing.
103
+ Identity rows sort by normalized-path UTF-8 bytes:
104
+
105
+ ```text
106
+ identity_digest = SHA-256(
107
+ "devrites.workflow-identity.v1\0" || uint32-be(target_count) ||
108
+ each(uint32-be(len(path_utf8)) || path_utf8 ||
109
+ uint32-be(planned_mode) || 32-byte-content-hash)
110
+ )
111
+ ```
112
+
113
+ Golden input: slug `demo`, zero-64hex binding, `scripts/prove.py`, mode `0755`
114
+ (decimal 493), bytes `print("ok")` plus LF:
115
+
116
+ | Value | Exact result |
117
+ | --- | --- |
118
+ | source filename | `00000000` |
119
+ | content SHA-256 | `3a66aebdedbad3cf107d24e72a07d4b735819b1cf4020fdd922f63c064708172` |
120
+ | handle digest | `1557f28b7dbf713ae3828b0dc4e914702ba34063f65393d4f8b57d99bc6af3ad` |
121
+ | logical handle | `wsrc:1557f28b7dbf713ae3828b0dc4e914702ba34063f65393d4f8b57d99bc6af3ad` |
122
+ | resolver path | `.workflow-artifact-sources/1557f28b7dbf713ae3828b0dc4e914702ba34063f65393d4f8b57d99bc6af3ad` |
123
+ | identity digest | `ce333944056552cf645c36cd03b5cd65774d167b5e920118639c6062e29f5c82` |
124
+
125
+ ### Owner, namespace, promotion, and reads
126
+
127
+ Pre-journal under umask `077`, active-workspace no-follow fd creates/opens
128
+ `.workflow-artifact-sources`: current-user exact `0700`. `.owner.lock`: create
129
+ `O_RDWR|O_CREAT|O_EXCL|O_NOFOLLOW|O_CLOEXEC`, `0600`; on `EEXIST`, no-follow open,
130
+ require current-user regular single-link `0600`; sync creations/parents. Use only Python `fcntl.flock(fd, fcntl.LOCK_EX | fcntl.LOCK_NB)`, never
131
+ lockf/F_SETLK/another domain; retain CLOEXEC fd through final generation.
132
+ Unsupported/access/metadata/bootstrap failure → `WA-R021-ACCESS-DENIED` before
133
+ mutation; busy → `WA-R001-OWNER-BUSY`, zero post-open writes. Under lock compare
134
+ monotonic generation and owned-section SHA-256 before promotion.
135
+
136
+ Namespace allowlist: `.owner.lock`; one canonical or exact stale replacement; one
137
+ recognized `.<hex>.preparing`; `.stale-cleanup` only during validated rollover.
138
+ Unknown entries block untouched. Build same-parent `.<handle-hex>.preparing`, mode
139
+ `0700`, with current-user regular single-link mode-`0600` indexed sources and exact
140
+ synced metadata:
141
+
142
+ ```text
143
+ .authority:
144
+ devrites.workflow-source-authority.v1
145
+ handle=<source_handle>
146
+ readiness=<readiness-binding>
147
+
148
+ .ready:
149
+ devrites.workflow-source-ready.v1
150
+ count=<decimal-target-count>
151
+ identity=<identity-digest-hex>
152
+ ```
153
+
154
+ Write `.authority`, indexes `00000000`..., `.ready`; sync directory; rename to
155
+ `<handle-hex>`; sync parent, all before journal/target mutation. Invalid/missing
156
+ authority stays untouched (`PLAN_VET_REPAIR`). Valid authority plus invalid ready
157
+ permits deleting only that preparation. Exact metadata/cardinality permits only
158
+ promotion or identical-canonical recognition. Resolve canonical no-follow,
159
+ current-user `0700`; open each bounded indexed source once, current-user regular
160
+ single-link `0600`. Held immutable bytes supply SHA-256 and stage writes; never
161
+ validate/reopen. Evidence stores logical handle only, never bytes/path.
162
+
163
+ Under owner lock, stale GC requires no journal/temp/target write, exact old
164
+ authority/readiness/count/index/slug-binding handle, and no unknown entry.
165
+ Complete-write, file-sync, read back, and directory-sync exact mode-`0600`:
166
+
167
+ ```text
168
+ devrites.workflow-source-stale-cleanup.v1
169
+ old_handle=wsrc:<old-handle-hex>
170
+ current_readiness=<current-64hex-binding>
171
+ count=<positive-decimal-target-count>
172
+ ```
173
+
174
+ Then file-sync/read back these exact <=512 bytes in the locked mode-`0600`
175
+ `.owner.lock` descriptor:
176
+
177
+ ```text
178
+ devrites.workflow-source-stale-intent.v1
179
+ old_handle=wsrc:<old-handle-hex>
180
+ old_readiness=<old-64hex-binding>
181
+ current_readiness=<current-64hex-binding>
182
+ identity=<64hex-identity>
183
+ count=<positive-decimal-target-count>
184
+ ```
185
+
186
+ Both require final LF, no extra byte. Sync bundle; rename
187
+ `.<old-hex>.stale-cleaning`; sync parent. Descriptor-relative delete order:
188
+ `.authority`, `.ready`, ascending indexes, `.stale-cleanup`, directory; sync each.
189
+ Exact authenticated intent admits only a partial or empty
190
+ remaining suffix of that order; re-authenticate the intent before every remaining deletion. Treat empty tree
191
+ without intent, malformed intent, or orphan intent lacking canonical/stale-cleaning
192
+ relation as forged: no change; route `WA-R022-STALE-SOURCE-GC-FAILED`. Only after the
193
+ stale directory is absent and parent synced, truncate the held lock intent, sync, and
194
+ read back
195
+ exact empty content.
196
+
197
+ Source persists through retryable `FAILED`; cleanup removes it before `CLEANED`/
198
+ `EXHAUSTED`; post-`CLEANED` absence is expected.
199
+
200
+ ## Journal and complete writes
201
+
202
+ First atomic write records frozen identity/source/epoch/generation plus
203
+ `PREPARING(0,stage,create)`; every effect has prior durable intent. Journal replace:
204
+ same-parent current-user regular single-link mode-`0600` temp; complete-write;
205
+ file/parent sync; atomic replace; no-follow parents supply
206
+ both source and destination directory handles. Stage/backup order: `create→write→mode→file_sync→directory_sync`.
207
+ Complete-write accepts integer progress `1..remaining` only; bool/noninteger/
208
+ nonpositive/oversize, exhausted short write, `ENOSPC`, or error fails boundedly.
209
+ Resume requires exact declared pre/post/valid-partial state.
210
+
211
+ Transaction-private JSON **transaction journal**
212
+ `.workflow-artifact-transactions/<identity-digest>/journal.json` is crash/recovery
213
+ authority; marker-owned `evidence.md` **evidence journal** is bounded durable/public
214
+ evidence. Neither aliases the other. Also sole: `.../stage/<8hex>`,
215
+ `.../backup/<8hex>`, `.evidence.md.workflow-artifact.tmp`.
216
+
217
+ Evidence-journal ownership spans standalone start through end-marker LF. Exact no-separator
218
+ fragments are `<!-- ` + `devrites` + `-workflow-artifact-journal:start -->` and
219
+ `<!-- ` + `devrites` + `-workflow-artifact-journal:end -->`; below they are
220
+ `START-MARKER`/`END-MARKER`:
221
+
222
+ ```markdown
223
+ START-MARKER
224
+ ## Workflow Artifact journal
225
+ DevRites contract: devrites.workflow-artifact-journal.v1
226
+
227
+ | Field | Value |
228
+ | --- | --- |
229
+ | transaction_id | `wtx:<identity-digest>` |
230
+ | attempt_epoch | `<positive base-10>` |
231
+ | attempt_id | `wta:<identity-digest>:<8hex-epoch>` |
232
+ | generation | `<nonnegative base-10>` |
233
+ | owned_section_preimage_sha256 | `<64hex or ABSENT>` |
234
+ | vet_readiness_binding | `<64hex>` |
235
+ | source_handle | `wsrc:<64hex>` |
236
+ | identity_digest | `<64hex>` |
237
+ | state | `<allowlisted state>` |
238
+ | boundary_id | `<allowlisted boundary>` |
239
+ | reason_id | `<allowlisted reason or NONE>` |
240
+ | next_route | `<allowlisted route>` |
241
+ | exhaustion_cause | `<same-fingerprint-count|total-epoch-limit>` |
242
+ | product_candidate_digest | `<64hex>` |
243
+ | product_readiness_binding | `<64hex>` |
244
+ | built_slice_count | `<nonnegative base-10>` |
245
+ | caller_return_phase | `<phase>` |
246
+ | caller_return_next_action | `<exact action>` |
247
+
248
+ | Index | Path | Mode | Content SHA-256 | Preimage | Preimage mode | Preimage SHA-256 | Backup handle | Result |
249
+ | --- | --- | --- | --- | --- | --- | --- | --- | --- |
250
+ | `<8hex>` | `<logical path>` | `<octal>` | `<64hex>` | `present or absent` | `<octal or NONE>` | `<64hex or NONE>` | `<opaque handle or NONE>` | `<allowlisted result>` |
251
+
252
+ | Epoch | Attempt ID | Failure fingerprint | Reason | Boundary | Progress | Result |
253
+ | --- | --- | --- | --- | --- | --- | --- |
254
+ | `<base-10>` | `<attempt ID>` | `<64hex or NONE>` | `<reason or NONE>` | `<boundary>` | `resolved or no-progress or pending` | `<allowlisted result>` |
255
+ END-MARKER
256
+ ```
257
+
258
+ Absent markers append one blank line and section, preserving outside bytes. Before
259
+ mutation reject duplicate/nested/malformed/over-budget markers. Keep one standalone
260
+ `Candidate SHA-256:` and only `product_candidate_digest`. `exhaustion_cause` exists
261
+ only for `EXHAUSTED` with one listed cause; otherwise absent. Immutable attempt rows
262
+ omit bytes, credentials, hostile input, paths, exceptions, and raw errors.
263
+
264
+ ## Canonical operation table
265
+
266
+ Independent observer derives `(operation_id,accepted_pre_state,accepted_post_state,
267
+ failure_route,observer_assertion_id)`. At `WA-OP-014`, read current candidate/
268
+ readiness/built-slice facts from engine/OS, never consumer-authored current/frozen
269
+ values.
270
+
271
+ |Operation ID|Attempt epoch|Durable intent|Accepted pre-state|Accepted post-state|Recoverable partial state|Failure route|Next state/operation|
272
+ |---|---|---|---|---|---|---|---|
273
+ | `WA-OP-001-OWNER-ACQUIRE`|current or 1|none; lock precedes journal read/write|no local owner descriptor|exclusive lock held; generation/owned hash observed|none; busy owner means no write|`WAIT_ACTIVE_OWNER` or `BLOCKED_GATE`|classifier-selected operation|
274
+ | `WA-OP-002-SOURCE-PROMOTE`|1 or retry re-preflight|exact authority/source/ready step before each create/write/mode/sync/rename|lock held; green retained bytes; no active target write|trusted canonical ready bundle|exact valid-authority `.preparing`; exact ready temp; already-identical canonical bundle|`PLAN_VET_REPAIR`|`WA-OP-003-JOURNAL-INIT`|
275
+ | `WA-OP-002A-STALE-SOURCE-GC`|pre-journal only|synced `.stale-cleanup`, then atomic rename to exact stale-cleaning directory|lock held; binding rollover; internally valid old canonical; no journal/temp/target write/unknown entry|stale bundle absent; parent synced|marker in canonical before rename or exact validated stale-cleaning directory with recognized entries missing/remaining|`OFFLINE_RECOVERY`|current `WA-OP-002-SOURCE-PROMOTE`|
276
+ | `WA-OP-003-JOURNAL-INIT`|current|`PREPARING(0,stage,create)` with frozen identity and source handle|lock held; trusted source; absent owned section; target set unmodified|generation advanced; complete owned section in `PREPARING`|exact same-parent evidence temporary; outside bytes unchanged|`OFFLINE_RECOVERY`|`WA-OP-004-STAGE-WRITE`|
277
+ | `WA-OP-004-STAGE-WRITE`|current|`(index,stage,create\|write\|mode\|file_sync\|directory_sync)`|`PREPARING`; source bytes retained; exact target parent|exact private stage bytes/mode synced|exact named partial stage whose metadata is valid|`OFFLINE_RECOVERY`|next stage or `WA-OP-005-BACKUP-WRITE`|
278
+ | `WA-OP-005-BACKUP-WRITE`|current|`(index,backup,create\|write\|mode\|file_sync\|directory_sync)`|`PREPARING`; target still unmodified|exact private backup/preimage-absence record synced|exact named partial backup whose metadata is valid|`OFFLINE_RECOVERY`|next backup or `PREPARED`|
279
+ | `WA-OP-006-INSTALL`|current|`INSTALLING(index)` names exact intent-derived private claim/install artifacts before mutation|`PREPARED`/prior `INSTALLING`; stage/backups exact|atomically move current destination into private claim; validate captured object against exact preimage/frozen expected-post pair; install desired bytes/absence no-replace; exact readback; advance/`INSTALLED`|third state/concurrent occupant preserves claim and occupant when needed and blocks|`OFFLINE_RECOVERY`|next install or `WA-OP-007-PROVE`|
280
+ | `WA-OP-007-PROVE`|current|`PROVING(command-index)` before process-group launch|`INSTALLED`; all targets read back exact|next proof command or durable `PROVED`|reaped process group with fixed failure/timeout boundary; bounded private output only|`OFFLINE_RECOVERY`|`WA-OP-008-ROLLBACK` on pre-`PROVED` failure; else `WA-OP-010-SUCCESS-CLEANUP`|
281
+ | `WA-OP-008-ROLLBACK`|current|`ROLLING_BACK(index)` names exact intent-derived private claim/install artifacts before mutation|replacement occurred; before `PROVED`|atomically move current destination into private claim; validate captured object against exact preimage/frozen expected-post pair; install desired bytes/absence no-replace; exact readback; advance/`ROLLED_BACK`|third state/concurrent occupant preserves claim and occupant when needed and blocks|`BLOCKED_GATE` if restore cannot complete|next rollback or `WA-OP-009-FAILURE-CLEANUP`|
282
+ | `WA-OP-009-FAILURE-CLEANUP`|current|`FAILURE_CLEANING(index)` before exact validated unlink/prune|zero replacements or durable `ROLLED_BACK`|stages/backups/evidence temp removed; canonical source retained; `FAILED`|exact admitted transaction file remains|`OFFLINE_RECOVERY`|`FAILED`; correction then `WA-OP-011-RETRY-HANDOFF`|
283
+ | `WA-OP-010-SUCCESS-CLEANUP`|current|`CLEANING(index)` before exact validated unlink/prune/source GC|durable `PROVED`; targets exact frozen identity|stages/backups/source/temp removed; outside evidence preserved; `CLEANED`|exact admitted cleanup file/source remains; source absence is already-cleaned|`RESUME_CLEANUP`|`CLEANED`, then `VERIFY_EXISTING`/caller return|
284
+ | `WA-OP-011-RETRY-HANDOFF`|prior+1, bounded by admission|immutable prior row plus `RETRY_PREPARING(epoch)` before handoff|locked `FAILED`; accepted correction; green re-preflight; same-fingerprint count <3 and next epoch within admitted cap|exact new epoch in `PREPARING`; prior rows unchanged|durable `RETRY_PREPARING(epoch)` with no target write|`OFFLINE_RECOVERY`|resume same epoch at `PREPARING`|
285
+ | `WA-OP-012-EXHAUSTION-GC`|current|`EXHAUSTED_CLEANING`|locked `FAILED`; same-fingerprint count=3 or admitted epoch cap reached|retained source and exact transaction files removed; `EXHAUSTED` with durable truthful `exhaustion_cause`|exact admitted cleanup file/source or missing cause remains|`BLOCKED_GATE` if safe cleanup cannot complete|`BLOCKED_EXHAUSTED`; no next attempt|
286
+ | `WA-OP-013-EVIDENCE-UPDATE`|current|next generation plus owned-section preimage SHA-256|lock held; observed generation/hash match|atomic synced marker-owned section; generation+1; all outside bytes exact|exact same-parent current-user regular single-link mode-`0600` temporary|state operation's route; never infer success|return to invoking operation|
287
+ | `WA-OP-014-PRODUCT-SEPARATION`|current|proof boundary before comparison|frozen pre-transaction product candidate/readiness/built count|exact equality recorded in owned section|none|`BLOCKED_GATE`|success cleanup only after equality|
288
+ | `WA-OP-015-VERIFY-EXISTING`|historical epoch|no mutation intent|`CLEANED`; exact evidence and targets; source absent or already GC'd|same bytes/state/counters|none|route by finite diagnostic table|caller return; no install/retry/budget charge|
289
+
290
+ ## State, proof, and retry
291
+
292
+ Success: `PREPARING → PREPARED → INSTALLING(n) → INSTALLED → PROVING → PROVED
293
+ → CLEANING(n) → CLEANED`.
294
+
295
+ Pre-replacement failure: `FAILURE_CLEANING(n) → FAILED`. From first replacement
296
+ through `PROVING`: `WA-OP-008-ROLLBACK → ROLLED_BACK → FAILURE_CLEANING(n) →
297
+ FAILED`. At/after durable `PROVED`, preserve targets and resume cleanup only. Source
298
+ loss follows the same branches.
299
+
300
+ Delivery's one immutable transaction-private `outside-manifest.json` sidecar.
301
+ Journal binds only exact relative name, SHA-256, encoded bytes, and row count; no
302
+ generation duplicates payload. Descriptor-stable records: directory/file/symlink type/mode/uid/gid; file nlink/SHA-256,
303
+ symlink target; fifo/socket same base; block/character add nonnegative integer
304
+ non-bool `st_rdev`. Reject other types before acceptance. Protect
305
+ ignored, nested-`.git`, and transaction-lookalike paths; exclude only root
306
+ `.git` and the exact selected transaction subtree. Container/siblings protected. Limits: 200,000 rows,
307
+ 16,777,216 encoded bytes, one 600-second wall, and 1,048,576 journal bytes.
308
+ Bootstrap sidecar/journal temps reconcile only before destination mutation.
309
+ Sidecar is immutable evidence in `FAILED`/`CLEANED`; stage, backups, proof-cache,
310
+ mutation artifacts clean exactly.
311
+
312
+ Candidate/destination and every generated-stage regular-file authority is acquired no-follow through one held descriptor; initial/opened/final pathname identity must match and each read caps at 16,777,216 bytes. Complete staged/current generated-tree scans share one finite absolute deadline: install delivery aggregate; recovery 600 seconds.
313
+
314
+ `PROVING` runs each trusted Vet-approved admitted argv command and its descendants
315
+
316
+ in one fresh process group, where they remain until exit; output and command/
317
+ aggregate time are bounded. A declared expected signal must be exactly one
318
+ standalone output line. It adds no network or filesystem sandbox and
319
+ makes no deliberate detached-session containment claim. Failure: `TERM`, bounded grace,
320
+ `KILL` survivors, reap group/leader, rollback. Any surviving group member, nonzero,
321
+ wrong signal, overflow, or timeout prevents `PROVED`.
322
+
323
+ Epoch starts 1. `FAILED` records preimages/cleanup/epoch/fingerprint/reason/
324
+ boundary/route/no-progress count. Resolved fingerprints close; a different
325
+ invariant gets a distinct fingerprint. Handoff death resumes its retry epoch with
326
+ prior rows immutable. `WA-OP-011/012` enforce independent fingerprint/epoch caps
327
+ and terminal source cleanup. Exhaustion records:
328
+
329
+ ```text
330
+ status=blocked
331
+ exhaustion_cause=<same-fingerprint-count|total-epoch-limit>
332
+ next_action=none — technical recovery exhausted; requires new evidence or changed failure conditions
333
+ ```
334
+
335
+ The journal, evidence section, and observer retain that cause; epoch exhaustion
336
+ never claims the current fingerprint reached three.
337
+
338
+ ## Route classifier
339
+
340
+ Precedence: busy owner; safety/access/approval gate; completed historical; active
341
+ journal; `CLEANED`; missing/stale authority; stale writer evidence; current
342
+ admission. `PROVED|CLEANING` resumes cleanup; install-through-`PROVING`, rollback,
343
+ or failure cleanup routes offline; retryable `FAILED` routes correction/retry;
344
+ `EXHAUSTED` blocks; `PREPARING|PREPARED` resumes only with current authority.
345
+ There is no actor-history migration or backfill.
346
+
347
+ |Route|Owner|Exact action|Durable state/status/next action|Cursor/output|
348
+ | ---|---|---|---|---|
349
+ | `ROOT_TRANSACTION`|controlling root|execute this module inside current caller; no phase command|keep caller phase, `status=running`, `next_action=<saved caller action>`|save return cursor; no intermediate user reply|
350
+ | `PLAN_VET_REPAIR`|controlling root|run `/rite-plan repair <slug>` then `/rite-vet <slug>` internally|`phase=plan`, `status=running`, `next_action=/rite-plan repair <slug>` until Vet READY|restore saved caller cursor; Autocomplete emits no intermediate reply|
351
+ | `OFFLINE_RECOVERY`|controlling root|run `/devrites-debug-recovery <slug>`, disposable re-preflight, then narrow `/rite-vet <slug>`|`status=running`, `next_action=/devrites-debug-recovery <slug>`; retry only from durable `FAILED` and remaining cap|preserve cursor and attempt history; no real action|
352
+ | `RESUME_CLEANUP`|controlling root|lock and resume exact `PROVED`/`CLEANING` generation|keep caller phase/status/action|proved targets stay; stale source routes Plan/Vet after cleanup|
353
+ | `PROVE_AND_RETURN`|controlling root|run admitted proof, success cleanup, restore cursor|saved return phase/action|stop for fresh consumptive-action authorization|
354
+ | `VERIFY_EXISTING`|controlling root|verify `CLEANED`, targets, proof, and product separation; do not reinstall|restore saved return phase/action|no retry/slice/action budget|
355
+ | `NO_BACKFILL`|controlling root|no action|completed state unchanged|no new output|
356
+ | `WAIT_ACTIVE_OWNER`|non-owner|no write; stop invocation|shared state unchanged|fixed owner-busy diagnostic|
357
+ | `BLOCKED_EXHAUSTED`|controlling root|no attempt 4|blocked with exact exhausted next action|fixed exhausted diagnostic|
358
+ | `BLOCKED_GATE`|controlling root|follow existing safety/access/approval gate|gate-owned state|gate output; never reinterpret as retry|
359
+
360
+ |Scenario ID|Trigger|Exact route / action|Durable consequence|Forbidden behavior|
361
+ | ---|---|---|---|---|
362
+ | WA-ADMISSION-SUCCESS|current exact admission, green retained source, no active journal|`ROOT_TRANSACTION` — freeze identity and begin preparation|first active state is `PREPARING`|wright dispatch or product-slice charge|
363
+ | WA-MISSING-IDENTITY|frozen identity/handle absent|`PLAN_VET_REPAIR`|zero active journal/target writes|synthesize from chat, target, or old evidence|
364
+ | WA-STALE-IDENTITY|Vet binding, order, path, mode, hash, or source differs|`PLAN_VET_REPAIR`|zero target writes; unrelated files untouched|continue with stale bytes|
365
+ | WA-STALE-WRITER-EXHAUSTION|only obsolete actor-exhaustion evidence exists|`PLAN_VET_REPAIR`|no migration/backfill attempt|reopen via one-time migration|
366
+ | WA-FIRST-ROOT-FAILURE|first active transaction fails before `PROVED`|`OFFLINE_RECOVERY`|exact preimages, `FAILED`, attempt one under same fingerprint|terminal exhaustion or fresh action budget|
367
+ | WA-REPLACEMENT-ROLLBACK|replacement fails after earlier installs|`OFFLINE_RECOVERY`|`ROLLING_BACK → ROLLED_BACK → FAILURE_CLEANING → FAILED`|partial installed set survives|
368
+ | WA-CLEANUP|termination/failure at or after `PROVED`|`RESUME_CLEANUP` then `PLAN_VET_REPAIR` only if source stale|proved targets preserved; cleanup reconciled|rollback or reinstall proved targets|
369
+ | WA-IDENTITY-CONTINUITY|readback/proof matches frozen identity|`PROVE_AND_RETURN`|candidate/readiness/built count unchanged; cursor restored|add workflow path to product manifest|
370
+ | WA-COMPLETED-HISTORICAL|completed workspace lacks current identity|`NO_BACKFILL`|no writes or reopened phase|historical reconstruction|
371
+ | WA-IDEMPOTENT-RERUN|exact `CLEANED` evidence and targets already match|`VERIFY_EXISTING` and return|no new transaction, slice charge, or action authorization|reinstall or consume retry budget|
372
+
373
+ ## Public diagnostics
374
+
375
+ Emit exactly one ASCII line plus LF, never dynamic text:
376
+
377
+ ```text
378
+ WORKFLOW_ARTIFACT_FAILURE reason_id=<reason> boundary_id=<boundary> next_route=<route>
379
+ ```
380
+
381
+ Unknown or malformed values collapse to
382
+ `WA-R009-STATE-AMBIGUOUS`, `WA-B005-JOURNAL`, `OFFLINE_RECOVERY`.
383
+ No target index, content, path, credential, hostile value, exception, or raw
384
+ filesystem error appears.
385
+
386
+ |Reason ID|Boundary ID|Meaning|Next route|
387
+ | ---|---|---|---|
388
+ | `WA-R001-OWNER-BUSY`|`WA-B001-OWNER`|exclusive owner held elsewhere|`WAIT_ACTIVE_OWNER`|
389
+ | `WA-R002-ADMISSION-INCOMPLETE`|`WA-B002-ADMISSION`|required admission absent or malformed|`PLAN_VET_REPAIR`|
390
+ | `WA-R003-IDENTITY-MISSING`|`WA-B004-SOURCE-OPEN`|current frozen identity unavailable|`PLAN_VET_REPAIR`|
391
+ | `WA-R004-IDENTITY-STALE`|`WA-B004-SOURCE-OPEN`|authority differs from frozen identity|`PLAN_VET_REPAIR`|
392
+ | `WA-R005-SOURCE-UNTRUSTED`|`WA-B003-SOURCE-PROMOTE`|source lacks exact authority|`PLAN_VET_REPAIR`|
393
+ | `WA-R006-SOURCE-STALE-PREINSTALL`|`WA-B004-SOURCE-OPEN`|stale before first replacement|`PLAN_VET_REPAIR`|
394
+ | `WA-R007-SOURCE-STALE-ACTIVE`|`WA-B004-SOURCE-OPEN`|stale after replacement before proof|`OFFLINE_RECOVERY`|
395
+ | `WA-R008-SOURCE-STALE-POSTPROOF`|`WA-B013-SUCCESS-CLEANUP`|stale during proved cleanup|`RESUME_CLEANUP`|
396
+ | `WA-R009-STATE-AMBIGUOUS`|`WA-B005-JOURNAL`|relation not admitted|`OFFLINE_RECOVERY`|
397
+ | `WA-R010-WRITE-FAILED`|`WA-B006-STAGE-WRITE` or `WA-B007-BACKUP-WRITE`|bounded write failed before install|`OFFLINE_RECOVERY`|
398
+ | `WA-R011-REPLACE-FAILED`|`WA-B008-INSTALL`|replacement failed|`OFFLINE_RECOVERY`|
399
+ | `WA-R012-READBACK-MISMATCH`|`WA-B009-READBACK`|installed identity differs|`OFFLINE_RECOVERY`|
400
+ | `WA-R013-PROOF-FAILED`|`WA-B010-PROVE`|nonzero or wrong proof signal|`OFFLINE_RECOVERY`|
401
+ | `WA-R014-PROOF-TIMEOUT`|`WA-B010-PROVE`|proof group exceeded bound|`OFFLINE_RECOVERY`|
402
+ | `WA-R015-ROLLBACK-FAILED`|`WA-B011-ROLLBACK`|preimages not restored|`BLOCKED_GATE`|
403
+ | `WA-R016-FAILURE-CLEANUP-FAILED`|`WA-B012-FAILURE-CLEANUP`|failure files remain|`OFFLINE_RECOVERY`|
404
+ | `WA-R017-SUCCESS-CLEANUP-FAILED`|`WA-B013-SUCCESS-CLEANUP`|proved cleanup incomplete|`RESUME_CLEANUP`|
405
+ | `WA-R018-PRODUCT-IDENTITY-CHANGED`|`WA-B014-PRODUCT-SEPARATION`|product identity drifted|`BLOCKED_GATE`|
406
+ | `WA-R019-LIMIT-EXCEEDED`|`WA-B002-ADMISSION`|byte/file/time/journal bound exceeded|`PLAN_VET_REPAIR`|
407
+ | `WA-R020-RETRY-EXHAUSTED`|`WA-B015-RETRY`|same-fingerprint count or total attempt epoch reached its independent cap|`BLOCKED_EXHAUSTED`|
408
+ | `WA-R021-ACCESS-DENIED`|`WA-B001-OWNER`|host access or canonical flock unavailable|`BLOCKED_GATE`|
409
+ | `WA-R022-STALE-SOURCE-GC-FAILED`|`WA-B016-STALE-SOURCE-GC`|validated stale cleanup incomplete|`OFFLINE_RECOVERY`|
410
+
411
+ Each diagnostic, including LF, is at most 256 bytes. Reason/boundary
412
+ pairs remain injective for actionable seams.
413
+
414
+ ## Phase adapters
415
+
416
+ |Canonical adapter|Entry trigger|Canonical action|Return cursor|
417
+ | ---|---|---|---|
418
+ | `devrites-lib/reference/standards/afk-hitl.md`|unattended root reaches current admitted Workflow Artifact work|invoke classifier; execute returned route without wright/slice charge|saved lifecycle phase/action; no intermediate reply|
419
+ | `devrites-lib/reference/standards/one-shot-actions.md`|workflow proof completes before any consumptive one-shot action|`PROVE_AND_RETURN`; require fresh real-action authorization|saved one-shot action boundary|
420
+ | `devrites-debug-recovery/SKILL.md`|durable active failure or ambiguous admitted state|`OFFLINE_RECOVERY`; correct offline, re-preflight, narrow Vet, retry only under cap|saved caller or exact Plan/Vet route|
421
+ | `rite-autocomplete/SKILL.md`|lifecycle cursor encounters admitted set or resumable journal|invoke classifier; execute returned route internally|saved phase/action; zero intermediate reply|
422
+ | `rite-autocomplete/reference/loop.md`|loop tick sees Workflow Artifact trigger/state|invoke classifier once under owner lock; no actor-history migration|same loop cursor; no budget charge for verify/rerun|
423
+ | `rite-autocomplete/reference/stop-conditions.md`|classifier returns owner-busy, exhausted, or existing hard gate|stop on exact `WAIT_ACTIVE_OWNER`, `BLOCKED_EXHAUSTED`, or `BLOCKED_GATE` result|unchanged cursor plus fixed route-owned output|
424
+ | `rite-build/SKILL.md`|Vet-ready admitted bytes require root authorship outside product wright|`ROOT_TRANSACTION`; root writes only admitted `.devrites/**` targets|saved Build slice cursor; wright product allowlist unchanged|
425
+ | `rite-build/reference/phase-contract.md`|Build gate enters or resumes transaction|invoke canonical operation table; reconcile exact result|same slice/checkpoint cursor or Plan/Vet route|
426
+ | `rite-prove/SKILL.md`|Prove consumes installed Workflow Artifact or `CLEANED` rerun|`VERIFY_EXISTING` or admitted proof path ending `PROVE_AND_RETURN`|saved Prove cursor; stop before real action|
427
+ | `rite-vet/SKILL.md`|plan declares root-authored executable workflow file|emit exact admission; stale/missing authority uses `PLAN_VET_REPAIR`|Vet READY cursor or exact technical replan|
@@ -0,0 +1,44 @@
1
+ # Visual playbook: code
2
+
3
+ ## use_when
4
+
5
+ Render source snippets, files, patches, PR diffs, or before/after code inside a visual — when the claim needs readable code next to explanation (prefer focused ranges, not whole unrelated files).
6
+
7
+ ## Structure / landmarks / stable ids
8
+
9
+ | Landmark | Suggested `id` | Role |
10
+ | --- | --- | --- |
11
+ | Claim / reason | `code-why` | Why inspect this code |
12
+ | Path header | `code-path-<slug>` | Path, language, scope |
13
+ | File or diff surface | `code-view-<slug>` | Rendered file or diff |
14
+ | Annotations | `code-notes` | Line-tied notes beside the claim |
15
+
16
+ Place path, language, and reason immediately before each render. Group multi-file changes by user-facing area or task, not raw repo order.
17
+
18
+ ## design_rules
19
+
20
+ - Prefer **focused ranges** and parsed patches over dumping huge files.
21
+ - Keep evidence next to claims (path + line references in HTML and outline Citations).
22
+ - **Simple snippets:** semantic `<pre><code>` (or equivalent) with language class and wrap-friendly CSS is acceptable when no interactive diff is needed.
23
+ - **Diffs / multi-file review:** may use `@pierre/diffs` from a pinned CDN (e.g. esm.sh) when side-by-side or unified diff UX is needed. If used:
24
+ - Pin the version in the script URL.
25
+ - Note the CDN dependency in the outline.
26
+ - Prefer themes that match the page light/dark scheme.
27
+ - Choose split vs unified for width; keep wrap unless alignment is essential.
28
+ - Prefer self-contained CSS for chrome around the code surface.
29
+ - Explicit background / color-scheme; stable ids on each file/diff block.
30
+
31
+ ## Pitfalls / anti-patterns
32
+
33
+ - Screenshots of code instead of text the agent can re-read.
34
+ - Showing huge unrelated files when a range would do.
35
+ - Separating a claim from the lines that prove it.
36
+ - Hard-requiring Lavish annotation / queue APIs around the code surface.
37
+ - Using a CDN without recording it in the outline.
38
+ - HTML without `.outline.md`.
39
+
40
+ ## DevRites notes
41
+
42
+ - **Home:** `.devrites/work/<slug>/visual/<name>.html` + `<name>.outline.md`.
43
+ - Outline: [`outline-template.md`](outline-template.md); list `code` under Playbooks used; note CDN if `@pierre/diffs` or similar is used.
44
+ - Often combines with `plan`, `table`, or `comparison` — open every match ([`index.md`](index.md)).
@@ -0,0 +1,42 @@
1
+ # Visual playbook: comparison
2
+
3
+ ## use_when
4
+
5
+ Show options, tradeoffs, before/after, or mutually exclusive directions so a human can choose or validate a recommendation.
6
+
7
+ ## Structure / landmarks / stable ids
8
+
9
+ | Landmark | Suggested `id` | Role |
10
+ | --- | --- | --- |
11
+ | Decision statement | `cmp-decision` | Named decision at the top |
12
+ | Option / side A | `cmp-option-a` (or `cmp-before`) | Concrete behavior / shape |
13
+ | Option / side B | `cmp-option-b` (or `cmp-after`) | Aligned counterpart |
14
+ | Scorecard (optional) | `cmp-scorecard` | Only when criteria are explicit |
15
+ | Recommendation | `cmp-recommend` | Only when evidence supports one |
16
+ | Assumptions | `cmp-assumptions` | What would change the call |
17
+
18
+ Align corresponding details across options so differences are visible without hunting. End with a recommendation only when evidence supports it; otherwise list open questions.
19
+
20
+ If the human must pick, also load [`input.md`](input.md).
21
+
22
+ ## design_rules
23
+
24
+ - Keep primary tradeoffs visually above secondary notes.
25
+ - Make costs as visible as benefits.
26
+ - Prefer concrete examples (behavior, API shape, UX mock) over vague pros/cons.
27
+ - Self-contained CSS; CDN only if a nested diagram/code surface requires it (note in outline).
28
+ - Explicit background / color-scheme; stable ids on each option card.
29
+
30
+ ## Pitfalls / anti-patterns
31
+
32
+ - Making every option look equally recommended when one is preferred.
33
+ - Comparing vague summaries when concrete examples exist.
34
+ - Burying assumptions that flip the recommendation.
35
+ - Requiring Lavish queue/select APIs for the comparison to function.
36
+ - HTML without outline.
37
+
38
+ ## DevRites notes
39
+
40
+ - **Home:** `.devrites/work/<slug>/visual/<name>.html` + `<name>.outline.md`.
41
+ - Outline template: [`outline-template.md`](outline-template.md). Capture tradeoffs in `## Relationships` and assumptions there or via `questions.md` pointers.
42
+ - Often pairs with `plan` or `diagram` — open every matching playbook ([`index.md`](index.md)).
@@ -0,0 +1,51 @@
1
+ # Visual playbook: diagram
2
+
3
+ ## use_when
4
+
5
+ Explain relationships, flows, state, architecture, and spatial concepts with illustrations — when Mermaid-in-`flows.md` alone is not rich enough for human review.
6
+
7
+ ## Structure / landmarks / stable ids
8
+
9
+ Recommended page landmarks:
10
+
11
+ | Landmark | Suggested `id` | Role |
12
+ | --- | --- | --- |
13
+ | Header | `viz-title` | Question the diagram answers |
14
+ | Overview figure | `diagram-overview` | Core relationship only |
15
+ | Detail region | `diagram-detail` | Module cards / evidence below overview |
16
+ | Legend | `diagram-legend` | Optional symbol key |
17
+ | Open questions | `viz-open-questions` | Uncertainties + confidence badges (optional) |
18
+ | Citations | `diagram-citations` | Repo paths / commands |
19
+
20
+ Give every meaningful SVG node, edge, and region a stable `id` (e.g. `node-auth`, `edge-auth-db`) so outline `## ID inventory` and `## Relationships` can mirror them.
21
+
22
+ Prefer **one concept per figure**. For large systems: small overview illustration + detail cards — not one dense auto-laid graph.
23
+
24
+ When uncertainty remains, add `id="viz-open-questions"` with 1–few open questions and optional confidence badges (`high` / `medium` / `low`). Mirror them in outline `## Open questions` and in the optional `#devrites-outline` JSON.
25
+
26
+ ## design_rules
27
+
28
+ - Prefer **hand-authored inline SVG + outline SSOT** for AI/human dual-read. Size with `viewBox` + `width: 100%`; never fixed pixel dimensions; keep elements inside the viewBox.
29
+ - Color via `currentColor` and page CSS custom properties so light/dark themes work.
30
+ - Short SVG labels (few words); put prose beside the figure in HTML — SVG text does not wrap.
31
+ - Figures stay self-contained: no external images/fonts required for the SVG itself.
32
+ - Explicit page `background` / `color-scheme`; semantic `header` / `main` / labeled sections.
33
+ - Prefer self-contained CSS. CDN only when Mermaid is justified (below) and the outline notes the dependency.
34
+ - **Mermaid** remains optional: use only when flowchart / sequence / state is clearer than hand SVG **and** the Mermaid source is embedded for agent read **and** mirrored in the outline. Do not use Mermaid merely to save authoring effort; do not treat Mermaid as a full dual-read replacement DSL.
35
+ - Optional but recommended: embed `<script type="application/json" id="devrites-outline">` matching the outline (outline wins on conflict).
36
+
37
+ ## Pitfalls / anti-patterns
38
+
39
+ - Cramming every file or function into one figure.
40
+ - Building boxes-and-arrows from div/flexbox instead of SVG (or justified Mermaid).
41
+ - Presenting unverified architecture as fact — cite files or commands.
42
+ - Requiring Lavish annotation / poll / whiteboard APIs for the diagram to work.
43
+ - Emitting HTML without the sibling `.outline.md`.
44
+
45
+ ## DevRites notes
46
+
47
+ - **Home:** `.devrites/work/<slug>/visual/<name>.html` + `<name>.outline.md`.
48
+ - **Outline companion:** copy headings from [`outline-template.md`](outline-template.md); list this id under `## Playbooks used`.
49
+ - Keep Mermaid in workspace `flows.md` when that is enough; richer presentation **also** emits `visual/` and may link from `flows.md`.
50
+ - **Consistency:** `open-visual` warns when outline inventory ids are missing from HTML (non-fatal). HTML-only decorative ids are not reported.
51
+ - Router: [`index.md`](index.md).
@@ -0,0 +1,66 @@
1
+ # Visual playbooks — router
2
+
3
+ Progressive references for DevRites `visual/` HTML + outline pairs.
4
+ Load **only** matching playbooks before writing HTML. Do not preload all seven.
5
+
6
+ **Spec / schema SSOT:** [`../workspace-artifact-schema.md`](../workspace-artifact-schema.md) (see What each file owns)
7
+ **Outline companion:** [`outline-template.md`](outline-template.md)
8
+
9
+ ## Load rules
10
+
11
+ 1. Match the artifact against each `use_when` below.
12
+ 2. **Open every matching playbook** (one page often combines several ids).
13
+ 3. **Do not** open non-matching playbooks "just in case."
14
+ 4. Always emit the dual-read pair: `visual/<name>.html` + `visual/<name>.outline.md`.
15
+ 5. Copy required outline headings from [`outline-template.md`](outline-template.md).
16
+ 6. **Dual-read:** the outline is SSOT — see `outline-template.md` § Dual-read rule.
17
+ 7. No Lavish runtime: never require `window.lavish.*`, `data-lavish-*`, poll, queue, share, or ht-ml.app.
18
+
19
+ ## Playbook ids
20
+
21
+ | ID | `use_when` | File |
22
+ | --- | --- | --- |
23
+ | `diagram` | Relationships, flows, state, architecture, spatial concepts | [`diagram.md`](diagram.md) |
24
+ | `table` | Dense comparable records that share the same fields | [`table.md`](table.md) |
25
+ | `comparison` | Options, before/after, tradeoffs, mutually exclusive directions | [`comparison.md`](comparison.md) |
26
+ | `plan` | Product or technical plan before build | [`plan.md`](plan.md) |
27
+ | `code` | Snippets, files, patches, diffs (prefer focused ranges) | [`code.md`](code.md) |
28
+ | `input` | Structured choices the human should make on the page | [`input.md`](input.md) |
29
+ | `slides` | Only when a paced deck / presentation is explicitly requested | [`slides.md`](slides.md) |
30
+
31
+ ## Dual-read reminder
32
+
33
+ | Human | Agent |
34
+ | --- | --- |
35
+ | Opens HTML in a normal browser (`open-visual`) | Reads `.outline.md` first |
36
+ | Sees layout, SVG, tables, forms, open questions | Uses Purpose / ID inventory / Relationships / Citations / Open questions |
37
+ | Optional form answers on the page | Persists answers in outline `## Answers` and/or `questions.md` |
38
+ | May skim `#devrites-outline` JSON | Treats JSON as a mirror; **outline.md wins** on conflict |
39
+
40
+ **Preferred dual-read shape:** hand-authored inline SVG + `.outline.md` SSOT.
41
+ Mermaid is optional when a flowchart / sequence / state diagram is clearer than
42
+ hand SVG **and** the Mermaid source is embedded and mirrored in the outline —
43
+ not a default substitute.
44
+
45
+ Home: `.devrites/work/<slug>/visual/`. Optional artifact; never a new lifecycle phase; never readiness-required.
46
+
47
+ ## Writer checklist (before HTML)
48
+
49
+ - [ ] Matching playbooks opened
50
+ - [ ] Outline headings prepared from template (including optional `## Open questions` when uncertainty remains)
51
+ - [ ] Stable `id`s planned for landmarks / nodes (include `viz-open-questions` when that section is present)
52
+ - [ ] Optional but recommended: `#devrites-outline` JSON embed planned (generated from outline; outline wins on conflict)
53
+ - [ ] CDN dependencies (if any) listed for the outline
54
+ - [ ] Claims cite real repo paths when they touch the tree
55
+ - [ ] After write: inventory ids present in HTML (`open-visual` warns inventory → HTML mismatches; HTML-only decorative ids are ignored)
56
+
57
+ ## Anti-slop triggers (load polish / playbooks)
58
+
59
+ When HTML/visual work shows **two or more** of: generic Inter/system font with no
60
+ brief justification, hero-only layout, purple/blue gradient CTA with no brand token,
61
+ lorem or placeholder copy in shipped states, or identical card grid with no product
62
+ hierarchy — load [`rite-polish`](../../../rite-polish/SKILL.md) **ux_coverage** and
63
+ craft axes before sign-off.
64
+
65
+ **Failing case:** visual ships with three slop patterns and no axis record → Review
66
+ Important finding.