cclaw-cli 0.48.27 → 0.48.29
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/dist/artifact-linter.js +16 -5
- package/dist/artifact-paths.d.ts +28 -0
- package/dist/artifact-paths.js +261 -0
- package/dist/content/contracts.js +3 -2
- package/dist/content/stage-schema.d.ts +1 -1
- package/dist/content/stage-schema.js +71 -15
- package/dist/content/stages/_lint-metadata/index.d.ts +2 -0
- package/dist/content/stages/_lint-metadata/index.js +79 -0
- package/dist/content/stages/brainstorm.js +140 -139
- package/dist/content/stages/design.js +243 -242
- package/dist/content/stages/plan.js +1 -2
- package/dist/content/stages/review.js +0 -1
- package/dist/content/stages/schema-types.d.ts +22 -3
- package/dist/content/stages/scope.js +215 -207
- package/dist/content/stages/ship.js +0 -7
- package/dist/content/stages/spec.js +2 -3
- package/dist/content/stages/tdd.d.ts +2 -2
- package/dist/content/stages/tdd.js +1 -3
- package/dist/gate-evidence.js +7 -17
- package/dist/internal/advance-stage.js +9 -3
- package/package.json +1 -1
|
@@ -2,255 +2,256 @@
|
|
|
2
2
|
// DESIGN — reference: gstack Eng review
|
|
3
3
|
// ---------------------------------------------------------------------------
|
|
4
4
|
export const DESIGN = {
|
|
5
|
+
schemaShape: "v2",
|
|
5
6
|
stage: "design",
|
|
6
7
|
complexityTier: "deep",
|
|
7
8
|
skillFolder: "engineering-design-lock",
|
|
8
9
|
skillName: "engineering-design-lock",
|
|
9
10
|
skillDescription: "Engineering lock-in stage. Build a concrete technical spine before spec and planning, with section-by-section interactive review.",
|
|
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
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
"
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
"
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
"Data Flow",
|
|
148
|
-
"Failure Modes and Mitigation",
|
|
149
|
-
"Performance Budget",
|
|
150
|
-
"One issue at a time"
|
|
151
|
-
],
|
|
152
|
-
artifactFile: "03-design.md",
|
|
153
|
-
next: "spec",
|
|
154
|
-
reviewSections: [
|
|
155
|
-
{
|
|
156
|
-
title: "Architecture Review",
|
|
157
|
-
evaluationPoints: [
|
|
158
|
-
"System design, boundaries, coupling, and bottlenecks",
|
|
159
|
-
"For each new codepath: one realistic production failure scenario"
|
|
160
|
-
],
|
|
161
|
-
stopGate: true
|
|
162
|
-
},
|
|
163
|
-
{
|
|
164
|
-
title: "Security & Threat Model",
|
|
165
|
-
evaluationPoints: [
|
|
166
|
-
"Trust boundaries, authz rules, and sensitive data flows are explicit",
|
|
167
|
-
"Mitigation ownership and residual risk are documented"
|
|
168
|
-
],
|
|
169
|
-
stopGate: true
|
|
170
|
-
},
|
|
171
|
-
{
|
|
172
|
-
title: "Code Quality Review",
|
|
173
|
-
evaluationPoints: [
|
|
174
|
-
"Code organization and module structure",
|
|
175
|
-
"DRY violations — flag aggressively",
|
|
176
|
-
"Error handling patterns and missing edge cases",
|
|
177
|
-
"Over-engineered or under-engineered areas",
|
|
178
|
-
"Existing diagrams in touched files — still accurate?"
|
|
179
|
-
],
|
|
180
|
-
stopGate: true
|
|
181
|
-
},
|
|
182
|
-
{
|
|
183
|
-
title: "Data Flow & Interaction Edge Cases",
|
|
184
|
-
evaluationPoints: [
|
|
185
|
-
"Happy/nil/empty/error paths are explicit",
|
|
186
|
-
"Interaction edge cases and Standard+ shadow/error diagrams are present",
|
|
187
|
-
"Error-flow includes rescue path and user-visible outcome"
|
|
188
|
-
],
|
|
189
|
-
stopGate: true
|
|
190
|
-
},
|
|
191
|
-
{
|
|
192
|
-
title: "Test Review",
|
|
193
|
-
evaluationPoints: [
|
|
194
|
-
"Diagram every new UX flow, data flow, codepath, background job, integration, error path",
|
|
195
|
-
"For each: what type of test covers it? Does one exist? What is the gap?",
|
|
196
|
-
"Coverage expectations: unit, integration, e2e split"
|
|
197
|
-
],
|
|
198
|
-
stopGate: true
|
|
199
|
-
},
|
|
200
|
-
{
|
|
201
|
-
title: "Performance Review",
|
|
202
|
-
evaluationPoints: [
|
|
203
|
-
"N+1 queries and database access patterns",
|
|
204
|
-
"Memory-usage concerns",
|
|
205
|
-
"Caching opportunities",
|
|
206
|
-
"Slow or high-complexity code paths",
|
|
207
|
-
"What breaks at 10x load? At 100x?"
|
|
208
|
-
],
|
|
209
|
-
stopGate: true
|
|
210
|
-
},
|
|
211
|
-
{
|
|
212
|
-
title: "Observability & Debuggability",
|
|
213
|
-
evaluationPoints: [
|
|
214
|
-
"Logs/metrics/traces exist for critical failure modes",
|
|
215
|
-
"Alerting and debug path from symptom to root cause are documented"
|
|
11
|
+
philosophy: {
|
|
12
|
+
hardGate: "Do NOT write implementation code. This stage produces design decisions and architecture documents only. No code changes, no scaffolding, no test files.",
|
|
13
|
+
ironLaw: "NO DESIGN DECISION WITHOUT A LABELED DIAGRAM, A REJECTED ALTERNATIVE, AND A NAMED FAILURE MODE.",
|
|
14
|
+
purpose: "Lock architecture, data flow, failure modes, and test/performance expectations through rigorous interactive review.",
|
|
15
|
+
whenToUse: [
|
|
16
|
+
"After scope agreement approval",
|
|
17
|
+
"Before writing final spec and execution plan",
|
|
18
|
+
"When architecture risks need explicit treatment"
|
|
19
|
+
],
|
|
20
|
+
whenNotToUse: [
|
|
21
|
+
"Scope mode and boundaries are still unresolved",
|
|
22
|
+
"The change is docs-only or metadata-only with no architecture impact",
|
|
23
|
+
"Implementation has already started and requires review instead of design lock"
|
|
24
|
+
],
|
|
25
|
+
commonRationalizations: [
|
|
26
|
+
"Architecture deferred to implementation phase",
|
|
27
|
+
"Missing data-flow edge cases",
|
|
28
|
+
"No interaction-edge-case matrix (double-click, navigate-away, stale-state, large-result)",
|
|
29
|
+
"No performance budget for critical path",
|
|
30
|
+
"Failure mode table omits rescue path or user-visible impact",
|
|
31
|
+
"Skipping security/observability/deployment review for non-trivial change",
|
|
32
|
+
"Skipping outside-voice review loop and treating first draft as final",
|
|
33
|
+
"Batching multiple design issues into one question",
|
|
34
|
+
"Agreeing with user's architecture choice without evaluating alternatives",
|
|
35
|
+
"No NOT-in-scope output section",
|
|
36
|
+
"Design decisions made without reading the actual code first"
|
|
37
|
+
]
|
|
38
|
+
},
|
|
39
|
+
executionModel: {
|
|
40
|
+
checklist: [
|
|
41
|
+
"Trivial-Change Escape Hatch — If scope artifact shows ≤3 files, zero new interfaces, and no cross-module data flow, skip full review sections. Produce a mini-design: one paragraph of rationale, list of changed files, one risk to watch. Proceed to spec.",
|
|
42
|
+
"Parallel Research Fleet — run `research/research-fleet.md` before architecture lock. Fleet size scales by complexity: Lightweight=1 lens (pitfalls), Standard=2 lenses (architecture+pitfalls), Deep=4 lenses. Record findings in `.cclaw/artifacts/02a-research.md` and summarize resulting decisions in `## Research Fleet Synthesis`.",
|
|
43
|
+
"Design Doc Check — read existing design docs, scope artifact, brainstorm artifact. If a design doc exists that covers this area, check for 'Supersedes:' and use the latest. Use upstream artifacts as source of truth.",
|
|
44
|
+
"Codebase Investigation — Before any design decision, read the actual code in the blast radius. List every file that will be touched, its current responsibilities, and existing patterns (error handling, naming, test style). Design must conform to discovered patterns, not impose new ones without justification.",
|
|
45
|
+
"Step 0: Scope Challenge — what existing code solves sub-problems? Minimum change set? Complexity check: 8+ files or 2+ new services = complexity smell → flag for possible scope reduction.",
|
|
46
|
+
"Search Before Building — For each technical choice (library, pattern, architecture), search for existing solutions. Label findings: Layer 1 (exact match), Layer 2 (partial match, needs adaptation), Layer 3 (inspiration only), EUREKA (unexpected perfect solution). Default to existing before custom.",
|
|
47
|
+
"Architecture Review — lock component boundaries and one realistic failure scenario per new codepath. **Mandatory diagrams:** architecture for all tiers; Standard/Deep adds Data-Flow Shadow Paths and Error Flow.",
|
|
48
|
+
"Security & Threat Model Review — trust boundaries, authn/authz, input validation, secrets handling, data exposure risks, abuse cases, and mitigation ownership.",
|
|
49
|
+
"Code Quality Review — code organization, DRY violations, error handling patterns, over/under-engineering assessment. Include stale-diagram audit for touched files.",
|
|
50
|
+
"Test Review — diagram every new flow, data path, error path. For each: what test type covers it? Does one exist? What is the gap? Produce test plan artifact.",
|
|
51
|
+
"Performance Review — N+1 queries, memory concerns, caching opportunities, slow code paths. What breaks at 10x load? At 100x?",
|
|
52
|
+
"Observability & Debuggability Review — logging, metrics, traces, alerts, and on-call diagnosis path for each critical failure mode.",
|
|
53
|
+
"Deployment & Rollout Review — migration sequencing, flag strategy, rollback plan, compatibility window, and post-deploy verification steps.",
|
|
54
|
+
"Parallelization Strategy — If multiple independent modules, produce dependency table: which can be built in parallel? Where are conflict risks? Flag shared-state modules.",
|
|
55
|
+
"Outside Voice + Spec Review Loop — run adversarial second-opinion review, reconcile findings, and iterate up to 3 cycles or until quality score >= 0.8.",
|
|
56
|
+
"Unresolved Decisions — List any design decisions that could not be resolved in this session. For each: what information is missing? Who can provide it? What is the default if no answer comes?",
|
|
57
|
+
"Distribution Check — If the plan creates new artifact types (packages, CLI tools, configs), document the build/publish story. How does it reach the user?",
|
|
58
|
+
"Deferred Items Cross-Reference — Collect every item explicitly deferred during design review. Each must appear in the Unresolved Decisions table or in the upstream scope artifact's deferred list. No deferred item may exist only in conversation — it must be written down."
|
|
59
|
+
],
|
|
60
|
+
interactionProtocol: [
|
|
61
|
+
"Review architecture decisions section-by-section.",
|
|
62
|
+
"For EACH issue found in a review section, present it ONE AT A TIME. Do NOT batch multiple issues.",
|
|
63
|
+
"For each issue: use the Decision Protocol — describe concretely with file/line references, present labeled options (A/B/C) with trade-offs, effort estimate (S/M/L/XL), risk level (Low/Med/High), and mark one as (recommended). Do NOT use a numeric Completeness rubric. If the harness's native structured-ask tool is available (`AskUserQuestion` / `AskQuestion` / `question` / `request_user_input`), send exactly ONE question per call and fall back to plain-text letters on schema/tool failure.",
|
|
64
|
+
"Only proceed to the next review section after ALL issues in the current section are resolved.",
|
|
65
|
+
"If a section has no issues, say 'No issues found' and move on.",
|
|
66
|
+
"Do not skip failure-mode mapping.",
|
|
67
|
+
"Use Failure Mode Table columns in fixed order: Method, Exception, Rescue, UserSees. Silent user impact without rescue is treated as critical.",
|
|
68
|
+
"For design baseline approval: present the full baseline. **STOP.** Do NOT proceed until user explicitly approves the design.",
|
|
69
|
+
"**STOP BEFORE ADVANCE.** Mandatory delegation `planner` must be marked completed or explicitly waived in `.cclaw/state/delegation-log.json`. Then close the stage via `node .cclaw/hooks/stage-complete.mjs design` (do not hand-edit `.cclaw/state/flow-state.json`).",
|
|
70
|
+
"Take a firm position on every recommendation. Do NOT hedge with 'it depends' or 'you could do either'. State your opinion, then justify it.",
|
|
71
|
+
"Use pushback for weak framing: 'small changes' on shared interfaces can still have large blast radius.",
|
|
72
|
+
"When the user's proposed architecture is suboptimal, say so directly. Offer the alternative with concrete trade-offs, do not bury criticism in praise.",
|
|
73
|
+
"When encountering ambiguity, classify it before acting: (A) ask user for missing info, (B) enumerate interpretations and pick one with justification, (C) propose hypothesis with validation path. Do NOT silently resolve ambiguity.",
|
|
74
|
+
"Before final approval, run outside-voice review loop and reconcile each finding (accept/reject/defer) with rationale.",
|
|
75
|
+
"Bound review-loop retries: max 3 iterations or early stop at quality score >= 0.8."
|
|
76
|
+
],
|
|
77
|
+
process: [
|
|
78
|
+
"Read upstream artifacts (brainstorm, scope).",
|
|
79
|
+
"Run the research fleet playbook with tiered fleet size and write `.cclaw/artifacts/02a-research.md` before locking architecture choices.",
|
|
80
|
+
"Investigate codebase: read files in blast radius, catalogue current patterns and responsibilities.",
|
|
81
|
+
"Run Step 0 scope challenge: existing code leverage, minimum change set, complexity check.",
|
|
82
|
+
"Walk through each review section interactively.",
|
|
83
|
+
"Define architecture boundaries and ownership.",
|
|
84
|
+
"Describe data flow and state transitions with edge paths + interaction edge-case matrix.",
|
|
85
|
+
"Map failure modes and recovery strategy using Method/Exception/Rescue/UserSees table.",
|
|
86
|
+
"Add security, observability, and deployment reviews for Standard+ changes.",
|
|
87
|
+
"Run stale-diagram audit in touched files and reconcile drift.",
|
|
88
|
+
"Define test coverage strategy and performance budget.",
|
|
89
|
+
"Produce required outputs: NOT-in-scope section, What-already-exists section, architecture + shadow/error diagrams, failure mode table.",
|
|
90
|
+
"Run outside-voice spec review loop (up to 3 iterations, quality score target >= 0.8).",
|
|
91
|
+
"Produce completion dashboard: status per review section, critical/open gap counts, decision count, unresolved items.",
|
|
92
|
+
"Write design lock artifact for downstream spec/plan."
|
|
93
|
+
],
|
|
94
|
+
requiredGates: [
|
|
95
|
+
{ id: "design_research_complete", description: "Parallel research artifact is complete and synthesized into design decisions." },
|
|
96
|
+
{ id: "design_architecture_locked", description: "Architecture boundaries are explicit and approved." },
|
|
97
|
+
{ id: "design_data_flow_mapped", description: "Data/state flow includes edge-case paths." },
|
|
98
|
+
{ id: "design_failure_modes_mapped", description: "Failure modes and mitigations are documented." },
|
|
99
|
+
{ id: "design_test_and_perf_defined", description: "Test strategy and performance budget are defined." }
|
|
100
|
+
],
|
|
101
|
+
requiredEvidence: [
|
|
102
|
+
"Research artifact written to `.cclaw/artifacts/02a-research.md` with stack/features/architecture/pitfalls sections plus synthesis.",
|
|
103
|
+
"Artifact written to `.cclaw/artifacts/03-design-<slug>.md`.",
|
|
104
|
+
"Failure-mode table exists in Method/Exception/Rescue/UserSees format.",
|
|
105
|
+
"Data-flow shadow and error-flow diagrams are present for Standard+ complexity.",
|
|
106
|
+
"Security & threat model findings are documented with mitigations.",
|
|
107
|
+
"Observability and deployment plans are explicit for critical flows.",
|
|
108
|
+
"Outside-voice findings and dispositions are recorded (accept/reject/defer).",
|
|
109
|
+
"Spec review loop summary includes iteration count and quality score trajectory.",
|
|
110
|
+
"Test strategy includes unit/integration/e2e expectations.",
|
|
111
|
+
"NOT-in-scope section produced.",
|
|
112
|
+
"What-already-exists section produced.",
|
|
113
|
+
"Completion dashboard lists review section status, critical/open gap counts, decision count, and unresolved items (or 'None')."
|
|
114
|
+
],
|
|
115
|
+
inputs: ["scope agreement artifact", "system constraints", "non-functional requirements"],
|
|
116
|
+
requiredContext: [
|
|
117
|
+
"parallel research synthesis from `.cclaw/artifacts/02a-research.md`",
|
|
118
|
+
"existing architecture and boundaries",
|
|
119
|
+
"operational constraints",
|
|
120
|
+
"security and reliability expectations"
|
|
121
|
+
],
|
|
122
|
+
researchPlaybooks: [
|
|
123
|
+
"research/research-fleet.md",
|
|
124
|
+
"research/framework-docs-lookup.md",
|
|
125
|
+
"research/best-practices-lookup.md"
|
|
126
|
+
],
|
|
127
|
+
blockers: [
|
|
128
|
+
"architecture ambiguity remains",
|
|
129
|
+
"failure modes not mapped",
|
|
130
|
+
"test/performance targets missing"
|
|
131
|
+
],
|
|
132
|
+
exitCriteria: [
|
|
133
|
+
"design baseline approved",
|
|
134
|
+
"all review sections completed",
|
|
135
|
+
"required gates marked satisfied",
|
|
136
|
+
"completion dashboard present with all review-section statuses",
|
|
137
|
+
"artifact complete for spec handoff"
|
|
138
|
+
]
|
|
139
|
+
},
|
|
140
|
+
artifactRules: {
|
|
141
|
+
artifactFile: "03-design-<slug>.md",
|
|
142
|
+
completionStatus: ["DONE", "DONE_WITH_CONCERNS", "BLOCKED"],
|
|
143
|
+
crossStageTrace: {
|
|
144
|
+
readsFrom: [
|
|
145
|
+
".cclaw/artifacts/01-brainstorm-<slug>.md",
|
|
146
|
+
".cclaw/artifacts/02-scope-<slug>.md",
|
|
147
|
+
".cclaw/artifacts/02a-research.md"
|
|
216
148
|
],
|
|
217
|
-
|
|
149
|
+
writesTo: [".cclaw/artifacts/03-design-<slug>.md"],
|
|
150
|
+
traceabilityRule: "Every architecture decision must trace to a scope boundary. Every downstream spec requirement must trace to a design decision."
|
|
218
151
|
},
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
"
|
|
232
|
-
"
|
|
233
|
-
".
|
|
152
|
+
artifactValidation: [
|
|
153
|
+
{ section: "Research Fleet Synthesis", required: true, validationRule: "Must summarize all four lenses (stack/features/architecture/pitfalls) and map findings to concrete design decisions." },
|
|
154
|
+
{ section: "Codebase Investigation", required: false, validationRule: "Must list blast-radius files with current responsibilities and discovered patterns." },
|
|
155
|
+
{ section: "Search Before Building", required: false, validationRule: "For each technical choice: Layer 1 (exact match), Layer 2 (partial match), Layer 3 (inspiration), EUREKA labels with reuse-first default." },
|
|
156
|
+
{ section: "Architecture Boundaries", required: true, validationRule: "Must list component boundaries with ownership." },
|
|
157
|
+
{ section: "Architecture Diagram", required: true, validationRule: "At least one diagram (ASCII, Mermaid, or image) showing component boundaries and data flow direction. Diagram must: (1) label every node with a concrete component name (no generic 'Service A/B'), (2) label every arrow with the action or message (no unlabeled arrows), (3) mark direction of data flow explicitly, (4) distinguish synchronous from asynchronous edges (e.g. solid vs dashed, or `sync:` / `async:` prefix), (5) include at least one failure/degraded edge line that contains an arrow plus a failure keyword (`timeout`, `error`, `fallback`, `degraded`, `retry`, etc.). Standard/Deep complexity must also include `Data-Flow Shadow Paths` and `Error Flow Diagram` sections." },
|
|
158
|
+
{ section: "Data Flow", required: false, validationRule: "Must include happy path, nil input, empty input, upstream error paths, plus interaction edge-case matrix (double-click, navigate-away, stale-state, large-result, background-job abandonment)." },
|
|
159
|
+
{ section: "Failure Mode Table", required: true, validationRule: "Use Method/Exception/Rescue/UserSees columns and treat silent user impact without rescue as critical." },
|
|
160
|
+
{ section: "Security & Threat Model", required: false, validationRule: "Must list trust boundaries, abuse/failure scenarios, mitigations, and residual risks." },
|
|
161
|
+
{ section: "Test Strategy", required: false, validationRule: "Must define unit/integration/e2e expectations with coverage targets." },
|
|
162
|
+
{ section: "Performance Budget", required: false, validationRule: "For each critical path: metric name, target threshold, and measurement method." },
|
|
163
|
+
{ section: "What Already Exists", required: false, validationRule: "For each sub-problem: existing code/library found (Layer 1-3/EUREKA label), reuse decision, and adaptation needed." },
|
|
164
|
+
{ section: "NOT in scope", required: false, validationRule: "Work considered and explicitly deferred with one-line rationale." },
|
|
165
|
+
{ section: "Parallelization Strategy", required: false, validationRule: "If multi-module: dependency table, parallel lanes, conflict flags." },
|
|
166
|
+
{ section: "Unresolved Decisions", required: false, validationRule: "If any: what info is missing, who provides it, default if unanswered." },
|
|
167
|
+
{ section: "Completion Dashboard", required: true, validationRule: "Lists every review section with status (clear / issues-found-resolved / issues-open), critical/open gap counts, decision count, and unresolved items (or 'None')." }
|
|
168
|
+
],
|
|
169
|
+
trivialOverrideSections: ["Architecture Boundaries", "NOT in scope", "Completion Dashboard"]
|
|
170
|
+
},
|
|
171
|
+
reviewLens: {
|
|
172
|
+
outputs: [
|
|
173
|
+
"parallel research synthesis artifact",
|
|
174
|
+
"architecture lock",
|
|
175
|
+
"risk and failure map",
|
|
176
|
+
"test and performance baseline",
|
|
177
|
+
"NOT-in-scope section",
|
|
178
|
+
"What-already-exists section",
|
|
179
|
+
"design completion dashboard"
|
|
234
180
|
],
|
|
235
|
-
|
|
236
|
-
|
|
181
|
+
reviewSections: [
|
|
182
|
+
{
|
|
183
|
+
title: "Architecture Review",
|
|
184
|
+
evaluationPoints: [
|
|
185
|
+
"System design, boundaries, coupling, and bottlenecks",
|
|
186
|
+
"For each new codepath: one realistic production failure scenario"
|
|
187
|
+
],
|
|
188
|
+
stopGate: true
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
title: "Security & Threat Model",
|
|
192
|
+
evaluationPoints: [
|
|
193
|
+
"Trust boundaries, authz rules, and sensitive data flows are explicit",
|
|
194
|
+
"Mitigation ownership and residual risk are documented"
|
|
195
|
+
],
|
|
196
|
+
stopGate: true
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
title: "Code Quality Review",
|
|
200
|
+
evaluationPoints: [
|
|
201
|
+
"Code organization and module structure",
|
|
202
|
+
"DRY violations — flag aggressively",
|
|
203
|
+
"Error handling patterns and missing edge cases",
|
|
204
|
+
"Over-engineered or under-engineered areas",
|
|
205
|
+
"Existing diagrams in touched files — still accurate?"
|
|
206
|
+
],
|
|
207
|
+
stopGate: true
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
title: "Data Flow & Interaction Edge Cases",
|
|
211
|
+
evaluationPoints: [
|
|
212
|
+
"Happy/nil/empty/error paths are explicit",
|
|
213
|
+
"Interaction edge cases and Standard+ shadow/error diagrams are present",
|
|
214
|
+
"Error-flow includes rescue path and user-visible outcome"
|
|
215
|
+
],
|
|
216
|
+
stopGate: true
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
title: "Test Review",
|
|
220
|
+
evaluationPoints: [
|
|
221
|
+
"Diagram every new UX flow, data flow, codepath, background job, integration, error path",
|
|
222
|
+
"For each: what type of test covers it? Does one exist? What is the gap?",
|
|
223
|
+
"Coverage expectations: unit, integration, e2e split"
|
|
224
|
+
],
|
|
225
|
+
stopGate: true
|
|
226
|
+
},
|
|
227
|
+
{
|
|
228
|
+
title: "Performance Review",
|
|
229
|
+
evaluationPoints: [
|
|
230
|
+
"N+1 queries and database access patterns",
|
|
231
|
+
"Memory-usage concerns",
|
|
232
|
+
"Caching opportunities",
|
|
233
|
+
"Slow or high-complexity code paths",
|
|
234
|
+
"What breaks at 10x load? At 100x?"
|
|
235
|
+
],
|
|
236
|
+
stopGate: true
|
|
237
|
+
},
|
|
238
|
+
{
|
|
239
|
+
title: "Observability & Debuggability",
|
|
240
|
+
evaluationPoints: [
|
|
241
|
+
"Logs/metrics/traces exist for critical failure modes",
|
|
242
|
+
"Alerting and debug path from symptom to root cause are documented"
|
|
243
|
+
],
|
|
244
|
+
stopGate: true
|
|
245
|
+
},
|
|
246
|
+
{
|
|
247
|
+
title: "Deployment & Rollout Review",
|
|
248
|
+
evaluationPoints: [
|
|
249
|
+
"Migration sequencing, rollout/rollback, and compatibility window are explicit",
|
|
250
|
+
"Post-deploy verification and distribution/build story are documented"
|
|
251
|
+
],
|
|
252
|
+
stopGate: true
|
|
253
|
+
}
|
|
254
|
+
]
|
|
237
255
|
},
|
|
238
|
-
|
|
239
|
-
{ section: "Research Fleet Synthesis", required: true, validationRule: "Must summarize all four lenses (stack/features/architecture/pitfalls) and map findings to concrete design decisions." },
|
|
240
|
-
{ section: "Codebase Investigation", required: false, validationRule: "Must list blast-radius files with current responsibilities and discovered patterns." },
|
|
241
|
-
{ section: "Search Before Building", required: false, validationRule: "For each technical choice: Layer 1 (exact match), Layer 2 (partial match), Layer 3 (inspiration), EUREKA labels with reuse-first default." },
|
|
242
|
-
{ section: "Architecture Boundaries", required: true, validationRule: "Must list component boundaries with ownership." },
|
|
243
|
-
{ section: "Architecture Diagram", required: true, validationRule: "At least one diagram (ASCII, Mermaid, or image) showing component boundaries and data flow direction. Diagram must: (1) label every node with a concrete component name (no generic 'Service A/B'), (2) label every arrow with the action or message (no unlabeled arrows), (3) mark direction of data flow explicitly, (4) distinguish synchronous from asynchronous edges (e.g. solid vs dashed, or `sync:` / `async:` prefix), (5) include at least one failure/degraded edge line that contains an arrow plus a failure keyword (`timeout`, `error`, `fallback`, `degraded`, `retry`, etc.). Standard/Deep complexity must also include `Data-Flow Shadow Paths` and `Error Flow Diagram` sections." },
|
|
244
|
-
{ section: "Data Flow", required: false, validationRule: "Must include happy path, nil input, empty input, upstream error paths, plus interaction edge-case matrix (double-click, navigate-away, stale-state, large-result, background-job abandonment)." },
|
|
245
|
-
{ section: "Failure Mode Table", required: true, validationRule: "Use Method/Exception/Rescue/UserSees columns and treat silent user impact without rescue as critical." },
|
|
246
|
-
{ section: "Security & Threat Model", required: false, validationRule: "Must list trust boundaries, abuse/failure scenarios, mitigations, and residual risks." },
|
|
247
|
-
{ section: "Test Strategy", required: false, validationRule: "Must define unit/integration/e2e expectations with coverage targets." },
|
|
248
|
-
{ section: "Performance Budget", required: false, validationRule: "For each critical path: metric name, target threshold, and measurement method." },
|
|
249
|
-
{ section: "What Already Exists", required: false, validationRule: "For each sub-problem: existing code/library found (Layer 1-3/EUREKA label), reuse decision, and adaptation needed." },
|
|
250
|
-
{ section: "NOT in scope", required: false, validationRule: "Work considered and explicitly deferred with one-line rationale." },
|
|
251
|
-
{ section: "Parallelization Strategy", required: false, validationRule: "If multi-module: dependency table, parallel lanes, conflict flags." },
|
|
252
|
-
{ section: "Unresolved Decisions", required: false, validationRule: "If any: what info is missing, who provides it, default if unanswered." },
|
|
253
|
-
{ section: "Completion Dashboard", required: true, validationRule: "Lists every review section with status (clear / issues-found-resolved / issues-open), critical/open gap counts, decision count, and unresolved items (or 'None')." }
|
|
254
|
-
],
|
|
255
|
-
trivialOverrideSections: ["Architecture Boundaries", "NOT in scope", "Completion Dashboard"]
|
|
256
|
+
next: "spec"
|
|
256
257
|
};
|
|
@@ -97,7 +97,6 @@ export const PLAN = {
|
|
|
97
97
|
"Locked decisions are missing or not mapped",
|
|
98
98
|
"Scope-reduction language appears without explicit approved defer decision"
|
|
99
99
|
],
|
|
100
|
-
policyNeedles: ["WAIT_FOR_CONFIRM", "Task Graph", "Dependency Batches", "Acceptance Mapping", "verification steps", "Locked Decision Coverage"],
|
|
101
100
|
artifactFile: "05-plan.md",
|
|
102
101
|
next: "tdd",
|
|
103
102
|
reviewSections: [
|
|
@@ -136,7 +135,7 @@ export const PLAN = {
|
|
|
136
135
|
],
|
|
137
136
|
completionStatus: ["DONE", "DONE_WITH_CONCERNS", "BLOCKED"],
|
|
138
137
|
crossStageTrace: {
|
|
139
|
-
readsFrom: [".cclaw/artifacts/04-spec.md", ".cclaw/artifacts/03-design
|
|
138
|
+
readsFrom: [".cclaw/artifacts/04-spec.md", ".cclaw/artifacts/03-design-<slug>.md", ".cclaw/artifacts/02-scope-<slug>.md"],
|
|
140
139
|
writesTo: [".cclaw/artifacts/05-plan.md"],
|
|
141
140
|
traceabilityRule: "Every task must trace to a spec acceptance criterion. Every locked scope decision (D-XX) must trace to at least one plan task or explicit defer rationale. Every downstream RED test must trace to a plan task."
|
|
142
141
|
},
|
|
@@ -97,7 +97,6 @@ export const REVIEW = {
|
|
|
97
97
|
"Batching multiple findings into one report without individual resolution",
|
|
98
98
|
"Skipping Layer 2 sections because Layer 1 passed"
|
|
99
99
|
],
|
|
100
|
-
policyNeedles: ["Layer 1", "Layer 2", "Critical", "Review Army", "Ready to Ship", "ROUTE_BACK_TO_TDD", "One issue at a time"],
|
|
101
100
|
artifactFile: "07-review.md",
|
|
102
101
|
next: "ship",
|
|
103
102
|
reviewSections: [
|