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): record no hotspots as null in the trend, not 10.0 (#3684)

Swati Ahujab26320ad8fbf
diff --git a/packages/cli/src/repowise/cli/commands/health_cmd/trends.py b/packages/cli/src/repowise/cli/commands/health_cmd/trends.py
index 8860d02a3..ed33893ab 100644
--- a/packages/cli/src/repowise/cli/commands/health_cmd/trends.py
+++ b/packages/cli/src/repowise/cli/commands/health_cmd/trends.py
@@ -92,7 +92,7 @@ def _render_trend(repo_path: object, *, fmt: str) -> None:
for r in rows:
table.add_row(
(r["taken_at"] or "—")[:19],
- f"{r['hotspot_health']:.2f}",
+ f"{r['hotspot_health']:.2f}" if r["hotspot_health"] is not None else "—",
f"{r['average_health']:.2f}",
f"{r['worst_performer_score']:.2f}" if r["worst_performer_score"] is not None else "—",
r["worst_performer_path"] or "—",
diff --git a/packages/core/alembic/versions/0108_health_snapshot_hotspot_nullable.py b/packages/core/alembic/versions/0108_health_snapshot_hotspot_nullable.py
new file mode 100644
index 000000000..bbc391f63
--- /dev/null
+++ b/packages/core/alembic/versions/0108_health_snapshot_hotspot_nullable.py
@@ -0,0 +1,39 @@
+"""Allow ``health_snapshots.hotspot_health`` to be NULL (PostgreSQL only).
+
+A repository with no scored hotspot file has no hotspot health, so its
+snapshot now stores NULL instead of a 10.0 that reads as perfect hotspots.
+
+Local SQLite stores never run Alembic; ``init_db`` rebuilds that table there
+when the column is still NOT NULL, and new stores get it from the model.
+
+Revision ID: 0108
+Revises: 0107
+Create Date: 2026-10-14
+"""
+
+from __future__ import annotations
+
+from collections.abc import Sequence
+
+import sqlalchemy as sa
+from alembic import op
+
+# revision identifiers
+revision: str = "0108"
+down_revision: str | None = "0107"
+branch_labels: str | Sequence[str] | None = None
+depends_on: str | Sequence[str] | None = None
+
+
+def upgrade() -> None:
+ if op.get_bind().dialect.name != "postgresql":
+ return
+ op.alter_column("health_snapshots", "hotspot_health", existing_type=sa.Float(), nullable=True)
+
+
+def downgrade() -> None:
+ """Restore NOT NULL with the value the old schema wrote for such snapshots."""
+ if op.get_bind().dialect.name != "postgresql":
+ return
+ op.execute("UPDATE health_snapshots SET hotspot_health = 10.0 WHERE hotspot_health IS NULL")
+ op.alter_column("health_snapshots", "hotspot_health", existing_type=sa.Float(), nullable=False)
diff --git a/packages/core/src/repowise/core/analysis/health/scoring.py b/packages/core/src/repowise/core/analysis/health/scoring.py
index 04ef1f20b..c9be51d9c 100644
--- a/packages/core/src/repowise/core/analysis/health/scoring.py
+++ b/packages/core/src/repowise/core/analysis/health/scoring.py
@@ -926,8 +926,8 @@ def hotspot_health(
and not a failure — a repo with no recent churn has nothing to be a hotspot.
It is kept distinct from a low score on purpose: averaging an empty set
yields 10.0, and reporting that would tell a user their hotspots are perfect
- when they have none. :func:`compute_kpis` still floors it to 10.0 for the
- persisted KPI, and says why there.
+ when they have none. :func:`compute_kpis` and the persisted snapshot carry
+ the ``None`` through unchanged.
"""
rows = [m for m in scored_rows(metrics) if field(m, "file_path") in hotspot_paths]
if not rows:
@@ -978,7 +978,8 @@ def compute_kpis(
) -> dict[str, object]:
"""Repo-level KPIs derived from per-file metrics.
- - ``hotspot_health``: NLOC-weighted average over files in *hotspot_paths*.
+ - ``hotspot_health``: NLOC-weighted average over files in *hotspot_paths*,
+ ``None`` when the repo has no scored hotspot file.
- ``average_health``: NLOC-weighted average over all files.
- ``worst_performer``: the worst file in Fix first's scope + score, and
``worst_test_performer`` the worst test, as ``ranking.worst_in_scope``
@@ -1026,14 +1027,8 @@ def compute_kpis(
for half in ("structure", "history")
for scope, rows in (("average", metrics), ("hotspot", hotspots))
}
- # Floored to 10.0 when the repo has no hotspot files, because this dict is
- # what ``save_health_snapshot`` persists into a non-nullable column and what
- # the trend alerts diff against. The floor lives here, at the one point that
- # needs it, rather than inside the arithmetic — surfaces that can say "no
- # hotspots" out loud read ``hotspot_health()`` and get ``None``.
- hotspot_kpi = hotspot_health(metrics, hotspot_paths)
return {
- "hotspot_health": hotspot_kpi if hotspot_kpi is not None else 10.0,
+ "hotspot_health": hotspot_health(metrics, hotspot_paths),
"average_health": round(nloc_weighted_score(metrics), 2),
**worst_kpis(metrics, deductions or {}),
"file_count": len(metrics),
diff --git a/packages/core/src/repowise/core/analysis/health/trends.py b/packages/core/src/repowise/core/analysis/health/trends.py
index 2650c18db..7a7093a12 100644
--- a/packages/core/src/repowise/core/analysis/health/trends.py
+++ b/packages/core/src/repowise/core/analysis/health/trends.py
@@ -86,7 +86,8 @@ class TrendAlert:
class TrendSummary:
"""Lightweight diff between the newest snapshot and the prior window."""
- current_hotspot_health: float
+ # ``None`` on a snapshot whose repo had no scored hotspot file.
+ current_hotspot_health: float | None
current_average_health: float
previous_hotspot_health: float | None
previous_average_health: float | None
@@ -158,7 +159,7 @@ class _ScopedSnapshot:
taken_at: Any
average_health: float
per_file_scores_json: str
- hotspot_health: float = 0.0
+ hotspot_health: float | None = None
worst_performer_path: str | None = None
worst_performer_score: float | None = None
structure_average: float | None = None
@@ -211,14 +212,15 @@ def diff_snapshots(history: list[Any]) -> TrendSummary:
current = history[-1]
prior = history[-2] if len(history) >= 2 else None
+ current_hotspot = _metric_value(current, "hotspot_health")
+ previous_hotspot = _metric_value(prior, "hotspot_health") if prior else None
summary = TrendSummary(
- current_hotspot_health=float(current.hotspot_health),
+ current_hotspot_health=current_hotspot,
current_average_health=float(current.average_health),
- previous_hotspot_health=float(prior.hotspot_health) if prior else None,
+ previous_hotspot_health=previous_hotspot,
previous_average_health=float(prior.average_health) if prior else None,
- hotspot_delta=_delta(
- float(current.hotspot_health),
- float(prior.hotspot_health) if prior else None,
+ hotspot_delta=(
+ _delta(current_hotspot, previous_hotspot) if current_hotspot is not None else None
),
average_delta=_delta(
float(current.average_health),
@@ -238,12 +240,17 @@ def hotspot_trend(history: list[Any]) -> str | None:
Compared over the same window the declining alert uses, so the two never
disagree. ``None`` with fewer than two snapshots: one reading is not a
- trend, and a surface should say nothing rather than print "stable".
+ trend, and a surface should say nothing rather than print "stable". Also
+ ``None`` when either end recorded no hotspot figure.
"""
if len(history) < 2:
return None
baseline = history[max(0, len(history) - 1 - DECLINE_LOOKBACK)]
- delta = float(history[-1].hotspot_health) - float(baseline.hotspot_health)
+ current = _metric_value(history[-1], "hotspot_health")
+ base = _metric_value(baseline, "hotspot_health")
+ if current is None or base is None:
+ return None
+ delta = current - base
if delta <= -DECLINE_THRESHOLD:
return "declining"
if delta >= DECLINE_THRESHOLD:
@@ -427,7 +434,7 @@ def recent_kpis(
rows.append(
{
"taken_at": snap.taken_at.isoformat() if snap.taken_at else None,
- "hotspot_health": round(float(snap.hotspot_health), 2),
+ "hotspot_health": _point(snap, "hotspot_health"),
"average_health": round(float(snap.average_health), 2),
"worst_performer_path": snap.worst_performer_path,
"worst_performer_score": (
@@ -526,7 +533,7 @@ def snapshot_fields(
return None
scores_map, deductions_map = snapshot_file_maps(metrics, findings)
return {
- "hotspot_health": float(kpis.get("hotspot_health", SCORE_MAX)),
+ "hotspot_health": kpis.get("hotspot_health"),
"average_health": float(kpis.get("average_health", SCORE_MAX)),
"worst_performer_path": kpis.get("worst_performer_path"),
"worst_performer_score": kpis.get("worst_performer_score"),
diff --git a/packages/core/src/repowise/core/persistence/_interfaces/_analysis.py b/packages/core/src/repowise/core/persistence/_interfaces/_analysis.py
index 257d279db..5438d46eb 100644
--- a/packages/core/src/repowise/core/persistence/_interfaces/_analysis.py
+++ b/packages/core/src/repowise/core/persistence/_interfaces/_analysis.py
@@ -219,7 +219,7 @@ class AnalysisIndexStore(ABC):
self,
repository_id: str,
*,
- hotspot_health: float,
+ hotspot_health: float | None,
average_health: float,
worst_performer_path: str | None,
worst_performer_score: float | None,
diff --git a/packages/core/src/repowise/core/persistence/crud/analysis/health.py b/packages/core/src/repowise/core/persistence/crud/analysis/health.py
index 3046388ca..db1a498a9 100644
--- a/packages/core/src/repowise/core/persistence/crud/analysis/health.py
+++ b/packages/core/src/repowise/core/persistence/crud/analysis/health.py
@@ -966,7 +966,7 @@ async def save_health_snapshot(
session: AsyncSession,
repository_id: str,
*,
- hotspot_health: float,
+ hotspot_health: float | None,
average_health: float,
worst_performer_path: str | None,
worst_performer_score: float | None,
@@ -1000,7 +1000,7 @@ async def save_health_snapshot(
id=_new_uuid(),
repository_id=repository_id,
taken_at=taken_at or _now_utc(),
- hotspot_health=float(hotspot_health),
+ hotspot_health=float(hotspot_health) if hotspot_health is not None else None,
average_health=float(average_health),
worst_performer_path=worst_performer_path,
worst_performer_score=(
@@ -1071,7 +1071,7 @@ class HealthSnapshotScalars(NamedTuple):
taken_at: datetime | None
average_health: float
- hotspot_health: float
+ hotspot_health: float | None
class HealthSnapshotHeadline(NamedTuple):
@@ -1128,11 +1128,11 @@ async def get_health_snapshot_headline(
hotspot_health, taken_at, _ = rows[-1]
window = rows[-recent:] if recent > 0 else []
return HealthSnapshotHeadline(
- float(hotspot_health),
+ hotspot_health,
taken_at,
len(rows),
tuple(
- HealthSnapshotScalars(r_taken_at, float(r_avg), float(r_hotspot))
+ HealthSnapshotScalars(r_taken_at, float(r_avg), r_hotspot)
for r_hotspot, r_taken_at, r_avg in window
),
)
diff --git a/packages/core/src/repowise/core/persistence/database.py b/packages/core/src/repowise/core/persistence/database.py
index 811cc191c..5d7af1952 100644
--- a/packages/core/src/repowise/core/persistence/database.py
+++ b/packages/core/src/repowise/core/persistence/database.py
@@ -450,7 +450,11 @@ def _run_data_step(step: Callable[[object], object], connection: object) -> None
#: additive reconciler below never does. Leaf tables only, since nothing may
#: reference a table that is copied, dropped and renamed. Each holds derived
#: rows, so an interrupted rebuild costs a recompute, never source data.
-_SQLITE_REBUILD_FOR_NULLABLE: frozenset[str] = frozenset({"health_file_metrics"})
+#: ``health_snapshots`` is history rather than derived, but small, and an
+#: interrupted rebuild leaves its rows in the staging table.
+_SQLITE_REBUILD_FOR_NULLABLE: frozenset[str] = frozenset(
+ {"health_file_metrics", "health_snapshots"}
+)
def _relax_not_null(connection: object, table: object) -> None:
@@ -497,8 +501,8 @@ def _loosen_postgres_columns(table: object, live: dict[str, dict], dialect: obje
Only ever loosens: drops a NOT NULL the model no longer declares and widens
a VARCHAR the model made longer or unbounded. Both are catalog-only changes
- on PostgreSQL and match what migrations 0062, 0064, 0086 and 0094 do, so a
- database that never ran Alembic (the Docker image's path) still accepts
+ on PostgreSQL and match what migrations 0062, 0064, 0086, 0094 and 0108 do,
+ so a database that never ran Alembic (the Docker image's path) still accepts
what the current code writes. Tightening stays an explicit migration.
"""
statements = []
diff --git a/packages/core/src/repowise/core/persistence/models.py b/packages/core/src/repowise/core/persistence/models.py
index d5ca55a7b..e50e6db67 100644
--- a/packages/core/src/repowise/core/persistence/models.py
+++ b/packages/core/src/repowise/core/persistence/models.py
@@ -2374,7 +2374,9 @@ class HealthSnapshot(Base):
taken_at: Mapped[datetime] = mapped_column(
DateTime(timezone=True), nullable=False, default=_now_utc
)
- hotspot_health: Mapped[float] = mapped_column(Float, nullable=False, default=10.0)
+ # NULL when the repo had no scored hotspot file: averaging an empty set
+ # would read as perfect hotspots. Snapshots before migration 0108 hold 10.0.
+ hotspot_health: Mapped[float | None] = mapped_column(Float, nullable=True)
average_health: Mapped[float] = mapped_column(Float, nullable=False, default=10.0)
worst_performer_path: Mapped[str | None] = mapped_column(Text, nullable=True)
worst_performer_score: Mapped[float | None] = mapped_column(Float, nullable=True)
diff --git a/packages/core/src/repowise/core/persistence/stores/_sql_analysis.py b/packages/core/src/repowise/core/persistence/stores/_sql_analysis.py
index f6254d7e5..7a52eb6c7 100644
--- a/packages/core/src/repowise/core/persistence/stores/_sql_analysis.py
+++ b/packages/core/src/repowise/core/persistence/stores/_sql_analysis.py
@@ -256,7 +256,7 @@ class _SqlAnalysisMixin(AnalysisIndexStore):
self,
repository_id: str,
*,
- hotspot_health: float,
+ hotspot_health: float | None,
average_health: float,
worst_performer_path: str | None,
worst_performer_score: float | None,
diff --git a/packages/server/src/repowise/server/routers/overview.py b/packages/server/src/repowise/server/routers/overview.py
index a6250ef5c..21b68300e 100644
--- a/packages/server/src/repowise/server/routers/overview.py
+++ b/packages/server/src/repowise/server/routers/overview.py
@@ -317,7 +317,8 @@ async def overview_summary(
if len(snapshot.recent) >= 2:
prev, cur = snapshot.recent[-2], snapshot.recent[-1]
deltas["average_health"] = round(cur.average_health - prev.average_health, 2)
- deltas["hotspot_health"] = round(cur.hotspot_health - prev.hotspot_health, 2)
+ if cur.hotspot_health is not None and prev.hotspot_health is not None:
+ deltas["hotspot_health"] = round(cur.hotspot_health - prev.hotspot_health, 2)
file_counts = await crud.get_health_snapshot_file_counts(session, repo_id, limit=2)
if len(file_counts) == 2 and all(file_counts):
deltas["file_count"] = file_counts[1] - file_counts[0]
@@ -539,7 +540,9 @@ async def overview_summary(
{
"taken_at": s.taken_at.isoformat() if s.taken_at else None,
"average_health": round(s.average_health, 2),
- "hotspot_health": round(s.hotspot_health, 2),
+ "hotspot_health": (
+ round(s.hotspot_health, 2) if s.hotspot_health is not None else None
+ ),
}
for s in snapshot.recent
],
diff --git a/packages/types/src/overview.ts b/packages/types/src/overview.ts
index ff9659a4c..72579b0b4 100644
--- a/packages/types/src/overview.ts
+++ b/packages/types/src/overview.ts
@@ -72,7 +72,8 @@ export interface OverviewStats {
export interface OverviewHealthHistoryPoint {
taken_at: string | null;
average_health: number;
- hotspot_health: number;
+ /** Null on a snapshot whose repo had no scored hotspot file. */
+ hotspot_health: number | null;
}
export interface OverviewHealth {
diff --git a/packages/ui/src/dashboard/health-overview-card.tsx b/packages/ui/src/dashboard/health-overview-card.tsx
index e2268ddf8..88c711a99 100644
--- a/packages/ui/src/dashboard/health-overview-card.tsx
+++ b/packages/ui/src/dashboard/health-overview-card.tsx
@@ -21,7 +21,7 @@ import { Sparkline } from "../health/sparkline";
export interface HealthOverviewPoint {
taken_at: string | null;
average_health: number;
- hotspot_health: number;
+ hotspot_health: number | null;
}
export interface HealthOverviewData {
@@ -255,7 +255,10 @@ export function HealthOverviewCard({
const avg = data.average_health;
const hot = data.hotspot_health;
const avgSeries = data.history.map((p) => p.average_health);
- const hotSeries = data.history.map((p) => p.hotspot_health);
+ // A snapshot with no hotspot figure is dropped rather than plotted at zero.
+ const hotSeries = data.history
+ .map((p) => p.hotspot_health)
+ .filter((v): v is number => v !== null);
const severities = SEVERITY_ORDER.map((key) => ({
key,
diff --git a/tests/unit/health/test_hotspot_health.py b/tests/unit/health/test_hotspot_health.py
index cee040d05..850582426 100644
--- a/tests/unit/health/test_hotspot_health.py
+++ b/tests/unit/health/test_hotspot_health.py
@@ -76,17 +76,14 @@ def test_nloc_floor_keeps_a_zero_nloc_file_from_vanishing() -> None:
assert hotspot_health(rows, {"empty.py", "real.py"}) == 5.0
-def test_compute_kpis_floors_the_persisted_kpi_to_ten() -> None:
- """The persisted contract is unchanged: a float, 10.0 when no hotspots.
+def test_compute_kpis_keeps_no_hotspots_as_none() -> None:
+ """The persisted KPI says "no hotspots" the way the dashboard does.
- ``save_health_snapshot`` writes this into a non-nullable column and the
- trend alerts diff against it, so ``None`` must not reach it. The honest
- ``None`` is what ``hotspot_health`` returns to surfaces that can render it.
+ It used to be floored to 10.0 for the snapshot, so the trend reported
+ perfect hotspots on repos the overview said had none.
"""
rows = [_Metric("a.py", 4.0, 100)]
- kpis = compute_kpis(rows, set())
- assert kpis["hotspot_health"] == 10.0
- assert hotspot_health(rows, set()) is None
+ assert compute_kpis(rows, set())["hotspot_health"] is None
def test_compute_kpis_hotspot_health_matches_the_shared_owner() -> None:
diff --git a/tests/unit/health/test_hotspot_trend.py b/tests/unit/health/test_hotspot_trend.py
index f30b3f450..81595416e 100644
--- a/tests/unit/health/test_hotspot_trend.py
+++ b/tests/unit/health/test_hotspot_trend.py
@@ -21,6 +21,13 @@ def _history(*values: float) -> list[SimpleNamespace]:
return [SimpleNamespace(hotspot_health=v, average_health=v) for v in values]
+def test_a_snapshot_with_no_hotspot_figure_is_no_trend() -> None:
+ assert hotspot_trend(_history(7.0, 7.0)) == "stable"
+ history = _history(7.0, 7.0)
+ history[0].hotspot_health = None
+ assert hotspot_trend(history) is None
+
+
def test_fewer_than_two_snapshots_is_no_trend() -> None:
assert hotspot_trend([]) is None
assert hotspot_trend(_history(7.0)) is None
diff --git a/tests/unit/health/test_trends.py b/tests/unit/health/test_trends.py
index 86c83cc03..be703fa34 100644
--- a/tests/unit/health/test_trends.py
+++ b/tests/unit/health/test_trends.py
@@ -15,6 +15,7 @@ from repowise.core.analysis.health.trends import (
file_score_series,
file_trend,
recent_kpis,
+ snapshot_fields,
snapshot_file_maps,
)
@@ -22,7 +23,7 @@ from repowise.core.analysis.health.trends import (
@dataclass
class _S:
taken_at: datetime
- hotspot_health: float
+ hotspot_health: float | None
average_health: float
worst_performer_path: str | None = "x"
worst_performer_score: float | None = 1.0
@@ -55,6 +56,36 @@ def test_diff_single_snapshot_no_alerts():
assert summary.alerts == []
+def test_a_repo_with_no_hotspots_trends_as_none_not_ten():
+ """A snapshot with no hotspot figure reads as null, never a perfect 10.0."""
+ snaps = [
+ _S(taken_at=_ts(i), hotspot_health=None, average_health=7.0 - 0.1 * i) for i in range(7)
+ ]
+ summary = diff_snapshots(snaps)
+ assert summary.current_hotspot_health is None
+ assert summary.previous_hotspot_health is None
+ assert summary.hotspot_delta is None
+ assert {a.metric for a in summary.alerts} == {"average_health"}
+ assert [r["hotspot_health"] for r in recent_kpis(snaps)] == [None] * 7
+
+
+def test_a_hotspot_figure_appearing_has_no_delta():
+ summary = diff_snapshots(
+ [
+ _S(taken_at=_ts(0), hotspot_health=None, average_health=7.0),
+ _S(taken_at=_ts(1), hotspot_health=6.0, average_health=7.0),
+ ]
+ )
+ assert summary.current_hotspot_health == 6.0
+ assert summary.previous_hotspot_health is None
+ assert summary.hotspot_delta is None
+
+
+def test_snapshot_fields_records_no_hotspots_as_none():
+ kpis = {"hotspot_health": None, "average_health": 7.0}
+ assert snapshot_fields(kpis, [], [])["hotspot_health"] is None
+
+
def test_declining_health_alert_triggers_at_threshold():
# 7 snapshots: oldest 8.0, newest 8.0 - threshold - 0.1
vals = [8.0, 8.0, 8.0, 8.0, 8.0, 8.0, 8.0 - DECLINE_THRESHOLD - 0.1]
diff --git a/tests/unit/persistence/test_health_metric_nullable_rebuild.py b/tests/unit/persistence/test_health_metric_nullable_rebuild.py
index 5b99ccc9c..e0bab23cf 100644
--- a/tests/unit/persistence/test_health_metric_nullable_rebuild.py
+++ b/tests/unit/persistence/test_health_metric_nullable_rebuild.py
@@ -7,6 +7,8 @@ health has no dialect for, and the whole metrics write would fail.
from __future__ import annotations
+from datetime import UTC, datetime
+
from sqlalchemy import text
from repowise.core.analysis.health.models import HealthFileMetricData
@@ -119,3 +121,41 @@ async def test_the_badge_says_no_data_when_no_file_is_scored(async_session):
assert await _badge_average_health(async_session, repo.id) == (None, 0.0)
await save_health_metrics(async_session, repo.id, [_row("Big.ex", None), _row("a.py", 8.0)])
assert await _badge_average_health(async_session, repo.id) == (8.0, 0.5)
+
+
+async def test_a_not_null_snapshot_store_is_rebuilt_and_keeps_its_history(
+ async_engine, async_session
+):
+ """Snapshot history survives the rebuild that lets "no hotspots" be NULL."""
+ from repowise.core.persistence.crud import list_health_snapshots, save_health_snapshot
+
+ def _snap(repo_id: str, hotspot: float | None, day: int):
+ return save_health_snapshot(
+ async_session,
+ repo_id,
+ hotspot_health=hotspot,
+ average_health=7.0,
+ worst_performer_path=None,
+ worst_performer_score=None,
+ taken_at=datetime(2026, 1, day, tzinfo=UTC),
+ )
+
+ ddl = (
+ await async_session.execute(
+ text("SELECT sql FROM sqlite_master WHERE name = 'health_snapshots'")
+ )
+ ).scalar_one()
+ assert "\thotspot_health FLOAT," in ddl
+ ddl = ddl.replace("\thotspot_health FLOAT,", "\thotspot_health FLOAT NOT NULL,")
+ await async_session.execute(text("DROP TABLE health_snapshots"))
+ await async_session.execute(text(ddl))
+ repo = await insert_repo(async_session)
+ await _snap(repo.id, 6.5, 1)
+ await async_session.commit()
+
+ await init_db(async_engine)
+
+ await _snap(repo.id, None, 2)
+ await async_session.commit()
+ history = await list_health_snapshots(async_session, repo.id)
+ assert [s.hotspot_health for s in history] == [6.5, None]
diff --git a/tests/unit/test_no_hotspot_health_copies.py b/tests/unit/test_no_hotspot_health_copies.py
index ed3526bca..4b0613682 100644
--- a/tests/unit/test_no_hotspot_health_copies.py
+++ b/tests/unit/test_no_hotspot_health_copies.py
@@ -47,6 +47,7 @@ _PLUMBING: dict[str, str] = {
"repowise/server/schemas/repository.py": "the response field",
"repowise/server/schemas/code_health.py": "the trend response fields",
"alembic/versions/0019_code_health.py": "the migration that adds the column",
+ "alembic/versions/0108_health_snapshot_hotspot_nullable.py": "the migration that allows NULL",
# --- trend surfaces: diff recorded snapshots, no current value -----------
"repowise/core/analysis/health/trends.py": (
"diffs snapshots and builds the snapshot writers' arguments; owns no current value"