From 81acadec1dcd21bf650cafe399e3eaf04b55f94a Mon Sep 17 00:00:00 2001 From: dtoro Date: Wed, 8 Jul 2026 21:37:31 +0200 Subject: [PATCH] docs: signal trigger architecture sequence diagram + full explanation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add docs/signal-triggers.md covering: - End-to-end sequence diagram (Nomos → API → Scheduler → target host) - Two paths: autonomous collection (scheduler) + query (MCP) - All 6 check kinds and 17 available scripts - Script deployment flow via sync timer - Signal lifecycle, threshold evaluation, data flow through DB tables - Prerequisites for SSH checks in Docker --- docs/signal-triggers.md | 206 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 206 insertions(+) create mode 100644 docs/signal-triggers.md diff --git a/docs/signal-triggers.md b/docs/signal-triggers.md new file mode 100644 index 0000000..63fad64 --- /dev/null +++ b/docs/signal-triggers.md @@ -0,0 +1,206 @@ +# Signal Trigger Architecture + +## Overview + +When Nomos is asked "what are the thermals of hubris?", here is exactly what happens: + +``` +┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ +│ Nomos │ │ Oikos │ │Scheduler │ │ Hubris │ +│ (Agent) │ │ API │ │ (Docker) │ │(Proxmox) │ +└────┬─────┘ └────┬─────┘ └────┬─────┘ └────┬─────┘ + │ │ │ │ + │ query_metrics │ │ │ + │────────────────>│ │ │ + │ │ │ │ + │ ← cpu_pct=2.5 │ SELECT FROM │ │ + │ cpu_temp=48 │ metric_samples│ │ + │<────────────────│ │ │ + │ │ │ │ + │ │ │ │ + ══════ Every 60s (autonomous loop) ══════ │ + │ │ │ │ + │ │ │ SSH exec │ + │ │ │─────────────────>│ + │ │ │ /opt/oikos/ │ + │ │ │ checks/ │ + │ │ │ cpu_check.sh │ + │ │ │ │ + │ │ │ {"health":"ok", │ + │ │ │ "metrics": │ + │ │ │ {"cpu_pct":2.5, │ + │ │ │ "cpu_temp":48}}│ + │ │ │<─────────────────│ + │ │ │ │ + │ │ │ INSERT │ + │ │ │ metric_samples │ + │ │ │ │ + │ │ │ UPSERT signal │ + │ │ │ (dedup) │ + │ │ │ │ +``` + +## Two Paths + +### Path A — Autonomous Collection (Scheduler) + +1. Operator creates a check via REST API: `POST /api/v1/checks` +2. Scheduler loads enabled checks every 30s from `check_defs` table +3. For `ssh-script` checks, scheduler SSHs to target host and runs `/opt/oikos/checks/