repo-manager/tests/test_hub_record_authority.py
tegwick ad621d6c0d feat: advance conformance and deterministic ID migration
Assistant: codex
Assistant-Model: gpt-5.6-sol
Assistant-Session: 01a023c0-a0a3-7c03-b395-5a0d2757214d
2026-08-21 22:43:37 +02:00

59 lines
1.5 KiB
Python

from pathlib import Path
import yaml
EXPECTED_STATE_HUB_TABLES = {
"agent_messages",
"capability_catalog",
"capability_requests",
"contributions",
"decisions",
"doi_cache",
"domain_goals",
"domains",
"extension_points",
"fabric_graph_edges",
"fabric_graph_imports",
"fabric_graph_nodes",
"intake_notes",
"intakes",
"interface_changes",
"legacy_interface_usage_buckets",
"legacy_interfaces",
"managed_repos",
"progress_events",
"repo_goals",
"sbom_entries",
"sbom_snapshots",
"service_catalog",
"service_cloud",
"service_first_party",
"service_self_hosted",
"service_third_party",
"suggestion_notes",
"suggestion_relevance_bumps",
"suggestions",
"tasks",
"td_notes",
"technical_debt",
"token_events",
"topics",
"tpsc_catalog",
"tpsc_entries",
"tpsc_snapshots",
"workplan_dependencies",
"workplan_launch_requests",
"workplans",
"write_idempotency_keys",
}
def test_every_state_hub_table_has_one_authority_class() -> None:
path = Path(__file__).parents[1] / "config" / "hub-record-authority.yaml"
document = yaml.safe_load(path.read_text(encoding="utf-8"))
classes = set(document["classes"])
records = document["records"]
assert set(records) == EXPECTED_STATE_HUB_TABLES
assert {record["class"] for record in records.values()} <= classes
assert all(record.get("owner") for record in records.values())