cclaw-cli 4.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 +40 -2
- package/dist/artifact-linter/design.js +2 -2
- 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 +9 -17
- package/dist/artifact-linter/shared.d.ts +65 -19
- package/dist/artifact-linter/shared.js +188 -96
- package/dist/artifact-linter.d.ts +1 -1
- package/dist/artifact-linter.js +1 -1
- package/dist/content/core-agents.js +6 -1
- package/dist/content/idea.js +14 -2
- package/dist/content/skills-elicitation.js +7 -4
- package/dist/content/stage-schema.js +10 -0
- package/dist/content/stages/_lint-metadata/index.js +1 -2
- package/dist/content/stages/brainstorm.js +4 -1
- package/dist/content/stages/design.js +12 -11
- package/dist/content/stages/review.js +21 -21
- package/dist/content/stages/scope.js +19 -17
- package/dist/content/stages/spec.js +3 -3
- package/dist/content/stages/tdd.js +1 -0
- package/dist/content/templates.d.ts +2 -2
- package/dist/content/templates.js +42 -32
- package/dist/flow-state.d.ts +12 -0
- package/dist/gate-evidence.d.ts +12 -0
- package/dist/gate-evidence.js +4 -1
- package/dist/harness-adapters.js +1 -1
- 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
|
@@ -32,14 +32,15 @@ export const REVIEW = {
|
|
|
32
32
|
},
|
|
33
33
|
executionModel: {
|
|
34
34
|
checklist: [
|
|
35
|
+
"**Boundary with TDD (do NOT re-classify slice findings).** `tdd.Per-Slice Review` OWNS severity-classified findings WITHIN a single slice (correctness, edge cases, regression for that slice). `review` OWNS whole-diff Layer 1 (spec compliance) plus Layer 2 (cross-slice integration findings, security sweep, dependency/version audit, observability). When the same finding ID appears in both `06-tdd.md > Per-Slice Review` and `07-review.md` / `07-review-army.json`, the severity/disposition MUST match — the cross-artifact-duplication linter blocks otherwise.",
|
|
35
36
|
"Diff Scope — Run `git diff` against base branch. If no diff, exit early with APPROVED (no changes to review). Scope the review to changed files unless blast-radius analysis requires wider inspection.",
|
|
36
37
|
"Change-Size Check — ~100 lines = normal. ~300 lines = consider splitting. ~1000+ lines = strongly recommend stacked PRs. Flag large diffs to the user.",
|
|
37
38
|
"Risk-Based Second Opinion — compute changed-line count, files-touched count, and trust-boundary movement. Dispatch an adversarial reviewer only when trust boundaries changed, Critical/Important ambiguity remains, or the diff is both large and high-risk; otherwise record `not triggered`.",
|
|
38
|
-
"Load upstream evidence — read TDD artifact (RED + GREEN + REFACTOR), spec, and the active track's upstream source items.",
|
|
39
|
+
"Load upstream evidence — read TDD artifact (RED + GREEN + REFACTOR + per-slice reviews), spec, design (architecture lens carry-forward), and the active track's upstream source items.",
|
|
39
40
|
"Confirm spec acceptance criteria and reproduction slices are covered directly in the review artifact evidence.",
|
|
40
41
|
"Layer 1: Spec Compliance — check every acceptance criterion against implementation. Verdict: pass/fail per criterion.",
|
|
41
42
|
"Review Evidence Scope — record base/head, files inspected, changed-file coverage, diagnostics run, dependency/version audit when relevant, and any files intentionally not inspected with explicit reason.",
|
|
42
|
-
"Layer 2:
|
|
43
|
+
"**Layer 2: Cross-slice integration findings — only findings that span >1 slice OR are not surfaced by per-slice tdd reviews.** Carry-forward: cite tdd per-slice review IDs already accepted; do not re-classify them. New categories owned by review Layer 2: cross-slice correctness, dependency/version audit, security sweep, observability gaps, external-safety. **Performance and architecture findings come from the design lens (cite `03-design-<slug>.md` Performance Budget / Architecture Decision Record); they are NOT re-derived in review.** Every finding uses file:line; if impossible, include an explicit no-line reason.",
|
|
43
44
|
"Security sweep — mandatory dedicated security-reviewer pass across diff + touched modules. A zero-finding pass must include `NO_CHANGE_ATTESTATION` or `NO_SECURITY_IMPACT` with rationale and inspected surfaces.",
|
|
44
45
|
"Incoming Feedback Intake — when human reviewer comments, bot findings, or CI annotations exist, keep a per-comment disposition queue and mirror outcomes into `07-review.md` + `07-review-army.json` before final verdict.",
|
|
45
46
|
"Structured Review reconciliation — normalize findings into `07-review-army.json`, dedup by fingerprint, and mark multi-specialist confirmations when multiple lenses agree.",
|
|
@@ -81,7 +82,8 @@ export const REVIEW = {
|
|
|
81
82
|
"Acceptance/reproduction coverage evidence recorded in the review artifact (AC and source-item/slice coverage snapshot).",
|
|
82
83
|
"Layer 1 verdict captured with per-criterion pass/fail.",
|
|
83
84
|
"Review Evidence Scope lists files inspected, changed-file coverage, diagnostics run, and omitted files with explicit reason.",
|
|
84
|
-
"Layer 2
|
|
85
|
+
"Layer 2 cross-slice findings recorded for: cross-slice correctness, security sweep, dependency/version audit, observability, external-safety. Performance/architecture come from design lens carry-forward (`03-design-<slug>.md`) — do NOT re-derive them.",
|
|
86
|
+
"Per-slice tdd review findings cited (not re-classified): each `06-tdd.md > Per-Slice Review` ID accepted in review must keep matching severity/disposition (cross-artifact-duplication linter enforces this).",
|
|
85
87
|
"Every finding cites `file:line`, or an explicit no-line reason is recorded.",
|
|
86
88
|
"No-finding attestation is explicit when no issues are found.",
|
|
87
89
|
"Dependency/version audit is recorded when manifests, lockfiles, generated clients, CI, runtime config, or external APIs are relevant.",
|
|
@@ -123,7 +125,7 @@ export const REVIEW = {
|
|
|
123
125
|
{ section: "Review Evidence Scope", required: true, validationRule: "Base/head, files inspected, changed-file coverage, diagnostics run, omitted files with reason, and reviewer/security-reviewer delegation evidence." },
|
|
124
126
|
{ section: "Changed-File Coverage", required: true, validationRule: "Each changed file is covered, intentionally omitted with no-impact reason, or linked to a broader inspected module." },
|
|
125
127
|
{ section: "Layer 1 Verdict", required: true, validationRule: "Per-criterion pass/fail with references." },
|
|
126
|
-
{ section: "Layer 2 Findings", required: false, validationRule: "Each finding has severity, category, file:line or explicit no-line reason, description, and resolution status
|
|
128
|
+
{ section: "Layer 2 Findings", required: false, validationRule: "Each finding has severity, category, file:line or explicit no-line reason, description, and resolution status. Wave 23 (v5.0.0): owned categories are cross-slice correctness, security, dependency/version, observability, and external-safety. Performance and architecture findings appear here only as carry-forward citations to `03-design-<slug>.md` (Performance Budget, ADR) — they are NOT re-derived. If there are no findings, include a no-finding attestation." },
|
|
127
129
|
{ section: "Lens Coverage", required: true, validationRule: "Reviewer must report inline lens outcomes: Performance/Compatibility/Observability as `NO_IMPACT` or `FOUND_<n>`, plus `Security: routed to security-reviewer`." },
|
|
128
130
|
{ section: "Security Sweep Attestation", required: false, validationRule: "Dedicated security-reviewer result: findings or `NO_CHANGE_ATTESTATION` / `NO_SECURITY_IMPACT` with inspected surfaces and rationale." },
|
|
129
131
|
{ section: "Dependency & Version Audit", required: false, validationRule: "Required when manifests, lockfiles, generated clients, CI, runtime config, or external APIs changed; otherwise record no-impact rationale." },
|
|
@@ -151,12 +153,12 @@ export const REVIEW = {
|
|
|
151
153
|
stopGate: true
|
|
152
154
|
},
|
|
153
155
|
{
|
|
154
|
-
title: "Layer 2:
|
|
156
|
+
title: "Layer 2: Cross-slice Integration Findings",
|
|
155
157
|
evaluationPoints: [
|
|
156
|
-
"
|
|
157
|
-
"Race conditions and concurrency issues",
|
|
158
|
-
"Null/undefined handling",
|
|
159
|
-
"Error propagation and recovery
|
|
158
|
+
"Cross-slice correctness: logic errors and boundary violations that span >1 slice",
|
|
159
|
+
"Race conditions and concurrency issues across slice boundaries",
|
|
160
|
+
"Null/undefined handling in shared paths",
|
|
161
|
+
"Error propagation and recovery across module seams (single-slice findings stay in tdd Per-Slice Review)"
|
|
160
162
|
],
|
|
161
163
|
stopGate: true
|
|
162
164
|
},
|
|
@@ -171,24 +173,22 @@ export const REVIEW = {
|
|
|
171
173
|
stopGate: true
|
|
172
174
|
},
|
|
173
175
|
{
|
|
174
|
-
title: "
|
|
176
|
+
title: "Performance Lens: Carry-forward from Design",
|
|
175
177
|
evaluationPoints: [
|
|
176
|
-
"
|
|
177
|
-
"
|
|
178
|
-
"
|
|
179
|
-
"Hot path complexity analysis"
|
|
178
|
+
"Cite `03-design-<slug>.md > Performance Budget` per critical path",
|
|
179
|
+
"Surface DRIFT only when implementation diff measurably violates a budgeted threshold; do NOT re-derive performance findings from scratch",
|
|
180
|
+
"Hot path / N+1 / caching observations belong here only when they cross slice boundaries and were not flagged by tdd Per-Slice Review"
|
|
180
181
|
],
|
|
181
|
-
stopGate:
|
|
182
|
+
stopGate: false
|
|
182
183
|
},
|
|
183
184
|
{
|
|
184
|
-
title: "
|
|
185
|
+
title: "Architecture Lens: Carry-forward from Design",
|
|
185
186
|
evaluationPoints: [
|
|
186
|
-
"
|
|
187
|
-
"
|
|
188
|
-
"
|
|
189
|
-
"Unintended architectural drift"
|
|
187
|
+
"Cite `03-design-<slug>.md > Architecture Decision Record (ADR)` and `Engineering Lock`",
|
|
188
|
+
"Surface DRIFT only when the implementation departs from the locked architecture; do NOT re-derive boundary/coupling/interface analysis from scratch",
|
|
189
|
+
"Cross-slice architectural drift findings use `file:line` plus the violated ADR ID"
|
|
190
190
|
],
|
|
191
|
-
stopGate:
|
|
191
|
+
stopGate: false
|
|
192
192
|
},
|
|
193
193
|
{
|
|
194
194
|
title: "Specialist Lens: External Safety Checklist",
|
|
@@ -13,7 +13,7 @@ export const SCOPE = {
|
|
|
13
13
|
philosophy: {
|
|
14
14
|
hardGate: "Do NOT begin architecture, design, or code. This stage produces scope decisions only. Do not silently add or remove scope — every change is an explicit user opt-in.",
|
|
15
15
|
ironLaw: "EVERY SCOPE CHANGE IS AN EXPLICIT USER OPT-IN — NEVER A SILENT ENLARGEMENT OR TRIM.",
|
|
16
|
-
purpose: "Decide the right scope before technical lock-in using explicit mode selection and
|
|
16
|
+
purpose: "Decide the right scope before technical lock-in using explicit mode selection and the brainstorm premise as carry-forward (not re-authored).",
|
|
17
17
|
whenToUse: [
|
|
18
18
|
"After brainstorm approval",
|
|
19
19
|
"Before architecture/design lock-in",
|
|
@@ -28,7 +28,8 @@ export const SCOPE = {
|
|
|
28
28
|
"Skipping pre-scope audit because the task looks small",
|
|
29
29
|
"Scope silently expanded during discussion",
|
|
30
30
|
"No explicit out-of-scope section",
|
|
31
|
-
"Premise
|
|
31
|
+
"Re-authoring brainstorm's `## Premise Check` instead of citing it via Upstream Handoff (premise carry-forward only)",
|
|
32
|
+
"Enumerating Implementation Alternatives in scope (architecture-tier choice belongs to design)",
|
|
32
33
|
"Sycophantic agreement without evidence-based pushback",
|
|
33
34
|
"Hedged recommendations that avoid taking a position",
|
|
34
35
|
"Batching multiple scope issues into one question",
|
|
@@ -45,15 +46,16 @@ export const SCOPE = {
|
|
|
45
46
|
},
|
|
46
47
|
executionModel: {
|
|
47
48
|
checklist: [
|
|
48
|
-
"**ADAPTIVE ELICITATION COMES FIRST (no exceptions, no subagent dispatch before).** Load `.cclaw/skills/adaptive-elicitation/SKILL.md`. Walk the scope 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
|
|
49
|
+
"**ADAPTIVE ELICITATION COMES FIRST (no exceptions, no subagent dispatch before).** Load `.cclaw/skills/adaptive-elicitation/SKILL.md`. Walk the scope 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 propose the scope contract draft, recommend a mode, or dispatch any delegations. The linter `qa_log_unconverged` rule will block `stage-complete` if convergence is not reached.",
|
|
49
50
|
"**Scope forcing questions (must be covered or explicitly waived)** — what is definitely in/out, which upstream decisions are locked, and what rollback path protects users if scope assumptions fail.",
|
|
50
51
|
"**Scope contract first** — read brainstorm handoff, name upstream decisions used, explicit drift, confidence, unresolved questions, and next-stage risk hints; draft the in-scope/out-of-scope/deferred/discretion contract before any design choice.",
|
|
51
|
-
"**Premise
|
|
52
|
+
"**Premise carry-forward (do NOT re-author)** — brainstorm OWNS the premise check (right problem / direct path / what if nothing). Cite brainstorm's `## Premise Check` section in `## Upstream Handoff > Decisions carried forward`. Add a row to `## Premise Drift` only when the scope-stage Q&A surfaced NEW evidence that materially changes the brainstorm answer (e.g. new constraint, new user signal). Otherwise mark `Premise Drift: None` — do not duplicate the brainstorm premise table.",
|
|
52
53
|
"**Conditional 10-star boundary** — for deep/high-risk/product-strategy work, show what would make the product meaningfully better, then explicitly choose what ships now, what is deferred, and what is excluded without vague `later/for now` placeholders. Skip this for straightforward repair work and record `not needed: compact scope`.",
|
|
53
54
|
"**Pick one operational mode with the user** — HOLD SCOPE preserves focus; SELECTIVE EXPANSION cherry-picks high-leverage reference ideas; SCOPE EXPANSION explores ambitious alternatives; SCOPE REDUCTION cuts to the essential wedge. Recommend one, state why and what signal would change it, then keep elicitation focused until the user either approves or asks to proceed with draft boundaries.",
|
|
54
55
|
"**Run mode-specific analysis only to needed depth** — lite keeps the selected-mode row compact; standard adds requirements/locked decisions/discretion; deep may add Landscape Check, Taste Calibration, Reference Pattern Registry, Reference Pull, Ambitious Alternatives, and Ruthless Minimum Slice evidence when mode/risk warrants it.",
|
|
55
56
|
"**Decision-driver contract** — list weighted decision drivers (value, risk, reversibility, effort, timeline) and score candidate scope moves so the selected mode and boundaries are evidence-backed, not preference-led.",
|
|
56
|
-
"**
|
|
57
|
+
"**Architecture handoff (do NOT pick architecture tier here)** — design OWNS architecture choice (minimum-viable / product-grade / ideal). Scope only picks the SCOPE MODE (HOLD/SELECTIVE/EXPAND/REDUCE) and boundary; record in `## Scope Contract > Design handoff` what design must decide (e.g. `architecture-tier`, `framework`, `data-model`). Do NOT enumerate Implementation Alternatives in scope.",
|
|
58
|
+
"**Constraints (carry-forward from brainstorm/external sources)** — record explicit external/regulatory/system/integration constraints in `## Scope Contract > Constraints`. Spec OWNS testable assumptions (`## Assumptions Before Finalization`); do NOT duplicate constraint material as assumption material.",
|
|
57
59
|
"**Run outside voice before final approval** — for simple/low-risk scope, record one concise adversarial self-check row; for complex/high-risk/configured scope, iterate until threshold. Record the loop summary in `## Scope Outside Voice Loop`, but do not treat it as user approval.",
|
|
58
60
|
"**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.",
|
|
59
61
|
"**Ask only one decision-changing question** — if the user rejects the contract but is unsure, offer 3-4 concrete scope moves instead of open-ended interrogation.",
|
|
@@ -65,21 +67,21 @@ export const SCOPE = {
|
|
|
65
67
|
"Run the shared adaptive elicitation cycle from `.cclaw/skills/adaptive-elicitation/SKILL.md`, including stop-signal handling (RU/EN/UA), smart-skip, conditional grilling triggers, and append-only `## Q&A Log` updates.",
|
|
66
68
|
"**Lead with adaptive elicitation, not with a proposed contract.** First walk scope forcing questions one-at-a-time per `adaptive-elicitation` skill. Only AFTER the Q&A loop converges (forcing-Qs answered/waived OR user stop-signal row recorded) propose the scope contract draft for approval. Lite-tier may compress: ask the smallest forcing-Q set (>= linter floor for `lightweight`/`scope`), then propose contract.",
|
|
67
69
|
"For low-risk concrete asks, keep the proposal compact but still explicit: recommend (do not auto-select) one mode, show exact in/out/deferred boundaries, and request explicit approval before finalizing the artifact or completing the stage.",
|
|
68
|
-
"
|
|
70
|
+
"Cite brainstorm's premise via `## Upstream Handoff` and take a firm position on whether scope-stage Q&A surfaced any premise drift; do NOT re-author the brainstorm Premise Check table.",
|
|
69
71
|
"Push back on weak framing: vague scope needs a specific user/problem, platform vision needs a narrow wedge, social proof needs behavioral evidence.",
|
|
70
72
|
"Resolve one structural scope issue at a time. Only non-critical preference/default assumptions may continue; STOP on uncertainty about scope boundary, architecture commitment, security, data loss, public API, migration, auth/pricing, or required user approval.",
|
|
71
73
|
"If the user says no but cannot name the change, offer concrete moves: keep scope, add one obvious adjacent capability, reduce to wedge, or re-open stack/product direction.",
|
|
72
74
|
"Before final approval, record outside-voice findings and a `## Scope Outside Voice Loop` table per the Scope Outside Voice Loop policy above.",
|
|
73
75
|
"**STOP.** Wait for explicit user approval of the scope mode and scope contract before writing final approval language or advancing.",
|
|
74
|
-
"**STOP BEFORE ADVANCE.** Mandatory delegation `planner` runs **AFTER user approval of the scope contract**, not before Q&A. Sequence is: Q&A loop -> propose contract -> user approval -> `planner` delegation -> `stage-complete`. If you delegate `planner` before the Q&A loop converges, you violate the elicitation contract and the linter will block stage-complete via `
|
|
76
|
+
"**STOP BEFORE ADVANCE.** Mandatory delegation `planner` runs **AFTER user approval of the scope contract**, not before Q&A. Sequence is: Q&A loop -> propose contract -> user approval -> `planner` delegation -> `stage-complete`. If you delegate `planner` before the Q&A loop converges, you violate the elicitation contract and the linter will block stage-complete via `qa_log_unconverged`. Legal fulfillment modes for `planner`: (a) **harness-native Task tool** — run the delegation, then record the lifecycle row via `node .cclaw/hooks/delegation-record.mjs --stage=scope --agent=planner --mode=mandatory --status=completed --span-id=<uuid> --dispatch-surface=cursor-task --agent-definition-path=<agent-md-path> --evidence-ref=<artifact#section>` (the helper sets `fulfillmentMode: \"generic-dispatch\"` automatically); (b) **role-switch** — announce `## cclaw role-switch: scope/planner (mandatory)`, write the planner output/evidence into the scope artifact, then record the row with `--dispatch-surface=role-switch --agent-definition-path=<artifact-anchor>` (helper sets `fulfillmentMode: \"role-switch\"` automatically); (c) **cclaw subagent helper** if available, with `--dispatch-surface=isolated`. Run `node .cclaw/hooks/stage-complete.mjs scope` from the tool layer (do not paste the command into chat); report only the resulting summary."
|
|
75
77
|
],
|
|
76
78
|
process: [
|
|
77
|
-
"Run pre-scope audit
|
|
78
|
-
"
|
|
79
|
-
"
|
|
80
|
-
"Recommend a scope mode with explicit rationale, then ask for user opt-in before treating it as selected.",
|
|
79
|
+
"Run pre-scope system audit (git log/diff/stash + debt-marker scan) — scope OWNS the repo audit; design will only diff the blast radius since this scope baseline.",
|
|
80
|
+
"Cite brainstorm's premise check via Upstream Handoff; record `## Premise Drift` only when the scope-stage Q&A surfaced new evidence that materially changes brainstorm's answer.",
|
|
81
|
+
"Run the scope pass scaled to risk: default to job-to-be-done plus explicit scope contract; add 10-star upside, smallest useful wedge, and change conditions only for deep/high-risk scope.",
|
|
82
|
+
"Recommend a scope mode (HOLD/SELECTIVE/EXPAND/REDUCE) with explicit rationale, then ask for user opt-in before treating it as selected. Do NOT enumerate architecture alternatives — design owns architecture choice.",
|
|
81
83
|
"Run outside voice / adversarial self-check before final approval and record a valid `## Scope Outside Voice Loop` table.",
|
|
82
|
-
"Write explicit scope contract, discretion areas, deferred items, error/rescue registry, and D-XX locked decisions.",
|
|
84
|
+
"Write explicit scope contract, discretion areas, deferred items, error/rescue registry, constraints (external/regulatory/system), and D-XX locked decisions.",
|
|
83
85
|
"Produce scope summary, completion dashboard, and exact next-stage handoff before asking final approval."
|
|
84
86
|
],
|
|
85
87
|
requiredGates: [
|
|
@@ -98,7 +100,8 @@ export const SCOPE = {
|
|
|
98
100
|
"Decision Drivers section records weighted criteria and per-option scores used to choose mode and boundary moves.",
|
|
99
101
|
"Scope Completeness Score is recorded (0.00-1.00) with the explicit blocker list for any remaining uncertainty.",
|
|
100
102
|
"Locked Decisions section lists stable D-XX IDs for non-negotiable boundaries.",
|
|
101
|
-
"Premise
|
|
103
|
+
"Premise carry-forward recorded: brainstorm `## Premise Check` cited in `## Upstream Handoff > Decisions carried forward`; `## Premise Drift` is `None` unless new scope-stage evidence materially changes brainstorm's answer.",
|
|
104
|
+
"Constraints (external/regulatory/system/integration) recorded in `## Scope Contract > Constraints` — spec must reference these in `## Constraints and Assumptions`, not restate them.",
|
|
102
105
|
"Outside Voice findings and dispositions are recorded (accept/reject/defer with rationale) before final approval.",
|
|
103
106
|
"Scope outside-voice loop summary includes a table with columns Iteration, Quality Score, Findings, plus Stop reason, Target score, Max iterations, and unresolved concerns. This is outside-voice evidence only; it does not satisfy user approval.",
|
|
104
107
|
"Early-loop status is reflected via `Victory Detector` / `Critic Pass` sections and `.cclaw/state/early-loop.json` when concerns remain.",
|
|
@@ -148,10 +151,10 @@ export const SCOPE = {
|
|
|
148
151
|
},
|
|
149
152
|
artifactValidation: [
|
|
150
153
|
{ section: "Upstream Handoff", required: false, validationRule: "Summarizes brainstorm/idea decisions, constraints, open questions, and explicit drift before scope decisions." },
|
|
151
|
-
{ section: "Pre-Scope System Audit", required: true, validationRule: "Must capture git log -30, git diff --stat, git stash list, and debt-marker scan (TODO/FIXME/XXX/HACK)
|
|
154
|
+
{ section: "Pre-Scope System Audit", required: true, validationRule: "Must capture git log -30, git diff --stat, git stash list, and debt-marker scan (TODO/FIXME/XXX/HACK). Scope OWNS the repo audit; design will only diff the blast radius since this scope baseline." },
|
|
152
155
|
{ section: "Prime Directives", required: false, validationRule: "For each scoped capability: named failure modes, explicit error surface, four data-flow paths, interaction edge cases, observability expectations, and deferred-item handling." },
|
|
153
|
-
{ section: "Premise
|
|
154
|
-
{ section: "Scope Contract", required: true, validationRule: "Canonical contract: selected mode, in scope, out of scope, requirements, locked decisions, discretion areas, deferred ideas, accepted/rejected reference ideas, success definition, and design handoff." },
|
|
156
|
+
{ section: "Premise Drift", required: false, validationRule: "Optional carry-forward marker: brainstorm OWNS the premise check. State `None` unless scope-stage Q&A surfaced new evidence (constraint, user signal, regulatory change) that materially changes brainstorm's `## Premise Check` answer; in that case record one or more drift rows citing the new evidence and the affected brainstorm question." },
|
|
157
|
+
{ section: "Scope Contract", required: true, validationRule: "Canonical contract: selected mode, in scope, out of scope, requirements, locked decisions, discretion areas, deferred ideas, accepted/rejected reference ideas, constraints (external/regulatory/system/integration), success definition, and design handoff. Architecture choice is delegated to design — do NOT enumerate Implementation Alternatives here." },
|
|
155
158
|
{ section: "Decision Drivers", required: false, validationRule: "Recommended: weighted decision drivers (value, risk, reversibility, effort, timeline) with scored options and the selected boundary rationale." },
|
|
156
159
|
{ section: "Scope Completeness Score", required: false, validationRule: "Recommended: score 0.00-1.00 plus unresolved blockers and the escalation trigger when confidence is low." },
|
|
157
160
|
{ section: "Landscape Check", required: false, validationRule: "Optional evidence heading for EXPAND/SELECTIVE/deep modes: include reference insight and impact on scope, or omit for compact HOLD SCOPE." },
|
|
@@ -162,7 +165,6 @@ export const SCOPE = {
|
|
|
162
165
|
{ section: "Ruthless Minimum Slice", required: false, validationRule: "Optional evidence heading for SCOPE REDUCTION or high-risk scope: define the smallest useful wedge and what it proves." },
|
|
163
166
|
{ section: "Requirements", required: false, validationRule: "Table of stable requirement IDs (R1, R2, R3…) one per row with observable outcome, priority, and source. IDs are assigned once and never renumbered across scope/design/spec/plan/review; dropped requirements stay with Priority `DROPPED`." },
|
|
164
167
|
{ section: "Locked Decisions", required: false, validationRule: "List of stable locked decisions, each with a unique `D-XX` ID. IDs are stable across edits so downstream stages can reference them; renumbering or duplicating IDs breaks the cross-stage traceability check." },
|
|
165
|
-
{ section: "Implementation Alternatives", required: false, validationRule: "2-3 options with Name, Summary, Effort, Risk, Pros, Cons, and Reuses. Must include minimal viable and ideal architecture options." },
|
|
166
168
|
{ section: "Scope Mode", required: true, validationRule: "Must state selected mode and rationale with default heuristic justification." },
|
|
167
169
|
{ section: "Mode-Specific Analysis", required: false, validationRule: "Default path: one selected-mode row with rationale. Deep/complex scope only: document the expanded analysis matching the selected mode." },
|
|
168
170
|
{ section: "In Scope / Out of Scope", required: true, validationRule: "Two separate explicit lists. Canonical form is one `## In Scope / Out of Scope` section with `### In Scope` and `### Out of Scope`; legacy split `## In Scope` and `## Out of Scope` headings are accepted. Out-of-scope must not be empty." },
|
|
@@ -39,8 +39,8 @@ export const SPEC = {
|
|
|
39
39
|
"Read upstream — standard track loads design + scope; medium loads brainstorm/spec handoff; quick loads `00-idea.md` plus any reproduction context. Cross-reference only artifacts that exist on the active track.",
|
|
40
40
|
"Define measurable acceptance criteria — each criterion must be observable and falsifiable. No vague adjectives.",
|
|
41
41
|
"Capture edge cases — for each criterion, define at least one boundary condition and one error condition.",
|
|
42
|
-
"
|
|
43
|
-
"
|
|
42
|
+
"**Constraints carry-forward (do NOT re-author).** Scope OWNS external/regulatory/system/integration constraints in `## Scope Contract > Constraints`. Cite them in `## Constraints and Assumptions > Constraints` (or mark `See scope: <ref>`). Add a constraint here only when spec-stage analysis surfaced a NEW one not present in scope. Spec OWNS testable assumptions (next bullet). 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.",
|
|
43
|
+
"**Assumptions Before Finalization (spec-only owner).** Spec OWNS testable assumptions: list each with source/confidence, validation path, and accepted/rejected/open disposition in `## Assumptions Before Finalization`. Do NOT duplicate scope's constraints here as assumptions.",
|
|
44
44
|
"Build the Acceptance Mapping contract — for each AC, map upstream design decision, observable evidence, verification method, and likely test level. If any column is unclear, rewrite the criterion.",
|
|
45
45
|
"Run Spec Self-Review — explicitly verify placeholder/consistency/scope/ambiguity checks before approval.",
|
|
46
46
|
"Present acceptance criteria to the user in 3-5-item batches, pausing for explicit ACK between batches (see Interaction Protocol).",
|
|
@@ -119,7 +119,7 @@ export const SPEC = {
|
|
|
119
119
|
{ section: "Acceptance Criteria", required: true, validationRule: "Each criterion is observable, measurable, and falsifiable. Standard track should include Requirement Ref and Design Decision Ref columns; quick track may instead link each AC to the reproduction contract or bug slice. AC IDs (AC-1, AC-2…) are stable across revisions — dropped ACs stay with Priority `DROPPED`." },
|
|
120
120
|
{ section: "Quick Reproduction Contract", required: false, validationRule: "Quick bug-fix specs own the reproduction contract: symptom, repro steps, expected RED test behavior, and acceptance criterion." },
|
|
121
121
|
{ section: "Edge Cases", required: true, validationRule: "At least one boundary and one error condition per criterion." },
|
|
122
|
-
{ section: "Constraints and Assumptions", required: false, validationRule: "
|
|
122
|
+
{ section: "Constraints and Assumptions", required: false, validationRule: "Constraints are CARRIED FORWARD from scope's `## Scope Contract > Constraints` (cite with `See scope: <ref>` or copy with attribution). New spec-stage constraints (rare) get a citation to the spec-stage Q&A row that surfaced them. Assumptions are owned by `## Assumptions Before Finalization` — do NOT duplicate them here. Section may be `- See scope: 02-scope.md#constraints.` for the common case." },
|
|
123
123
|
{ section: "Assumptions Before Finalization", required: true, validationRule: "Each assumption has source/confidence, validation path, and accepted/rejected/open disposition before the Approval section is finalized." },
|
|
124
124
|
{ section: "Acceptance Mapping", required: true, validationRule: "Each criterion maps to upstream design decision, observable evidence, verification method, likely test level (unit/integration/e2e/manual), and command or manual steps when known." },
|
|
125
125
|
{ section: "Non-Functional Requirements", required: false, validationRule: "If present: performance thresholds, security constraints, scalability limits, reliability targets with measurable values." },
|
|
@@ -52,6 +52,7 @@ export const TDD = {
|
|
|
52
52
|
"REFACTOR: continue the `test-author` evidence cycle (or a dedicated refactor mode when available) to improve code quality without behavior changes. Set `CCLAW_ACTIVE_AGENT=tdd-refactor` when the harness supports phase labels.",
|
|
53
53
|
"Record evidence — capture test discovery, system-wide impact check, RED failure, GREEN output, and REFACTOR notes in the TDD artifact. When logging a `green` row, attach the closed acceptance-criterion IDs in `acIds` so Ralph Loop status counts them.",
|
|
54
54
|
"Annotate traceability — link to the active track's source: plan task ID + spec criterion on standard/medium, or spec acceptance item / bug reproduction slice on quick.",
|
|
55
|
+
"**Boundary with review (do NOT escalate single-slice findings to whole-diff review).** `tdd.Per-Slice Review` OWNS severity-classified findings WITHIN one slice (correctness, edge cases, regression). `review` OWNS whole-diff Layer 1 (spec compliance) plus Layer 2 (cross-slice integration, security sweep, dependency/version audit, observability). When a single-slice finding genuinely needs whole-diff escalation, surface it in `06-tdd.md > Per-Slice Review` first; review will cite it (not re-classify) and the cross-artifact-duplication linter requires matching severity/disposition.",
|
|
55
56
|
"Per-Slice Review (conditional) — if the slice meets any trigger (touchCount >= filesChangedThreshold, touchPaths match touchTriggers, or highRisk=true), append a `## Per-Slice Review` entry for this slice before moving on (see the dedicated section below).",
|
|
56
57
|
"Repeat for each slice — return to step 1 for the next plan slice."
|
|
57
58
|
],
|
|
@@ -6,6 +6,6 @@ export declare const RULEBOOK_MARKDOWN = "# Cclaw Rulebook\n\n## MUST_ALWAYS\n-
|
|
|
6
6
|
* loading skills. Three hard rules cover the most common Wave 22 regressions
|
|
7
7
|
* (premature draft, premature subagent dispatch, command-line echo to chat).
|
|
8
8
|
*/
|
|
9
|
-
export declare const CURSOR_GUIDELINES_RULE_MDC = "---\ndescription: cclaw zero-install behavior baseline (always-on)\nglobs:\n - \"**/*\"\nalwaysApply: true\n---\n\n<!-- cclaw-managed-cursor-guidelines-rule -->\n\n# Cclaw Baseline Guidelines\n\nThese three rules apply to every Cursor agent session in this project,\nregardless of whether stage skills loaded.\n\n## 1. Q&A floor before drafting (brainstorm/scope/design)\n\nBefore drafting any `.cclaw/artifacts/01-brainstorm-*.md`,\n`02-scope-*.md`, or `03-design-*.md`, verify that the artifact's\n`## Q&A Log` table
|
|
10
|
-
export declare const CURSOR_WORKFLOW_RULE_MDC = "---\ndescription: cclaw workflow guardrails for Cursor agent sessions\nglobs:\n - \"**/*\"\nalwaysApply: true\n---\n\n<!-- cclaw-managed-cursor-workflow-rule -->\n\n# Cclaw Workflow Guardrails\n\n## Activation Rule\n\nBefore responding to coding work:\n1. Read `.cclaw/state/flow-state.json`.\n2. Start with `/cc` or continue with `/cc`.\n3. If no software-stage flow applies, respond normally.\n\n## Stage Order\n\n`brainstorm -> scope -> design -> spec -> plan -> tdd -> review -> ship`\n\nTrack-specific skips are allowed only when `flow-state.track` + `skippedStages` explicitly say so.\n\n## Task Classification\n\n| Class | Route |\n|---|---|\n| non-trivial software work | `/cc <idea>` |\n| trivial software fix | `/cc <idea>` (quick track) |\n| bugfix with repro | `/cc <idea>` and enforce RED-first in tdd |\n| pure question / non-software | direct answer (no stage flow) |\n\n## Command Surface\n\n- `/cc` = entry and resume.\n- `/cc` = only progression path.\n- Knowledge capture and recall use the `learnings` skill when requested.\n\n## Verification Discipline\n\n- No completion claim without fresh command evidence in this turn.\n- Do not mark gates passed from memory.\n- Keep evidence in `.cclaw/artifacts/`; archive through closeout via `/cc` or cancel early via `node .cclaw/hooks/cancel-run.mjs`.\n\n## Delegation And Approvals\n\n- Machine-only checks in design/plan/tdd/review/ship should auto-dispatch when tooling supports it.\n- **For brainstorm / scope / design stages**: ask user input continuously via adaptive elicitation (one question per turn through the harness-native question tool \u2014 `AskQuestion` in Cursor). Walk the stage forcing-questions list one-by-one. Do NOT batch and do NOT defer to a single approval gate at the end. The `
|
|
9
|
+
export declare const CURSOR_GUIDELINES_RULE_MDC = "---\ndescription: cclaw zero-install behavior baseline (always-on)\nglobs:\n - \"**/*\"\nalwaysApply: true\n---\n\n<!-- cclaw-managed-cursor-guidelines-rule -->\n\n# Cclaw Baseline Guidelines\n\nThese three rules apply to every Cursor agent session in this project,\nregardless of whether stage skills loaded.\n\n## 1. Q&A floor before drafting (brainstorm/scope/design)\n\nBefore drafting any `.cclaw/artifacts/01-brainstorm-*.md`,\n`02-scope-*.md`, or `03-design-*.md`, verify that the artifact's\n`## Q&A Log` table demonstrates Ralph-Loop convergence: forcing-question\ntopics are addressed (see the stage's forcing-questions checklist row),\nthe last 2 turns produce no new decision-changing impact, OR an explicit\nuser stop-signal row is recorded. Walk the stage forcing questions one at\na time via the `AskQuestion` tool. If you find yourself proposing a\ndraft after 1-2 questions while forcing topics remain unaddressed, STOP\nand continue the loop.\n\nThe `qa_log_unconverged` linter rule will block `stage-complete` when\nconvergence has not been reached.\n\n## 2. Mandatory subagents run after Q&A approval\n\nFor brainstorm / scope / design, mandatory subagents (\n`product-discovery`, `critic`, `planner`, `architect`,\n`test-author`) run **only AFTER the user approves the elicitation\noutcome**, never before the Q&A loop converges. Dispatching them early\npreempts the user dialogue and violates the elicitation contract \u2014 the\nlinter will block stage-complete.\n\nSee each stage's \"Run Phase: post-elicitation\" rows in the materialized\nAutomatic Subagent Dispatch table.\n\n## 3. Never echo cclaw command lines to chat\n\nThe user does not run cclaw helpers (`node .cclaw/hooks/...`) manually.\nNEVER paste full command lines, `--evidence-json '{...}'` payloads,\n`--waive-delegation=...`, or shell hash commands (`shasum`,\n`sha256sum`, `Get-FileHash`, `certutil`, etc.) into chat. Run the\nhelper via the tool layer and report only the resulting summary. On\nfailure, report a compact human-readable summary plus the helper JSON in\na single fenced `json` block.\n";
|
|
10
|
+
export declare const CURSOR_WORKFLOW_RULE_MDC = "---\ndescription: cclaw workflow guardrails for Cursor agent sessions\nglobs:\n - \"**/*\"\nalwaysApply: true\n---\n\n<!-- cclaw-managed-cursor-workflow-rule -->\n\n# Cclaw Workflow Guardrails\n\n## Activation Rule\n\nBefore responding to coding work:\n1. Read `.cclaw/state/flow-state.json`.\n2. Start with `/cc` or continue with `/cc`.\n3. If no software-stage flow applies, respond normally.\n\n## Stage Order\n\n`brainstorm -> scope -> design -> spec -> plan -> tdd -> review -> ship`\n\nTrack-specific skips are allowed only when `flow-state.track` + `skippedStages` explicitly say so.\n\n## Task Classification\n\n| Class | Route |\n|---|---|\n| non-trivial software work | `/cc <idea>` |\n| trivial software fix | `/cc <idea>` (quick track) |\n| bugfix with repro | `/cc <idea>` and enforce RED-first in tdd |\n| pure question / non-software | direct answer (no stage flow) |\n\n## Command Surface\n\n- `/cc` = entry and resume.\n- `/cc` = only progression path.\n- Knowledge capture and recall use the `learnings` skill when requested.\n\n## Verification Discipline\n\n- No completion claim without fresh command evidence in this turn.\n- Do not mark gates passed from memory.\n- Keep evidence in `.cclaw/artifacts/`; archive through closeout via `/cc` or cancel early via `node .cclaw/hooks/cancel-run.mjs`.\n\n## Delegation And Approvals\n\n- Machine-only checks in design/plan/tdd/review/ship should auto-dispatch when tooling supports it.\n- **For brainstorm / scope / design stages**: ask user input continuously via adaptive elicitation (one question per turn through the harness-native question tool \u2014 `AskQuestion` in Cursor). Walk the stage forcing-questions list one-by-one. Do NOT batch and do NOT defer to a single approval gate at the end. The `qa_log_unconverged` linter rule will block `stage-complete` when convergence is not reached (forcing topics unaddressed AND last 2 turns still produce decision-changing rows AND no stop-signal).\n- **For other stages** (spec/plan/tdd/build/review/ship): ask user input only at explicit approval gates (scope mode, plan approval, challenge resolution, ship finalization), not for routine progress updates.\n- If you find yourself proposing a draft after 1-2 questions in brainstorm/scope/design, STOP \u2014 go back to the forcing-questions list and continue.\n- Mandatory subagents in brainstorm/scope/design run only AFTER the user approves the elicitation outcome (see each stage's \"Run Phase: post-elicitation\" rows). Dispatching them before the Q&A loop converges violates the contract.\n- Never echo cclaw command lines (`node .cclaw/hooks/...`, `--evidence-json '{...}'`) to chat \u2014 the user does not run cclaw manually. Run helpers via the tool layer; report only the resulting summary.\n- If harness capabilities are partial, record waiver reasons in delegation logs.\n\n## Routing Source Of Truth\n\n- Primary router: `.cclaw/skills/using-cclaw/SKILL.md`.\n- Stage behavior: current stage skill plus `.cclaw/state/flow-state.json`.\n- Preamble budget: keep role/status announcements brief and avoid repeating\n them unless the stage or role changes.\n";
|
|
11
11
|
export declare function buildRulesJson(): Record<string, unknown>;
|
|
@@ -38,6 +38,13 @@ export const ARTIFACT_TEMPLATES = {
|
|
|
38
38
|
|---|---|---|---|
|
|
39
39
|
| | | | |
|
|
40
40
|
|
|
41
|
+
## Idea Evidence Carry-forward
|
|
42
|
+
> Required only when this brainstorm started from \`/cc-ideate\` (\`flow-state.interactionHints.brainstorm.fromIdeaArtifact\` is set). Skip the section entirely otherwise.
|
|
43
|
+
- Source: \`<.cclaw/ideas/idea-YYYY-MM-DD-slug.md>\`
|
|
44
|
+
- Candidate: \`I-#\`
|
|
45
|
+
- Reused fields: Title, Why-now, Expected impact, Risk, Counter-argument
|
|
46
|
+
- Newly generated: challenger row(s) only — the idea candidate becomes the \`baseline\` row of \`## Approaches\` and the seed of \`## Selected Direction\`; do NOT regenerate divergent + critique + rank work that \`/cc-ideate\` already produced.
|
|
47
|
+
|
|
41
48
|
## Problem Decision Record
|
|
42
49
|
- **Depth:** lite | standard | deep
|
|
43
50
|
- **Frame type:** \`<free-form-label>\` (one short token that names how this work is framed; pick whatever fits — examples in commentary only: \`product\`, \`technical-maintenance\`, \`research-spike\`, \`ops-incident\`, \`infrastructure\`, \`library-extraction\`. Do NOT treat the examples as an enum.)
|
|
@@ -219,23 +226,14 @@ ${MARKDOWN_CODE_FENCE}
|
|
|
219
226
|
- Every error has a name:
|
|
220
227
|
- Four paths per data flow:
|
|
221
228
|
|
|
222
|
-
## Premise
|
|
223
|
-
|
|
224
|
-
|---|---|---|
|
|
225
|
-
| Right problem? | | |
|
|
226
|
-
| Direct path? | | |
|
|
227
|
-
| What if we do nothing? | | |
|
|
228
|
-
| Existing-code leverage? | | |
|
|
229
|
-
| Reversibility cost? | | |
|
|
230
|
-
|
|
231
|
-
## Implementation Alternatives
|
|
232
|
-
| Option | Summary | Effort (S/M/L/XL) | Risk (Low/Med/High) | Pros | Cons | Reuses |
|
|
233
|
-
|---|---|---|---|---|---|---|
|
|
234
|
-
| A (minimum viable) | | | | | | |
|
|
235
|
-
| B (ideal architecture) | | | | | | |
|
|
236
|
-
| C (optional) | | | | | | |
|
|
229
|
+
## Premise Drift
|
|
230
|
+
> Optional. Brainstorm OWNS the premise check. Record \`None\` unless scope-stage Q&A surfaced new evidence (constraint, user signal, regulatory change) that materially changes brainstorm's \`## Premise Check\` answer.
|
|
237
231
|
|
|
238
|
-
|
|
232
|
+
| Brainstorm question | New evidence (scope-stage) | Drift verdict (no-change / shift / reverse) | Action |
|
|
233
|
+
|---|---|---|---|
|
|
234
|
+
| (cite brainstorm Q) | | | |
|
|
235
|
+
|
|
236
|
+
- Default: \`Drift: None — brainstorm Premise Check stands.\`
|
|
239
237
|
|
|
240
238
|
## Scope Contract
|
|
241
239
|
- **Selected mode:** HOLD SCOPE | SELECTIVE EXPANSION | SCOPE EXPANSION | SCOPE REDUCTION
|
|
@@ -247,8 +245,9 @@ RECOMMENDATION: <option letter — one-line rationale tying back to premise chal
|
|
|
247
245
|
- **Deferred ideas:**
|
|
248
246
|
- **Accepted reference ideas:**
|
|
249
247
|
- **Rejected reference ideas:**
|
|
248
|
+
- **Constraints (external/regulatory/system/integration):** (spec carries these forward — do NOT restate as assumptions)
|
|
250
249
|
- **Success definition:**
|
|
251
|
-
- **Design handoff:**
|
|
250
|
+
- **Design handoff:** (name what design must decide: architecture-tier, framework, data-model, etc. — design OWNS the architecture choice)
|
|
252
251
|
|
|
253
252
|
## Decision Drivers
|
|
254
253
|
| Driver | Weight (1-5) | Option A | Option B | Option C | Notes |
|
|
@@ -528,8 +527,12 @@ ${MARKDOWN_CODE_FENCE}
|
|
|
528
527
|
|---|---|---|---|---|
|
|
529
528
|
| | | | clear/stale | |
|
|
530
529
|
|
|
531
|
-
##
|
|
532
|
-
|
|
530
|
+
## Blast-radius Diff
|
|
531
|
+
> Diff since scope artifact baseline. Scope OWNS the full repo audit (\`## Pre-Scope System Audit\`); design only diffs touched paths.
|
|
532
|
+
>
|
|
533
|
+
> Suggested command: \`git diff <scope-artifact-head-sha>..HEAD -- <touched-paths>\`
|
|
534
|
+
|
|
535
|
+
| File | Change since scope (\`git diff\` summary) | Current responsibility | Reuse candidate / existing pattern |
|
|
533
536
|
|---|---|---|---|
|
|
534
537
|
| | | | |
|
|
535
538
|
|
|
@@ -624,9 +627,6 @@ ${MARKDOWN_CODE_FENCE}
|
|
|
624
627
|
- Max iterations: 3
|
|
625
628
|
- Unresolved concerns:
|
|
626
629
|
|
|
627
|
-
## NOT in scope
|
|
628
|
-
-
|
|
629
|
-
|
|
630
630
|
## Parallelization Strategy
|
|
631
631
|
- Standard/Deep add-on when multi-module; omit for compact sequential work.
|
|
632
632
|
- Parallel lanes:
|
|
@@ -722,8 +722,10 @@ ${MARKDOWN_CODE_FENCE}
|
|
|
722
722
|
| AC-1 | | |
|
|
723
723
|
|
|
724
724
|
## Constraints and Assumptions
|
|
725
|
-
-
|
|
726
|
-
|
|
725
|
+
> Constraints are CARRIED FORWARD from scope's \`## Scope Contract > Constraints\`. Cite or copy with attribution; do NOT re-author. Spec OWNS testable assumptions in \`## Assumptions Before Finalization\` below.
|
|
726
|
+
|
|
727
|
+
- **Constraints (carry-forward):** See scope: \`02-scope-<slug>.md#scope-contract\` (or list new spec-stage constraints with citation to the Q&A row that surfaced them).
|
|
728
|
+
- **Assumptions:** See \`## Assumptions Before Finalization\` (spec-only owner).
|
|
727
729
|
|
|
728
730
|
## Assumptions Before Finalization
|
|
729
731
|
| Assumption | Source / confidence | Validation path | Disposition |
|
|
@@ -1184,9 +1186,14 @@ Execution rule: complete and verify each batch before starting the next batch.
|
|
|
1184
1186
|
| AC-1 | PASS/FAIL | |
|
|
1185
1187
|
|
|
1186
1188
|
## Layer 2 Findings
|
|
1189
|
+
> Wave 23 (v5.0.0): Layer 2 categories OWNED by review = cross-slice correctness, security, dependency/version, observability, external-safety. Performance + architecture findings are CARRY-FORWARD from \`03-design-<slug>.md\` (Performance Budget, ADR) — cite, do NOT re-derive. Single-slice findings stay in \`06-tdd.md > Per-Slice Review\`; review may cite their IDs (severity/disposition must match — cross-artifact-duplication linter blocks otherwise).
|
|
1190
|
+
|
|
1187
1191
|
| ID | Severity | Category | File:line / no-line reason | Description | Status |
|
|
1188
1192
|
|---|---|---|---|---|---|
|
|
1189
|
-
| R-1 | Critical/Important/Suggestion | correctness/security/
|
|
1193
|
+
| R-1 | Critical/Important/Suggestion | cross-slice-correctness/security/dependency-version/observability/external-safety | path:line | | open/resolved |
|
|
1194
|
+
| R-2 | from-design | performance | cite \`03-design-<slug>.md > Performance Budget\` | | carry-forward |
|
|
1195
|
+
| R-3 | from-design | architecture | cite \`03-design-<slug>.md > ADR\` | | carry-forward |
|
|
1196
|
+
| R-4 | from-tdd | from-tdd | cite \`06-tdd.md > Per-Slice Review > F-<n>\` | | carry-forward |
|
|
1190
1197
|
- NO_FINDINGS_ATTESTATION: <required when no findings are reported; cite inspected coverage>
|
|
1191
1198
|
|
|
1192
1199
|
## Lens Coverage
|
|
@@ -1477,13 +1484,16 @@ regardless of whether stage skills loaded.
|
|
|
1477
1484
|
|
|
1478
1485
|
Before drafting any \`.cclaw/artifacts/01-brainstorm-*.md\`,
|
|
1479
1486
|
\`02-scope-*.md\`, or \`03-design-*.md\`, verify that the artifact's
|
|
1480
|
-
\`## Q&A Log\` table
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1487
|
+
\`## Q&A Log\` table demonstrates Ralph-Loop convergence: forcing-question
|
|
1488
|
+
topics are addressed (see the stage's forcing-questions checklist row),
|
|
1489
|
+
the last 2 turns produce no new decision-changing impact, OR an explicit
|
|
1490
|
+
user stop-signal row is recorded. Walk the stage forcing questions one at
|
|
1491
|
+
a time via the \`AskQuestion\` tool. If you find yourself proposing a
|
|
1492
|
+
draft after 1-2 questions while forcing topics remain unaddressed, STOP
|
|
1493
|
+
and continue the loop.
|
|
1484
1494
|
|
|
1485
|
-
The \`
|
|
1486
|
-
|
|
1495
|
+
The \`qa_log_unconverged\` linter rule will block \`stage-complete\` when
|
|
1496
|
+
convergence has not been reached.
|
|
1487
1497
|
|
|
1488
1498
|
## 2. Mandatory subagents run after Q&A approval
|
|
1489
1499
|
|
|
@@ -1555,7 +1565,7 @@ Track-specific skips are allowed only when \`flow-state.track\` + \`skippedStage
|
|
|
1555
1565
|
## Delegation And Approvals
|
|
1556
1566
|
|
|
1557
1567
|
- Machine-only checks in design/plan/tdd/review/ship should auto-dispatch when tooling supports it.
|
|
1558
|
-
- **For brainstorm / scope / design stages**: ask user input continuously via adaptive elicitation (one question per turn through the harness-native question tool — \`AskQuestion\` in Cursor). Walk the stage forcing-questions list one-by-one. Do NOT batch and do NOT defer to a single approval gate at the end. The \`
|
|
1568
|
+
- **For brainstorm / scope / design stages**: ask user input continuously via adaptive elicitation (one question per turn through the harness-native question tool — \`AskQuestion\` in Cursor). Walk the stage forcing-questions list one-by-one. Do NOT batch and do NOT defer to a single approval gate at the end. The \`qa_log_unconverged\` linter rule will block \`stage-complete\` when convergence is not reached (forcing topics unaddressed AND last 2 turns still produce decision-changing rows AND no stop-signal).
|
|
1559
1569
|
- **For other stages** (spec/plan/tdd/build/review/ship): ask user input only at explicit approval gates (scope mode, plan approval, challenge resolution, ship finalization), not for routine progress updates.
|
|
1560
1570
|
- If you find yourself proposing a draft after 1-2 questions in brainstorm/scope/design, STOP — go back to the forcing-questions list and continue.
|
|
1561
1571
|
- Mandatory subagents in brainstorm/scope/design run only AFTER the user approves the elicitation outcome (see each stage's "Run Phase: post-elicitation" rows). Dispatching them before the Q&A loop converges violates the contract.
|
package/dist/flow-state.d.ts
CHANGED
|
@@ -93,6 +93,18 @@ export interface StageInteractionHint {
|
|
|
93
93
|
skipQuestions?: boolean;
|
|
94
94
|
sourceStage?: FlowStage;
|
|
95
95
|
recordedAt?: string;
|
|
96
|
+
/**
|
|
97
|
+
* Wave 23 (v5.0.0) — `/cc-ideate` handoff carry-forward.
|
|
98
|
+
* When a brainstorm run is started from a `/cc-ideate` recommendation,
|
|
99
|
+
* `start-flow` records the originating idea artifact so brainstorm can
|
|
100
|
+
* reuse the divergent + critique + rank work instead of re-generating it.
|
|
101
|
+
*
|
|
102
|
+
* `fromIdeaArtifact` is a workspace-relative POSIX path to
|
|
103
|
+
* `.cclaw/ideas/idea-YYYY-MM-DD-<slug>.md` (or wherever `/cc-ideate`
|
|
104
|
+
* wrote its artifact). `fromIdeaCandidateId` is the chosen `I-#` row.
|
|
105
|
+
*/
|
|
106
|
+
fromIdeaArtifact?: string;
|
|
107
|
+
fromIdeaCandidateId?: string;
|
|
96
108
|
}
|
|
97
109
|
export interface InitialFlowStateOptions {
|
|
98
110
|
activeRunId?: string;
|
package/dist/gate-evidence.d.ts
CHANGED
|
@@ -12,11 +12,23 @@ import { type FlowStage } from "./types.js";
|
|
|
12
12
|
export interface QaLogFloorSignal {
|
|
13
13
|
ok: boolean;
|
|
14
14
|
count: number;
|
|
15
|
+
/**
|
|
16
|
+
* Wave 23 (v5.0.0): always 0. The convergence floor no longer enforces
|
|
17
|
+
* a fixed count. Harness UIs may render `questionBudgetHint(track,
|
|
18
|
+
* stage).recommended` separately as a soft hint.
|
|
19
|
+
*/
|
|
15
20
|
min: number;
|
|
16
21
|
hasStopSignal: boolean;
|
|
22
|
+
/** Wave 23: always false. See `min` note above. */
|
|
17
23
|
liteShortCircuit: boolean;
|
|
18
24
|
skipQuestionsAdvisory: boolean;
|
|
19
25
|
blocking: boolean;
|
|
26
|
+
/** Forcing-question topics deemed addressed in `## Q&A Log`. */
|
|
27
|
+
forcingCovered: string[];
|
|
28
|
+
/** Forcing-question topics still pending (no Q&A row matched). */
|
|
29
|
+
forcingPending: string[];
|
|
30
|
+
/** Ralph-Loop convergence detector verdict for the last 2 rows. */
|
|
31
|
+
noNewDecisions: boolean;
|
|
20
32
|
}
|
|
21
33
|
export interface GateEvidenceCheckResult {
|
|
22
34
|
ok: boolean;
|
package/dist/gate-evidence.js
CHANGED
|
@@ -471,7 +471,10 @@ export async function verifyCurrentStageGateEvidence(projectRoot, flowState, opt
|
|
|
471
471
|
hasStopSignal: floor.hasStopSignal,
|
|
472
472
|
liteShortCircuit: floor.liteShortCircuit,
|
|
473
473
|
skipQuestionsAdvisory: floor.skipQuestionsAdvisory,
|
|
474
|
-
blocking: !floor.ok && !floor.skipQuestionsAdvisory
|
|
474
|
+
blocking: !floor.ok && !floor.skipQuestionsAdvisory,
|
|
475
|
+
forcingCovered: floor.forcingCovered,
|
|
476
|
+
forcingPending: floor.forcingPending,
|
|
477
|
+
noNewDecisions: floor.noNewDecisions
|
|
475
478
|
};
|
|
476
479
|
}
|
|
477
480
|
return {
|
package/dist/harness-adapters.js
CHANGED
|
@@ -349,7 +349,7 @@ Before responding to a coding request:
|
|
|
349
349
|
|
|
350
350
|
Three rules apply to every cclaw stage in this project, regardless of which skills loaded:
|
|
351
351
|
|
|
352
|
-
1. **Q&A
|
|
352
|
+
1. **Q&A convergence before drafting** — for brainstorm / scope / design, walk the stage forcing questions one at a time via the harness-native question tool (Claude \`AskUserQuestion\`, Cursor \`AskQuestion\`, Codex \`request_user_input\`, Gemini \`ask_user\`). The \`qa_log_unconverged\` linter rule will block \`stage-complete\` when convergence has not been reached. Convergence is satisfied 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 (Ralph-Loop), or (c) an explicit user stop-signal row is recorded. The fixed count floor (10 for standard) was removed in Wave 23.
|
|
353
353
|
2. **Subagents run after Q&A approval** — mandatory subagents in brainstorm / scope / design (\`product-discovery\`, \`critic\`, \`planner\`, \`architect\`, \`test-author\`) run only AFTER the user approves the elicitation outcome. See each stage's "Run Phase: post-elicitation" rows in the materialized Automatic Subagent Dispatch table.
|
|
354
354
|
3. **No command-line echo to chat** — the user does not run cclaw helpers manually. Never paste \`node .cclaw/hooks/...\` invocations, \`--evidence-json '{...}'\` payloads, or shell hash commands (\`shasum\`, \`sha256sum\`, \`Get-FileHash\`, \`certutil\`, etc.) into chat. Run helpers via the tool layer; report only the resulting summary.
|
|
355
355
|
|
|
@@ -39,6 +39,14 @@ export interface StartFlowArgs {
|
|
|
39
39
|
forceReset: boolean;
|
|
40
40
|
reclassify: boolean;
|
|
41
41
|
quiet: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Wave 23 (v5.0.0) — `/cc-ideate` handoff carry-forward.
|
|
44
|
+
* Workspace-relative POSIX path to `.cclaw/ideas/idea-YYYY-MM-DD-<slug>.md`
|
|
45
|
+
* (or wherever `/cc-ideate` wrote its artifact).
|
|
46
|
+
*/
|
|
47
|
+
fromIdeaArtifact?: string;
|
|
48
|
+
/** Optional `I-#` row id chosen from the idea artifact's ranked list. */
|
|
49
|
+
fromIdeaCandidateId?: string;
|
|
42
50
|
}
|
|
43
51
|
export interface CancelRunArgs {
|
|
44
52
|
reason: string;
|
|
@@ -211,6 +211,8 @@ export function parseStartFlowArgs(tokens) {
|
|
|
211
211
|
let forceReset = false;
|
|
212
212
|
let reclassify = false;
|
|
213
213
|
let quiet = false;
|
|
214
|
+
let fromIdeaArtifact;
|
|
215
|
+
let fromIdeaCandidateId;
|
|
214
216
|
for (let i = 0; i < tokens.length; i += 1) {
|
|
215
217
|
const token = tokens[i];
|
|
216
218
|
const nextToken = tokens[i + 1];
|
|
@@ -259,12 +261,36 @@ export function parseStartFlowArgs(tokens) {
|
|
|
259
261
|
stack = readValue("--stack").trim();
|
|
260
262
|
continue;
|
|
261
263
|
}
|
|
264
|
+
if (token === "--from-idea-artifact" || token.startsWith("--from-idea-artifact=")) {
|
|
265
|
+
const raw = readValue("--from-idea-artifact").trim();
|
|
266
|
+
fromIdeaArtifact = raw.length > 0 ? raw : undefined;
|
|
267
|
+
continue;
|
|
268
|
+
}
|
|
269
|
+
if (token === "--from-idea-candidate" || token.startsWith("--from-idea-candidate=")) {
|
|
270
|
+
const raw = readValue("--from-idea-candidate").trim();
|
|
271
|
+
fromIdeaCandidateId = raw.length > 0 ? raw : undefined;
|
|
272
|
+
continue;
|
|
273
|
+
}
|
|
262
274
|
throw new Error(`Unknown flag for internal start-flow: ${token}`);
|
|
263
275
|
}
|
|
264
276
|
if (!track) {
|
|
265
277
|
throw new Error("internal start-flow requires --track=<standard|medium|quick>.");
|
|
266
278
|
}
|
|
267
|
-
|
|
279
|
+
if (fromIdeaCandidateId && !fromIdeaArtifact) {
|
|
280
|
+
throw new Error("--from-idea-candidate requires --from-idea-artifact=<path> to be set as well.");
|
|
281
|
+
}
|
|
282
|
+
return {
|
|
283
|
+
track,
|
|
284
|
+
className,
|
|
285
|
+
prompt,
|
|
286
|
+
reason,
|
|
287
|
+
stack,
|
|
288
|
+
forceReset,
|
|
289
|
+
reclassify,
|
|
290
|
+
quiet,
|
|
291
|
+
fromIdeaArtifact,
|
|
292
|
+
fromIdeaCandidateId
|
|
293
|
+
};
|
|
268
294
|
}
|
|
269
295
|
export function parseCancelRunArgs(tokens) {
|
|
270
296
|
let reason;
|
|
@@ -119,6 +119,19 @@ export async function runStartFlow(projectRoot, args, io) {
|
|
|
119
119
|
else {
|
|
120
120
|
nextState = createInitialFlowState({ track: args.track });
|
|
121
121
|
}
|
|
122
|
+
if (args.fromIdeaArtifact) {
|
|
123
|
+
const existingHints = nextState.interactionHints ?? {};
|
|
124
|
+
const existingBrainstorm = existingHints.brainstorm ?? {};
|
|
125
|
+
nextState.interactionHints = {
|
|
126
|
+
...existingHints,
|
|
127
|
+
brainstorm: {
|
|
128
|
+
...existingBrainstorm,
|
|
129
|
+
fromIdeaArtifact: args.fromIdeaArtifact,
|
|
130
|
+
...(args.fromIdeaCandidateId ? { fromIdeaCandidateId: args.fromIdeaCandidateId } : {}),
|
|
131
|
+
recordedAt: new Date().toISOString()
|
|
132
|
+
}
|
|
133
|
+
};
|
|
134
|
+
}
|
|
122
135
|
await writeFlowState(projectRoot, nextState, { allowReset: true });
|
|
123
136
|
await appendIdeaArtifact(projectRoot, args, current);
|
|
124
137
|
if (!args.quiet) {
|