devrites 4.1.0 → 4.3.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.
- package/CHANGELOG.md +13 -0
- package/README.md +1 -1
- package/docs/engine/commands.md +69 -6
- package/docs/orchestration.md +6 -3
- package/engine/go.mod +1 -1
- package/engine/internal/gate/gate.go +154 -46
- package/engine/internal/gate/gate_test.go +290 -2
- package/engine/internal/gate/readiness_binding.go +66 -100
- package/engine/internal/gate/readiness_binding_test.go +126 -3
- package/engine/internal/lib/cli_observe.go +66 -0
- package/engine/internal/lib/observe_summary.go +79 -0
- package/engine/internal/lib/resolve.go +6 -6
- package/engine/internal/lib/skilltrust.go +196 -0
- package/engine/internal/lib/taskgraph.go +162 -0
- package/engine/internal/lib/taskgraph_test.go +150 -0
- package/engine/internal/lib/workspace_read.go +29 -0
- package/engine/internal/parallel/cli.go +467 -0
- package/engine/internal/parallel/git.go +181 -0
- package/engine/internal/parallel/lease.go +244 -0
- package/engine/internal/parallel/ops.go +416 -0
- package/engine/internal/parallel/parallel_test.go +242 -0
- package/engine/internal/parallel/pathdisjoint.go +129 -0
- package/engine/internal/parallel/pathdisjoint_test.go +97 -0
- package/engine/internal/state/cmd/workflowmanifest/main.go +32 -3
- package/engine/internal/state/feature.go +1 -100
- package/engine/internal/state/observation.go +584 -0
- package/engine/internal/state/observation_open_other.go +9 -0
- package/engine/internal/state/observation_open_unix.go +12 -0
- package/engine/internal/state/observation_test.go +960 -0
- package/engine/internal/state/observation_unix_test.go +68 -0
- package/engine/internal/state/schema.go +60 -160
- package/engine/internal/state/state_test.go +489 -101
- package/engine/internal/state/status.go +97 -53
- package/engine/main.go +72 -3
- package/engine/root_routing_test.go +1 -1
- package/engine/tests/adr_0004_required_by_phase_test.go +16 -13
- package/engine/tests/adr_0011_define_plan_test.go +14 -12
- package/engine/tests/gate_test.go +403 -28
- package/engine/tests/workspace_observation_migration_test.go +1065 -0
- package/pack/.claude/skills/devrites-debug-recovery/SKILL.md +1 -10
- package/pack/.claude/skills/devrites-lib/reference/standards/acceptance-preserving-reslice.md +30 -0
- package/pack/.claude/skills/devrites-lib/reference/standards/afk-hitl.md +2 -9
- package/pack/.claude/skills/devrites-lib/reference/standards/one-shot-actions.md +1 -6
- package/pack/.claude/skills/devrites-lib/reference/standards/skill-authoring.md +22 -0
- package/pack/.claude/skills/devrites-lib/reference/standards/workflow-artifacts.md +411 -102
- package/pack/.claude/skills/rite-autocomplete/SKILL.md +98 -146
- package/pack/.claude/skills/rite-autocomplete/reference/decision-policy.md +11 -5
- package/pack/.claude/skills/rite-autocomplete/reference/loop.md +96 -134
- package/pack/.claude/skills/rite-autocomplete/reference/stop-conditions.md +92 -131
- package/pack/.claude/skills/rite-build/SKILL.md +46 -81
- package/pack/.claude/skills/rite-build/reference/afk-discipline.md +19 -25
- package/pack/.claude/skills/rite-build/reference/checkpoint-protocol.md +29 -59
- package/pack/.claude/skills/rite-build/reference/one-slice-cycle.md +8 -3
- package/pack/.claude/skills/rite-build/reference/output.md +2 -0
- package/pack/.claude/skills/rite-build/reference/parallel-batch.md +64 -0
- package/pack/.claude/skills/rite-build/reference/phase-contract.md +9 -22
- package/pack/.claude/skills/rite-build/reference/wright-dispatch.md +7 -3
- package/pack/.claude/skills/rite-clarify/reference/anti-patterns.md +24 -0
- package/pack/.claude/skills/rite-customize/SKILL.md +3 -2
- package/pack/.claude/skills/rite-doctor/SKILL.md +5 -1
- package/pack/.claude/skills/rite-plan/SKILL.md +17 -17
- package/pack/.claude/skills/rite-plan/reference/anti-patterns.md +11 -1
- package/pack/.claude/skills/rite-plan/reference/dependency-graph.md +3 -0
- package/pack/.claude/skills/rite-plan/reference/replan-and-repair.md +10 -3
- package/pack/.claude/skills/rite-prove/SKILL.md +95 -153
- package/pack/.claude/skills/rite-vet/SKILL.md +121 -174
- package/pack/.claude/skills/rite-vet/reference/anti-patterns.md +14 -2
- package/pack/.claude/skills/rite-vet/reference/artifacts.md +10 -6
- package/pack/.claude/skills/rite-vet/reference/depth.md +10 -3
- package/pack/.claude/skills/rite-vet/reference/review-axes.md +12 -4
- package/pack/generated/claude/skills/devrites-debug-recovery/SKILL.md +1 -10
- package/pack/generated/claude/skills/devrites-lib/reference/standards/acceptance-preserving-reslice.md +30 -0
- package/pack/generated/claude/skills/devrites-lib/reference/standards/afk-hitl.md +2 -9
- package/pack/generated/claude/skills/devrites-lib/reference/standards/one-shot-actions.md +1 -6
- package/pack/generated/claude/skills/devrites-lib/reference/standards/skill-authoring.md +22 -0
- package/pack/generated/claude/skills/devrites-lib/reference/standards/workflow-artifacts.md +411 -102
- package/pack/generated/claude/skills/rite-autocomplete/SKILL.md +98 -146
- package/pack/generated/claude/skills/rite-autocomplete/reference/decision-policy.md +11 -5
- package/pack/generated/claude/skills/rite-autocomplete/reference/loop.md +96 -134
- package/pack/generated/claude/skills/rite-autocomplete/reference/stop-conditions.md +92 -131
- package/pack/generated/claude/skills/rite-build/SKILL.md +46 -81
- package/pack/generated/claude/skills/rite-build/reference/afk-discipline.md +19 -25
- package/pack/generated/claude/skills/rite-build/reference/checkpoint-protocol.md +29 -59
- package/pack/generated/claude/skills/rite-build/reference/one-slice-cycle.md +8 -3
- package/pack/generated/claude/skills/rite-build/reference/output.md +2 -0
- package/pack/generated/claude/skills/rite-build/reference/parallel-batch.md +64 -0
- package/pack/generated/claude/skills/rite-build/reference/phase-contract.md +9 -22
- package/pack/generated/claude/skills/rite-build/reference/wright-dispatch.md +7 -3
- package/pack/generated/claude/skills/rite-clarify/reference/anti-patterns.md +24 -0
- package/pack/generated/claude/skills/rite-customize/SKILL.md +3 -2
- package/pack/generated/claude/skills/rite-doctor/SKILL.md +5 -1
- package/pack/generated/claude/skills/rite-plan/SKILL.md +17 -17
- package/pack/generated/claude/skills/rite-plan/reference/anti-patterns.md +11 -1
- package/pack/generated/claude/skills/rite-plan/reference/dependency-graph.md +3 -0
- package/pack/generated/claude/skills/rite-plan/reference/replan-and-repair.md +10 -3
- package/pack/generated/claude/skills/rite-prove/SKILL.md +95 -153
- package/pack/generated/claude/skills/rite-vet/SKILL.md +121 -174
- package/pack/generated/claude/skills/rite-vet/reference/anti-patterns.md +14 -2
- package/pack/generated/claude/skills/rite-vet/reference/artifacts.md +10 -6
- package/pack/generated/claude/skills/rite-vet/reference/depth.md +10 -3
- package/pack/generated/claude/skills/rite-vet/reference/review-axes.md +12 -4
- package/pack/generated/codex/skills/devrites-debug-recovery/SKILL.md +1 -10
- package/pack/generated/codex/skills/devrites-lib/reference/standards/acceptance-preserving-reslice.md +30 -0
- package/pack/generated/codex/skills/devrites-lib/reference/standards/afk-hitl.md +2 -9
- package/pack/generated/codex/skills/devrites-lib/reference/standards/one-shot-actions.md +1 -6
- package/pack/generated/codex/skills/devrites-lib/reference/standards/skill-authoring.md +22 -0
- package/pack/generated/codex/skills/devrites-lib/reference/standards/workflow-artifacts.md +411 -102
- package/pack/generated/codex/skills/rite-autocomplete/SKILL.md +98 -146
- package/pack/generated/codex/skills/rite-autocomplete/reference/decision-policy.md +11 -5
- package/pack/generated/codex/skills/rite-autocomplete/reference/loop.md +96 -134
- package/pack/generated/codex/skills/rite-autocomplete/reference/stop-conditions.md +92 -131
- package/pack/generated/codex/skills/rite-build/SKILL.md +46 -81
- package/pack/generated/codex/skills/rite-build/reference/afk-discipline.md +19 -25
- package/pack/generated/codex/skills/rite-build/reference/checkpoint-protocol.md +29 -59
- package/pack/generated/codex/skills/rite-build/reference/one-slice-cycle.md +8 -3
- package/pack/generated/codex/skills/rite-build/reference/output.md +2 -0
- package/pack/generated/codex/skills/rite-build/reference/parallel-batch.md +64 -0
- package/pack/generated/codex/skills/rite-build/reference/phase-contract.md +9 -22
- package/pack/generated/codex/skills/rite-build/reference/wright-dispatch.md +7 -3
- package/pack/generated/codex/skills/rite-clarify/reference/anti-patterns.md +24 -0
- package/pack/generated/codex/skills/rite-customize/SKILL.md +3 -2
- package/pack/generated/codex/skills/rite-doctor/SKILL.md +5 -1
- package/pack/generated/codex/skills/rite-plan/SKILL.md +17 -17
- package/pack/generated/codex/skills/rite-plan/reference/anti-patterns.md +11 -1
- package/pack/generated/codex/skills/rite-plan/reference/dependency-graph.md +3 -0
- package/pack/generated/codex/skills/rite-plan/reference/replan-and-repair.md +10 -3
- package/pack/generated/codex/skills/rite-prove/SKILL.md +95 -153
- package/pack/generated/codex/skills/rite-vet/SKILL.md +121 -174
- package/pack/generated/codex/skills/rite-vet/reference/anti-patterns.md +14 -2
- package/pack/generated/codex/skills/rite-vet/reference/artifacts.md +10 -6
- package/pack/generated/codex/skills/rite-vet/reference/depth.md +10 -3
- package/pack/generated/codex/skills/rite-vet/reference/review-axes.md +12 -4
- package/package.json +1 -1
|
@@ -1,131 +1,92 @@
|
|
|
1
|
-
# Stop conditions: when autocomplete
|
|
2
|
-
|
|
3
|
-
On
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
-
|
|
22
|
-
-
|
|
23
|
-
-
|
|
24
|
-
-
|
|
25
|
-
-
|
|
26
|
-
|
|
27
|
-
Red
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
## Not
|
|
31
|
-
|
|
32
|
-
`NEEDS_REPLAN` is not a stop condition under
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
Agent-owned backtracking is not a stop condition while
|
|
38
|
-
budget
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
## Stop on workflow state
|
|
94
|
-
|
|
95
|
-
- **NO-GO at seal** → stop; surface every blocker with `file:line` and the fix
|
|
96
|
-
direction. Do not round NO-GO up to GO.
|
|
97
|
-
- **Spec Drift Guard fires** (`$rite-build` finds the plan is wrong and the change
|
|
98
|
-
alters product behaviour) → stop; route through `$rite-plan repair`.
|
|
99
|
-
- **Budget exhausted with slices still pending:** any validated root-owned remaining
|
|
100
|
-
value of zero stops before the next dispatch. Report which bound won (pre-existing
|
|
101
|
-
remaining value, explicit flag, sentinel cap, or post-vet pending count) and the
|
|
102
|
-
unbuilt slices. A malformed value also fails closed. Zero with no pending slices is
|
|
103
|
-
normal completion → continue to `$rite-prove` without pausing.
|
|
104
|
-
- **Resource envelope unavailable or exhausted:** stop before more work when the AFK
|
|
105
|
-
envelope is missing/malformed/expired; another run overlaps; native agent, token,
|
|
106
|
-
cost, or wall-time headroom is exhausted/unobservable despite a declared cap; or
|
|
107
|
-
unresolved review/gate backlog is above its cap. At the review cap, permit only
|
|
108
|
-
reconciliation that reduces the queue. Record the exact winning limit and observed
|
|
109
|
-
usage/count. A new activation gets fresh activation-local counters; it does not reset
|
|
110
|
-
durable slice/recovery budgets, expiry, or the recomputed queue.
|
|
111
|
-
- **Still low-confidence after the interview:** the idea can't be pinned to testable
|
|
112
|
-
acceptance criteria → stop and ask, rather than guessing the product.
|
|
113
|
-
- **Repeated failure:** bounded recovery exhausts → stop with reproduction.
|
|
114
|
-
|
|
115
|
-
## The final type-GO
|
|
116
|
-
|
|
117
|
-
- `--ship` / `--yolo` never authorizes Git. Continue through ship preflight,
|
|
118
|
-
disclose the exact plan, then stop for literal `GO` and native approval.
|
|
119
|
-
- Without either flag, stop at seal GO with `$rite-ship` as the resume command.
|
|
120
|
-
Seal GO, AFK, prior approval, and flags never satisfy ship approval.
|
|
121
|
-
|
|
122
|
-
## How to stop well
|
|
123
|
-
|
|
124
|
-
State must be enough for a fresh agent to resume cold:
|
|
125
|
-
- `state.md`: `Status`, the blocking reason, and either a single actionable
|
|
126
|
-
`Next step` command or the terminal `none — technical recovery exhausted`
|
|
127
|
-
marker.
|
|
128
|
-
- The relevant `questions.md` / `drift.md` / `seal.md` entry that explains the pause.
|
|
129
|
-
- A one-line user-facing message: *what* stopped it and, only when one exists,
|
|
130
|
-
*what human-owned action* resumes. A terminal technical blocker names no
|
|
131
|
-
routine Plan/Vet/retry command.
|
|
1
|
+
# Stop conditions: when autocomplete pauses
|
|
2
|
+
|
|
3
|
+
On a real stop, write `state.md` as `awaiting_human` or `blocked`, persist the
|
|
4
|
+
reason, and include one resume command only when an actual human/safety/access
|
|
5
|
+
action can change it. Exhausted agent-owned recovery records terminal
|
|
6
|
+
`Next step: none` and no runnable recovery command. `--ship` never bypasses a
|
|
7
|
+
stop.
|
|
8
|
+
|
|
9
|
+
Authority: `.agents/skills/devrites-lib/reference/standards/acceptance-preserving-reslice.md`.
|
|
10
|
+
|
|
11
|
+
<!-- BEGIN RESLICE ROUTE-TO-ACTION -->
|
|
12
|
+
- `FOLD` → keep Plan repair/affected Vet internal; no stop solely for topology/count.
|
|
13
|
+
- `GUARD_AND_REPAIR` → enter Spec Drift Guard/Clarify; pause only at an existing human-owned gate; resume Plan/Vet internally.
|
|
14
|
+
- `BLOCKED_INPUT` → no planning writes; stop internal branch; exact diagnostic; recover authority; reclassify.
|
|
15
|
+
<!-- END RESLICE ROUTE-TO-ACTION -->
|
|
16
|
+
|
|
17
|
+
## Always stop
|
|
18
|
+
|
|
19
|
+
Regardless of flags or AFK ceiling:
|
|
20
|
+
|
|
21
|
+
- destructive data migration;
|
|
22
|
+
- auth/authz boundary change;
|
|
23
|
+
- public API break;
|
|
24
|
+
- external-service contract change; or
|
|
25
|
+
- filesystem destruction outside the workspace.
|
|
26
|
+
|
|
27
|
+
Red proof cannot advance. Run bounded Debug Recovery; stop after proven
|
|
28
|
+
exhaustion unless the remaining owner is human.
|
|
29
|
+
|
|
30
|
+
## Not stops: internal technical routing
|
|
31
|
+
|
|
32
|
+
`NEEDS_REPLAN` is not a stop condition under active Autocomplete. It blocks
|
|
33
|
+
forward work, persists the return cursor, and invokes Plan repair plus Recovery
|
|
34
|
+
Vet inline. The same applies to nested `STOP`/`Next step` when its decision is
|
|
35
|
+
agent-owned.
|
|
36
|
+
|
|
37
|
+
Agent-owned backtracking is not a stop condition while the exact causal
|
|
38
|
+
fingerprint has budget. Invoke the earlier phase, affected Vet, remediation, and
|
|
39
|
+
proof; then resume the origin. Stop only after three no-progress corrections of
|
|
40
|
+
that exact fingerprint or a real human/safety/access gate. Preserve reproduction,
|
|
41
|
+
attempts, and dead ends; never offer `$rite-plan unblock` or another routine
|
|
42
|
+
phase command. Reinvocation with unchanged evidence does not reset the cap.
|
|
43
|
+
`unchanged` means the same fingerprint already has three recorded no-progress
|
|
44
|
+
corrections. Closure is progress; a separately evidenced Critical/Important
|
|
45
|
+
invariant starts its own cap and cannot extend the closed one.
|
|
46
|
+
|
|
47
|
+
Spent consumptive-action authorization is not technical-recovery exhaustion.
|
|
48
|
+
It blocks another execution; retained new Critical/Important evidence still
|
|
49
|
+
enters offline recovery. After affected Vet is READY, pause for fresh action
|
|
50
|
+
authorization and never reuse old GO.
|
|
51
|
+
|
|
52
|
+
Past evidence being irretrievable is not by itself terminal. If an in-scope
|
|
53
|
+
trusted seam can uniquely discriminate the next failure, run diagnostic-
|
|
54
|
+
amplification Plan repair and narrow Vet inline, then pause for fresh GO before
|
|
55
|
+
one evidence-acquisition attempt. Use terminal none only when no safe in-scope
|
|
56
|
+
seam exists, a real human/risk/scope gate owns it, or bounded recovery is
|
|
57
|
+
exhausted.
|
|
58
|
+
|
|
59
|
+
<!-- workflow-artifact-adapter: {"module":"devrites-lib/reference/standards/workflow-artifacts.md","entry":"classifier returns owner-busy, exhausted, or existing hard gate","action":"stop on exact WAIT_ACTIVE_OWNER, BLOCKED_EXHAUSTED, or BLOCKED_GATE result","return":"unchanged cursor plus fixed route-owned output"} -->
|
|
60
|
+
## Other stop classes
|
|
61
|
+
|
|
62
|
+
- **Gate severity:** blocking or escalating gate; any open validating question.
|
|
63
|
+
- **Temper:** any `expand` or added acceptance criterion. `hold-rigor`,
|
|
64
|
+
`reduce-to-MVP`, and a justified skip do not pause.
|
|
65
|
+
- **Clarify:** material Partial/Missing/unowned decision coverage or a
|
|
66
|
+
low-confidence high-consequence assumption. Continue the initial interview;
|
|
67
|
+
never arm AFK early.
|
|
68
|
+
- **Seal:** NO-GO, with every blocker and fix direction. Never round up to GO.
|
|
69
|
+
- **Reslice:** execute its marked action before deciding continue/stop.
|
|
70
|
+
- **Slice budget:** any validated root-owned remaining value of zero stops before the next dispatch
|
|
71
|
+
when slices remain; malformed state also stops. Report whether the winning
|
|
72
|
+
bound was the pre-existing remaining value, explicit flag, sentinel cap, or post-vet pending count.
|
|
73
|
+
Zero with no pending slices is normal completion and proceeds to Prove.
|
|
74
|
+
- **Resource envelope:** missing/malformed/expired AFK, overlapping run,
|
|
75
|
+
exhausted/unobservable declared agent/token/cost/time headroom, or review queue
|
|
76
|
+
above cap. At cap, only queue-reducing reconciliation may run. Persist winning
|
|
77
|
+
bound and observed usage; a new activation does not reset durable budgets or
|
|
78
|
+
expiry.
|
|
79
|
+
- **Confidence:** intent still cannot become testable acceptance after interview.
|
|
80
|
+
- **Repeated failure:** the exact fingerprint's bounded recovery is exhausted.
|
|
81
|
+
|
|
82
|
+
## Final GO and durable stop
|
|
83
|
+
|
|
84
|
+
`--ship`/`--yolo` never authorizes Git. With a flag, complete Ship preflight,
|
|
85
|
+
disclose the exact plan, and stop for literal `GO` plus native approval. Without
|
|
86
|
+
one, stop at Seal GO with `$rite-ship`. Seal GO, AFK, prior approval, and flags
|
|
87
|
+
never satisfy Ship approval.
|
|
88
|
+
|
|
89
|
+
A cold-resumable stop records `state.md` status, exact reason, and either one
|
|
90
|
+
human-owned resume action or `none — technical recovery exhausted`; the owning
|
|
91
|
+
question/drift/seal entry explains it. The user-facing line says what stopped
|
|
92
|
+
and, only when applicable, what human action resumes it.
|
|
@@ -1,99 +1,64 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: rite-build
|
|
3
|
-
description: Build the next approved vertical slice with evidence. HITL
|
|
4
|
-
argument-hint: "[slice number or name]"
|
|
3
|
+
description: Build the next approved vertical slice with evidence. HITL one-slice default; AFK may chain serially; opt-in `--parallel N` (2≤N≤3) for path-disjoint worktrees.
|
|
4
|
+
argument-hint: "[--parallel N] [slice number or name]"
|
|
5
5
|
user-invocable: true
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
# $rite-build: one verified slice
|
|
9
9
|
|
|
10
10
|
Build and prove one slice. HITL stops; a later user invocation starts the next.
|
|
11
|
-
Explicit `.devrites/AFK` alone lets the controlling root chain pending slices
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
Explicit `.devrites/AFK` alone lets the controlling root chain pending slices
|
|
12
|
+
serially under green proof, caps, and pause rules. Every wright returns after it.
|
|
13
|
+
**Opt-in:** `$rite-build --parallel N` (2≤N≤3; N=1≡serial) follows
|
|
14
|
+
[`reference/parallel-batch.md`](reference/parallel-batch.md).
|
|
14
15
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
Root owns gates/bookkeeping. Fresh
|
|
17
|
+
[`devrites-slice-wright`](.codex/agents/devrites-slice-wright.toml) writes product
|
|
18
|
+
source/tests. Workflow Artifact paths use
|
|
18
19
|
[`workflow-artifacts.md`](../devrites-lib/reference/standards/workflow-artifacts.md).
|
|
19
|
-
|
|
20
|
-
dispatch, doubt, fail-on-red, record, and stop checks. See
|
|
20
|
+
Execute [`reference/phase-contract.md`](reference/phase-contract.md); dispatch uses
|
|
21
21
|
[`reference/wright-dispatch.md`](reference/wright-dispatch.md).
|
|
22
22
|
|
|
23
|
-
##
|
|
24
|
-
Read `.agents/skills/devrites-lib/reference/standards/core.md` first. The wright
|
|
25
|
-
reads named on-demand rules while writing; root reads them for doubt/record gates:
|
|
26
|
-
- `coding-style.md`: naming, function shape, guard clauses, comments, reuse-first.
|
|
27
|
-
- `error-handling.md`: fail fast, no silent catches, fail closed.
|
|
28
|
-
- `testing.md`: pyramid, behaviour over implementation, see-it-fail-first.
|
|
29
|
-
- [`reference/tdd.md`](reference/tdd.md): the slice-level Red → Green → Refactor
|
|
30
|
-
and Prove-It contract.
|
|
31
|
-
- `patterns.md`: composition over inheritance, avoid premature abstraction.
|
|
32
|
-
- `principles.md`: the project invariants (`.devrites/principles.md`) the slice must honor; the wright reads them as **binding**, not priors.
|
|
33
|
-
- `security.md`: when the slice touches user input, auth, data, or external integrations.
|
|
34
|
-
- `repository-topology.md`: when targets span roots/languages/services or touch generated/vendor surfaces.
|
|
35
|
-
- `data-integrity.md`: when the slice writes durable state or changes migration/concurrency/tenant/retention behavior.
|
|
36
|
-
- `integration-reliability.md`: when the slice changes an API/webhook/queue/job/cache/cross-service boundary.
|
|
37
|
-
- `definition-of-done.md`: standing Done bar: acceptance mapped, fresh proof, no open hard gates, scoped edits, rollback/docs where needed.
|
|
23
|
+
## Required rules
|
|
38
24
|
|
|
25
|
+
Read `.agents/skills/devrites-lib/reference/standards/core.md` first. Load only triggered rules:
|
|
26
|
+
coding/error/testing/[`tdd.md`](reference/tdd.md)/patterns/DoD; binding
|
|
27
|
+
`.devrites/principles.md`; security; topology; data integrity; integration reliability.
|
|
28
|
+
Wright applies anti-slop; root verifies returns and never patches source.
|
|
39
29
|
|
|
40
|
-
##
|
|
41
|
-
- **One slice per wright dispatch.** Every wright returns after it. The controlling
|
|
42
|
-
root applies the mode rule above before another dispatch. Prefer the guarded serial
|
|
43
|
-
native-worktree pilot in `wright-dispatch.md` only when its committed-clean
|
|
44
|
-
preflight and explicit reconciliation path both hold; otherwise use the existing
|
|
45
|
-
serial same-worktree writer. Never run writers in parallel.
|
|
46
|
-
- Evidence over confidence. Prefer existing conventions. Feature scope only: no
|
|
47
|
-
drive-by refactors.
|
|
48
|
-
- **Record adjacent issues; do not edit them.** An issue outside the exact paths
|
|
49
|
-
stated in the dispatch task becomes an FYI follow-up in `decisions.md`. The slice summary states
|
|
50
|
-
what it deliberately left alone ([`git-workflow.md`](../devrites-lib/reference/standards/git-workflow.md)
|
|
51
|
-
"Things I didn't touch"). The root rejects a returned diff outside this boundary.
|
|
52
|
-
- **Don't re-run an unchanged check.** The same build or test on unchanged code provides
|
|
53
|
-
no new evidence. Re-verify after an edit.
|
|
54
|
-
- Surface material assumptions. Do not introduce an unplanned dependency or second design
|
|
55
|
-
system: route the objective plan gap to `$rite-vet` (or bounded recovery), not to a human.
|
|
56
|
-
Ask only if the newly exposed choice changes licensing/cost/security, product behavior,
|
|
57
|
-
or an explicit architecture policy. The
|
|
58
|
-
[Spec Drift Guard](reference/spec-drift-guard.md) is active throughout.
|
|
59
|
-
- **Avoid AI slop while writing.** `devrites-slice-wright` applies the anti-slop charter
|
|
60
|
-
while writing. The canonical list is `rite-polish/reference/anti-ai-slop.md`; do not
|
|
61
|
-
duplicate it here. The wright follows project idioms and reuses existing code first.
|
|
62
|
-
**Verify the charter on return.** Do not correct source from the orchestrator.
|
|
63
|
-
The **prose you write yourself** (`evidence.md`, `decisions.md`, the slice report) follows
|
|
64
|
-
the human-voice charter (`.agents/skills/devrites-lib/reference/standards/prose-style.md`; depth in `devrites-prose-craft`): no
|
|
65
|
-
filler openers or marketing adjectives; preserve exact commands and identifiers.
|
|
66
|
-
- **Honor declared project principles.** The wright reads `.devrites/principles.md` and treats
|
|
67
|
-
each invariant as **binding** (not a prior to weigh like a convention): a slice it cannot build
|
|
68
|
-
without breaking one is an **Escalation**, not a silent violation. On return **you verify no
|
|
69
|
-
principle was broken**; a fresh violation is handled like any irreversible-risk item: a
|
|
70
|
-
human-approved, scoped exception in the register or a stop, never folded into the slice. No
|
|
71
|
-
`.devrites/principles.md` → none declared → nothing to honor.
|
|
72
|
-
- **You never edit product source/tests.** You write `.devrites/` bookkeeping and,
|
|
73
|
-
only through `workflow-artifacts.md`, an exact Vet-ready executable workflow-artifact set.
|
|
74
|
-
Follow the
|
|
75
|
-
host gate in `wright-dispatch.md` before every build or recovery dispatch. On a
|
|
76
|
-
supported host, the wright is the only writer of code and tests. Codex gives
|
|
77
|
-
the root workspace permission only so that native writer dispatch can execute;
|
|
78
|
-
never patch code from the root. Put the exact project-relative source/test path
|
|
79
|
-
list directly in the task, dispatch the exact `devrites-slice-wright`, then
|
|
80
|
-
compare `git diff --name-only` with those task paths. Any extra source file is
|
|
81
|
-
a hard STOP.
|
|
82
|
-
- **Executable workflow-artifact branch.** If every implementation target is an
|
|
83
|
-
exact admitted path under the active `.devrites/work/<slug>/`, the controlling
|
|
84
|
-
root materializes and proves that atomic set itself. It does not dispatch the wright,
|
|
85
|
-
decrement/count a product slice, update the candidate manifest, or execute the
|
|
86
|
-
consumptive action. After narrow Vet, restore the caller cursor.
|
|
30
|
+
## Invariants
|
|
87
31
|
|
|
88
|
-
|
|
32
|
+
- Default: one slice; writers serial on control. Parallel only via `--parallel N`
|
|
33
|
+
under [`reference/parallel-batch.md`](reference/parallel-batch.md). Same-worktree
|
|
34
|
+
multi-writer / root-emulated concurrency forbidden. Native-worktree pilot =
|
|
35
|
+
single-slice isolation when `wright-dispatch.md` preflight + reconcile hold.
|
|
36
|
+
- Exact feature scope only; reject out-of-allowlist diffs; record adjacent issues.
|
|
37
|
+
- Never rerun an unchanged check; re-prove after edits.
|
|
38
|
+
- Unplanned dependency/design-system/gap/repair → Vet/Spec Drift Guard. Ask only
|
|
39
|
+
for licensing/cost/security/product or explicit architecture-policy decisions.
|
|
40
|
+
- Root never edits product source/tests (`.devrites/` + Workflow Artifact only).
|
|
41
|
+
Wright is sole product writer; extras in returned paths/`git diff --name-only` hard-stop.
|
|
42
|
+
- Principles bind; irreversible conflict needs human exception or stop.
|
|
43
|
+
- Evidence beats confidence. Never weaken tests, skip TDD, widen writers, or
|
|
44
|
+
self-approve. Drift → [`spec-drift-guard.md`](reference/spec-drift-guard.md);
|
|
45
|
+
checkpoint → [`checkpoint.md`](reference/checkpoint.md).
|
|
89
46
|
|
|
90
|
-
|
|
91
|
-
[`reference/phase-contract.md`](reference/phase-contract.md). It is not optional:
|
|
92
|
-
it contains the gated one-slice workflow, including readiness, HITL/AFK handling,
|
|
93
|
-
wright dispatch, doubt, fail-on-red, record gates, and stop behavior.
|
|
47
|
+
## Workflow Artifact branch
|
|
94
48
|
|
|
95
|
-
|
|
49
|
+
<!-- workflow-artifact-adapter: {"module":"devrites-lib/reference/standards/workflow-artifacts.md","entry":"Vet-ready admitted bytes require root authorship outside product wright","action":"ROOT_TRANSACTION; root writes only admitted .devrites/** targets","return":"saved Build slice cursor; wright product allowlist unchanged"} -->
|
|
50
|
+
## `--parallel N` (opt-in)
|
|
96
51
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
52
|
+
Omitted/`1` ≡ serial; `2`/`3` → path-disjoint fan-out when eligible; else hard refuse.
|
|
53
|
+
All-green serial integrate; one red/gap aborts. AFK charges after integrate only.
|
|
54
|
+
Running lease blocks another `$rite-build`. Details: `parallel-batch.md`.
|
|
55
|
+
|
|
56
|
+
## Execute and reply
|
|
57
|
+
|
|
58
|
+
Run every step in `reference/phase-contract.md`: readiness, one target, dispatch
|
|
59
|
+
or canonical transaction, return inspection, independent doubt/test analysis,
|
|
60
|
+
approved fail-on-red proof, record, AFK accounting, and stop. Use
|
|
61
|
+
[`reference/output.md`](reference/output.md) plus the shared
|
|
62
|
+
[`reply contract`](../devrites-lib/reference/reply-contract.md). HITL never starts
|
|
63
|
+
the next slice automatically; AFK chains only within its durable remaining
|
|
64
|
+
budget; Prove starts only after all slices are built.
|
|
@@ -8,16 +8,8 @@ Load the shared
|
|
|
8
8
|
contract for the sentinel schema, defaults, gate ceiling, and mutable-counter
|
|
9
9
|
ownership. This file owns only Build's dispatch, charging, and red-path behavior.
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
1. **Require green feedback.** Tests, types, and lint must pass before a slice is
|
|
15
|
-
marked `built`.
|
|
16
|
-
2. **Cap iterations.** `max_slices` is the hard limit.
|
|
17
|
-
3. **Run gates before the action they control.** A post-action gate is only a review
|
|
18
|
-
queue.
|
|
19
|
-
4. **Keep irreversible work manual.** Destructive work, auth boundaries, and public
|
|
20
|
-
API breaks always pause regardless of the sentinel.
|
|
11
|
+
Rules: green before `built`; hard `max_slices` cap; gates before the action they
|
|
12
|
+
control; irreversible work (destructive/auth/public API) always pauses.
|
|
21
13
|
|
|
22
14
|
## Iteration cap
|
|
23
15
|
|
|
@@ -41,32 +33,33 @@ The controlling root owns the cap:
|
|
|
41
33
|
A controlling orchestrator may pre-seed the remaining field from a validated
|
|
42
34
|
post-plan budget before the first dispatch; never increase or reinitialize an
|
|
43
35
|
existing value.
|
|
44
|
-
3. **Charge exactly once after each green built slice.**
|
|
45
|
-
built is not charged again after retry, resume, or
|
|
46
|
-
saved cursor; if it is zero, report the cap and stop
|
|
47
|
-
dispatch.
|
|
36
|
+
3. **Charge exactly once after each green built slice.** On the control tree, a slice
|
|
37
|
+
already marked built is not charged again after retry, resume, or
|
|
38
|
+
compaction. Re-read the saved cursor; if it is zero, report the cap and stop
|
|
39
|
+
before the next dispatch.
|
|
40
|
+
- **Serial:** charge when fail-on-red is green and the built record is written
|
|
41
|
+
(same rewrite as step 2).
|
|
42
|
+
- **Parallel `--parallel`:** charge only after **successful serial integrate**
|
|
43
|
+
— once per integrated green sibling. Abort / integrate-failed → charge **0**.
|
|
44
|
+
Do not charge on worktree-green before integrate. See
|
|
45
|
+
[`parallel-batch.md`](parallel-batch.md).
|
|
48
46
|
|
|
49
47
|
Use this stop message:
|
|
50
48
|
|
|
51
|
-
```
|
|
49
|
+
```text
|
|
52
50
|
AFK cap reached. Raise `state.md` `AFK slices remaining` or remove the sentinel to continue.
|
|
53
51
|
```
|
|
54
52
|
|
|
55
53
|
`max_slices` itself is read-only and never rewritten. No exit-code command
|
|
56
54
|
enforces this policy.
|
|
57
55
|
|
|
58
|
-
Choose
|
|
59
|
-
|
|
60
|
-
successfully in HITL.
|
|
56
|
+
Choose caps deliberately (≈5–10 small, ≈30–50 larger). Avoid `unlimited` until HITL
|
|
57
|
+
has succeeded for the work.
|
|
61
58
|
|
|
62
59
|
## Fail-on-red
|
|
63
60
|
|
|
64
|
-
The **fail-on-red step**
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
- A red signal means either the slice's contract is wrong or the implementation/proof path is.
|
|
68
|
-
The slice cannot advance, but an objective root cause is agent-owned recovery work.
|
|
69
|
-
- Marking it `built` would let the next slice build on broken state.
|
|
61
|
+
The **fail-on-red step** refuses `built` when targeted tests/types/lint are red. Red means
|
|
62
|
+
wrong contract or proof path — agent-owned recovery; never advance on broken state.
|
|
70
63
|
|
|
71
64
|
The fail-on-red path:
|
|
72
65
|
|
|
@@ -105,7 +98,7 @@ The hook is a single shell command run on the `awaiting_human` transition. Envir
|
|
|
105
98
|
the hook receives:
|
|
106
99
|
|
|
107
100
|
| Var | Value |
|
|
108
|
-
|
|
101
|
+
| --- | --- |
|
|
109
102
|
| `DEVRITES_QID` | the new qid (e.g. `q-2026-05-28-001`) |
|
|
110
103
|
| `DEVRITES_GATE` | `advisory` / `validating` / `blocking` / `escalating` |
|
|
111
104
|
| `DEVRITES_SLICE` | `<N — name>` |
|
|
@@ -117,6 +110,7 @@ The hook is best effort: a non-zero exit does **not** roll back the pause. Failu
|
|
|
117
110
|
logged to `evidence.md` so the user sees them on return.
|
|
118
111
|
|
|
119
112
|
Example targets:
|
|
113
|
+
|
|
120
114
|
- `curl -d "$DEVRITES_QID: $DEVRITES_QUESTION" ntfy.sh/my-topic`
|
|
121
115
|
- `osascript -e "display notification \"$DEVRITES_QUESTION\" with title \"DevRites: $DEVRITES_GATE\""`
|
|
122
116
|
- `pb push "$DEVRITES_SLUG: $DEVRITES_QUESTION"` (via pushbullet CLI)
|
|
@@ -1,29 +1,22 @@
|
|
|
1
1
|
# Checkpoint protocol: what `$rite-build` does when a slice is HITL
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
surfaces the checkpoint as a ranked **option set** and resolves it **before** any code lands:
|
|
3
|
+
HITL slices pause **pre-action** as a ranked **option set** before any code:
|
|
5
4
|
|
|
6
|
-
- **
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
`state.md` `Awaiting human`), fire the `notify:` hook, and **stop**. Resume later via
|
|
11
|
-
`$rite-resolve` (or `--batch`).
|
|
12
|
-
|
|
13
|
-
Either way the pause is **pre-action**, not post-action: code never lands before the gate.
|
|
5
|
+
- **Interactive:** `AskUserQuestion`; record to `questions.md`/`decisions.md`; clear gate;
|
|
6
|
+
continue in place (no `$rite-resolve` round-trip).
|
|
7
|
+
- **Absent / AFK / notify-only:** persist open question + `Awaiting human`, notify, **stop**.
|
|
8
|
+
Resume via `$rite-resolve` (or `--batch`).
|
|
14
9
|
|
|
15
10
|
## Render contract
|
|
16
11
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
the persisted form is for the next session or the AFK observer.
|
|
12
|
+
Render the checkpoint in user-facing output **and** persist it for the next session / AFK
|
|
13
|
+
observer.
|
|
20
14
|
|
|
21
15
|
### User-facing render: the option set
|
|
22
16
|
|
|
23
|
-
Present
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
plus the escape hatch. The header names the slice + gate:
|
|
17
|
+
Present as `AskUserQuestion` ranked **option set** (`afk-hitl.md`): 2–4 options,
|
|
18
|
+
recommended first + `(Recommended)`, dimension-tagged trade-offs, plus escape hatch.
|
|
19
|
+
Header names slice + gate:
|
|
27
20
|
|
|
28
21
|
```
|
|
29
22
|
Slice <N — name> — HITL (<gate>, SLA <SLA>). <Checkpoint text from tasks.md>
|
|
@@ -35,12 +28,9 @@ Slice <N — name> — HITL (<gate>, SLA <SLA>). <Checkpoint text from tasks.md>
|
|
|
35
28
|
4. Something else — I'll describe it
|
|
36
29
|
```
|
|
37
30
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
(its conventions, stack, scale), not a generic default. On an interactive pick, resolve in
|
|
42
|
-
place; when persisting a pause instead, the same set is written to `questions.md` `options:`
|
|
43
|
-
and the resume line is `$rite-resolve <qid> "<answer>"` (or `--drop <qid> "<reason>"`).
|
|
31
|
+
Option #1 (recommended) is **required** and must reflect *this* project. Interactive pick →
|
|
32
|
+
resolve in place; pause → persist the same set to `questions.md` `options:` with resume
|
|
33
|
+
`$rite-resolve <qid> "<answer>"` (or `--drop <qid> "<reason>"`).
|
|
44
34
|
|
|
45
35
|
### Workspace mutations
|
|
46
36
|
|
|
@@ -93,9 +83,7 @@ rewrite; do not claim cross-file atomicity):
|
|
|
93
83
|
sh -c "$notify_cmd"
|
|
94
84
|
```
|
|
95
85
|
|
|
96
|
-
|
|
97
|
-
that already records the pause. Failures in the hook **do not** roll back the pause:
|
|
98
|
-
the gate is authoritative; the notification is best-effort.
|
|
86
|
+
Fire after workspace write. Hook failure does **not** roll back the pause (best-effort).
|
|
99
87
|
|
|
100
88
|
## qid generation
|
|
101
89
|
|
|
@@ -109,42 +97,24 @@ reservation or engine command for qids.
|
|
|
109
97
|
|
|
110
98
|
## When AFK is active
|
|
111
99
|
|
|
112
|
-
If `.devrites/AFK` exists and the slice
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
`evidence.md`), not per slice. The `built (pending review)` slice is not done until the
|
|
122
|
-
open `validating` gate resolves via `$rite-resolve`; an open `validating` gate is a
|
|
123
|
-
NO-GO at seal.
|
|
124
|
-
|
|
125
|
-
For gates in `allow_gates`, AFK **auto-picks the recommended option** (option 1 of the set)
|
|
126
|
-
instead of pausing, recording it as above. For `blocking` and `escalating` (and every
|
|
127
|
-
irreversible-risk item), AFK **always** invokes the checkpoint protocol: the sentinel does
|
|
128
|
-
not unlock these gates and no AFK key can override them. See `afk-discipline.md`
|
|
129
|
-
for the irreversible-risk list.
|
|
100
|
+
If `.devrites/AFK` exists and the slice `Gate` is in `allow_gates`, skip this protocol and
|
|
101
|
+
auto-pick recommended option 1:
|
|
102
|
+
|
|
103
|
+
- `advisory`: log `gate: advisory` + `decisions.md`, then dispatch wright.
|
|
104
|
+
- `validating` (only if allowed): dispatch wright; on return log `gate: validating`, mark
|
|
105
|
+
`built (pending review)`, continue. Slice states remain `pending|built`; feature
|
|
106
|
+
acceptance is `$rite-prove`. Open `validating` is NO-GO at seal until `$rite-resolve`.
|
|
107
|
+
|
|
108
|
+
`blocking` / `escalating` / irreversible-risk always use this protocol (`afk-discipline.md`).
|
|
130
109
|
|
|
131
110
|
## Multi-question pauses
|
|
132
111
|
|
|
133
|
-
|
|
134
|
-
checkpoints, split it into sub-slices via `$rite-plan reslice` so each pause is
|
|
135
|
-
single-question. Multi-question pauses are reserved future shape; `Awaiting human` is
|
|
136
|
-
written as a single block.
|
|
112
|
+
**One question per pause.** Multiple HITL checkpoints → `$rite-plan reslice`.
|
|
137
113
|
|
|
138
114
|
## What NOT to do
|
|
139
115
|
|
|
140
|
-
-
|
|
141
|
-
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
explicit answer: the agent doesn't confirm its own `proposed:` on resume. This is distinct
|
|
146
|
-
from the two legitimate auto-resolutions: an interactive `AskUserQuestion` pick the human
|
|
147
|
-
just made, and an AFK auto-pick of the recommended option on a gate `allow_gates` permits.
|
|
148
|
-
- **Don't bundle the `notify:` hook output into chat.** Fire-and-forget; the chat already
|
|
149
|
-
has the user-facing render.
|
|
150
|
-
- **Don't fire `notify:` on `advisory`-downgraded entries.** It's reserved for true pauses.
|
|
116
|
+
- Don't write code then pause — pre-action only.
|
|
117
|
+
- Don't render without persisting `state.md` + `questions.md`.
|
|
118
|
+
- Don't self-answer a human pause via `proposed:` — `$rite-resolve` needs an explicit
|
|
119
|
+
answer (distinct from interactive pick / AFK auto-pick on `allow_gates`).
|
|
120
|
+
- Don't put `notify:` output in chat; don't fire `notify:` on advisory-only entries.
|