devrites 4.1.0 → 4.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/README.md +1 -1
- package/docs/engine/commands.md +65 -6
- 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/resolve.go +6 -6
- 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 +67 -48
- 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/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 +51 -79
- package/pack/.claude/skills/rite-build/reference/phase-contract.md +3 -17
- 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/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/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 +51 -79
- package/pack/generated/claude/skills/rite-build/reference/phase-contract.md +3 -17
- 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/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/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 +51 -79
- package/pack/generated/codex/skills/rite-build/reference/phase-contract.md +3 -17
- 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/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
|
@@ -7,161 +7,113 @@ user-invocable: true
|
|
|
7
7
|
|
|
8
8
|
# $rite-autocomplete: full lifecycle, unattended
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
Run every phase after one clarification window. Irreversible-risk,
|
|
11
11
|
blocking/escalating,<!-- pack-scan-ignore: negated statement: gates are NOT disabled -->
|
|
12
|
-
|
|
13
|
-
default and
|
|
14
|
-
[`
|
|
12
|
+
NO-GO, resource, and human-owned gates still pause. Use the Standard native
|
|
13
|
+
profile by default and Full for high-risk scope or explicit `--full`; see
|
|
14
|
+
[`orchestration-profiles.md`](../devrites-lib/reference/orchestration-profiles.md).
|
|
15
15
|
|
|
16
|
-
##
|
|
17
|
-
**Step 0:** Read `.agents/skills/devrites-lib/reference/standards/core.md` and `.agents/skills/devrites-lib/reference/standards/afk-hitl.md` first.
|
|
18
|
-
When the cursor or approved plan contains a consumptive action, also read
|
|
19
|
-
`.agents/skills/devrites-lib/reference/standards/one-shot-actions.md` before any
|
|
20
|
-
stop/continue or execution decision.
|
|
21
|
-
When a blocked cursor names missing executable controller/harness/bundle bytes or
|
|
22
|
-
a missing writer under the active feature workspace, read
|
|
23
|
-
`.agents/skills/devrites-lib/reference/standards/workflow-artifacts.md` before honoring
|
|
24
|
-
the terminal cursor or its recovery count.
|
|
16
|
+
## Required rules
|
|
25
17
|
|
|
26
|
-
|
|
27
|
-
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
18
|
+
Read `devrites-lib/reference/standards/core.md` and `afk-hitl.md` first. Read
|
|
19
|
+
`one-shot-actions.md` before any stop/continue or execution decision involving a
|
|
20
|
+
consumptive action. Before honoring a terminal cursor that names missing
|
|
21
|
+
executable controller/harness/bundle bytes or a missing writer, read
|
|
22
|
+
`workflow-artifacts.md`. Before classifying any Reslice, read `.agents/skills/devrites-lib/reference/standards/acceptance-preserving-reslice.md`.
|
|
23
|
+
|
|
24
|
+
<!-- BEGIN RESLICE ROUTE-TO-ACTION -->
|
|
25
|
+
- `FOLD` → keep Plan repair/affected Vet internal; no stop solely for topology/count.
|
|
26
|
+
- `GUARD_AND_REPAIR` → enter Spec Drift Guard/Clarify; pause only at an existing human-owned gate; resume Plan/Vet internally.
|
|
27
|
+
- `BLOCKED_INPUT` → no planning writes; stop internal branch; exact diagnostic; recover authority; reclassify.
|
|
28
|
+
<!-- END RESLICE ROUTE-TO-ACTION -->
|
|
29
|
+
|
|
30
|
+
## Invariants
|
|
31
|
+
|
|
32
|
+
- Use one initial human window: Spec, topology-first Clarify, and
|
|
33
|
+
`Decision coverage: CLEAR`. Only then arm AFK. Record later reversible choices
|
|
34
|
+
under [decision policy](reference/decision-policy.md).
|
|
35
|
+
- Safety is not bypassable. `--ship`/`--yolo` reaches only the exact-plan
|
|
36
|
+
literal-GO and native-approval boundary; it never authorizes Git.
|
|
39
37
|
- **Treat technical readiness as routing, not completion.** `NEEDS_REPLAN` is a backward edge
|
|
40
|
-
to Plan repair and narrow Vet
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
and
|
|
61
|
-
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
spec on its own; it never *expands* the build's scope without the human.
|
|
66
|
-
- **Engineering review runs on every plan, but never auto-grows scope.** After `$rite-define`,
|
|
67
|
-
run `$rite-vet` on **every** feature (depth scales: a light pass on simple plans, full rigor on
|
|
68
|
-
big/risky; never skipped). Unattended it auto-applies only *hardening* findings: added test
|
|
69
|
-
requirements, error-handling / failure-mode coverage, tightened scope, reuse-over-rebuild,
|
|
70
|
-
dependency-order fixes (these never grow acceptance); acceptance-preserving
|
|
71
|
-
reslicing or remediation remains agent-owned. **Any finding that grows product
|
|
72
|
-
scope or changes acceptance is a blocking pause**, and irreversible-risk findings always
|
|
73
|
-
pause. Cross-model is off unless `--cross-model` was armed.
|
|
38
|
+
to Plan repair and narrow Vet. `NEEDS_REPLAN` cold resume follows a valid
|
|
39
|
+
technical return cursor before forward work or any reply. Clarification is
|
|
40
|
+
likewise internal when current authority resolves it.
|
|
41
|
+
- Always follow agent-owned backward edges through repair, affected Vet,
|
|
42
|
+
correction, and proof. A nested `STOP`/`Next step` is not a user handoff.
|
|
43
|
+
Pause only for a shared human/safety/access/exhaustion condition.
|
|
44
|
+
- **Do not confuse an action budget with recovery exhaustion.** Spent action
|
|
45
|
+
authority blocks another real execution, not offline correction of retained
|
|
46
|
+
Critical/Important evidence. Stop for fresh GO only after changed conditions
|
|
47
|
+
and READY Vet.
|
|
48
|
+
- Every exact causal fingerprint gets at most three no-progress corrections.
|
|
49
|
+
Closing one is progress; a distinct Critical/Important invariant has its own
|
|
50
|
+
budget. Lower severity cannot prolong recovery.
|
|
51
|
+
- Enforce `--max-slices`, the AFK sentinel, expiry, review queue, and native
|
|
52
|
+
agent/token/cost/time limits before every phase or dispatch. Count failed,
|
|
53
|
+
malformed, and unavailable leaf calls. At the review cap, permit only work
|
|
54
|
+
that reduces the queue.
|
|
55
|
+
- Parse flags only from this invocation. `--ship`, `--yolo`, `--max-slices`,
|
|
56
|
+
`--full`, and `--cross-model` activate only as exact standalone tokens in
|
|
57
|
+
`$ARGUMENTS`; examples or earlier messages can never arm them. `--max-slices`
|
|
58
|
+
must occur once and be followed by a positive base-10 integer; missing, repeated, malformed, or conflicting values stop before any write.
|
|
59
|
+
- Temper always runs after Clarify. Unattended mode auto-applies only
|
|
60
|
+
`hold-rigor` and `reduce-to-MVP`; any `expand` or added acceptance pauses.
|
|
61
|
+
- Vet every plan. Cross-model is off unless the current invocation arms it.
|
|
62
|
+
Never auto-grow accepted scope.
|
|
74
63
|
|
|
75
64
|
## Workflow
|
|
76
|
-
1. **Orient + parse args.** Resolve the explicit or active slug, require its
|
|
77
|
-
`state.md`, and read the cursor directly. Before honoring `blocked` with a
|
|
78
|
-
terminal `next_action`, reconcile retained consumptive-action artifacts and
|
|
79
|
-
per-fingerprint attempts from `drift.md` / `evidence.md`. A distinct retained
|
|
80
|
-
fingerprint below its no-progress cap reopens caller-owned offline recovery;
|
|
81
|
-
a stale pre-ownership workflow-artifact writer stop reopens under
|
|
82
|
-
`workflow-artifacts.md` when no controlling-root materialization attempt exists.
|
|
83
|
-
A `NEEDS_REPLAN` cold resume with a valid technical return cursor immediately
|
|
84
|
-
invokes Plan repair and Recovery Vet before selecting a forward phase or
|
|
85
|
-
emitting any reply.
|
|
86
|
-
That materialization runs directly as non-consumptive prerequisite recovery,
|
|
87
|
-
even with no pending product slice or AFK budget; it does not re-ask an answered
|
|
88
|
-
human gate.
|
|
89
|
-
reconstruct any missing return cursor only from the current phase plus the
|
|
90
|
-
exact approved action in `test-plan.md` / evidence, never from chat or guesswork.
|
|
91
|
-
The idea + flags: `--ship` / `--yolo` (continue through ship preflight, then stop
|
|
92
|
-
for literal-GO and native approval), `--max-slices N` (optional explicit cap;
|
|
93
|
-
a newly created sentinel defaults to 10 and post-Vet pending count may lower it).
|
|
94
|
-
Parse only the current `$ARGUMENTS`; normalize the result to the idea,
|
|
95
|
-
`ship_preflight: yes|no`, `max_slices: N|default`, `profile: standard|full`, and
|
|
96
|
-
`cross_model: yes|no`.
|
|
97
|
-
**Completion:** that normalized state is unambiguous and no sentinel or workspace
|
|
98
|
-
file has been written.
|
|
99
|
-
2. **Specify and clarify up front.** Use `devrites-interview`, `$rite-spec`, and
|
|
100
|
-
`$rite-clarify` as one interactive window. Clear specs ask zero questions; Partial/Missing
|
|
101
|
-
coverage never arms AFK. **Completion:** `decision-coverage.md` records `CLEAR`.
|
|
102
|
-
3. **Arm AFK after clarity.** Require `Decision coverage: CLEAR`, then apply the
|
|
103
|
-
loop's [one-write AFK contract](reference/loop.md#arm-afk-once): preserve a valid
|
|
104
|
-
existing sentinel byte-for-byte or create an advisory-only sentinel once with
|
|
105
|
-
bounded slices, agents, wall time, review queue, and four-hour absolute expiry;
|
|
106
|
-
never rewrite it after Vet or reset it on resume. Also `touch .devrites/CHECKPOINT`:
|
|
107
|
-
unattended runs use
|
|
108
|
-
checkpoint mode so each proven slice is committed locally as a crash-survivable
|
|
109
|
-
`WIP` ([rite-build/reference/checkpoint.md](../rite-build/reference/checkpoint.md));
|
|
110
|
-
`$rite-ship` collapses them into the one feature commit. **Completion:** AFK config is
|
|
111
|
-
valid and advisory-only, any pre-existing bytes are unchanged, and the checkpoint
|
|
112
|
-
sentinel exists.
|
|
113
|
-
4. **Drive the phases** ([reference/loop.md](reference/loop.md)). The canonical arc is
|
|
114
|
-
`$rite-spec` → **`$rite-clarify`** → **`$rite-temper`** → `$rite-define` →
|
|
115
|
-
**`$rite-vet`** → `$rite-build` (repeat until all slices
|
|
116
|
-
built; root charges the AFK budget once per green built slice) → `$rite-prove`
|
|
117
|
-
→ `$rite-polish` → `$rite-review` → `$rite-seal`.
|
|
118
|
-
Read each `SKILL.md` and execute it; workspace files carry state, not chat.
|
|
119
|
-
Follow the loop's backward-edge contract whenever a later phase discovers an
|
|
120
|
-
agent-owned earlier-phase gap; keep the original return cursor until that
|
|
121
|
-
phase resumes.
|
|
122
|
-
Immediately after `$rite-vet` and before the first Build dispatch, apply the loop's
|
|
123
|
-
[mutable post-vet budget](reference/loop.md#derive-the-mutable-post-vet-budget)
|
|
124
|
-
contract, then apply resource admission before every phase and native dispatch.
|
|
125
|
-
**Completion:** the loop reaches Seal GO, or a stop condition is persisted
|
|
126
|
-
before any later phase runs; the cursor names the last completed phase and the
|
|
127
|
-
effective remaining budget.
|
|
128
|
-
5. **Apply stop conditions at every gate** ([reference/stop-conditions.md](reference/stop-conditions.md)):
|
|
129
|
-
first route an agent-owned red technical result through the loop's bounded
|
|
130
|
-
recovery; its `blocked` label alone is not a stop condition. After that, on
|
|
131
|
-
hard-risk / human-owned blocking / escalating / NO-GO / slice, agent, token,
|
|
132
|
-
cost, time, review-queue, or expiry exhaustion / still-low-confidence → write
|
|
133
|
-
`state.md` (`Status`, `Next step`), surface *why*, and **STOP**.
|
|
134
|
-
Exhausted agent-owned technical recovery uses the terminal `Next step: none`
|
|
135
|
-
marker and never hands the user `$rite-plan unblock` or another routine
|
|
136
|
-
phase command.
|
|
137
|
-
**Completion:** either no stop condition is active, or the stopped cursor and reason
|
|
138
|
-
are durable and no later phase has been invoked.
|
|
139
|
-
6. **Seal GO → ship boundary.** With `--ship` / `--yolo`, proceed through
|
|
140
|
-
`$rite-ship` preflight, disclose the exact Git plan, then stop for the human's
|
|
141
|
-
literal `GO` and any native host approval. Without the flag, stop at seal GO with
|
|
142
|
-
`$rite-ship` as the resume command. **Completion:** the no-flag path has performed no
|
|
143
|
-
Ship work; the flagged path has disclosed the exact plan and performed no Git action
|
|
144
|
-
before fresh literal `GO` plus native approval.
|
|
145
65
|
|
|
146
|
-
|
|
147
|
-
|
|
66
|
+
1. **Orient and parse.** Resolve the explicit or active slug, require `state.md`,
|
|
67
|
+
and read its cursor. Before honoring `blocked` with terminal `next_action`,
|
|
68
|
+
reconcile retained consumptive evidence and fingerprint attempts from
|
|
69
|
+
`drift.md`/`evidence.md`; a retained fingerprint below its cap resumes offline
|
|
70
|
+
recovery.
|
|
71
|
+
<!-- workflow-artifact-adapter: {"module":"devrites-lib/reference/standards/workflow-artifacts.md","entry":"lifecycle cursor encounters admitted set or resumable journal","action":"invoke classifier; execute returned route internally","return":"saved phase/action; zero intermediate reply"} -->
|
|
72
|
+
Reconstruct a missing return cursor only from
|
|
73
|
+
the current phase and exact approved action in `test-plan.md`/evidence, never
|
|
74
|
+
from chat. Normalize current arguments to idea, `ship_preflight: yes|no`,
|
|
75
|
+
`max_slices: N|default`, `profile: standard|full`, and `cross_model: yes|no`.
|
|
76
|
+
**Completion:** normalized state is unambiguous and no sentinel or workspace file has been written.
|
|
77
|
+
2. **Specify and clarify.** Run `devrites-interview`, `$rite-spec`, and
|
|
78
|
+
`$rite-clarify` as one window. Partial/Missing material coverage never arms
|
|
79
|
+
AFK. **Completion:** `Decision coverage: CLEAR` is durable.
|
|
80
|
+
3. **Arm AFK once.** Apply the loop's
|
|
81
|
+
[one-write AFK contract](reference/loop.md#arm-afk-once): preserve valid
|
|
82
|
+
existing bytes or create the bounded advisory-only sentinel once; never
|
|
83
|
+
rewrite it after Vet. Preserve an existing sentinel byte-for-byte. Touch
|
|
84
|
+
`.devrites/CHECKPOINT` so proven slices get local crash-survivable WIP
|
|
85
|
+
checkpoints for Ship to collapse. **Completion:** valid read-only AFK and checkpoint sentinels exist.
|
|
86
|
+
4. **Drive phases.** Follow [the loop](reference/loop.md): `$rite-spec` →
|
|
87
|
+
`$rite-clarify` → `$rite-temper` → `$rite-define` → `$rite-vet` →
|
|
88
|
+
`$rite-build` × pending slices → `$rite-prove` → `$rite-polish` →
|
|
89
|
+
`$rite-review` → `$rite-seal`. Read and execute each skill; durable files, not
|
|
90
|
+
chat, carry state. Apply the mutable post-vet budget before first Build.
|
|
91
|
+
**Completion:** loop reaches Seal GO or persists a valid stop before any later phase.
|
|
92
|
+
5. **Apply stops.** At every gate use
|
|
93
|
+
[stop-conditions.md](reference/stop-conditions.md). A `blocked` label alone is not a stop condition:
|
|
94
|
+
route agent-owned red results through bounded recovery.
|
|
95
|
+
Red gates block forward advancement and enter caller-owned recovery. Stop on
|
|
96
|
+
hard risk, human-owned blocking/escalating/NO-GO, resource exhaustion, or the
|
|
97
|
+
exact fingerprint's proven exhaustion. Technical exhaustion records terminal
|
|
98
|
+
`Next step: none`, never a routine phase command. **Completion:** no stop is active, or its cursor and reason are durable.
|
|
99
|
+
6. **Seal boundary.** Without a ship flag, stop at Seal GO with `$rite-ship`.
|
|
100
|
+
With one, perform Ship preflight, disclose the exact Git plan, and stop for
|
|
101
|
+
fresh literal `GO` plus native approval. **Completion:** performed no Git action before fresh literal `GO` plus native approval.
|
|
148
102
|
|
|
149
|
-
|
|
150
|
-
|
|
103
|
+
## Reply and resume
|
|
104
|
+
|
|
105
|
+
HITL Build returns after one slice; explicit valid AFK may chain only green
|
|
106
|
+
slices within every cap. One Autocomplete invocation owns all internal
|
|
107
|
+
backtracking. Context pressure, compaction, or a nested completion footer does
|
|
108
|
+
not create a stop; persist and resume the cursor.
|
|
109
|
+
|
|
110
|
+
Use one terse line:
|
|
111
|
+
|
|
112
|
+
```text
|
|
151
113
|
Autocomplete: <slug>
|
|
152
114
|
spec <done|stopped> · clarify <clear|stopped> · temper <done|skipped|stopped> · define <done|stopped> · vet <ready|stopped> · build <n/N|stopped> · prove <done|stopped> · polish <done|stopped> · review <done|stopped> · seal <GO|NO-GO|stopped>
|
|
153
115
|
```
|
|
154
116
|
|
|
155
|
-
Final state
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
## Clean baseline and checkpoint mode
|
|
160
|
-
- Before autonomy, require a clean or accepted baseline; refuse unrelated dirty work and record plan artifacts.
|
|
161
|
-
- Arm `.devrites/CHECKPOINT`; `$rite-ship` collapses its local-only proven-slice checkpoints.
|
|
162
|
-
- Red gates block forward advancement and enter caller-owned bounded recovery.
|
|
163
|
-
Stop only when the shared stop contract classifies risk/HITL or the exact
|
|
164
|
-
fingerprint's recovery budget is exhausted.
|
|
165
|
-
- One autocomplete pass spans the lifecycle. Each wright returns after one slice;
|
|
166
|
-
explicit `.devrites/AFK` lets the Build root chain green slices under cap/pause rules;
|
|
167
|
-
otherwise HITL stops.
|
|
117
|
+
Final state is `Shipped`, `Stopped`, `Awaiting human`, `NO-GO`, or `GO`; do not
|
|
118
|
+
write a narrative recap. Require a clean or accepted baseline, arm checkpoint
|
|
119
|
+
mode, and never auto-pass a red gate.
|
|
@@ -4,6 +4,14 @@ Unattended ≠ careless. Every discretionary choice is made the way a senior eng
|
|
|
4
4
|
would, then **recorded** so the seal can audit it. The difference from interactive mode
|
|
5
5
|
is only *who answers* a discretionary question, not whether it's reasoned.
|
|
6
6
|
|
|
7
|
+
Authority: `.agents/skills/devrites-lib/reference/standards/acceptance-preserving-reslice.md`.
|
|
8
|
+
|
|
9
|
+
<!-- BEGIN RESLICE ROUTE-TO-ACTION -->
|
|
10
|
+
- `FOLD` → keep Plan repair/affected Vet internal; no stop solely for topology/count.
|
|
11
|
+
- `GUARD_AND_REPAIR` → enter Spec Drift Guard/Clarify; pause only at an existing human-owned gate; resume Plan/Vet internally.
|
|
12
|
+
- `BLOCKED_INPUT` → no planning writes; stop internal branch; exact diagnostic; recover authority; reclassify.
|
|
13
|
+
<!-- END RESLICE ROUTE-TO-ACTION -->
|
|
14
|
+
|
|
7
15
|
## The rule
|
|
8
16
|
|
|
9
17
|
For each non-trivial choice, pick the option the **relevant specialist favours**, and
|
|
@@ -28,8 +36,6 @@ not pick the option that's merely easiest to implement.
|
|
|
28
36
|
|
|
29
37
|
## When a choice is NOT autocomplete's to make
|
|
30
38
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
(see [stop-conditions.md](stop-conditions.md)). Autocomplete answers *how*, never
|
|
35
|
-
*what to build* beyond what the up-front interview settled.
|
|
39
|
+
Human-owned contract, data-model, security, and product choices are not discretionary.
|
|
40
|
+
Use owning elicitation/safety gates and the topology marked action. Autocomplete
|
|
41
|
+
answers *how*, never *what to build* beyond the settled interview.
|
|
@@ -1,154 +1,116 @@
|
|
|
1
1
|
# The autocomplete loop: arm AFK, drive every phase
|
|
2
2
|
|
|
3
|
-
Autocomplete sequences existing `/rite-*` workflows
|
|
4
|
-
|
|
3
|
+
Autocomplete sequences existing `/rite-*` workflows without pausing between
|
|
4
|
+
routine phases. Acceptance-preserving Reslice authority is
|
|
5
|
+
`.agents/skills/devrites-lib/reference/standards/acceptance-preserving-reslice.md`.
|
|
5
6
|
|
|
6
|
-
|
|
7
|
+
<!-- BEGIN RESLICE ROUTE-TO-ACTION -->
|
|
8
|
+
- `FOLD` → keep Plan repair/affected Vet internal; no stop solely for topology/count.
|
|
9
|
+
- `GUARD_AND_REPAIR` → enter Spec Drift Guard/Clarify; pause only at an existing human-owned gate; resume Plan/Vet internally.
|
|
10
|
+
- `BLOCKED_INPUT` → no planning writes; stop internal branch; exact diagnostic; recover authority; reclassify.
|
|
11
|
+
<!-- END RESLICE ROUTE-TO-ACTION -->
|
|
7
12
|
|
|
8
|
-
Arm
|
|
13
|
+
## Arm AFK once
|
|
9
14
|
|
|
10
15
|
```yaml
|
|
11
|
-
allow_gates: [advisory]
|
|
12
|
-
max_slices: 10
|
|
13
|
-
max_agents: 32
|
|
14
|
-
max_minutes: 120
|
|
15
|
-
max_review_queue: 8
|
|
16
|
-
expires_at: "<now + 4 hours>"
|
|
17
|
-
# max_tokens: <N>
|
|
18
|
-
# max_cost_usd: <amount>
|
|
19
|
-
# notify: "<cmd>"
|
|
16
|
+
allow_gates: [advisory]
|
|
17
|
+
max_slices: 10
|
|
18
|
+
max_agents: 32
|
|
19
|
+
max_minutes: 120
|
|
20
|
+
max_review_queue: 8
|
|
21
|
+
expires_at: "<now + 4 hours>"
|
|
22
|
+
# max_tokens: <N>
|
|
23
|
+
# max_cost_usd: <amount>
|
|
24
|
+
# notify: "<cmd>"
|
|
20
25
|
```
|
|
21
26
|
|
|
22
|
-
Read an existing sentinel first. Preserve it byte-for-byte when valid; stop if
|
|
23
|
-
ceiling exceeds
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
reset resource authority.
|
|
27
|
+
Read an existing sentinel first. Preserve it byte-for-byte when valid; stop if
|
|
28
|
+
its gate ceiling exceeds advisory, required envelope is malformed/expired, or
|
|
29
|
+
`max_slices` conflicts with the invocation. If absent, write it once after
|
|
30
|
+
clarity, replacing the safe slice default only for explicit `--max-slices N`
|
|
31
|
+
and resolving one absolute UTC expiry. It is read-only: never rewrite it after
|
|
32
|
+
Vet or reset it on resume.
|
|
29
33
|
|
|
30
34
|
### Derive the mutable post-vet budget
|
|
31
35
|
|
|
32
|
-
After
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
never increase or reinitialize it. This keeps the crash-survivable budget in its mutable owner
|
|
37
|
-
without changing AFK configuration mid-run.
|
|
36
|
+
After Vet, count pending slices and take the minimum of that count, explicit
|
|
37
|
+
flag, and sentinel cap. Before first Build, seed absent state-owned
|
|
38
|
+
`afk_slices_remaining`; retain the lower valid existing value and never increase
|
|
39
|
+
or reinitialize it. AFK configuration itself stays unchanged.
|
|
38
40
|
|
|
39
41
|
### Admit each unattended cycle
|
|
40
42
|
|
|
41
|
-
Before every phase,
|
|
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
|
-
| 11 | `$rite-ship` | only if seal GO; `--ship` / `--yolo` never authorizes Git and only continues to the exact-plan literal-GO/native-approval boundary |
|
|
43
|
+
Before every phase, review fan-out, recovery, or writer dispatch, apply
|
|
44
|
+
`afk-hitl.md#unattended-resource-envelope`: cheapest current-state/readiness
|
|
45
|
+
check first; reject overlap; count unresolved review; check expiry and native
|
|
46
|
+
agent/token/cost/time headroom. Count every leaf result. At the review cap, only
|
|
47
|
+
reconciliation that reduces the queue may run. Any reached or unobservable
|
|
48
|
+
bound stops before more work and persists the winning reason. A new activation
|
|
49
|
+
gets fresh activation-local counters but retains durable slice/recovery state,
|
|
50
|
+
expiry, and recomputed queue.
|
|
51
|
+
|
|
52
|
+
`allow_gates: [advisory]` means validating gates pause now rather than becoming
|
|
53
|
+
Seal NO-GO. Only explicit human configuration outside Autocomplete may widen it.
|
|
54
|
+
|
|
55
|
+
## Phase arc
|
|
56
|
+
|
|
57
|
+
Workspace files carry state; chat does not. Read and execute each phase skill:
|
|
58
|
+
|
|
59
|
+
| Step | Phase | Completion / edge |
|
|
60
|
+
| --- | --- | --- |
|
|
61
|
+
| 1 | `$rite-spec` | investigate and write testable intent |
|
|
62
|
+
| 2 | `$rite-clarify` | topology-first scan; require `Decision coverage: CLEAR`, then arm AFK |
|
|
63
|
+
| 3 | `$rite-temper` | harden or reduce; expansion and irreversible risk pause |
|
|
64
|
+
| 4 | `$rite-define` | approved plan/tasks/traceability |
|
|
65
|
+
| 5 | `$rite-vet` | every plan; derive mutable budget after READY |
|
|
66
|
+
| 6 | `$rite-build` ×N | one pending slice per wright; charge once only after green built state |
|
|
67
|
+
| 7 | `$rite-prove` | all slices built; approved proof; recovery on red |
|
|
68
|
+
| 8 | `$rite-polish` | re-prove after code edits |
|
|
69
|
+
| 9 | `$rite-review` | in-scope correction then fresh proof |
|
|
70
|
+
| 10 | `$rite-seal` | GO/NO-GO; no Git |
|
|
71
|
+
| 11 | `$rite-ship` | only after GO; `--ship` never authorizes Git; stop at literal-GO/native approval |
|
|
72
|
+
|
|
73
|
+
Before advancing, check resource admission and
|
|
74
|
+
[stop-conditions.md](stop-conditions.md). After source edits, discard stale pass
|
|
75
|
+
evidence. Re-read the active workspace before each phase.
|
|
75
76
|
|
|
76
77
|
## Backtrack without handing off
|
|
77
78
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
one already exists.
|
|
104
|
-
2. Invoke the required repair, Vet, remediation, and proof skills inline. After
|
|
105
|
-
Plan repair, run Vet in its recovery mode as a narrow Vet recheck of the prior
|
|
106
|
-
findings, changed paths/criteria, and affected evidence; do not restart a Full
|
|
107
|
-
Vet over unchanged axes. Their
|
|
108
|
-
`STOP` instructions end only those nested phases.
|
|
109
|
-
3. Re-read `state.md` after each nested phase and follow its intermediate
|
|
110
|
-
`next_action`; do not hand the intermediate command to the user.
|
|
111
|
-
4. Reconcile each exact causal fingerprint from `drift.md` and `evidence.md`.
|
|
112
|
-
Continue automatically when the recheck closes a prior fingerprint or admits
|
|
113
|
-
a genuinely new Critical/Important fingerprint. Charge only a no-progress
|
|
114
|
-
outcome against the same fingerprint; lower-severity novelty cannot prolong
|
|
115
|
-
the chain.
|
|
116
|
-
For a failed consumptive action, its spent authorization blocks only another
|
|
117
|
-
real execution. A retained artifact that identifies a new fingerprint is the
|
|
118
|
-
offline reproduction input: diagnose, repair, and narrow-Vet it now, then pause
|
|
119
|
-
for fresh authorization before any next consumptive execution.
|
|
120
|
-
5. When the prerequisite chain is green, restore and consume the return cursor,
|
|
121
|
-
resume the originating phase, and continue the forward table.
|
|
122
|
-
|
|
123
|
-
Count failed corrections by causal fingerprint under `afk-hitl.md`. Ask only
|
|
124
|
-
for a human-owned decision or mandatory safety/access action. Exhausted
|
|
125
|
-
agent-owned recovery stops once with its reproduction and dead ends, never with
|
|
126
|
-
another routine Plan/Vet command.
|
|
79
|
+
The active Autocomplete root remains caller whenever a later phase exposes an
|
|
80
|
+
agent-owned earlier-phase gap:
|
|
81
|
+
|
|
82
|
+
1. Save the originating phase/action unless a valid native return cursor exists.
|
|
83
|
+
2. On cold resume, reconcile the terminal cursor against durable fingerprint
|
|
84
|
+
accounting. Restore `return_next_action` only from the approved
|
|
85
|
+
`test-plan.md`/evidence action; ambiguity returns to Vet and never licenses
|
|
86
|
+
execution.
|
|
87
|
+
3. Invoke required Plan repair, affected Vet, remediation, and proof inline.
|
|
88
|
+
Recovery Vet is a narrow Vet recheck of prior findings, changed paths/criteria,
|
|
89
|
+
and affected evidence; it never restarts unaffected axes. A nested `STOP`
|
|
90
|
+
ends that phase only; do not hand the intermediate command to the user.
|
|
91
|
+
4. Re-read state after each nested phase. Reconcile exact causal fingerprints
|
|
92
|
+
from `drift.md`/`evidence.md`. A closed reproduction is progress. A different
|
|
93
|
+
Critical/Important invariant gets a separate budget; Suggestion/Nit/FYI does
|
|
94
|
+
not prolong the chain. Only a no-progress result charges the same fingerprint.
|
|
95
|
+
5. For failed consumptive action, spent authorization blocks only another real
|
|
96
|
+
execution. Use retained evidence for offline diagnosis, repair, and narrow
|
|
97
|
+
Vet; after READY, pause for fresh authorization.
|
|
98
|
+
6. Restore and consume the original cursor when prerequisites are green.
|
|
99
|
+
|
|
100
|
+
<!-- workflow-artifact-adapter: {"module":"devrites-lib/reference/standards/workflow-artifacts.md","entry":"loop tick sees Workflow Artifact trigger/state","action":"invoke classifier once under owner lock; no actor-history migration","return":"same loop cursor; no budget charge for verify/rerun"} -->
|
|
101
|
+
Ask only for a human-owned decision or mandatory safety/access action. Three
|
|
102
|
+
no-progress corrections of one exact fingerprint exhaust; preserve its
|
|
103
|
+
reproduction and dead ends without another Plan/Vet command.
|
|
127
104
|
|
|
128
105
|
## Continuous caller obligation
|
|
129
106
|
|
|
130
|
-
No user-facing reply is permitted while
|
|
131
|
-
|
|
132
|
-
Critical/Important fingerprint
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
same exact fingerprint exhaust. Context pressure, compaction, session duration,
|
|
141
|
-
or a nested skill's completion footer also cannot convert an internal checkpoint
|
|
142
|
-
into a stop; persist the checkpoint and resume from it inside the same controlling
|
|
143
|
-
invocation. Autocomplete may emit its final reply only after reaching its requested
|
|
144
|
-
rest point or one of the shared human/safety/access/exhaustion stop conditions.
|
|
145
|
-
|
|
146
|
-
## Between phases
|
|
147
|
-
|
|
148
|
-
- Re-read the active workspace before each phase (don't trust chat memory).
|
|
149
|
-
- Re-run resource admission before each phase or native dispatch; stop before work
|
|
150
|
-
when expiry, review backlog, or agent/token/cost/time headroom is exhausted.
|
|
151
|
-
- After a phase that edits code (build, polish, review), evidence may be stale: let
|
|
152
|
-
the next gate re-prove rather than carrying a stale pass (see
|
|
153
|
-
`.agents/skills/devrites-lib/reference/standards/development-workflow.md`).
|
|
154
|
-
- Check [stop-conditions.md](stop-conditions.md) at every gate **before** advancing.
|
|
107
|
+
No user-facing reply is permitted while durable state contains agent-owned
|
|
108
|
+
`NEEDS_REPLAN`, an intermediate Plan/Vet action, or a distinct retained
|
|
109
|
+
Critical/Important fingerprint below its cap. Invoke the next internal repair
|
|
110
|
+
immediately. A narrow reviewer closing one finding and exposing another
|
|
111
|
+
Critical/Important invariant is progress, not exhaustion.
|
|
112
|
+
|
|
113
|
+
The number of completed repair/Vet cycles is not a stop condition. Context
|
|
114
|
+
pressure, compaction, session duration, and nested completion do not convert an
|
|
115
|
+
internal checkpoint into a handoff. Persist it and resume until the requested
|
|
116
|
+
rest point or a shared human/safety/access/exhaustion condition.
|