From 2c3ce07f5c174e23b70e875b19603201d9c55d53 Mon Sep 17 00:00:00 2001 From: PedroHMCosme Date: Wed, 7 Oct 2026 16:25:30 -0300 Subject: [PATCH] docs: simple metrics parallel windows and adaptive frequency convention (SIENTIAPDE-2193) --- README.md | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/README.md b/README.md index cd37937..5ac0a06 100644 --- a/README.md +++ b/README.md @@ -612,6 +612,35 @@ Temporal input configuration sample: } ``` +#### Simple metrics: parallel windows & adaptive frequency + +One `pipelines` doc per window, all with the same `model_id`. Name them `-simple_metrics-m`; each doc becomes its own Temporal schedule. Thresholds are shared through `model.model_config`. The adaptive state is per doc. + +```json +{ + "schedule_name": "model-x-simple_metrics-60m", + "workflow_type": "simple_metrics", + "model_id": "model-x", + "active": true, + "interval_minutes": 60, + "frequency": "1h", + "frequency_alert": "5m" +} +``` + +| Field | Meaning | Default | +|---|---|---| +| `frequency_alert` | Frequency while escalated, same format as `frequency`. Absent = adaptive mode off. Below `1m` the orchestrator sends one WARNING and keeps the value | — | +| `adaptive_state` | `{escalated, healthy_streak}`, written **only** by laborious (with `updated_at` as a BSON datetime when `escalated` flips) | `{false, 0}` | +| `model.model_config.simple_metrics_thresholds` | `{_max, _min}` shared by all windows | — | +| `model.model_config.simple_metrics_min_samples` | Windows with fewer rows neither alert nor escalate, and count toward recovery | — | + +Rules: +- **Escalation:** laborious escalates on the first breach. +- **Recovery:** after `min(12, ceil(interval_minutes / frequency_alert))` consecutive runs without one. Empty windows count as runs without a breach. +- **Alerts** are per model (trigger `-simple_metrics`), so several windows seeing the same breach produce one alert. +- **Delay:** the schedule switches on the orchestrator tick after laborious flips the state, at most one tick later. + #### Alerts Workflow ```json