cclaw-cli 0.46.13 → 0.46.15

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.
@@ -5,6 +5,7 @@ import { withDirectoryLock } from "./fs-utils.js";
5
5
  import { FLOW_STAGES } from "./types.js";
6
6
  const KNOWLEDGE_TYPE_SET = new Set(["rule", "pattern", "lesson", "compound"]);
7
7
  const KNOWLEDGE_CONFIDENCE_SET = new Set(["high", "medium", "low"]);
8
+ const KNOWLEDGE_SEVERITY_SET = new Set(["critical", "important", "suggestion"]);
8
9
  const KNOWLEDGE_UNIVERSALITY_SET = new Set(["project", "personal", "universal"]);
9
10
  const KNOWLEDGE_MATURITY_SET = new Set(["raw", "lifted-to-rule", "lifted-to-enforcement"]);
10
11
  const KNOWLEDGE_SOURCE_SET = new Set([
@@ -34,6 +35,7 @@ const KNOWLEDGE_REQUIRED_KEYS = [
34
35
  ];
35
36
  const KNOWLEDGE_ALLOWED_KEYS = new Set(KNOWLEDGE_REQUIRED_KEYS);
36
37
  KNOWLEDGE_ALLOWED_KEYS.add("source");
38
+ KNOWLEDGE_ALLOWED_KEYS.add("severity");
37
39
  function knowledgePath(projectRoot) {
38
40
  return path.join(projectRoot, RUNTIME_ROOT, "knowledge.jsonl");
39
41
  }
@@ -60,7 +62,8 @@ function dedupeKey(entry) {
60
62
  entry.origin_feature === null ? "null" : normalizeText(entry.origin_feature),
61
63
  entry.universality,
62
64
  entry.project === null ? "null" : normalizeText(entry.project),
63
- entry.source === undefined || entry.source === null ? "null" : entry.source
65
+ entry.source === undefined || entry.source === null ? "null" : entry.source,
66
+ entry.severity === undefined ? "none" : entry.severity
64
67
  ].join("|");
65
68
  }
66
69
  function isIsoUtcTimestamp(value) {
@@ -100,6 +103,10 @@ export function validateKnowledgeEntry(entry) {
100
103
  if (!KNOWLEDGE_CONFIDENCE_SET.has(obj.confidence)) {
101
104
  errors.push("confidence must be one of: high, medium, low.");
102
105
  }
106
+ if (obj.severity !== undefined &&
107
+ (typeof obj.severity !== "string" || !KNOWLEDGE_SEVERITY_SET.has(obj.severity))) {
108
+ errors.push("severity must be one of: critical, important, suggestion.");
109
+ }
103
110
  if (!isNullableString(obj.domain)) {
104
111
  errors.push("domain must be string or null.");
105
112
  }
@@ -161,6 +168,9 @@ export function materializeKnowledgeEntry(seed, defaults = {}) {
161
168
  last_seen_ts: normalizeUtcIso(seed.last_seen_ts ?? now),
162
169
  project: seed.project ?? defaults.project ?? null
163
170
  };
171
+ if (seed.severity !== undefined) {
172
+ entry.severity = seed.severity;
173
+ }
164
174
  if (source !== null) {
165
175
  entry.source = source;
166
176
  }
package/dist/types.d.ts CHANGED
@@ -88,6 +88,27 @@ export interface SliceReviewConfig {
88
88
  /** Tracks on which missed reviews escalate to a doctor warning. */
89
89
  enforceOnTracks?: FlowTrack[];
90
90
  }
91
+ /**
92
+ * File-path routing hints used by workflow-guard during `tdd` stage.
93
+ *
94
+ * - `testPathPatterns`: paths considered test-side changes (RED writes).
95
+ * - `productionPathPatterns`: optional allowlist for production paths that
96
+ * participate in GREEN/REFACTOR checks. When omitted, workflow-guard treats
97
+ * non-test code files as production writes.
98
+ */
99
+ export interface TddPathConfig {
100
+ testPathPatterns?: string[];
101
+ productionPathPatterns?: string[];
102
+ }
103
+ /**
104
+ * Compound-stage clustering policy.
105
+ *
106
+ * `recurrenceThreshold` is the base minimum repeat count for a trigger/action
107
+ * cluster before it is eligible for promotion into durable rules/skills.
108
+ */
109
+ export interface CompoundConfig {
110
+ recurrenceThreshold?: number;
111
+ }
91
112
  export interface VibyConfig {
92
113
  version: string;
93
114
  flowVersion: string;
@@ -112,13 +133,20 @@ export interface VibyConfig {
112
133
  */
113
134
  promptGuardMode?: "advisory" | "strict";
114
135
  /**
115
- * TDD red->green->refactor enforcement mode used by workflow guard hooks.
136
+ * TDD RED -> GREEN -> REFACTOR enforcement mode used by workflow guard hooks.
116
137
  *
117
138
  * Since v0.43.0 this is an advanced override — see `strictness`.
118
139
  */
119
140
  tddEnforcement?: "advisory" | "strict";
120
- /** Optional test file globs used by guard guidance and /cc-ops tdd-log docs. */
141
+ /**
142
+ * Legacy alias for test-side path detection in workflow-guard.
143
+ * Prefer `tdd.testPathPatterns` in new configs.
144
+ */
121
145
  tddTestGlobs?: string[];
146
+ /** Path-pattern routing for TDD test/production write classification. */
147
+ tdd?: TddPathConfig;
148
+ /** Compound-stage recurrence policy overrides. */
149
+ compound?: CompoundConfig;
122
150
  /** When true, cclaw installs managed git pre-commit/pre-push wrappers. */
123
151
  gitHookGuards?: boolean;
124
152
  /** 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.46.13",
3
+ "version": "0.46.15",
4
4
  "description": "Installer-first flow toolkit for coding agents",
5
5
  "type": "module",
6
6
  "bin": {