@plumpslabs/kuma 2.4.11 → 2.4.12

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plumpslabs/kuma",
3
- "version": "2.4.11",
3
+ "version": "2.4.12",
4
4
  "description": "Safety-first context & orchestration engine for AI coding agents. MCP server with mandatory research pipeline, knowledge graph, impact analysis, decision memory, and safety guard — works with any MCP client.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -73,12 +73,51 @@ function readSessionMetrics(dbPath) {
73
73
  return empty;
74
74
  }
75
75
  }
76
+ function searchByBasename(dir, baseName, maxDepth) {
77
+ if (maxDepth < 0) return null;
78
+ try {
79
+ const entries = fs.readdirSync(dir, { withFileTypes: true });
80
+ for (const entry of entries) {
81
+ if (entry.name.startsWith(".") || entry.name === "node_modules" || entry.name === "dist") continue;
82
+ const full = path.join(dir, entry.name);
83
+ if (entry.isFile() && entry.name.toLowerCase() === baseName.toLowerCase()) return full;
84
+ if (entry.isDirectory()) {
85
+ const found = searchByBasename(full, baseName, maxDepth - 1);
86
+ if (found) return found;
87
+ }
88
+ }
89
+ } catch {
90
+ }
91
+ return null;
92
+ }
93
+ function findFileInMonorepo(root, targetPath) {
94
+ const direct = path.join(root, targetPath);
95
+ if (fs.existsSync(direct) && fs.statSync(direct).isFile()) return direct;
96
+ const targetBase = path.basename(targetPath);
97
+ try {
98
+ const entries = fs.readdirSync(root, { withFileTypes: true });
99
+ for (const ent of entries) {
100
+ if (ent.isDirectory() && !ent.name.startsWith(".") && ent.name !== "node_modules" && ent.name !== "dist" && ent.name !== "build") {
101
+ const dirPath = path.join(root, ent.name);
102
+ const relCand = path.join(dirPath, targetPath);
103
+ if (fs.existsSync(relCand) && fs.statSync(relCand).isFile()) return relCand;
104
+ const relSrcCand = path.join(dirPath, "src", targetPath);
105
+ if (fs.existsSync(relSrcCand) && fs.statSync(relSrcCand).isFile()) return relSrcCand;
106
+ const found = searchByBasename(dirPath, targetBase, 3);
107
+ if (found) return found;
108
+ }
109
+ }
110
+ } catch {
111
+ }
112
+ return null;
113
+ }
76
114
  function detectStaleNodes(db, dbPath) {
77
115
  try {
78
116
  const root = projectRootFromDb(dbPath);
79
117
  const stmt = db.prepare(
80
- `SELECT id, file_path, metadata, COUNT(*) as cnt FROM nodes
118
+ `SELECT id, file_path, type, metadata, COUNT(*) as cnt FROM nodes
81
119
  WHERE file_path IS NOT NULL AND file_path != '' AND file_path NOT LIKE '%::%'
120
+ AND type NOT IN ('decision', 'arch_flow', 'feature_domain', 'feature', 'workflow', 'cross_service_link', 'research')
82
121
  GROUP BY file_path ORDER BY cnt DESC LIMIT 500`
83
122
  );
84
123
  const missing = [];
@@ -86,10 +125,19 @@ function detectStaleNodes(db, dbPath) {
86
125
  let staleNodes = 0;
87
126
  while (stmt.step()) {
88
127
  const row = stmt.getAsObject();
89
- const fp = row.file_path;
128
+ const fp = (row.file_path || "").trim();
90
129
  const metadata = row.metadata || "{}";
130
+ if (!fp || /\s/.test(fp) || !path.extname(fp) || fp.includes("::")) {
131
+ continue;
132
+ }
91
133
  checked++;
92
- const fullPath = path.join(root, fp);
134
+ let fullPath = path.join(root, fp);
135
+ if (!fs.existsSync(fullPath)) {
136
+ const monorepoPath = findFileInMonorepo(root, fp);
137
+ if (monorepoPath) {
138
+ fullPath = monorepoPath;
139
+ }
140
+ }
93
141
  if (!fs.existsSync(fullPath)) {
94
142
  const count = Number(row.cnt ?? 1);
95
143
  missing.push({ filePath: fp, nodeCount: count, reason: "file_missing" });
package/plugin.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://antigravity.google/schemas/v1/plugin.json",
3
3
  "name": "kuma",
4
- "version": "2.4.11",
4
+ "version": "2.4.12",
5
5
  "description": "Safety-first context & orchestration engine for AI coding agents. Shadow memory, gotcha lifecycle, blast radius impact analysis, and test verification.",
6
6
  "author": {
7
7
  "name": "plumpslabs",