devrites 7.3.4 → 7.3.5
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 +18 -0
- package/README.md +1 -1
- package/docs/adr/0039-autocomplete-structural-admission.md +87 -0
- package/docs/adr/README.md +1 -0
- package/docs/cli.md +103 -5
- package/docs/engine/commands.md +46 -1
- package/engine/internal/lib/claims.go +65 -8
- package/engine/internal/lib/continuation.go +6 -1
- package/engine/internal/lib/dispatch.go +78 -32
- package/engine/internal/lib/frontier.go +103 -47
- package/engine/internal/lib/frontier_controller.go +652 -0
- package/engine/internal/lib/frontier_roadmap.go +168 -0
- package/engine/internal/lib/next.go +9 -0
- package/engine/internal/parallel/repository.go +10 -0
- package/pack/.claude/skills/devrites-lib/reference/parallel-workspaces.md +106 -115
- package/pack/.claude/skills/devrites-lib/reference/standards/afk-hitl.md +18 -17
- package/pack/.claude/skills/devrites-lib/reference/workspace-artifact-schema.md +41 -38
- package/pack/.claude/skills/rite-autocomplete/SKILL.md +33 -38
- package/pack/.claude/skills/rite-autocomplete/reference/loop.md +46 -52
- package/pack/.claude/skills/rite-autocomplete/reference/stop-conditions.md +28 -28
- package/pack/.claude/skills/rite-build/reference/parallel-batch.md +17 -15
- package/pack/generated/claude/skills/devrites-lib/reference/parallel-workspaces.md +106 -115
- package/pack/generated/claude/skills/devrites-lib/reference/standards/afk-hitl.md +18 -17
- package/pack/generated/claude/skills/devrites-lib/reference/workspace-artifact-schema.md +41 -38
- package/pack/generated/claude/skills/rite-autocomplete/SKILL.md +33 -38
- package/pack/generated/claude/skills/rite-autocomplete/reference/loop.md +46 -52
- package/pack/generated/claude/skills/rite-autocomplete/reference/stop-conditions.md +28 -28
- package/pack/generated/claude/skills/rite-build/reference/parallel-batch.md +17 -15
- package/pack/generated/codex/skills/devrites-lib/reference/parallel-workspaces.md +106 -115
- package/pack/generated/codex/skills/devrites-lib/reference/standards/afk-hitl.md +18 -17
- package/pack/generated/codex/skills/devrites-lib/reference/workspace-artifact-schema.md +41 -38
- package/pack/generated/codex/skills/rite-autocomplete/SKILL.md +33 -38
- package/pack/generated/codex/skills/rite-autocomplete/reference/loop.md +46 -52
- package/pack/generated/codex/skills/rite-autocomplete/reference/stop-conditions.md +28 -28
- package/pack/generated/codex/skills/rite-build/reference/parallel-batch.md +17 -15
- package/pack/generated/devin/skills/devrites-lib/reference/parallel-workspaces.md +106 -115
- package/pack/generated/devin/skills/devrites-lib/reference/standards/afk-hitl.md +18 -17
- package/pack/generated/devin/skills/devrites-lib/reference/workspace-artifact-schema.md +41 -38
- package/pack/generated/devin/skills/rite-autocomplete/SKILL.md +33 -38
- package/pack/generated/devin/skills/rite-autocomplete/reference/loop.md +46 -52
- package/pack/generated/devin/skills/rite-autocomplete/reference/stop-conditions.md +28 -28
- package/pack/generated/devin/skills/rite-build/reference/parallel-batch.md +17 -15
- package/pack/generated/dsh/skills/devrites-lib/reference/parallel-workspaces.md +106 -115
- package/pack/generated/dsh/skills/devrites-lib/reference/standards/afk-hitl.md +18 -17
- package/pack/generated/dsh/skills/devrites-lib/reference/workspace-artifact-schema.md +41 -38
- package/pack/generated/dsh/skills/rite-autocomplete/SKILL.md +33 -38
- package/pack/generated/dsh/skills/rite-autocomplete/reference/loop.md +46 -52
- package/pack/generated/dsh/skills/rite-autocomplete/reference/stop-conditions.md +28 -28
- package/pack/generated/dsh/skills/rite-build/reference/parallel-batch.md +17 -15
- package/pack/generated/omp/skills/devrites-lib/reference/parallel-workspaces.md +106 -115
- package/pack/generated/omp/skills/devrites-lib/reference/standards/afk-hitl.md +18 -17
- package/pack/generated/omp/skills/devrites-lib/reference/workspace-artifact-schema.md +41 -38
- package/pack/generated/omp/skills/rite-autocomplete/SKILL.md +33 -38
- package/pack/generated/omp/skills/rite-autocomplete/reference/loop.md +46 -52
- package/pack/generated/omp/skills/rite-autocomplete/reference/stop-conditions.md +28 -28
- package/pack/generated/omp/skills/rite-build/reference/parallel-batch.md +17 -15
- package/pack/generated/pi/skills/devrites-lib/reference/parallel-workspaces.md +106 -115
- package/pack/generated/pi/skills/devrites-lib/reference/standards/afk-hitl.md +18 -17
- package/pack/generated/pi/skills/devrites-lib/reference/workspace-artifact-schema.md +41 -38
- package/pack/generated/pi/skills/rite-autocomplete/SKILL.md +33 -38
- package/pack/generated/pi/skills/rite-autocomplete/reference/loop.md +46 -52
- package/pack/generated/pi/skills/rite-autocomplete/reference/stop-conditions.md +28 -28
- package/pack/generated/pi/skills/rite-build/reference/parallel-batch.md +17 -15
- package/package.json +1 -1
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
package lib
|
|
2
|
+
|
|
3
|
+
import (
|
|
4
|
+
"fmt"
|
|
5
|
+
"os"
|
|
6
|
+
"path/filepath"
|
|
7
|
+
"strconv"
|
|
8
|
+
"strings"
|
|
9
|
+
|
|
10
|
+
"github.com/devrites/devrites/internal/devritespaths"
|
|
11
|
+
"github.com/devrites/devrites/internal/markdowntext"
|
|
12
|
+
)
|
|
13
|
+
|
|
14
|
+
// frontierCanonicalRoadmap reads current authority from the full related sequence.
|
|
15
|
+
// A nil map without an error leaves headerless historical maps to legacy parsing.
|
|
16
|
+
func frontierCanonicalRoadmap(nodes map[string]*frontierWorkspace, ordered []string) (mapping map[int]string, artifacts []string, err error) {
|
|
17
|
+
var owner *frontierWorkspace
|
|
18
|
+
var lines []string
|
|
19
|
+
for _, slug := range ordered {
|
|
20
|
+
n := nodes[slug]
|
|
21
|
+
if n == nil || n.dir == "" {
|
|
22
|
+
continue
|
|
23
|
+
}
|
|
24
|
+
path := filepath.Join(n.dir, "roadmap.md")
|
|
25
|
+
raw, readErr := readBoundedRegularFile(path, workspaceArtifactLimit)
|
|
26
|
+
if os.IsNotExist(readErr) {
|
|
27
|
+
continue
|
|
28
|
+
}
|
|
29
|
+
if readErr != nil {
|
|
30
|
+
return nil, append(artifacts, path), fmt.Errorf("roadmap %s unreadable: %w", path, readErr)
|
|
31
|
+
}
|
|
32
|
+
structural, parseErr := markdowntext.Structural(raw)
|
|
33
|
+
if parseErr != nil {
|
|
34
|
+
return nil, append(artifacts, path), fmt.Errorf("roadmap %s malformed: %w", path, parseErr)
|
|
35
|
+
}
|
|
36
|
+
candidate := strings.Split(string(structural), "\n")
|
|
37
|
+
explicit := false
|
|
38
|
+
for _, line := range candidate {
|
|
39
|
+
line = strings.TrimSpace(line)
|
|
40
|
+
if strings.HasPrefix(line, "Sequence root:") || strings.HasPrefix(line, "Decision:") {
|
|
41
|
+
explicit = true
|
|
42
|
+
break
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
if !explicit {
|
|
46
|
+
continue
|
|
47
|
+
}
|
|
48
|
+
artifacts = append(artifacts, path)
|
|
49
|
+
if owner != nil {
|
|
50
|
+
return nil, artifacts, fmt.Errorf("multiple canonical roadmap owners: %s and %s", owner.slug, slug)
|
|
51
|
+
}
|
|
52
|
+
owner, lines = n, candidate
|
|
53
|
+
}
|
|
54
|
+
if owner == nil {
|
|
55
|
+
return nil, nil, nil
|
|
56
|
+
}
|
|
57
|
+
root, decision := "", ""
|
|
58
|
+
rootCount, decisionCount := 0, 0
|
|
59
|
+
for _, line := range lines {
|
|
60
|
+
line = strings.TrimSpace(line)
|
|
61
|
+
if value, ok := strings.CutPrefix(line, "Sequence root:"); ok {
|
|
62
|
+
root, rootCount = strings.TrimSpace(value), rootCount+1
|
|
63
|
+
}
|
|
64
|
+
if value, ok := strings.CutPrefix(line, "Decision:"); ok {
|
|
65
|
+
decision, decisionCount = strings.TrimSpace(value), decisionCount+1
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
if rootCount != 1 || decisionCount != 1 || !devritespaths.ValidSlug(root) || strings.ContainsAny(root, " \t") || strings.HasPrefix(root, "-") {
|
|
69
|
+
return nil, artifacts, fmt.Errorf("canonical roadmap requires one valid Sequence root and Decision header")
|
|
70
|
+
}
|
|
71
|
+
if len(decision) != 7 || !strings.HasPrefix(decision, "DEC-") || strings.Trim(decision[4:], "0123456789") != "" {
|
|
72
|
+
return nil, artifacts, fmt.Errorf("canonical roadmap Decision must be DEC-NNN")
|
|
73
|
+
}
|
|
74
|
+
decisionPath := filepath.Join(owner.dir, "decisions.md")
|
|
75
|
+
artifacts = append(artifacts, decisionPath)
|
|
76
|
+
raw, readErr := readBoundedRegularFile(decisionPath, workspaceArtifactLimit)
|
|
77
|
+
if readErr != nil {
|
|
78
|
+
return nil, artifacts, fmt.Errorf("canonical roadmap decision unreadable: %w", readErr)
|
|
79
|
+
}
|
|
80
|
+
structural, parseErr := markdowntext.Structural(raw)
|
|
81
|
+
if parseErr != nil {
|
|
82
|
+
return nil, artifacts, fmt.Errorf("canonical roadmap decision malformed: %w", parseErr)
|
|
83
|
+
}
|
|
84
|
+
headings := 0
|
|
85
|
+
for _, line := range strings.Split(string(structural), "\n") {
|
|
86
|
+
fields := strings.Fields(line)
|
|
87
|
+
if len(fields) >= 2 && fields[0] == "##" && fields[1] == decision {
|
|
88
|
+
headings++
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
if headings != 1 {
|
|
92
|
+
return nil, artifacts, fmt.Errorf("canonical roadmap Decision %s requires one exact owner-local heading, found %d", decision, headings)
|
|
93
|
+
}
|
|
94
|
+
mapping = map[int]string{}
|
|
95
|
+
positions := map[string]int{}
|
|
96
|
+
tables := 0
|
|
97
|
+
for i := 0; i < len(lines); i++ {
|
|
98
|
+
cells := frontierCells(lines[i])
|
|
99
|
+
if len(cells) != 0 && (len(cells) != 2 || cells[0] != "Position" || cells[1] != "Workspace") {
|
|
100
|
+
return nil, artifacts, fmt.Errorf("canonical roadmap contains an unexpected table")
|
|
101
|
+
}
|
|
102
|
+
if len(cells) != 2 || cells[0] != "Position" || cells[1] != "Workspace" {
|
|
103
|
+
continue
|
|
104
|
+
}
|
|
105
|
+
tables++
|
|
106
|
+
if tables != 1 || i+1 >= len(lines) {
|
|
107
|
+
return nil, artifacts, fmt.Errorf("canonical roadmap requires exactly one Position/Workspace table")
|
|
108
|
+
}
|
|
109
|
+
separator := frontierCells(lines[i+1])
|
|
110
|
+
if len(separator) != 2 {
|
|
111
|
+
return nil, artifacts, fmt.Errorf("canonical roadmap table separator malformed")
|
|
112
|
+
}
|
|
113
|
+
for _, cell := range separator {
|
|
114
|
+
if len(strings.Trim(cell, ":")) < 3 || strings.Trim(cell, "-:") != "" {
|
|
115
|
+
return nil, artifacts, fmt.Errorf("canonical roadmap table separator malformed")
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
i += 2
|
|
119
|
+
for ; i < len(lines) && strings.HasPrefix(strings.TrimSpace(lines[i]), "|"); i++ {
|
|
120
|
+
row := frontierCells(lines[i])
|
|
121
|
+
if len(row) != 2 {
|
|
122
|
+
return nil, artifacts, fmt.Errorf("canonical roadmap table row malformed")
|
|
123
|
+
}
|
|
124
|
+
position, numberErr := strconv.Atoi(row[0])
|
|
125
|
+
slug := row[1]
|
|
126
|
+
if numberErr != nil || position != len(mapping)+1 || strconv.Itoa(position) != row[0] {
|
|
127
|
+
return nil, artifacts, fmt.Errorf("canonical roadmap positions must be unique and contiguous from 1")
|
|
128
|
+
}
|
|
129
|
+
if !devritespaths.ValidSlug(slug) || strings.ContainsAny(slug, " \t") || strings.HasPrefix(slug, "-") || positions[slug] != 0 {
|
|
130
|
+
return nil, artifacts, fmt.Errorf("canonical roadmap requires unique valid workspace slugs")
|
|
131
|
+
}
|
|
132
|
+
mapping[position], positions[slug] = slug, position
|
|
133
|
+
}
|
|
134
|
+
i--
|
|
135
|
+
}
|
|
136
|
+
if tables != 1 || len(mapping) == 0 || mapping[1] != root {
|
|
137
|
+
return nil, artifacts, fmt.Errorf("canonical roadmap requires one nonempty table rooted at Sequence root")
|
|
138
|
+
}
|
|
139
|
+
for _, slug := range ordered {
|
|
140
|
+
n := nodes[slug]
|
|
141
|
+
chain, chainErr := frontierChain(nodes, slug)
|
|
142
|
+
if chainErr != nil {
|
|
143
|
+
return nil, artifacts, fmt.Errorf("canonical roadmap recorded chain invalid: %w", chainErr)
|
|
144
|
+
}
|
|
145
|
+
if chain[len(chain)-1] != root {
|
|
146
|
+
return nil, artifacts, fmt.Errorf("canonical roadmap root %s does not match actual chain anchor", root)
|
|
147
|
+
}
|
|
148
|
+
position := positions[slug]
|
|
149
|
+
if position == 0 || n.hasPosition && n.position != position {
|
|
150
|
+
return nil, artifacts, fmt.Errorf("canonical roadmap conflicts with recorded position for %s", slug)
|
|
151
|
+
}
|
|
152
|
+
if n.parent != mapping[position-1] {
|
|
153
|
+
return nil, artifacts, fmt.Errorf("canonical roadmap conflicts with recorded predecessor for %s", slug)
|
|
154
|
+
}
|
|
155
|
+
if target := frontierSpecTarget(n); target != "" && mapping[position+1] != target {
|
|
156
|
+
return nil, artifacts, fmt.Errorf("canonical roadmap conflicts with next Spec for %s", slug)
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
for _, slug := range mapping {
|
|
160
|
+
if n := nodes[slug]; n != nil {
|
|
161
|
+
position := positions[slug]
|
|
162
|
+
if n.problem != nil || n.hasPosition && n.position != position || n.parent != mapping[position-1] {
|
|
163
|
+
return nil, artifacts, fmt.Errorf("canonical roadmap workspace %s is not bound to its recorded sequence position", slug)
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
return mapping, artifacts, nil
|
|
168
|
+
}
|
|
@@ -82,6 +82,15 @@ func RunNext(root string, args []string, stdout, stderr io.Writer) int {
|
|
|
82
82
|
for _, line := range lines {
|
|
83
83
|
fmt.Fprintln(stdout, line)
|
|
84
84
|
}
|
|
85
|
+
mode, err := autocompleteMode(root)
|
|
86
|
+
if err != nil {
|
|
87
|
+
fmt.Fprintf(stderr, "next: %v\n", err)
|
|
88
|
+
return 2
|
|
89
|
+
}
|
|
90
|
+
if mode && frontierGlobalPriority(slug, lines) {
|
|
91
|
+
fmt.Fprintln(stdout, "next-command: /rite-autocomplete")
|
|
92
|
+
return exit
|
|
93
|
+
}
|
|
85
94
|
}
|
|
86
95
|
if report.Phase == state.PhaseBuild {
|
|
87
96
|
printPlanBatch(stdout, root, slug)
|
|
@@ -169,6 +169,8 @@ func controllerLease(root, controller string) (*repositoryLease, error) {
|
|
|
169
169
|
|
|
170
170
|
// ControllerLease returns the retained repository controller without changing its lease.
|
|
171
171
|
// A lease in another checkout requires recovery at that explicit control root.
|
|
172
|
+
// Recorded checkout/ref identity must still match; legacy leases lack that evidence.
|
|
173
|
+
// Active reservations must remain path-disjoint; integrated history holds no slot.
|
|
172
174
|
func ControllerLease(repoRoot string) (string, *Lease, error) {
|
|
173
175
|
found, err := controllerLease(repoRoot, "")
|
|
174
176
|
if err != nil || found == nil {
|
|
@@ -177,6 +179,14 @@ func ControllerLease(repoRoot string) (string, *Lease, error) {
|
|
|
177
179
|
if found.root != resolvedPath(repoRoot) {
|
|
178
180
|
return "", nil, fmt.Errorf("repository controller lease retained by %s at %s; recover at its explicit root", found.controller, found.root)
|
|
179
181
|
}
|
|
182
|
+
if err := ensureControllerIdentity(repoRoot, found.lease); err != nil {
|
|
183
|
+
return "", nil, err
|
|
184
|
+
}
|
|
185
|
+
if active := activeSlices(found.lease); len(active) >= 2 {
|
|
186
|
+
if _, err := CheckPathDisjoint(active, repoRoot); err != nil {
|
|
187
|
+
return "", nil, err
|
|
188
|
+
}
|
|
189
|
+
}
|
|
180
190
|
return found.controller, found.lease, nil
|
|
181
191
|
}
|
|
182
192
|
|
|
@@ -12,65 +12,45 @@ candidate bindings and proof belong to that source. A missing source artifact
|
|
|
12
12
|
routes its prerequisite; it never falls back to another workspace's artifacts.
|
|
13
13
|
An explicit valid workspace does not require ACTIVE to name it or to exist.
|
|
14
14
|
|
|
15
|
-
Carry
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
workspace path, not a slug. Apply this environment only to that invocation;
|
|
22
|
-
neither a fabricated resolver slug argument nor process-global environment
|
|
23
|
-
mutation is routing. Use the same source binding for nested recommended answers.
|
|
24
|
-
|
|
25
|
-
Preparing or running an admitted future source preserves the ordered owner's
|
|
26
|
-
ACTIVE and retained writer/controller. Ordinary standalone Spec still sets ACTIVE;
|
|
27
|
-
explicit `--lookahead` still stops at planning/Vet and never becomes a Build root.
|
|
15
|
+
Carry SOURCE through every phase, nested resolution and cold handoff. Use existing
|
|
16
|
+
slug arguments (`context <source>`, `handoff <source> --resume`). Qid-only
|
|
17
|
+
`state resolve` retains its argv: bind only that invocation's `DEVRITES_ROOT` and
|
|
18
|
+
`DEVRITES_WORKSPACE` as above, never a fabricated resolver slug or process-global
|
|
19
|
+
change. Early future work preserves ACTIVE and the retained controller.
|
|
20
|
+
Standalone Spec still sets ACTIVE; `--lookahead` remains planning/Vet-only.
|
|
28
21
|
Target binding changes neither phase approval nor Ship authority.
|
|
29
22
|
|
|
30
23
|
## Authority and admission
|
|
31
24
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
validate each producer reference and graph, including safely archived predecessors.
|
|
62
|
-
Cycles, unknown/malformed references and shared unisolated runtime withhold unsafe
|
|
63
|
-
candidates. A waiting producer withholds only its consumers, not unrelated work.
|
|
64
|
-
|
|
65
|
-
Missing declarations in legacy future plans need narrow Plan repair + affected
|
|
66
|
-
Vet before early admission; existing local/standalone plans remain valid. Absent,
|
|
67
|
-
incomplete, stale or human-blocked future work is a planning/repair/blocked
|
|
68
|
-
opportunity, not a fatal pool failure. Retain every readiness reason: fixing stale
|
|
69
|
-
bindings does not waive a coexisting human/access/safety gate. Re-Vet affected
|
|
70
|
-
predecessor assumptions, then record current bindings; never auto-refresh a digest.
|
|
71
|
-
Read archived predecessors in place through the engine's referenced read-only
|
|
72
|
-
readiness lookup. Never copy an archive into live `work/` merely to read/hash it:
|
|
73
|
-
that can resurrect stale controller leases and claims.
|
|
25
|
+
Keep ACTIVE on the ordered owner until normal handoff. One repository-global
|
|
26
|
+
lease owns control-tip mutations; recover its controller, source identities and
|
|
27
|
+
handles before more admission, including after handoff. No second Build root.
|
|
28
|
+
`--parallel N` caps active writers globally: explicit N, else AFK `max_parallel`,
|
|
29
|
+
else retained capacity on resume, else 10. One means one writer total. Review
|
|
30
|
+
queues retain host/reviewer caps; capacity or Reslice never waives fanout or proof.
|
|
31
|
+
|
|
32
|
+
Only checked source-related sequence membership qualifies; user-mentioned or
|
|
33
|
+
unrelated directories are not enrollment. Current canonical `roadmap.md` follows
|
|
34
|
+
[the grammar](workspace-artifact-schema.md#what-each-file-owns): one related live/
|
|
35
|
+
archived owner, actual chain root, same-owner unique decision and contiguous
|
|
36
|
+
position table. It supersedes historical tables for scheduling without rewriting
|
|
37
|
+
them. Invalid canonical authority fails closed; absence retains conservative
|
|
38
|
+
legacy resolution. Honor opt-out, opening budgets and human bounds; charge each
|
|
39
|
+
opening once. Lookahead claims retain artifacts through terminal reconciliation.
|
|
40
|
+
Root alone writes workspace artifacts; leaves never write `.devrites/**`.
|
|
41
|
+
|
|
42
|
+
Native Plan/Vet must bind CURRENT readiness, contract, producer assumptions and
|
|
43
|
+
explicit future `Workspace dependencies` per [slice grammar](workspace-artifact-schema.md#canonical-slice-grammar).
|
|
44
|
+
`none` is a native declaration, not an inference from paths, local dependencies,
|
|
45
|
+
digests or green branches. Only durable BUILT/integrated checkpoints satisfy
|
|
46
|
+
validated producer references/graphs, including safely archived predecessors.
|
|
47
|
+
Unknown references, cycles and shared unisolated runtime withhold unsafe slices;
|
|
48
|
+
waiting producers withhold consumers, not independent work. Legacy future plans
|
|
49
|
+
need narrow Plan repair/affected Vet; standalone/local plans retain their rules.
|
|
50
|
+
Per-slice withheld diagnostics do not block other returned eligible IDs;
|
|
51
|
+
workspace-wide readiness failures still withhold the source.
|
|
52
|
+
Preserve coexisting stale-readiness and human/access/safety reasons. Re-Vet changed
|
|
53
|
+
assumptions; never auto-refresh digests or copy archives into live `work/`.
|
|
74
54
|
|
|
75
55
|
## Recover avoidable serialization
|
|
76
56
|
|
|
@@ -108,66 +88,77 @@ reslicing unchanged work.
|
|
|
108
88
|
|
|
109
89
|
## Continuous global frontier
|
|
110
90
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
controller
|
|
117
|
-
|
|
118
|
-
1.
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
For
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
91
|
+
Run this pass at phase entry, before local recovery/waits/reply, and after landing
|
|
92
|
+
or planning changes. A persisted `dispatch return` emits fresh scheduling after
|
|
93
|
+
locks release, even when later claim release fails: retain the nonzero failure
|
|
94
|
+
and claim exclusion. Exact successful claim reconciliation also refreshes;
|
|
95
|
+
rejected/unpersisted returns do not. Ordinary status stays read-only. Keep local
|
|
96
|
+
return cursors and native handles: one controller, not another phase or queue.
|
|
97
|
+
|
|
98
|
+
1. Read `devrites-engine frontier <source>`, then its selected `frontier-authority`
|
|
99
|
+
paths before preparation. Follow the actual owner/decision, including archives;
|
|
100
|
+
local phase context is not a reason to create a second owner. Execute native actions.
|
|
101
|
+
Normalize unresolved legacy sequence authority through its owning decision/
|
|
102
|
+
phase. Positive budget, ambiguous prose or path disjointness grants nothing.
|
|
103
|
+
A current invalid canonical map is an error, never a fallback to history.
|
|
104
|
+
For controller mode at cap>1, before a new Build-wright wave writes claims,
|
|
105
|
+
rounds or history, start preparation of that source's immediate recorded
|
|
106
|
+
successor. Missing targets need native Spec → Clarify → Temper → Define/Plan →
|
|
107
|
+
affected Vet; existing targets need completed native state, actual pending
|
|
108
|
+
planning/review handles, current Build-ready binding, or a human/dependency hold.
|
|
109
|
+
Completed live/archived successors need no reopening; retained actors still bind.
|
|
110
|
+
A placeholder, prose claim, unopened wave or unrelated reviewer is insufficient.
|
|
111
|
+
Pipeline one successor per admitted source; preparing the whole roadmap first
|
|
112
|
+
is unnecessary. Opt-out, zero opening budget or source human/question holds
|
|
113
|
+
prevent new openings, not already-created child planning or independent work.
|
|
114
|
+
If preparation cannot start, retain `frontier-blocked: <successor> — <constraint>`
|
|
115
|
+
in source `evidence.md`. `frontier-blocked: sequence — <constraint>` may defer
|
|
116
|
+
unresolved historical normalization for valid independent local work. Each row
|
|
117
|
+
names one concrete native-reviewed constraint; keep it visible and revisit on
|
|
118
|
+
change. It discharges only that scheduling obligation, not readiness, malformed
|
|
119
|
+
canonical/AFK data, paths, claims, isolation, proof or human gates. It cannot
|
|
120
|
+
waive already-ready foreign picks or certify preparation/normalization.
|
|
121
|
+
2. Reconcile explicit/AFK capacity via `parallel add --root <repo> --slug
|
|
122
|
+
<controller> --cap N --json -`, stdin `[]`. Below occupied count, freeze every
|
|
123
|
+
new launch, even reserved waves; reconcile/drain and retry without cancelling.
|
|
124
|
+
Recover recorded landing intent; unrelated HEAD/ref movement
|
|
125
|
+
stays blocked. Rerun frontier after changes and execute its exact authorized
|
|
126
|
+
`frontier-select-command`. Local select notices do not broaden picks. Existing
|
|
127
|
+
global slots and paths seed selection; reserve the mixed cohort in create/add
|
|
128
|
+
before separate source-local wave opens. Reservations assemble width, never
|
|
129
|
+
prove actor checkout/start. Ready foreign picks cannot disappear behind local
|
|
130
|
+
`serial:` records. A foreign deferral is exactly
|
|
131
|
+
`serial: child/SLICE-001 — <reason>` in source evidence; bare `SLICE-001` is local.
|
|
132
|
+
Substantive-reason rules apply; native workflow judges the constraint.
|
|
133
|
+
Re-evaluate owning serial rows when constraints change; engine checks exact
|
|
134
|
+
scope, not the truth of a host/resource claim.
|
|
135
|
+
Discharged deferrals are not repeatedly actionable. Foreign work/preparation
|
|
136
|
+
and authority normalization precede local Build; local-only reconciliation,
|
|
137
|
+
repair and picks retain their owning phase, not recursive Autocomplete.
|
|
138
|
+
Zero picks with live writers means planning/wait, not premature Prove.
|
|
139
|
+
3. Apply SOURCE Build readiness/preconditions, exact paths and runtime isolation.
|
|
140
|
+
Early foreign Build always uses isolated workers. On a capable host at cap>1,
|
|
141
|
+
isolate even the first local writer for later refill; persist `--cap N`.
|
|
142
|
+
Add one pick to a retained lease; reopen a complete lease only at unchanged
|
|
143
|
+
control tip, or create from current control after cleanup. Unsupported
|
|
144
|
+
isolation uses qualified serial deferral, truthful local-owner dispatch and
|
|
145
|
+
ordinary ordered handoff, never early same-tree foreign/concurrent writers.
|
|
146
|
+
New dispatch accounts retain opaque `controller_batch` and immutable per-slice
|
|
147
|
+
normalized `admitted_paths`. Retain only each pending writer's lane; returned/
|
|
148
|
+
integrated siblings may release slots for rolling refill. Missing snapshots or
|
|
149
|
+
changed lease paths require actor reconciliation, never backfill from new tasks.
|
|
150
|
+
Exact claim identity/session still matters; release/expiry does not stop an actor.
|
|
151
|
+
Same-session claims allocate space, not extra write authority. None of these
|
|
152
|
+
records proves actual cwd/profile: verify through the native host.
|
|
153
|
+
4. Start every selected native writer before waiting; continue independent native
|
|
154
|
+
planning/review while they run. Protected validation defers unsafe landings,
|
|
155
|
+
not independent preparation. Outside that window, land individually green
|
|
156
|
+
siblings through Build review/proof and `parallel integrate --slice <key>`;
|
|
157
|
+
refill globally. Red/integrate-failed siblings keep slots/paths for repair.
|
|
158
|
+
Durable integration alone satisfies producer edges. After worker-bound
|
|
159
|
+
accounts and source bookkeeping settle, `parallel prune --root <repo> --slug
|
|
160
|
+
<controller>` removes only verified clean integrated checkouts, retaining
|
|
161
|
+
transfer refs/lease identities. Dirty/ignored data keeps its recovery path.
|
|
171
162
|
|
|
172
163
|
## Identity, dispatch and proof
|
|
173
164
|
|
|
@@ -51,6 +51,7 @@ time. No `state.md` run-mode field can drift out of sync.
|
|
|
51
51
|
Presence = AFK active. The file body is optional YAML:
|
|
52
52
|
|
|
53
53
|
```yaml
|
|
54
|
+
mode: autocomplete # optional controller identity; absent = standalone AFK
|
|
54
55
|
max_slices: 10 # whole-workspace writer budget; seeds state.md remaining count
|
|
55
56
|
max_agents: 32 # native agent dispatches in one host activation
|
|
56
57
|
max_minutes: 120 # min; /rite-autocomplete: not a ceiling
|
|
@@ -61,10 +62,13 @@ notify: 'curl -fsS -m 10 -d "$DEVRITES_QID: $DEVRITES_QUESTION" ntfy.sh/my-topic
|
|
|
61
62
|
allow_gates: [advisory, validating] # gate severities AFK auto-handles (auto-picks the recommended option)
|
|
62
63
|
continue_sequence: true # after Seal GO, open the next recorded continuation
|
|
63
64
|
max_workspaces: 5 # workspaces one armed sequence may open
|
|
64
|
-
max_parallel: 10 #
|
|
65
|
+
max_parallel: 10 # global writer cap; explicit --parallel N wins
|
|
65
66
|
```
|
|
66
67
|
|
|
67
|
-
|
|
68
|
+
AFK is read-only after entry. Explicit `/rite-autocomplete` upserts only
|
|
69
|
+
`mode: autocomplete` and, with `--parallel N`, `max_parallel: N`; preserve other
|
|
70
|
+
fields. Missing mode keeps standalone behavior; invalid/duplicate mode fails
|
|
71
|
+
closed. Mode identifies scheduling, never grants phase, safety or Git authority.
|
|
68
72
|
|
|
69
73
|
Outside active `/rite-autocomplete`, the following slice-budget rules apply:
|
|
70
74
|
`max_slices` seeds root-owned `state.md` cursor `afk_slices_remaining`
|
|
@@ -103,10 +107,9 @@ malformed values fail closed; `0` opens nothing.
|
|
|
103
107
|
candidate manifest to cover the whole recorded chain — run
|
|
104
108
|
`devrites-engine state merge-manifest <slug>` before Prove.
|
|
105
109
|
|
|
106
|
-
- Only
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
`/rite-autocomplete`.
|
|
110
|
+
- Only checked recorded continuations qualify, under the
|
|
111
|
+
[sequence grammar](../workspace-artifact-schema.md#what-each-file-owns).
|
|
112
|
+
No next entry or opening budget stops new openings, not existing child work.
|
|
110
113
|
- Milestones are **not** shipped: they stay sealed and unarchived in `.devrites/work/`
|
|
111
114
|
with `Next step: /rite-ship` preserved. Local `WIP(<slug>):` checkpoints still
|
|
112
115
|
land ([checkpoint.md](../../../rite-build/reference/checkpoint.md)), so the tree
|
|
@@ -118,15 +121,13 @@ candidate manifest to cover the whole recorded chain — run
|
|
|
118
121
|
`/rite-autocomplete` recovers agent-owned Seal `NO-GO` per
|
|
119
122
|
[stop-conditions.md](../../../rite-autocomplete/reference/stop-conditions.md), not a handoff.
|
|
120
123
|
|
|
121
|
-
`
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
after a batch completes. **Failing case:** `/rite-autocomplete --parallel 5`
|
|
129
|
-
honors leftover `max_parallel: 1`, or grants five writers per workspace.
|
|
124
|
+
`--parallel N` wins over AFK `max_parallel`, else retained lease capacity on
|
|
125
|
+
resume, else 10. Build's flag never rewrites AFK; explicit controller entry may
|
|
126
|
+
update only mode/capacity. One cap covers all admitted sources, even explicit 1;
|
|
127
|
+
standalone Build stays local. Follow the [global pass](../parallel-workspaces.md#continuous-global-frontier)
|
|
128
|
+
for immediate-successor preparation, narrow `frontier-blocked` deferrals,
|
|
129
|
+
qualified foreign `serial:` handoff and automatic dispatch-return scheduling.
|
|
130
|
+
These are scheduling disclosures, never readiness, isolation, proof or Ship waivers.
|
|
130
131
|
|
|
131
132
|
## Unattended resource envelope
|
|
132
133
|
|
|
@@ -157,8 +158,8 @@ applicable remaining limit. Agent/time/token/cost counters are per native activa
|
|
|
157
158
|
for a new activation. Slice/recovery state and review queue remain durable/recomputed across wakes.
|
|
158
159
|
Persist stops/checkpoints before notification.
|
|
159
160
|
|
|
160
|
-
|
|
161
|
-
|
|
161
|
+
Fresh AFK omits expiry and notification/token/cost caps. Standalone post-Vet
|
|
162
|
+
counts may lower slices; preserve existing fields except controller entry above.
|
|
162
163
|
|
|
163
164
|
Delete the file to restore HITL on the next invocation.
|
|
164
165
|
|