devrites 4.0.10 → 4.0.11

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 (25) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/README.md +4 -3
  3. package/docs/skills.md +2 -2
  4. package/pack/.claude/skills/devrites-debug-recovery/SKILL.md +5 -1
  5. package/pack/.claude/skills/devrites-lib/reference/standards/afk-hitl.md +3 -1
  6. package/pack/.claude/skills/devrites-lib/reference/standards/one-shot-actions.md +7 -0
  7. package/pack/.claude/skills/devrites-lib/reference/standards/workflow-artifacts.md +27 -1
  8. package/pack/.claude/skills/rite-autocomplete/reference/loop.md +4 -1
  9. package/pack/.claude/skills/rite-autocomplete/reference/stop-conditions.md +6 -1
  10. package/pack/.claude/skills/rite-build/reference/phase-contract.md +5 -1
  11. package/pack/generated/claude/skills/devrites-debug-recovery/SKILL.md +5 -1
  12. package/pack/generated/claude/skills/devrites-lib/reference/standards/afk-hitl.md +3 -1
  13. package/pack/generated/claude/skills/devrites-lib/reference/standards/one-shot-actions.md +7 -0
  14. package/pack/generated/claude/skills/devrites-lib/reference/standards/workflow-artifacts.md +27 -1
  15. package/pack/generated/claude/skills/rite-autocomplete/reference/loop.md +4 -1
  16. package/pack/generated/claude/skills/rite-autocomplete/reference/stop-conditions.md +6 -1
  17. package/pack/generated/claude/skills/rite-build/reference/phase-contract.md +5 -1
  18. package/pack/generated/codex/skills/devrites-debug-recovery/SKILL.md +5 -1
  19. package/pack/generated/codex/skills/devrites-lib/reference/standards/afk-hitl.md +3 -1
  20. package/pack/generated/codex/skills/devrites-lib/reference/standards/one-shot-actions.md +7 -0
  21. package/pack/generated/codex/skills/devrites-lib/reference/standards/workflow-artifacts.md +27 -1
  22. package/pack/generated/codex/skills/rite-autocomplete/reference/loop.md +4 -1
  23. package/pack/generated/codex/skills/rite-autocomplete/reference/stop-conditions.md +6 -1
  24. package/pack/generated/codex/skills/rite-build/reference/phase-contract.md +5 -1
  25. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  All notable changes to DevRites are documented here. The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and DevRites adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). Releases are generated automatically by [semantic-release](https://semantic-release.gitbook.io/) from Conventional Commits on `main`.
4
4
 
5
+ ## [4.0.11](https://github.com/ViktorsBaikers/DevRites/compare/v4.0.10...v4.0.11) (2026-08-08)
6
+
7
+ ### Fixed
8
+
9
+ * **rite:** recover workflow materializer failures ([4ab042b](https://github.com/ViktorsBaikers/DevRites/commit/4ab042b269c90ce7133bb425d3db15469035255e))
10
+
5
11
  ## [4.0.10](https://github.com/ViktorsBaikers/DevRites/compare/v4.0.9...v4.0.10) (2026-08-08)
6
12
 
7
13
  ### Fixed
package/README.md CHANGED
@@ -28,7 +28,7 @@ project-conventional push, tag, or PR action, and archive the workspace.
28
28
  Unattended runs may create local WIP checkpoint commits along the way, but they
29
29
  remain local unless Ship's disclosed plan includes an approved remote action.
30
30
 
31
- **Status:** [`v4.0.10`](https://github.com/ViktorsBaikers/DevRites/releases/tag/v4.0.10): see [`CHANGELOG.md`](CHANGELOG.md) for release notes.
31
+ **Status:** [`v4.0.11`](https://github.com/ViktorsBaikers/DevRites/releases/tag/v4.0.11): see [`CHANGELOG.md`](CHANGELOG.md) for release notes.
32
32
 
33
33
  This is the latest published release; `main` may contain unreleased work.
34
34
 
@@ -83,7 +83,7 @@ the same skill.
83
83
  | 3 | Temper | [`/rite-temper`](pack/.claude/skills/rite-temper/SKILL.md) | Challenges scope and failure modes before Define. It is optional for small work and always runs in `/rite-autocomplete`. |
84
84
  | 4 | Define | [`/rite-define`](pack/.claude/skills/rite-define/SKILL.md) | Turns the approved spec into architecture, a plan, traceability, and vertical task slices; changed provider/consumer boundaries name one shared contract and consuming tests on both sides. |
85
85
  | 5 | Vet | [`/rite-vet`](pack/.claude/skills/rite-vet/SKILL.md) | Reviews every plan before implementation. The review depth scales with the risk. |
86
- | 6 | Build | [`/rite-build`](pack/.claude/skills/rite-build/SKILL.md) | In HITL, implements and verifies one product slice, then stops. Run it again for each remaining slice. An explicit `.devrites/AFK` sentinel permits bounded low-risk slice chaining under its cap and pause rules. Exact Vet-ready executable workflow artifacts under the active feature workspace are root-materialized and excluded from product slice accounting. |
86
+ | 6 | Build | [`/rite-build`](pack/.claude/skills/rite-build/SKILL.md) | In HITL, implements and verifies one product slice, then stops. Run it again for each remaining slice. An explicit `.devrites/AFK` sentinel permits bounded low-risk slice chaining under its cap and pause rules. Exact Vet-ready executable workflow artifacts under the active feature workspace are root-materialized and excluded from product slice accounting; their transaction code is proved in a disposable same-layout fixture before active writes and uses normal bounded recovery rather than a one-shot budget. |
87
87
  | 7 | Converge | [`/rite-converge`](pack/.claude/skills/rite-converge/SKILL.md) | Runs only when recovery is needed. It compares the code with the recorded intent, adds missing slices, and sends the changed plan back to Vet. |
88
88
  | 8 | Prove | [`/rite-prove`](pack/.claude/skills/rite-prove/SKILL.md) | Runs positive, discriminating tests, build/runtime checks, and UI proof, then binds the evidence to the exact candidate digest. |
89
89
  | 9 | Polish | [`/rite-polish`](pack/.claude/skills/rite-polish/SKILL.md) | Cleans up the candidate, normalizes UI when needed, performs durable capability/design/ADR rollups, and refreshes affected proof before closing it. |
@@ -105,7 +105,8 @@ Some work needs a different route:
105
105
  boundary-discriminating diagnostic design; only its next real acquisition attempt
106
106
  needs a new GO. After an upgrade introduces a supported workflow-artifact writer,
107
107
  Autocomplete reopens a stale missing-writer stop once instead of preserving the
108
- obsolete recovery count.
108
+ obsolete recovery count. The first real root-materializer failure then counts as
109
+ attempt one under normal fingerprint recovery; it is not terminal by itself.
109
110
  - [`/rite-upgrade [slug]`](pack/.claude/skills/rite-upgrade/SKILL.md) is a
110
111
  compatibility route for an older active workspace that cannot resume. Age or
111
112
  cursor form alone never triggers repair; it is not a lifecycle phase.
package/docs/skills.md CHANGED
@@ -178,7 +178,7 @@ and `Shipped`. Utility commands keep the same compact labels and one-next-action
178
178
 
179
179
  | Skill | What It Does | Use When |
180
180
  |---|---|---|
181
- | [`rite-build`](../pack/.claude/skills/rite-build/SKILL.md) | In HITL, orchestrates one vertical product slice through the sole wright; an explicit `.devrites/AFK` sentinel may chain bounded low-risk slices. Exact Vet-ready executable proof artifacts under the active `.devrites/work/<slug>/` are instead materialized atomically by the controlling root and remain outside product candidate/slice accounting. | A plan exists, native semantic `CLEAR` and `READY` review passes, `test-plan.md` is complete, and the content-bound engine check passes. |
181
+ | [`rite-build`](../pack/.claude/skills/rite-build/SKILL.md) | In HITL, orchestrates one vertical product slice through the sole wright; an explicit `.devrites/AFK` sentinel may chain bounded low-risk slices. Exact Vet-ready executable proof artifacts under the active `.devrites/work/<slug>/` are instead materialized atomically by the controlling root and remain outside product candidate/slice accounting. The materializer transaction is proved first in a disposable same-layout fixture; its failures use normal three-attempt fingerprint recovery, not consumptive one-shot authority. | A plan exists, native semantic `CLEAR` and `READY` review passes, `test-plan.md` is complete, and the content-bound engine check passes. |
182
182
  | [`devrites-source-driven`](../pack/.claude/skills/devrites-source-driven/SKILL.md) | Consult official docs / source before relying on framework behavior; record the source. | API, config, or framework behavior is assumed rather than known. |
183
183
  | [`devrites-api-interface`](../pack/.claude/skills/devrites-api-interface/SKILL.md) | Design stable API / interface contracts: REST/GraphQL, module boundaries, type contracts, FE/BE split. | A slice crosses a boundary or defines a public interface. |
184
184
  | [`devrites-debug-recovery`](../pack/.claude/skills/devrites-debug-recovery/SKILL.md) | Reproduce → ranked hypotheses → instrument → fix in scope → regression-test. Caller and recovery count at most three failures per causal fingerprint from context and Dead ends/evidence. | Tests, builds, or runtime checks fail. |
@@ -222,7 +222,7 @@ and `Shipped`. Utility commands keep the same compact labels and one-next-action
222
222
 
223
223
  | Skill | What It Does | Use When |
224
224
  |---|---|---|
225
- | [`rite-autocomplete`](../pack/.claude/skills/rite-autocomplete/SKILL.md) | Runs the whole lifecycle unattended (spec → clarify → … → seal → ship), choosing the recommended option at each soft gate and recording the rationale in `decisions.md`. A vague prompt triggers one up-front spec/clarify window; after decision coverage is CLEAR it runs without per-phase iteration, pausing only for genuine product/scope/policy decisions, irreversible risk, human-only access/actions, NO-GO, or budget exhaustion. Objective red checks use bounded technical recovery, including cold-resume recovery from retained one-shot evidence and one-time migration of stale missing-writer stops when an upgraded contract supplies the first supported workflow-artifact writer. Spending an action authorization blocks only another real execution, not offline repair. Default stops at Seal GO; `--ship` (alias `--yolo`) reaches Ship preflight but still requires a fresh literal `GO` and native approval. | "Autocomplete", "do the whole thing", "run the full cycle", "one-shot this feature". |
225
+ | [`rite-autocomplete`](../pack/.claude/skills/rite-autocomplete/SKILL.md) | Runs the whole lifecycle unattended (spec → clarify → … → seal → ship), choosing the recommended option at each soft gate and recording the rationale in `decisions.md`. A vague prompt triggers one up-front spec/clarify window; after decision coverage is CLEAR it runs without per-phase iteration, pausing only for genuine product/scope/policy decisions, irreversible risk, human-only access/actions, NO-GO, or budget exhaustion. Objective red checks use bounded technical recovery, including cold-resume recovery from retained one-shot evidence and one-time migration of stale missing-writer stops when an upgraded contract supplies the first supported workflow-artifact writer. That migration applies once, but the first real materializer failure is only attempt one under normal bounded recovery. Spending an action authorization blocks only another real execution, not offline repair. Default stops at Seal GO; `--ship` (alias `--yolo`) reaches Ship preflight but still requires a fresh literal `GO` and native approval. | "Autocomplete", "do the whole thing", "run the full cycle", "one-shot this feature". |
226
226
  | [`rite-zoom-out`](../pack/.claude/skills/rite-zoom-out/SKILL.md) | Map the modules, callers, callees, and decisions in an unfamiliar area using the project's domain glossary. | Explicit-only: `/rite-zoom-out` / `/rite zoom-out`. |
227
227
  | [`rite-prototype`](../pack/.claude/skills/rite-prototype/SKILL.md) | Throwaway code answering ONE design question: logic harness OR 2 to 4 UI variations on one route. | Explicit-only: `/rite-prototype` / `/rite prototype`. |
228
228
  | [`rite-handoff`](../pack/.claude/skills/rite-handoff/SKILL.md) | Compact chat session → handoff doc. References existing `.devrites/work/<slug>/` artifacts by path. | Explicit-only: `/rite-handoff` / `/rite handoff`. |
@@ -73,7 +73,11 @@ has no clear next move.
73
73
  workspace follow
74
74
  [`workflow-artifacts.md`](../devrites-lib/reference/standards/workflow-artifacts.md)
75
75
  and are materialized by the controlling root. Never ask a read-only planner or
76
- reviewer to return implementation bodies.
76
+ reviewer to return implementation bodies. Materializer failures are reversible
77
+ offline recovery, not consumptive one-shot execution: preserve the transaction
78
+ journal, preimage hashes, and bound temporaries, preflight the corrected
79
+ transaction in a disposable same-layout fixture, then retry only within the
80
+ existing materializer fingerprint budget.
77
81
  - **Classify before routing** with
78
82
  [cleanup-and-classify.md](reference/cleanup-and-classify.md).
79
83
  - **Durably record class and rationale** in `decisions.md` and the applicable
@@ -264,7 +264,9 @@ changes, not a request for permission to retry.
264
264
  a read-only role or product wright for implementation and evidence records
265
265
  **no controlling-root materialization attempt**. Preserve the old attempts, but
266
266
  do not count them against the new root-materialization fingerprint. Record the
267
- migration; after a root attempt exists, normal fingerprint accounting applies.
267
+ migration; after a root attempt exists, normal fingerprint accounting applies:
268
+ the first root failure is attempt one, not a new one-shot terminal, and the
269
+ shared cap remains three no-progress corrections.
268
270
  - **Classify exhaustion:** human-owned contract/risk/access gaps open their gate. Otherwise
269
271
  preserve reproduction/dead ends, set `Status: blocked` and `Next step: none — technical recovery exhausted for <causal fingerprint>; requires new evidence or changed failure conditions`.
270
272
  Do not emit `/rite-plan unblock`, another phase command, a question, or
@@ -7,6 +7,13 @@ privileged/external state so a rerun is not equivalent, and actions whose cleanu
7
7
  can destroy the failure state needed for diagnosis. Successful cleanup does not
8
8
  make a consumptive action repeatable.
9
9
 
10
+ Workflow-artifact materialization is reversible offline work when every admitted
11
+ target has a bound preimage or absence marker, rollback is local to the active
12
+ feature workspace, and no privileged/external real action executes. It is not a
13
+ consumptive action and must not receive a one-shot authorization budget. Failures
14
+ of its materializer, atomic replacement, rollback, or offline proof use the normal
15
+ causal-fingerprint recovery cap in `afk-hitl.md`.
16
+
10
17
  ## Pre-attempt gate
11
18
 
12
19
  Before Vet can emit READY, and again immediately before Prove executes the action,
@@ -37,7 +37,9 @@ directly even when all product slices are built or the AFK slice budget is zero.
37
37
  Do not consume product-slice budget, reopen an answered human gate, or require GO
38
38
  for this offline work. After any controlling-root attempt is recorded, this
39
39
  migration cannot apply again; route its observed atomic/proof failure under the
40
- new fingerprint instead.
40
+ new fingerprint instead. Applying the migration once does not make the first root
41
+ attempt terminal: normal fingerprint accounting starts with that attempt and
42
+ allows up to three no-progress corrections under `afk-hitl.md`.
41
43
 
42
44
  ## Admission
43
45
 
@@ -52,15 +54,39 @@ Before writing:
52
54
  or a request that a drafter supply code is a Plan gap, not implementation input.
53
55
  3. Record preimages or absence for every target plus protected product manifests
54
56
  and the current candidate digest. Resolve every parent no-follow before mutation.
57
+ 4. Before creating an active transaction, **preflight the materializer itself**.
58
+ Do this before any journal or admitted-target mutation. Compile/static-check
59
+ it, then run its
60
+ complete transaction machinery in a disposable same-layout fixture. Cover an
61
+ existing target, an absent target, full success, injected replacement failure,
62
+ rollback cleanup, retained-temporary cleanup, and idempotent rerun. Require the
63
+ fixture to prove that failures leave every simulated target at its bound
64
+ preimage and that no same-parent temporary escapes its admitted directory. Run
65
+ with the working directory outside the admitted parent, and execute negative
66
+ mutants where relative replacement omits either directory handle; both mutants
67
+ must fail before the active transaction is eligible.
55
68
 
56
69
  ## Materialize
57
70
 
58
71
  The root authors the smallest complete bytes for all admitted targets. Write each
59
72
  through a same-parent private temporary file, set the planned mode, flush it, and
60
73
  atomically replace the target; settle the whole set or roll back partial output.
74
+ Anchor every relative rename/replace operand to its source and destination directory handles.
75
+ For Python `os.replace`, pass both `src_dir_fd`
76
+ and `dst_dir_fd`; a basename plus only the destination handle is not admitted.
61
77
  Do not install dependencies, touch Git, use the network, mutate product paths, or
62
78
  execute the consumptive action.
63
79
 
80
+ Workflow-artifact materialization is not a consumptive action. Its active
81
+ transaction may begin only after the disposable preflight is green. If an active
82
+ attempt fails, preserve its journal, exact hashes, and decisive boundary before
83
+ cleanup. When all targets remain at their recorded preimages and only bound
84
+ same-parent temporaries remain, perform exact fail-closed cleanup, repair and
85
+ preflight the materializer offline, then retry under the same causal fingerprint.
86
+ The first controlling-root failure is attempt one of the shared cap, not terminal
87
+ exhaustion; stop only after three no-progress corrections or a genuine
88
+ human/safety/access gate.
89
+
64
90
  ## Verify and return
65
91
 
66
92
  Read back the exact path set, modes, and SHA-256 identities. Run only the vetted
@@ -72,7 +72,10 @@ root ownership is a changed routing condition. Preserve the old fingerprint,
72
72
  record the new materialization fingerprint, and run that offline branch directly;
73
73
  do not charge or require product-slice/AFK budget, re-ask a resolved question, or
74
74
  request GO. Once a root materialization attempt exists, never apply this migration
75
- again—route its observed failure normally. This reconciliation runs even when all
75
+ again—route its observed failure normally. That one-time migration
76
+ does not make the first root attempt terminal: record it as attempt one under the new
77
+ materializer fingerprint and continue bounded offline correction while fewer than
78
+ three no-progress corrections exist. This reconciliation runs even when all
76
79
  product slices are already built, before selecting the next forward phase.
77
80
 
78
81
  1. Save the originating phase/action in the native return cursor unless a valid
@@ -52,7 +52,12 @@ as root materialization attempts. Reopen only when exact paths and executable
52
52
  behavior passed Vet and there is **no controlling-root materialization attempt**;
53
53
  record the routing migration so it cannot reset again. Missing product slices,
54
54
  unresolved protocol choices, or a recorded root attempt remain under their normal
55
- gate/fingerprint rules.
55
+ gate/fingerprint rules. The first controlling-root failure is not exhaustion: it
56
+ is the first no-progress result for the materializer fingerprint. If all targets
57
+ still equal their recorded preimages, no real action ran, and only admitted bound
58
+ temporaries remain, reopen an incorrectly persisted one-shot `1/1` terminal,
59
+ preserve its evidence as attempt one, clean/repair/preflight offline, and continue
60
+ within the shared three-attempt cap.
56
61
 
57
62
  Past evidence being irretrievable is not by itself terminal. When an in-scope
58
63
  trusted diagnostic seam can make the next retained fingerprint uniquely
@@ -23,7 +23,11 @@ See [`one-slice-cycle.md`](one-slice-cycle.md); candidate lifecycle is
23
23
  dispatch the exact `devrites-slice-wright` fresh. Root never writes those product
24
24
  paths, wright never widens, and a missing profile stops.
25
25
  For the workflow-artifact branch, the controlling root writes only the admitted
26
- `.devrites/work/<slug>/` paths, proves the complete atomic set, rechecks an
26
+ `.devrites/work/<slug>/` paths. Before an active journal or target write, it
27
+ compiles the materializer and runs the exact transaction implementation in a
28
+ disposable same-layout fixture covering success, replacement failure, rollback,
29
+ retained-temporary cleanup, and rerun. It then proves the complete atomic set,
30
+ rechecks an
27
31
  identical product candidate, records hashes/evidence, and runs narrow Vet. Do not
28
32
  dispatch any agent as a substitute writer and do not charge a product slice.
29
33
 
@@ -73,7 +73,11 @@ has no clear next move.
73
73
  workspace follow
74
74
  [`workflow-artifacts.md`](../devrites-lib/reference/standards/workflow-artifacts.md)
75
75
  and are materialized by the controlling root. Never ask a read-only planner or
76
- reviewer to return implementation bodies.
76
+ reviewer to return implementation bodies. Materializer failures are reversible
77
+ offline recovery, not consumptive one-shot execution: preserve the transaction
78
+ journal, preimage hashes, and bound temporaries, preflight the corrected
79
+ transaction in a disposable same-layout fixture, then retry only within the
80
+ existing materializer fingerprint budget.
77
81
  - **Classify before routing** with
78
82
  [cleanup-and-classify.md](reference/cleanup-and-classify.md).
79
83
  - **Durably record class and rationale** in `decisions.md` and the applicable
@@ -264,7 +264,9 @@ changes, not a request for permission to retry.
264
264
  a read-only role or product wright for implementation and evidence records
265
265
  **no controlling-root materialization attempt**. Preserve the old attempts, but
266
266
  do not count them against the new root-materialization fingerprint. Record the
267
- migration; after a root attempt exists, normal fingerprint accounting applies.
267
+ migration; after a root attempt exists, normal fingerprint accounting applies:
268
+ the first root failure is attempt one, not a new one-shot terminal, and the
269
+ shared cap remains three no-progress corrections.
268
270
  - **Classify exhaustion:** human-owned contract/risk/access gaps open their gate. Otherwise
269
271
  preserve reproduction/dead ends, set `Status: blocked` and `Next step: none — technical recovery exhausted for <causal fingerprint>; requires new evidence or changed failure conditions`.
270
272
  Do not emit `/rite-plan unblock`, another phase command, a question, or
@@ -7,6 +7,13 @@ privileged/external state so a rerun is not equivalent, and actions whose cleanu
7
7
  can destroy the failure state needed for diagnosis. Successful cleanup does not
8
8
  make a consumptive action repeatable.
9
9
 
10
+ Workflow-artifact materialization is reversible offline work when every admitted
11
+ target has a bound preimage or absence marker, rollback is local to the active
12
+ feature workspace, and no privileged/external real action executes. It is not a
13
+ consumptive action and must not receive a one-shot authorization budget. Failures
14
+ of its materializer, atomic replacement, rollback, or offline proof use the normal
15
+ causal-fingerprint recovery cap in `afk-hitl.md`.
16
+
10
17
  ## Pre-attempt gate
11
18
 
12
19
  Before Vet can emit READY, and again immediately before Prove executes the action,
@@ -37,7 +37,9 @@ directly even when all product slices are built or the AFK slice budget is zero.
37
37
  Do not consume product-slice budget, reopen an answered human gate, or require GO
38
38
  for this offline work. After any controlling-root attempt is recorded, this
39
39
  migration cannot apply again; route its observed atomic/proof failure under the
40
- new fingerprint instead.
40
+ new fingerprint instead. Applying the migration once does not make the first root
41
+ attempt terminal: normal fingerprint accounting starts with that attempt and
42
+ allows up to three no-progress corrections under `afk-hitl.md`.
41
43
 
42
44
  ## Admission
43
45
 
@@ -52,15 +54,39 @@ Before writing:
52
54
  or a request that a drafter supply code is a Plan gap, not implementation input.
53
55
  3. Record preimages or absence for every target plus protected product manifests
54
56
  and the current candidate digest. Resolve every parent no-follow before mutation.
57
+ 4. Before creating an active transaction, **preflight the materializer itself**.
58
+ Do this before any journal or admitted-target mutation. Compile/static-check
59
+ it, then run its
60
+ complete transaction machinery in a disposable same-layout fixture. Cover an
61
+ existing target, an absent target, full success, injected replacement failure,
62
+ rollback cleanup, retained-temporary cleanup, and idempotent rerun. Require the
63
+ fixture to prove that failures leave every simulated target at its bound
64
+ preimage and that no same-parent temporary escapes its admitted directory. Run
65
+ with the working directory outside the admitted parent, and execute negative
66
+ mutants where relative replacement omits either directory handle; both mutants
67
+ must fail before the active transaction is eligible.
55
68
 
56
69
  ## Materialize
57
70
 
58
71
  The root authors the smallest complete bytes for all admitted targets. Write each
59
72
  through a same-parent private temporary file, set the planned mode, flush it, and
60
73
  atomically replace the target; settle the whole set or roll back partial output.
74
+ Anchor every relative rename/replace operand to its source and destination directory handles.
75
+ For Python `os.replace`, pass both `src_dir_fd`
76
+ and `dst_dir_fd`; a basename plus only the destination handle is not admitted.
61
77
  Do not install dependencies, touch Git, use the network, mutate product paths, or
62
78
  execute the consumptive action.
63
79
 
80
+ Workflow-artifact materialization is not a consumptive action. Its active
81
+ transaction may begin only after the disposable preflight is green. If an active
82
+ attempt fails, preserve its journal, exact hashes, and decisive boundary before
83
+ cleanup. When all targets remain at their recorded preimages and only bound
84
+ same-parent temporaries remain, perform exact fail-closed cleanup, repair and
85
+ preflight the materializer offline, then retry under the same causal fingerprint.
86
+ The first controlling-root failure is attempt one of the shared cap, not terminal
87
+ exhaustion; stop only after three no-progress corrections or a genuine
88
+ human/safety/access gate.
89
+
64
90
  ## Verify and return
65
91
 
66
92
  Read back the exact path set, modes, and SHA-256 identities. Run only the vetted
@@ -72,7 +72,10 @@ root ownership is a changed routing condition. Preserve the old fingerprint,
72
72
  record the new materialization fingerprint, and run that offline branch directly;
73
73
  do not charge or require product-slice/AFK budget, re-ask a resolved question, or
74
74
  request GO. Once a root materialization attempt exists, never apply this migration
75
- again—route its observed failure normally. This reconciliation runs even when all
75
+ again—route its observed failure normally. That one-time migration
76
+ does not make the first root attempt terminal: record it as attempt one under the new
77
+ materializer fingerprint and continue bounded offline correction while fewer than
78
+ three no-progress corrections exist. This reconciliation runs even when all
76
79
  product slices are already built, before selecting the next forward phase.
77
80
 
78
81
  1. Save the originating phase/action in the native return cursor unless a valid
@@ -52,7 +52,12 @@ as root materialization attempts. Reopen only when exact paths and executable
52
52
  behavior passed Vet and there is **no controlling-root materialization attempt**;
53
53
  record the routing migration so it cannot reset again. Missing product slices,
54
54
  unresolved protocol choices, or a recorded root attempt remain under their normal
55
- gate/fingerprint rules.
55
+ gate/fingerprint rules. The first controlling-root failure is not exhaustion: it
56
+ is the first no-progress result for the materializer fingerprint. If all targets
57
+ still equal their recorded preimages, no real action ran, and only admitted bound
58
+ temporaries remain, reopen an incorrectly persisted one-shot `1/1` terminal,
59
+ preserve its evidence as attempt one, clean/repair/preflight offline, and continue
60
+ within the shared three-attempt cap.
56
61
 
57
62
  Past evidence being irretrievable is not by itself terminal. When an in-scope
58
63
  trusted diagnostic seam can make the next retained fingerprint uniquely
@@ -23,7 +23,11 @@ See [`one-slice-cycle.md`](one-slice-cycle.md); candidate lifecycle is
23
23
  dispatch the exact `devrites-slice-wright` fresh. Root never writes those product
24
24
  paths, wright never widens, and a missing profile stops.
25
25
  For the workflow-artifact branch, the controlling root writes only the admitted
26
- `.devrites/work/<slug>/` paths, proves the complete atomic set, rechecks an
26
+ `.devrites/work/<slug>/` paths. Before an active journal or target write, it
27
+ compiles the materializer and runs the exact transaction implementation in a
28
+ disposable same-layout fixture covering success, replacement failure, rollback,
29
+ retained-temporary cleanup, and rerun. It then proves the complete atomic set,
30
+ rechecks an
27
31
  identical product candidate, records hashes/evidence, and runs narrow Vet. Do not
28
32
  dispatch any agent as a substitute writer and do not charge a product slice.
29
33
 
@@ -73,7 +73,11 @@ has no clear next move.
73
73
  workspace follow
74
74
  [`workflow-artifacts.md`](../devrites-lib/reference/standards/workflow-artifacts.md)
75
75
  and are materialized by the controlling root. Never ask a read-only planner or
76
- reviewer to return implementation bodies.
76
+ reviewer to return implementation bodies. Materializer failures are reversible
77
+ offline recovery, not consumptive one-shot execution: preserve the transaction
78
+ journal, preimage hashes, and bound temporaries, preflight the corrected
79
+ transaction in a disposable same-layout fixture, then retry only within the
80
+ existing materializer fingerprint budget.
77
81
  - **Classify before routing** with
78
82
  [cleanup-and-classify.md](reference/cleanup-and-classify.md).
79
83
  - **Durably record class and rationale** in `decisions.md` and the applicable
@@ -264,7 +264,9 @@ changes, not a request for permission to retry.
264
264
  a read-only role or product wright for implementation and evidence records
265
265
  **no controlling-root materialization attempt**. Preserve the old attempts, but
266
266
  do not count them against the new root-materialization fingerprint. Record the
267
- migration; after a root attempt exists, normal fingerprint accounting applies.
267
+ migration; after a root attempt exists, normal fingerprint accounting applies:
268
+ the first root failure is attempt one, not a new one-shot terminal, and the
269
+ shared cap remains three no-progress corrections.
268
270
  - **Classify exhaustion:** human-owned contract/risk/access gaps open their gate. Otherwise
269
271
  preserve reproduction/dead ends, set `Status: blocked` and `Next step: none — technical recovery exhausted for <causal fingerprint>; requires new evidence or changed failure conditions`.
270
272
  Do not emit `$rite-plan unblock`, another phase command, a question, or
@@ -7,6 +7,13 @@ privileged/external state so a rerun is not equivalent, and actions whose cleanu
7
7
  can destroy the failure state needed for diagnosis. Successful cleanup does not
8
8
  make a consumptive action repeatable.
9
9
 
10
+ Workflow-artifact materialization is reversible offline work when every admitted
11
+ target has a bound preimage or absence marker, rollback is local to the active
12
+ feature workspace, and no privileged/external real action executes. It is not a
13
+ consumptive action and must not receive a one-shot authorization budget. Failures
14
+ of its materializer, atomic replacement, rollback, or offline proof use the normal
15
+ causal-fingerprint recovery cap in `afk-hitl.md`.
16
+
10
17
  ## Pre-attempt gate
11
18
 
12
19
  Before Vet can emit READY, and again immediately before Prove executes the action,
@@ -37,7 +37,9 @@ directly even when all product slices are built or the AFK slice budget is zero.
37
37
  Do not consume product-slice budget, reopen an answered human gate, or require GO
38
38
  for this offline work. After any controlling-root attempt is recorded, this
39
39
  migration cannot apply again; route its observed atomic/proof failure under the
40
- new fingerprint instead.
40
+ new fingerprint instead. Applying the migration once does not make the first root
41
+ attempt terminal: normal fingerprint accounting starts with that attempt and
42
+ allows up to three no-progress corrections under `afk-hitl.md`.
41
43
 
42
44
  ## Admission
43
45
 
@@ -52,15 +54,39 @@ Before writing:
52
54
  or a request that a drafter supply code is a Plan gap, not implementation input.
53
55
  3. Record preimages or absence for every target plus protected product manifests
54
56
  and the current candidate digest. Resolve every parent no-follow before mutation.
57
+ 4. Before creating an active transaction, **preflight the materializer itself**.
58
+ Do this before any journal or admitted-target mutation. Compile/static-check
59
+ it, then run its
60
+ complete transaction machinery in a disposable same-layout fixture. Cover an
61
+ existing target, an absent target, full success, injected replacement failure,
62
+ rollback cleanup, retained-temporary cleanup, and idempotent rerun. Require the
63
+ fixture to prove that failures leave every simulated target at its bound
64
+ preimage and that no same-parent temporary escapes its admitted directory. Run
65
+ with the working directory outside the admitted parent, and execute negative
66
+ mutants where relative replacement omits either directory handle; both mutants
67
+ must fail before the active transaction is eligible.
55
68
 
56
69
  ## Materialize
57
70
 
58
71
  The root authors the smallest complete bytes for all admitted targets. Write each
59
72
  through a same-parent private temporary file, set the planned mode, flush it, and
60
73
  atomically replace the target; settle the whole set or roll back partial output.
74
+ Anchor every relative rename/replace operand to its source and destination directory handles.
75
+ For Python `os.replace`, pass both `src_dir_fd`
76
+ and `dst_dir_fd`; a basename plus only the destination handle is not admitted.
61
77
  Do not install dependencies, touch Git, use the network, mutate product paths, or
62
78
  execute the consumptive action.
63
79
 
80
+ Workflow-artifact materialization is not a consumptive action. Its active
81
+ transaction may begin only after the disposable preflight is green. If an active
82
+ attempt fails, preserve its journal, exact hashes, and decisive boundary before
83
+ cleanup. When all targets remain at their recorded preimages and only bound
84
+ same-parent temporaries remain, perform exact fail-closed cleanup, repair and
85
+ preflight the materializer offline, then retry under the same causal fingerprint.
86
+ The first controlling-root failure is attempt one of the shared cap, not terminal
87
+ exhaustion; stop only after three no-progress corrections or a genuine
88
+ human/safety/access gate.
89
+
64
90
  ## Verify and return
65
91
 
66
92
  Read back the exact path set, modes, and SHA-256 identities. Run only the vetted
@@ -72,7 +72,10 @@ root ownership is a changed routing condition. Preserve the old fingerprint,
72
72
  record the new materialization fingerprint, and run that offline branch directly;
73
73
  do not charge or require product-slice/AFK budget, re-ask a resolved question, or
74
74
  request GO. Once a root materialization attempt exists, never apply this migration
75
- again—route its observed failure normally. This reconciliation runs even when all
75
+ again—route its observed failure normally. That one-time migration
76
+ does not make the first root attempt terminal: record it as attempt one under the new
77
+ materializer fingerprint and continue bounded offline correction while fewer than
78
+ three no-progress corrections exist. This reconciliation runs even when all
76
79
  product slices are already built, before selecting the next forward phase.
77
80
 
78
81
  1. Save the originating phase/action in the native return cursor unless a valid
@@ -52,7 +52,12 @@ as root materialization attempts. Reopen only when exact paths and executable
52
52
  behavior passed Vet and there is **no controlling-root materialization attempt**;
53
53
  record the routing migration so it cannot reset again. Missing product slices,
54
54
  unresolved protocol choices, or a recorded root attempt remain under their normal
55
- gate/fingerprint rules.
55
+ gate/fingerprint rules. The first controlling-root failure is not exhaustion: it
56
+ is the first no-progress result for the materializer fingerprint. If all targets
57
+ still equal their recorded preimages, no real action ran, and only admitted bound
58
+ temporaries remain, reopen an incorrectly persisted one-shot `1/1` terminal,
59
+ preserve its evidence as attempt one, clean/repair/preflight offline, and continue
60
+ within the shared three-attempt cap.
56
61
 
57
62
  Past evidence being irretrievable is not by itself terminal. When an in-scope
58
63
  trusted diagnostic seam can make the next retained fingerprint uniquely
@@ -23,7 +23,11 @@ See [`one-slice-cycle.md`](one-slice-cycle.md); candidate lifecycle is
23
23
  dispatch the exact `devrites-slice-wright` fresh. Root never writes those product
24
24
  paths, wright never widens, and a missing profile stops.
25
25
  For the workflow-artifact branch, the controlling root writes only the admitted
26
- `.devrites/work/<slug>/` paths, proves the complete atomic set, rechecks an
26
+ `.devrites/work/<slug>/` paths. Before an active journal or target write, it
27
+ compiles the materializer and runs the exact transaction implementation in a
28
+ disposable same-layout fixture covering success, replacement failure, rollback,
29
+ retained-temporary cleanup, and rerun. It then proves the complete atomic set,
30
+ rechecks an
27
31
  identical product candidate, records hashes/evidence, and runs narrow Vet. Do not
28
32
  dispatch any agent as a substitute writer and do not charge a product slice.
29
33
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "devrites",
3
- "version": "4.0.10",
3
+ "version": "4.0.11",
4
4
  "description": "DevRites: a disciplined senior-engineer workflow pack for Claude Code and Codex",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "homepage": "https://github.com/ViktorsBaikers/DevRites#readme",