cclaw-cli 7.7.1 → 8.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +211 -134
- package/dist/artifact-frontmatter.d.ts +51 -0
- package/dist/artifact-frontmatter.js +131 -0
- package/dist/artifact-paths.d.ts +7 -27
- package/dist/artifact-paths.js +20 -249
- package/dist/cancel.d.ts +16 -0
- package/dist/cancel.js +66 -0
- package/dist/cli.d.ts +2 -27
- package/dist/cli.js +107 -511
- package/dist/compound.d.ts +26 -0
- package/dist/compound.js +96 -0
- package/dist/config.d.ts +14 -51
- package/dist/config.js +23 -359
- package/dist/constants.d.ts +11 -18
- package/dist/constants.js +19 -106
- package/dist/content/antipatterns.d.ts +1 -0
- package/dist/content/antipatterns.js +109 -0
- package/dist/content/artifact-templates.d.ts +10 -0
- package/dist/content/artifact-templates.js +550 -0
- package/dist/content/cancel-command.d.ts +2 -2
- package/dist/content/cancel-command.js +25 -17
- package/dist/content/core-agents.d.ts +9 -233
- package/dist/content/core-agents.js +39 -768
- package/dist/content/decision-protocol.d.ts +1 -12
- package/dist/content/decision-protocol.js +27 -20
- package/dist/content/examples.d.ts +8 -42
- package/dist/content/examples.js +293 -425
- package/dist/content/idea-command.d.ts +2 -0
- package/dist/content/idea-command.js +38 -0
- package/dist/content/iron-laws.d.ts +4 -138
- package/dist/content/iron-laws.js +18 -197
- package/dist/content/meta-skill.d.ts +1 -3
- package/dist/content/meta-skill.js +57 -134
- package/dist/content/node-hooks.d.ts +12 -8
- package/dist/content/node-hooks.js +188 -838
- package/dist/content/recovery.d.ts +8 -0
- package/dist/content/recovery.js +179 -0
- package/dist/content/reference-patterns.d.ts +4 -13
- package/dist/content/reference-patterns.js +260 -389
- package/dist/content/research-playbooks.d.ts +8 -8
- package/dist/content/research-playbooks.js +108 -121
- package/dist/content/review-loop.d.ts +6 -192
- package/dist/content/review-loop.js +29 -731
- package/dist/content/skills.d.ts +8 -38
- package/dist/content/skills.js +681 -732
- package/dist/content/specialist-prompts/architect.d.ts +1 -0
- package/dist/content/specialist-prompts/architect.js +225 -0
- package/dist/content/specialist-prompts/brainstormer.d.ts +1 -0
- package/dist/content/specialist-prompts/brainstormer.js +168 -0
- package/dist/content/specialist-prompts/index.d.ts +2 -0
- package/dist/content/specialist-prompts/index.js +14 -0
- package/dist/content/specialist-prompts/planner.d.ts +1 -0
- package/dist/content/specialist-prompts/planner.js +182 -0
- package/dist/content/specialist-prompts/reviewer.d.ts +1 -0
- package/dist/content/specialist-prompts/reviewer.js +193 -0
- package/dist/content/specialist-prompts/security-reviewer.d.ts +1 -0
- package/dist/content/specialist-prompts/security-reviewer.js +133 -0
- package/dist/content/specialist-prompts/slice-builder.d.ts +1 -0
- package/dist/content/specialist-prompts/slice-builder.js +232 -0
- package/dist/content/stage-playbooks.d.ts +8 -0
- package/dist/content/stage-playbooks.js +404 -0
- package/dist/content/start-command.d.ts +2 -12
- package/dist/content/start-command.js +221 -207
- package/dist/flow-state.d.ts +21 -178
- package/dist/flow-state.js +67 -170
- package/dist/fs-utils.d.ts +6 -26
- package/dist/fs-utils.js +29 -162
- package/dist/gitignore.d.ts +2 -1
- package/dist/gitignore.js +51 -34
- package/dist/harness-detect.d.ts +10 -0
- package/dist/harness-detect.js +29 -0
- package/dist/harness-prompt.d.ts +26 -0
- package/dist/harness-prompt.js +142 -0
- package/dist/install.d.ts +35 -15
- package/dist/install.js +238 -1347
- package/dist/knowledge-store.d.ts +19 -163
- package/dist/knowledge-store.js +56 -590
- package/dist/logger.d.ts +8 -3
- package/dist/logger.js +13 -4
- package/dist/orchestrator-routing.d.ts +29 -0
- package/dist/orchestrator-routing.js +156 -0
- package/dist/run-persistence.d.ts +7 -118
- package/dist/run-persistence.js +29 -845
- package/dist/runtime/run-hook.entry.d.ts +1 -3
- package/dist/runtime/run-hook.entry.js +19 -4
- package/dist/runtime/run-hook.mjs +13 -1024
- package/dist/types.d.ts +25 -261
- package/dist/types.js +8 -36
- package/package.json +6 -3
- package/dist/artifact-linter/brainstorm.d.ts +0 -2
- package/dist/artifact-linter/brainstorm.js +0 -353
- package/dist/artifact-linter/design.d.ts +0 -18
- package/dist/artifact-linter/design.js +0 -444
- package/dist/artifact-linter/findings-dedup.d.ts +0 -56
- package/dist/artifact-linter/findings-dedup.js +0 -232
- package/dist/artifact-linter/plan.d.ts +0 -2
- package/dist/artifact-linter/plan.js +0 -826
- package/dist/artifact-linter/review-army.d.ts +0 -49
- package/dist/artifact-linter/review-army.js +0 -520
- package/dist/artifact-linter/review.d.ts +0 -2
- package/dist/artifact-linter/review.js +0 -113
- package/dist/artifact-linter/scope.d.ts +0 -2
- package/dist/artifact-linter/scope.js +0 -158
- package/dist/artifact-linter/shared.d.ts +0 -637
- package/dist/artifact-linter/shared.js +0 -2163
- package/dist/artifact-linter/ship.d.ts +0 -2
- package/dist/artifact-linter/ship.js +0 -250
- package/dist/artifact-linter/spec.d.ts +0 -2
- package/dist/artifact-linter/spec.js +0 -176
- package/dist/artifact-linter/tdd.d.ts +0 -118
- package/dist/artifact-linter/tdd.js +0 -1404
- package/dist/artifact-linter.d.ts +0 -15
- package/dist/artifact-linter.js +0 -517
- package/dist/codex-feature-flag.d.ts +0 -58
- package/dist/codex-feature-flag.js +0 -193
- package/dist/content/closeout-guidance.d.ts +0 -14
- package/dist/content/closeout-guidance.js +0 -44
- package/dist/content/diff-command.d.ts +0 -1
- package/dist/content/diff-command.js +0 -43
- package/dist/content/harness-doc.d.ts +0 -1
- package/dist/content/harness-doc.js +0 -65
- package/dist/content/hook-events.d.ts +0 -9
- package/dist/content/hook-events.js +0 -23
- package/dist/content/hook-manifest.d.ts +0 -81
- package/dist/content/hook-manifest.js +0 -156
- package/dist/content/hooks.d.ts +0 -11
- package/dist/content/hooks.js +0 -1972
- package/dist/content/idea.d.ts +0 -60
- package/dist/content/idea.js +0 -416
- package/dist/content/language-policy.d.ts +0 -2
- package/dist/content/language-policy.js +0 -13
- package/dist/content/learnings.d.ts +0 -6
- package/dist/content/learnings.js +0 -141
- package/dist/content/observe.d.ts +0 -19
- package/dist/content/observe.js +0 -86
- package/dist/content/opencode-plugin.d.ts +0 -1
- package/dist/content/opencode-plugin.js +0 -635
- package/dist/content/review-prompts.d.ts +0 -1
- package/dist/content/review-prompts.js +0 -104
- package/dist/content/runtime-shared-snippets.d.ts +0 -8
- package/dist/content/runtime-shared-snippets.js +0 -80
- package/dist/content/session-hooks.d.ts +0 -7
- package/dist/content/session-hooks.js +0 -107
- package/dist/content/skills-elicitation.d.ts +0 -1
- package/dist/content/skills-elicitation.js +0 -167
- package/dist/content/stage-command.d.ts +0 -2
- package/dist/content/stage-command.js +0 -17
- package/dist/content/stage-schema.d.ts +0 -117
- package/dist/content/stage-schema.js +0 -955
- package/dist/content/stages/_lint-metadata/index.d.ts +0 -2
- package/dist/content/stages/_lint-metadata/index.js +0 -97
- package/dist/content/stages/brainstorm.d.ts +0 -2
- package/dist/content/stages/brainstorm.js +0 -184
- package/dist/content/stages/design.d.ts +0 -2
- package/dist/content/stages/design.js +0 -288
- package/dist/content/stages/index.d.ts +0 -8
- package/dist/content/stages/index.js +0 -11
- package/dist/content/stages/plan.d.ts +0 -2
- package/dist/content/stages/plan.js +0 -191
- package/dist/content/stages/review.d.ts +0 -2
- package/dist/content/stages/review.js +0 -240
- package/dist/content/stages/schema-types.d.ts +0 -203
- package/dist/content/stages/schema-types.js +0 -1
- package/dist/content/stages/scope.d.ts +0 -2
- package/dist/content/stages/scope.js +0 -254
- package/dist/content/stages/ship.d.ts +0 -2
- package/dist/content/stages/ship.js +0 -159
- package/dist/content/stages/spec.d.ts +0 -2
- package/dist/content/stages/spec.js +0 -170
- package/dist/content/stages/tdd.d.ts +0 -4
- package/dist/content/stages/tdd.js +0 -273
- package/dist/content/state-contracts.d.ts +0 -1
- package/dist/content/state-contracts.js +0 -63
- package/dist/content/status-command.d.ts +0 -4
- package/dist/content/status-command.js +0 -109
- package/dist/content/subagent-context-skills.d.ts +0 -4
- package/dist/content/subagent-context-skills.js +0 -279
- package/dist/content/subagents.d.ts +0 -3
- package/dist/content/subagents.js +0 -997
- package/dist/content/templates.d.ts +0 -26
- package/dist/content/templates.js +0 -1692
- package/dist/content/track-render-context.d.ts +0 -18
- package/dist/content/track-render-context.js +0 -53
- package/dist/content/tree-command.d.ts +0 -1
- package/dist/content/tree-command.js +0 -64
- package/dist/content/utility-skills.d.ts +0 -30
- package/dist/content/utility-skills.js +0 -160
- package/dist/content/view-command.d.ts +0 -2
- package/dist/content/view-command.js +0 -92
- package/dist/delegation.d.ts +0 -649
- package/dist/delegation.js +0 -1539
- package/dist/early-loop.d.ts +0 -70
- package/dist/early-loop.js +0 -302
- package/dist/execution-topology.d.ts +0 -44
- package/dist/execution-topology.js +0 -95
- package/dist/gate-evidence.d.ts +0 -85
- package/dist/gate-evidence.js +0 -631
- package/dist/harness-adapters.d.ts +0 -151
- package/dist/harness-adapters.js +0 -756
- package/dist/harness-selection.d.ts +0 -31
- package/dist/harness-selection.js +0 -214
- package/dist/hook-schema.d.ts +0 -6
- package/dist/hook-schema.js +0 -114
- package/dist/hook-schemas/claude-hooks.v1.json +0 -10
- package/dist/hook-schemas/codex-hooks.v1.json +0 -10
- package/dist/hook-schemas/cursor-hooks.v1.json +0 -13
- package/dist/init-detect.d.ts +0 -2
- package/dist/init-detect.js +0 -50
- package/dist/internal/advance-stage/advance.d.ts +0 -89
- package/dist/internal/advance-stage/advance.js +0 -655
- package/dist/internal/advance-stage/cancel-run.d.ts +0 -8
- package/dist/internal/advance-stage/cancel-run.js +0 -19
- package/dist/internal/advance-stage/flow-state-coercion.d.ts +0 -3
- package/dist/internal/advance-stage/flow-state-coercion.js +0 -81
- package/dist/internal/advance-stage/helpers.d.ts +0 -14
- package/dist/internal/advance-stage/helpers.js +0 -145
- package/dist/internal/advance-stage/hook.d.ts +0 -8
- package/dist/internal/advance-stage/hook.js +0 -40
- package/dist/internal/advance-stage/parsers.d.ts +0 -72
- package/dist/internal/advance-stage/parsers.js +0 -357
- package/dist/internal/advance-stage/proactive-delegation-trace.d.ts +0 -24
- package/dist/internal/advance-stage/proactive-delegation-trace.js +0 -56
- package/dist/internal/advance-stage/review-loop.d.ts +0 -16
- package/dist/internal/advance-stage/review-loop.js +0 -199
- package/dist/internal/advance-stage/rewind.d.ts +0 -14
- package/dist/internal/advance-stage/rewind.js +0 -108
- package/dist/internal/advance-stage/start-flow.d.ts +0 -13
- package/dist/internal/advance-stage/start-flow.js +0 -241
- package/dist/internal/advance-stage/verify.d.ts +0 -21
- package/dist/internal/advance-stage/verify.js +0 -185
- package/dist/internal/advance-stage.d.ts +0 -7
- package/dist/internal/advance-stage.js +0 -138
- package/dist/internal/cohesion-contract-stub.d.ts +0 -24
- package/dist/internal/cohesion-contract-stub.js +0 -148
- package/dist/internal/compound-readiness.d.ts +0 -23
- package/dist/internal/compound-readiness.js +0 -102
- package/dist/internal/detect-public-api-changes.d.ts +0 -5
- package/dist/internal/detect-public-api-changes.js +0 -45
- package/dist/internal/detect-supply-chain-changes.d.ts +0 -6
- package/dist/internal/detect-supply-chain-changes.js +0 -138
- package/dist/internal/early-loop-status.d.ts +0 -7
- package/dist/internal/early-loop-status.js +0 -93
- package/dist/internal/envelope-validate.d.ts +0 -7
- package/dist/internal/envelope-validate.js +0 -66
- package/dist/internal/flow-state-repair.d.ts +0 -20
- package/dist/internal/flow-state-repair.js +0 -104
- package/dist/internal/plan-split-waves.d.ts +0 -190
- package/dist/internal/plan-split-waves.js +0 -764
- package/dist/internal/runtime-integrity.d.ts +0 -7
- package/dist/internal/runtime-integrity.js +0 -268
- package/dist/internal/slice-commit.d.ts +0 -7
- package/dist/internal/slice-commit.js +0 -619
- package/dist/internal/tdd-loop-status.d.ts +0 -14
- package/dist/internal/tdd-loop-status.js +0 -68
- package/dist/internal/tdd-red-evidence.d.ts +0 -7
- package/dist/internal/tdd-red-evidence.js +0 -153
- package/dist/internal/waiver-grant.d.ts +0 -62
- package/dist/internal/waiver-grant.js +0 -294
- package/dist/internal/wave-status.d.ts +0 -74
- package/dist/internal/wave-status.js +0 -506
- package/dist/managed-resources.d.ts +0 -53
- package/dist/managed-resources.js +0 -313
- package/dist/policy.d.ts +0 -10
- package/dist/policy.js +0 -167
- package/dist/retro-gate.d.ts +0 -9
- package/dist/retro-gate.js +0 -47
- package/dist/run-archive.d.ts +0 -61
- package/dist/run-archive.js +0 -391
- package/dist/runs.d.ts +0 -2
- package/dist/runs.js +0 -2
- package/dist/stack-detection.d.ts +0 -116
- package/dist/stack-detection.js +0 -489
- package/dist/streaming/event-stream.d.ts +0 -31
- package/dist/streaming/event-stream.js +0 -114
- package/dist/tdd-cycle.d.ts +0 -107
- package/dist/tdd-cycle.js +0 -289
- package/dist/tdd-verification-evidence.d.ts +0 -17
- package/dist/tdd-verification-evidence.js +0 -122
- package/dist/track-heuristics.d.ts +0 -27
- package/dist/track-heuristics.js +0 -154
- package/dist/util/slice-id.d.ts +0 -58
- package/dist/util/slice-id.js +0 -89
- package/dist/worktree-manager.d.ts +0 -20
- package/dist/worktree-manager.js +0 -108
|
@@ -1,203 +0,0 @@
|
|
|
1
|
-
import type { FlowStage } from "../../types.js";
|
|
2
|
-
export interface StageGate {
|
|
3
|
-
id: string;
|
|
4
|
-
description: string;
|
|
5
|
-
tier?: "required" | "recommended";
|
|
6
|
-
}
|
|
7
|
-
export interface ReviewSection {
|
|
8
|
-
title: string;
|
|
9
|
-
evaluationPoints: string[];
|
|
10
|
-
stopGate: boolean;
|
|
11
|
-
}
|
|
12
|
-
export interface CrossStageTrace {
|
|
13
|
-
readsFrom: string[];
|
|
14
|
-
writesTo: string[];
|
|
15
|
-
traceabilityRule: string;
|
|
16
|
-
}
|
|
17
|
-
export interface ArtifactValidation {
|
|
18
|
-
section: string;
|
|
19
|
-
required: boolean;
|
|
20
|
-
tier?: "required" | "recommended";
|
|
21
|
-
validationRule: string;
|
|
22
|
-
}
|
|
23
|
-
export type StageSubagentName = "researcher" | "architect" | "spec-validator" | "spec-document-reviewer" | "coherence-reviewer" | "scope-guardian-reviewer" | "feasibility-reviewer" | "slice-builder" | "release-reviewer" | "planner" | "product-discovery" | "divergent-thinker" | "critic" | "reviewer" | "security-reviewer" | "integration-overseer" | "doc-updater" | "fixer";
|
|
24
|
-
export type StageSubagentDispatchClass = "stage-specialist" | "worker" | "review-lens";
|
|
25
|
-
export type StageSubagentReturnSchema = "planning-return" | "product-return" | "critic-return" | "review-return" | "security-return" | "tdd-return" | "docs-return" | "worker-return" | "fixer-return" | "research-return" | "architecture-return" | "spec-validation-return" | "release-return";
|
|
26
|
-
export interface StageAutoSubagentDispatch {
|
|
27
|
-
agent: StageSubagentName;
|
|
28
|
-
/**
|
|
29
|
-
* - `mandatory` — must be dispatched (or explicitly waived) before stage transition.
|
|
30
|
-
* - `proactive` — should be dispatched automatically when context matches `when`.
|
|
31
|
-
*/
|
|
32
|
-
mode: "mandatory" | "proactive";
|
|
33
|
-
/**
|
|
34
|
-
* Minimum complexity tier where this dispatch policy applies.
|
|
35
|
-
* Defaults to `standard` for mandatory/proactive dispatches when omitted.
|
|
36
|
-
*/
|
|
37
|
-
requiredAtTier?: StageComplexityTier;
|
|
38
|
-
when: string;
|
|
39
|
-
purpose: string;
|
|
40
|
-
requiresUserGate: boolean;
|
|
41
|
-
/**
|
|
42
|
-
* When this delegation may run relative to the adaptive elicitation Q&A loop.
|
|
43
|
-
* - `pre-elicitation` — run before any user dialogue (rare; only for trivial info-gathering).
|
|
44
|
-
* - `post-elicitation` — run only after the Q&A loop converges (default for brainstorm/scope/design
|
|
45
|
-
* so subagents do not preempt the user dialogue).
|
|
46
|
-
* - `any` — no ordering constraint (default for stages that do not run elicitation:
|
|
47
|
-
* spec/plan/tdd/review/ship).
|
|
48
|
-
*/
|
|
49
|
-
runPhase?: "pre-elicitation" | "post-elicitation" | "any";
|
|
50
|
-
/** Role category used by generated routing tables and lifecycle checks. */
|
|
51
|
-
dispatchClass?: StageSubagentDispatchClass;
|
|
52
|
-
/** Strict status/evidence contract the dispatched agent must return. */
|
|
53
|
-
returnSchema?: StageSubagentReturnSchema;
|
|
54
|
-
/** Optional skill folder the dispatched agent should load as additional context. */
|
|
55
|
-
skill?: string;
|
|
56
|
-
/**
|
|
57
|
-
* When true on a proactive dispatch row for brainstorm/scope/design, the trace
|
|
58
|
-
* gate keeps this rule even when `discoveryMode` is `lean` or `guided`.
|
|
59
|
-
*/
|
|
60
|
-
essentialAcrossModes?: boolean;
|
|
61
|
-
}
|
|
62
|
-
export type StageComplexityTier = "lightweight" | "standard" | "deep";
|
|
63
|
-
export interface StagePhilosophy {
|
|
64
|
-
hardGate: string;
|
|
65
|
-
ironLaw: string;
|
|
66
|
-
purpose: string;
|
|
67
|
-
whenToUse: string[];
|
|
68
|
-
whenNotToUse: string[];
|
|
69
|
-
commonRationalizations: string[];
|
|
70
|
-
}
|
|
71
|
-
export interface StageExecutionModel {
|
|
72
|
-
interactionProtocol: string[];
|
|
73
|
-
process: string[];
|
|
74
|
-
/**
|
|
75
|
-
* Optional custom mermaid `flowchart` body (without the fenced `mermaid`
|
|
76
|
-
* code block) that overrides the auto-generated linear flowchart in the
|
|
77
|
-
* rendered `## Process` section. Use for stages whose state machine is
|
|
78
|
-
* non-linear (loops, conditional branches) — otherwise leave unset and
|
|
79
|
-
* let the renderer derive a simple `A --> B --> C` chart from `process`.
|
|
80
|
-
*/
|
|
81
|
-
processFlow?: string;
|
|
82
|
-
checklist: string[];
|
|
83
|
-
requiredGates: StageGate[];
|
|
84
|
-
requiredEvidence: string[];
|
|
85
|
-
inputs: string[];
|
|
86
|
-
requiredContext: string[];
|
|
87
|
-
researchPlaybooks?: string[];
|
|
88
|
-
blockers: string[];
|
|
89
|
-
exitCriteria: string[];
|
|
90
|
-
/**
|
|
91
|
-
* Optional platform-specific notes (Windows/macOS/Linux path separators,
|
|
92
|
-
* PowerShell vs cmd, harness-specific tool names). Rendered under
|
|
93
|
-
* "## Platform Notes" when present. Omit when the stage is
|
|
94
|
-
* platform-agnostic.
|
|
95
|
-
*/
|
|
96
|
-
platformNotes?: string[];
|
|
97
|
-
}
|
|
98
|
-
export interface StageArtifactRules {
|
|
99
|
-
artifactFile: string;
|
|
100
|
-
completionStatus: string[];
|
|
101
|
-
crossStageTrace: CrossStageTrace;
|
|
102
|
-
artifactValidation: ArtifactValidation[];
|
|
103
|
-
trivialOverrideSections?: string[];
|
|
104
|
-
}
|
|
105
|
-
export interface StageReviewLens {
|
|
106
|
-
outputs: string[];
|
|
107
|
-
reviewSections: ReviewSection[];
|
|
108
|
-
mandatoryDelegations: string[];
|
|
109
|
-
reviewLoop?: StageReviewLoop;
|
|
110
|
-
}
|
|
111
|
-
export interface StageReviewLensInput {
|
|
112
|
-
outputs: string[];
|
|
113
|
-
reviewSections: ReviewSection[];
|
|
114
|
-
reviewLoop?: StageReviewLoop;
|
|
115
|
-
}
|
|
116
|
-
export interface StageReviewLoop {
|
|
117
|
-
stage: "scope" | "design";
|
|
118
|
-
checklist: string[];
|
|
119
|
-
maxIterations: number;
|
|
120
|
-
targetScore: number;
|
|
121
|
-
}
|
|
122
|
-
export interface StageSchema {
|
|
123
|
-
schemaShape: "v2";
|
|
124
|
-
stage: FlowStage;
|
|
125
|
-
skillFolder: string;
|
|
126
|
-
skillName: string;
|
|
127
|
-
skillDescription: string;
|
|
128
|
-
complexityTier: StageComplexityTier;
|
|
129
|
-
philosophy: StagePhilosophy;
|
|
130
|
-
executionModel: StageExecutionModel;
|
|
131
|
-
artifactRules: StageArtifactRules;
|
|
132
|
-
reviewLens: StageReviewLens;
|
|
133
|
-
hardGate: string;
|
|
134
|
-
/**
|
|
135
|
-
* One-line "Iron Law" punchcard — the single rule that, if broken,
|
|
136
|
-
* invalidates the stage outright. Rendered in ALL-CAPS wrapped in
|
|
137
|
-
* <EXTREMELY-IMPORTANT> XML markers at the very top of the skill body.
|
|
138
|
-
* Reference: Superpowers (obra) "NO PRODUCTION CODE WITHOUT A FAILING
|
|
139
|
-
* TEST FIRST".
|
|
140
|
-
*/
|
|
141
|
-
ironLaw: string;
|
|
142
|
-
purpose: string;
|
|
143
|
-
whenToUse: string[];
|
|
144
|
-
whenNotToUse: string[];
|
|
145
|
-
interactionProtocol: string[];
|
|
146
|
-
process: string[];
|
|
147
|
-
/** See {@link StageExecutionModel.processFlow}. */
|
|
148
|
-
processFlow?: string;
|
|
149
|
-
/** See {@link StageExecutionModel.platformNotes}. */
|
|
150
|
-
platformNotes?: string[];
|
|
151
|
-
requiredGates: StageGate[];
|
|
152
|
-
requiredEvidence: string[];
|
|
153
|
-
inputs: string[];
|
|
154
|
-
requiredContext: string[];
|
|
155
|
-
/** In-thread research procedures for this stage (`.cclaw/skills/research/*.md`). */
|
|
156
|
-
researchPlaybooks?: string[];
|
|
157
|
-
outputs: string[];
|
|
158
|
-
blockers: string[];
|
|
159
|
-
exitCriteria: string[];
|
|
160
|
-
/**
|
|
161
|
-
* Consolidated "Common Rationalizations" list — things an agent is likely to
|
|
162
|
-
* talk itself into that should stop the stage. Rendered under the
|
|
163
|
-
* "Anti-Patterns & Red Flags" heading in the generated SKILL.md. Replaces
|
|
164
|
-
* the former split between `antiPatterns` and `redFlags`, which produced
|
|
165
|
-
* near-duplicate entries and forced downstream code to merge them anyway.
|
|
166
|
-
*/
|
|
167
|
-
commonRationalizations: string[];
|
|
168
|
-
artifactFile: string;
|
|
169
|
-
next: FlowStage | "done";
|
|
170
|
-
checklist: string[];
|
|
171
|
-
reviewSections: ReviewSection[];
|
|
172
|
-
completionStatus: string[];
|
|
173
|
-
crossStageTrace: CrossStageTrace;
|
|
174
|
-
artifactValidation: ArtifactValidation[];
|
|
175
|
-
/** When true, stage skill includes batch auto-execute guidance (tdd). */
|
|
176
|
-
batchExecutionAllowed?: boolean;
|
|
177
|
-
/** Sections that remain required even when the trivial-change escape hatch is active (design only). */
|
|
178
|
-
trivialOverrideSections?: string[];
|
|
179
|
-
/** Agent names that MUST be dispatched (or waived) before stage transition — derived from mandatory auto-subagent rows. */
|
|
180
|
-
mandatoryDelegations: string[];
|
|
181
|
-
/** Optional shared outside-voice loop config for scope/design stages. */
|
|
182
|
-
reviewLoop?: StageReviewLoop;
|
|
183
|
-
}
|
|
184
|
-
export type StageSchemaLegacyInput = Omit<StageSchema, "schemaShape" | "philosophy" | "executionModel" | "artifactRules" | "reviewLens" | "mandatoryDelegations" | "complexityTier"> & {
|
|
185
|
-
schemaShape?: "legacy";
|
|
186
|
-
complexityTier?: StageComplexityTier;
|
|
187
|
-
};
|
|
188
|
-
export interface StageSchemaV2Input {
|
|
189
|
-
schemaShape: "v2";
|
|
190
|
-
stage: FlowStage;
|
|
191
|
-
skillFolder: string;
|
|
192
|
-
skillName: string;
|
|
193
|
-
skillDescription: string;
|
|
194
|
-
complexityTier?: StageComplexityTier;
|
|
195
|
-
philosophy: StagePhilosophy;
|
|
196
|
-
executionModel: StageExecutionModel;
|
|
197
|
-
artifactRules: StageArtifactRules;
|
|
198
|
-
reviewLens: StageReviewLensInput;
|
|
199
|
-
next: FlowStage | "done";
|
|
200
|
-
/** When true, stage skill includes batch auto-execute guidance (tdd). */
|
|
201
|
-
batchExecutionAllowed?: boolean;
|
|
202
|
-
}
|
|
203
|
-
export type StageSchemaInput = StageSchemaLegacyInput | StageSchemaV2Input;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,254 +0,0 @@
|
|
|
1
|
-
import { REVIEW_LOOP_CHECKLISTS, reviewLoopPolicySummary } from "../review-loop.js";
|
|
2
|
-
import { decisionProtocolInstruction } from "../decision-protocol.js";
|
|
3
|
-
// ---------------------------------------------------------------------------
|
|
4
|
-
// SCOPE — reference: gstack CEO review
|
|
5
|
-
// ---------------------------------------------------------------------------
|
|
6
|
-
export const SCOPE = {
|
|
7
|
-
schemaShape: "v2",
|
|
8
|
-
stage: "scope",
|
|
9
|
-
complexityTier: "standard",
|
|
10
|
-
skillFolder: "scope",
|
|
11
|
-
skillName: "scope",
|
|
12
|
-
skillDescription: "Strategic contract stage. Select HOLD/SELECTIVE/EXPAND/REDUCE mode, lock the slice and boundaries, and hand stable discretion zones to design.",
|
|
13
|
-
philosophy: {
|
|
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
|
-
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 the brainstorm premise as carry-forward (not re-authored).",
|
|
17
|
-
whenToUse: [
|
|
18
|
-
"After brainstorm approval",
|
|
19
|
-
"Before architecture/design lock-in",
|
|
20
|
-
"When ambition vs feasibility trade-off is unclear"
|
|
21
|
-
],
|
|
22
|
-
whenNotToUse: [
|
|
23
|
-
"Brainstorm has not been approved yet",
|
|
24
|
-
"Scope boundaries are already locked and user requested no scope changes",
|
|
25
|
-
"The work is a pure implementation or debugging pass within existing scope"
|
|
26
|
-
],
|
|
27
|
-
commonRationalizations: [
|
|
28
|
-
"Skipping pre-scope audit because the task looks small",
|
|
29
|
-
"Scope silently expanded during discussion",
|
|
30
|
-
"No explicit out-of-scope section",
|
|
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)",
|
|
33
|
-
"Sycophantic agreement without evidence-based pushback",
|
|
34
|
-
"Hedged recommendations that avoid taking a position",
|
|
35
|
-
"Batching multiple scope issues into one question",
|
|
36
|
-
"Re-arguing for smaller scope after user rejects reduction",
|
|
37
|
-
"Using scope-reduction placeholders (`v1`, `for now`, `we can do later`) instead of explicit user-approved boundaries",
|
|
38
|
-
"No selected mode in artifact",
|
|
39
|
-
"Mode selected without heuristic justification",
|
|
40
|
-
"No discretion section (or explicit `None`) in artifact",
|
|
41
|
-
"No deferred/not-in-scope section",
|
|
42
|
-
"No user approval marker",
|
|
43
|
-
"Missing Locked Decisions section or decisions without D-XX IDs",
|
|
44
|
-
"Skipping outside-voice review loop and treating first draft as final"
|
|
45
|
-
]
|
|
46
|
-
},
|
|
47
|
-
executionModel: {
|
|
48
|
-
checklist: [
|
|
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 **and stamp the row's `Decision impact` cell with the matching `[topic:<id>]` tag** (e.g. `[topic:in-out]`). Continue until every forcing-question topic id is tagged on a row OR the Q&A 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.",
|
|
50
|
-
"**Scope forcing questions (must be covered or explicitly waived)** — `in-out: what is definitely in/out`; `locked-upstream: which upstream decisions are locked`. Tag the matching `## Q&A Log` row's `Decision impact` cell with `[topic:<id>]` (e.g. `[topic:in-out]`) so the linter can verify coverage in any natural language. Tags are MANDATORY for forcing-question rows; un-tagged rows do NOT count toward coverage. removed the counterfactual `rollback` and `failure-modes` topics from scope forcing questions; Design still owns the Failure Mode Table and rollback evidence.",
|
|
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.",
|
|
52
|
-
"**Premise carry-forward (do NOT re-author)** — brainstorm OWNS the premise check (right problem / direct path). 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.",
|
|
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`.",
|
|
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.",
|
|
55
|
-
"**Product-discovery is REQUIRED for SELECTIVE / SCOPE EXPANSION (hard gate)** — If the resolved scope mode is SELECTIVE EXPANSION or SCOPE EXPANSION, run \`product-discovery\` in proactive mode **after** adaptive elicitation converges and **before** \`stage-complete\`. Do not complete this stage until the delegation ledger shows \`product-discovery\` as \`completed\` with non-empty \`evidenceRefs\` pointing at this scope artifact. HOLD SCOPE and SCOPE REDUCTION do not require this row.",
|
|
56
|
-
"**Run mode-specific analysis only to needed depth** — lean discovery keeps the selected-mode row compact; guided adds the standard contract rows; deep may add Landscape Check, Taste Calibration, Reference Pattern Registry, Reference Pull, Ambitious Alternatives, and Ruthless Minimum Slice evidence when mode/risk warrants it.",
|
|
57
|
-
"**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.",
|
|
58
|
-
"**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.",
|
|
59
|
-
"**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.",
|
|
60
|
-
"**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.",
|
|
61
|
-
"**Run Early-Loop / Concern Ledger 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. (This is the producer-critic concern ledger, not the Q&A Ralph Loop used for elicitation convergence.)",
|
|
62
|
-
"**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.",
|
|
63
|
-
"**Write the scope contract after approval** — include selected mode, in scope, out of scope, requirements, locked decisions, discretion areas, deferred ideas, accepted/rejected reference ideas, success definition, design handoff, completion dashboard, and explicit approval evidence."
|
|
64
|
-
],
|
|
65
|
-
interactionProtocol: [
|
|
66
|
-
"\"Strong success criteria let you loop independently. Weak criteria require constant clarification.\"",
|
|
67
|
-
decisionProtocolInstruction("scope mode selection", "present expand/selective/hold/reduce as labeled options with trade-offs and mark one as (recommended)", "recommend the option that best covers the prime-directive failure modes, four data-flow paths, observability, and deferred handling for the in-scope set with the smallest blast radius. Base your recommendation on default heuristics: greenfield -> expand, enhancement -> selective, bugfix/hotfix/refactor -> hold, broad blast radius -> reduce"),
|
|
68
|
-
"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.",
|
|
69
|
-
"**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. Lean discovery may compress: ask the smallest forcing-Q set that satisfies the convergence floor, then propose contract.",
|
|
70
|
-
"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.",
|
|
71
|
-
"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.",
|
|
72
|
-
"Push back on weak framing: vague scope needs a specific user/problem, platform vision needs a narrow wedge, social proof needs behavioral evidence.",
|
|
73
|
-
"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.",
|
|
74
|
-
"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.",
|
|
75
|
-
"Before final approval, record outside-voice findings and a `## Scope Outside Voice Loop` table per the Scope Outside Voice Loop policy above.",
|
|
76
|
-
"**STOP.** Wait for explicit user approval of the scope mode and scope contract before writing final approval language or advancing.",
|
|
77
|
-
"**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.",
|
|
78
|
-
"Investigation discipline: follow the shared `## Investigation Discipline` block (search -> graph/impact -> narrow read of 1-3 files -> draft); pass repo-relative paths and refs to any delegated planner/critic instead of pasting upstream content.",
|
|
79
|
-
"Behavior anchor: see the shared `## Behavior anchor` block in this skill — the bad/good pair anchors how this stage's `Scope Contract` must trace each row to a recorded user signal."
|
|
80
|
-
],
|
|
81
|
-
process: [
|
|
82
|
-
"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.",
|
|
83
|
-
"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.",
|
|
84
|
-
"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.",
|
|
85
|
-
"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.",
|
|
86
|
-
"Run outside voice / adversarial self-check before final approval and record a valid `## Scope Outside Voice Loop` table.",
|
|
87
|
-
"Write explicit scope contract, discretion areas, deferred items, error/rescue registry, constraints (external/regulatory/system), and D-XX locked decisions.",
|
|
88
|
-
"Produce scope summary, completion dashboard, and exact next-stage handoff before asking final approval."
|
|
89
|
-
],
|
|
90
|
-
requiredGates: [
|
|
91
|
-
{ id: "scope_mode_selected", description: "One scope mode was explicitly selected." },
|
|
92
|
-
{ id: "scope_contract_written", description: "In-scope/out-of-scope contract is documented." },
|
|
93
|
-
{ id: "scope_user_approved", description: "User approved the final scope direction." }
|
|
94
|
-
],
|
|
95
|
-
requiredEvidence: [
|
|
96
|
-
"Artifact written to `.cclaw/artifacts/02-scope-<slug>.md`.",
|
|
97
|
-
"Pre-Scope System Audit findings are captured (git log/diff/stash/debt markers).",
|
|
98
|
-
"In-scope and out-of-scope lists are explicit.",
|
|
99
|
-
"Discretion areas are explicit (or marked as `None`).",
|
|
100
|
-
"Selected mode and rationale are documented using HOLD SCOPE, SELECTIVE EXPANSION, SCOPE EXPANSION, or SCOPE REDUCTION.",
|
|
101
|
-
"When selected mode is SCOPE EXPANSION or SELECTIVE EXPANSION, active-run delegation ledger includes a completed `product-discovery` row with non-empty `evidenceRefs`.",
|
|
102
|
-
"Scope Contract captures requirements, locked decisions, discretion areas, accepted/rejected/deferred reference ideas from the Reference Pattern Registry, success definition, and design handoff.",
|
|
103
|
-
"Decision Drivers section records weighted criteria and per-option scores used to choose mode and boundary moves.",
|
|
104
|
-
"Scope Completeness Score is recorded (0.00-1.00) with the explicit blocker list for any remaining uncertainty.",
|
|
105
|
-
"Locked Decisions section lists stable D-XX IDs for non-negotiable boundaries.",
|
|
106
|
-
"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.",
|
|
107
|
-
"Constraints (external/regulatory/system/integration) recorded in `## Scope Contract > Constraints` — spec must reference these in `## Constraints and Assumptions`, not restate them.",
|
|
108
|
-
"Outside Voice findings and dispositions are recorded (accept/reject/defer with rationale) before final approval.",
|
|
109
|
-
"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.",
|
|
110
|
-
"Early-loop status is reflected via `Victory Detector` / `Critic Pass` sections and `.cclaw/state/early-loop.json` when concerns remain.",
|
|
111
|
-
"When a second opinion is used, record source, critique frame, and disposition (accept/reject/defer) with rationale.",
|
|
112
|
-
"Deferred items list with one-line rationale for each.",
|
|
113
|
-
"When an upside deferred idea is parked, a seed file is created under `.cclaw/seeds/` and referenced in the artifact.",
|
|
114
|
-
"Completion dashboard lists per-section status, critical/open gaps, decision count, and unresolved items (or `None`).",
|
|
115
|
-
"Scope Summary includes a next-stage handoff naming the track-aware successor (`design` for standard, `spec` for medium) and the decisions/artifacts it must carry forward."
|
|
116
|
-
],
|
|
117
|
-
inputs: ["brainstorm artifact", "timeline constraints", "product priorities"],
|
|
118
|
-
requiredContext: [
|
|
119
|
-
"approved brainstorm direction with selected option and non-goals",
|
|
120
|
-
"existing capabilities and reusable components",
|
|
121
|
-
"delivery deadlines and risk tolerance"
|
|
122
|
-
],
|
|
123
|
-
researchPlaybooks: [
|
|
124
|
-
"research/git-history.md"
|
|
125
|
-
],
|
|
126
|
-
blockers: [
|
|
127
|
-
"scope mode not selected",
|
|
128
|
-
"in/out boundaries ambiguous",
|
|
129
|
-
"discretion areas undefined",
|
|
130
|
-
"critical premise disagreement unresolved"
|
|
131
|
-
],
|
|
132
|
-
exitCriteria: [
|
|
133
|
-
"scope contract approved by user",
|
|
134
|
-
"discretion areas recorded explicitly",
|
|
135
|
-
"required gates marked satisfied",
|
|
136
|
-
"deferred list recorded explicitly",
|
|
137
|
-
"locked decisions captured with stable D-XX IDs",
|
|
138
|
-
"completion dashboard produced",
|
|
139
|
-
"scope summary produced"
|
|
140
|
-
],
|
|
141
|
-
platformNotes: [
|
|
142
|
-
"Scope contract paths must be repo-relative with forward slashes so they resolve identically on Windows, macOS, and Linux (`src/pkg/mod.ts`, NOT `src\\pkg\\mod.ts`).",
|
|
143
|
-
"When invoking `git log`/`git diff` for the Pre-Scope audit, wrap glob patterns in single quotes on POSIX shells and double quotes on PowerShell (`git log -- 'src/**/*.ts'` vs `git log -- \"src/**/*.ts\"`). Document the command with the quoting style you actually ran.",
|
|
144
|
-
"Do not hard-code machine-specific absolute paths (home dirs, drive letters) into the scope contract — keep boundaries repo-relative."
|
|
145
|
-
]
|
|
146
|
-
},
|
|
147
|
-
artifactRules: {
|
|
148
|
-
artifactFile: "02-scope-<slug>.md",
|
|
149
|
-
completionStatus: ["DONE", "DONE_WITH_CONCERNS", "BLOCKED"],
|
|
150
|
-
crossStageTrace: {
|
|
151
|
-
readsFrom: [".cclaw/artifacts/01-brainstorm-<slug>.md"],
|
|
152
|
-
writesTo: [".cclaw/artifacts/02-scope-<slug>.md"],
|
|
153
|
-
traceabilityRule: "Every scope boundary must be traceable to a brainstorm decision. Every downstream design choice must stay within the scope contract."
|
|
154
|
-
},
|
|
155
|
-
artifactValidation: [
|
|
156
|
-
{ section: "Upstream Handoff", required: false, validationRule: "Summarizes brainstorm/idea decisions, constraints, open questions, and explicit drift before scope decisions." },
|
|
157
|
-
{ 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." },
|
|
158
|
-
{ 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." },
|
|
159
|
-
{ 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." },
|
|
160
|
-
{ 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." },
|
|
161
|
-
{ section: "Decision Drivers", required: false, validationRule: "Recommended: weighted decision drivers (value, risk, reversibility, effort, timeline) with scored options and the selected boundary rationale." },
|
|
162
|
-
{ section: "Scope Completeness Score", required: false, validationRule: "Recommended: score 0.00-1.00 plus unresolved blockers and the escalation trigger when confidence is low." },
|
|
163
|
-
{ 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." },
|
|
164
|
-
{ section: "Taste Calibration", required: false, validationRule: "Optional evidence heading: reference 2-3 strong in-repo modules/files that define the quality bar or justify omission." },
|
|
165
|
-
{ section: "Reference Pattern Registry", required: false, validationRule: "Recommended for SELECTIVE/EXPAND/deep scope: table of pattern/source, accepted/rejected/deferred disposition, invariant to preserve, and boundary impact. Compact HOLD SCOPE may state `Not needed - compact scope`." },
|
|
166
|
-
{ section: "Reference Pull", required: false, validationRule: "Optional evidence heading: cite ideas pulled from `<repo-relative references dir>` or state no reference pull was needed for compact HOLD SCOPE." },
|
|
167
|
-
{ section: "Ambitious Alternatives", required: false, validationRule: "Optional evidence heading for SCOPE EXPANSION/SELECTIVE: list larger alternatives considered and their disposition." },
|
|
168
|
-
{ 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." },
|
|
169
|
-
{ 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`." },
|
|
170
|
-
{ 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." },
|
|
171
|
-
{ section: "Scope Mode", required: true, validationRule: "Must state selected mode and rationale with default heuristic justification." },
|
|
172
|
-
{ 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." },
|
|
173
|
-
{ 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." },
|
|
174
|
-
{ section: "Discretion Areas", required: false, validationRule: "Explicit list of implementer decision zones, or 'None' if scope is fully locked." },
|
|
175
|
-
{ section: "Deferred Items", required: false, validationRule: "Each item has one-line rationale. If empty, state 'None' explicitly." },
|
|
176
|
-
{ section: "Error & Rescue Registry", required: false, validationRule: "Each scoped capability has: failure mode, detection method, fallback decision." },
|
|
177
|
-
{ section: "Outside Voice Findings", required: false, validationRule: "Must list external/adversarial findings and disposition (accept/reject/defer) with rationale." },
|
|
178
|
-
{ section: "Scope Outside Voice Loop", required: false, validationRule: `Must record iterations, quality score per iteration, stop reason, and unresolved concerns. Enforce ${reviewLoopPolicySummary("scope")}` },
|
|
179
|
-
{ 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." },
|
|
180
|
-
{ 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." },
|
|
181
|
-
{ section: "Completion Dashboard", required: true, validationRule: "Lists per-review-section status, count of critical/open gaps, resolved decisions, and unresolved decisions (or 'None')." },
|
|
182
|
-
{ section: "Scope Summary", required: true, validationRule: "Compact recap of the locked scope. Must name the selected mode using one canonical token, confidence, explicit drift from brainstorm, unresolved questions, and the track-aware next-stage handoff (`design` for standard, `spec` for medium); the linter checks structure, not English wording." }
|
|
183
|
-
]
|
|
184
|
-
},
|
|
185
|
-
reviewLens: {
|
|
186
|
-
outputs: ["scope mode decision", "scope contract", "discretion areas list", "deferred scope list", "scope summary", "scope completion dashboard"],
|
|
187
|
-
reviewLoop: {
|
|
188
|
-
stage: "scope",
|
|
189
|
-
checklist: REVIEW_LOOP_CHECKLISTS.scope.map((dimension) => dimension.id),
|
|
190
|
-
maxIterations: 3,
|
|
191
|
-
targetScore: 0.8
|
|
192
|
-
},
|
|
193
|
-
reviewSections: [
|
|
194
|
-
{
|
|
195
|
-
title: "Scope Boundary Audit",
|
|
196
|
-
evaluationPoints: [
|
|
197
|
-
"Are all in-scope items justified by the problem statement?",
|
|
198
|
-
"Are any in-scope items actually solving a proxy problem instead of the real one?",
|
|
199
|
-
"Could any in-scope item be deferred without blocking the core objective?"
|
|
200
|
-
],
|
|
201
|
-
stopGate: true
|
|
202
|
-
},
|
|
203
|
-
{
|
|
204
|
-
title: "Deferred Items Review",
|
|
205
|
-
evaluationPoints: [
|
|
206
|
-
"Does each deferred item have a one-line rationale?",
|
|
207
|
-
"Are any deferred items actually blockers for the core scope?",
|
|
208
|
-
"Will deferring these items create technical debt that is expensive to unwind?"
|
|
209
|
-
],
|
|
210
|
-
stopGate: true
|
|
211
|
-
},
|
|
212
|
-
{
|
|
213
|
-
title: "Risk and Reversibility Check",
|
|
214
|
-
evaluationPoints: [
|
|
215
|
-
"For each major scope decision: is it reversible?",
|
|
216
|
-
"What is the blast radius if this decision is wrong?",
|
|
217
|
-
"Are there hidden dependencies between in-scope and out-of-scope items?"
|
|
218
|
-
],
|
|
219
|
-
stopGate: true
|
|
220
|
-
},
|
|
221
|
-
{
|
|
222
|
-
title: "Existing-Code Reuse Check",
|
|
223
|
-
evaluationPoints: [
|
|
224
|
-
"Has every sub-problem been mapped to existing code?",
|
|
225
|
-
"Is the plan rebuilding anything that already exists?",
|
|
226
|
-
"Are there integration opportunities that reduce new code?",
|
|
227
|
-
"Have you searched for built-in or library solutions before scoping custom work?"
|
|
228
|
-
],
|
|
229
|
-
stopGate: true
|
|
230
|
-
},
|
|
231
|
-
{
|
|
232
|
-
title: "Error & Rescue Scope Check",
|
|
233
|
-
evaluationPoints: [
|
|
234
|
-
"For every new capability: what breaks if it fails?",
|
|
235
|
-
"Is failure detection in scope or deferred? If deferred, is that acceptable?",
|
|
236
|
-
"Are there rescue/fallback paths for critical user journeys?",
|
|
237
|
-
"Is observability (logging, metrics, alerts) explicitly in or out of scope?"
|
|
238
|
-
],
|
|
239
|
-
stopGate: true
|
|
240
|
-
},
|
|
241
|
-
{
|
|
242
|
-
title: "Outside Voice Reconciliation",
|
|
243
|
-
evaluationPoints: [
|
|
244
|
-
"Were adversarial findings categorized as accept/reject/defer with rationale?",
|
|
245
|
-
"Did any rejected finding still expose a real gap in assumptions?",
|
|
246
|
-
"Is quality score trajectory improving across iterations?",
|
|
247
|
-
"Did the review loop stop because quality threshold was met (>=0.8) or because retry budget was exhausted?"
|
|
248
|
-
],
|
|
249
|
-
stopGate: true
|
|
250
|
-
}
|
|
251
|
-
]
|
|
252
|
-
},
|
|
253
|
-
next: "design"
|
|
254
|
-
};
|