Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion heart/dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,8 @@ class Board:
penalties: list[dict] | None = None
vantage: str = "local snapshot"
devbox_observed: str | None = None
# Capture time only; verdict evidence timestamps cannot establish a refresh.
refreshed_at: str | None = None


# --- verdict/state → glyph & colour maps ------------------------------------
Expand Down Expand Up @@ -1114,6 +1116,7 @@ def build_board(
verdict=v,
score=score,
ts=ts,
refreshed_at=snapshot.get("ts"),
age_seconds=age,
stale=stale,
red_reasons=red,
Expand Down Expand Up @@ -2390,7 +2393,10 @@ def _render_html(board: Board) -> str:
panel = t_.orchestration_panel(
"heart", "Fix Heart systematically", "",
(board.fix_plan or build_fix_plan(board))["prompt"],
work_links=work_links, copy_label="Fix Heart systematically", organ="heart")
work_links=work_links, copy_label="Fix Heart systematically", organ="heart",
refreshed_at=board.refreshed_at,
refresh_url=(f"https://github.com/{gh_owner}/{repo_name}/actions/workflows/heart-health.yml"
if gh_owner else None))
return f"""<!doctype html>
<html lang="en"><head><meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
Expand Down
13 changes: 13 additions & 0 deletions tests/test_dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -1836,3 +1836,16 @@ def test_cloud_test_run_renders_failed_counts_and_no_invented_zeros():
section = next(s for s in board.sections if s.key == "test_run")
assert "counts not ingested" in section.summary
assert "0p" not in section.summary


def test_panel_refresh_never_substitutes_verdict_evidence_date(monkeypatch):
theme = dashboard.theme()
calls = []
monkeypatch.setattr(theme, "orchestration_panel", lambda *a, **kw: calls.append(kw) or "")
snap = make_snapshot()
dashboard.render(snap, make_verdict(), fmt="html", now=FRESH_NOW)
assert calls[-1]["refreshed_at"] == snap["ts"]
assert calls[-1]["refresh_url"].endswith("/actions/workflows/heart-health.yml")
snap.pop("ts")
dashboard.render(snap, make_verdict(), fmt="html", now=FRESH_NOW)
assert calls[-1]["refreshed_at"] is None
Loading