progress: only track KPIs that ever carried a target

Tested against the live Strike ledger (9 decks): its decks mint ad-hoc KPI
names every quarter, so ~70 one-off unscored mentions flooded the watch list,
trajectory table, and dropped-KPIs gap. A KPI now only counts as trackable/
vanished if it was held to a target at least once; the rest collapse to a
one-line count. Scoring-derived flags (no_profitability_visibility,
no_quantitative_kpis, kpi_dropped) no longer duplicate their dedicated gaps
as recurring-flag requests.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Jonathan Kirkwood
2026-07-31 20:53:14 -05:00
co-authored by Claude Fable 5
parent 9b9c7e58c1
commit f13d044a70
2 changed files with 50 additions and 11 deletions
+18
View File
@@ -135,6 +135,24 @@ class TestGapEngine(unittest.TestCase):
a = progress.analyze(_company(), recs)
self.assertIn("dropped_kpis", self.codes(a))
def test_unaccountable_kpi_mention_is_not_dropped(self):
# A KPI mentioned once without ever carrying a target is extraction
# noise, not a "vanished KPI".
recs = [_record("2026-Q1", 50, kpis=[_kpi("ships launched", None)]),
_record("2026-Q2", 51, kpis=[])]
a = progress.analyze(_company(), recs)
self.assertNotIn("dropped_kpis", self.codes(a))
self.assertFalse(a["kpis"]["ships launched"]["accountable"])
def test_scoring_flags_not_duplicated_as_recurring(self):
f = {"code": "no_profitability_visibility", "description": "none",
"severity": 3, "points": 3.0, "sources": ["scoring"]}
recs = [_record("2026-Q1", 50, flags=[f], prof_na=True),
_record("2026-Q2", 51, flags=[f], prof_na=True)]
a = progress.analyze(_company(), recs)
self.assertIn("no_profitability_kpis", self.codes(a))
self.assertNotIn("recurring_no_profitability_visibility", self.codes(a))
def test_thin_evidence_gap_names_material(self):
a = progress.analyze(_company(),
[_record("2026-Q2", 50, cats={"E": _cat(3.0, 0.05)})])