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.
Files changed (54) hide show
  1. package/dist/cli.d.ts +2 -0
  2. package/dist/cli.js +25 -1
  3. package/dist/config.js +19 -8
  4. package/dist/constants.d.ts +2 -2
  5. package/dist/constants.js +16 -1
  6. package/dist/content/archive-command.d.ts +2 -0
  7. package/dist/content/archive-command.js +98 -0
  8. package/dist/content/contracts.js +1 -1
  9. package/dist/content/diff-command.d.ts +2 -0
  10. package/dist/content/diff-command.js +83 -0
  11. package/dist/content/feature-command.d.ts +2 -0
  12. package/dist/content/feature-command.js +120 -0
  13. package/dist/content/harnesses-doc.js +11 -0
  14. package/dist/content/hooks.js +48 -2
  15. package/dist/content/learnings.d.ts +0 -2
  16. package/dist/content/learnings.js +4 -33
  17. package/dist/content/meta-skill.js +4 -2
  18. package/dist/content/next-command.js +18 -9
  19. package/dist/content/observe.d.ts +5 -1
  20. package/dist/content/observe.js +134 -2
  21. package/dist/content/ops-command.d.ts +2 -0
  22. package/dist/content/ops-command.js +60 -0
  23. package/dist/content/protocols.js +14 -2
  24. package/dist/content/retro-command.d.ts +2 -0
  25. package/dist/content/retro-command.js +77 -0
  26. package/dist/content/rewind-command.d.ts +3 -0
  27. package/dist/content/rewind-command.js +120 -0
  28. package/dist/content/skills.js +2 -0
  29. package/dist/content/stage-common-guidance.js +2 -1
  30. package/dist/content/status-command.js +43 -35
  31. package/dist/content/tdd-log-command.d.ts +2 -0
  32. package/dist/content/tdd-log-command.js +75 -0
  33. package/dist/content/templates.d.ts +1 -1
  34. package/dist/content/templates.js +36 -6
  35. package/dist/content/tree-command.d.ts +2 -0
  36. package/dist/content/tree-command.js +91 -0
  37. package/dist/content/utility-skills.js +1 -1
  38. package/dist/content/view-command.d.ts +2 -0
  39. package/dist/content/view-command.js +57 -0
  40. package/dist/doctor-registry.js +3 -3
  41. package/dist/doctor.js +149 -3
  42. package/dist/feature-system.d.ts +18 -0
  43. package/dist/feature-system.js +247 -0
  44. package/dist/flow-state.d.ts +25 -0
  45. package/dist/flow-state.js +8 -1
  46. package/dist/harness-adapters.js +95 -4
  47. package/dist/install.js +44 -2
  48. package/dist/policy.js +22 -0
  49. package/dist/runs.d.ts +33 -1
  50. package/dist/runs.js +365 -6
  51. package/dist/tdd-cycle.d.ts +22 -0
  52. package/dist/tdd-cycle.js +82 -0
  53. package/dist/types.d.ts +4 -2
  54. 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). */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cclaw-cli",
3
- "version": "0.12.0",
3
+ "version": "0.14.0",
4
4
  "description": "Installer-first flow toolkit for coding agents",
5
5
  "type": "module",
6
6
  "bin": {