feat: publish authoritative fabric cutover export
Assistant: codex Assistant-Model: gpt-5.6-sol Assistant-Session: 01a053ff-1d6f-7fe2-ac1c-a6eb40a42a0c
This commit is contained in:
parent
7745a965f6
commit
113445def9
5 changed files with 112 additions and 6 deletions
|
|
@ -26,6 +26,22 @@ from .registry import (
|
|||
)
|
||||
|
||||
|
||||
def _graph_summary(graph: dict[str, Any]) -> dict[str, Any]:
|
||||
source = graph.get("source") if isinstance(graph.get("source"), dict) else {}
|
||||
return {
|
||||
"apiVersion": graph.get("apiVersion"),
|
||||
"kind": graph.get("kind"),
|
||||
"schema_version": graph.get("schema_version"),
|
||||
"generated_at": graph.get("generated_at"),
|
||||
"source": source,
|
||||
"node_count": len(graph.get("nodes", [])),
|
||||
"edge_count": len(graph.get("edges", [])),
|
||||
"actor_count": len(graph.get("actors", [])),
|
||||
"fabric_count": len(graph.get("fabrics", [])),
|
||||
"unresolved_count": len(graph.get("unresolved", [])),
|
||||
}
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class HtmlResponse:
|
||||
body: str
|
||||
|
|
@ -93,6 +109,10 @@ class RegistryHandler(BaseHTTPRequestHandler):
|
|||
return HTTPStatus.OK, self.store.search(_query_one(query, "q"))
|
||||
if parts == ["graph", "nodes"]:
|
||||
return HTTPStatus.OK, self.store.combined_graph()["nodes"]
|
||||
if parts == ["graph", "edges"]:
|
||||
return HTTPStatus.OK, self.store.combined_graph()["edges"]
|
||||
if parts == ["graph", "summary"]:
|
||||
return HTTPStatus.OK, _graph_summary(self.store.combined_graph())
|
||||
if len(parts) == 3 and parts[0] == "graph" and parts[1] == "nodes":
|
||||
return HTTPStatus.OK, self.store.graph_node_detail(parts[2])
|
||||
if parts == ["graph", "providers"]:
|
||||
|
|
@ -107,6 +127,8 @@ class RegistryHandler(BaseHTTPRequestHandler):
|
|||
return HTTPStatus.OK, {"lines": dependency_path_lines(self.store.combined_graph(), _query_one(query, "service_id"))}
|
||||
if parts == ["exports", "state-hub"]:
|
||||
return HTTPStatus.OK, self.store.combined_graph()
|
||||
if parts == ["exports", "financial"]:
|
||||
return HTTPStatus.OK, self.store.financial_graph()
|
||||
if parts == ["exports", "reset-archive"]:
|
||||
return HTTPStatus.OK, self.store.reset_archive()
|
||||
if parts == ["exports", "backstage"]:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue