@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,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
|
|