cclaw-cli 0.12.0 → 0.14.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/dist/cli.d.ts +2 -0
- package/dist/cli.js +25 -1
- package/dist/config.js +19 -8
- package/dist/constants.d.ts +2 -2
- package/dist/constants.js +16 -1
- package/dist/content/archive-command.d.ts +2 -0
- package/dist/content/archive-command.js +98 -0
- package/dist/content/contracts.js +1 -1
- package/dist/content/diff-command.d.ts +2 -0
- package/dist/content/diff-command.js +83 -0
- package/dist/content/feature-command.d.ts +2 -0
- package/dist/content/feature-command.js +120 -0
- package/dist/content/harnesses-doc.js +11 -0
- package/dist/content/hooks.js +48 -2
- package/dist/content/learnings.d.ts +0 -2
- package/dist/content/learnings.js +4 -33
- package/dist/content/meta-skill.js +4 -2
- package/dist/content/next-command.js +18 -9
- package/dist/content/observe.d.ts +5 -1
- package/dist/content/observe.js +134 -2
- package/dist/content/ops-command.d.ts +2 -0
- package/dist/content/ops-command.js +60 -0
- package/dist/content/protocols.js +14 -2
- package/dist/content/retro-command.d.ts +2 -0
- package/dist/content/retro-command.js +77 -0
- package/dist/content/rewind-command.d.ts +3 -0
- package/dist/content/rewind-command.js +120 -0
- package/dist/content/skills.js +2 -0
- package/dist/content/stage-common-guidance.js +2 -1
- package/dist/content/status-command.js +43 -35
- package/dist/content/tdd-log-command.d.ts +2 -0
- package/dist/content/tdd-log-command.js +75 -0
- package/dist/content/templates.d.ts +1 -1
- package/dist/content/templates.js +36 -6
- package/dist/content/tree-command.d.ts +2 -0
- package/dist/content/tree-command.js +91 -0
- package/dist/content/utility-skills.js +1 -1
- package/dist/content/view-command.d.ts +2 -0
- package/dist/content/view-command.js +57 -0
- package/dist/doctor-registry.js +3 -3
- package/dist/doctor.js +149 -3
- package/dist/feature-system.d.ts +18 -0
- package/dist/feature-system.js +247 -0
- package/dist/flow-state.d.ts +25 -0
- package/dist/flow-state.js +8 -1
- package/dist/harness-adapters.js +95 -4
- package/dist/install.js +44 -2
- package/dist/policy.js +22 -0
- package/dist/runs.d.ts +33 -1
- package/dist/runs.js +365 -6
- package/dist/tdd-cycle.d.ts +22 -0
- package/dist/tdd-cycle.js +82 -0
- package/dist/types.d.ts +4 -2
- package/package.json +1 -1
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export type TddCyclePhase = "red" | "green" | "refactor";
|
|
2
|
+
export interface TddCycleEntry {
|
|
3
|
+
ts: string;
|
|
4
|
+
runId: string;
|
|
5
|
+
stage: string;
|
|
6
|
+
slice: string;
|
|
7
|
+
phase: TddCyclePhase;
|
|
8
|
+
command: string;
|
|
9
|
+
files?: string[];
|
|
10
|
+
exitCode?: number;
|
|
11
|
+
note?: string;
|
|
12
|
+
}
|
|
13
|
+
export interface TddCycleValidation {
|
|
14
|
+
ok: boolean;
|
|
15
|
+
issues: string[];
|
|
16
|
+
openRedSlices: string[];
|
|
17
|
+
sliceCount: number;
|
|
18
|
+
}
|
|
19
|
+
export declare function parseTddCycleLog(text: string): TddCycleEntry[];
|
|
20
|
+
export declare function validateTddCycleOrder(entries: TddCycleEntry[], options?: {
|
|
21
|
+
runId?: string;
|
|
22
|
+
}): TddCycleValidation;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
export function parseTddCycleLog(text) {
|
|
2
|
+
const out = [];
|
|
3
|
+
for (const raw of text.split(/\r?\n/)) {
|
|
4
|
+
const line = raw.trim();
|
|
5
|
+
if (!line)
|
|
6
|
+
continue;
|
|
7
|
+
try {
|
|
8
|
+
const parsed = JSON.parse(line);
|
|
9
|
+
const phase = parsed.phase;
|
|
10
|
+
if (phase !== "red" && phase !== "green" && phase !== "refactor") {
|
|
11
|
+
continue;
|
|
12
|
+
}
|
|
13
|
+
const entry = {
|
|
14
|
+
ts: typeof parsed.ts === "string" ? parsed.ts : "",
|
|
15
|
+
runId: typeof parsed.runId === "string" ? parsed.runId : "active",
|
|
16
|
+
stage: typeof parsed.stage === "string" ? parsed.stage : "tdd",
|
|
17
|
+
slice: typeof parsed.slice === "string" ? parsed.slice : "S-unknown",
|
|
18
|
+
phase,
|
|
19
|
+
command: typeof parsed.command === "string" ? parsed.command : "",
|
|
20
|
+
files: Array.isArray(parsed.files)
|
|
21
|
+
? parsed.files.filter((item) => typeof item === "string")
|
|
22
|
+
: undefined,
|
|
23
|
+
exitCode: typeof parsed.exitCode === "number" ? parsed.exitCode : undefined,
|
|
24
|
+
note: typeof parsed.note === "string" ? parsed.note : undefined
|
|
25
|
+
};
|
|
26
|
+
out.push(entry);
|
|
27
|
+
}
|
|
28
|
+
catch {
|
|
29
|
+
// skip malformed line
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
return out;
|
|
33
|
+
}
|
|
34
|
+
export function validateTddCycleOrder(entries, options = {}) {
|
|
35
|
+
const targetRun = options.runId;
|
|
36
|
+
const filtered = targetRun
|
|
37
|
+
? entries.filter((entry) => entry.runId === targetRun)
|
|
38
|
+
: entries;
|
|
39
|
+
const bySlice = new Map();
|
|
40
|
+
for (const entry of filtered) {
|
|
41
|
+
const list = bySlice.get(entry.slice) ?? [];
|
|
42
|
+
list.push(entry);
|
|
43
|
+
bySlice.set(entry.slice, list);
|
|
44
|
+
}
|
|
45
|
+
const issues = [];
|
|
46
|
+
const openRedSlices = [];
|
|
47
|
+
for (const [slice, sliceEntries] of bySlice.entries()) {
|
|
48
|
+
let state = "need_red";
|
|
49
|
+
for (const entry of sliceEntries) {
|
|
50
|
+
if (entry.phase === "red") {
|
|
51
|
+
if (state === "red_open") {
|
|
52
|
+
issues.push(`slice ${slice}: duplicate red before green`);
|
|
53
|
+
continue;
|
|
54
|
+
}
|
|
55
|
+
state = "red_open";
|
|
56
|
+
continue;
|
|
57
|
+
}
|
|
58
|
+
if (entry.phase === "green") {
|
|
59
|
+
if (state !== "red_open") {
|
|
60
|
+
issues.push(`slice ${slice}: green logged before red`);
|
|
61
|
+
continue;
|
|
62
|
+
}
|
|
63
|
+
state = "green_done";
|
|
64
|
+
continue;
|
|
65
|
+
}
|
|
66
|
+
// refactor
|
|
67
|
+
if (state !== "green_done") {
|
|
68
|
+
issues.push(`slice ${slice}: refactor logged before green`);
|
|
69
|
+
}
|
|
70
|
+
state = "need_red";
|
|
71
|
+
}
|
|
72
|
+
if (state === "red_open") {
|
|
73
|
+
openRedSlices.push(slice);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
return {
|
|
77
|
+
ok: issues.length === 0 && openRedSlices.length === 0,
|
|
78
|
+
issues,
|
|
79
|
+
openRedSlices,
|
|
80
|
+
sliceCount: bySlice.size
|
|
81
|
+
};
|
|
82
|
+
}
|
package/dist/types.d.ts
CHANGED
|
@@ -57,10 +57,12 @@ export interface VibyConfig {
|
|
|
57
57
|
version: string;
|
|
58
58
|
flowVersion: string;
|
|
59
59
|
harnesses: HarnessId[];
|
|
60
|
-
/** When true, stage skills instruct the agent to continue to the following stage after gates pass. */
|
|
61
|
-
autoAdvance?: boolean;
|
|
62
60
|
/** Prompt guard behavior for runtime write-risk detection hooks. */
|
|
63
61
|
promptGuardMode?: "advisory" | "strict";
|
|
62
|
+
/** TDD red->green->refactor enforcement mode used by workflow guard hooks. */
|
|
63
|
+
tddEnforcement?: "advisory" | "strict";
|
|
64
|
+
/** Optional test file globs used by guard guidance and /cc-tdd-log docs. */
|
|
65
|
+
tddTestGlobs?: string[];
|
|
64
66
|
/** When true, cclaw installs managed git pre-commit/pre-push wrappers. */
|
|
65
67
|
gitHookGuards?: boolean;
|
|
66
68
|
/** Default flow track for new runs (quick = shortened path, standard = full pipeline). */
|