@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,243 +1,109 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
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
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
scope-specific audit decision. Never select it from a keyword, severity label,
|
|
111
|
-
Full depth, or reviewer availability. If the required host event is unavailable,
|
|
112
|
-
pause once and report the capability blocker; do not retry loops or downgrade.
|
|
113
|
-
|
|
114
|
-
Strict red-team lenses are Security Adversary, Failure Mode Analyst, Assumption
|
|
115
|
-
Destroyer, and Scope & Complexity Critic. Findings without a concrete physical
|
|
116
|
-
location and counterexample are rejected as unsupported.
|
|
117
|
-
|
|
118
|
-
## Finding format
|
|
119
|
-
|
|
120
|
-
```markdown
|
|
121
|
-
## Finding N: <title>
|
|
122
|
-
- **Severity:** Critical | High | Medium
|
|
123
|
-
- **Location:** <file:line or exact section/anchor/requirement ID>
|
|
124
|
-
- **Broken edge:** <source -> target in the consistency graph>
|
|
125
|
-
- **Flaw:** <specific contradiction or omission>
|
|
126
|
-
- **Counterexample:** <concrete input/state/event and incorrect possible result>
|
|
127
|
-
- **Evidence:** <short quote or missing required mapping>
|
|
128
|
-
- **Suggested fix:** <smallest semantic correction>
|
|
129
|
-
- **Disposition:** Accept | Reject
|
|
130
|
-
- **Rationale:** <why>
|
|
131
|
-
```
|
|
132
|
-
|
|
133
|
-
Apply accepted findings to requirements, design, task acceptance/changes, named
|
|
134
|
-
contracts/invariants, dependencies, or verification. A report-only fix is not a
|
|
135
|
-
fix. Scope or product decisions require explicit user approval before editing.
|
|
136
|
-
|
|
137
|
-
## Deterministic and grounding gates
|
|
138
|
-
|
|
139
|
-
Finalize requirements, design, optional research, task files, and canonical
|
|
140
|
-
`spec.json` topology first. Every required authoring stage (`requirements`,
|
|
141
|
-
`design`, and, when present, `research`/`tasks`) must already read `validated`
|
|
142
|
-
via a fresh run of `spec-authoring-validation.cjs` — the sole atomic writer of
|
|
143
|
-
that transition and its C16 `AuthoringValidationReceipt` — before the digest
|
|
144
|
-
below is computed; a `validated` reading with no matching fresh receipt digest
|
|
145
|
-
is treated as `draft` everywhere it is read. Compute the candidate digest
|
|
146
|
-
read-only, then provide a review JSON object with exactly `verdict`,
|
|
147
|
-
`findings`, `unresolved_decisions`, `graph_coverage`, `reviewed_criteria`,
|
|
148
|
-
`counterexamples`, and `reviewer_evidence` — the frozen C2 fields the reviewer
|
|
149
|
-
itself supplies. `lifecycle_disposition` and `repair_round` are never authored
|
|
150
|
-
in this JSON: the finalizer derives both (repair_round is the C13 `attempt_index`
|
|
151
|
-
for the current review_epoch; lifecycle_disposition is CONTINUE unless a
|
|
152
|
-
non-PASS at the epoch's third attempt forces BLOCKED) and appends the completed
|
|
153
|
-
receipt to the durable, append-only `semantic_review_history` lineage. The
|
|
154
|
-
author must not fabricate or directly write authority state.
|
|
155
|
-
|
|
156
|
-
The digest projects task registry semantics as `id`, `dependencies`, and optional
|
|
157
|
-
`artifacts`. Execution-only status, blocker, timestamps, Markdown `Status`, and
|
|
158
|
-
checkbox checked state do not stale review; requirement, design, research, task
|
|
159
|
-
prose, dependency, artifact, or coordination changes do.
|
|
160
|
-
|
|
161
|
-
```bash
|
|
162
|
-
# Claude Code
|
|
163
|
-
node .claude/scripts/validate-spec-output.cjs specs/<feature> --semantic-digest
|
|
164
|
-
# Codex (installed projection — verify, not raw .claude path)
|
|
165
|
-
node .codex/scripts/validate-spec-output.cjs specs/<feature> --semantic-digest
|
|
166
|
-
```
|
|
167
|
-
|
|
168
|
-
The machine-recorded state binds the returned digest, exact reviewed `RN.M`
|
|
169
|
-
criteria, and one concrete counterexample per criterion. Each counterexample uses exactly `criterion`,
|
|
170
|
-
`case_kind`, `scenario`, `expected`, `decision_refs`, and `verification_ref`.
|
|
171
|
-
Decision refs resolve to real `D`/`I`/`C` definitions; the `V` definition traces
|
|
172
|
-
both the criterion and decisions. This state binds what was reviewed; it never
|
|
173
|
-
substitutes for semantic judgment or resolves ambiguity.
|
|
174
|
-
|
|
175
|
-
Routine and Elevated have no reviewer ceremony. Strict requires a real event
|
|
176
|
-
observed by the installed host hook from an allowlisted reviewer capability.
|
|
177
|
-
The hook derives reviewer identity/capability and binds the digest; authoring
|
|
178
|
-
prose cannot self-declare it.
|
|
179
|
-
The final reviewer message contains
|
|
180
|
-
exactly one line:
|
|
181
|
-
|
|
182
|
-
```text
|
|
183
|
-
CAFEKIT_SEMANTIC_REVIEW_ATTESTATION {"feature_name":"<feature>","spec_file":"specs/<feature>/spec.json","semantic_digest":"sha256:<digest>","verdict":"PASS"}
|
|
184
|
-
```
|
|
185
|
-
|
|
186
|
-
The `SubagentStop` hook recomputes the digest and stores a MAC-protected record
|
|
187
|
-
outside the project, bound to canonical project/spec/feature identity. Codex
|
|
188
|
-
must use its event-capable thread-spawn path for this Strict gate. Its legacy
|
|
189
|
-
internal multi-agent path does not expose the child completion message through
|
|
190
|
-
a supported hook event, so it stays not-ready; never derive authority from a
|
|
191
|
-
parent summary or a spawn-only `PostToolUse` event.
|
|
192
|
-
Do not add reviewer identity or independence claims to `semantic_review`.
|
|
193
|
-
This is a host-hook-observed honest-agent guardrail. It is not host-attested
|
|
194
|
-
evidence and not a security boundary against another process running as the
|
|
195
|
-
same OS account.
|
|
196
|
-
|
|
197
|
-
After the Strict observation (or immediately for Routine/Elevated), invoke the
|
|
198
|
-
only supported atomic promotion path:
|
|
199
|
-
|
|
200
|
-
```bash
|
|
201
|
-
# Claude Code
|
|
202
|
-
node .claude/scripts/spec-readiness.cjs specs/<feature> --review-result <review.json>
|
|
203
|
-
# Codex (installed projection — verify, not raw .claude path)
|
|
204
|
-
node .codex/scripts/spec-readiness.cjs specs/<feature> --review-result <review.json>
|
|
205
|
-
```
|
|
206
|
-
|
|
207
|
-
Run normal validation only after the installed finalizer records that state:
|
|
208
|
-
|
|
209
|
-
```bash
|
|
210
|
-
# Claude Code
|
|
211
|
-
node .claude/scripts/validate-spec-output.cjs specs/<feature>
|
|
212
|
-
# Codex (installed projection)
|
|
213
|
-
node .codex/scripts/validate-spec-output.cjs specs/<feature>
|
|
214
|
-
```
|
|
215
|
-
|
|
216
|
-
Run the runtime-provided grounding command for every durable spec. It
|
|
217
|
-
deterministically recomputes factual anchor/path/symbol/command reachability and
|
|
218
|
-
creates no additional receipt. Record command, exit code, and failing categories.
|
|
219
|
-
Non-zero blocks readiness. Exit 0 does not override a broken consistency edge or
|
|
220
|
-
counterexample; semantic review remains mandatory at the selected assurance level.
|
|
221
|
-
|
|
222
|
-
## Final reconciliation
|
|
223
|
-
|
|
224
|
-
Before readiness:
|
|
225
|
-
|
|
226
|
-
1. Re-read all physical artifacts after fixes.
|
|
227
|
-
2. Confirm accepted findings changed implementation-facing content.
|
|
228
|
-
3. Confirm requirements, globally unique anchor IDs, canonical design-anchor
|
|
229
|
-
references, contracts, owners/consumers, dependencies, negative paths, and
|
|
230
|
-
verification form a closed graph.
|
|
231
|
-
4. Confirm `feature-receipt.md`, phase files, copied contract bodies, legacy
|
|
232
|
-
topology markers, and unused template sections are absent.
|
|
233
|
-
5. Write coherent final timestamps/status and rerun deterministic gates;
|
|
234
|
-
readiness means technical artifact readiness, not permission to implement.
|
|
235
|
-
|
|
236
|
-
If any check fails, report `FAIL` or `BLOCKED`, preserve unfinished lifecycle
|
|
237
|
-
state, and do not suggest implementation handoff.
|
|
238
|
-
|
|
239
|
-
## Platform acceptance
|
|
240
|
-
|
|
241
|
-
Acceptance covers Claude Code and Codex artifacts only. Verify the semantic
|
|
242
|
-
rules/templates installed for both runtimes remain equivalent. Do not add a
|
|
243
|
-
third runtime to this acceptance scope.
|
|
1
|
+
# Plan review — evidence, adversarial lenses, and C2
|
|
2
|
+
|
|
3
|
+
Review exists to find costly errors before code. It is not a prose-quality
|
|
4
|
+
score. Every accepted finding must be reproducible from current repository
|
|
5
|
+
evidence.
|
|
6
|
+
|
|
7
|
+
## B1 — evidence rule
|
|
8
|
+
|
|
9
|
+
- Cite at least one real `path:line` for every repository claim. A finding
|
|
10
|
+
without a citation is excluded rather than debated.
|
|
11
|
+
- Run the search or read command; a plausible-looking citation is not proof.
|
|
12
|
+
- When a plan changes a symbol, interface, route, config key, or file contract,
|
|
13
|
+
count and list its callers, tests, exports, help text, and generated copies.
|
|
14
|
+
- Replace "update all callers" with the observed count and names. Above ten,
|
|
15
|
+
list the first ten plus the total.
|
|
16
|
+
- Label an unresolved external or runtime claim `[UNVERIFIED]` and name the
|
|
17
|
+
command, document, or environment that would settle it.
|
|
18
|
+
|
|
19
|
+
## Reviewer roles
|
|
20
|
+
|
|
21
|
+
| Role | Question | Required evidence |
|
|
22
|
+
|---|---|---|
|
|
23
|
+
| Fact Checker | Do named paths, symbols, commands, and keys exist? | search/read output with `path:line` |
|
|
24
|
+
| Flow Tracer | Does the claimed call order and error path exist? | entrypoint-to-effect trace, including early returns |
|
|
25
|
+
| Scope Auditor | Is new state scoped to the right lifetime and owner? | constructors, writers, cleanup, and existing equivalents |
|
|
26
|
+
| Contract Verifier | Are all consumers and compatibility surfaces covered? | caller/test/export/config/help inventory |
|
|
27
|
+
|
|
28
|
+
Scale the review to the number of independent work groups:
|
|
29
|
+
|
|
30
|
+
| Groups | Reviewers | Roles | Claim budget |
|
|
31
|
+
|---|---:|---|---:|
|
|
32
|
+
| 1-2 | 2 | Fact Checker plus the highest-risk role | about 5 per group |
|
|
33
|
+
| 3-5 | 3 | Fact Checker, Contract Verifier, one risk role | about 10 per group |
|
|
34
|
+
| 6+ | 4 | all roles | at least 15 total |
|
|
35
|
+
|
|
36
|
+
The table is a sizing guide, not permission to skip a material boundary.
|
|
37
|
+
|
|
38
|
+
## B2 — fresh-context red team
|
|
39
|
+
|
|
40
|
+
Use reviewers that did not author the plan and give each one a distinct lens:
|
|
41
|
+
|
|
42
|
+
- **Security adversary:** authorization bypass, injection, secret exposure,
|
|
43
|
+
unsafe path and trust-boundary transitions.
|
|
44
|
+
- **Failure-mode analyst:** race, partial write, crash recovery, retry,
|
|
45
|
+
cancellation, and stale state.
|
|
46
|
+
- **Assumption destroyer:** implicit dependencies, unavailable services,
|
|
47
|
+
untested error paths, and claims that something "should" work.
|
|
48
|
+
- **Scope and complexity critic:** premature abstraction, duplicated state,
|
|
49
|
+
optional work, and tasks too large for one owner.
|
|
50
|
+
|
|
51
|
+
Prompt them to break the plan. For every finding require: severity, exact plan
|
|
52
|
+
location, concrete counterexample, repository evidence, and the smallest repair.
|
|
53
|
+
Ignore style-only feedback.
|
|
54
|
+
|
|
55
|
+
## Four red-team lenses
|
|
56
|
+
|
|
57
|
+
Apply these to the relevant boundary:
|
|
58
|
+
|
|
59
|
+
1. **Input and identity:** empty, duplicate, malformed, adversarial, stale, and
|
|
60
|
+
cross-tenant inputs.
|
|
61
|
+
2. **State transition:** retry, partial completion, reordering, concurrency,
|
|
62
|
+
rollback, and recovery.
|
|
63
|
+
3. **Integration:** callers, exports, registration, transport, persistence,
|
|
64
|
+
packaging, and runtime reachability.
|
|
65
|
+
4. **Proof:** negative path, exact command, nonzero exit, zero-test result,
|
|
66
|
+
missing artifact, stale provenance, and environment limitation.
|
|
67
|
+
|
|
68
|
+
Each finding must describe an observable failure, not a preference.
|
|
69
|
+
|
|
70
|
+
## Aggregate before C2
|
|
71
|
+
|
|
72
|
+
Normalize duplicate findings by root cause. Preserve the strongest evidence and
|
|
73
|
+
smallest counterexample. Sort Critical, High, then Medium. Cap the presented
|
|
74
|
+
list at 15; a larger useful set means the plan should be split.
|
|
75
|
+
|
|
76
|
+
Present C2 as a table:
|
|
77
|
+
|
|
78
|
+
| ID | Severity | Plan location | Failure scenario | Evidence | Proposed repair | Decision |
|
|
79
|
+
|---|---|---|---|---|---|---|
|
|
80
|
+
|
|
81
|
+
The user chooses accept, reject, or revise. Do not apply findings before that
|
|
82
|
+
decision. Record the result in the plan review log.
|
|
83
|
+
|
|
84
|
+
## B3 — consistency sweep
|
|
85
|
+
|
|
86
|
+
After any accepted finding or user edit:
|
|
87
|
+
|
|
88
|
+
1. Reread every file in `specs/<feature>/`.
|
|
89
|
+
2. List deltas: renamed terms, changed decisions, removed assumptions, task
|
|
90
|
+
order, ownership, dependencies, acceptance IDs, and commands.
|
|
91
|
+
3. Search every delta and its old spelling across the whole feature packet.
|
|
92
|
+
4. Reconcile the plan table, task details, examples, acceptance mapping, and
|
|
93
|
+
verification commands.
|
|
94
|
+
5. Record: `files reread / deltas / stale references fixed / conflicts left`.
|
|
95
|
+
|
|
96
|
+
Any unresolved contradiction keeps the plan unready.
|
|
97
|
+
|
|
98
|
+
## B4 — stop condition
|
|
99
|
+
|
|
100
|
+
- Allow at most two review-and-repair rounds before implementation.
|
|
101
|
+
- Round three requires runtime evidence: an executed test, command output, or
|
|
102
|
+
observed host behavior. More paper argument is not a new finding.
|
|
103
|
+
- A repair round should not grow the plan unless evidence proves missing scope.
|
|
104
|
+
- Two add-only rounds trigger a split, deferral, or return to C1.
|
|
105
|
+
- Stop early when remaining findings are duplicates, preferences, or already
|
|
106
|
+
covered by one acceptance criterion and one verification command.
|
|
107
|
+
|
|
108
|
+
Review saturation means new reviewers no longer find a distinct material
|
|
109
|
+
failure with new evidence. It does not mean the plan is guaranteed correct.
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
# Process-first plan, task, and receipt templates
|
|
2
|
+
|
|
3
|
+
Use these as compact starting points. Remove unused examples and placeholders
|
|
4
|
+
before C2. The primary layout is always flat:
|
|
5
|
+
|
|
6
|
+
```text
|
|
7
|
+
specs/<feature>/
|
|
8
|
+
├── plan.md
|
|
9
|
+
├── task-01-<slug>.md
|
|
10
|
+
└── task-NN-<slug>.md
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## `plan.md` template
|
|
14
|
+
|
|
15
|
+
Keep the plan short enough to scan as one index, normally under 100 lines.
|
|
16
|
+
|
|
17
|
+
```markdown
|
|
18
|
+
# <Feature name>
|
|
19
|
+
|
|
20
|
+
## Scope decision (C1 — YYYY-MM-DD)
|
|
21
|
+
- Existing: <reusable code with path:line>
|
|
22
|
+
- Minimum change: <required behavior>
|
|
23
|
+
- Expansion signals: <none or evidence>
|
|
24
|
+
- User decision: EXPAND | KEEP | CUT — <reason>
|
|
25
|
+
|
|
26
|
+
## Out of scope
|
|
27
|
+
- <deliberate exclusion>
|
|
28
|
+
|
|
29
|
+
## Acceptance criteria
|
|
30
|
+
| ID | EARS criterion | Proof |
|
|
31
|
+
|---|---|---|
|
|
32
|
+
| AC-01 | When <trigger>, the system shall <response>. | `<command>` |
|
|
33
|
+
|
|
34
|
+
## Tasks
|
|
35
|
+
| # | Task | Criteria | Primary ownership | Dependencies | Status |
|
|
36
|
+
|---|---|---|---|---|---|
|
|
37
|
+
| 01 | <one outcome> | AC-01 | `src/example.ts` | - | pending |
|
|
38
|
+
|
|
39
|
+
## Review log
|
|
40
|
+
- Round 1: <findings accepted/rejected/revised>; sweep <result>.
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Each acceptance ID must map to at least one task and one proof. A task with no
|
|
44
|
+
criterion is scope drift; a criterion with no task or proof is not executable.
|
|
45
|
+
|
|
46
|
+
## `task-NN-*.md` template
|
|
47
|
+
|
|
48
|
+
Keep one exact `Status:` field. The task file is one owner's packet.
|
|
49
|
+
|
|
50
|
+
````markdown
|
|
51
|
+
# Task NN — <one observable outcome>
|
|
52
|
+
|
|
53
|
+
Status: pending
|
|
54
|
+
|
|
55
|
+
## Outcome
|
|
56
|
+
<What becomes true when this task succeeds.>
|
|
57
|
+
|
|
58
|
+
## Scope
|
|
59
|
+
- In: <exact behavior>
|
|
60
|
+
- Out: <nearby behavior deliberately excluded>
|
|
61
|
+
|
|
62
|
+
## Ownership
|
|
63
|
+
- Modify: `src/a.ts`
|
|
64
|
+
- Create: `test/a.test.ts`
|
|
65
|
+
- Read: `src/caller.ts`
|
|
66
|
+
|
|
67
|
+
## Acceptance
|
|
68
|
+
- AC-01: <task-local measurable condition>
|
|
69
|
+
|
|
70
|
+
## Dependencies
|
|
71
|
+
- <task number or `none`>
|
|
72
|
+
|
|
73
|
+
## Verification Plan
|
|
74
|
+
- Command: `<exact runnable command>`
|
|
75
|
+
- Expected: <observable success, including nonzero/negative behavior if relevant>
|
|
76
|
+
- Reachability: <entrypoint or consumer>
|
|
77
|
+
- Artifacts: <path and digest requirement, or none>
|
|
78
|
+
|
|
79
|
+
## Receipt
|
|
80
|
+
<!-- Fill only after execution; see canonical form below. -->
|
|
81
|
+
````
|
|
82
|
+
|
|
83
|
+
## Canonical inline Receipt
|
|
84
|
+
|
|
85
|
+
The completed task keeps this section at the end of the same file. Derive Base
|
|
86
|
+
and Head from the current runtime; do not invent or reuse them.
|
|
87
|
+
|
|
88
|
+
````markdown
|
|
89
|
+
## Receipt
|
|
90
|
+
|
|
91
|
+
Verification: PASS
|
|
92
|
+
Command: pnpm test -- --filter example
|
|
93
|
+
Exit: 0
|
|
94
|
+
Base: <runtime-derived base commit>
|
|
95
|
+
Head: <runtime-derived tree digest or commit>
|
|
96
|
+
```text
|
|
97
|
+
$ pnpm test -- --filter example
|
|
98
|
+
PASS example.test.ts
|
|
99
|
+
Tests: 3 passed, 3 total
|
|
100
|
+
```
|
|
101
|
+
````
|
|
102
|
+
|
|
103
|
+
The receipt is invalid when it has a placeholder, missing output fence, zero
|
|
104
|
+
executed tests where tests are required, a failure marker, nonzero exit, stale
|
|
105
|
+
Base/Head, or a bare PASS claim without the command output.
|
|
106
|
+
|
|
107
|
+
## EARS sentence patterns
|
|
108
|
+
|
|
109
|
+
Use the narrowest pattern that describes observable behavior:
|
|
110
|
+
|
|
111
|
+
1. **Ubiquitous:** `The <system> shall <response>.`
|
|
112
|
+
2. **Event-driven:** `When <trigger>, the <system> shall <response>.`
|
|
113
|
+
3. **State-driven:** `While <state>, the <system> shall <response>.`
|
|
114
|
+
4. **Unwanted behavior:** `If <fault>, the <system> shall <response>.`
|
|
115
|
+
5. **Optional feature:** `Where <feature is enabled>, the <system> shall <response>.`
|
|
116
|
+
|
|
117
|
+
Avoid implementation detail unless it is a user-approved contract. Replace
|
|
118
|
+
"fast", "robust", and "works" with a measurable threshold or observation.
|
|
119
|
+
|
|
120
|
+
## Example Mapping rule
|
|
121
|
+
|
|
122
|
+
When the expected outcome is uncertain, write a question and take it to C1 or
|
|
123
|
+
C2; do not guess. When a rule is ambiguous, add two or three examples:
|
|
124
|
+
|
|
125
|
+
```text
|
|
126
|
+
Rule: A done task has fresh executable proof.
|
|
127
|
+
Example: command exits 0 and reports 3 tests passed -> done may be proposed.
|
|
128
|
+
Example: command exits 0 but reports 0 tests -> remains unfinished.
|
|
129
|
+
Example: output is copied from an earlier session -> remains unfinished.
|
|
130
|
+
Question: which environment owns the authoritative integration run?
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
Keep examples only until they clarify a rule or acceptance criterion.
|
|
134
|
+
|
|
135
|
+
## Twelve edge-case dimensions
|
|
136
|
+
|
|
137
|
+
For each material boundary, select relevant dimensions rather than filling a
|
|
138
|
+
ceremonial matrix:
|
|
139
|
+
|
|
140
|
+
| Dimension | Probe |
|
|
141
|
+
|---|---|
|
|
142
|
+
| Input shape | empty, malformed, duplicate, maximum size |
|
|
143
|
+
| Identity | missing, wrong actor, cross-scope, replay |
|
|
144
|
+
| State | initial, partial, terminal, stale |
|
|
145
|
+
| Order | early, late, repeated, out of order |
|
|
146
|
+
| Concurrency | double writer, race, cancellation |
|
|
147
|
+
| Dependency | missing, blocked, version drift |
|
|
148
|
+
| Failure | timeout, exception, nonzero exit |
|
|
149
|
+
| Recovery | retry, resume, rollback, cleanup |
|
|
150
|
+
| Persistence | partial write, corruption, migration |
|
|
151
|
+
| Integration | caller, registration, packaging, reachability |
|
|
152
|
+
| Security/privacy | injection, traversal, secret exposure |
|
|
153
|
+
| Observability/proof | logs, artifact, negative path, provenance |
|
|
154
|
+
|
|
155
|
+
Turn a discovered risk into an EARS criterion, a task acceptance item, or a
|
|
156
|
+
verification probe. Do not duplicate it across all three.
|
|
157
|
+
|
|
158
|
+
## Quality and saturation checks
|
|
159
|
+
|
|
160
|
+
Before C2 confirm:
|
|
161
|
+
|
|
162
|
+
- every repository fact has current evidence or `[UNVERIFIED]`;
|
|
163
|
+
- every acceptance criterion maps to task and proof;
|
|
164
|
+
- task ownership does not overlap within a proposed parallel wave;
|
|
165
|
+
- dependencies are acyclic and refer to real task numbers;
|
|
166
|
+
- commands are runnable from the named work context;
|
|
167
|
+
- negative, recovery, and reachability probes exist where risk requires them;
|
|
168
|
+
- examples settle ambiguous rules rather than adding prose;
|
|
169
|
+
- the latest consistency sweep reports zero unresolved contradictions.
|
|
170
|
+
|
|
171
|
+
Stop expanding when a fresh reviewer finds no new material failure with new
|
|
172
|
+
evidence, the 12 dimensions yield no uncovered relevant boundary, and every
|
|
173
|
+
accepted C2 finding is represented exactly once.
|