Skip to content

Codebase intelligence for AI and humans: code health scores, auto-generated docs, git analytics, dead code detection, and architectural decisions via MCP.

fix(health): reword stale_governance text to match what the finding checks (#4391)

macholulf31eb129869d
diff --git a/packages/core/src/repowise/core/analysis/health/fix_first/text.py b/packages/core/src/repowise/core/analysis/health/fix_first/text.py
index 05327768b..a33fa832f 100644
--- a/packages/core/src/repowise/core/analysis/health/fix_first/text.py
+++ b/packages/core/src/repowise/core/analysis/health/fix_first/text.py
@@ -352,7 +352,7 @@ def history_fact(marker: str, details: dict, function: str | None = None) -> str
if marker == "code_age_volatility":
return "old code that still changes often"
if marker == "stale_governance":
- return "a decision that covers it is out of date"
+ return "a decision that covers it predates changes to the files it governs"
if marker == "contradictory_decision":
return "decisions that cover it disagree"
return None
diff --git a/packages/core/src/repowise/core/analysis/health/suggestions.py b/packages/core/src/repowise/core/analysis/health/suggestions.py
index 386bca64d..99372556f 100644
--- a/packages/core/src/repowise/core/analysis/health/suggestions.py
+++ b/packages/core/src/repowise/core/analysis/health/suggestions.py
@@ -186,10 +186,10 @@ _TEMPLATES: dict[str, str] = {
"to check against."
),
"stale_governance": (
- "The architectural decision governing this file has gone stale: "
- "the code has changed but the decision hasn't been reviewed. "
- "Update or supersede the decision via `repowise decision edit` "
- "so the rationale reflects the current implementation."
+ "Files governed by this file's architectural decision have changed "
+ "since the decision was recorded. Review it, and if it no longer "
+ "holds, update or supersede it via `repowise decision edit` so the "
+ "rationale reflects the current implementation."
),
"contradictory_decision": (
"Two active decisions make contradictory claims that affect this "
diff --git a/packages/ui/__tests__/health/biomarker-glossary.test.ts b/packages/ui/__tests__/health/biomarker-glossary.test.ts
index eed6d1eb4..9f00e14cd 100644
--- a/packages/ui/__tests__/health/biomarker-glossary.test.ts
+++ b/packages/ui/__tests__/health/biomarker-glossary.test.ts
@@ -16,6 +16,7 @@ import { describe, expect, it } from "vitest";
import {
CATEGORY_CAP,
PERFORMANCE_HOME_BIOMARKERS,
+ biomarkerInfo,
biomarkerLabel,
isKnownBiomarker,
} from "../../src/health/biomarker-glossary.js";
@@ -45,3 +46,9 @@ describe("performance glossary", () => {
expect(missing).toEqual([]);
});
});
+
+describe("stale_governance description", () => {
+ it("claims only what the finding checks, not that anyone confirmed the decision", () => {
+ expect(biomarkerInfo("stale_governance").description).not.toMatch(/confirmed/i);
+ });
+});
diff --git a/packages/ui/src/health/biomarker-glossary.ts b/packages/ui/src/health/biomarker-glossary.ts
index cbc7fd7b2..3b972d1c5 100644
--- a/packages/ui/src/health/biomarker-glossary.ts
+++ b/packages/ui/src/health/biomarker-glossary.ts
@@ -254,7 +254,7 @@ export const BIOMARKER_GLOSSARY: Record<string, BiomarkerInfo> = {
label: BIOMARKER_LABELS.stale_governance,
category: "organizational",
description:
- "The architectural decision governing this file has gone stale — the code has moved on since the decision was last confirmed.",
+ "Files governed by this file's architectural decision have changed since the decision was recorded. The decision may still hold, but it is worth a review.",
},
contradictory_decision: {
label: BIOMARKER_LABELS.contradictory_decision,
diff --git a/tests/unit/health/test_suggestions.py b/tests/unit/health/test_suggestions.py
index 67ceaaf71..d22b29235 100644
--- a/tests/unit/health/test_suggestions.py
+++ b/tests/unit/health/test_suggestions.py
@@ -40,3 +40,18 @@ def test_annotate_finding_adds_suggestion_field():
assert out["biomarker_type"] == "nested_complexity"
assert "suggestion" in out
assert out["suggestion"] == suggestion_for("nested_complexity")
+
+
+def test_stale_governance_suggestion_claims_only_that_files_changed():
+ text = suggestion_for("stale_governance")
+ assert "hasn't been reviewed" not in text
+ assert "changed since the decision was recorded" in text
+
+
+def test_stale_governance_fix_first_fact_claims_only_that_files_changed():
+ from repowise.core.analysis.health.fix_first.text import history_fact
+
+ fact = history_fact("stale_governance", {})
+ assert fact is not None
+ assert "out of date" not in fact
+ assert "predates changes" in fact