cclaw-cli 0.48.20 → 0.48.21
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.
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Single source of truth for how /cc-next should treat Ralph Loop status.
|
|
3
|
+
*
|
|
4
|
+
* IMPORTANT: Ralph Loop is a **progress indicator + soft pre-advance nudge**,
|
|
5
|
+
* not a hard gate. Hard enforcement always flows through flow-state.json
|
|
6
|
+
* gates via `stage-complete.mjs`. Both the command contract and the skill
|
|
7
|
+
* document render this same paragraph to prevent drift — see
|
|
8
|
+
* `tests/e2e/next-command-ralph-loop-contract.test.ts`.
|
|
9
|
+
*/
|
|
10
|
+
export declare const RALPH_LOOP_CONTRACT_MARKER = "ralph-loop-contract:v1";
|
|
11
|
+
export declare function ralphLoopContractSnippet(): string;
|
|
1
12
|
/**
|
|
2
13
|
* Command contract for /cc-next — the primary progression command.
|
|
3
14
|
* Reads flow-state, starts the current stage if unfinished, or advances if all gates pass.
|
|
@@ -13,6 +13,34 @@ function delegationLogPathLine() {
|
|
|
13
13
|
function reconciliationNoticesPathLine() {
|
|
14
14
|
return `${RUNTIME_ROOT}/state/reconciliation-notices.json`;
|
|
15
15
|
}
|
|
16
|
+
/**
|
|
17
|
+
* Single source of truth for how /cc-next should treat Ralph Loop status.
|
|
18
|
+
*
|
|
19
|
+
* IMPORTANT: Ralph Loop is a **progress indicator + soft pre-advance nudge**,
|
|
20
|
+
* not a hard gate. Hard enforcement always flows through flow-state.json
|
|
21
|
+
* gates via `stage-complete.mjs`. Both the command contract and the skill
|
|
22
|
+
* document render this same paragraph to prevent drift — see
|
|
23
|
+
* `tests/e2e/next-command-ralph-loop-contract.test.ts`.
|
|
24
|
+
*/
|
|
25
|
+
export const RALPH_LOOP_CONTRACT_MARKER = "ralph-loop-contract:v1";
|
|
26
|
+
export function ralphLoopContractSnippet() {
|
|
27
|
+
return `**Ralph Loop (tdd only).** When \`currentStage === "tdd"\`, read
|
|
28
|
+
\`${RUNTIME_ROOT}/state/ralph-loop.json\` (refreshed on every session-start
|
|
29
|
+
while the flow is in tdd) as a **progress indicator**:
|
|
30
|
+
|
|
31
|
+
- \`loopIteration\` — running count of RED → GREEN cycles already landed.
|
|
32
|
+
- \`acClosed\` — distinct acceptance-criterion IDs closed by GREEN rows
|
|
33
|
+
(populated from \`acIds\` in \`tdd-cycle-log.jsonl\`).
|
|
34
|
+
- \`redOpenSlices\` — slices with an unsatisfied RED.
|
|
35
|
+
|
|
36
|
+
Ralph Loop is a **soft pre-advance nudge**, not a gate: do not advance
|
|
37
|
+
toward review while \`redOpenSlices\` is non-empty unless the user
|
|
38
|
+
explicitly defers a slice. Hard gate enforcement always flows through
|
|
39
|
+
\`flow-state.json\` gates via \`node .cclaw/hooks/stage-complete.mjs <stage>\`;
|
|
40
|
+
Ralph Loop fields never gate-check on their own.
|
|
41
|
+
|
|
42
|
+
<!-- ${RALPH_LOOP_CONTRACT_MARKER} -->`;
|
|
43
|
+
}
|
|
16
44
|
/**
|
|
17
45
|
* Command contract for /cc-next — the primary progression command.
|
|
18
46
|
* Reads flow-state, starts the current stage if unfinished, or advances if all gates pass.
|
|
@@ -60,17 +88,8 @@ This is the only progression command the user needs to drive the entire flow. St
|
|
|
60
88
|
→ Load **\`${RUNTIME_ROOT}/skills/<skillFolder>/SKILL.md\`** and **\`${RUNTIME_ROOT}/commands/<currentStage>.md\`** for the current stage.
|
|
61
89
|
→ Execute that stage's protocol. The stage skill handles the full interaction including STOP points and gate tracking.
|
|
62
90
|
→ Stage completion must use \`node .cclaw/hooks/stage-complete.mjs <currentStage>\` (canonical), which validates delegations + gate evidence before mutating \`flow-state.json\`.
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
while the flow is in tdd). Use it as a ground-truth progress indicator:
|
|
66
|
-
- \`loopIteration\` tells you how many RED → GREEN cycles already landed.
|
|
67
|
-
- \`acClosed\` lists the distinct acceptance-criterion IDs a GREEN row has
|
|
68
|
-
closed so far — if your plan tasks map to ACs, this is the "tasks
|
|
69
|
-
remaining" signal without needing a separate counter.
|
|
70
|
-
- \`redOpenSlices\` is the set of slices with an unsatisfied RED. Do not
|
|
71
|
-
advance to review while this is non-empty.
|
|
72
|
-
- Stage advancement to \`review\` still requires the normal gates in
|
|
73
|
-
\`flow-state.json\`; Ralph Loop status is a soft nudge, not a gate.
|
|
91
|
+
|
|
92
|
+
${ralphLoopContractSnippet()}
|
|
74
93
|
|
|
75
94
|
### Path B: Current stage IS complete (all gates passed, all delegations satisfied)
|
|
76
95
|
|
|
@@ -208,14 +227,7 @@ Load the current stage's skill and command contract:
|
|
|
208
227
|
|
|
209
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).
|
|
210
229
|
|
|
211
|
-
|
|
212
|
-
normal gate-evidence view with \`${RUNTIME_ROOT}/state/ralph-loop.json\`:
|
|
213
|
-
\`loopIteration\` is the running count of RED → GREEN cycles,
|
|
214
|
-
\`acClosed\` lists distinct acceptance-criterion IDs already closed by
|
|
215
|
-
GREEN rows (populated from \`acIds\` in \`tdd-cycle-log.jsonl\`), and
|
|
216
|
-
\`redOpenSlices\` is the "tasks remaining" indicator. Advance only when
|
|
217
|
-
every planned slice is in \`acClosed\` (or explicitly deferred) and
|
|
218
|
-
\`redOpenSlices\` is empty.
|
|
230
|
+
${ralphLoopContractSnippet()}
|
|
219
231
|
|
|
220
232
|
Special-case for review: if \`review_criticals_resolved\` is in \`blocked\`, route to rework instead of looping review forever — recommend \`/cc-ops rewind tdd "review_blocked_by_critical"\`.
|
|
221
233
|
|