cclaw-cli 0.48.35 → 0.51.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/README.md +54 -82
- package/dist/artifact-linter.d.ts +4 -0
- package/dist/artifact-linter.js +24 -3
- package/dist/cli.d.ts +1 -19
- package/dist/cli.js +49 -495
- package/dist/constants.d.ts +2 -13
- package/dist/constants.js +1 -46
- package/dist/content/closeout-guidance.d.ts +14 -0
- package/dist/content/closeout-guidance.js +42 -0
- package/dist/content/core-agents.js +51 -9
- package/dist/content/decision-protocol.d.ts +12 -0
- package/dist/content/decision-protocol.js +20 -0
- package/dist/content/diff-command.d.ts +1 -2
- package/dist/content/diff-command.js +8 -94
- package/dist/content/examples.d.ts +4 -10
- package/dist/content/examples.js +10 -20
- package/dist/content/hook-events.js +2 -2
- package/dist/content/hook-inline-snippets.d.ts +5 -2
- package/dist/content/hook-inline-snippets.js +33 -1
- package/dist/content/hook-manifest.d.ts +3 -4
- package/dist/content/hook-manifest.js +11 -12
- package/dist/content/hooks.js +2 -0
- package/dist/content/ideate-command.d.ts +2 -0
- package/dist/content/ideate-command.js +31 -25
- package/dist/content/iron-laws.d.ts +5 -5
- package/dist/content/iron-laws.js +5 -5
- package/dist/content/learnings.d.ts +3 -4
- package/dist/content/learnings.js +24 -50
- package/dist/content/meta-skill.js +31 -24
- package/dist/content/next-command.js +38 -38
- package/dist/content/node-hooks.js +17 -343
- package/dist/content/opencode-plugin.js +2 -100
- package/dist/content/research-playbooks.js +14 -14
- package/dist/content/review-loop.d.ts +2 -0
- package/dist/content/review-loop.js +8 -0
- package/dist/content/session-hooks.js +14 -46
- package/dist/content/skills.d.ts +0 -5
- package/dist/content/skills.js +53 -128
- package/dist/content/stage-common-guidance.d.ts +0 -1
- package/dist/content/stage-common-guidance.js +15 -14
- package/dist/content/stage-schema.d.ts +26 -1
- package/dist/content/stage-schema.js +121 -40
- package/dist/content/stages/_lint-metadata/index.js +9 -15
- package/dist/content/stages/brainstorm.js +22 -43
- package/dist/content/stages/design.js +37 -57
- package/dist/content/stages/plan.js +22 -13
- package/dist/content/stages/review.js +24 -27
- package/dist/content/stages/scope.js +34 -46
- package/dist/content/stages/ship.js +7 -4
- package/dist/content/stages/spec.js +20 -9
- package/dist/content/stages/tdd.js +64 -44
- package/dist/content/start-command.js +10 -12
- package/dist/content/status-command.d.ts +2 -7
- package/dist/content/status-command.js +19 -146
- package/dist/content/subagents.d.ts +0 -5
- package/dist/content/subagents.js +47 -28
- package/dist/content/templates.d.ts +1 -1
- package/dist/content/templates.js +126 -135
- package/dist/content/track-render-context.d.ts +17 -0
- package/dist/content/track-render-context.js +44 -0
- package/dist/content/tree-command.d.ts +1 -2
- package/dist/content/tree-command.js +4 -87
- package/dist/content/utility-skills.d.ts +2 -29
- package/dist/content/utility-skills.js +2 -1533
- package/dist/content/view-command.js +29 -11
- package/dist/delegation.d.ts +1 -1
- package/dist/delegation.js +5 -15
- package/dist/doctor-registry.js +20 -21
- package/dist/doctor.js +88 -408
- package/dist/flow-state.d.ts +3 -0
- package/dist/flow-state.js +2 -0
- package/dist/harness-adapters.d.ts +1 -1
- package/dist/harness-adapters.js +48 -57
- package/dist/install.js +128 -520
- package/dist/internal/advance-stage.js +3 -9
- package/dist/internal/compound-readiness.d.ts +1 -1
- package/dist/internal/compound-readiness.js +1 -1
- package/dist/internal/tdd-loop-status.d.ts +1 -1
- package/dist/internal/tdd-loop-status.js +1 -1
- package/dist/knowledge-store.d.ts +16 -10
- package/dist/knowledge-store.js +51 -15
- package/dist/policy.js +16 -109
- package/dist/run-archive.d.ts +4 -6
- package/dist/run-archive.js +15 -20
- package/dist/run-persistence.d.ts +2 -2
- package/dist/run-persistence.js +3 -9
- package/package.json +1 -2
- package/dist/content/archive-command.d.ts +0 -2
- package/dist/content/archive-command.js +0 -124
- package/dist/content/compound-command.d.ts +0 -5
- package/dist/content/compound-command.js +0 -193
- package/dist/content/contexts.d.ts +0 -9
- package/dist/content/contexts.js +0 -65
- package/dist/content/contracts.d.ts +0 -2
- package/dist/content/contracts.js +0 -51
- package/dist/content/doctor-references.d.ts +0 -2
- package/dist/content/doctor-references.js +0 -150
- package/dist/content/eval-scaffold.d.ts +0 -15
- package/dist/content/eval-scaffold.js +0 -370
- package/dist/content/feature-command.d.ts +0 -2
- package/dist/content/feature-command.js +0 -123
- package/dist/content/flow-map.d.ts +0 -23
- package/dist/content/flow-map.js +0 -134
- package/dist/content/harness-doc.d.ts +0 -2
- package/dist/content/harness-doc.js +0 -202
- package/dist/content/harness-playbooks.d.ts +0 -24
- package/dist/content/harness-playbooks.js +0 -393
- package/dist/content/harness-tool-refs.d.ts +0 -20
- package/dist/content/harness-tool-refs.js +0 -268
- package/dist/content/ops-command.d.ts +0 -2
- package/dist/content/ops-command.js +0 -71
- package/dist/content/protocols.d.ts +0 -7
- package/dist/content/protocols.js +0 -215
- package/dist/content/retro-command.d.ts +0 -2
- package/dist/content/retro-command.js +0 -165
- package/dist/content/rewind-command.d.ts +0 -2
- package/dist/content/rewind-command.js +0 -106
- package/dist/content/tdd-log-command.d.ts +0 -2
- package/dist/content/tdd-log-command.js +0 -85
- package/dist/eval/agents/single-shot.d.ts +0 -27
- package/dist/eval/agents/single-shot.js +0 -79
- package/dist/eval/agents/with-tools.d.ts +0 -44
- package/dist/eval/agents/with-tools.js +0 -261
- package/dist/eval/agents/workflow.d.ts +0 -31
- package/dist/eval/agents/workflow.js +0 -155
- package/dist/eval/baseline.d.ts +0 -38
- package/dist/eval/baseline.js +0 -282
- package/dist/eval/config-loader.d.ts +0 -14
- package/dist/eval/config-loader.js +0 -395
- package/dist/eval/corpus.d.ts +0 -30
- package/dist/eval/corpus.js +0 -330
- package/dist/eval/cost-guard.d.ts +0 -102
- package/dist/eval/cost-guard.js +0 -190
- package/dist/eval/diff.d.ts +0 -64
- package/dist/eval/diff.js +0 -323
- package/dist/eval/llm-client.d.ts +0 -176
- package/dist/eval/llm-client.js +0 -267
- package/dist/eval/mode.d.ts +0 -28
- package/dist/eval/mode.js +0 -61
- package/dist/eval/progress.d.ts +0 -83
- package/dist/eval/progress.js +0 -59
- package/dist/eval/report.d.ts +0 -11
- package/dist/eval/report.js +0 -181
- package/dist/eval/rubric-loader.d.ts +0 -20
- package/dist/eval/rubric-loader.js +0 -143
- package/dist/eval/runner.d.ts +0 -81
- package/dist/eval/runner.js +0 -746
- package/dist/eval/runs.d.ts +0 -41
- package/dist/eval/runs.js +0 -114
- package/dist/eval/sandbox.d.ts +0 -38
- package/dist/eval/sandbox.js +0 -137
- package/dist/eval/tools/glob.d.ts +0 -2
- package/dist/eval/tools/glob.js +0 -163
- package/dist/eval/tools/grep.d.ts +0 -2
- package/dist/eval/tools/grep.js +0 -152
- package/dist/eval/tools/index.d.ts +0 -7
- package/dist/eval/tools/index.js +0 -35
- package/dist/eval/tools/read.d.ts +0 -2
- package/dist/eval/tools/read.js +0 -122
- package/dist/eval/tools/types.d.ts +0 -49
- package/dist/eval/tools/types.js +0 -41
- package/dist/eval/tools/write.d.ts +0 -2
- package/dist/eval/tools/write.js +0 -92
- package/dist/eval/types.d.ts +0 -561
- package/dist/eval/types.js +0 -47
- package/dist/eval/verifiers/judge.d.ts +0 -40
- package/dist/eval/verifiers/judge.js +0 -256
- package/dist/eval/verifiers/rules.d.ts +0 -24
- package/dist/eval/verifiers/rules.js +0 -218
- package/dist/eval/verifiers/structural.d.ts +0 -14
- package/dist/eval/verifiers/structural.js +0 -171
- package/dist/eval/verifiers/traceability.d.ts +0 -23
- package/dist/eval/verifiers/traceability.js +0 -84
- package/dist/eval/verifiers/workflow-consistency.d.ts +0 -21
- package/dist/eval/verifiers/workflow-consistency.js +0 -225
- package/dist/eval/workflow-corpus.d.ts +0 -7
- package/dist/eval/workflow-corpus.js +0 -207
- package/dist/feature-system.d.ts +0 -42
- package/dist/feature-system.js +0 -432
- package/dist/internal/knowledge-digest.d.ts +0 -7
- package/dist/internal/knowledge-digest.js +0 -93
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { RUNTIME_ROOT } from "../constants.js";
|
|
2
|
-
import { FLOW_MAP_REL_PATH } from "./flow-map.js";
|
|
3
2
|
import { stageSchema } from "./stage-schema.js";
|
|
3
|
+
import { closeoutChainInline, closeoutNextCommandGuidance, closeoutSubstateInline, closeoutSubstateProtocolBullets } from "./closeout-guidance.js";
|
|
4
4
|
import { stageSkillFolder } from "./skills.js";
|
|
5
5
|
const NEXT_SKILL_FOLDER = "flow-next-step";
|
|
6
6
|
const NEXT_SKILL_NAME = "flow-next-step";
|
|
@@ -58,7 +58,8 @@ export function nextCommandContract() {
|
|
|
58
58
|
|
|
59
59
|
- **Current stage not started / in progress** → load its skill and execute it.
|
|
60
60
|
- **Current stage complete (all gates passed)** → advance \`currentStage\` and load the next skill.
|
|
61
|
-
- **
|
|
61
|
+
- **Ship complete** → continue the resumable ${closeoutChainInline()} closeout via \`/cc-next\`.
|
|
62
|
+
- **Flow complete** → report done after closeout has archived the run.
|
|
62
63
|
|
|
63
64
|
This is the only progression command the user needs to drive the entire flow. Stage command contracts are internal implementation details loaded by \`/cc-next\`.
|
|
64
65
|
|
|
@@ -66,13 +67,13 @@ This is the only progression command the user needs to drive the entire flow. St
|
|
|
66
67
|
|
|
67
68
|
- **Do not** invent gate completion: use only \`${flowPath}\` plus observable evidence in repo artifacts.
|
|
68
69
|
- **Do not** skip stages: advance only from \`currentStage\` to its configured successor.
|
|
69
|
-
-
|
|
70
|
+
- ${closeoutNextCommandGuidance()}
|
|
70
71
|
|
|
71
72
|
## Algorithm (mandatory)
|
|
72
73
|
|
|
73
74
|
1. Read **\`${flowPath}\`**. If missing → **BLOCKED** (state missing).
|
|
74
75
|
2. Parse JSON. Capture \`currentStage\` and \`stageGateCatalog[currentStage]\`.
|
|
75
|
-
3. If \`staleStages[currentStage]\` exists, do not advance automatically. Re-run the stage artifact work, then clear the marker with
|
|
76
|
+
3. If \`staleStages[currentStage]\` exists, do not advance automatically. Re-run the stage artifact work, then clear the marker with \`cclaw internal rewind --ack <currentStage>\`.
|
|
76
77
|
4. Read **\`${reconciliationNoticesPath}\`** when present. If it contains entries for \`activeRunId + currentStage\` and the listed gate is still blocked in \`stageGateCatalog[currentStage].blocked\`, emit a structured warning before any stage-advance decision.
|
|
77
78
|
5. Let \`G\` = \`requiredGates\` for **\`currentStage\`** from the stage schema.
|
|
78
79
|
6. Let \`catalog\` = \`stageGateCatalog[currentStage]\` from flow state.
|
|
@@ -81,11 +82,11 @@ This is the only progression command the user needs to drive the entire flow. St
|
|
|
81
82
|
9. If \`M\` is non-empty, inspect **\`${delegationPath}\`**. Treat as satisfied only if each mandatory agent is **completed** or **waived**.
|
|
82
83
|
10. For each satisfied mandatory delegation row, verify \`evidenceRefs\` is a non-empty array (unless status is \`waived\` with rationale). Missing evidenceRefs means delegation is unresolved.
|
|
83
84
|
11. If any mandatory delegation is missing and no waiver exists: **STOP** and ask the user whether to dispatch now or waive with rationale. Do not mark gates passed while delegation is unresolved.
|
|
84
|
-
12. If \`currentStage === "review"\` and \`catalog.blocked\` includes \`review_criticals_resolved\`, treat this as a hard remediation branch: recommend
|
|
85
|
+
12. If \`currentStage === "review"\` and \`catalog.blocked\` includes \`review_criticals_resolved\`, treat this as a hard remediation branch: recommend \`cclaw internal rewind tdd "review_blocked_by_critical"\` with the blocking finding IDs, and do not attempt to advance toward ship.
|
|
85
86
|
|
|
86
87
|
### Path A: Current stage is NOT complete (any gate unmet or delegation missing)
|
|
87
88
|
|
|
88
|
-
→ Load **\`${RUNTIME_ROOT}/skills/<skillFolder>/SKILL.md\`**
|
|
89
|
+
→ Load **\`${RUNTIME_ROOT}/skills/<skillFolder>/SKILL.md\`** for the current stage.
|
|
89
90
|
→ Execute that stage's protocol. The stage skill handles the full interaction including STOP points and gate tracking.
|
|
90
91
|
→ Stage completion must use \`node .cclaw/hooks/stage-complete.mjs <currentStage>\` (canonical), which validates delegations + gate evidence before mutating \`flow-state.json\`.
|
|
91
92
|
|
|
@@ -95,24 +96,11 @@ ${ralphLoopContractSnippet()}
|
|
|
95
96
|
|
|
96
97
|
→ If current stage's \`next\` is **\`done\`**:
|
|
97
98
|
|
|
98
|
-
|
|
99
|
-
- \`"idle"\` or missing -> set \`closeout.shipSubstate = "retro_review"\`, then
|
|
100
|
-
load \`${RUNTIME_ROOT}/commands/retro.md\` + \`${RUNTIME_ROOT}/skills/flow-retro/SKILL.md\`
|
|
101
|
-
and execute the retro protocol (draft + one structured accept/edit/skip ask).
|
|
102
|
-
- \`"retro_review"\` -> continue the retro protocol (re-ask the structured
|
|
103
|
-
question; the draft already exists — do not regenerate it).
|
|
104
|
-
- \`"compound_review"\` -> load \`${RUNTIME_ROOT}/commands/compound.md\` +
|
|
105
|
-
\`${RUNTIME_ROOT}/skills/flow-compound/SKILL.md\`, execute the compound
|
|
106
|
-
scan, ask user **one** structured question (apply / skip) per candidate
|
|
107
|
-
cluster or a single accept-all / skip choice, and advance substate on
|
|
108
|
-
completion or skip.
|
|
109
|
-
- \`"ready_to_archive"\` -> load \`${RUNTIME_ROOT}/commands/archive.md\` +
|
|
110
|
-
\`${RUNTIME_ROOT}/skills/flow-archive/SKILL.md\`, run archive, reset state.
|
|
111
|
-
- \`"archived"\` (transient) -> report "run archived" and stop.
|
|
99
|
+
${closeoutSubstateProtocolBullets()}
|
|
112
100
|
|
|
113
101
|
Otherwise report **"Flow complete. All stages finished."** and stop.
|
|
114
102
|
|
|
115
|
-
→ Otherwise: load **\`${RUNTIME_ROOT}/skills/<skillFolder>/SKILL.md\`**
|
|
103
|
+
→ Otherwise: load **\`${RUNTIME_ROOT}/skills/<skillFolder>/SKILL.md\`** for the successor stage. Execute that stage's protocol.
|
|
116
104
|
|
|
117
105
|
### Track-aware successor resolution
|
|
118
106
|
|
|
@@ -128,7 +116,7 @@ ${ralphLoopContractSnippet()}
|
|
|
128
116
|
\`/cc-next\` in a **new session** = resume from where you left off:
|
|
129
117
|
- Flow-state records \`currentStage\` and which gates have passed.
|
|
130
118
|
- The stage skill reads upstream artifacts and picks up context.
|
|
131
|
-
-
|
|
119
|
+
- ${closeoutSubstateInline()} carries the post-ship substate, so a crashed
|
|
132
120
|
session during retro/compound/archive resumes at the exact step without
|
|
133
121
|
regenerating the retro draft.
|
|
134
122
|
- No special resume command needed — \`/cc-next\` IS the resume command.
|
|
@@ -151,9 +139,7 @@ Validate envelopes with:
|
|
|
151
139
|
|
|
152
140
|
## Surface reference
|
|
153
141
|
|
|
154
|
-
|
|
155
|
-
state files) load \`${FLOW_MAP_REL_PATH}\`. It is the single-page
|
|
156
|
-
overview and is safe to read at any time.
|
|
142
|
+
Use the flow-start skill plus \`.cclaw/state/flow-state.json\` for orientation when needed.
|
|
157
143
|
`;
|
|
158
144
|
}
|
|
159
145
|
/**
|
|
@@ -182,6 +168,21 @@ description: "The primary progression command. Reads flow state, starts/resumes
|
|
|
182
168
|
|
|
183
169
|
\`/cc-next\` is **the only command you need** to drive the entire cclaw flow.
|
|
184
170
|
|
|
171
|
+
## Operator Output Contract
|
|
172
|
+
|
|
173
|
+
Default output should be compact, like OMC/OMX operator surfaces:
|
|
174
|
+
|
|
175
|
+
\`\`\`
|
|
176
|
+
Stage: <currentStage> (<track>)
|
|
177
|
+
Gates: <passed>/<required> passed, <blocked> blocked
|
|
178
|
+
Delegations: <done>/<mandatory> done
|
|
179
|
+
Blockers: <none | gate/delegation/reconciliation ids>
|
|
180
|
+
Next: <exact next action, usually /cc-next or one named remediation>
|
|
181
|
+
\`\`\`
|
|
182
|
+
|
|
183
|
+
Only expand beyond this when blocked, when asking a structured question, or when
|
|
184
|
+
the user explicitly requests detail. Do not dump full artifacts in progression output.
|
|
185
|
+
|
|
185
186
|
**How it works:**
|
|
186
187
|
1. Reads \`flow-state.json\` to find \`currentStage\`
|
|
187
188
|
2. Checks if all gates for that stage are satisfied
|
|
@@ -200,7 +201,7 @@ Do **not** mark gates satisfied from memory alone. Cite **artifact evidence** (p
|
|
|
200
201
|
|
|
201
202
|
1. Open **\`${flowPath}\`**.
|
|
202
203
|
2. Record \`currentStage\` and \`stageGateCatalog[currentStage]\`.
|
|
203
|
-
3. If \`staleStages[currentStage]\` exists, re-run the stage and clear marker via
|
|
204
|
+
3. If \`staleStages[currentStage]\` exists, re-run the stage and clear marker via \`cclaw internal rewind --ack <currentStage>\` before advancing.
|
|
204
205
|
4. If the file is missing or invalid JSON → **BLOCKED** (report and stop).
|
|
205
206
|
5. Read \`${reconciliationNoticesPath}\` when present. For entries matching \`activeRunId + currentStage\` whose gate is still in \`stageGateCatalog[currentStage].blocked\`, show a warning with gate id + reason before proceeding.
|
|
206
207
|
|
|
@@ -221,42 +222,41 @@ If reconciliation warnings were emitted in Step 1, treat them as a pre-advance s
|
|
|
221
222
|
|
|
222
223
|
**Path A — stage NOT complete (any gate unmet):**
|
|
223
224
|
|
|
224
|
-
Load the current stage
|
|
225
|
+
Load the current stage skill:
|
|
225
226
|
- \`${RUNTIME_ROOT}/skills/<skillFolder>/SKILL.md\`
|
|
226
|
-
- \`${RUNTIME_ROOT}/commands/<currentStage>.md\`
|
|
227
227
|
|
|
228
228
|
Execute the stage protocol. The stage skill handles interaction, STOP points, gate tracking, and stage completion via \`node .cclaw/hooks/stage-complete.mjs <stage>\` (canonical flow-state mutation path).
|
|
229
229
|
|
|
230
230
|
${ralphLoopContractSnippet()}
|
|
231
231
|
|
|
232
|
-
Special-case for review: if \`review_criticals_resolved\` is in \`blocked\`, route to rework instead of looping review forever — recommend
|
|
232
|
+
Special-case for review: if \`review_criticals_resolved\` is in \`blocked\`, route to rework instead of looping review forever — recommend \`cclaw internal rewind tdd "review_blocked_by_critical"\`.
|
|
233
233
|
|
|
234
234
|
**Path B — stage IS complete (all gates met, all delegations done):**
|
|
235
235
|
|
|
236
236
|
If \`next\` is \`done\`:
|
|
237
237
|
|
|
238
238
|
When \`currentStage\` is \`ship\`, automatically drive the **closeout chain**
|
|
239
|
-
by inspecting
|
|
239
|
+
by inspecting ${closeoutSubstateInline()}:
|
|
240
240
|
|
|
241
241
|
| shipSubstate | Action |
|
|
242
242
|
|-----------------------|-----------------------------------------------------|
|
|
243
243
|
| \`idle\` / missing | Flip to \`retro_review\` and start retro protocol |
|
|
244
|
-
| \`retro_review\` |
|
|
245
|
-
| \`compound_review\` |
|
|
246
|
-
| \`ready_to_archive\` | Run archive
|
|
244
|
+
| \`retro_review\` | Draft/update \`09-retro.md\`, ask accept/edit/skip |
|
|
245
|
+
| \`compound_review\` | Compound closeout: overlap scan, refresh/supersede, ask approve/skip |
|
|
246
|
+
| \`ready_to_archive\` | Run \`cclaw archive\`; reset flow-state on success |
|
|
247
247
|
| \`archived\` | Report "run archived"; stop |
|
|
248
248
|
|
|
249
|
-
Each step owns its own state transition. \`/cc-next\`
|
|
250
|
-
|
|
251
|
-
skill and command contract and executes the protocol in-session.
|
|
249
|
+
Each step owns its own state transition. \`/cc-next\` keeps retro and compound
|
|
250
|
+
in-session, then uses the archive runtime only at \`ready_to_archive\`.
|
|
252
251
|
|
|
253
252
|
Otherwise report **"Flow complete. All stages finished."** and stop.
|
|
254
253
|
|
|
255
|
-
Otherwise (non-terminal \`next\`): load the next stage
|
|
256
|
-
contract, begin execution.
|
|
254
|
+
Otherwise (non-terminal \`next\`): load the next stage skill and begin execution.
|
|
257
255
|
|
|
258
256
|
## Stage order
|
|
259
257
|
|
|
258
|
+
This table is the critical path. After \`ship\`, \`/cc-next\` continues closeout via ${closeoutSubstateInline()}: ${closeoutChainInline()}.
|
|
259
|
+
|
|
260
260
|
| Stage | Next | Skill path |
|
|
261
261
|
|---|---|---|
|
|
262
262
|
${stageRows}
|