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
package/README.md
CHANGED
|
@@ -25,8 +25,7 @@ operational knobs to memorise.
|
|
|
25
25
|
changes across multiple harnesses and languages.
|
|
26
26
|
- Staff engineers and tech leads who want **enforceable discipline**:
|
|
27
27
|
locked-in decisions, no placeholders, mandatory TDD, traceable plans.
|
|
28
|
-
- Maintainers
|
|
29
|
-
via the built-in eval harness.
|
|
28
|
+
- Maintainers who want a compact, file-backed flow their harness agents can actually follow.
|
|
30
29
|
|
|
31
30
|
---
|
|
32
31
|
|
|
@@ -76,7 +75,7 @@ You ──► /cc <idea>
|
|
|
76
75
|
cclaw reads state + knowledge, guides execution
|
|
77
76
|
│
|
|
78
77
|
▼
|
|
79
|
-
artifacts written,
|
|
78
|
+
artifacts written, handoff captured
|
|
80
79
|
│
|
|
81
80
|
▼
|
|
82
81
|
next stage is explicit in flow-state.json
|
|
@@ -86,7 +85,14 @@ You ──► /cc <idea>
|
|
|
86
85
|
|
|
87
86
|
## 30-second install
|
|
88
87
|
|
|
88
|
+
Requirements:
|
|
89
|
+
|
|
90
|
+
- Node.js **20+** (matches the package `engines` field).
|
|
91
|
+
- Run from the **git project root** you want cclaw to manage, not from `~`
|
|
92
|
+
or a nested package directory.
|
|
93
|
+
|
|
89
94
|
```bash
|
|
95
|
+
cd /path/to/your/repo
|
|
90
96
|
npx cclaw-cli
|
|
91
97
|
```
|
|
92
98
|
|
|
@@ -102,26 +108,23 @@ Everything day-to-day happens inside your harness (Claude Code, Cursor,
|
|
|
102
108
|
OpenCode, or Codex); optional maintenance commands are listed in the
|
|
103
109
|
CLI reference.
|
|
104
110
|
|
|
111
|
+
If cclaw says it is not installed, either run `npx cclaw-cli init` in the
|
|
112
|
+
repo root or `cd` to the project that already contains `.cclaw/`.
|
|
113
|
+
|
|
105
114
|
### What gets generated
|
|
106
115
|
|
|
107
116
|
```text
|
|
108
117
|
.cclaw/
|
|
109
|
-
├── commands/ #
|
|
110
|
-
├── skills/ #
|
|
111
|
-
├── contexts/ # cross-cutting context modes (research, debugging, …)
|
|
118
|
+
├── commands/ # four entrypoints: /cc, /cc-next, /cc-ideate, /cc-view
|
|
119
|
+
├── skills/ # flow-critical skills loaded by the harness
|
|
112
120
|
├── templates/ # artifact skeletons for each stage
|
|
113
|
-
├── rules/ #
|
|
114
|
-
├──
|
|
115
|
-
├──
|
|
116
|
-
├──
|
|
117
|
-
├──
|
|
118
|
-
├──
|
|
119
|
-
|
|
120
|
-
├── references/ # (optional) pinned copies of reference frameworks
|
|
121
|
-
├── evals/ # eval corpus, rubrics, baselines, reports
|
|
122
|
-
├── custom-skills/ # user-authored skills (never overwritten)
|
|
123
|
-
├── state/ # flow-state.json + delegation-log.json + activity
|
|
124
|
-
└── knowledge.jsonl # append-only, strict-schema lessons + patterns
|
|
121
|
+
├── rules/ # opt-in language rule packs
|
|
122
|
+
├── agents/ # subagent definitions
|
|
123
|
+
├── hooks/ # harness-agnostic hook runtime
|
|
124
|
+
├── artifacts/ # active run artifacts (00-idea.md -> 09-retro.md)
|
|
125
|
+
├── runs/ # archived run snapshots: YYYY-MM-DD-slug/
|
|
126
|
+
├── state/ # flow-state.json + stage activity log
|
|
127
|
+
└── knowledge.jsonl # append-only lessons + patterns
|
|
125
128
|
```
|
|
126
129
|
|
|
127
130
|
Plus harness-specific shims:
|
|
@@ -133,9 +136,10 @@ Plus harness-specific shims:
|
|
|
133
136
|
activated via `/use cc` or description-based auto-matching. Hooks
|
|
134
137
|
require Codex CLI ≥ v0.114 and `[features] codex_hooks = true` in
|
|
135
138
|
`~/.codex/config.toml`; `cclaw init --codex` offers to patch that flag
|
|
136
|
-
for you.
|
|
137
|
-
folders are auto-cleaned on sync.)
|
|
139
|
+
for you. `cclaw doctor` reports stale legacy Codex layouts.)
|
|
138
140
|
- `AGENTS.md` with a managed routing block (includes a Codex-specific note)
|
|
141
|
+
— see [`docs/agents-block.example.md`](./docs/agents-block.example.md)
|
|
142
|
+
for a static example of what the harness reads.
|
|
139
143
|
|
|
140
144
|
### `.cclaw/config.yaml` — the minimal surface
|
|
141
145
|
|
|
@@ -172,21 +176,22 @@ Full key-by-key reference: [`docs/config.md`](./docs/config.md).
|
|
|
172
176
|
## The four commands you actually use
|
|
173
177
|
|
|
174
178
|
All four appear as slash commands in every supported harness. This is the
|
|
175
|
-
top-level user surface
|
|
176
|
-
|
|
179
|
+
top-level user surface: `/cc`, `/cc-next`, `/cc-ideate`, and `/cc-view status`
|
|
180
|
+
cover the happy path. Operator/support tools stay separate so the harness
|
|
181
|
+
does not feel like a command framework.
|
|
177
182
|
|
|
178
183
|
| Command | What it does |
|
|
179
184
|
|---|---|
|
|
180
185
|
| **`/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. |
|
|
181
186
|
| **`/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**. |
|
|
182
187
|
| **`/cc-ideate`** | Repository improvement ideate mode. Scans for TODOs, flaky tests, oversized modules, docs drift, and recurring knowledge-store lessons, **persists the ranked backlog** to `.cclaw/artifacts/ideate-<date>-<slug>.md`, and ends with a concrete handoff: launch `/cc` on the selected candidate in the same session, save-and-close, or discard. Resume check on next run reuses any ideate artifact younger than 30 days. Never mutates `flow-state.json`. |
|
|
183
|
-
| **`/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
|
|
188
|
+
| **`/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 harness capability status from `cclaw doctor --explain`. `/cc-view diff` shows stage/gate/closeout/delegation changes from visible state and git evidence. Never mutates state. |
|
|
184
189
|
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
+
Operational extras stay off the main surface: `/cc-next` handles progression
|
|
191
|
+
and closeout, `cclaw archive` handles explicit archival/reset, and
|
|
192
|
+
`cclaw doctor` verifies install/runtime wiring. Doctor is not a replacement
|
|
193
|
+
for a real harness smoke test; it catches broken files, stale hooks, and
|
|
194
|
+
schema drift before the user loses a run.
|
|
190
195
|
|
|
191
196
|
### Example first-run
|
|
192
197
|
|
|
@@ -260,7 +265,7 @@ Each critical-path stage produces a dated artifact under
|
|
|
260
265
|
`02a-research.md` (design research fleet synthesis), `03-design.md` through
|
|
261
266
|
`08-ship.md`. Closeout adds `09-retro.md`; archive then rolls the whole
|
|
262
267
|
bundle into `.cclaw/runs/<YYYY-MM-DD-slug>/` and resets the active flow for
|
|
263
|
-
the next
|
|
268
|
+
the next run.
|
|
264
269
|
|
|
265
270
|
### Track heuristics are configurable (advisory)
|
|
266
271
|
|
|
@@ -312,9 +317,7 @@ it into ceremony:
|
|
|
312
317
|
- **Mandatory subagent delegation** at TDD, with per-harness waivers.
|
|
313
318
|
- **Turn Announce Discipline.** Every stage entry/exit emits a visible
|
|
314
319
|
line so users can see what the agent is doing, not just what it says.
|
|
315
|
-
- **
|
|
316
|
-
in a single place (`.cclaw/contexts/`), so every skill speaks the same
|
|
317
|
-
dialect.
|
|
320
|
+
- **Inline protocols.** Decision, Completion, and Ethos discipline is embedded in the active stage skill so users do not need to chase generated reference files.
|
|
318
321
|
- **Knowledge capture throughout the flow.** Every stage completion
|
|
319
322
|
protocol emits typed entries (`rule` / `pattern` / `lesson`) to
|
|
320
323
|
`.cclaw/knowledge.jsonl` as the flow progresses — not only at retro.
|
|
@@ -334,7 +337,7 @@ it into ceremony:
|
|
|
334
337
|
|
|
335
338
|
The `tdd` stage is not prose guidance. It requires:
|
|
336
339
|
|
|
337
|
-
- an explicit **RED** test run (
|
|
340
|
+
- an explicit **RED** test run (captured in `.cclaw/artifacts/06-tdd.md`)
|
|
338
341
|
- a mandatory **`test-author`** subagent dispatch (logged to
|
|
339
342
|
`.cclaw/state/delegation-log.json`)
|
|
340
343
|
- a **GREEN** full-suite run before exit
|
|
@@ -349,7 +352,7 @@ subagent as `completed` (or, on Codex / OpenCode, role-switched with
|
|
|
349
352
|
## Ship and closeout — automatic, resumable
|
|
350
353
|
|
|
351
354
|
Shipping writes `08-ship.md`. `/cc-next` then automatically walks the
|
|
352
|
-
|
|
355
|
+
run through a deterministic three-step closeout without extra
|
|
353
356
|
commands from you:
|
|
354
357
|
|
|
355
358
|
1. **Retro (`09-retro.md`).** cclaw drafts a retrospective from your
|
|
@@ -375,9 +378,7 @@ If your session dies mid-closeout, a new `/cc-next` resumes at the
|
|
|
375
378
|
exact step — retro drafts are not regenerated and no structured ask is
|
|
376
379
|
repeated silently.
|
|
377
380
|
|
|
378
|
-
|
|
379
|
-
compound`, `/cc-ops archive`), but for the default path you do not need
|
|
380
|
-
to: `/cc-next` is the only command.
|
|
381
|
+
For the default path, `/cc-next` is the only command; explicit archival/reset remains available through `cclaw archive`.
|
|
381
382
|
|
|
382
383
|
---
|
|
383
384
|
|
|
@@ -386,12 +387,12 @@ to: `/cc-next` is the only command.
|
|
|
386
387
|
cclaw is honest about what each harness can and cannot do, and it
|
|
387
388
|
closes every real gap with a documented fallback — not a silent waiver.
|
|
388
389
|
|
|
389
|
-
| Harness | Dispatch | Fallback | Hook surface | Structured ask |
|
|
390
|
-
|
|
391
|
-
| Claude Code | full (named subagents) | `native` | full | `AskUserQuestion` |
|
|
392
|
-
| Cursor | generic Task dispatcher | `generic-dispatch` | full | `AskQuestion` |
|
|
393
|
-
| OpenCode | plugin / in-session | `role-switch` | plugin | `question` (permission-gated; `permission.question: "allow"`) |
|
|
394
|
-
| OpenAI Codex | in-session only | `role-switch` (evidenceRefs required) | limited (Bash-only `PreToolUse`/`PostToolUse`; requires `codex_hooks` feature flag) | `request_user_input` (experimental; Plan / Collaboration mode) |
|
|
390
|
+
| Harness | Dispatch | Fallback | Hook surface | Structured ask |
|
|
391
|
+
|---|---|---|---|---|
|
|
392
|
+
| Claude Code | full (named subagents) | `native` | full | `AskUserQuestion` |
|
|
393
|
+
| Cursor | generic Task dispatcher | `generic-dispatch` | full | `AskQuestion` |
|
|
394
|
+
| OpenCode | plugin / in-session | `role-switch` | plugin | `question` (permission-gated; `permission.question: "allow"`) |
|
|
395
|
+
| OpenAI Codex | in-session only | `role-switch` (evidenceRefs required) | limited (Bash-only `PreToolUse`/`PostToolUse`; requires `codex_hooks` feature flag) | `request_user_input` (experimental; Plan / Collaboration mode) |
|
|
395
396
|
|
|
396
397
|
What the fallbacks mean:
|
|
397
398
|
|
|
@@ -401,8 +402,7 @@ What the fallbacks mean:
|
|
|
401
402
|
vocabulary of `subagent_type`s (`explore`, `generalPurpose`, …).
|
|
402
403
|
cclaw maps each named agent (planner / reviewer / test-author /
|
|
403
404
|
security-reviewer / doc-updater) onto the generic dispatcher with a
|
|
404
|
-
structured role prompt.
|
|
405
|
-
playbook.
|
|
405
|
+
structured role prompt.
|
|
406
406
|
- `role-switch` — OpenCode and Codex lack an isolated worker primitive.
|
|
407
407
|
The agent announces the role in-session, performs the work, and
|
|
408
408
|
records a delegation row with `fulfillmentMode: "role-switch"` and at
|
|
@@ -418,10 +418,10 @@ What the fallbacks mean:
|
|
|
418
418
|
> (Jan 2026), but Codex ≥ v0.114 (Mar 2026) grew an experimental
|
|
419
419
|
> lifecycle hooks API. cclaw installs Codex entry points as native
|
|
420
420
|
> **skills** under `.agents/skills/cc*/SKILL.md` (invoke with `/use cc`,
|
|
421
|
-
> `/use cc-next`, `/use cc-view`, `/use cc-
|
|
421
|
+
> `/use cc-next`, `/use cc-view`, `/use cc-ideate`, or
|
|
422
422
|
> by typing `/cc …` in plain text — Codex auto-matches from the skill
|
|
423
423
|
> description) **and** writes `.codex/hooks.json` so session-start
|
|
424
|
-
> rehydration, stop-
|
|
424
|
+
> rehydration, stop-handoff, prompt-guard, workflow-guard, and
|
|
425
425
|
> context-monitor fire automatically — as long as you enable the
|
|
426
426
|
> `codex_hooks` feature flag in `~/.codex/config.toml`. `cclaw init
|
|
427
427
|
> --codex` asks for consent before patching that file. Codex's
|
|
@@ -431,40 +431,13 @@ What the fallbacks mean:
|
|
|
431
431
|
> and any legacy layout to clean up.
|
|
432
432
|
|
|
433
433
|
The full capability matrix lives in
|
|
434
|
-
[`docs/harnesses.md`](./docs/harnesses.md).
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
Runtime state:
|
|
439
|
-
|
|
440
|
-
- `.cclaw/state/harness-gaps.json` (schema v2) — per-harness list of
|
|
441
|
-
missing capabilities, missing hook events, the declared fallback, the
|
|
442
|
-
playbook path, and a `remediation[]` list you can act on.
|
|
443
|
-
- `cclaw doctor` — asserts every installed harness has its playbook on
|
|
444
|
-
disk and surfaces the expected fulfillment mode inside the
|
|
445
|
-
`delegation:mandatory:current_stage` check.
|
|
446
|
-
|
|
447
|
-
---
|
|
448
|
-
|
|
449
|
-
## Eval-driven prompt engineering
|
|
450
|
-
|
|
451
|
-
cclaw ships with `cclaw-cli eval` — a three-tier regression harness for
|
|
452
|
-
the skills and contracts the runtime generates. Use it when you change a
|
|
453
|
-
stage skill, tweak a prompt, or swap a model.
|
|
454
|
-
|
|
455
|
-
Works with any OpenAI-compatible endpoint — Zhipu AI GLM, OpenAI, Together,
|
|
456
|
-
self-hosted vLLM — via three environment variables:
|
|
457
|
-
|
|
458
|
-
```bash
|
|
459
|
-
CCLAW_EVAL_API_KEY=...
|
|
460
|
-
CCLAW_EVAL_BASE_URL=https://api.z.ai/api/coding/paas/v4 # default
|
|
461
|
-
CCLAW_EVAL_MODEL=glm-5.1 # default
|
|
462
|
-
```
|
|
434
|
+
[`docs/harnesses.md`](./docs/harnesses.md). Harness capability gaps are
|
|
435
|
+
reported by `cclaw doctor` instead of generating reference files into the
|
|
436
|
+
user project.
|
|
463
437
|
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
`.github/workflows/mutation.yml` (manual + weekly run).
|
|
438
|
+
Runtime state stays small: `flow-state.json` is the source of truth, while
|
|
439
|
+
stage activity is an append-only trace for what happened during the run.
|
|
440
|
+
Derived diagnostics are produced on demand by `cclaw doctor`.
|
|
468
441
|
|
|
469
442
|
---
|
|
470
443
|
|
|
@@ -478,9 +451,8 @@ npx cclaw-cli # launches interactive setup (or prints
|
|
|
478
451
|
# a one-line status hint if already installed)
|
|
479
452
|
npx cclaw-cli sync # re-materialize generated runtime from config.yaml
|
|
480
453
|
npx cclaw-cli upgrade # refresh generated files; preserves .cclaw/config.yaml
|
|
481
|
-
npx cclaw-cli archive # archive
|
|
454
|
+
npx cclaw-cli archive # explicit/manual archive; normal post-ship closeout uses /cc-next
|
|
482
455
|
npx cclaw-cli uninstall # remove .cclaw + generated harness shims
|
|
483
|
-
npx cclaw-cli eval … # maintainer surface (see docs/evals.md)
|
|
484
456
|
npx cclaw-cli --version
|
|
485
457
|
```
|
|
486
458
|
|
|
@@ -28,6 +28,8 @@ export interface LearningSeedEntry {
|
|
|
28
28
|
domain?: string | null;
|
|
29
29
|
stage?: FlowStage | null;
|
|
30
30
|
origin_stage?: FlowStage | null;
|
|
31
|
+
origin_run?: string | null;
|
|
32
|
+
/** @deprecated Use `origin_run`. Accepted only for legacy learning bullets. */
|
|
31
33
|
origin_feature?: string | null;
|
|
32
34
|
frequency?: number;
|
|
33
35
|
universality?: LearningUniversality;
|
|
@@ -37,6 +39,8 @@ export interface LearningSeedEntry {
|
|
|
37
39
|
last_seen_ts?: string;
|
|
38
40
|
project?: string | null;
|
|
39
41
|
source?: LearningSource | null;
|
|
42
|
+
supersedes?: string[];
|
|
43
|
+
superseded_by?: string;
|
|
40
44
|
}
|
|
41
45
|
export interface LearningsParseResult {
|
|
42
46
|
ok: boolean;
|
package/dist/artifact-linter.js
CHANGED
|
@@ -780,6 +780,7 @@ const LEARNING_ALLOWED_KEYS = new Set([
|
|
|
780
780
|
"domain",
|
|
781
781
|
"stage",
|
|
782
782
|
"origin_stage",
|
|
783
|
+
"origin_run",
|
|
783
784
|
"origin_feature",
|
|
784
785
|
"frequency",
|
|
785
786
|
"universality",
|
|
@@ -788,7 +789,9 @@ const LEARNING_ALLOWED_KEYS = new Set([
|
|
|
788
789
|
"first_seen_ts",
|
|
789
790
|
"last_seen_ts",
|
|
790
791
|
"project",
|
|
791
|
-
"source"
|
|
792
|
+
"source",
|
|
793
|
+
"supersedes",
|
|
794
|
+
"superseded_by"
|
|
792
795
|
]);
|
|
793
796
|
function isIsoUtcTimestamp(value) {
|
|
794
797
|
return /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}Z$/u.test(value);
|
|
@@ -862,6 +865,9 @@ function parseLearningSeedEntry(raw, index) {
|
|
|
862
865
|
error: `Learnings bullet #${index} field "origin_stage" must be one of ${FLOW_STAGES.join(", ")} or null.`
|
|
863
866
|
};
|
|
864
867
|
}
|
|
868
|
+
if (obj.origin_run !== undefined && !isNullableString(obj.origin_run)) {
|
|
869
|
+
return { ok: false, error: `Learnings bullet #${index} field "origin_run" must be string or null.` };
|
|
870
|
+
}
|
|
865
871
|
if (obj.origin_feature !== undefined && !isNullableString(obj.origin_feature)) {
|
|
866
872
|
return { ok: false, error: `Learnings bullet #${index} field "origin_feature" must be string or null.` };
|
|
867
873
|
}
|
|
@@ -906,6 +912,17 @@ function parseLearningSeedEntry(raw, index) {
|
|
|
906
912
|
};
|
|
907
913
|
}
|
|
908
914
|
}
|
|
915
|
+
if (obj.supersedes !== undefined) {
|
|
916
|
+
if (!Array.isArray(obj.supersedes) ||
|
|
917
|
+
obj.supersedes.length === 0 ||
|
|
918
|
+
obj.supersedes.some((value) => typeof value !== "string" || value.trim().length === 0)) {
|
|
919
|
+
return { ok: false, error: `Learnings bullet #${index} field "supersedes" must be a non-empty array of strings.` };
|
|
920
|
+
}
|
|
921
|
+
}
|
|
922
|
+
if (obj.superseded_by !== undefined &&
|
|
923
|
+
(typeof obj.superseded_by !== "string" || obj.superseded_by.trim().length === 0)) {
|
|
924
|
+
return { ok: false, error: `Learnings bullet #${index} field "superseded_by" must be a non-empty string.` };
|
|
925
|
+
}
|
|
909
926
|
return {
|
|
910
927
|
ok: true,
|
|
911
928
|
entry: {
|
|
@@ -1002,7 +1019,6 @@ const FRONTMATTER_REQUIRED_KEYS = [
|
|
|
1002
1019
|
"stage",
|
|
1003
1020
|
"schema_version",
|
|
1004
1021
|
"version",
|
|
1005
|
-
"feature",
|
|
1006
1022
|
"locked_decisions",
|
|
1007
1023
|
"inputs_hash"
|
|
1008
1024
|
];
|
|
@@ -1271,6 +1287,11 @@ export async function lintArtifact(projectRoot, stage, track = "standard") {
|
|
|
1271
1287
|
const value = parsedFrontmatter.values[key];
|
|
1272
1288
|
return typeof value !== "string" || value.trim().length === 0;
|
|
1273
1289
|
});
|
|
1290
|
+
if (parsedFrontmatter.hasFrontmatter &&
|
|
1291
|
+
typeof parsedFrontmatter.values.run !== "string" &&
|
|
1292
|
+
typeof parsedFrontmatter.values.feature !== "string") {
|
|
1293
|
+
frontmatterMissingKeys.push("run");
|
|
1294
|
+
}
|
|
1274
1295
|
const frontmatterStage = parsedFrontmatter.values.stage?.replace(/^['"]|['"]$/gu, "");
|
|
1275
1296
|
const frontmatterSchemaVersion = parsedFrontmatter.values.schema_version?.replace(/^['"]|['"]$/gu, "");
|
|
1276
1297
|
const frontmatterInputsHash = parsedFrontmatter.values.inputs_hash?.replace(/^['"]|['"]$/gu, "");
|
|
@@ -1283,7 +1304,7 @@ export async function lintArtifact(projectRoot, stage, track = "standard") {
|
|
|
1283
1304
|
findings.push({
|
|
1284
1305
|
section: "Frontmatter",
|
|
1285
1306
|
required: requireFrontmatter,
|
|
1286
|
-
rule: "Artifact must include frontmatter keys (stage, schema_version=1, version,
|
|
1307
|
+
rule: "Artifact must include frontmatter keys (stage, schema_version=1, version, run, locked_decisions, inputs_hash=sha256:pending|sha256:<64hex>). Legacy feature is accepted during migration.",
|
|
1287
1308
|
found: parsedFrontmatter.hasFrontmatter ? frontmatterValid : true,
|
|
1288
1309
|
details: !parsedFrontmatter.hasFrontmatter
|
|
1289
1310
|
? "Legacy artifact without YAML frontmatter (allowed for backward compatibility)."
|
package/dist/cli.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import type { FlowTrack, HarnessId } from "./types.js";
|
|
3
|
-
|
|
4
|
-
type CommandName = "init" | "sync" | "doctor" | "upgrade" | "uninstall" | "archive" | "eval" | "internal";
|
|
3
|
+
type CommandName = "init" | "sync" | "doctor" | "upgrade" | "uninstall" | "archive" | "internal";
|
|
5
4
|
interface ParsedArgs {
|
|
6
5
|
command?: CommandName;
|
|
7
6
|
harnesses?: HarnessId[];
|
|
@@ -16,23 +15,6 @@ interface ParsedArgs {
|
|
|
16
15
|
archiveName?: string;
|
|
17
16
|
archiveSkipRetro?: boolean;
|
|
18
17
|
archiveSkipRetroReason?: string;
|
|
19
|
-
evalStage?: string;
|
|
20
|
-
evalMode?: EvalMode;
|
|
21
|
-
evalSchemaOnly?: boolean;
|
|
22
|
-
evalRules?: boolean;
|
|
23
|
-
evalJudge?: boolean;
|
|
24
|
-
evalJson?: boolean;
|
|
25
|
-
evalNoWrite?: boolean;
|
|
26
|
-
evalUpdateBaseline?: boolean;
|
|
27
|
-
evalConfirm?: boolean;
|
|
28
|
-
evalQuiet?: boolean;
|
|
29
|
-
evalMaxCostUsd?: number;
|
|
30
|
-
/** Optional subcommand after `eval`. */
|
|
31
|
-
evalSubcommand?: "diff" | "runs";
|
|
32
|
-
/** Positional arguments for eval subcommands (e.g. `diff <old> <new>`). */
|
|
33
|
-
evalArgs?: string[];
|
|
34
|
-
evalBackground?: boolean;
|
|
35
|
-
evalCompareModel?: string;
|
|
36
18
|
/** Hidden plumbing command (`cclaw internal ...`) arguments. */
|
|
37
19
|
internalArgs?: string[];
|
|
38
20
|
showHelp?: boolean;
|