@haposoft/cafekit 0.16.0-rc.6 → 0.16.0-rc.8
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/README.md +21 -58
- package/bin/__tests__/change-firewall.semantic-firewall.test.js +4 -5
- package/bin/__tests__/codex-hooks.test.js +382 -0
- package/bin/__tests__/codex-native.test.js +579 -80
- package/bin/__tests__/develop-contract.test.js +155 -76
- package/bin/__tests__/installer-safety.test.js +19 -154
- package/bin/__tests__/package-inventory.test.js +494 -26
- package/bin/__tests__/release-preflight.semantic-firewall.test.js +2 -2
- package/bin/__tests__/validator-grounding.test.js +11 -11
- package/bin/install.js +2 -7
- package/bin/lib/context.js +0 -45
- package/bin/lib/copy-utils.js +1 -1
- package/bin/lib/i18n.js +0 -3
- package/bin/lib/manifest.js +1 -1
- package/bin/phases/claude-runtime.js +1 -3
- package/bin/phases/codex-runtime.js +4 -2
- package/bin/phases/copy-payload.js +3 -15
- package/bin/phases/post-install.js +5 -17
- package/bin/phases/root-config.js +2 -3
- package/bin/phases/select-platform.js +2 -5
- package/bin/phases/summary.js +0 -1
- package/package.json +2 -5
- package/src/claude/CLAUDE.md +19 -6
- package/src/claude/agents/project-manager.md +41 -9
- package/src/claude/agents/spec-maker.md +82 -155
- package/src/claude/gitignore +1 -1
- package/src/claude/hooks/__tests__/spec-gate.test.js +238 -0
- package/src/claude/hooks/__tests__/state.test.js +249 -3
- package/src/claude/hooks/lib/context.cjs +1 -1
- package/src/claude/hooks/lib/detect.cjs +1 -1
- package/src/claude/hooks/spec-gate.cjs +44 -9
- package/src/claude/hooks/spec-state.cjs +51 -13
- package/src/claude/hooks/task-scaffold-guard.cjs +1 -1
- package/src/claude/migration-manifest.json +17 -3
- package/src/claude/rules/manage-docs.md +43 -24
- package/src/claude/rules/state-sync.md +57 -62
- package/src/claude/rules/workflow.md +30 -13
- package/src/claude/scripts/change-firewall.cjs +2 -2
- package/src/claude/scripts/generate-skill-catalog.cjs +0 -1
- package/src/claude/scripts/spec-receipt.cjs +196 -1
- package/src/claude/scripts/spec-resolver.cjs +428 -0
- package/src/claude/skills/develop/SKILL.md +89 -125
- package/src/claude/skills/develop/references/parallel-waves.md +75 -162
- package/src/claude/skills/develop/references/quality-gate.md +61 -121
- package/src/claude/skills/develop/references/subagent-patterns.md +31 -38
- package/src/claude/skills/question/SKILL.md +1 -1
- package/src/claude/skills/specs/SKILL.md +152 -204
- package/src/claude/skills/specs/references/review.md +124 -243
- package/src/claude/skills/specs/references/templates.md +202 -0
- package/src/claude/skills/sync/SKILL.md +66 -90
- package/src/claude/skills/sync/references/sync-protocols.md +62 -83
- package/src/codex/AGENTS.md +20 -7
- package/src/codex/hooks/lib/spec-receipt.cjs +18 -0
- package/src/codex/hooks/lib/spec-utils.cjs +25 -0
- package/src/codex/hooks/spec-gate.cjs +46 -16
- package/src/codex/hooks/spec-state.cjs +54 -16
- package/src/codex/rules/state-sync.md +57 -61
- package/src/common/AGENTS.md +8 -1
- package/bin/__tests__/opencode-spec-gate.test.js +0 -799
- package/bin/lib/opencode-install.js +0 -899
- package/bin/phases/opencode-runtime.js +0 -38
- package/src/claude/skills/specs/references/archive-workflow.md +0 -74
- package/src/claude/skills/specs/references/ask-user-question-gates.md +0 -70
- package/src/claude/skills/specs/references/codebase-analysis.md +0 -102
- package/src/claude/skills/specs/references/cross-spec-dependency.md +0 -76
- package/src/claude/skills/specs/references/research-strategy.md +0 -107
- package/src/claude/skills/specs/references/scope-inquiry.md +0 -107
- package/src/claude/skills/specs/references/translation-mirror.md +0 -83
- package/src/claude/skills/specs/rules/design-discovery-full.md +0 -45
- package/src/claude/skills/specs/rules/design-discovery-light.md +0 -28
- package/src/claude/skills/specs/rules/design-principles.md +0 -138
- package/src/claude/skills/specs/rules/design-review.md +0 -55
- package/src/claude/skills/specs/rules/ears-format.md +0 -42
- package/src/claude/skills/specs/rules/phase-decision-matrix.md +0 -56
- package/src/claude/skills/specs/rules/task-scoring-rubric.md +0 -52
- package/src/claude/skills/specs/rules/tasks-generation.md +0 -189
- package/src/opencode/AGENTS.md +0 -41
- package/src/opencode/plugins/docs-sync.ts +0 -175
- package/src/opencode/plugins/inspect-block.ts +0 -164
- package/src/opencode/plugins/privacy-block.ts +0 -182
- package/src/opencode/plugins/rules.ts +0 -155
- package/src/opencode/plugins/session.ts +0 -179
- package/src/opencode/plugins/spec-gate.ts +0 -457
- package/src/opencode/plugins/spec-state.ts +0 -311
- package/src/opencode/plugins/state.ts +0 -253
- package/src/opencode/plugins/task-scaffold-guard.ts +0 -161
- package/src/opencode/plugins/usage.ts +0 -178
|
@@ -1,187 +1,151 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: hapo:develop
|
|
3
|
-
description: "Implement an explicitly
|
|
3
|
+
description: "Implement an explicitly requested process-first feature or task, run its real verification, and close it with one evidence owner. Also supports existing legacy Specs packets."
|
|
4
4
|
user-invocable: true
|
|
5
|
-
when_to_use: "Use to implement a ready
|
|
5
|
+
when_to_use: "Use to implement a ready feature packet, one named task, or a clear low-risk change."
|
|
6
6
|
category: utilities
|
|
7
7
|
keywords: [implementation, specs, verification]
|
|
8
8
|
argument-hint: "[feature-name|specs-directory-path] [task-file] [--flash] [--parallel [N]] [--notes]"
|
|
9
9
|
metadata:
|
|
10
10
|
author: haposoft
|
|
11
|
-
version: "
|
|
11
|
+
version: "3.0.0"
|
|
12
12
|
---
|
|
13
|
-
# Develop —
|
|
13
|
+
# Develop — implement, prove, synchronize
|
|
14
14
|
|
|
15
|
-
Implement the requested scope
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
is `src/claude/scripts/workflow-policy.cjs` (installed as
|
|
20
|
-
`.claude/scripts/workflow-policy.cjs`).
|
|
15
|
+
Implement only the explicitly requested scope. For a process-first feature,
|
|
16
|
+
`plan.md` and flat tasks are the durable packet; one closeout owner coordinates verification, review, sync, and docs impact without borrowing evidence.
|
|
17
|
+
|
|
18
|
+
Develop never starts merely because Specs finished. The user invokes it.
|
|
21
19
|
|
|
22
20
|
## Usage and pre-state guard
|
|
23
21
|
|
|
24
22
|
```text
|
|
25
23
|
/hapo:develop <feature>
|
|
26
24
|
/hapo:develop specs/<feature>
|
|
27
|
-
/hapo:develop <feature>
|
|
25
|
+
/hapo:develop <feature> task-02-<slug>.md
|
|
28
26
|
/hapo:develop <feature> --flash
|
|
29
27
|
/hapo:develop <feature> --parallel [N]
|
|
30
28
|
/hapo:develop <feature> --notes
|
|
31
29
|
```
|
|
32
30
|
|
|
33
|
-
`--notes` is opt-in.
|
|
31
|
+
`--notes` is opt-in. Only then load `references/implementation-notes-template.html`;
|
|
32
|
+
record decisions, scope exceptions, risks, gaps, and verification limits. Never create it by default.
|
|
34
33
|
|
|
35
|
-
|
|
34
|
+
Before any state mutation, reject `--flash` combined with `--parallel`:
|
|
36
35
|
|
|
37
36
|
```bash
|
|
38
37
|
node .claude/scripts/workflow-policy.cjs --flash --parallel --json
|
|
39
38
|
```
|
|
40
39
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
```text
|
|
44
|
-
Unsupported flags: --flash and --parallel are incompatible.
|
|
45
|
-
Remediation: run `/hapo:develop <feature> --flash` or `/hapo:develop <feature> --parallel [N]`.
|
|
46
|
-
No spec state, task receipt, worktree, subagent, or commit was created.
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
## Policy authority
|
|
50
|
-
|
|
51
|
-
For durable specs, persisted `workflow_policy` authority is the v2.1 minimum.
|
|
52
|
-
Canonical authoring supplies `planning_depth`, `assurance_level`,
|
|
53
|
-
`classified_minimum`, and normalized `risks`; lane and ceremony remain derived
|
|
54
|
-
views.
|
|
55
|
-
|
|
56
|
-
Classify before spec/state mutation:
|
|
57
|
-
|
|
58
|
-
```bash
|
|
59
|
-
node .claude/scripts/workflow-policy.cjs --classify-lane --task-json '<task JSON>' --json
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
- **Direct**: clear, isolated, reversible, low-risk. Skip spec/state/registry ceremony and run targeted verification with proportional evidence.
|
|
63
|
-
- **Standard**: use the bounded spec profile and focused inspection. A small feature needs no task registry/bundle and closes once at the feature boundary.
|
|
64
|
-
- **Critical**: derived Strict view. Add durable task state, research, or review
|
|
65
|
-
only when actual topology, uncertainty, or assurance requires it.
|
|
40
|
+
The pair exits `2` before a task edit, receipt, worktree, subagent, or commit. Do not reproduce it with a looser parser.
|
|
66
41
|
|
|
67
|
-
|
|
68
|
-
persistence, a per-feature baseline is monotonic and no downgrade is supported
|
|
69
|
-
until a trusted issuer exists; the baseline applies only to that feature.
|
|
70
|
-
Legacy approval fields and caller booleans have zero authority.
|
|
42
|
+
## Resolve the work packet
|
|
71
43
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
44
|
+
1. Resolve one `specs/<feature>/plan.md` plus flat `task-NN-*.md`; an explicit task path wins.
|
|
45
|
+
2. Read C1 scope, exclusions, acceptance mapping, ownership, and task order.
|
|
46
|
+
3. A task is unblocked only when every named dependency is done with a valid inline Receipt.
|
|
47
|
+
4. Full-feature mode selects one unblocked task at a time, in plan order.
|
|
48
|
+
Specific-task mode implements only that task and then stops.
|
|
49
|
+
5. Without a packet, work directly only when the change is clear, isolated, reversible, and low-risk.
|
|
75
50
|
|
|
76
|
-
|
|
51
|
+
Ambiguity, overlapping ownership, a dependency cycle, or a missing Verification Plan is a blocker. Do not guess.
|
|
77
52
|
|
|
78
53
|
## Modes
|
|
79
54
|
|
|
80
|
-
###
|
|
55
|
+
### Sequential feature or specific task
|
|
81
56
|
|
|
82
|
-
|
|
57
|
+
Set the selected task's single `Status:` field to `in_progress`. Implement its
|
|
58
|
+
Outcome and Acceptance only. Do not start the next task until proof, review,
|
|
59
|
+
and sync for the current task finish. A specific-task invocation never chains.
|
|
83
60
|
|
|
84
|
-
###
|
|
61
|
+
### Parallel (`--parallel [N]`)
|
|
85
62
|
|
|
86
|
-
|
|
63
|
+
Load `references/parallel-waves.md`. Require disjoint writes, satisfied dependencies,
|
|
64
|
+
isolated worktrees, a bounded wave, and one controller writer; otherwise work sequentially.
|
|
87
65
|
|
|
88
|
-
###
|
|
66
|
+
### Flash (`--flash`)
|
|
89
67
|
|
|
90
|
-
|
|
68
|
+
Flash is an explicit speed trade-off, never completion:
|
|
91
69
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
- skip dedicated test suites, full task evidence execution, and extended manual
|
|
96
|
-
checks;
|
|
97
|
-
- run only a cheap available syntax/typecheck/compile preflight;
|
|
98
|
-
- never weaken or delete tests;
|
|
99
|
-
- synchronize only as `in_progress` with `FLASH_UNVERIFIED`,
|
|
100
|
-
`dependencyBlocked: true`, `unblocks: false`, and blocker
|
|
70
|
+
- run only an available cheap syntax, typecheck, or compile preflight;
|
|
71
|
+
- skip dedicated tests, extended manual checks, and review retry loops;
|
|
72
|
+
- keep `Status: in_progress` and record `FLASH_UNVERIFIED` plus blocker
|
|
101
73
|
`awaiting /hapo:test <feature>`;
|
|
102
|
-
-
|
|
103
|
-
|
|
74
|
+
- do not unblock dependents or report Test PASS, Evidence PASS,
|
|
75
|
+
production-ready, or done;
|
|
76
|
+
- promotion later requires a fresh canonical PASS receipt through the trusted
|
|
77
|
+
sync-finalize path.
|
|
104
78
|
|
|
105
|
-
|
|
106
|
-
## Workflow
|
|
107
|
-
`Classify lane → load lane artifacts → scout obligations → implement current
|
|
108
|
-
scope → one closeout owner → test receipt → review → docs-impact sync.`
|
|
79
|
+
Never weaken, delete, or rewrite tests to make Flash look complete.
|
|
109
80
|
|
|
110
|
-
|
|
81
|
+
## Task cycle
|
|
111
82
|
|
|
112
|
-
|
|
113
|
-
- Standard requires its bounded validated artifacts, but not a
|
|
114
|
-
registry when the scope is small and no task obligation is persisted.
|
|
115
|
-
- Critical requires only the artifacts named by its snapshot obligations.
|
|
116
|
-
- For task-bearing work, load one requested task or one unblocked task and
|
|
117
|
-
extract the exact seven v2.1 sections: `Outcome`, `Scope`, `Anchors and Ownership`,
|
|
118
|
-
`Changes`, `Acceptance`, `Dependencies`, and `Verification Plan`.
|
|
119
|
-
Use typed `coordination.boundaries` for ownership/DAG/proof/parallel authority.
|
|
120
|
-
- Before implementation, transition `pending` to `in_progress` in task Markdown `**Status:**` and `spec.json.task_registry[path]` with synchronized timestamps. Never write execution proof into the task plan.
|
|
121
|
-
- A spec-ready execution-evidence or independent-audit slot may be `PENDING`
|
|
122
|
-
before implementation; pending is not proof and cannot close the feature.
|
|
83
|
+
### 1. Scout
|
|
123
84
|
|
|
124
|
-
|
|
85
|
+
Trace entrypoints, callers, dependents, registration, errors, and owned files.
|
|
86
|
+
Compilation does not prove an unmounted UI, unregistered route, uncalled service, or missing consumer.
|
|
125
87
|
|
|
126
|
-
|
|
127
|
-
entrypoints/callers, integration points, dependents, reachability risks, and
|
|
128
|
-
safe scope. File count is not review depth; stop if a runtime entrypoint cannot
|
|
129
|
-
be grounded.
|
|
88
|
+
### 2. Implement
|
|
130
89
|
|
|
131
|
-
|
|
90
|
+
Honor Scope, Ownership, Acceptance, and Dependencies. Do not silently replace named contracts;
|
|
91
|
+
scope expansion requires evidence and a return to C1, not implementation convenience.
|
|
132
92
|
|
|
133
|
-
|
|
134
|
-
frameworks, auth, transport, storage, or runtime boundaries. Do not mark a
|
|
135
|
-
runtime-facing file complete while it is orphaned, unmounted, unregistered, or
|
|
136
|
-
uncalled. A specific-task request ends after that task; no automatic chain.
|
|
93
|
+
### 3. Verify and review once
|
|
137
94
|
|
|
138
|
-
|
|
139
|
-
The
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
</SCOPE-FIDELITY>
|
|
95
|
+
The test owner executes the exact Verification Plan and records real output.
|
|
96
|
+
The review owner, when risk or repository policy requires review, evaluates
|
|
97
|
+
correctness, security, scope, and reachability but does not manufacture proof.
|
|
98
|
+
Use `PASS | PASS_WITH_WARNINGS | FAIL | BLOCKED`; only literal PASS can close.
|
|
143
99
|
|
|
144
|
-
|
|
100
|
+
Load `references/quality-gate.md` for the closeout contract. Remediate an
|
|
101
|
+
observed failure, then rerun only affected proof and review. Do not blind-retry
|
|
102
|
+
a blocked environment. After three failed repair rounds, stop and ask the user.
|
|
145
103
|
|
|
146
|
-
|
|
104
|
+
### 4. Write the inline Receipt and sync
|
|
147
105
|
|
|
148
|
-
|
|
149
|
-
- The review owner evaluates correctness, security, and spec compliance; it
|
|
150
|
-
consumes existing proof but never creates or claims execution proof.
|
|
151
|
-
- Review depth follows `assurance_level`, risk, and blast radius. Lane is only
|
|
152
|
-
a derived view, and depth does not follow the
|
|
153
|
-
number of files changed.
|
|
154
|
-
- Finding count never selects review depth or overrides missing execution proof.
|
|
155
|
-
- Use the shared adapter surface: `PASS | PASS_WITH_WARNINGS | FAIL | BLOCKED`.
|
|
156
|
-
Warnings do not waive missing proof; `FAIL` is remediable and `BLOCKED` stops.
|
|
106
|
+
After a real pass, append or replace the task's final `## Receipt` with:
|
|
157
107
|
|
|
158
|
-
|
|
159
|
-
|
|
108
|
+
- `Verification: PASS`;
|
|
109
|
+
- the exact `Command:` and `Exit: 0`;
|
|
110
|
+
- runtime-derived `Base:` and `Head:`;
|
|
111
|
+
- a non-empty fenced block containing current command output;
|
|
112
|
+
- required negative, reachability, and artifact proof from the task.
|
|
160
113
|
|
|
161
|
-
|
|
114
|
+
Then set `Status: done`, update only implemented checkboxes, and recompute the
|
|
115
|
+
queue. Missing, stale, contradictory, zero-test, placeholder, or marker-only
|
|
116
|
+
proof leaves the task unfinished.
|
|
162
117
|
|
|
163
|
-
|
|
164
|
-
After verification, synchronize status/timestamps/task state. Then evaluate
|
|
165
|
-
actual docs impact:
|
|
118
|
+
### 5. Finish the requested boundary
|
|
166
119
|
|
|
167
|
-
-
|
|
168
|
-
|
|
169
|
-
|
|
120
|
+
Specific-task mode stops after its sync. Full-feature mode continues one task
|
|
121
|
+
at a time, then runs the feature-level integration command and reachability
|
|
122
|
+
check named by the repository or plan. Show current evidence and limitations at
|
|
123
|
+
C3; the user decides completion.
|
|
170
124
|
|
|
171
|
-
|
|
125
|
+
Evaluate docs impact from the behavior actually changed:
|
|
172
126
|
|
|
173
|
-
|
|
127
|
+
- `none`: report it and make no docs edit;
|
|
128
|
+
- `minor` or `major`: update only affected existing docs through the docs flow.
|
|
174
129
|
|
|
175
|
-
|
|
176
|
-
a receipt bound to expected Base/Head, and every lane obligation. Only literal
|
|
177
|
-
`PASS` can complete; `PASS_WITH_WARNINGS` remains unfinished.
|
|
178
|
-
`--flash` records only `FLASH_UNVERIFIED` and never done.
|
|
130
|
+
## Definition of done
|
|
179
131
|
|
|
180
|
-
|
|
132
|
+
Done requires satisfied acceptance, reachable behavior, current executable
|
|
133
|
+
proof, correct Base/Head binding, resolved blocking review findings, and no
|
|
134
|
+
scope substitution. `PASS_WITH_WARNINGS`, `NO_TESTS`, `FLASH_UNVERIFIED`, or a
|
|
135
|
+
review-only pass cannot close work.
|
|
181
136
|
|
|
182
137
|
## Attached references
|
|
183
138
|
|
|
184
|
-
- `references/quality-gate.md` —
|
|
185
|
-
|
|
186
|
-
- `references/
|
|
187
|
-
|
|
139
|
+
- `references/quality-gate.md` — proof and review ownership.
|
|
140
|
+
- `references/parallel-waves.md` — opt-in isolated worktree waves.
|
|
141
|
+
- `references/implementation-notes-template.html` — only with `--notes`.
|
|
142
|
+
|
|
143
|
+
## Legacy workflow compatibility
|
|
144
|
+
|
|
145
|
+
If the selected feature contains `spec.json`, use its persisted
|
|
146
|
+
`workflow_policy`, `task_registry`, nested task paths, typed boundaries,
|
|
147
|
+
separate task receipts, and feature closeout receipt exactly as the legacy
|
|
148
|
+
adapters require. Preserve `planning_depth`, `assurance_level`, derived lane,
|
|
149
|
+
and read-only `execution_tier`; do not project these fields into a new v3
|
|
150
|
+
packet. Keep JSON and Markdown status synchronized, and use the existing
|
|
151
|
+
completion-authority path for final closeout.
|
|
@@ -1,194 +1,107 @@
|
|
|
1
|
-
# Parallel
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
4. The destination tree must be clean (`git status --porcelain` is empty) and
|
|
19
|
-
compatible with the selected base before dispatch. Record the destination
|
|
20
|
-
`base_sha` and stop without mutation when cleanliness, repository, or base
|
|
21
|
-
compatibility checks fail.
|
|
22
|
-
5. Before dispatch, state whether `--parallel` consent authorizes worker commits
|
|
23
|
-
and orchestrator cherry-picks. If that consent is not explicit, obtain the
|
|
24
|
-
separate confirmation before creating worktrees or asking workers to commit.
|
|
25
|
-
|
|
26
|
-
### Receipt contract (required per wave/task)
|
|
27
|
-
|
|
28
|
-
Every task and wave receipt records these exact fields:
|
|
1
|
+
# Parallel waves — `hapo:develop --parallel`
|
|
2
|
+
|
|
3
|
+
Load this reference only for explicit parallel execution. The goal is bounded
|
|
4
|
+
concurrency with immutable provenance and one state writer.
|
|
5
|
+
|
|
6
|
+
## Preconditions
|
|
7
|
+
|
|
8
|
+
1. Confirm the work context is a Git repository and worktree isolation is
|
|
9
|
+
available. Otherwise state why and fall back to the sequential loop.
|
|
10
|
+
2. Respect `.claude/runtime.json` `develop.parallel: false` when present.
|
|
11
|
+
3. Clamp `--parallel N` to 1..5; default to 3.
|
|
12
|
+
4. Require a clean destination and record its exact `base_sha`. Stop without
|
|
13
|
+
mutation if cleanliness or base compatibility fails.
|
|
14
|
+
5. Confirm whether the user's parallel consent also authorizes worker commits
|
|
15
|
+
and controller cherry-picks before creating worktrees.
|
|
16
|
+
|
|
17
|
+
Every task receipt for a wave records:
|
|
29
18
|
|
|
30
19
|
```text
|
|
31
20
|
base_sha: <destination commit before dispatch>
|
|
32
|
-
head_sha: <
|
|
21
|
+
head_sha: <worker or integrated commit>
|
|
33
22
|
branch: <worker branch>
|
|
34
|
-
worktree_path: <
|
|
23
|
+
worktree_path: <path>
|
|
35
24
|
commit_range: <base_sha>..<head_sha>
|
|
36
25
|
retention: retained|released
|
|
37
26
|
cleanup_authorization: pending|explicit-discard|merged-release
|
|
38
27
|
```
|
|
39
28
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
Every fix is a new commit: advance `head_sha`, replace `commit_range`, and rerun
|
|
43
|
-
only affected gates plus the wave integration check. A receipt without these
|
|
44
|
-
fields is incomplete.
|
|
29
|
+
Test and review commands inspect `git diff <base_sha>..<head_sha>`, never an
|
|
30
|
+
ambient working-tree diff. A fix creates a new commit and advances Head.
|
|
45
31
|
|
|
46
|
-
##
|
|
47
|
-
|
|
48
|
-
```
|
|
49
|
-
ready(t) = t.status == "pending" AND every dep in task_registry[t].dependencies
|
|
50
|
-
has status == "done"
|
|
51
|
-
candidates = ready tasks in task_registry order
|
|
52
|
-
wave = first ≤cap candidates, EXCLUDING any task that conflicts with an
|
|
53
|
-
earlier task already in the wave under the conflict graph below
|
|
54
|
-
```
|
|
32
|
+
## Build a wave
|
|
55
33
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
or shared state writers. `Create`/`Modify`/`Delete` rows are writers; `Read` rows
|
|
60
|
-
are still conflicts when they consume a mutable generated or registry surface.
|
|
61
|
-
Normalize paths before comparison. If overlap is uncertain, classify it as a
|
|
62
|
-
conflict and defer the task to the sequential fallback; never guess that two
|
|
63
|
-
writers are independent.
|
|
34
|
+
Read dependencies from the plan task table and each flat task's
|
|
35
|
+
`## Dependencies`. A candidate is ready only when all named dependencies are
|
|
36
|
+
done with valid Receipts.
|
|
64
37
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
38
|
+
Add ready tasks in plan order up to the cap, excluding a task when it shares a
|
|
39
|
+
write target with an earlier task or touches the same mutable registry,
|
|
40
|
+
lockfile, manifest, generated output, migration, or export barrel. Normalize
|
|
41
|
+
paths. Uncertain overlap is a conflict, not an invitation to guess.
|
|
68
42
|
|
|
69
|
-
|
|
70
|
-
|
|
43
|
+
One file has one writer per wave. If no safe wave remains, use the sequential
|
|
44
|
+
loop and state the dependency or ownership conflict.
|
|
71
45
|
|
|
72
|
-
|
|
46
|
+
## Dispatch
|
|
73
47
|
|
|
74
|
-
|
|
75
|
-
|
|
48
|
+
Each worker receives the complete task packet, work context, exact owned paths,
|
|
49
|
+
acceptance, Verification Plan, dependencies, and these constraints:
|
|
76
50
|
|
|
77
|
-
|
|
78
|
-
|
|
51
|
+
1. Work only in the assigned isolated worktree.
|
|
52
|
+
2. Do not edit `plan.md`, task Status, or `## Receipt`; the controller owns
|
|
53
|
+
state and evidence synchronization.
|
|
54
|
+
3. Do not touch a path outside granted ownership or undo another worker's edit.
|
|
55
|
+
4. Run task-local prechecks and report exact commands and exits.
|
|
56
|
+
5. Commit only when the user's authorization covers worker commits.
|
|
57
|
+
6. Return status plus branch, worktree, Base, Head, range, and retention.
|
|
79
58
|
|
|
80
|
-
|
|
59
|
+
A blocked or failed worker keeps its identifiable worktree and branch. Never
|
|
60
|
+
force-delete it without merge success or explicit discard authorization.
|
|
81
61
|
|
|
82
|
-
|
|
83
|
-
self-contained prompt per `rules/orchestrator.md` (task file content, design and
|
|
84
|
-
requirements excerpts, work-context/specs/docs paths, acceptance criteria) plus
|
|
85
|
-
these mandatory lines:
|
|
62
|
+
## Verify before integration
|
|
86
63
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
4. "When done, `git add` your changes and `git commit -m \"task(<id>): <title>\"` —
|
|
92
|
-
an uncommitted worktree cannot be merged."
|
|
93
|
-
5. End with the standard `Status: DONE|CONCERNS|BLOCKED|NEEDS_INFO` block, plus
|
|
94
|
-
the receipt fields from §1, including worktree path, branch, and commit range.
|
|
95
|
-
6. If a worker fails or blocks, do not remove its worktree or delete its branch.
|
|
96
|
-
Mark `retention: retained` and `cleanup_authorization: pending` until merge
|
|
97
|
-
succeeds or the user gives explicit discard authorization.
|
|
64
|
+
Inside each worktree, run the task's proof through `quality-gate.md` against the
|
|
65
|
+
immutable commit range. A task with missing proof, overlap, or unresolved High
|
|
66
|
+
or Critical finding is not eligible to integrate. Three failed repair rounds
|
|
67
|
+
collapse only that task; siblings may finish but do not erase its blocker.
|
|
98
68
|
|
|
99
|
-
|
|
100
|
-
first accepted commit becomes `head_sha`; no receipt may use a moving ambient
|
|
101
|
-
HEAD as a substitute. The Agent result returns `worktreePath` and
|
|
102
|
-
`worktreeBranch`; record both in the receipt.
|
|
69
|
+
## Integrate sequentially
|
|
103
70
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
Run the unchanged Stage A + Stage B gate (`references/quality-gate.md`) per task
|
|
107
|
-
**with the task's worktree as working directory**. Before reviewing, tester and
|
|
108
|
-
reviewer commands must inspect the receipt's immutable range:
|
|
71
|
+
Apply accepted worker commits one at a time in plan order:
|
|
109
72
|
|
|
110
73
|
```bash
|
|
111
|
-
git
|
|
112
|
-
git diff "$BASE_SHA..$HEAD_SHA"
|
|
74
|
+
git cherry-pick <worker-commit>
|
|
113
75
|
```
|
|
114
76
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
keep running. Any fix creates a new commit and updates `head_sha`/`commit_range`
|
|
119
|
-
before affected gates rerun.
|
|
77
|
+
On conflict, abort the cherry-pick, mark the task blocked, and retain its
|
|
78
|
+
worktree/branch. After success, update the receipt range to the integrated Head.
|
|
79
|
+
Release a worktree only after recording `cleanup_authorization: merged-release`.
|
|
120
80
|
|
|
121
|
-
##
|
|
81
|
+
## Post-merge proof
|
|
122
82
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
83
|
+
After the wave's last integration, run an affected integration command derived
|
|
84
|
+
from the tasks and repository contract. Record command, exit, Base, Head,
|
|
85
|
+
range, and output. Failure blocks the next wave.
|
|
126
86
|
|
|
127
|
-
|
|
87
|
+
Classify a failure before acting:
|
|
128
88
|
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
# → retain the worktree/branch; receipt says retention=retained
|
|
134
|
-
```
|
|
89
|
+
- `baseline`: reproduces from the recorded Base;
|
|
90
|
+
- `environment`: required tool, service, permission, or dependency unavailable;
|
|
91
|
+
- `spec`: acceptance or evidence contract is wrong or incomplete;
|
|
92
|
+
- `code`: implementation or integration regression.
|
|
135
93
|
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
`cleanup_authorization: merged-release`:
|
|
94
|
+
Do not blind-retry. Fix code/spec with a new commit and rerun affected proof;
|
|
95
|
+
record baseline/environment as blockers.
|
|
139
96
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
97
|
+
After the final wave, run the feature-level integration and reachability proof.
|
|
98
|
+
The controller then writes inline Receipts and Status updates one task at a
|
|
99
|
+
time. Worker reports are evidence inputs, not permission to claim done.
|
|
100
|
+
|
|
101
|
+
## Legacy workflow compatibility
|
|
144
102
|
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
## 6. Post-merge integration check (per wave)
|
|
152
|
-
|
|
153
|
-
After the wave's last cherry-pick, run an affected integration command derived
|
|
154
|
-
from the task's `Verification Plan` and repository contract (build or affected test
|
|
155
|
-
subset; never the full suite mid-flight). Record command, `base_sha`, `head_sha`,
|
|
156
|
-
range, and result in the wave receipt. Failure blocks the next wave.
|
|
157
|
-
|
|
158
|
-
After the final wave, run an explicit feature/full integration command derived
|
|
159
|
-
from the repository contract — for example the feature's exact verification suite
|
|
160
|
-
or the repository's documented full test/build command. A final scout is not a
|
|
161
|
-
substitute. On PASS, the test owner creates `feature-receipt.md` once; task
|
|
162
|
-
receipts alone cannot close the feature. Classify every failure before acting as exactly one of:
|
|
163
|
-
|
|
164
|
-
- `baseline` — reproduces from the recorded destination `base_sha`;
|
|
165
|
-
- `environment` — tool, dependency, permission, or service unavailable;
|
|
166
|
-
- `spec` — requirement, acceptance, or evidence contract mismatch;
|
|
167
|
-
- `code` — implementation or integration regression.
|
|
168
|
-
|
|
169
|
-
Do not blind-retry. Fix `code`/`spec` failures with a new commit and affected
|
|
170
|
-
gates; record `baseline`/`environment` blockers and escalate or use the
|
|
171
|
-
sequential fallback according to the task contract.
|
|
172
|
-
|
|
173
|
-
## 7. State sync — orchestrator is the single writer
|
|
174
|
-
|
|
175
|
-
Only the orchestrator writes `spec.json` and task markdown, after each task's
|
|
176
|
-
cherry-pick: registry `status`/`completed_at`/`last_updated_at`, task-md `Status`,
|
|
177
|
-
checkbox ticks, and a canonical `receipts/<task-basename>.md` citing the
|
|
178
|
-
worktree gate evidence plus the post-merge check result. Never append execution
|
|
179
|
-
proof to task Markdown. The Stop completion gate (`spec-gate.cjs`) applies
|
|
180
|
-
unchanged — a receipt-less done blocks the turn. After syncing the wave, recompute
|
|
181
|
-
§2 and continue until no pending tasks remain.
|
|
182
|
-
|
|
183
|
-
## 8. Failure summary
|
|
184
|
-
|
|
185
|
-
| Event | Action |
|
|
186
|
-
|---|---|
|
|
187
|
-
| Escape hatch on / not a git repo / no isolation | Sequential fallback + stated reason |
|
|
188
|
-
| Same-wave path collision | Defer the later task to next wave (§2) |
|
|
189
|
-
| Gate fails 3× for a task | COLLAPSE for that task; retain worktree/branch and receipt; wave continues |
|
|
190
|
-
| Worker failure or blocked task | Retain identifiable worktree/branch; no force-remove; classify and await resume or explicit discard |
|
|
191
|
-
| Cherry-pick conflict | Abort pick; task `blocked` + conflict blocker; retain worktree/branch; wave continues |
|
|
192
|
-
| Post-merge check fails | Classify baseline/environment/spec/code; no next wave until resolved or explicitly blocked |
|
|
193
|
-
| Final integration fails | Record failure class and stop; do not claim completion from a final scout |
|
|
194
|
-
| Empty wave, tasks pending | Sequential loop for the remainder + notice |
|
|
103
|
+
For an existing `spec.json` feature, readiness and dependencies come from the
|
|
104
|
+
persisted `task_registry` and typed `coordination.boundaries`. Workers still do
|
|
105
|
+
not edit that state. The controller writes the legacy separate task receipt,
|
|
106
|
+
synchronizes registry plus nested task Markdown, and creates the required final
|
|
107
|
+
feature receipt only after integrated proof.
|