fix Fabric authority import compatibility
All checks were successful
CI Smoke / host-smoke (push) Successful in 0s
CI Smoke / container-smoke (push) Successful in 1s
Build and Publish Multi-Context Image / build-and-push (push) Successful in 21s

Assistant: codex
Assistant-Model: gpt-5.6-sol
Assistant-Session: 01a053ff-1d6f-7fe2-ac1c-a6eb40a42a0c
This commit is contained in:
tegwick 2026-08-31 23:00:39 +02:00
parent 903a2fb090
commit cf40c7bb4e
5 changed files with 87 additions and 4 deletions

View file

@ -1291,7 +1291,8 @@ def _financial_fabric_graph_export(generated_at="2026-05-24T00:00:00Z"):
"source": {
"producer": "railiance-fabric",
"registry": "registry",
"commit": "financial-example",
"commit": "snapshot-set:sha256:" + ("a" * 64),
"path": "registry://accepted-snapshots",
"generation_reason": "operator_refresh",
},
"compatibility": {
@ -1373,6 +1374,11 @@ def _financial_fabric_graph_export(generated_at="2026-05-24T00:00:00Z"):
"cost_center_id": "cc.platform.shared",
"allocation_model": "direct",
},
"deployment_overlay": {
"deployment_environment": "local",
"routing_authority": "ops-hub",
"route_evidence": {"observed": True, "port": 8000},
},
"evidence": {
"state": "declared",
"review_state": "accepted",
@ -1581,6 +1587,8 @@ class TestFabricGraphReadModel:
body = r.json()
assert body["import_run"]["api_version"] == "railiance.fabric/v1alpha2"
assert body["import_run"]["schema_version"] == "financial-fabric-v1"
assert body["import_run"]["source_commit"] == "snapshot-set:sha256:" + ("a" * 64)
assert body["import_run"]["source_path"] == "registry://accepted-snapshots"
assert body["import_run"]["netkingdom_id"] == "railiance.netkingdom"
assert body["import_run"]["actor_count"] == 3
assert body["import_run"]["fabric_count"] == 2
@ -1646,6 +1654,19 @@ class TestFabricGraphReadModel:
r = await client.get("/fabric/graph/nodes")
assert r.status_code == 404
async def test_invalid_export_with_oversized_revision_is_recorded_not_500(self, client):
payload = _financial_fabric_graph_export()
payload["source"]["commit"] = "x" * 300
r = await client.post("/fabric/graph-exports", json=payload)
assert r.status_code == 422, r.text
import_id = r.json()["detail"]["import_id"]
r = await client.get("/fabric/graph-exports?validation_status=invalid")
invalid = next(item for item in r.json() if item["id"] == import_id)
assert invalid["source_commit"] == "x" * 255
assert "at most 255 characters" in invalid["error_details"]["error"]
async def test_legacy_fabric_exports_remain_compatible_with_null_financial_fields(self, client):
r = await client.post("/fabric/graph-exports", json=_fabric_graph_export())
assert r.status_code == 200, r.text