@kaddo/mcp 3.23.1 → 3.23.2
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/index.js +21 -15
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2102,6 +2102,8 @@ function hasSection(body, re) {
|
|
|
2102
2102
|
return body.split(/\r?\n/).some((l) => /^#{1,6}\s+/.test(l) && re.test(l));
|
|
2103
2103
|
}
|
|
2104
2104
|
function buildImpactReport(dir, opts = {}, now = /* @__PURE__ */ new Date()) {
|
|
2105
|
+
const resolvedScope = opts.scope ?? "all";
|
|
2106
|
+
const scopeSource = opts.scopeSource ?? (opts.scope ? "explicit" : "default");
|
|
2105
2107
|
const exp = buildProjectExplanation(dir);
|
|
2106
2108
|
const wis = discoverWorkItems(dir);
|
|
2107
2109
|
const total = wis.length;
|
|
@@ -2172,19 +2174,13 @@ function buildImpactReport(dir, opts = {}, now = /* @__PURE__ */ new Date()) {
|
|
|
2172
2174
|
}
|
|
2173
2175
|
const ownershipOverlaps = gaps.ownership_overlaps.length;
|
|
2174
2176
|
let g;
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
g = { available: true, scope: graph.scope, scopeReason: graph.scope_reason, nodes: graph.nodes.length, edges: graph.edges.length, quality: hints.quality, hints: hints.summary.hints, generatedAt: graph.generated_at };
|
|
2181
|
-
} else {
|
|
2182
|
-
g = { available: false, scope: opts.scope, scopeReason: "", nodes: 0, edges: 0, quality: "unknown", hints: 0, generatedAt: "" };
|
|
2183
|
-
}
|
|
2184
|
-
} else if (exp.graph) {
|
|
2185
|
-
g = { available: true, scope: exp.graph.scope, scopeReason: exp.graph.scopeReason, nodes: exp.graph.nodes, edges: exp.graph.edges, quality: exp.graphHints?.quality ?? "unknown", hints: exp.graphHints?.totalHints ?? 0, generatedAt: exp.graph.generatedAt };
|
|
2177
|
+
const config = loadConfig(dir);
|
|
2178
|
+
if (config) {
|
|
2179
|
+
const graph = buildGraph(dir, config, { scope: resolvedScope }, now);
|
|
2180
|
+
const hints = buildGraphHints(dir, graph, now);
|
|
2181
|
+
g = { available: true, scope: graph.scope, scopeReason: graph.scope_reason, nodes: graph.nodes.length, edges: graph.edges.length, quality: hints.quality, hints: hints.summary.hints, generatedAt: graph.generated_at };
|
|
2186
2182
|
} else {
|
|
2187
|
-
g = { available: false, scope:
|
|
2183
|
+
g = { available: false, scope: resolvedScope, scopeReason: "", nodes: 0, edges: 0, quality: "unknown", hints: 0, generatedAt: "" };
|
|
2188
2184
|
}
|
|
2189
2185
|
const layerStatus = (name) => exp.layers.find((l) => l.layer === name)?.status ?? "Missing";
|
|
2190
2186
|
const byState = exp.workItems.byState;
|
|
@@ -2282,7 +2278,7 @@ function buildImpactReport(dir, opts = {}, now = /* @__PURE__ */ new Date()) {
|
|
|
2282
2278
|
};
|
|
2283
2279
|
const actions = [];
|
|
2284
2280
|
if (!g.available) actions.push("Run `kaddo graph export --scope all` to inspect full traceability.");
|
|
2285
|
-
else if (g.scope === "active" && g.quality === "empty") actions.push("Run `kaddo
|
|
2281
|
+
else if (g.scope === "active" && g.quality === "empty") actions.push("Run `kaddo impact --scope all` to measure accumulated knowledge impact.");
|
|
2286
2282
|
if (exp.roadmap.remaining > 0) actions.push(`Materialize the ${exp.roadmap.remaining} remaining roadmap candidate(s) with \`kaddo create --from roadmap\`.`);
|
|
2287
2283
|
for (const a of [
|
|
2288
2284
|
groupedAction(gaps.missing_code_ownership, "Add `code:` ownership to"),
|
|
@@ -2307,6 +2303,8 @@ function buildImpactReport(dir, opts = {}, now = /* @__PURE__ */ new Date()) {
|
|
|
2307
2303
|
generated_at: now.toISOString(),
|
|
2308
2304
|
project: exp.project.name,
|
|
2309
2305
|
scope: g.scope,
|
|
2306
|
+
default_scope: "all",
|
|
2307
|
+
scope_source: scopeSource,
|
|
2310
2308
|
executive_summary: summary,
|
|
2311
2309
|
knowledge_health,
|
|
2312
2310
|
knowledge_coverage,
|
|
@@ -2361,6 +2359,11 @@ function renderImpactMarkdown(r) {
|
|
|
2361
2359
|
L.push(`Scope: ${r.scope}`);
|
|
2362
2360
|
if (r.score !== null) L.push(`Knowledge Impact Score: ${r.score}/100`);
|
|
2363
2361
|
else L.push("Knowledge Impact Score: not available");
|
|
2362
|
+
if (r.scope_source === "default") {
|
|
2363
|
+
L.push("Scope note: Impact reports use `all` by default to measure accumulated knowledge impact.");
|
|
2364
|
+
} else if (r.scope === "active" && r.graph_quality.available === false) {
|
|
2365
|
+
L.push("Tip: Run `kaddo impact --scope all` to inspect accumulated knowledge impact.");
|
|
2366
|
+
}
|
|
2364
2367
|
L.push("");
|
|
2365
2368
|
L.push("## Executive Summary", "");
|
|
2366
2369
|
for (const s2 of r.executive_summary) L.push(`- ${s2}`);
|
|
@@ -2417,6 +2420,9 @@ function renderImpactMarkdown(r) {
|
|
|
2417
2420
|
L.push(`- Hints: ${gq.hints}`);
|
|
2418
2421
|
if (gq.reason) L.push(`- Reason: ${gq.reason}`);
|
|
2419
2422
|
if (gq.last_exported) L.push(`- Last exported: ${gq.last_exported}`);
|
|
2423
|
+
if (gq.scope === "active" && gq.quality === "empty") {
|
|
2424
|
+
L.push("- Tip: Run `kaddo impact --scope all` to inspect accumulated knowledge impact.");
|
|
2425
|
+
}
|
|
2420
2426
|
} else {
|
|
2421
2427
|
L.push("- Graph data not available.");
|
|
2422
2428
|
L.push(`- Tip: ${r.graph_quality.suggestion}`);
|
|
@@ -2706,7 +2712,7 @@ var RESOURCES = [
|
|
|
2706
2712
|
if (!hasKnowledge(root)) {
|
|
2707
2713
|
return text("kaddo://impact-report", "Knowledge repository not found. Run `kaddo bootstrap` first.", "text/plain");
|
|
2708
2714
|
}
|
|
2709
|
-
return [{ uri: "kaddo://impact-report", text: renderImpactMarkdown(buildImpactReport(root, { scope: "all" })), mimeType: "text/markdown" }];
|
|
2715
|
+
return [{ uri: "kaddo://impact-report", text: renderImpactMarkdown(buildImpactReport(root, { scope: "all", scopeSource: "default" })), mimeType: "text/markdown" }];
|
|
2710
2716
|
}
|
|
2711
2717
|
}
|
|
2712
2718
|
];
|
|
@@ -3474,7 +3480,7 @@ function generateImpactReport(root, opts = {}) {
|
|
|
3474
3480
|
requireConfig(root);
|
|
3475
3481
|
requireKnowledge(root);
|
|
3476
3482
|
const format = opts.format ?? "markdown";
|
|
3477
|
-
const report = buildImpactReport(root, { scope: opts.scope ?? "all" });
|
|
3483
|
+
const report = buildImpactReport(root, { scope: opts.scope ?? "all", scopeSource: opts.scope ? "explicit" : "default" });
|
|
3478
3484
|
const content = format === "json" ? serializeImpactJson(report) : renderImpactMarkdown(report);
|
|
3479
3485
|
const out = opts.output ?? `.kaddo/reports/impact-report.${format === "json" ? "json" : "md"}`;
|
|
3480
3486
|
writeDerived(root, out, content);
|
package/package.json
CHANGED