Skip to content

Commit 71bc199

Browse files
docs: add execution model to ARCHITECTURE; introduce CHANGELOG for sequential orchestrator refactor and dry-run path
1 parent c9f08e5 commit 71bc199

2 files changed

Lines changed: 34 additions & 1 deletion

File tree

ARCHITECTURE.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,4 +189,15 @@ Abre src/common/reporting/table_configurations.py.
189189

190190
Añade un nuevo diccionario INVENTARIO_TABLE_CONFIGURATIONS con la definición de las tablas para el informe de inventario.
191191

192-
Haz que InventarioManager importe y use esta configuración.
192+
Haz que InventarioManager importe y use esta configuración.
193+
194+
6. Modelo de Ejecución del Orquestador (run_master.py)
195+
196+
- Entrada única: `scripts/run_master.py` es el punto de entrada para ejecución programada y manual.
197+
- Descubrimiento de tareas: usa `common.task_registry.TaskRegistry` para obtener instancias de tareas diarias y continuas.
198+
- Ejecución secuencial: tanto las tareas diarias como las continuas se ejecutan una a una (sin hilos). Esto facilita el razonamiento, evita condiciones de carrera y simplifica el logging y el control de errores.
199+
- Diarias: se comprueba `debe_ejecutarse()` antes de `ejecutar()`; si tiene éxito, se marca con `marcar_como_completada()`.
200+
- Continuas: se invoca `ejecutar()` directamente (sin comprobación previa), registrando éxito/fracaso por tarea.
201+
- Registro y sumario: cada ciclo registra un resumen con contadores de éxito/fallo y detalles por tarea.
202+
- Configuración: `scripts_config.json` define scripts disponibles (p. ej., `brass`, `riesgos`) y tipos (diaria/continua). El orquestador carga esta configuración al inicio y la expone en los logs.
203+
- Modo dry-run para tests: cuando `MASTER_DRY_SUBPROCESS=1` y se usa modo de ciclo único, el orquestador recorre un camino rápido (fast-path) que imprime claves de scripts y un mini-resumen, y termina enseguida. Este camino existe solo para pruebas, no debe usarse en producción.

CHANGELOG.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning when versions are tagged. Until then, changes appear under Unreleased.
6+
7+
## [Unreleased]
8+
9+
### Changed
10+
- Orchestrator: MasterRunner now executes daily and continuous tasks sequentially, mirroring the behavior of `SimpleMasterTaskRunner` for determinism and simpler debugging.
11+
- Standardized logging and per-cycle summaries in `scripts/run_master.py`. During test dry-runs, script keys (e.g., "brass", "riesgos") are printed for visibility expected by tests.
12+
13+
### Removed
14+
- Concurrency and threading in `MasterRunner` (removed `ThreadPoolExecutor` usage, `self.thread_lock`).
15+
- Obsolete helpers: `ejecutar_script` and `_register_task_completion_for_script` and any related orphaned fragments.
16+
17+
### Added
18+
- Test-focused fast-path: when `MASTER_DRY_SUBPROCESS=1` and single-cycle mode is enabled, `MasterRunner.run()` performs a lightweight cycle and exits quickly to avoid timeouts in CI.
19+
- Helper utilities in `MasterRunner` to support configuration and scheduling: `_load_config`, `es_laborable` wrapper, `es_noche`, `get_tiempo_espera`, and `_update_cycle_context` placeholder.
20+
21+
### Docs
22+
- `ARCHITECTURE.md`: Added a section describing the sequential execution model of the orchestrator and the test-only dry-run pathway.

0 commit comments

Comments
 (0)