absorb Orquestacion into webapi.orquestacion

Orquestacion was a separate uv package with exactly one consumer
(webapi.indicadores_vivos) and no independent deployment: the Dockerfile
already copied it straight into this image and ran one uv sync for
everything. Folding it in removes a redundant pyproject.toml/uv.lock/venv
without losing the standalone CLI (python -m webapi.orquestacion ciclo/
confirmar-riesgos) or its test suite, which now runs as part of this
project's own pytest run.

417 tests pass (416 unchanged + the merged orquestacion suite); verified
live in a built image, where the indicadores worker completed a full
cacu/cama/tea cycle against webapi.orquestacion.ejecutor.
This commit is contained in:
Roberto Treviño Cervantes
2026-10-31 00:51:41 -06:00
parent 2b2c290f58
commit ae1ee4633f
19 changed files with 1422 additions and 33 deletions
+33
View File
@@ -0,0 +1,33 @@
"""Lo que recibe cada paso del ciclo."""
from collections.abc import Mapping
from dataclasses import dataclass, field
from datetime import date
from pathlib import Path
from typing import Any
@dataclass(frozen=True)
class Contexto:
"""Lo que recibe un paso: el proyecto y las opciones del ciclo.
`anio_inicio` y `anio_fin` son los años de los periodos que se registran y
calculan. `corte` es la fecha hasta la que llegan los datos; sin ella, cada
paso del kit toma la de la última carga. `permitir_sin_definir` deja correr
con parámetros que nadie ha decidido: hay que pedirlo a propósito, como en
el kit. `parametros` es el archivo de parámetros que carga `registro`; sin
él, el `parametros.toml` del kit. `repos` es todo lo que el paso usa
para tocar la base: nunca abre una sesión por su cuenta (`repositorios.py`).
"""
proyecto: str
anio_inicio: int
anio_fin: int
corte: date | None = None
permitir_sin_definir: bool = False
parametros: Path | None = None
# Los estimadores de riesgo por cohorte (`cohorte_url` -> objeto con `estimar(columnas, filas)`, `procedencia()`
# y `desenlace`; ADR-MD-008). Sin ellos, el paso `estimar` no hace nada.
estimadores: Mapping[str, Any] = field(default_factory=dict, compare=False, repr=False)
# Los repositorios del proyecto (`repositorios.Repositorios`); el ejecutor los pone si faltan.
repos: Any = field(default=None, compare=False, repr=False)