Control-plane topology
Phase 0 of the AlphaSwarm infra-expansion plan. The single source of truth
for "what services exist, where do they live, what URLs do they
expose" is alphaswarm_platform/configs/deployment/topology.yaml.
Both the AlphaSwarm monolith (alphaswarm/) and the standalone control plane
(alphaswarm_controller/) read from the same YAML through the shared
loader at
alphaswarm_core.topology.load_topology.
Resolution order
- Hardcoded default in
Settings. ALPHASWARM_*environment variable.alphaswarm_platform/configs/deployment/topology.yamlfallback (this layer).
The Phase 0 fallback ONLY fires when an ALPHASWARM_* env var is unset
(checked via Settings.model_fields_set). Operators who explicitly
override an env var keep their override.
URL fallback table
The mapping lives in
alphaswarm/config/topology_fallback.py::URL_FALLBACK_FIELDS.
Each row says: when topology declares endpoints[<endpoint_name>]
on the service whose id is <service_id>, use that URL as the
fallback for the matching Settings field. Adding a new service =
new row in the table + new services: entry in topology.yaml.
Control-plane routes
alphaswarm_controller exposes the topology over HTTP:
| Route | Purpose |
|---|---|
GET /manage/topology | Full snapshot (services + targets). |
GET /manage/topology/services | Filterable service list (?role=, ?cluster=). |
GET /manage/topology/services/{id} | Single descriptor (matched by id or alias). |
GET /manage/topology/services/{id}/endpoint?name= | Resolve a named URL. |
GET /manage/topology/services/{id}/health | Live provider probe. |
GET /manage/topology/targets | List deployment targets. |
POST /manage/topology/reload | Drop the cache and reload from disk (admin:cluster). |
The frontend at /admin/topology renders the topology grouped by role with a "Probe health" button per service.
Adding a new shared service
- Append a
services:entry toalphaswarm_platform/configs/deployment/topology.yamlwithcluster,namespace,protocols, andendpointspopulated. - Add the new
Settingsfield inalphaswarm/config/settings.py(default""). - Add a row to
URL_FALLBACK_FIELDSmapping the newSettingsfield to the topology endpoint name. - Add the namespace to
targets.<env>.servicesso the topology round-trips for that environment. - (Optional) Add a
/cache/<category>populator on theMetadataPrefetcherso the<EntityPicker kind="<category>" />in the frontend has dropdown data.