cclaw-cli 3.0.0 → 5.0.0
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/brainstorm.js +51 -2
- package/dist/artifact-linter/design.js +14 -3
- package/dist/artifact-linter/review-army.d.ts +25 -0
- package/dist/artifact-linter/review-army.js +155 -0
- package/dist/artifact-linter/review.js +13 -0
- package/dist/artifact-linter/scope.js +27 -48
- package/dist/artifact-linter/shared.d.ts +98 -11
- package/dist/artifact-linter/shared.js +280 -113
- package/dist/artifact-linter.d.ts +12 -2
- package/dist/artifact-linter.js +29 -13
- package/dist/content/core-agents.js +6 -1
- package/dist/content/examples.js +8 -0
- package/dist/content/hooks.js +2 -1
- package/dist/content/idea.js +14 -2
- package/dist/content/review-prompts.js +3 -3
- package/dist/content/skills-elicitation.js +61 -20
- package/dist/content/skills.js +19 -6
- package/dist/content/stage-schema.js +46 -18
- package/dist/content/stages/_lint-metadata/index.js +1 -2
- package/dist/content/stages/brainstorm.js +6 -3
- package/dist/content/stages/design.js +13 -12
- package/dist/content/stages/plan.js +1 -1
- package/dist/content/stages/review.js +21 -21
- package/dist/content/stages/schema-types.d.ts +9 -0
- package/dist/content/stages/scope.js +22 -20
- package/dist/content/stages/spec.js +3 -3
- package/dist/content/stages/tdd.js +1 -0
- package/dist/content/templates.d.ts +8 -1
- package/dist/content/templates.js +115 -43
- package/dist/flow-state.d.ts +12 -0
- package/dist/gate-evidence.d.ts +37 -1
- package/dist/gate-evidence.js +37 -3
- package/dist/harness-adapters.js +8 -0
- package/dist/install.js +22 -11
- package/dist/internal/advance-stage/advance.d.ts +1 -0
- package/dist/internal/advance-stage/advance.js +5 -2
- package/dist/internal/advance-stage/parsers.d.ts +8 -0
- package/dist/internal/advance-stage/parsers.js +27 -1
- package/dist/internal/advance-stage/start-flow.js +13 -0
- package/dist/run-persistence.js +14 -2
- package/package.json +1 -1
|
@@ -18,18 +18,38 @@ export function adaptiveElicitationSkillMarkdown() {
|
|
|
18
18
|
const budgetTable = renderQuestionBudgetHintTable();
|
|
19
19
|
return `---
|
|
20
20
|
name: adaptive-elicitation
|
|
21
|
-
description: "Harness-native one-question-at-a-time dialogue for brainstorm/scope/design with stop signals, smart-skip, and append-only Q&A logging."
|
|
21
|
+
description: "Harness-native one-question-at-a-time dialogue for brainstorm/scope/design with stop signals, smart-skip, and append-only Q&A logging. Walking forcing questions in order is mandatory; the linter blocks stage-complete when Q&A Log is below floor."
|
|
22
22
|
---
|
|
23
23
|
|
|
24
24
|
# Adaptive Elicitation
|
|
25
25
|
|
|
26
26
|
Pinned anchor: "Don't tell it what to do, give it success criteria and watch it go."
|
|
27
27
|
|
|
28
|
-
##
|
|
28
|
+
## Anti-pattern (BAD examples — never do these)
|
|
29
|
+
|
|
30
|
+
These behaviors are the exact reason this skill exists. The linter will block your stage-complete if you do them.
|
|
31
|
+
|
|
32
|
+
- **Bad**: User asks for a "simple web app" -> agent asks 1 question about stack -> 1 question about auth -> drafts the brainstorm artifact and asks for approval.
|
|
33
|
+
- **Good**: User asks for a "simple web app" -> agent asks Q1 (what pain) -> Q2 (direct path) -> Q3 (do-nothing cost) -> Q4 (first operator/user) -> Q5 (no-go boundaries) -> self-eval: clear -> drafts the brainstorm artifact.
|
|
34
|
+
|
|
35
|
+
- **Bad**: Agent immediately dispatches a subagent (\`product-discovery\`, \`critic\`, \`planner\`) at the start of brainstorm/scope/design to "gather context" before any user dialogue.
|
|
36
|
+
- **Good**: Agent walks the Q&A loop with the user first; subagent dispatch happens only after the user approves the elicitation outcome.
|
|
37
|
+
|
|
38
|
+
- **Bad**: Agent batches 3-5 grill questions into one large message and asks the user to answer them all at once.
|
|
39
|
+
- **Good**: Agent asks one grill question, waits, logs the answer, asks the next.
|
|
40
|
+
|
|
41
|
+
- **Bad**: Agent skips forcing questions because it "already has a good idea" of the answer.
|
|
42
|
+
- **Good**: Agent asks the forcing question; if the user's reply confirms the assumption, log it as \`asked (confirmed assumption)\` and move on. Do not silently skip.
|
|
43
|
+
|
|
44
|
+
## HARD-GATE (machine-enforced)
|
|
45
|
+
|
|
29
46
|
- User does not run cclaw manually. Do not tell the user to run CLI commands for answers.
|
|
30
47
|
- Ask exactly one question per turn and wait for the answer before asking the next one.
|
|
31
48
|
- Use harness-native question tools first; prose fallback is allowed only when the tool is unavailable.
|
|
32
49
|
- Keep a running Q&A trace in the active artifact under \`## Q&A Log\` in \`${RUNTIME_ROOT}/artifacts/\` as append-only rows.
|
|
50
|
+
- **Convergence floor**: do NOT advance the stage (do NOT call \`stage-complete.mjs\`) until Q&A converges. Convergence is reached when ANY of: (a) all forcing-question topics are addressed in \`## Q&A Log\`, (b) the last 2 substantive rows produce no decision-changing impact (\`skip\`/\`continue\`/\`no-change\`/\`done\`), or (c) an explicit user stop-signal row is recorded. The linter rule \`qa_log_unconverged\` enforces this; \`stage-complete\` will fail otherwise. Wave 23 (v5.0.0) replaced the fixed-count floor with this convergence detector.
|
|
51
|
+
- **NEVER run shell hash commands** (\`shasum\`, \`sha256sum\`, \`md5sum\`, \`Get-FileHash\`, \`certutil\`, etc.) to compute artifact hashes. If a linter ever asks you for a hash, that is a linter bug — report failure and stop, do not auto-fix in bash.
|
|
52
|
+
- **NEVER paste cclaw command lines into chat** (e.g. \`node .cclaw/hooks/stage-complete.mjs ... --evidence-json '{...}'\`). Run them via the tool layer; report only the resulting summary. The user does not run cclaw manually and seeing the command line is noise.
|
|
33
53
|
|
|
34
54
|
## Harness Question Surface
|
|
35
55
|
|
|
@@ -43,67 +63,84 @@ If unavailable, ask one concise prose question and explicitly wait for chat answ
|
|
|
43
63
|
|
|
44
64
|
## Core Protocol
|
|
45
65
|
|
|
46
|
-
1. Ask one decision-changing question.
|
|
66
|
+
1. Ask one decision-changing question via the harness-native question tool.
|
|
47
67
|
2. Wait for the answer.
|
|
48
68
|
3. Append one row to \`## Q&A Log\`: \`Turn | Question | User answer (1-line) | Decision impact\`.
|
|
49
69
|
4. Self-evaluate:
|
|
50
70
|
- What did I learn?
|
|
51
71
|
- Is context enough to draft now? (yes/no + reason)
|
|
52
|
-
-
|
|
53
|
-
|
|
72
|
+
- Have I covered all stage forcing questions in order? (yes/no + which remain)
|
|
73
|
+
- If forcing questions remain or context is incomplete, what is the next decision-changing question?
|
|
74
|
+
5. Repeat until **all forcing questions are answered/skipped/waived AND self-evaluation says context is sufficient**, OR user records an explicit stop-signal row.
|
|
54
75
|
|
|
55
76
|
## Question Shape Rules
|
|
56
77
|
|
|
57
78
|
- Prefer single-select multiple choice when one direction/priority/next step must be chosen.
|
|
58
79
|
- Use multi-select only for compatible sets (goals, constraints, non-goals).
|
|
59
|
-
- Smart-skip
|
|
80
|
+
- Smart-skip: if a question is already answered earlier (directly or implicitly), log \`skipped (already covered: turn N)\` instead of skipping silently. The smart-skip row counts as a substantive Q&A Log entry for floor purposes.
|
|
60
81
|
|
|
61
82
|
## Stop Signals (Natural Language)
|
|
62
83
|
|
|
63
84
|
Treat these as stop-and-draft signals:
|
|
64
|
-
- RU: "достаточно", "хватит", "давай драфт"
|
|
65
|
-
- EN: "enough", "skip", "just draft it", "stop asking", "move on"
|
|
85
|
+
- RU: "достаточно", "хватит", "давай драфт", "хватит вопросов"
|
|
86
|
+
- EN: "enough", "skip", "just draft it", "stop asking", "move on", "no more questions"
|
|
66
87
|
- UA: "досить", "вистачить", "давай драфт", "рухаємось далі"
|
|
67
88
|
|
|
68
89
|
When detected:
|
|
90
|
+
- Append a Q&A Log row exactly like: \`Turn N | (stop-signal) | <user quote> | stop-and-draft\` — this row satisfies the linter floor escape hatch.
|
|
69
91
|
- Do not ask another question in this stage loop.
|
|
70
92
|
- Move to drafting with available context.
|
|
71
|
-
- For internal agent
|
|
93
|
+
- For the next internal agent-only call to advance-stage, pass \`--skip-questions\`. **The user never sees or types this flag.**
|
|
72
94
|
|
|
73
95
|
## Conditional Grilling (Only On Risk Triggers)
|
|
74
96
|
|
|
75
|
-
|
|
97
|
+
When one of these triggers appears, continue the elicitation loop with sharper questions **one at a time** (do NOT batch them):
|
|
76
98
|
- Irreversibility (data deletion, schema migration, breaking API/contract)
|
|
77
99
|
- Security/auth boundary changes
|
|
78
100
|
- Domain-model ambiguity with multiple plausible invariants
|
|
79
101
|
|
|
102
|
+
Each grill question follows the same Core Protocol: ask one, wait, log, self-eval, ask next.
|
|
103
|
+
|
|
80
104
|
Do not ask extra questions "for theater" on simple low-risk work.
|
|
81
105
|
|
|
82
|
-
## Question Budget Hint (
|
|
106
|
+
## Question Budget Hint (advisory only — Wave 23 dropped the count floor)
|
|
83
107
|
|
|
84
|
-
|
|
108
|
+
Source of truth: \`questionBudgetHint(track, stage)\`. The numbers below are
|
|
109
|
+
**soft hints** for harness UI and elicitation pacing; gate blocking is done
|
|
110
|
+
by the \`qa_log_unconverged\` rule (Ralph-Loop convergence detector), NOT by
|
|
111
|
+
a fixed count.
|
|
85
112
|
|
|
86
113
|
${budgetTable}
|
|
87
114
|
|
|
88
115
|
Track mapping note: \`quick\` ~= lightweight, \`medium\` ~= standard, \`standard\` ~= deep.
|
|
89
|
-
Stop based on clarity/user signal, not raw count.
|
|
90
116
|
|
|
91
|
-
|
|
117
|
+
How to use the columns:
|
|
118
|
+
- \`Min\` — soft minimum to surface forcing questions; not a blocking gate.
|
|
119
|
+
- \`Recommended\` — target for normal flows.
|
|
120
|
+
- \`Hard cap warning\` — point at which to stop or compress remaining forcing questions into one final batched ask. Not skip.
|
|
121
|
+
|
|
122
|
+
## Stage Forcing Questions (walk in order, one per turn)
|
|
92
123
|
|
|
93
|
-
|
|
124
|
+
**Walk the forcing questions list one-by-one in order, asking each as a separate turn.** Do NOT batch. Do NOT pick favorites — go in order. For each question record one of:
|
|
125
|
+
- \`asked\` — question was asked and answered.
|
|
126
|
+
- \`asked (confirmed assumption)\` — question was asked, user confirmed your prior reading.
|
|
127
|
+
- \`skipped (already covered: turn N)\` — answered implicitly by an earlier reply; cite the turn.
|
|
128
|
+
- \`waived (user override)\` — user explicitly waived this question.
|
|
94
129
|
|
|
95
|
-
|
|
130
|
+
Stage forcing question lists:
|
|
131
|
+
|
|
132
|
+
- **Brainstorm**:
|
|
96
133
|
- What pain are we solving?
|
|
97
134
|
- What is the most direct path?
|
|
98
135
|
- What happens if we do nothing?
|
|
99
136
|
- Who is the operator/user impacted first?
|
|
100
137
|
- What are non-negotiable no-go boundaries?
|
|
101
|
-
- Scope
|
|
138
|
+
- **Scope**:
|
|
102
139
|
- What is definitely in and definitely out?
|
|
103
140
|
- Which decisions are already locked upstream?
|
|
104
141
|
- What is the rollback path if this fails?
|
|
105
142
|
- What are the top failure modes we must design for?
|
|
106
|
-
- Design
|
|
143
|
+
- **Design**:
|
|
107
144
|
- What is the data flow end-to-end?
|
|
108
145
|
- Where are the seams/interfaces and ownership boundaries?
|
|
109
146
|
- Which invariants must always hold?
|
|
@@ -118,6 +155,10 @@ For irreversible moves (deletion, schema migration, breaking API):
|
|
|
118
155
|
|
|
119
156
|
## Completion Rule
|
|
120
157
|
|
|
121
|
-
|
|
122
|
-
|
|
158
|
+
Continue asking forcing questions in order until one of:
|
|
159
|
+
- (a) all forcing questions for the stage are answered/skipped/waived AND self-evaluation says context is sufficient, OR
|
|
160
|
+
- (b) user records an explicit stop-signal row in \`## Q&A Log\`, OR
|
|
161
|
+
- (c) the \`hard cap warning\` count is reached and you compressed the remaining forcing questions into one final batched ask (not skip).
|
|
162
|
+
|
|
163
|
+
Do NOT exit the loop after the first 1-2 questions just because you can draft something. The point of the loop is to surface the user's actual constraints, not to confirm your initial reading.`;
|
|
123
164
|
}
|
package/dist/content/skills.js
CHANGED
|
@@ -175,18 +175,23 @@ function autoSubagentDispatchBlock(stage, track) {
|
|
|
175
175
|
const userGate = rule.requiresUserGate ? "required" : "not required";
|
|
176
176
|
const dispatchClass = rule.dispatchClass ?? "stage-specialist";
|
|
177
177
|
const returnSchema = rule.returnSchema ?? "agent-default";
|
|
178
|
-
|
|
178
|
+
const runPhase = rule.runPhase ?? "any";
|
|
179
|
+
return `| ${rule.agent} | ${rule.mode} | ${runPhase} | ${dispatchClass} | ${returnSchema} | ${userGate} | ${rule.when} | ${rule.purpose} |`;
|
|
179
180
|
})
|
|
180
181
|
.join("\n");
|
|
181
182
|
const mandatory = schema.mandatoryDelegations;
|
|
182
183
|
const mandatoryList = mandatory.length > 0 ? mandatory.map((a) => `\`${a}\``).join(", ") : "none";
|
|
183
184
|
const delegationLogRel = `${RUNTIME_ROOT}/state/delegation-log.json`;
|
|
184
185
|
const delegationEventsRel = `${RUNTIME_ROOT}/state/delegation-events.jsonl`;
|
|
186
|
+
const hasPostElicitation = rules.some((rule) => rule.runPhase === "post-elicitation");
|
|
187
|
+
const runPhaseLegend = hasPostElicitation
|
|
188
|
+
? `\nRun Phase legend: \`post-elicitation\` = run only AFTER the adaptive elicitation Q&A loop converges (forcing questions answered/skipped/waived OR user stop-signal recorded). \`pre-elicitation\` = run before any user dialogue (rare). \`any\` = no ordering constraint.`
|
|
189
|
+
: "";
|
|
185
190
|
return `## Automatic Subagent Dispatch
|
|
186
|
-
| Agent | Mode | Class | Return Schema | User Gate | Trigger | Purpose |
|
|
187
|
-
|
|
191
|
+
| Agent | Mode | Run Phase | Class | Return Schema | User Gate | Trigger | Purpose |
|
|
192
|
+
|---|---|---|---|---|---|---|---|
|
|
188
193
|
${rows}
|
|
189
|
-
Mandatory: ${mandatoryList}. Record lifecycle rows in \`${delegationLogRel}\` and append-only \`${delegationEventsRel}\` before completion
|
|
194
|
+
Mandatory: ${mandatoryList}. Record lifecycle rows in \`${delegationLogRel}\` and append-only \`${delegationEventsRel}\` before completion.${runPhaseLegend}
|
|
190
195
|
### Harness Dispatch Contract — use true harness dispatch: Claude Task, Cursor generic dispatch, OpenCode \`.opencode/agents/<agent>.md\` via Task/@agent, Codex \`.codex/agents/<agent>.toml\`. Do not collapse OpenCode or Codex to role-switch by default. Worker ACK Contract: ACK must include \`spanId\`, \`dispatchId\`, \`dispatchSurface\`, \`agentDefinitionPath\`, and \`ackTs\`; never claim \`fulfillmentMode: "isolated"\` without matching lifecycle proof. Helper: \`.cclaw/hooks/delegation-record.mjs --status=<status> --span-id=<spanId> --dispatch-id=<dispatchId> --dispatch-surface=<surface> --agent-definition-path=<path> --json\`. Exact recipe: scheduled -> launched -> acknowledged -> completed with the same span; completed isolated/generic rows require a prior ACK event for that span or \`--ack-ts=<iso>\`.
|
|
191
196
|
|
|
192
197
|
${perHarnessLifecycleRecipeBlock()}`;
|
|
@@ -392,6 +397,14 @@ function delegationAndCompletionBlock(schema, track) {
|
|
|
392
397
|
${normalizedDispatch}
|
|
393
398
|
|
|
394
399
|
${completionBlock}
|
|
400
|
+
|
|
401
|
+
### Stage Closure (harness-only UX)
|
|
402
|
+
|
|
403
|
+
- **NEVER paste the \`stage-complete.mjs\` command line into chat.** The user does not run cclaw manually; seeing \`node .cclaw/hooks/stage-complete.mjs ... --evidence-json '{...}' --waive-delegation=...\` is noise. Run the helper via the tool layer; report only the resulting summary.
|
|
404
|
+
- **NEVER paste the \`--evidence-json\` payload into chat.** It is structured data for the helper, not for the user. The same evidence already lives in the artifact section.
|
|
405
|
+
- On failure, report a compact human-readable summary based on the helper's JSON \`findings\` array — list failing section names only (one line each), include the full helper JSON in a single fenced \`json\` block. Do not echo the invoking command.
|
|
406
|
+
- **NEVER run shell hash commands** (\`shasum\`, \`sha256sum\`, \`md5sum\`, \`Get-FileHash\`, \`certutil\`, etc.) for hash compute. If the linter ever asks for a hash, that is a linter bug — report failure and stop, do not auto-fix in bash.
|
|
407
|
+
- The helper defaults to quiet success (\`CCLAW_STAGE_COMPLETE_QUIET=1\`); rely on the resulting JSON, not stdout chatter.
|
|
395
408
|
`;
|
|
396
409
|
}
|
|
397
410
|
function quickStartBlock(stage, track) {
|
|
@@ -638,10 +651,10 @@ CLI commands, using existing \`cclaw run resume\` and \`internal verify-current-
|
|
|
638
651
|
|
|
639
652
|
1. **Wave Start**: author wave plan as \`.cclaw/wave-plans/<wave-n>.md\` referencing previous wave's ship artifact.
|
|
640
653
|
2. **Carry-forward Audit**: at brainstorm of the next wave, re-read previous wave ship artifact and explicitly record in the existing \`## Wave Carry-forward\` section:
|
|
641
|
-
- Carrying forward: <scope
|
|
654
|
+
- Carrying forward: <scope D-XX decision references still valid>
|
|
642
655
|
- Drift detected: <decisions no longer valid + reason>
|
|
643
656
|
- Re-scope needed: <yes/no>
|
|
644
|
-
- Never create a second \`## Locked Decisions\` heading in brainstorm; reference prior
|
|
657
|
+
- Never create a second \`## Locked Decisions\` heading in brainstorm; reference prior D-XX IDs inline.
|
|
645
658
|
3. **Resume Path**: if a wave was interrupted mid-stage, \`cclaw run resume\` restores state. Run \`internal verify-current-state\` before continuing.
|
|
646
659
|
4. **Wave End**: at ship, architect cross-stage verification runs from dispatch matrix. If \`DRIFT_DETECTED\`, fix before ship.
|
|
647
660
|
5. **Next Wave Trigger**: launch new \`/cc <topic>\` for next wave and reference previous wave ship artifact in upstream handoff.
|
|
@@ -439,20 +439,32 @@ const STAGE_SCHEMA_MAP = {
|
|
|
439
439
|
review: REVIEW,
|
|
440
440
|
ship: SHIP
|
|
441
441
|
};
|
|
442
|
+
/**
|
|
443
|
+
* Stage-level subagent dispatch matrix.
|
|
444
|
+
*
|
|
445
|
+
* NOTE on `fixer`: the `fixer` agent is intentionally NOT listed in any stage
|
|
446
|
+
* row. It is dispatched on-demand by the SDD `subagent-dev` skill (and by
|
|
447
|
+
* reviewer flows) when a review surfaces a concrete failing criterion that
|
|
448
|
+
* needs a fresh worker. Adding `fixer` to the static matrix would create
|
|
449
|
+
* proactive-waiver theatre because it can only run after a specific review
|
|
450
|
+
* finding exists. See `core-agents.ts` `fixer` definition for the contract.
|
|
451
|
+
*/
|
|
442
452
|
const STAGE_AUTO_SUBAGENT_DISPATCH = {
|
|
443
453
|
brainstorm: [
|
|
444
454
|
{
|
|
445
455
|
agent: "product-discovery",
|
|
446
456
|
mode: "mandatory",
|
|
447
457
|
requiredAtTier: "standard",
|
|
448
|
-
|
|
458
|
+
runPhase: "post-elicitation",
|
|
459
|
+
when: "Always for standard/deep brainstorm to validate value, persona/JTBD, success metric, and why-now framing. Runs only after the adaptive elicitation Q&A loop converges.",
|
|
449
460
|
purpose: "Run product-discovery mode to pressure-test problem/value fit and produce product evidence for the Problem Decision Record.",
|
|
450
461
|
requiresUserGate: false
|
|
451
462
|
},
|
|
452
463
|
{
|
|
453
464
|
agent: "divergent-thinker",
|
|
454
465
|
mode: "proactive",
|
|
455
|
-
|
|
466
|
+
runPhase: "post-elicitation",
|
|
467
|
+
when: "When brainstorm has >1 candidate direction or user signals openness to alternatives. Runs only after the adaptive elicitation Q&A loop converges.",
|
|
456
468
|
purpose: "Expand option-space with alternative framings and approaches before planner/critic convergence.",
|
|
457
469
|
requiresUserGate: false
|
|
458
470
|
},
|
|
@@ -460,7 +472,8 @@ const STAGE_AUTO_SUBAGENT_DISPATCH = {
|
|
|
460
472
|
agent: "critic",
|
|
461
473
|
mode: "mandatory",
|
|
462
474
|
requiredAtTier: "standard",
|
|
463
|
-
|
|
475
|
+
runPhase: "post-elicitation",
|
|
476
|
+
when: "Always for standard/deep brainstorm to challenge the premise, do-nothing path, and higher-upside alternatives. Runs only after the adaptive elicitation Q&A loop converges.",
|
|
464
477
|
purpose: "Attack assumptions and surface non-goals before direction approval, with pre-commitment predictions validated against evidence.",
|
|
465
478
|
requiresUserGate: false,
|
|
466
479
|
skill: "critic-multi-perspective"
|
|
@@ -468,7 +481,8 @@ const STAGE_AUTO_SUBAGENT_DISPATCH = {
|
|
|
468
481
|
{
|
|
469
482
|
agent: "researcher",
|
|
470
483
|
mode: "proactive",
|
|
471
|
-
|
|
484
|
+
runPhase: "post-elicitation",
|
|
485
|
+
when: "When repository, market, docs, or prior-art context changes the approach set. Runs only after the adaptive elicitation Q&A loop converges.",
|
|
472
486
|
purpose: "Provide search-before-read summaries and context-readiness evidence before large reads or decisions.",
|
|
473
487
|
requiresUserGate: false
|
|
474
488
|
}
|
|
@@ -478,14 +492,16 @@ const STAGE_AUTO_SUBAGENT_DISPATCH = {
|
|
|
478
492
|
agent: "planner",
|
|
479
493
|
mode: "mandatory",
|
|
480
494
|
requiredAtTier: "standard",
|
|
481
|
-
|
|
495
|
+
runPhase: "post-elicitation",
|
|
496
|
+
when: "Always during scope shaping. Runs only after the adaptive elicitation Q&A loop converges and the user has approved the scope contract draft.",
|
|
482
497
|
purpose: "Challenge premise, map alternatives, and produce explicit in/out contract.",
|
|
483
498
|
requiresUserGate: false
|
|
484
499
|
},
|
|
485
500
|
{
|
|
486
501
|
agent: "divergent-thinker",
|
|
487
502
|
mode: "proactive",
|
|
488
|
-
|
|
503
|
+
runPhase: "post-elicitation",
|
|
504
|
+
when: "When scope mode is SCOPE EXPANSION or SELECTIVE EXPANSION, or scope contract has fewer than 3 alternatives considered. Runs only after the adaptive elicitation Q&A loop converges.",
|
|
489
505
|
purpose: "Generate additional framings and approach variants before scope convergence hardens.",
|
|
490
506
|
requiresUserGate: false
|
|
491
507
|
},
|
|
@@ -493,7 +509,8 @@ const STAGE_AUTO_SUBAGENT_DISPATCH = {
|
|
|
493
509
|
agent: "critic",
|
|
494
510
|
mode: "mandatory",
|
|
495
511
|
requiredAtTier: "standard",
|
|
496
|
-
|
|
512
|
+
runPhase: "post-elicitation",
|
|
513
|
+
when: "Always during scope shaping for standard/deep work. Runs only after the adaptive elicitation Q&A loop converges.",
|
|
497
514
|
purpose: "Test whether the selected scope mode is too timid, too broad, or hiding a smaller useful slice, using pre-commitment predictions and validation.",
|
|
498
515
|
requiresUserGate: false,
|
|
499
516
|
skill: "critic-multi-perspective"
|
|
@@ -501,14 +518,16 @@ const STAGE_AUTO_SUBAGENT_DISPATCH = {
|
|
|
501
518
|
{
|
|
502
519
|
agent: "researcher",
|
|
503
520
|
mode: "proactive",
|
|
504
|
-
|
|
521
|
+
runPhase: "post-elicitation",
|
|
522
|
+
when: "When churn, prior attempts, reference patterns, or external constraints may change scope boundaries. Runs only after the adaptive elicitation Q&A loop converges.",
|
|
505
523
|
purpose: "Summarize search/context findings before the scope contract locks accepted/rejected/deferred ideas.",
|
|
506
524
|
requiresUserGate: false
|
|
507
525
|
},
|
|
508
526
|
{
|
|
509
527
|
agent: "product-discovery",
|
|
510
528
|
mode: "proactive",
|
|
511
|
-
|
|
529
|
+
runPhase: "post-elicitation",
|
|
530
|
+
when: "When scope choices change user value, success metrics, or product positioning (Mode: discovery). Runs only after the adaptive elicitation Q&A loop converges.",
|
|
512
531
|
purpose: "Keep accepted/deferred reference ideas tied to user value and measurable success under product-discovery mode.",
|
|
513
532
|
requiresUserGate: false
|
|
514
533
|
},
|
|
@@ -516,14 +535,16 @@ const STAGE_AUTO_SUBAGENT_DISPATCH = {
|
|
|
516
535
|
agent: "product-discovery",
|
|
517
536
|
mode: "proactive",
|
|
518
537
|
requiredAtTier: "standard",
|
|
519
|
-
|
|
538
|
+
runPhase: "post-elicitation",
|
|
539
|
+
when: "When scope mode resolves to SCOPE EXPANSION or SELECTIVE EXPANSION (Mode: strategist). Runs only after the adaptive elicitation Q&A loop converges.",
|
|
520
540
|
purpose: "Drive 10x vision and concrete expansion proposals before locking the scope contract via product-discovery strategist mode.",
|
|
521
541
|
requiresUserGate: false
|
|
522
542
|
},
|
|
523
543
|
{
|
|
524
544
|
agent: "scope-guardian-reviewer",
|
|
525
545
|
mode: "proactive",
|
|
526
|
-
|
|
546
|
+
runPhase: "post-elicitation",
|
|
547
|
+
when: "When scope mode is SCOPE EXPANSION or SELECTIVE EXPANSION, or scope contract has many accepted ideas. Runs only after the adaptive elicitation Q&A loop converges.",
|
|
527
548
|
purpose: "Challenge complexity growth and enforce minimum-change scope discipline before scope lock.",
|
|
528
549
|
requiresUserGate: false,
|
|
529
550
|
skill: "document-scope-guard"
|
|
@@ -534,7 +555,8 @@ const STAGE_AUTO_SUBAGENT_DISPATCH = {
|
|
|
534
555
|
agent: "architect",
|
|
535
556
|
mode: "mandatory",
|
|
536
557
|
requiredAtTier: "standard",
|
|
537
|
-
|
|
558
|
+
runPhase: "post-elicitation",
|
|
559
|
+
when: "Always during design lock. Runs only after the adaptive elicitation Q&A loop converges.",
|
|
538
560
|
purpose: "Stress architecture boundaries, dependency graph, critical path, and spec handoff.",
|
|
539
561
|
requiresUserGate: false
|
|
540
562
|
},
|
|
@@ -542,14 +564,16 @@ const STAGE_AUTO_SUBAGENT_DISPATCH = {
|
|
|
542
564
|
agent: "test-author",
|
|
543
565
|
mode: "mandatory",
|
|
544
566
|
requiredAtTier: "standard",
|
|
545
|
-
|
|
567
|
+
runPhase: "post-elicitation",
|
|
568
|
+
when: "Always during design lock. Runs only after the adaptive elicitation Q&A loop converges.",
|
|
546
569
|
purpose: "Check test diagram mapping, RED expressibility, assertion quality, and verification routes before implementation.",
|
|
547
570
|
requiresUserGate: false
|
|
548
571
|
},
|
|
549
572
|
{
|
|
550
573
|
agent: "critic",
|
|
551
574
|
mode: "proactive",
|
|
552
|
-
|
|
575
|
+
runPhase: "post-elicitation",
|
|
576
|
+
when: "When architecture alternatives, coupling, cost, or rollback risk remain debatable, or when security/auth/authz trust boundaries are involved. Runs only after the adaptive elicitation Q&A loop converges.",
|
|
553
577
|
purpose: "Produce a shadow alternative, switch trigger, and cheaper-path challenge for the engineering lock with pre-commitment predictions and validation.",
|
|
554
578
|
requiresUserGate: false,
|
|
555
579
|
skill: "critic-multi-perspective"
|
|
@@ -557,21 +581,24 @@ const STAGE_AUTO_SUBAGENT_DISPATCH = {
|
|
|
557
581
|
{
|
|
558
582
|
agent: "researcher",
|
|
559
583
|
mode: "proactive",
|
|
560
|
-
|
|
584
|
+
runPhase: "post-elicitation",
|
|
585
|
+
when: "When framework/library docs, repo graph context, or reference contracts may change the design. Runs only after the adaptive elicitation Q&A loop converges.",
|
|
561
586
|
purpose: "Run search-before-read context synthesis before architecture locks.",
|
|
562
587
|
requiresUserGate: false
|
|
563
588
|
},
|
|
564
589
|
{
|
|
565
590
|
agent: "security-reviewer",
|
|
566
591
|
mode: "proactive",
|
|
567
|
-
|
|
592
|
+
runPhase: "post-elicitation",
|
|
593
|
+
when: "When trust boundaries, auth, secrets, sensitive data, or external inputs are involved. Runs only after the adaptive elicitation Q&A loop converges.",
|
|
568
594
|
purpose: "Catch design-level security risks before implementation.",
|
|
569
595
|
requiresUserGate: false
|
|
570
596
|
},
|
|
571
597
|
{
|
|
572
598
|
agent: "coherence-reviewer",
|
|
573
599
|
mode: "proactive",
|
|
574
|
-
|
|
600
|
+
runPhase: "post-elicitation",
|
|
601
|
+
when: "When design touches multiple subsystems or includes multiple alternatives sections. Runs only after the adaptive elicitation Q&A loop converges.",
|
|
575
602
|
purpose: "Detect internal contradictions, terminology drift, and broken cross-section references in design docs.",
|
|
576
603
|
requiresUserGate: false,
|
|
577
604
|
skill: "document-coherence-pass"
|
|
@@ -579,7 +606,8 @@ const STAGE_AUTO_SUBAGENT_DISPATCH = {
|
|
|
579
606
|
{
|
|
580
607
|
agent: "feasibility-reviewer",
|
|
581
608
|
mode: "proactive",
|
|
582
|
-
|
|
609
|
+
runPhase: "post-elicitation",
|
|
610
|
+
when: "When design assumes runtime conditions, scaling behavior, or external service availability. Runs only after the adaptive elicitation Q&A loop converges.",
|
|
583
611
|
purpose: "Validate that design assumptions remain feasible in real runtime and rollout constraints.",
|
|
584
612
|
requiresUserGate: false,
|
|
585
613
|
skill: "document-feasibility-pass"
|
|
@@ -36,8 +36,8 @@ export const BRAINSTORM = {
|
|
|
36
36
|
},
|
|
37
37
|
executionModel: {
|
|
38
38
|
checklist: [
|
|
39
|
-
"**
|
|
40
|
-
"**
|
|
39
|
+
"**ADAPTIVE ELICITATION COMES FIRST (no exceptions, no subagent dispatch before).** Load `.cclaw/skills/adaptive-elicitation/SKILL.md`. Walk the brainstorm forcing questions one-at-a-time via the harness-native question tool, append one row to `## Q&A Log` (`Turn | Question | User answer (1-line) | Decision impact`) after each user answer. Continue until forcing-questions converge (all answered/skipped/waived) OR Ralph-Loop convergence detector says no new decision-changing rows in last 2 iterations OR user records an explicit stop-signal row. Only then proceed to delegations, drafts, or analysis. The linter `qa_log_unconverged` rule will block `stage-complete` if convergence is not reached.",
|
|
40
|
+
"**Explore project context** — after the elicitation loop converges, inspect existing files/docs/recent activity to refine the Discovered context section; capture matching files/patterns/seeds in `Context > Discovered context` so downstream stages don't redo discovery.",
|
|
41
41
|
"**Brainstorm forcing questions (must be covered or explicitly waived)** — what pain are we solving, what is the direct path, what happens if we do nothing, who is the first operator/user affected, and what no-go boundaries are non-negotiable.",
|
|
42
42
|
"**Classify stage depth** — choose `lite` for clear low-risk tasks, `standard` for normal engineering/product changes, or `deep` for ambiguity, architecture, external dependency, security/data risk, or explicit think-bigger requests.",
|
|
43
43
|
"**Write the Problem Decision Record** — pick a free-form `Frame type` label that names how this work is framed (examples: product, technical-maintenance, research-spike, ops-incident, infrastructure), then fill the universal Framing fields: affected user/role/operator, current state/failure mode/opportunity, desired observable outcome, evidence/signal, why now, do-nothing consequence, and non-goals.",
|
|
@@ -48,11 +48,12 @@ export const BRAINSTORM = {
|
|
|
48
48
|
"**Use compact discovery for low-risk asks** — for concrete bounded requests, do one context pass, compare one baseline and one challenger, and move to draft once context is sufficient; do not drag the user through a full workshop.",
|
|
49
49
|
"**Early-exit concrete asks** — for unambiguous implementation-only requests, write a compact Problem Decision Record plus short-circuit handoff (context, approved intent, constraints, assumptions, next-stage risks) and request explicit approval when the draft is ready.",
|
|
50
50
|
"**Ask only decision-changing questions** — one at a time; if answers would not change approach and are non-critical preference/default assumptions, state the assumption and continue; STOP on scope, architecture, security, data loss, public API, migration, auth/pricing, or user approval uncertainty.",
|
|
51
|
+
"**Idea-evidence carry-forward (when applicable).** If `flow-state.interactionHints.brainstorm.fromIdeaArtifact` is set, read that idea artifact and reuse its `Title`, `Why-now`, `Expected impact`, `Risk`, `Counter-argument` for the chosen `I-#` (`fromIdeaCandidateId`) as the seed of `## Selected Direction` and as one row of `## Approaches` (role: `baseline`, evidence: idea-artifact path). Generate ONLY the missing higher-upside `challenger` row(s); do NOT re-generate the candidate that came from `/cc-ideate`. Record the carry-forward in `## Idea Evidence Carry-forward` with at minimum `- Source: <path>`, `- Candidate: <I-#>`, `- Reused fields: Title, Why-now, Expected impact, Risk, Counter-argument`, `- Newly generated: challenger(s) only`.",
|
|
51
52
|
"**Compare 2-3 distinct approaches with stable Role/Upside columns** — Role values are `baseline` | `challenger` | `wild-card`; Upside is `low` | `modest` | `high` | `higher`; include real trade-offs, reuse notes, and reference-pattern source/disposition when a known pattern influenced the option; include exactly one challenger with explicit `high` or `higher` upside.",
|
|
52
53
|
"**Collect reaction before recommending** — ask which option feels closest and what concern remains, then recommend based on that reaction.",
|
|
53
54
|
"**Write the `Not Doing` list** — name 3-5 things this brainstorm explicitly is not committing to (vs. deferred). This protects scope from silent enlargement and the next stage from rework.",
|
|
54
55
|
"**Run early Ralph loop discipline** — after each producer iteration, append a `Critic Pass` JSONL row to `.cclaw/state/early-loop-log.jsonl`, refresh `.cclaw/state/early-loop.json`, and iterate until open concerns clear or convergence guard escalates.",
|
|
55
|
-
"**Embedded Grill (post-pick)** — after `Selected Direction` is named,
|
|
56
|
+
"**Embedded Grill (post-pick, one-at-a-time)** — after `Selected Direction` is named, if grilling triggers fire (irreversibility, security/auth boundary, domain-model ambiguity per `adaptive-elicitation:Conditional Grilling`), continue the elicitation loop with sharper questions **one at a time**, appended to `## Q&A Log` and reflected as rows in `## Embedded Grill`. Do NOT batch the 3-5 grill checks — each one follows the Core Protocol (ask, wait, log, self-eval, ask next).",
|
|
56
57
|
"**Self-review before user approval** — re-read the artifact and patch contradictions, weak trade-offs, placeholders, ambiguity, and weak handoff language. Record the result in `Self-Review Notes` using the calibrated review format: `- Status: Approved` (or `Issues Found`), `- Patches applied:` with inline note or sub-bullets, `- Remaining concerns:` with inline note or sub-bullets. Use `Patches applied: None` and `Remaining concerns: None` when there is nothing to record.",
|
|
57
58
|
"**Request explicit approval to close the stage** — state exactly what direction is being approved after the adaptive elicitation loop converges; do not advance without approval and artifact review.",
|
|
58
59
|
"**Handoff packet** — only after approval, produce a scope handoff packet with selected direction, why rejected options were rejected, explicit non-goals, unresolved questions, risk hints, and explicit drift from the initial ask so scope starts from locked upstream decisions instead of rediscovering intent."
|
|
@@ -91,6 +92,7 @@ export const BRAINSTORM = {
|
|
|
91
92
|
"Clarity Gate records ambiguity score, decision boundaries, reaffirmed non-goals, and residual-risk handoff.",
|
|
92
93
|
"Clarifying questions are one-at-a-time and captured only when they change a decision or stop condition.",
|
|
93
94
|
"2-3 approaches with trade-offs are recorded, including one higher-upside challenger option and reference-pattern source/disposition when applicable.",
|
|
95
|
+
"When `flow-state.interactionHints.brainstorm.fromIdeaArtifact` is set, the `## Idea Evidence Carry-forward` section cites the idea artifact + `I-#` and only the challenger rows are newly generated (idea candidate is reused as `baseline`, never re-derived).",
|
|
94
96
|
"User reaction to approaches is captured before final recommendation.",
|
|
95
97
|
"Final recommendation explicitly reflects user reaction.",
|
|
96
98
|
"Early-loop status is reflected via `Victory Detector` / `Critic Pass` sections and `.cclaw/state/early-loop.json` when concerns remain.",
|
|
@@ -146,6 +148,7 @@ export const BRAINSTORM = {
|
|
|
146
148
|
{ section: "Approach Tier", required: true, validationRule: "Must classify depth as lite/standard/deep and explain the risk/uncertainty signal." },
|
|
147
149
|
{ section: "Short-Circuit Decision", required: false, validationRule: "Must include Status/Why/Scope handoff lines when short-circuit is discussed; compact stubs are valid for concrete asks." },
|
|
148
150
|
{ section: "Reference Pattern Candidates", required: false, validationRule: "Recommended when examples influence direction: list pattern/source, reusable invariant, accept/reject/defer disposition, and reason before approaches are finalized." },
|
|
151
|
+
{ section: "Idea Evidence Carry-forward", required: false, validationRule: "Wave 23 (v5.0.0): when `flow-state.interactionHints.brainstorm.fromIdeaArtifact` is set, this section MUST cite the idea artifact path and the chosen `I-#`, list reused fields (Title, Why-now, Expected impact, Risk, Counter-argument), and explicitly state that only challenger row(s) were newly generated. Honors `/cc-ideate` handoff so divergent + critique + rank work is reused, not redone." },
|
|
149
152
|
{ section: "Approaches", required: true, validationRule: "Must compare 2-3 distinct options with real trade-offs. Use the canonical `Role` column with `baseline` | `challenger` | `wild-card` and the `Upside` column with `low` | `modest` | `high` | `higher`; include exactly one challenger row with `high` or `higher` upside, and cite reference-pattern source/disposition when applicable." },
|
|
150
153
|
{ section: "Approach Reaction", required: true, validationRule: "Must appear before Selected Direction and summarize user reaction before recommendation, including `Closest option`, `Concerns`, and what changed after reaction." },
|
|
151
154
|
{ section: "Selected Direction", required: true, validationRule: "Must include the selected approach, explicit approval marker, rationale traceable to Approach Reaction, and a scope handoff packet with selected direction, decisions, drift, confidence, unresolved questions, risk hints, and non-goals." },
|
|
@@ -34,19 +34,22 @@ export const DESIGN = {
|
|
|
34
34
|
"Skipping outside-voice review loop and treating first draft as final",
|
|
35
35
|
"Batching multiple design issues into one question",
|
|
36
36
|
"Agreeing with user's architecture choice without evaluating alternatives",
|
|
37
|
-
"
|
|
37
|
+
"Re-authoring scope's out-of-scope list instead of citing it via Upstream Handoff",
|
|
38
|
+
"Re-authoring scope's repo audit instead of diffing the blast radius since scope baseline",
|
|
38
39
|
"Design decisions made without reading the actual code first"
|
|
39
40
|
]
|
|
40
41
|
},
|
|
41
42
|
executionModel: {
|
|
42
43
|
checklist: [
|
|
43
|
-
"**
|
|
44
|
+
"**ADAPTIVE ELICITATION COMES FIRST (no exceptions, no subagent dispatch before).** Load `.cclaw/skills/adaptive-elicitation/SKILL.md`. Walk the design forcing questions one-at-a-time via the harness-native question tool, append one row to `## Q&A Log` (`Turn | Question | User answer (1-line) | Decision impact`) after each user answer. Continue until forcing-questions converge (all answered/skipped/waived) OR Ralph-Loop convergence detector says no new decision-changing rows in last 2 iterations OR user records an explicit stop-signal row. Only then proceed to research, investigator pass, architecture lock, or any delegations. The linter `qa_log_unconverged` rule will block `stage-complete` if convergence is not reached.",
|
|
44
45
|
"**Design forcing questions (must be covered or explicitly waived)** — what is the end-to-end data flow, where are seams/ownership boundaries, which invariants must hold, and what will explicitly NOT be refactored now.",
|
|
46
|
+
"**Out-of-scope carry-forward (do NOT re-author)** — scope OWNS the out-of-scope list. Cite scope's `## In Scope / Out of Scope > Out of Scope` via `## Upstream Handoff > Decisions carried forward`; do NOT add a separate `## NOT in scope` section in the design artifact. Add a row to `## Spec Handoff` only if a design-stage decision NEWLY excludes something not already in scope's out-of-scope.",
|
|
45
47
|
"Compact design lock — design does not decide what to build; it decides how the approved scope works. For simple slices, produce a tight lock: upstream handoff, existing fit, architecture boundary, one labeled diagram, data/state flow, critical path, failure/rescue, trust boundaries, test/perf expectations, rollout/rollback, rejected alternative, and spec handoff.",
|
|
46
48
|
"Trivial-Change Escape Hatch — for <=3 files, no new interfaces, and no cross-module data flow, produce a mini-design (rationale, changed files, one risk) and proceed to spec.",
|
|
49
|
+
"**Architecture choice (design OWNS the tier decision)** — pick the architecture tier (minimum-viable / product-grade / ideal) using scope's `## Scope Contract > Design handoff` as the input. Record the tier and rationale in `## Architecture Decision Record (ADR)` and `## Engineering Lock`. Scope only locked the SCOPE MODE; it did NOT enumerate Implementation Alternatives.",
|
|
47
50
|
"Tiered Research — for simple/medium work, do compact inline codebase/research synthesis in `Research Fleet Synthesis`; write `.cclaw/artifacts/02a-research.md` and run the full fleet only for deep/high-risk work or when external framework/architecture uncertainty exists.",
|
|
48
51
|
"Design Doc Check — read upstream artifacts and current design docs; latest superseding doc wins.",
|
|
49
|
-
"
|
|
52
|
+
"**Blast-radius diff (do NOT re-audit the whole repo)** — scope OWNS the full repo audit (`## Pre-Scope System Audit`). Design only diffs the blast radius SINCE scope baseline: `git diff <scope-artifact-head-sha>..HEAD -- <touched-paths>`. Record touched files, current responsibilities, reuse candidates, and existing patterns in `## Codebase Investigation` and `## Blast-radius Diff`. Do NOT re-author scope's git log/diff/stash audit.",
|
|
50
53
|
"Scope Challenge + Search Before Building — find existing solutions, minimum change set, reference-grade contracts to mirror, and complexity smells before custom architecture.",
|
|
51
54
|
"Architecture Review — lock boundaries, chosen path, shadow alternative, switch trigger, failure/rescue/degraded behavior, and verification evidence for every high-risk choice; include tier-required diagrams.",
|
|
52
55
|
"Review core risk areas — existing system fit, data/state flow, critical path, security/trust boundaries, tests, performance budget, observability/debuggability, rollout/rollback, rejected alternatives, and spec handoff.",
|
|
@@ -68,7 +71,7 @@ export const DESIGN = {
|
|
|
68
71
|
"Classify ambiguity before acting. Only non-critical preference/default assumptions may continue; STOP on uncertainty about scope, architecture, security, data loss, public API, migration, auth/pricing, or required user approval. Design hypotheses must name validation path, rollback trigger, and owner before they can be carried forward.",
|
|
69
72
|
"Before final approval, run the critic pass, reconcile material findings, and bound retries with the review-loop policy.",
|
|
70
73
|
"For baseline approval, present the full design plus exact spec handoff and **STOP** until explicit approval.",
|
|
71
|
-
"**STOP BEFORE ADVANCE.** Mandatory delegation `planner`
|
|
74
|
+
"**STOP BEFORE ADVANCE.** Mandatory delegation `planner` runs **AFTER user approval of the design lock**, not before Q&A. Sequence is: Q&A loop -> draft design lock -> user approval -> `planner` delegation -> `stage-complete`. Legal fulfillment modes for `planner`: (a) **harness-native Task tool** — run the delegation, then record via `node .cclaw/hooks/delegation-record.mjs --stage=design --agent=planner --mode=mandatory --status=completed --span-id=<uuid> --dispatch-surface=cursor-task --agent-definition-path=<agent-md-path> --evidence-ref=<artifact#section>`; (b) **role-switch** — write planner output into the design artifact, then record with `--dispatch-surface=role-switch`; (c) **cclaw subagent helper** with `--dispatch-surface=isolated`. Run `node .cclaw/hooks/stage-complete.mjs design` from the tool layer (do not paste the command into chat); report only the resulting summary."
|
|
72
75
|
],
|
|
73
76
|
process: [
|
|
74
77
|
"Read upstream artifacts and current design docs.",
|
|
@@ -77,7 +80,7 @@ export const DESIGN = {
|
|
|
77
80
|
"Walk review sections interactively and lock boundaries, data flow, state transitions, edge cases, and failure modes.",
|
|
78
81
|
"Cover security, observability, deployment, tests, and performance for Standard+ changes.",
|
|
79
82
|
"Run stale-diagram audit (enabled by default unless explicitly disabled).",
|
|
80
|
-
"Produce required outputs:
|
|
83
|
+
"Produce required outputs: blast-radius diff (scope owns full repo audit), tier diagrams, failure table, completion dashboard. Out-of-scope is carried from scope via Upstream Handoff — do NOT re-author it.",
|
|
81
84
|
"Plant high-upside deferred ideas when useful and reconcile critic/outside-voice findings.",
|
|
82
85
|
"Write design lock artifact for downstream spec/plan with design decisions, rejected alternatives, verification evidence, and exact spec handoff."
|
|
83
86
|
],
|
|
@@ -107,8 +110,8 @@ export const DESIGN = {
|
|
|
107
110
|
"Test-Diagram Mapping links critical flows to both validating tests and diagram anchors.",
|
|
108
111
|
"Test strategy includes unit/integration/e2e expectations.",
|
|
109
112
|
"When a high-upside idea is deferred, a seed file is created under `.cclaw/seeds/` and referenced in the artifact.",
|
|
110
|
-
"NOT-in-scope section
|
|
111
|
-
"
|
|
113
|
+
"Out-of-scope is carried forward from scope's `## In Scope / Out of Scope > Out of Scope` via `## Upstream Handoff > Decisions carried forward`; design does NOT author its own NOT-in-scope section.",
|
|
114
|
+
"Blast-radius Diff section produced (git diff since scope artifact baseline) — scope owns the full repo audit; design only diffs touched paths.",
|
|
112
115
|
"Completion dashboard lists review section status, critical/open gap counts, decision count, and unresolved items (or 'None')."
|
|
113
116
|
],
|
|
114
117
|
inputs: ["scope agreement artifact", "system constraints", "non-functional requirements"],
|
|
@@ -174,7 +177,7 @@ export const DESIGN = {
|
|
|
174
177
|
{ section: "Performance Budget", required: false, validationRule: "For each critical path: metric name, target threshold, and measurement method." },
|
|
175
178
|
{ section: "Observability & Debuggability", required: true, validationRule: "Must define logs/metrics/traces plus alerting/debug path for critical failure modes." },
|
|
176
179
|
{ section: "Deployment & Rollout", required: true, validationRule: "Must define migration/flag strategy, rollout/rollback plan, switch trigger, and post-deploy verification steps." },
|
|
177
|
-
{ section: "
|
|
180
|
+
{ section: "Blast-radius Diff", required: false, validationRule: "Diff since scope artifact baseline (`git diff <scope-sha>..HEAD -- <touched-paths>`): for each touched file, summarize change since scope, current responsibility, reuse candidate, and existing pattern. Scope OWNS the full repo audit; design only diffs the blast radius." },
|
|
178
181
|
{ section: "Reference-Grade Contracts", required: false, validationRule: "For every mirrored pattern: source, reusable invariant, local adaptation, rejection boundary, and verification signal. Omit with `None - no external or in-repo pattern mirrored` for compact local changes." },
|
|
179
182
|
{ section: "Rejected Alternatives", required: false, validationRule: "List alternatives considered, why rejected, and what signal would revive them." },
|
|
180
183
|
{ section: "Design Decisions", required: false, validationRule: "Stable design decisions with requirement/locked-decision refs and downstream spec impact." },
|
|
@@ -184,10 +187,9 @@ export const DESIGN = {
|
|
|
184
187
|
{ section: "Design Outside Voice Loop", required: false, validationRule: `Record iteration table with quality score per iteration, stop reason, and unresolved concerns. Enforce ${reviewLoopPolicySummary("design")}` },
|
|
185
188
|
{ section: "Victory Detector", required: false, validationRule: "Recommended early-loop checkpoint: cite `.cclaw/state/early-loop.json`, current iteration/maxIterations, open concern count, convergence status, and iterate/ready/escalate decision." },
|
|
186
189
|
{ section: "Critic Pass", required: false, validationRule: "Recommended producer/critic log contract: each iteration appends one JSONL row to `.cclaw/state/early-loop-log.jsonl` with runId, stage, iteration, and open concerns." },
|
|
187
|
-
{ section: "NOT in scope", required: false, validationRule: "Work considered and explicitly deferred with one-line rationale." },
|
|
188
190
|
{ 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')." }
|
|
189
191
|
],
|
|
190
|
-
trivialOverrideSections: ["Architecture Boundaries", "
|
|
192
|
+
trivialOverrideSections: ["Architecture Boundaries", "Completion Dashboard"]
|
|
191
193
|
},
|
|
192
194
|
reviewLens: {
|
|
193
195
|
outputs: [
|
|
@@ -195,8 +197,7 @@ export const DESIGN = {
|
|
|
195
197
|
"architecture lock",
|
|
196
198
|
"risk and failure map",
|
|
197
199
|
"test and performance baseline",
|
|
198
|
-
"
|
|
199
|
-
"What-already-exists section",
|
|
200
|
+
"blast-radius diff since scope baseline",
|
|
200
201
|
"design decisions and spec handoff",
|
|
201
202
|
"design completion dashboard"
|
|
202
203
|
],
|
|
@@ -46,7 +46,7 @@ export const PLAN = {
|
|
|
46
46
|
"Slice into vertical tasks — each task targets 2-5 minutes, produces one testable outcome, and touches one coherent area.",
|
|
47
47
|
"Task Contract — every task has one coherent outcome, AC mapping, exact verification command/manual step, and expected evidence snippet or pass condition. Avoid vague `run tests` wording.",
|
|
48
48
|
"Annotate slice-review metadata — task rows may carry `touchCount` (rough number of files expected to change), `touchPaths` (glob hints, e.g. `migrations/**`, `src/auth/**`), and optional `highRisk: true` to force a review pass. These fields feed the TDD stage's Per-Slice Review point.",
|
|
49
|
-
"Map scope Locked Decisions — every
|
|
49
|
+
"Map scope Locked Decisions — every D-XX ID from scope is referenced by at least one plan task (or explicitly marked deferred with reason).",
|
|
50
50
|
"Run anti-placeholder + anti-scope-reduction scans — block `TODO/TBD/...` and phrasing like `v1`, `for now`, `later` for locked boundaries.",
|
|
51
51
|
"Define validation points — mark where progress must be checked before continuing, with concrete command and expected evidence.",
|
|
52
52
|
"Define execution posture — record whether execution should be sequential, dependency-batched, parallel-safe, or blocked; include risk triggers and RED/GREEN/REFACTOR checkpoint/commit expectations when the repo workflow supports them. This fulfills the `plan_execution_posture_recorded` gate.",
|