@haposoft/cafekit 0.16.0-rc.2 → 0.16.0-rc.4
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/bin/__tests__/codex-hooks.test.js +794 -21
- package/bin/__tests__/codex-native.test.js +228 -7
- package/bin/__tests__/develop-contract.test.js +1838 -112
- package/bin/__tests__/installer-safety.test.js +82 -29
- package/bin/__tests__/opencode-spec-gate.test.js +799 -0
- package/bin/__tests__/package-inventory.test.js +841 -10
- package/bin/__tests__/specs-v2-execution-closeout.test.js +421 -0
- package/bin/__tests__/specs-v2-policy-and-scaffold.test.js +601 -0
- package/bin/__tests__/specs-v2-validator-grounder-contract.test.js +952 -0
- package/bin/__tests__/test-runtime-dependency-closure.cjs +182 -0
- package/bin/__tests__/validator-grounding.test.js +2469 -71
- package/bin/lib/managed-writer.js +12 -3
- package/bin/phases/codex-runtime.js +17 -1
- package/package.json +1 -1
- package/src/claude/CLAUDE.md +6 -0
- package/src/claude/agents/code-auditor.md +20 -0
- package/src/claude/agents/spec-maker.md +153 -202
- package/src/claude/hooks/__tests__/completion-authority.test.js +953 -0
- package/src/claude/hooks/__tests__/privacy-block.test.js +172 -0
- package/src/claude/hooks/__tests__/semantic-review-authority.test.js +257 -0
- package/src/claude/hooks/__tests__/spec-gate.test.js +604 -56
- package/src/claude/hooks/completion-authority-check.cjs +56 -0
- package/src/claude/hooks/completion-authority-state.cjs +527 -0
- package/src/claude/hooks/completion-authority.cjs +154 -0
- package/src/claude/hooks/docs-sync.cjs +5 -2
- package/src/claude/hooks/lib/privacy-command-analysis.cjs +393 -0
- package/src/claude/hooks/lib/runtime-path-safety.cjs +119 -0
- package/src/claude/hooks/privacy-block.cjs +77 -30
- package/src/claude/hooks/semantic-review-authority.cjs +152 -0
- package/src/claude/hooks/session.cjs +33 -19
- package/src/claude/hooks/spec-gate.cjs +181 -139
- package/src/claude/hooks/spec-state.cjs +112 -47
- package/src/claude/migration-manifest.json +15 -2
- package/src/claude/rules/state-sync.md +52 -21
- package/src/claude/rules/workflow.md +17 -9
- package/src/claude/scripts/provenance.cjs +315 -0
- package/src/claude/scripts/spec-final-state.cjs +244 -0
- package/src/claude/scripts/spec-ground.cjs +535 -173
- package/src/claude/scripts/spec-readiness.cjs +118 -0
- package/src/claude/scripts/spec-receipt.cjs +162 -0
- package/src/claude/scripts/spec-resolver.cjs +501 -0
- package/src/claude/scripts/spec-scaffold.cjs +1945 -55
- package/src/claude/scripts/spec-semantic-model.cjs +396 -0
- package/src/claude/scripts/validate-spec-output.cjs +3204 -262
- package/src/claude/scripts/workflow-policy.cjs +1888 -203
- package/src/claude/settings/settings.json +12 -0
- package/src/claude/skills/code-review/SKILL.md +94 -66
- package/src/claude/skills/code-review/references/spec-compliance-review.md +10 -2
- package/src/claude/skills/code-review/references/verification-gate.md +13 -0
- package/src/claude/skills/develop/SKILL.md +138 -283
- package/src/claude/skills/develop/references/parallel-waves.md +9 -6
- package/src/claude/skills/develop/references/quality-gate.md +123 -148
- package/src/claude/skills/develop/references/subagent-patterns.md +42 -37
- package/src/claude/skills/specs/SKILL.md +192 -397
- package/src/claude/skills/specs/references/ask-user-question-gates.md +27 -18
- package/src/claude/skills/specs/references/cross-spec-dependency.md +8 -4
- package/src/claude/skills/specs/references/research-strategy.md +4 -1
- package/src/claude/skills/specs/references/review.md +200 -260
- package/src/claude/skills/specs/references/scope-inquiry.md +18 -5
- package/src/claude/skills/specs/rules/design-discovery-full.md +33 -81
- package/src/claude/skills/specs/rules/design-discovery-light.md +21 -42
- package/src/claude/skills/specs/rules/design-principles.md +136 -180
- package/src/claude/skills/specs/rules/design-review.md +42 -97
- package/src/claude/skills/specs/rules/ears-format.md +42 -50
- package/src/claude/skills/specs/rules/phase-decision-matrix.md +42 -41
- package/src/claude/skills/specs/rules/task-scoring-rubric.md +46 -46
- package/src/claude/skills/specs/rules/tasks-generation.md +189 -271
- package/src/claude/skills/specs/templates/design.md +49 -263
- package/src/claude/skills/specs/templates/requirements.md +26 -36
- package/src/claude/skills/specs/templates/research.md +9 -98
- package/src/claude/skills/specs/templates/spec-state.json +26 -67
- package/src/claude/skills/specs/templates/task.md +30 -82
- package/src/claude/skills/sync/SKILL.md +45 -15
- package/src/claude/skills/sync/references/sync-protocols.md +34 -16
- package/src/claude/skills/test/SKILL.md +151 -167
- package/src/codex/AGENTS.md +6 -0
- package/src/codex/hooks/completion-authority-check.cjs +63 -0
- package/src/codex/hooks/completion-authority-state.cjs +527 -0
- package/src/codex/hooks/completion-authority.cjs +106 -0
- package/src/codex/hooks/lib/hook-context.cjs +58 -4
- package/src/codex/hooks/lib/privacy-command-analysis.cjs +3 -0
- package/src/codex/hooks/lib/privacy-state.cjs +38 -16
- package/src/codex/hooks/lib/runtime-path-safety.cjs +3 -0
- package/src/codex/hooks/lib/spec-receipt.cjs +86 -115
- package/src/codex/hooks/lib/spec-utils.cjs +104 -27
- package/src/codex/hooks/privacy-approval.cjs +1 -1
- package/src/codex/hooks/privacy-block.cjs +67 -11
- package/src/codex/hooks/semantic-review-authority.cjs +130 -0
- package/src/codex/hooks/session.cjs +2 -0
- package/src/codex/hooks/spec-gate.cjs +151 -24
- package/src/codex/hooks/spec-state.cjs +65 -12
- package/src/codex/hooks/state.cjs +2 -0
- package/src/codex/hooks.json +16 -1
- package/src/codex/rules/state-sync.md +47 -27
- package/src/common/AGENTS.md +1 -1
- package/src/opencode/AGENTS.md +4 -2
- package/src/opencode/plugins/spec-gate.ts +296 -122
- package/src/opencode/plugins/spec-state.ts +183 -116
|
@@ -1,179 +1,154 @@
|
|
|
1
|
-
# Quality Gate —
|
|
1
|
+
# Quality Gate — one closeout, separate proof and review
|
|
2
2
|
|
|
3
|
-
This is
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
1. Automated verification (typecheck/test/build)
|
|
7
|
-
2. Spec compliance review (scope/task/design adherence)
|
|
8
|
-
3. Code quality review
|
|
9
|
-
4. Task evidence (completion criteria + runtime/artifact/reachability proof from the task file)
|
|
3
|
+
This reference is loaded at develop closeout. It is an executable contract, not
|
|
4
|
+
a fixed actor checklist. Canonical v2.1 policy input is authoritative; lane and
|
|
5
|
+
`execution_tier` are derived/read-only compatibility views.
|
|
10
6
|
|
|
11
|
-
|
|
7
|
+
## Inputs and ownership
|
|
12
8
|
|
|
13
|
-
|
|
9
|
+
The single closeout owner receives the current scope, assurance, risk signals, blast
|
|
10
|
+
radius, exact evidence commands, and the current diff. It calls the test owner
|
|
11
|
+
once, then the review owner once when required. No parallel path, review path,
|
|
12
|
+
or sync hook runs a duplicate hidden gate.
|
|
14
13
|
|
|
15
|
-
|
|
14
|
+
- **Test owner:** executes commands and creates the canonical execution receipt.
|
|
15
|
+
- **Review owner:** evaluates correctness, security, scope, and spec compliance;
|
|
16
|
+
consumes the receipt but never creates or claims execution proof.
|
|
17
|
+
- **Closeout owner:** combines both results and performs one state/docs sync.
|
|
16
18
|
|
|
17
|
-
|
|
19
|
+
Review depth follows assurance, risk, and blast radius, not the number of files or
|
|
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.
|
|
18
23
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
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
|
|
31
|
+
|
|
32
|
+
Before completion, verify:
|
|
33
|
+
|
|
34
|
+
1. compile/typecheck precheck and every exact command named by the active
|
|
35
|
+
`Verification Plan`;
|
|
36
|
+
2. real runtime reachability and declared artifact inspection;
|
|
37
|
+
3. canonical `receipts/<task-basename>.md` with task identity/path, non-empty
|
|
38
|
+
exact command, successful exit/result, expected versus observed behavior,
|
|
39
|
+
applicable negative/reachability proof, both provenance anchors bound to the
|
|
40
|
+
runtime's expected Base/Head pair, and required SHA-256 declarations;
|
|
41
|
+
4. correctness/security/spec review at the selected depth;
|
|
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"`.
|
|
22
46
|
|
|
23
|
-
|
|
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`.
|
|
24
51
|
|
|
25
52
|
## Spec compliance review
|
|
26
53
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
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
|
-
|
|
62
|
-
the deepest existing parent both stay inside the canonical root; parent-symlink
|
|
63
|
-
and final-symlink targets are rejected without following/overwriting; no file
|
|
64
|
-
outside root is created or mutated on rejection; write goes via same-directory
|
|
65
|
-
temp file + atomic `rename` with cleanup on error; success returns canonical
|
|
66
|
-
`realpath` (platform aliases resolved).
|
|
54
|
+
Check scope lock, requirements, design contracts, task Acceptance, Verification
|
|
55
|
+
Plan, runtime reachability, and artifact/provenance boundaries. A missing or orphaned
|
|
56
|
+
runtime deliverable is a failure even when compilation succeeds.
|
|
57
|
+
|
|
58
|
+
**Specific-task mode:** review exactly the requested task and its diff, then
|
|
59
|
+
stop. Do not select a next task.
|
|
60
|
+
|
|
61
|
+
**Full-feature mode:** use the cumulative feature scope only at its closeout;
|
|
62
|
+
intermediate synchronization does not claim feature completion. Run the Final
|
|
63
|
+
Integration Scout when runtime-facing surfaces exist.
|
|
64
|
+
|
|
65
|
+
## Correctness and security review
|
|
66
|
+
|
|
67
|
+
Apply only the checks relevant to the touched boundary. For logging/redaction,
|
|
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
|
|
74
|
+
|
|
75
|
+
```text
|
|
76
|
+
retry_count = 0
|
|
77
|
+
while closeout is not PASS:
|
|
78
|
+
test owner executes required proof once
|
|
79
|
+
if proof is BLOCKED: stop without blind retry
|
|
80
|
+
review owner evaluates correctness/security/spec once
|
|
81
|
+
if FAIL: fix only the affected scope and rerun affected proof/review
|
|
82
|
+
if retry_count reaches 3: stop and request user intervention
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
Only `FAIL` enters remediation. `BLOCKED` is terminal until its prerequisite
|
|
86
|
+
changes. `PASS_WITH_WARNINGS` is a review result only and remains unfinished;
|
|
87
|
+
only literal `PASS` may close when all execution and policy obligations are
|
|
88
|
+
complete.
|
|
67
89
|
|
|
68
90
|
## Flash Gate (`--flash`)
|
|
69
91
|
|
|
70
|
-
Use
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
- Do not report `Test PASS`, `Evidence PASS`, `Auto-Approved`, or `production-ready`.
|
|
74
|
-
- Still perform a scope sanity check against active task Completion Criteria.
|
|
75
|
-
- Still perform a reachability sanity check for runtime-facing files: imported, mounted, registered, routed, or invoked where applicable.
|
|
76
|
-
- Run a cheap compile/syntax/typecheck/build command only when available and expected to complete quickly without dependency install or external services.
|
|
77
|
-
- If the cheap preflight fails, return to implementation; do not sync.
|
|
78
|
-
- If the cheap preflight is unavailable or too slow, record `Preflight: skipped in --flash mode`.
|
|
79
|
-
- Sync only with receipt fields:
|
|
80
|
-
- `Mode: --flash`
|
|
81
|
-
- `Tests: skipped by user request`
|
|
82
|
-
- `Evidence: FLASH_UNVERIFIED`
|
|
83
|
-
- `Status: in_progress`
|
|
84
|
-
- `Blocker: awaiting /hapo:test <feature>`
|
|
85
|
-
- `Next verification: /hapo:test <feature>`
|
|
92
|
+
Use only when the flag is explicit. Skip dedicated tests, full evidence
|
|
93
|
+
execution, extended UI/manual checks, and review retry loops. Still perform a
|
|
94
|
+
cheap preflight and scope/reachability sanity check.
|
|
86
95
|
|
|
87
|
-
|
|
96
|
+
The flash record must contain exactly the unfinished semantics:
|
|
88
97
|
|
|
89
98
|
```text
|
|
90
|
-
|
|
99
|
+
Mode: --flash
|
|
100
|
+
Tests: skipped by user request
|
|
101
|
+
Evidence: FLASH_UNVERIFIED
|
|
102
|
+
Status: in_progress
|
|
103
|
+
Blocker: awaiting /hapo:test <feature>
|
|
104
|
+
Next verification: /hapo:test <feature>
|
|
91
105
|
```
|
|
92
106
|
|
|
93
|
-
|
|
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.
|
|
94
111
|
|
|
95
|
-
|
|
112
|
+
Terminal log:
|
|
96
113
|
|
|
97
114
|
```text
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
Before START_LOOP:
|
|
101
|
-
- Read the active task file(s)
|
|
102
|
-
- Extract Related Files, Completion Criteria, `## Evidence` (legacy heading aliases still parse)
|
|
103
|
-
- Extract the exact executable verification commands in declaration order
|
|
104
|
-
- Extract relevant design contracts/invariants for the touched area
|
|
105
|
-
- Extract scope_lock, requirement IDs, runtime entrypoints/callers, and reachability proof obligations
|
|
106
|
-
- If any of these are missing or too vague to verify, FAIL immediately and route back to spec correction
|
|
107
|
-
|
|
108
|
-
START_LOOP:
|
|
109
|
-
---------------------------------------------------------------
|
|
110
|
-
STAGE A: Test + SPEC COMPLIANCE review
|
|
111
|
-
---------------------------------------------------------------
|
|
112
|
-
→ Light: main session executes exact Evidence commands, spec checklist,
|
|
113
|
-
artifact checks, and reachability checks; spawn 0 subagents.
|
|
114
|
-
→ Standard: main session executes exact Evidence commands and spec checklist;
|
|
115
|
-
defer one combined auditor to the ship point.
|
|
116
|
-
→ Deep / --parallel: run the documented per-task sequence `inspector → implementer → test-runner → code-auditor` in the
|
|
117
|
-
task worktree, then preserve its documented merge/integration gates.
|
|
118
|
-
|
|
119
|
-
Test result and review result use the review enum only: PASS | FAIL | BLOCKED.
|
|
120
|
-
PASS proceeds. FAIL returns actionable findings to implementer. BLOCKED means
|
|
121
|
-
execution proof, permissions, environment, or a user-owned decision is missing:
|
|
122
|
-
stop immediately and do not blind-retry.
|
|
123
|
-
|
|
124
|
-
Standard specific-task ship point:
|
|
125
|
-
→ run exactly one combined code-auditor review after Stage A PASS.
|
|
126
|
-
Standard full-spec ship point:
|
|
127
|
-
→ run exactly one combined code-auditor review after the final task and
|
|
128
|
-
Final Integration Scout over the cumulative feature diff.
|
|
129
|
-
|
|
130
|
-
CASE 1 — PRECHECK_FAIL OR Automated FAIL OR required command missing OR Evidence FAIL / UNVERIFIED OR Reachability FAIL:
|
|
131
|
-
- For FAIL: increment retry_count; return to implementation while retry_count < 3.
|
|
132
|
-
- For BLOCKED: stop without retry; record blocker and await resolution.
|
|
133
|
-
- If retry_count >= 3: COLLAPSE and ask for user intervention.
|
|
134
|
-
|
|
135
|
-
CASE 2 — Test PASS + Evidence PASS + spec checklist PASS:
|
|
136
|
-
→ Proceed to the ship-point review for Standard, or the Deep Stage B review.
|
|
137
|
-
|
|
138
|
-
STAGE B:
|
|
139
|
-
---------------------------------------------------------------
|
|
140
|
-
CODE QUALITY REVIEW (only after spec compliance passes)
|
|
141
|
-
---------------------------------------------------------------
|
|
142
|
-
Standard uses the combined auditor described above; Deep retains the existing
|
|
143
|
-
Stage B quality review chain inside each worktree.
|
|
144
|
-
→ PASS = no Critical, no High, at most one Medium; proceed to sync.
|
|
145
|
-
→ FAIL = findings mapped to task/surface; fix affected scope and rerun only
|
|
146
|
-
affected evidence plus this combined review.
|
|
147
|
-
→ BLOCKED = missing proof/permission/environment/user decision; stop, no blind retry.
|
|
115
|
+
⚡ Step 4 Flash Gate: tests skipped by --flash; preflight=<pass|skipped>; evidence=FLASH_UNVERIFIED
|
|
148
116
|
```
|
|
149
117
|
|
|
150
|
-
|
|
118
|
+
Do not report `Test PASS`, `Evidence PASS`, `Auto-Approved`, or
|
|
119
|
+
`production-ready`. Flash never sets `done`, unblocks dependents, or promotes
|
|
120
|
+
from a marker. Trusted sync-finalize alone may consume a fresh canonical PASS
|
|
121
|
+
receipt and derive promotion.
|
|
151
122
|
|
|
152
|
-
|
|
153
|
-
- **Performance:** Bottlenecks, O(n^3) algorithms, unbounded loops over DB calls.
|
|
154
|
-
- **Architecture:** Breaking MVC boundaries, cross-module coupling, convention violations.
|
|
155
|
-
- **Principles:** YAGNI violations, KISS violations, DRY violations (excessive code duplication).
|
|
156
|
-
- **Evidence / Done-Criteria Drift:** Missing required artifacts, placeholder-only wiring, missing entrypoints, unproven completion criteria, or runtime contract mismatches.
|
|
157
|
-
- **Reachability Failure:** Orphan components/services/hooks/routes/workers/commands/providers/reducers, unmounted UI, unregistered routes, uncalled data loaders, unused providers, disconnected actions, or any runtime-facing artifact that cannot be reached from the declared entrypoint/caller.
|
|
158
|
-
- **Scope Drift:** Scoped acceptance criteria omitted, behavior added outside `scope_lock`, or a task marked complete while part of its approved requirement remains unwired.
|
|
159
|
-
- **Overscope Delivery Drift:** Implementing later-task deliverables or editing out-of-scope files without direct justification for the active task packet.
|
|
160
|
-
- **Contract Substitution Drift:** Replacing a named framework/auth/transport/datastore/runtime boundary with a custom simplification without a spec amendment.
|
|
161
|
-
- **Cross-Service Reality Failure:** Claiming end-to-end behavior across web/api/worker/extension boundaries while state only exists in local process memory or placeholder adapters.
|
|
123
|
+
## Closeout and docs impact
|
|
162
124
|
|
|
163
|
-
|
|
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:
|
|
164
128
|
|
|
165
|
-
|
|
129
|
+
- `none`: record no docs edit and stop;
|
|
130
|
+
- `minor` or `major`: update only affected existing docs through the normal docs
|
|
131
|
+
workflow.
|
|
166
132
|
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
- **Preflight Fail:** `[x] Step 4 Quality Gate: PRECHECK_FAIL → compile/typecheck/build failed before tests mattered`
|
|
170
|
-
- **Fix Needed:** `[~] Step 4 Quality Gate: Tests/spec/evidence failed → returned to implementer`
|
|
171
|
-
- **Awaiting Rescue:** `[!] Step 4 Quality Gate: Failed 3 rounds! Awaiting user intervention...`
|
|
133
|
+
Do not run a docs checkpoint merely because a task completed. Do not refresh the
|
|
134
|
+
whole repository for a local change.
|
|
172
135
|
|
|
173
|
-
|
|
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.
|
|
141
|
+
|
|
142
|
+
## Review threshold
|
|
174
143
|
|
|
175
|
-
|
|
144
|
+
`PASS` requires no Critical or High correctness/security/spec finding and no
|
|
145
|
+
blocking Medium finding. `PASS_WITH_WARNINGS` may carry documented non-blocking
|
|
146
|
+
findings. Finding count never selects review depth or overrides missing proof.
|
|
147
|
+
Any missing proof, unresolved obligation, scope drift, contract substitution, or
|
|
148
|
+
reachability failure remains unfinished regardless of review severity.
|
|
176
149
|
|
|
177
|
-
|
|
150
|
+
### Reachability Failure
|
|
178
151
|
|
|
179
|
-
|
|
152
|
+
An unmounted UI, unregistered route, uncalled service/loader, disconnected
|
|
153
|
+
worker/command/provider/reducer, missing artifact consumer, or other orphaned
|
|
154
|
+
runtime-facing output is a review failure.
|
|
@@ -1,46 +1,51 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Capability dispatch patterns
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
This reference is optional. Load it only when the persisted lane requires
|
|
4
|
+
independent capability work. Role names are runtime configuration, not workflow
|
|
5
|
+
policy: resolve them from the installed catalog instead of hardcoding an actor
|
|
6
|
+
name or a sequence in a skill.
|
|
4
7
|
|
|
5
|
-
##
|
|
6
|
-
Use the current Claude Code `Agent` tool for subagent invocation. In older runtimes, the same shape may appear as legacy `Task`.
|
|
7
|
-
```
|
|
8
|
-
Agent(subagent_type="[agent-name]", prompt="[task description]", description="[short title]")
|
|
9
|
-
```
|
|
8
|
+
## Dispatch contract
|
|
10
9
|
|
|
11
|
-
|
|
12
|
-
```
|
|
13
|
-
Agent(subagent_type="inspector", prompt="Scan and identify all files related to [feature-name] in the current codebase.", description="Scout [feature-name]")
|
|
14
|
-
```
|
|
10
|
+
Every dispatch prompt includes:
|
|
15
11
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
12
|
+
- Work context: the git root of the primary files;
|
|
13
|
+
- Reports path: `<work-context>/plans/reports/`;
|
|
14
|
+
- Plans path: `<work-context>/plans/`;
|
|
15
|
+
- exact task/scope and owned files;
|
|
16
|
+
- lane snapshot, risk/blast-radius obligations, and stop conditions;
|
|
17
|
+
- required output, evidence, and status.
|
|
20
18
|
|
|
21
|
-
|
|
22
|
-
```
|
|
23
|
-
Agent(subagent_type="ui-ux-designer", prompt="Implement the frontend code for [feature] following ./docs/design-guidelines.md", description="Code UI [feature]")
|
|
24
|
-
```
|
|
19
|
+
Use a capability request such as:
|
|
25
20
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
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>")
|
|
29
28
|
```
|
|
30
29
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
Agent(subagent_type="test-runner",
|
|
34
|
-
prompt="Run tests for recently implemented code. Apply blast-radius scoping
|
|
35
|
-
unless --full is requested. Return structured verdict with Status, Results,
|
|
36
|
-
Coverage, Failures, and Action.",
|
|
37
|
-
description="Test [feature]")
|
|
38
|
-
```
|
|
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.
|
|
39
32
|
|
|
40
|
-
##
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
33
|
+
## Independence and ownership
|
|
34
|
+
|
|
35
|
+
- Inspection may report entrypoints and blast radius but does not edit source.
|
|
36
|
+
- Implementation edits only the active task scope and does not sync state.
|
|
37
|
+
- Verification is the sole producer of canonical execution proof.
|
|
38
|
+
- Review consumes proof and reports correctness/security/spec findings only.
|
|
39
|
+
- Documentation work is invoked only after a real docs-impact decision.
|
|
40
|
+
|
|
41
|
+
Specific-task mode ends after one task. Full-feature mode may continue only
|
|
42
|
+
after the closeout owner synchronizes the current task and finds another
|
|
43
|
+
unblocked task. A capability result marked `PENDING`, `BLOCKED`, or lacking
|
|
44
|
+
provenance cannot be converted into PASS by the controller.
|
|
45
|
+
|
|
46
|
+
## Safe fallback
|
|
47
|
+
|
|
48
|
+
If the required capability or isolated workspace is unavailable, keep the
|
|
49
|
+
workflow in `BLOCKED` or run the permitted main-session check. Do not substitute
|
|
50
|
+
a model, profile, or actor silently, and do not claim an independent result
|
|
51
|
+
without an actually independent execution.
|