@haposoft/cafekit 0.16.0-rc.6 → 0.16.0-rc.7
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 +137 -0
- package/bin/__tests__/codex-native.test.js +130 -74
- 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 +10 -20
- 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 +76 -155
- package/src/claude/gitignore +1 -1
- package/src/claude/hooks/__tests__/spec-gate.test.js +162 -0
- 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 +22 -11
- 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 +141 -1
- package/src/claude/scripts/spec-resolver.cjs +288 -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 +142 -204
- package/src/claude/skills/specs/references/review.md +109 -243
- package/src/claude/skills/specs/references/templates.md +173 -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 +22 -12
- 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,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.
|
|
@@ -1,99 +1,71 @@
|
|
|
1
|
-
# Quality
|
|
1
|
+
# Quality gate — one closeout, separate proof and review
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
a fixed
|
|
5
|
-
`execution_tier` are derived/read-only compatibility views.
|
|
3
|
+
Load this reference when closing a task or direct change. It defines ownership
|
|
4
|
+
and evidence, not a fixed agent sequence.
|
|
6
5
|
|
|
7
|
-
##
|
|
6
|
+
## Ownership
|
|
8
7
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
- **Test owner:** executes the named commands and is the sole producer of
|
|
9
|
+
execution proof.
|
|
10
|
+
- **Review owner:** evaluates correctness, security, scope, and reachability;
|
|
11
|
+
consumes proof but never creates it.
|
|
12
|
+
- **Closeout owner:** normalizes both results, writes the task Receipt and
|
|
13
|
+
Status, and reports docs impact.
|
|
13
14
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
- **Closeout owner:** combines both results and performs one state/docs sync.
|
|
15
|
+
Use `PASS | PASS_WITH_WARNINGS | FAIL | BLOCKED`. Only literal PASS plus all
|
|
16
|
+
required proof can close. Review depth follows risk, blast radius, and repository
|
|
17
|
+
policy, not file count.
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
tasks. There is no fixed Light/Standard/Deep agent sequence. The shared verdict
|
|
21
|
-
surface is `PASS | PASS_WITH_WARNINGS | FAIL | BLOCKED`; all adapters must use
|
|
22
|
-
the same normalizer.
|
|
23
|
-
|
|
24
|
-
## Working directory (parallel mode)
|
|
25
|
-
|
|
26
|
-
When an opt-in wave is active, each command runs in its task worktree. A
|
|
27
|
-
collapse of one task does not cancel other in-flight tasks; merge and state
|
|
28
|
-
synchronization remain single-writer operations.
|
|
29
|
-
|
|
30
|
-
## Required evidence
|
|
19
|
+
## Required proof
|
|
31
20
|
|
|
32
21
|
Before completion, verify:
|
|
33
22
|
|
|
34
|
-
1. compile/typecheck
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
runtime
|
|
41
|
-
|
|
42
|
-
5. a real independent audit when `needsIndependentAudit` is persisted. The
|
|
43
|
-
audit must use schema version `1`, distinct reviewer and implementation
|
|
44
|
-
session IDs, matching expected Base/Head binding, concrete evidence, and
|
|
45
|
-
literal `verdict: "PASS"`.
|
|
46
|
-
|
|
47
|
-
`PRECHECK_FAIL` outranks no-tests. Missing, pending, marker-only, contradictory,
|
|
48
|
-
or placeholder proof is unfinished. `Audit: PASS` is not an independent audit.
|
|
49
|
-
`NO_TESTS` may be retained as a legacy diagnostic input, but it can never become
|
|
50
|
-
the shared completion verdict `PASS`.
|
|
23
|
+
1. applicable compile/typecheck and every exact task command;
|
|
24
|
+
2. at least one real test when automated tests are required;
|
|
25
|
+
3. runtime reachability through the declared entrypoint or consumer;
|
|
26
|
+
4. negative/failure behavior named by Acceptance;
|
|
27
|
+
5. artifact bytes and SHA-256 when the task declares an artifact;
|
|
28
|
+
6. an inline `## Receipt` with `Verification: PASS`, exact `Command`, `Exit: 0`,
|
|
29
|
+
runtime-bound Base/Head, and non-empty fenced command output;
|
|
30
|
+
7. correctness/security/scope review at the required depth.
|
|
51
31
|
|
|
52
|
-
|
|
32
|
+
`PRECHECK_FAIL` outranks no-tests. Missing, pending, placeholder, contradictory,
|
|
33
|
+
zero-test, stale, copied, or marker-only proof is unfinished. A review PASS
|
|
34
|
+
cannot replace execution evidence.
|
|
53
35
|
|
|
54
|
-
|
|
55
|
-
Plan, runtime reachability, and artifact/provenance boundaries. A missing or orphaned
|
|
56
|
-
runtime deliverable is a failure even when compilation succeeds.
|
|
36
|
+
## Review focus
|
|
57
37
|
|
|
58
|
-
|
|
59
|
-
|
|
38
|
+
Check task Outcome, Scope, Acceptance, Dependencies, Verification Plan, changed
|
|
39
|
+
diff, and actual consumers. Treat an unmounted UI, unregistered route, uncalled
|
|
40
|
+
service, disconnected worker, missing export, or unconsumed artifact as a
|
|
41
|
+
reachability failure even when compilation passes.
|
|
60
42
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
43
|
+
Apply security checks relevant to the touched boundary: auth and tenant scope,
|
|
44
|
+
input validation, secret redaction, path containment and symlinks, atomic writes,
|
|
45
|
+
concurrency, cleanup, and safe error behavior. Do not add unrelated ceremony.
|
|
64
46
|
|
|
65
|
-
|
|
47
|
+
Specific-task mode reviews only that task and stops. Full-feature mode uses
|
|
48
|
+
cumulative scope only for the final integration check.
|
|
66
49
|
|
|
67
|
-
|
|
68
|
-
check safe identifiers, quoted schemes, idempotence, and receipt secrecy. For
|
|
69
|
-
filesystem writes, check lexical and canonical containment, symlink rejection,
|
|
70
|
-
atomic same-directory replacement, cleanup, and canonical return paths. Add
|
|
71
|
-
auth, persistence, provider, or concurrency checks only when scope/risk requires.
|
|
72
|
-
|
|
73
|
-
## Quality cycle
|
|
50
|
+
## Repair cycle
|
|
74
51
|
|
|
75
52
|
```text
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
if retry_count reaches 3: stop and request user intervention
|
|
53
|
+
test owner runs required proof once
|
|
54
|
+
if BLOCKED: record prerequisite and stop
|
|
55
|
+
if FAIL: repair the observed cause and rerun affected proof
|
|
56
|
+
review owner evaluates the proven diff once
|
|
57
|
+
if review FAIL: repair affected scope and rerun affected proof/review
|
|
58
|
+
after three failed repair rounds: stop and request user direction
|
|
83
59
|
```
|
|
84
60
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
complete.
|
|
89
|
-
|
|
90
|
-
## Flash Gate (`--flash`)
|
|
61
|
+
`PASS_WITH_WARNINGS` may report non-blocking observations but remains
|
|
62
|
+
unfinished for state synchronization. Never retry an unchanged environment to
|
|
63
|
+
manufacture a green result.
|
|
91
64
|
|
|
92
|
-
|
|
93
|
-
execution, extended UI/manual checks, and review retry loops. Still perform a
|
|
94
|
-
cheap preflight and scope/reachability sanity check.
|
|
65
|
+
## Flash gate
|
|
95
66
|
|
|
96
|
-
|
|
67
|
+
With explicit `--flash`, run only a cheap available preflight and a basic
|
|
68
|
+
scope/reachability check. Record:
|
|
97
69
|
|
|
98
70
|
```text
|
|
99
71
|
Mode: --flash
|
|
@@ -101,54 +73,22 @@ Tests: skipped by user request
|
|
|
101
73
|
Evidence: FLASH_UNVERIFIED
|
|
102
74
|
Status: in_progress
|
|
103
75
|
Blocker: awaiting /hapo:test <feature>
|
|
104
|
-
Next verification: /hapo:test <feature>
|
|
105
|
-
```
|
|
106
|
-
|
|
107
|
-
The persisted flash input must also contain `dependencyBlocked: true`,
|
|
108
|
-
`unblocks: false`, and a non-placeholder blocker, and must omit
|
|
109
|
-
`readyForSync`, `flashTransition`, and `promotionReceipt`. Sync-finalize
|
|
110
|
-
rejects minimal or caller-pre-promoted states.
|
|
111
|
-
|
|
112
|
-
Terminal log:
|
|
113
|
-
|
|
114
|
-
```text
|
|
115
|
-
⚡ Step 4 Flash Gate: tests skipped by --flash; preflight=<pass|skipped>; evidence=FLASH_UNVERIFIED
|
|
116
76
|
```
|
|
117
77
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
receipt and derive promotion.
|
|
122
|
-
|
|
123
|
-
## Closeout and docs impact
|
|
124
|
-
|
|
125
|
-
After the test receipt and review verdict are both available, the closeout owner
|
|
126
|
-
uses the policy adapter and synchronizes state. A review-only pass cannot close
|
|
127
|
-
missing execution proof. Evaluate docs impact from the actual behavior change:
|
|
128
|
-
|
|
129
|
-
- `none`: record no docs edit and stop;
|
|
130
|
-
- `minor` or `major`: update only affected existing docs through the normal docs
|
|
131
|
-
workflow.
|
|
132
|
-
|
|
133
|
-
Do not run a docs checkpoint merely because a task completed. Do not refresh the
|
|
134
|
-
whole repository for a local change.
|
|
135
|
-
|
|
136
|
-
After every task receipt is valid, final integration execution creates
|
|
137
|
-
`feature-receipt.md` once. A task-bearing feature cannot close without all task
|
|
138
|
-
receipts and the feature receipt. A taskless Compact/Full feature closes from a
|
|
139
|
-
valid feature receipt; absence before final closeout is not a failure. Receipts
|
|
140
|
-
never supply or imply approval, readiness, audit status, or product semantics.
|
|
78
|
+
Flash does not write a PASS receipt, mark done, unblock dependents, or report
|
|
79
|
+
production readiness. Trusted sync-finalize may promote only after fresh proof
|
|
80
|
+
passes the same receipt contract above.
|
|
141
81
|
|
|
142
|
-
##
|
|
82
|
+
## Docs impact and C3
|
|
143
83
|
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
reachability failure remains unfinished regardless of review severity.
|
|
84
|
+
After proof and review, classify docs impact as `none`, `minor`, or `major`.
|
|
85
|
+
Update only affected existing docs when impact is not none. Show the user the
|
|
86
|
+
current command evidence and limitations at C3; do not infer approval from a
|
|
87
|
+
receipt.
|
|
149
88
|
|
|
150
|
-
|
|
89
|
+
## Legacy workflow compatibility
|
|
151
90
|
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
91
|
+
Existing kernel packets keep their separate `receipts/<task-basename>.md`, task
|
|
92
|
+
identity/path metadata, final `feature-receipt.md`, persisted independent-audit
|
|
93
|
+
obligations, and completion-authority checks. The same proof/review ownership
|
|
94
|
+
applies. Do not copy that storage shape into a flat process-first task.
|
|
@@ -1,51 +1,44 @@
|
|
|
1
1
|
# Capability dispatch patterns
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
name or a sequence in a skill.
|
|
3
|
+
Load this optional reference only when a task benefits from independent
|
|
4
|
+
inspection, implementation, verification, review, or docs capability. Runtime
|
|
5
|
+
role names are configuration, not workflow policy.
|
|
7
6
|
|
|
8
|
-
## Dispatch
|
|
7
|
+
## Dispatch packet
|
|
9
8
|
|
|
10
|
-
Every dispatch
|
|
9
|
+
Every dispatch includes:
|
|
11
10
|
|
|
12
|
-
-
|
|
13
|
-
-
|
|
14
|
-
-
|
|
15
|
-
-
|
|
16
|
-
-
|
|
17
|
-
- required output, evidence, and status.
|
|
11
|
+
- work context and reports/plans paths;
|
|
12
|
+
- exact task outcome, scope, acceptance, and dependencies;
|
|
13
|
+
- owned read/write paths and explicit exclusions;
|
|
14
|
+
- risk, blast radius, stop conditions, and required evidence;
|
|
15
|
+
- expected status and handoff format.
|
|
18
16
|
|
|
19
|
-
Use
|
|
20
|
-
|
|
21
|
-
```text
|
|
22
|
-
dispatch(capability="inspection|implementation|verification|review|docs",
|
|
23
|
-
work_context="<root>",
|
|
24
|
-
scope="<task or feature>",
|
|
25
|
-
owned_files=["<paths>"],
|
|
26
|
-
obligations=["<persisted obligations>"],
|
|
27
|
-
output="<required packet and evidence>")
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
The runtime may map a capability to a local role. That mapping must not change
|
|
31
|
-
the lane, add ceremony, or become a new persisted policy field.
|
|
17
|
+
Use one capability per concrete responsibility. The runtime may map it to an
|
|
18
|
+
available local role, but that mapping cannot add scope or weaken proof.
|
|
32
19
|
|
|
33
20
|
## Independence and ownership
|
|
34
21
|
|
|
35
|
-
- Inspection
|
|
36
|
-
- Implementation edits only
|
|
37
|
-
- Verification is the sole producer of
|
|
38
|
-
- Review consumes proof and reports
|
|
39
|
-
- Documentation
|
|
22
|
+
- Inspection traces entrypoints and risks without editing source.
|
|
23
|
+
- Implementation edits only granted paths and does not write task state.
|
|
24
|
+
- Verification is the sole producer of executable proof.
|
|
25
|
+
- Review consumes proof and reports findings without claiming execution.
|
|
26
|
+
- Documentation starts only after a real docs-impact decision.
|
|
27
|
+
- The controller alone writes Status and inline Receipt.
|
|
40
28
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
provenance cannot be converted into PASS by the controller.
|
|
29
|
+
A specific-task invocation ends after that task. Full-feature execution may
|
|
30
|
+
continue only after the current task is synchronized and the next dependency
|
|
31
|
+
set is recomputed.
|
|
45
32
|
|
|
46
33
|
## Safe fallback
|
|
47
34
|
|
|
48
|
-
If
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
35
|
+
If a required capability or isolated workspace is unavailable, record BLOCKED
|
|
36
|
+
or run only a permitted main-session check. Never silently substitute an actor
|
|
37
|
+
for an independence requirement. A PENDING, BLOCKED, or provenance-free result
|
|
38
|
+
cannot be normalized to PASS.
|
|
39
|
+
|
|
40
|
+
## Legacy workflow compatibility
|
|
41
|
+
|
|
42
|
+
When the selected packet is legacy, include its persisted lane snapshot and
|
|
43
|
+
obligations in the dispatch, but do not let workers edit that state or infer an
|
|
44
|
+
independent result from a role label.
|
|
@@ -73,7 +73,7 @@ If `unclear`, ask one focused follow-up with the minimum choices needed.
|
|
|
73
73
|
|
|
74
74
|
Repo evidence priority:
|
|
75
75
|
1. `README.md`, `AGENTS.md`, `CLAUDE.md`
|
|
76
|
-
2. relevant `docs/`, `specs/`, `.claude
|
|
76
|
+
2. relevant `docs/`, `specs/`, `.claude/`
|
|
77
77
|
3. source files, tests, scripts, package manifests, config files
|
|
78
78
|
4. git history only when the question asks about changes or provenance
|
|
79
79
|
|