diff --git a/.github/workflows/dashboard_refresh.yml b/.github/workflows/dashboard_refresh.yml index 9723e5b..7b9fef4 100644 --- a/.github/workflows/dashboard_refresh.yml +++ b/.github/workflows/dashboard_refresh.yml @@ -14,9 +14,10 @@ name: Dashboard Refresh # latest PyPI release) and any dispatch that did not arrive. # - workflow_dispatch: manual. # -# The render is deterministic (the pages have no wall-clock stamp, and -# state.json's `updated` moves only when the feed's content does), so a night -# with no change commits nothing. The runner has no project-repo checkout and uses Brain only for presentation, +# Rendering the same captured inputs is deterministic. Each successful +# collection records its capture time in the orchestration panel; state.json +# `updated` still moves only when the feed content changes. The runner has no +# project-repo checkout and uses Brain only for presentation, # so each instance's conductor survey is carried forward from the committed # dashboard (the last local `bin/pyauto-eyes board`); the open critiques are # read live from a checkout of PyAutoMind (public). The bot commit uses GITHUB_TOKEN, which never diff --git a/eyes/board.py b/eyes/board.py index eb3bd63..7e98fda 100644 --- a/eyes/board.py +++ b/eyes/board.py @@ -83,6 +83,8 @@ class InstanceView: latest: str | None # latest released library version, None if unknown context: context_mod.Context = field(default_factory=context_mod.Context) + captured_at: str | None = None # successful manifest collection, never figure evidence + @property def behind(self) -> bool: return self.freshness.startswith("behind") @@ -132,6 +134,7 @@ def collect( release_lookup=latest_release, context_lookup=None, previous=None, + captured_at=None, ): """Read every instance's manifest (and its latest release, when online). @@ -140,6 +143,7 @@ def collect( CLI); None skips it, carrying forward whatever ``previous`` (the committed dashboard.md text) recorded. """ + capture_time = captured_at or _utc_now() sources = sources or {} before = context_mod.recorded(previous) if previous else {} views = [] @@ -156,7 +160,7 @@ def collect( ctx = context_lookup(inst, checkout, prior) else: ctx = prior or context_mod.Context() - views.append(InstanceView(inst, man, error, latest, ctx)) + views.append(InstanceView(inst, man, error, latest, ctx, capture_time if man else None)) return views @@ -464,7 +468,18 @@ def render_html(views) -> str: if owner_url: work_links.append({"label": ORGAN_ROOT.name, "href": owner_url}) panel = shared.orchestration_panel( - "eyes", "", "", CHECKIN_PROMPT, work_links=work_links, organ="eyes" + "eyes", + "", + "", + CHECKIN_PROMPT, + work_links=work_links, + organ="eyes", + refreshed_at=( + min(v.captured_at for v in views) + if views and all(v.manifest and v.captured_at for v in views) + else None + ), + refresh_url=(owner_url + "/actions/workflows/dashboard_refresh.yml") if owner_url else None, ) rows = [] for v in views: diff --git a/tests/test_board.py b/tests/test_board.py index a3603e5..f4919dd 100644 --- a/tests/test_board.py +++ b/tests/test_board.py @@ -371,3 +371,15 @@ def test_empty_orchestration_reports_unavailable_without_inventing_a_repo(monkey page = board.render_html([]) assert "Work repository unavailable in this snapshot." in page assert "data-orchestration-copy" in page + + +def test_refresh_uses_successful_collection_not_figure_generation(registry_file, project): + instances = registry.load(registry_file) + views = board.collect( + instances, {"demo": project}, offline=True, captured_at="2026-10-07T09:00:00Z" + ) + page = board.render_html(views) + assert 'data-refreshed-at="2026-10-07T09:00:00Z"' in page + assert board.render_html(views) == page + views[0].captured_at = None + assert "Last updated unavailable" in board.render_html(views)