Registry: list a domain's scenarios with a version in production

This commit is contained in:
2026-11-22 20:34:38 -06:00
parent e1f388c702
commit ccaa6fca12
2 changed files with 22 additions and 1 deletions
+8
View File
@@ -125,6 +125,14 @@ class ModelRegistry:
def status(self, domain: str, scenario: str, version: str) -> str:
return self._status(self.get(domain, scenario, version))
def in_production(self, domain: str) -> list[str]:
"""The scenarios of `domain` with a version holding the `produccion` alias, by name."""
if domain not in DOMAINS:
raise ValueError(f"dominio desconocido: {domain!r}")
prefix = registered_name(domain, "")
models = self.client.search_registered_models(filter_string=f"name LIKE '{prefix}%'")
return sorted(m.name.removeprefix(prefix) for m in models if PRODUCTION_ALIAS in (m.aliases or {}))
def resolve(self, domain: str, scenario: str, version: str | None = None) -> ResolvedVersion:
"""With no `version`, the one holding the `produccion` alias; with a version, that one, whatever
its status (to test or compare a candidate). The status travels with it: confirming risks only