@kaddo/mcp 3.124.3 → 3.124.4

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 (2) hide show
  1. package/dist/index.js +118 -35
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -10406,16 +10406,25 @@ function buildGuardHistory(dir) {
10406
10406
  // ../cli/src/core/reporting-evidence.ts
10407
10407
  function graphHintFinding(hint) {
10408
10408
  const affected = [hint.artifact_id, ...hint.path ? [hint.path] : []];
10409
+ const semantics = {
10410
+ "work-item": { classification: "coverage_gap", priority: "medium", action: "Review whether the active Work Item needs the missing declared relationship." },
10411
+ decision: { classification: "coverage_gap", priority: "low", action: "Review whether this decision should declare governed code paths." },
10412
+ capability: { classification: "coverage_gap", priority: "low", action: "Review whether this capability should connect to existing Work Items; the relationship is optional." },
10413
+ "knowledge-capsule": { classification: "review_hint", priority: "low", action: "Confirm whether this capsule is intended for direct contextual use or Work Item relationships." }
10414
+ };
10415
+ const semantic = semantics[hint.artifact_type];
10409
10416
  return {
10410
10417
  id: `graph-hint:${hint.artifact_id}:${hint.missing.join(",")}`,
10411
10418
  category: "topology",
10419
+ classification: semantic.classification,
10420
+ resolution_status: "open",
10412
10421
  source: "graph-hints",
10413
10422
  affected_artifacts: affected,
10414
- // Graph Hints are intentionally informational; review is useful but not a blocking error.
10415
- priority: "medium",
10423
+ // Graph Hints are intentionally non-blocking; their type determines priority and meaning.
10424
+ priority: semantic.priority,
10416
10425
  evidence: hint.reason,
10417
10426
  explanation: hint.message,
10418
- suggested_action: `Review the declared relationships for ${hint.artifact_id}${hint.path ? ` at ${hint.path}` : ""}.`
10427
+ suggested_action: semantic.action
10419
10428
  };
10420
10429
  }
10421
10430
  function reportingProjectContext(dir) {
@@ -10635,9 +10644,11 @@ function buildImpactReport(dir, opts = {}, now = /* @__PURE__ */ new Date()) {
10635
10644
  findings.push({
10636
10645
  id: `knowledge-health:${layer2.toLowerCase()}`,
10637
10646
  category: "knowledge",
10647
+ classification: "coverage_gap",
10648
+ resolution_status: "open",
10638
10649
  source: "knowledge-health",
10639
10650
  affected_artifacts: [layer2],
10640
- priority: status === "Missing" ? "high" : "medium",
10651
+ priority: status === "Missing" ? "medium" : "low",
10641
10652
  evidence: `${layer2} knowledge maturity is ${status}.`,
10642
10653
  explanation: `This assesses documented ${layer2} knowledge, not the quality of the product or implementation.`,
10643
10654
  suggested_action: `Review ${layer2} knowledge coverage and the artifacts or relationships available for it.`
@@ -10647,12 +10658,29 @@ function buildImpactReport(dir, opts = {}, now = /* @__PURE__ */ new Date()) {
10647
10658
  findings.push({
10648
10659
  id: `ownership:${gap.id}`,
10649
10660
  category: "delivery",
10661
+ classification: "coverage_gap",
10662
+ resolution_status: "open",
10650
10663
  source: "work-item-ownership",
10651
10664
  affected_artifacts: [gap.id, gap.path],
10652
10665
  priority: "medium",
10653
10666
  evidence: "A corrective Work Item has no declared code ownership.",
10654
10667
  explanation: gap.title,
10655
- suggested_action: gap.suggested_action
10668
+ suggested_action: "Review and add relevant code ownership declarations."
10669
+ });
10670
+ }
10671
+ for (const wi of completedWis) {
10672
+ if (!wi.validationStatus || !["not-started", "in-progress", "partial", "failed", "blocked"].includes(wi.validationStatus)) continue;
10673
+ findings.push({
10674
+ id: `completion-validation:${wi.id || wi.title}`,
10675
+ category: "delivery",
10676
+ classification: "review_hint",
10677
+ resolution_status: "open",
10678
+ source: "work-item-lifecycle",
10679
+ affected_artifacts: [wi.id || wi.title, wi.relPath],
10680
+ priority: "medium",
10681
+ evidence: `Lifecycle is completed while persisted validation is ${wi.validationStatus}.`,
10682
+ explanation: "This requires review against the Work Item completion contract; it is not automatically a failed or invalid completion.",
10683
+ suggested_action: "Review the validation evidence and confirm whether the completed lifecycle state is consistent with the Work Item completion contract."
10656
10684
  });
10657
10685
  }
10658
10686
  findings.push(...graphHintEntries.map(graphHintFinding));
@@ -10695,7 +10723,6 @@ function buildImpactReport(dir, opts = {}, now = /* @__PURE__ */ new Date()) {
10695
10723
  else if (g.scope === "active" && g.quality === "empty") actions.push("Run `kaddo impact --scope all` to measure accumulated knowledge impact.");
10696
10724
  if (exp.roadmap.remaining > 0) actions.push(`Materialize the ${exp.roadmap.remaining} remaining roadmap candidate(s) with \`kaddo create --from roadmap\`.`);
10697
10725
  for (const a2 of [
10698
- groupedAction(gaps.missing_code_ownership, "Add `code:` ownership to"),
10699
10726
  groupedAction(gaps.missing_source, "Add `source`/`source_id` to")
10700
10727
  ]) if (a2) actions.push(a2);
10701
10728
  if (gaps.broad_ownership_globs.length > 0) actions.push(`Narrow ${gaps.broad_ownership_globs.length} broad ownership glob(s) into specific paths.`);
@@ -10783,7 +10810,7 @@ function buildImpactReport(dir, opts = {}, now = /* @__PURE__ */ new Date()) {
10783
10810
  function ratio(have, total) {
10784
10811
  return `${have}/${total}`;
10785
10812
  }
10786
- function renderImpactMarkdown(r2) {
10813
+ function renderImpactMarkdown(r2, opts = {}) {
10787
10814
  const L = [];
10788
10815
  L.push("# Kaddo Knowledge Impact Report", "");
10789
10816
  L.push(`Generated at: ${r2.generated_at}`);
@@ -10805,10 +10832,10 @@ function renderImpactMarkdown(r2) {
10805
10832
  if (r2.findings.length === 0) L.push("No current findings detected by the executed deterministic checks.");
10806
10833
  if (r2.findings.length > 0) {
10807
10834
  const cell = (value) => value.replace(/\|/g, "\\|").replace(/\r?\n/g, " ");
10808
- L.push("| Priority | Source | Affected | Finding | Suggested action |");
10809
- L.push("|---|---|---|---|---|");
10835
+ L.push("| Classification | Priority | Status | Source | Affected | Finding | Suggested action |");
10836
+ L.push("|---|---|---|---|---|---|---|");
10810
10837
  for (const finding of r2.findings) {
10811
- L.push(`| ${finding.priority} | ${cell(finding.source)} | ${cell(finding.affected_artifacts.join(", ") || "not available")} | ${cell(finding.explanation)} Evidence: ${cell(finding.evidence)} | ${cell(finding.suggested_action)} |`);
10838
+ L.push(`| ${finding.classification} | ${finding.priority} | ${finding.resolution_status} | ${cell(finding.source)} | ${cell(finding.affected_artifacts.join(", ") || "not available")} | ${cell(finding.explanation)} Evidence: ${cell(finding.evidence)} | ${cell(finding.suggested_action)} |`);
10812
10839
  }
10813
10840
  }
10814
10841
  L.push("");
@@ -10920,9 +10947,9 @@ function renderImpactMarkdown(r2) {
10920
10947
  }
10921
10948
  L.push("");
10922
10949
  };
10923
- gapSection("Work Items missing source", gp.missing_source);
10924
- gapSection("Work Items missing code ownership", gp.missing_code_ownership);
10925
- if (gp.broad_ownership_globs.length > 0) {
10950
+ if (opts.details) gapSection("Work Items missing source", gp.missing_source);
10951
+ if (opts.details) gapSection("Work Items missing code ownership", gp.missing_code_ownership);
10952
+ if (opts.details && gp.broad_ownership_globs.length > 0) {
10926
10953
  L.push("### Broad ownership globs", "");
10927
10954
  for (const b2 of gp.broad_ownership_globs) {
10928
10955
  L.push(`- ${b2.id} \u2014 ${b2.title}`);
@@ -10933,16 +10960,26 @@ function renderImpactMarkdown(r2) {
10933
10960
  }
10934
10961
  if (gp.ownership_overlaps.length > 0) {
10935
10962
  L.push("### Shared code-path history (review only)", "");
10936
- for (const o2 of gp.ownership_overlaps) {
10937
- L.push(`- \`${o2.code_path}\``);
10938
- L.push(` - Owned by: ${o2.work_items.join(", ")}`);
10939
- L.push(` - Suggested action: ${o2.suggested_action}`);
10963
+ if (opts.details) {
10964
+ for (const o2 of gp.ownership_overlaps) {
10965
+ L.push(`- \`${o2.code_path}\``);
10966
+ L.push(` - Owned by: ${o2.work_items.join(", ")}`);
10967
+ L.push(` - Suggested action: ${o2.suggested_action}`);
10968
+ }
10969
+ } else {
10970
+ L.push(`- ${gp.ownership_overlaps.length} shared path declaration(s) detected. These are historical relationships, not necessarily ownership conflicts.`);
10971
+ const areas = gp.ownership_overlaps.slice(0, 3).map((o2) => `\`${o2.code_path}\``);
10972
+ if (areas.length > 0) L.push(`- Most involved paths: ${areas.join(", ")}.`);
10973
+ L.push("- Run `kaddo impact --details` for the complete shared-path inventory.");
10940
10974
  }
10941
10975
  L.push("");
10942
10976
  }
10943
10977
  const anyGaps = gp.missing_source.length + gp.missing_code_ownership.length + gp.broad_ownership_globs.length;
10944
10978
  if (anyGaps === 0) {
10945
10979
  L.push("No actionable knowledge gaps detected. \u{1F389}", "");
10980
+ } else if (!opts.details) {
10981
+ L.push("- Current actionable items are listed in Key Findings. Run `kaddo impact --details` for the full artifact inventory.");
10982
+ L.push("");
10946
10983
  }
10947
10984
  const historical = [
10948
10985
  ["knowledge level", gp.missing_knowledge_level],
@@ -11205,7 +11242,7 @@ function renderSavingsMarkdown(r2) {
11205
11242
  L.push("");
11206
11243
  L.push("## Evidence Used", "");
11207
11244
  const e = r2.evidence;
11208
- L.push(`- Knowledge Impact Score: ${e.knowledge_impact_score ?? "not available"}${e.knowledge_impact_score !== null ? "/100" : ""}`);
11245
+ L.push(`- Legacy Knowledge Impact Score: ${e.knowledge_impact_score ?? "not available"}${e.knowledge_impact_score !== null ? "/100" : ""} (deprecated; informational only and not used for confidence)`);
11209
11246
  L.push(`- Completed Work Items: ${e.completed_work_items}`);
11210
11247
  L.push(`- Ownership coverage: ${e.ownership_coverage_percent}%`);
11211
11248
  L.push(`- Work Items with Acceptance Criteria: ${e.work_items_with_acceptance_criteria}`);
@@ -11280,7 +11317,15 @@ function buildDriftReport(dir, now = /* @__PURE__ */ new Date()) {
11280
11317
  const workItems = discoverWorkItems(dir);
11281
11318
  const verificationEvidence = workItems.filter((wi) => wi.validationStatus && wi.validationStatus !== "not-started");
11282
11319
  const plans = getDeprecationPlans(dir);
11283
- const deprecationFindings = plans.flatMap((plan) => getDeprecationPlan(dir, plan.id)?.targets.flatMap(validateTarget) ?? []);
11320
+ const planDetails = plans.map((plan) => getDeprecationPlan(dir, plan.id)).filter((plan) => plan !== null);
11321
+ const plansWithoutTargets = planDetails.filter((plan) => plan.targets.length === 0);
11322
+ const plansWithTargets = planDetails.filter((plan) => plan.targets.length > 0);
11323
+ const targetFindingsByPlan = new Map(plansWithTargets.map((plan) => [
11324
+ plan.id,
11325
+ plan.targets.flatMap(validateTarget)
11326
+ ]));
11327
+ const deprecationFindings = [...targetFindingsByPlan.values()].flat();
11328
+ const plansWithoutStructuralFindings = plansWithTargets.filter((plan) => (targetFindingsByPlan.get(plan.id) ?? []).length === 0);
11284
11329
  const config = loadConfig(dir);
11285
11330
  const topology = config ? buildGraph(dir, config, { scope: "all" }, now) : null;
11286
11331
  const graphHints = topology ? buildGraphHints(dir, topology, now) : null;
@@ -11290,13 +11335,27 @@ function buildDriftReport(dir, now = /* @__PURE__ */ new Date()) {
11290
11335
  ...deprecationFindings.map((finding, index) => ({
11291
11336
  id: `deprecation-target:${index + 1}`,
11292
11337
  category: "consistency",
11338
+ classification: "consistency_violation",
11339
+ resolution_status: "open",
11293
11340
  source: "deprecation-target-validation",
11294
- affected_artifacts: [],
11295
- priority: "medium",
11296
- evidence: String(finding),
11341
+ affected_artifacts: finding.target ? [finding.target] : [],
11342
+ priority: finding.severity === "error" ? "high" : "medium",
11343
+ evidence: finding.message,
11297
11344
  explanation: "A deterministic deprecation target consistency check reported a finding.",
11298
11345
  suggested_action: "Review the affected deprecation target and its declared lifecycle evidence."
11299
- }))
11346
+ })),
11347
+ ...h2.available && h2.total_runs >= 2 ? h2.threads.filter((thread) => thread.status === "open").map((thread) => ({
11348
+ id: `guard-history:${thread.code_path}`,
11349
+ category: "consistency",
11350
+ classification: "historical_drift",
11351
+ resolution_status: "open",
11352
+ source: "guard-history",
11353
+ affected_artifacts: [thread.code_path, ...thread.related_artifacts],
11354
+ priority: "medium",
11355
+ evidence: `Recorded Guard observations from ${thread.first_detected} through ${thread.last_seen} remain unresolved.`,
11356
+ explanation: "Comparable Guard runs observed a possible code/knowledge drift thread over time.",
11357
+ suggested_action: "Review the recorded drift thread and update the relevant knowledge or ownership evidence."
11358
+ })) : []
11300
11359
  ];
11301
11360
  const actions = [];
11302
11361
  if (!h2.available) {
@@ -11313,12 +11372,17 @@ function buildDriftReport(dir, now = /* @__PURE__ */ new Date()) {
11313
11372
  consistency_evidence: [
11314
11373
  { id: "guard-current-consistency", label: "Current Guard consistency", classification: h2.available ? "observed" : "unknown", reason: h2.available ? `${h2.total_runs} recorded Guard run(s) provide deterministic consistency evidence.` : "No recorded Guard history is available." },
11315
11374
  { id: "lifecycle-consistency", label: "Lifecycle evidence consistency", classification: verificationEvidence.length > 0 ? "observed" : "unknown", reason: verificationEvidence.length > 0 ? `${verificationEvidence.length} Work Item(s) persist an implementation validation status.` : "No persisted Work Item validation status is available." },
11316
- { id: "deprecation-consistency", label: "Deprecation consistency", classification: plans.length === 0 ? "not_applicable" : deprecationFindings.length === 0 ? "derived" : "observed", reason: plans.length === 0 ? "No deprecation plans exist in this project." : deprecationFindings.length === 0 ? `${plans.length} plan(s) passed deterministic target consistency checks.` : `${deprecationFindings.length} deterministic deprecation consistency finding(s) were detected.` },
11375
+ { id: "deprecation-consistency", label: "Deprecation consistency", classification: plans.length === 0 ? "not_applicable" : plansWithTargets.length === 0 ? "unknown" : deprecationFindings.length === 0 ? "derived" : "observed", reason: plans.length === 0 ? "No deprecation plans exist in this project." : plansWithTargets.length === 0 ? `${plansWithoutTargets.length} plan(s) have no targets, so target consistency was not evaluated.` : deprecationFindings.length === 0 ? `${plansWithTargets.length} plan(s) with targets passed deterministic target consistency checks; ${plansWithoutTargets.length} plan(s) remain unevaluated because they have no targets.` : `${deprecationFindings.length} deterministic deprecation consistency finding(s) were detected.` },
11317
11376
  { id: "topology-consistency", label: "Knowledge topology consistency", classification: topology === null ? "unknown" : topologyHints === 0 ? "derived" : "observed", reason: topology === null ? "No project configuration is available to construct the topology." : topologyHints === 0 ? `The in-memory topology has ${topology.nodes.length} node(s) and no open deterministic hints.` : `The in-memory topology has ${topologyHints} open deterministic hint(s).` }
11318
11377
  ],
11319
11378
  current_consistency_findings: currentConsistencyFindings,
11320
11379
  structural_consistency: {
11321
- deprecation_target_checks: plans.length === 0 ? "not_applicable" : deprecationFindings.length === 0 ? "passed" : "findings_detected",
11380
+ deprecation_target_checks: plans.length === 0 ? "not_applicable" : plansWithTargets.length === 0 ? "not_evaluated" : deprecationFindings.length === 0 ? "passed" : "findings_detected",
11381
+ plans_discovered: plans.length,
11382
+ plans_without_targets: plansWithoutTargets.length,
11383
+ plans_with_targets_evaluated: plansWithTargets.length,
11384
+ structural_findings: deprecationFindings.length,
11385
+ plans_without_structural_findings: plansWithoutStructuralFindings.length,
11322
11386
  note: plans.length === 0 ? "No deprecation plans exist in this project." : "Target consistency checks validate declared structural state only; they do not verify operational removal from infrastructure, production or external consumers."
11323
11387
  },
11324
11388
  guard_history: {
@@ -11346,22 +11410,41 @@ function renderDriftMarkdown(r2) {
11346
11410
  L.push("## Consistency Evidence", "");
11347
11411
  for (const item of r2.consistency_evidence) L.push(`- ${item.label}: ${item.classification} \u2014 ${item.reason}`);
11348
11412
  L.push("");
11349
- L.push("## Current Consistency Findings", "");
11350
- if (r2.current_consistency_findings.length === 0) {
11351
- L.push("No findings detected by the executed consistency checks.");
11352
- L.push("");
11413
+ const findingGroups = [
11414
+ { classification: "consistency_violation", title: "Consistency Violations" },
11415
+ { classification: "coverage_gap", title: "Coverage Gaps" },
11416
+ { classification: "review_hint", title: "Review Hints" },
11417
+ { classification: "historical_drift", title: "Historical Drift" }
11418
+ ];
11419
+ L.push("## Current Findings Summary", "");
11420
+ for (const group of findingGroups) {
11421
+ const count = r2.current_consistency_findings.filter((finding) => finding.classification === group.classification).length;
11422
+ const unavailable = group.classification === "historical_drift" && !r2.guard_history.available;
11423
+ L.push(`- ${group.title}: ${unavailable ? "not available \u2014 no recorded Guard runs" : count}`);
11353
11424
  }
11354
- if (r2.current_consistency_findings.length > 0) {
11355
- const cell = (value) => value.replace(/\|/g, "\\|").replace(/\r?\n/g, " ");
11356
- L.push("| Priority | Source | Affected | Finding | Suggested action |");
11357
- L.push("|---|---|---|---|---|");
11358
- for (const finding of r2.current_consistency_findings) {
11359
- L.push(`| ${finding.priority} | ${cell(finding.source)} | ${cell(finding.affected_artifacts.join(", ") || "not available")} | ${cell(finding.explanation)} Evidence: ${cell(finding.evidence)} | ${cell(finding.suggested_action)} |`);
11425
+ L.push("");
11426
+ L.push("## Current Consistency Findings", "");
11427
+ if (r2.current_consistency_findings.length === 0) L.push("No findings detected by the executed consistency checks.", "");
11428
+ const cell = (value) => value.replace(/\|/g, "\\|").replace(/\r?\n/g, " ");
11429
+ for (const group of findingGroups) {
11430
+ const findings = r2.current_consistency_findings.filter((finding) => finding.classification === group.classification);
11431
+ if (findings.length === 0) continue;
11432
+ L.push(`### ${group.title}`, "");
11433
+ L.push("| Classification | Priority | Status | Source | Affected | Finding | Suggested action |");
11434
+ L.push("|---|---|---|---|---|---|---|");
11435
+ for (const finding of findings) {
11436
+ L.push(`| ${finding.classification} | ${finding.priority} | ${finding.resolution_status} | ${cell(finding.source)} | ${cell(finding.affected_artifacts.join(", ") || "not available")} | ${cell(finding.explanation)} Evidence: ${cell(finding.evidence)} | ${cell(finding.suggested_action)} |`);
11360
11437
  }
11361
11438
  L.push("");
11362
11439
  }
11363
11440
  L.push("## Structural Consistency Boundaries", "");
11364
11441
  L.push(`- Deprecation target checks: ${r2.structural_consistency.deprecation_target_checks}`);
11442
+ L.push(`- Plans discovered: ${r2.structural_consistency.plans_discovered}`);
11443
+ L.push(`- Plans without targets: ${r2.structural_consistency.plans_without_targets}`);
11444
+ L.push(`- Plans with targets evaluated: ${r2.structural_consistency.plans_with_targets_evaluated}`);
11445
+ L.push(`- Structural findings: ${r2.structural_consistency.structural_findings}`);
11446
+ L.push(`- Plans without structural findings: ${r2.structural_consistency.plans_without_structural_findings}`);
11447
+ if (r2.structural_consistency.plans_without_targets > 0) L.push("- Target consistency for plans without targets: not evaluated \u2014 no targets defined.");
11365
11448
  L.push(`- Note: ${r2.structural_consistency.note}`);
11366
11449
  L.push("");
11367
11450
  if (!r2.guard_history.available) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kaddo/mcp",
3
- "version": "3.124.3",
3
+ "version": "3.124.4",
4
4
  "description": "MCP server for Kaddo project knowledge: read-only resources/tools/prompts plus safe derived generation under .kaddo/.",
5
5
  "license": "MIT",
6
6
  "repository": {