cclaw-cli 0.33.0 → 0.34.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 CHANGED
@@ -133,7 +133,7 @@ inside `/cc-ops` subcommands.
133
133
  | **`/cc <idea>`** | Classify the task, discover origin docs (`docs/prd/**`, ADRs, root `PRD.md`, …), sniff the stack, recommend a track, then start the first stage of that track. `/cc` without arguments resumes the current flow. |
134
134
  | **`/cc-next`** | The one progression primitive. Reads `flow-state.json`, checks gates + mandatory subagent delegations, and either resumes the current stage or advances to the next. `/cc-next` in a new session is how you **resume**. |
135
135
  | **`/cc-ideate`** | Repository improvement discovery. Scans for TODOs, flaky tests, oversized modules, docs drift, and recurring knowledge-store lessons; returns a ranked backlog before you commit to a specific feature. |
136
- | **`/cc-view`** | Read-only flow visibility. `/cc-view status` (default), `/cc-view tree`, `/cc-view diff` (baseline delta map). Never mutates state. |
136
+ | **`/cc-view`** | Read-only flow visibility. `/cc-view status` (default) shows stage progress, mandatory delegations with their fulfillment mode (isolated / generic-dispatch / role-switch), the ship closeout substate (retro → compound → archive), and the active harness parity row. `/cc-view tree` renders the same picture as a tree with a closeout sub-branch under ship and a per-harness playbook summary. `/cc-view diff` shows stage/gate/closeout/delegation deltas since the last run. Never mutates state (except diff's snapshot baseline). |
137
137
 
138
138
  > Power-user surface: `/cc-ops` is an operational router for manual
139
139
  > overrides (rewind a stale stage, manage parallel features, re-run a
@@ -7,12 +7,23 @@ function flowStatePath() {
7
7
  function snapshotPath() {
8
8
  return `${RUNTIME_ROOT}/state/flow-state.snapshot.json`;
9
9
  }
10
+ function delegationLogPath() {
11
+ return `${RUNTIME_ROOT}/state/delegation-log.json`;
12
+ }
13
+ function retroArtifactPath() {
14
+ return `${RUNTIME_ROOT}/artifacts/09-retro.md`;
15
+ }
10
16
  export function diffCommandContract() {
11
17
  return `# /cc-view diff
12
18
 
13
19
  ## Purpose
14
20
 
15
- Show a visual before/after diff map for flow-state progression.
21
+ Show a visual before/after diff map for flow-state progression. Covers the core
22
+ stage/gate transitions plus:
23
+
24
+ - ship **closeout substate** transitions (\`retro_review\` → \`compound_review\` → \`ready_to_archive\`),
25
+ - delegation **fulfillmentMode** transitions per mandatory agent,
26
+ - appearance or removal of the retro artifact \`09-retro.md\`.
16
27
 
17
28
  ## HARD-GATE
18
29
 
@@ -21,16 +32,27 @@ Show a visual before/after diff map for flow-state progression.
21
32
 
22
33
  ## Algorithm
23
34
 
24
- 1. Read current state from \`${flowStatePath()}\`.
25
- 2. Read baseline from \`${snapshotPath()}\` (if missing -> create baseline from current state and stop).
26
- 3. Compute deltas:
27
- - stage transition (\`from -> to\`)
28
- - completed stage additions/removals
29
- - skipped stage additions/removals
30
- - stale stage additions/removals
31
- - current-stage gate \`passed\` and \`blocked\` changes
32
- 4. Render a compact diff map (added \`+\`, removed \`-\`, changed \`->\`).
33
- 5. Persist current state back to \`${snapshotPath()}\` as new baseline with \`capturedAt\`.
35
+ 1. Read current state from \`${flowStatePath()}\` (including \`closeout\`).
36
+ 2. Read current delegation log from \`${delegationLogPath()}\` (if missing treat as empty).
37
+ 3. Read baseline from \`${snapshotPath()}\` (if missing -> create baseline from
38
+ current state **plus** a copy of the current delegation log; report
39
+ \`flow diff baseline created\` and stop).
40
+ 4. Compute deltas:
41
+ - stage transition (\`from -> to\`),
42
+ - completed stage additions/removals,
43
+ - skipped stage additions/removals,
44
+ - stale stage additions/removals,
45
+ - current-stage gate \`passed\` and \`blocked\` changes,
46
+ - \`closeout.shipSubstate\` transition (\`from -> to\`),
47
+ - \`closeout.retroDraftedAt\` / \`retroAcceptedAt\` / \`retroSkipped\` flips,
48
+ - \`closeout.compoundPromoted\` / \`compoundSkipped\` flips,
49
+ - per-agent \`fulfillmentMode\` transitions from the baseline delegation log,
50
+ - appearance (\`+\`) or disappearance (\`-\`) of \`${retroArtifactPath()}\`.
51
+ 5. Render a compact diff map (added \`+\`, removed \`-\`, changed \`->\`).
52
+ 6. Persist current state back to \`${snapshotPath()}\` as new baseline with
53
+ \`capturedAt\` and an embedded \`delegations\` projection
54
+ (\`{ agent, status, fulfillmentMode }[]\`) so fulfillmentMode transitions are
55
+ computable on the next run.
34
56
 
35
57
  ## Diff Map Format
36
58
 
@@ -41,8 +63,18 @@ cclaw flow diff
41
63
  stale: -design
42
64
  gates(spec): +spec_contract_complete -spec_open_questions_closed
43
65
  blocked(spec): +spec_trace_matrix_missing
66
+ closeout: idle -> retro_review
67
+ retro: +drafted (09-retro.md appeared)
68
+ delegations:
69
+ - reviewer: scheduled -> completed (mode=generic-dispatch)
70
+ - test-author: mode=? -> role-switch (evidenceRefs=2)
44
71
  \`\`\`
45
72
 
73
+ - The \`closeout:\` line is omitted when \`shipSubstate\` is unchanged.
74
+ - The \`delegations:\` block is omitted when no agent changed status or mode.
75
+ - The \`retro:\` line is emitted only on artifact appearance/removal or on a
76
+ \`retroAcceptedAt\` / \`retroSkipped\` flip.
77
+
46
78
  ## Primary skill
47
79
 
48
80
  **${RUNTIME_ROOT}/skills/${DIFF_SKILL_FOLDER}/SKILL.md**
@@ -51,7 +83,7 @@ cclaw flow diff
51
83
  export function diffCommandSkillMarkdown() {
52
84
  return `---
53
85
  name: ${DIFF_SKILL_NAME}
54
- description: "Compare current flow-state against saved snapshot and render gate/stage deltas."
86
+ description: "Compare current flow-state against saved snapshot and render gate/stage/closeout/delegation deltas."
55
87
  ---
56
88
 
57
89
  # /cc-view diff
@@ -63,21 +95,35 @@ Never lose baseline visibility: render deltas before writing a new snapshot.
63
95
  ## Protocol
64
96
 
65
97
  1. Read \`${flowStatePath()}\`.
66
- 2. Read \`${snapshotPath()}\`.
67
- 3. If snapshot missing:
68
- - write baseline snapshot from current state,
98
+ 2. Read \`${delegationLogPath()}\` (missing → treat as empty list).
99
+ 3. Read \`${snapshotPath()}\`.
100
+ 4. If snapshot missing:
101
+ - write baseline snapshot from current state **plus** a
102
+ \`delegations\` projection (\`{ agent, status, fulfillmentMode }[]\`),
69
103
  - print \`flow diff baseline created\`,
70
104
  - stop.
71
- 4. Build deltas for stage, completed/skipped/stale sets, and current-stage gate arrays.
72
- 5. Print a compact diff map with explicit \`+\`, \`-\`, and \`->\` markers.
73
- 6. Write updated snapshot with:
74
- - \`capturedAt\` (ISO)
75
- - \`state\` (full current flow-state object)
105
+ 5. Build deltas for:
106
+ - stage, completed/skipped/stale sets,
107
+ - current-stage gate arrays (\`passed\`, \`blocked\`),
108
+ - \`closeout.shipSubstate\` transitions (\`from -> to\`),
109
+ - \`closeout.retroDraftedAt\` / \`retroAcceptedAt\` / \`retroSkipped\` flips,
110
+ - \`closeout.compoundPromoted\` / \`compoundSkipped\` / \`compoundCompletedAt\` flips,
111
+ - per-agent \`fulfillmentMode\` transitions by matching baseline delegations
112
+ against current delegations on \`agent\` + latest entry,
113
+ - appearance or removal of \`${retroArtifactPath()}\` on disk.
114
+ 6. Print a compact diff map with explicit \`+\`, \`-\`, and \`->\` markers.
115
+ 7. Write updated snapshot with:
116
+ - \`capturedAt\` (ISO),
117
+ - \`state\` (full current flow-state object),
118
+ - \`delegations\` projection from the current log.
76
119
 
77
120
  ## Validation
78
121
 
79
122
  - Diff output must be deterministic for identical states ("no changes").
80
123
  - Snapshot file stays valid JSON after every run.
81
124
  - Do not suppress removed values; removals are first-class evidence.
125
+ - Closeout diff lines must use the same \`shipSubstate\` vocabulary as the
126
+ state machine (\`idle\` / \`retro_review\` / \`compound_review\` /
127
+ \`ready_to_archive\` / \`archived\`).
82
128
  `;
83
129
  }
@@ -22,6 +22,12 @@ function stageActivityPath() {
22
22
  function snapshotPath() {
23
23
  return `${RUNTIME_ROOT}/state/flow-state.snapshot.json`;
24
24
  }
25
+ function harnessGapsPath() {
26
+ return `${RUNTIME_ROOT}/state/harness-gaps.json`;
27
+ }
28
+ function retroArtifactPath() {
29
+ return `${RUNTIME_ROOT}/artifacts/09-retro.md`;
30
+ }
25
31
  /**
26
32
  * Command contract for /cc-view status — a read-only snapshot command.
27
33
  * Does not mutate state. Always safe to run.
@@ -34,7 +40,8 @@ export function statusCommandContract() {
34
40
  ## Purpose
35
41
 
36
42
  **Read-only visual snapshot of the cclaw run.** Shows progress bar, current stage,
37
- gate coverage, delegation status, stale markers, and top knowledge highlights.
43
+ gate coverage, delegation status with fulfillmentMode, closeout substate after
44
+ ship, harness parity fallback, stale markers, and top knowledge highlights.
38
45
 
39
46
  This command **never mutates state**. Use it at session start to orient, or at any
40
47
  time to answer "where are we?" without advancing the flow.
@@ -49,9 +56,10 @@ time to answer "where are we?" without advancing the flow.
49
56
  ## Algorithm
50
57
 
51
58
  1. Read **\`${flowPath}\`** — capture \`track\`, \`currentStage\`, \`completedStages\`,
52
- \`skippedStages\`, and per-stage gate catalog.
53
- 2. Read **\`${delegationPath}\`** — count delegated / completed / waived / pending entries
54
- for the current stage's \`mandatoryDelegations\`.
59
+ \`skippedStages\`, \`staleStages\`, per-stage gate catalog, and **\`closeout\`**
60
+ (shipSubstate + retro/compound flags).
61
+ 2. Read **\`${delegationPath}\`** — for each mandatory agent of the current stage,
62
+ capture \`status\`, \`fulfillmentMode\`, and whether \`evidenceRefs\` are present.
55
63
  3. Read **\`${contextModePath()}\`** — surface \`activeMode\` (default if missing).
56
64
  4. Compute **time in current stage** from the most recent stage-entry signal:
57
65
  - Prefer \`${checkpointPath()}\`'s \`timestamp\` when its \`stage\` matches \`currentStage\`.
@@ -60,25 +68,37 @@ time to answer "where are we?" without advancing the flow.
60
68
  - If no signal exists, render \`(unknown)\`.
61
69
  5. Optionally read **\`${snapshotPath()}\`** to compute gate delta versus prior baseline:
62
70
  - If missing or invalid, render \`delta: (baseline unavailable; run /cc-view diff)\`.
63
- 6. Read the top of **\`${knowledgePath}\`** surface up to 3 most recent entries
71
+ 6. Read **\`${harnessGapsPath()}\`** (schemaVersion 2). For every installed harness
72
+ capture \`tier\`, \`subagentFallback\`, and \`playbookPath\` for the harness row.
73
+ 7. Read the top of **\`${knowledgePath()}\`** — surface up to 3 most recent entries
64
74
  (by trailing timestamp or source marker).
65
- 7. Emit the visual status block described below. Do **not** load any stage skill.
75
+ 8. Detect **closeout artifacts**: check whether \`${retroArtifactPath()}\` exists on
76
+ disk and annotate the closeout row accordingly.
77
+ 9. Emit the visual status block described below. Do **not** load any stage skill.
66
78
 
67
79
  ## Visual markers
68
80
 
69
81
  Default UTF markers: \`✓\` passed, \`▶\` current, \`○\` pending, \`⊘\` skipped, \`⏸\` stale, \`✗\` blocked.
70
82
  ASCII fallback (no UTF locale): \`[x]\`, \`[>]\`, \`[ ]\`, \`[-]\`, \`[=]\`, \`[!]\`.
71
83
 
84
+ Delegation markers: \`✓\` completed, \`◎\` completed-no-evidence (role-switch
85
+ harness; **blocks stage**), \`○\` scheduled/pending, \`⊘\` waived, \`✗\` failed.
86
+
72
87
  ## Status Block Format
73
88
 
74
89
  \`\`\`
75
90
  cclaw status
76
- flow: <track> · run=<runId> · feature=<feature-id>
77
- stage: <stage> (<N>/<total>) · time <Xd|XhYm|Xm|unknown> · mode <activeMode>
78
- bar: [✓ brainstorm] [✓ scope] [▶ design] [○ spec] [○ plan] [○ tdd] [○ review] [○ ship]
79
- gates: now <passed>/<required> · blocked <count> · delta <summary or baseline-unavailable>
80
- delegations: [✓ <role>] [○ <role>] ...
81
- stale: <list or none>
91
+ flow: <track> · run=<runId> · feature=<feature-id>
92
+ stage: <stage> (<N>/<total>) · time <Xd|XhYm|Xm|unknown> · mode <activeMode>
93
+ bar: [✓ brainstorm] [✓ scope] [▶ design] [○ spec] [○ plan] [○ tdd] [○ review] [○ ship]
94
+ gates: now <passed>/<required> · blocked <count> · delta <summary or baseline-unavailable>
95
+ delegations (<expectedMode>):
96
+ - planner ✓ completed mode=<isolated|generic-dispatch|role-switch>
97
+ - reviewer ○ pending
98
+ - test-author ◎ missing-evidence (role-switch; add evidenceRefs)
99
+ closeout: <shipSubstate> · retro=<drafted|accepted|skipped|—> · compound=<N promoted|skipped|—>
100
+ harness: <id>=<tier>/<fallback>, ... · playbooks: <M>/<N>
101
+ stale: <list or none>
82
102
  knowledge:
83
103
  - <latest entry summary>
84
104
  - <second entry summary>
@@ -86,12 +106,20 @@ cclaw status
86
106
  next: /cc-next · /cc-view tree · /cc-view diff
87
107
  \`\`\`
88
108
 
109
+ - Omit the \`closeout:\` row when \`currentStage !== "ship"\` and \`shipSubstate === "idle"\`.
110
+ - Omit \`delegations\` line when the current stage has zero mandatory delegations.
111
+ - Omit \`harness\` line only when \`${harnessGapsPath()}\` is missing or invalid
112
+ (render \`harness: (report unavailable; run cclaw upgrade)\`).
113
+
89
114
  ## Anti-patterns
90
115
 
91
116
  - Inventing gate status without reading \`${flowPath}\`.
92
117
  - Reporting delegations as satisfied when the log says \`pending\`.
118
+ - Treating a \`completed\` role-switch delegation without \`evidenceRefs\` as green
119
+ — it must surface as \`◎ missing-evidence\`.
93
120
  - Advancing the stage from \`/cc-view status\` — progression belongs to \`/cc-next\`.
94
- - Hiding stale stages; stale markers must be surfaced directly in the status line.
121
+ - Hiding the closeout substate after ship; retro/compound/archive progress must
122
+ be visible so \`/cc-next\` resumes at the right step.
95
123
 
96
124
  ## Primary skill
97
125
 
@@ -106,7 +134,7 @@ export function statusCommandSkillMarkdown() {
106
134
  const delegationPath = delegationLogPath();
107
135
  return `---
108
136
  name: ${STATUS_SKILL_NAME}
109
- description: "Read-only visual snapshot of the cclaw flow with progress bar, gate delta, delegations, and stale markers."
137
+ description: "Read-only visual snapshot of the cclaw flow with progress bar, gate delta, delegations (fulfillmentMode + evidence), closeout substate, and harness parity row."
110
138
  ---
111
139
 
112
140
  # /cc-view status — Flow Status Snapshot
@@ -114,7 +142,14 @@ description: "Read-only visual snapshot of the cclaw flow with progress bar, gat
114
142
  ## Overview
115
143
 
116
144
  \`/cc-view status\` is the quickest way to answer "where are we in the flow?" without
117
- advancing or mutating anything. Safe to run at any point.
145
+ advancing or mutating anything. Safe to run at any point. The snapshot reflects:
146
+
147
+ - progress across stages with per-stage markers,
148
+ - gate coverage and delta vs. baseline,
149
+ - mandatory delegations with **fulfillmentMode** (isolated / generic-dispatch /
150
+ role-switch / harness-waiver) and evidence gate,
151
+ - **closeout substate** after ship (retro → compound → archive),
152
+ - **harness parity row** (tier + fallback) for the active harness set.
118
153
 
119
154
  ## HARD-GATE
120
155
 
@@ -133,22 +168,45 @@ a read-only command. Do **not** update \`${snapshotPath()}\` here.
133
168
  5. Try reading \`${snapshotPath()}\` for gate delta:
134
169
  - If available, compare current stage \`passed\` / \`blocked\` sets against baseline.
135
170
  - If unavailable, render \`delta: (baseline unavailable; run /cc-view diff)\`.
136
- 6. Read \`${RUNTIME_ROOT}/knowledge.jsonl\`. If missing or empty → knowledge highlights are \`(none recorded)\`. Parse each line as JSON and surface its \`trigger\`/\`action\`.
137
- 7. For each gate in \`stageGateCatalog[currentStage].required\`:
171
+ 6. Read \`${harnessGapsPath()}\`:
172
+ - If \`schemaVersion === 2\`, for each entry render \`<harness>=<tier>/<subagentFallback>\`.
173
+ - Count existing \`playbookPath\` files on disk to print \`playbooks: <M>/<N>\`.
174
+ - If the file is missing or has an older schema, render
175
+ \`harness: (report unavailable; run cclaw upgrade)\`.
176
+ 7. Read \`${RUNTIME_ROOT}/knowledge.jsonl\`. If missing or empty → knowledge highlights are \`(none recorded)\`. Parse each line as JSON and surface its \`trigger\`/\`action\`.
177
+ 8. For each gate in \`stageGateCatalog[currentStage].required\`:
138
178
  - Satisfied if present in \`passed\` and absent from \`blocked\`.
139
- 8. Build and print the visual status block:
140
- - stage header
141
- - one-line progress bar with per-stage markers
142
- - gate summary + delta
143
- - delegation row
144
- - stale stage row
145
- 9. Suggest the next action:
146
- - If current stage has unmet gates → \`/cc-next\` to resume.
147
- - If current stage is complete → \`/cc-next\` to advance (or report "Flow complete" if terminal).
179
+ 9. For each mandatory delegation of the current stage, evaluate:
180
+ - \`✓ completed\` when \`status === "completed"\` and (harness is not role-switch
181
+ **or** \`evidenceRefs.length >= 1\`).
182
+ - \`◎ missing-evidence\` when \`status === "completed"\`, harness declares
183
+ \`role-switch\`, and \`evidenceRefs\` is empty or absent.
184
+ - \`○ <status>\` for \`scheduled\` / pending.
185
+ - \`⊘ waived\` when \`status === "waived"\`.
186
+ - \`✗ failed\` when \`status === "failed"\`.
187
+ 10. Compute **closeout row** when \`currentStage === "ship"\` or
188
+ \`closeout.shipSubstate !== "idle"\`:
189
+ - \`shipSubstate\` verbatim,
190
+ - \`retro=drafted|accepted|skipped|—\` derived from \`closeout.retroDraftedAt\`,
191
+ \`closeout.retroAcceptedAt\`, \`closeout.retroSkipped\`,
192
+ - \`compound=<N promoted>|skipped|—\` from
193
+ \`closeout.compoundPromoted\` / \`closeout.compoundSkipped\`.
194
+ 11. Build and print the visual status block:
195
+ - stage header
196
+ - one-line progress bar with per-stage markers
197
+ - gate summary + delta
198
+ - delegation rows (per mandatory agent)
199
+ - closeout row (when active)
200
+ - harness row
201
+ - stale stage row
202
+ 12. Suggest the next action:
203
+ - If current stage has unmet gates → \`/cc-next\` to resume.
204
+ - If closeout substate is non-idle → \`/cc-next\` to continue the chain.
205
+ - If current stage is complete → \`/cc-next\` to advance (or report "Flow complete" if terminal).
148
206
 
149
207
  ## Output Guidelines
150
208
 
151
- - Keep output compact (≤ 30 lines) — status, not narrative.
209
+ - Keep output compact (≤ 40 lines) — status, not narrative.
152
210
  - Report counts, not full artifact contents.
153
211
  - If any data source is missing or corrupt, say so explicitly rather than guessing.
154
212
  - Include \`/cc-view tree\` for deep structure and \`/cc-view diff\` for before/after map in the final line.
@@ -157,6 +215,10 @@ a read-only command. Do **not** update \`${snapshotPath()}\` here.
157
215
 
158
216
  - Rebuilding trace-matrix or running doctor from \`/cc-view status\` — those belong to dedicated tools.
159
217
  - Treating absence of delegation log as "all delegations complete".
218
+ - Collapsing \`◎ missing-evidence\` into \`✓ completed\` — role-switch gaps must stay
219
+ visible so the stage cannot advance silently.
220
+ - Omitting the closeout row when \`shipSubstate !== "idle"\`; it is the only signal
221
+ that tells the user why \`/cc-next\` is about to run retro/compound/archive.
160
222
  - Mutating state to "clean up" during a status check.
161
223
  `;
162
224
  }
@@ -13,13 +13,17 @@ function artifactsPath() {
13
13
  function rewindLogPath() {
14
14
  return `${RUNTIME_ROOT}/state/rewind-log.jsonl`;
15
15
  }
16
+ function harnessPlaybooksDir() {
17
+ return `${RUNTIME_ROOT}/references/harnesses`;
18
+ }
16
19
  export function treeCommandContract() {
17
20
  return `# /cc-view tree
18
21
 
19
22
  ## Purpose
20
23
 
21
- Render a visual flow tree for quick orientation across stages, gates, delegations,
22
- stale markers, and artifact presence.
24
+ Render a visual flow tree for quick orientation across stages, gates, delegations
25
+ (with fulfillmentMode), ship closeout substate, stale markers, artifact presence,
26
+ and per-harness playbook availability.
23
27
 
24
28
  ## HARD-GATE
25
29
 
@@ -30,13 +34,21 @@ stale markers, and artifact presence.
30
34
 
31
35
  1. Read \`${flowStatePath()}\`.
32
36
  2. Read \`${delegationLogPath()}\` (if missing, treat current-stage delegations as pending).
33
- 3. Detect artifact files in \`${artifactsPath()}\`.
37
+ 3. Detect artifact files in \`${artifactsPath()}\` (\`01-brainstorm.md\` …
38
+ \`08-ship.md\` plus \`09-retro.md\`).
34
39
  4. Read rewind records from \`${rewindLogPath()}\` when present for stale-stage context.
35
- 5. Render the tree using stage order from active track:
40
+ 5. Inspect \`${harnessPlaybooksDir()}\` to confirm per-harness playbooks exist
41
+ for the installed harness set.
42
+ 6. Render the tree using stage order from active track:
36
43
  - stage node marker: passed/current/pending/skipped/stale
37
44
  - gate summary: \`passed/required\`
38
- - delegation summary for current stage
45
+ - delegation summary for current stage (each agent carries its
46
+ \`fulfillmentMode\` label)
39
47
  - artifact marker per stage (exists / stale copy / missing)
48
+ 7. When \`currentStage === "ship"\` or \`closeout.shipSubstate !== "idle"\`,
49
+ append a closeout sub-tree under ship with substate and retro/compound flags.
50
+ 8. Append a final \`harnesses\` branch summarising tier + fallback +
51
+ playbook-present for each installed harness.
40
52
 
41
53
  ## Tree Format
42
54
 
@@ -45,12 +57,31 @@ cclaw flow tree (track=<track>, run=<runId>)
45
57
  ├─ [✓] brainstorm gates 6/6 artifact 01-brainstorm.md
46
58
  ├─ [✓] scope gates 5/5 artifact 02-scope.md
47
59
  ├─ [▶] design gates 2/7 artifact 03-design.md
48
- │ ├─ delegations: [✓] planner [○] reviewer
60
+ │ ├─ delegations:
61
+ │ │ ├─ planner ✓ completed mode=isolated
62
+ │ │ └─ reviewer ○ pending
49
63
  │ └─ stale: none
50
64
  ├─ [○] spec gates - artifact missing
51
65
  └─ [○] plan gates - artifact missing
66
+
67
+ closeout (shipSubstate=retro_review):
68
+ ├─ retro: drafted 09-retro.md · awaiting accept/edit/skip
69
+ ├─ compound: —
70
+ └─ archive: pending
71
+
72
+ harnesses:
73
+ ├─ claude tier=tier1 fallback=native playbook ✓
74
+ ├─ cursor tier=tier2 fallback=generic-dispatch playbook ✓
75
+ ├─ opencode tier=tier2 fallback=role-switch playbook ✓
76
+ └─ codex tier=tier2 fallback=role-switch playbook ✓
52
77
  \`\`\`
53
78
 
79
+ - Closeout sub-tree is **omitted** when \`currentStage !== "ship"\` and
80
+ \`shipSubstate === "idle"\`.
81
+ - Delegations sub-branch is omitted when the stage has no mandatory agents.
82
+ - Playbook marker is \`✗ missing\` when the file under
83
+ \`${harnessPlaybooksDir()}/<harness>-playbook.md\` is absent.
84
+
54
85
  Use UTF markers by default, ASCII fallback when terminal cannot render UTF.
55
86
 
56
87
  ## Primary skill
@@ -61,7 +92,7 @@ Use UTF markers by default, ASCII fallback when terminal cannot render UTF.
61
92
  export function treeCommandSkillMarkdown() {
62
93
  return `---
63
94
  name: ${TREE_SKILL_NAME}
64
- description: "Render a visual flow tree for stages, gates, delegations, and artifacts."
95
+ description: "Render a visual flow tree for stages, gates, delegations (fulfillmentMode), ship closeout substate, artifacts, and per-harness playbooks."
65
96
  ---
66
97
 
67
98
  # /cc-view tree
@@ -72,20 +103,39 @@ Do not modify state in this command. It is a pure read/render operation.
72
103
 
73
104
  ## Protocol
74
105
 
75
- 1. Read \`${flowStatePath()}\` as source of truth.
76
- 2. Read \`${delegationLogPath()}\` for current-stage delegation status.
77
- 3. Inspect \`${artifactsPath()}\` for per-stage artifact presence and stale copies.
78
- 4. Render one compact tree:
79
- - stage marker: passed/current/pending/skipped/stale
80
- - gates summary
81
- - artifact summary
82
- - delegation branch for current stage
83
- 5. If rewind records exist in \`${rewindLogPath()}\`, include latest rewind note in footer.
106
+ 1. Read \`${flowStatePath()}\` as source of truth (including \`closeout\`).
107
+ 2. Read \`${delegationLogPath()}\` for current-stage delegation status plus
108
+ \`fulfillmentMode\` / \`evidenceRefs\`.
109
+ 3. Inspect \`${artifactsPath()}\` for per-stage artifact presence and stale copies,
110
+ and for the retro artifact \`09-retro.md\`.
111
+ 4. Inspect \`${harnessPlaybooksDir()}\` for \`<harness>-playbook.md\` files.
112
+ 5. Render one compact tree:
113
+ - stage marker: passed/current/pending/skipped/stale,
114
+ - gates summary,
115
+ - artifact summary,
116
+ - delegation branch for current stage with fulfillmentMode labels,
117
+ 6. When \`closeout.shipSubstate !== "idle"\` or \`currentStage === "ship"\`, add
118
+ a closeout sub-tree:
119
+ - \`retro:\` line derived from \`closeout.retroDraftedAt\` /
120
+ \`closeout.retroAcceptedAt\` / \`closeout.retroSkipped\` and artifact presence,
121
+ - \`compound:\` line derived from \`closeout.compoundPromoted\` /
122
+ \`closeout.compoundSkipped\` / \`closeout.compoundCompletedAt\`,
123
+ - \`archive:\` line — \`pending\` until \`shipSubstate === "ready_to_archive"\`,
124
+ then \`next\`; the transient \`archived\` substate surfaces only if the
125
+ archive step failed mid-run.
126
+ 7. Append a \`harnesses:\` branch. For each installed harness derive the tier
127
+ from the harness-gaps report and mark \`playbook ✓/✗ missing\` based on
128
+ \`${harnessPlaybooksDir()}/<harness>-playbook.md\` existence.
129
+ 8. If rewind records exist in \`${rewindLogPath()}\`, include latest rewind note in footer.
84
130
 
85
131
  ## Validation
86
132
 
87
133
  - Output must mention the active \`track\` and \`currentStage\`.
88
134
  - Exactly one stage is marked current.
89
135
  - Missing files are reported explicitly; never guessed as complete.
136
+ - Delegation rows always carry a fulfillmentMode label (or \`mode=?\` when the
137
+ ledger entry is legacy and the mode is inferred).
138
+ - Closeout sub-tree is present iff ship is reached; it cannot be omitted while
139
+ \`shipSubstate !== "idle"\`.
90
140
  `;
91
141
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cclaw-cli",
3
- "version": "0.33.0",
3
+ "version": "0.34.0",
4
4
  "description": "Installer-first flow toolkit for coding agents",
5
5
  "type": "module",
6
6
  "bin": {