From 055cf4980c3d48d932e3bae07caf897a167524d5 Mon Sep 17 00:00:00 2001 From: tegwick Date: Fri, 21 Aug 2026 19:10:11 +0200 Subject: [PATCH] fix: preserve logical projection provenance --- hub_core/runtime/postgres_store.py | 10 ++++++---- tests/test_postgres_store.py | 3 +++ 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/hub_core/runtime/postgres_store.py b/hub_core/runtime/postgres_store.py index d58d2bd..b2b6403 100644 --- a/hub_core/runtime/postgres_store.py +++ b/hub_core/runtime/postgres_store.py @@ -323,8 +323,10 @@ def _now() -> datetime: def _rebuild_sources(projection_id: str) -> list[str]: return { - "hub_registry": ["runtime_registrations"], - "messages": ["runtime_messages"], - "progress_events": ["runtime_progress_events"], - "interaction_events": ["runtime_interaction_events"], + # Provenance names are logical authority collections in the extension + # contract, not backend-specific SQL table names. + "hub_registry": ["hub_descriptors", "hub_manifests"], + "messages": ["messages"], + "progress_events": ["progress_events"], + "interaction_events": ["interaction_events"], }[projection_id] diff --git a/tests/test_postgres_store.py b/tests/test_postgres_store.py index ba2854c..7da15ed 100644 --- a/tests/test_postgres_store.py +++ b/tests/test_postgres_store.py @@ -64,6 +64,9 @@ def test_durable_store_survives_reopen_and_keeps_event_families_separate(tmp_pat assert {item["family"] for item in progress["data"]["items"]} == {"progress"} assert {item["family"] for item in interaction["data"]["items"]} == {"interaction"} assert progress["provenance"]["source_system"] == "hub-core-postgresql" + assert registry["data"]["rebuild_from"] == ["hub_descriptors", "hub_manifests"] + assert progress["data"]["rebuild_from"] == ["progress_events"] + assert interaction["data"]["rebuild_from"] == ["interaction_events"] async def audit_count() -> int: async with second_store.sessions() as session: