@kaddo/mcp 3.25.0 → 3.25.1

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 +45 -11
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -2702,11 +2702,23 @@ function buildSavingsReport(dir, opts = {}, now = /* @__PURE__ */ new Date()) {
2702
2702
  const graphMult = GRAPH_MULT[graphQuality] ?? 0;
2703
2703
  const archH = round2(a.architecture_discovery_hours_saved_when_graph_good * graphMult);
2704
2704
  const guard = buildGuardHistory(dir);
2705
- const driftSavings = guard.available && guard.resolved > 0 ? {
2706
- available: true,
2707
- hours: round2(guard.resolved * a.rework_hours_avoided_per_resolved_drift),
2708
- formula: `${guard.resolved} resolved drift warnings \xD7 ${a.rework_hours_avoided_per_resolved_drift} h`
2709
- } : { available: false, hours: 0, reason: "Guard history is not persisted yet." };
2705
+ let driftSavings;
2706
+ if (!guard.available) {
2707
+ driftSavings = { available: false, hours: 0, reason: "Guard history is not persisted yet." };
2708
+ } else if (guard.resolved > 0) {
2709
+ driftSavings = {
2710
+ available: true,
2711
+ hours: round2(guard.resolved * a.rework_hours_avoided_per_resolved_drift),
2712
+ formula: `${guard.resolved} resolved drift warnings \xD7 ${a.rework_hours_avoided_per_resolved_drift} h`
2713
+ };
2714
+ } else {
2715
+ driftSavings = {
2716
+ available: true,
2717
+ hours: 0,
2718
+ formula: `0 resolved drift warnings \xD7 ${a.rework_hours_avoided_per_resolved_drift} h`,
2719
+ reason: "Guard history exists, but no resolved drift warnings have been recorded yet."
2720
+ };
2721
+ }
2710
2722
  const totalHours = round2(ctxPrepH + reviewH + clarH + onboardH + archH + driftSavings.hours);
2711
2723
  const totalValue = Math.round(totalHours * a.hourly_cost);
2712
2724
  const reasons = [];
@@ -2721,15 +2733,27 @@ function buildSavingsReport(dir, opts = {}, now = /* @__PURE__ */ new Date()) {
2721
2733
  level = "Medium";
2722
2734
  reasons.push("Strong knowledge and graph evidence.");
2723
2735
  }
2724
- if (!guard.available) reasons.push("Guard history is not persisted yet \u2014 avoided rework is not estimated.");
2725
- else reasons.push(`Guard history available (${guard.resolved} resolved drift warning(s)).`);
2736
+ if (!guard.available) {
2737
+ reasons.push("Guard history is not persisted yet \u2014 avoided rework is not estimated.");
2738
+ } else if (guard.resolved > 0) {
2739
+ reasons.push(`Guard history available (${guard.resolved} resolved drift warning(s)).`);
2740
+ } else {
2741
+ reasons.push("Guard history available, but no resolved drift warnings have been recorded yet.");
2742
+ }
2726
2743
  reasons.push(source === "file" ? "Assumptions come from `.kaddo/savings.yml`." : "Savings assumptions are defaults and should be calibrated.");
2727
2744
  const actions = [];
2728
2745
  if (source === "default") actions.push("Run `kaddo savings init` to customize assumptions.");
2729
2746
  actions.push("Calibrate hourly cost and team assumptions with real team data.");
2730
2747
  actions.push("Run `kaddo impact` to verify the underlying evidence quality.");
2731
2748
  actions.push("Use this report as directional evidence, not accounting data.");
2732
- actions.push("Future: persist Guard history to estimate avoided rework.");
2749
+ if (!guard.available) {
2750
+ actions.push("Future: persist Guard history to estimate avoided rework.");
2751
+ } else if (guard.resolved === 0) {
2752
+ actions.push("Continue running `kaddo guard --record` before important commits to capture resolved drift warnings.");
2753
+ if (guard.open > 0) actions.push("Review open drift warnings with `kaddo drift`.");
2754
+ } else {
2755
+ actions.push("Use drift history to calibrate `rework_hours_avoided_per_resolved_drift`.");
2756
+ }
2733
2757
  return {
2734
2758
  generated_at: now.toISOString(),
2735
2759
  project: impact.project,
@@ -2755,7 +2779,9 @@ function buildSavingsReport(dir, opts = {}, now = /* @__PURE__ */ new Date()) {
2755
2779
  graph_nodes: impact.graph_quality.available ? impact.graph_quality.nodes : null,
2756
2780
  graph_edges: impact.graph_quality.available ? impact.graph_quality.edges : null,
2757
2781
  context_readiness: readiness,
2758
- guard_history_available: guard.available
2782
+ guard_history_available: guard.available,
2783
+ guard_runs_recorded: guard.total_runs,
2784
+ resolved_drift_warnings: guard.resolved
2759
2785
  },
2760
2786
  estimated_savings: {
2761
2787
  context_preparation: { hours: ctxPrepH, formula: `${completed} Work Items \xD7 ${a.context_preparation_minutes_saved_per_work_item} min` },
@@ -2805,7 +2831,13 @@ function renderSavingsMarkdown(r) {
2805
2831
  if (e.graph_nodes !== null) L.push(`- Graph nodes: ${e.graph_nodes}`);
2806
2832
  if (e.graph_edges !== null) L.push(`- Graph edges: ${e.graph_edges}`);
2807
2833
  L.push(`- Context readiness: ${e.context_readiness}`);
2808
- L.push("- Guard history: not available");
2834
+ if (e.guard_history_available) {
2835
+ L.push("- Guard history: available");
2836
+ L.push(`- Guard runs recorded: ${e.guard_runs_recorded}`);
2837
+ L.push(`- Resolved drift warnings: ${e.resolved_drift_warnings}`);
2838
+ } else {
2839
+ L.push("- Guard history: not available");
2840
+ }
2809
2841
  L.push("");
2810
2842
  L.push("## Estimated Savings", "");
2811
2843
  const s = r.estimated_savings;
@@ -2822,7 +2854,9 @@ function renderSavingsMarkdown(r) {
2822
2854
  L.push("### Drift Prevention", "");
2823
2855
  if (s.drift_prevention.available) {
2824
2856
  L.push(`- Formula: ${s.drift_prevention.formula}`);
2825
- L.push(`- Estimated: ${s.drift_prevention.hours} h`, "");
2857
+ L.push(`- Estimated: ${s.drift_prevention.hours} h`);
2858
+ if (s.drift_prevention.reason) L.push(`- Reason: ${s.drift_prevention.reason}`);
2859
+ L.push("");
2826
2860
  } else {
2827
2861
  L.push("- Not available yet.");
2828
2862
  L.push(`- Reason: ${s.drift_prevention.reason}`, "");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kaddo/mcp",
3
- "version": "3.25.0",
3
+ "version": "3.25.1",
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": {