feat(dqo): deploy tip-dqo self-heal orchestrator

- escalation-sink: add NTFY_TOKEN Bearer auth header support
- self-heal-guards: pass max_load from GuardConfig to isLoadAcceptable
- control-loop: include MAX_LOAD in guardConfig so DQO_MAX_LOAD env is respected
This commit is contained in:
root 2026-07-07 09:47:47 +00:00
parent 201f5d3a47
commit 3e0750eb3c
3 changed files with 4 additions and 1 deletions

View File

@ -83,6 +83,7 @@ function guardConfig(t: Target): GuardConfig {
budget_per_day: t.budget_per_day, budget_per_day: t.budget_per_day,
max_backoff_hours: t.max_backoff_hours, max_backoff_hours: t.max_backoff_hours,
circuit_breaker_strikes: t.circuit_breaker_strikes, circuit_breaker_strikes: t.circuit_breaker_strikes,
max_load: MAX_LOAD,
}; };
} }

View File

@ -36,6 +36,7 @@ export async function notify(
Title: title, Title: title,
Priority: level === "page" ? "high" : "default", Priority: level === "page" ? "high" : "default",
Tags: level === "page" ? "rotating_light" : "warning", Tags: level === "page" ? "rotating_light" : "warning",
...(process.env.NTFY_TOKEN ? { Authorization: `Bearer ${process.env.NTFY_TOKEN}` } : {}),
}, },
body, body,
signal: AbortSignal.timeout(10_000), signal: AbortSignal.timeout(10_000),

View File

@ -22,6 +22,7 @@ export interface GuardConfig {
budget_per_day: number; budget_per_day: number;
max_backoff_hours: number; max_backoff_hours: number;
circuit_breaker_strikes: number; circuit_breaker_strikes: number;
max_load?: number;
} }
/** Facts read from the self_heal_dispatch ledger for one source. */ /** Facts read from the self_heal_dispatch ledger for one source. */
@ -118,7 +119,7 @@ export function canDispatch(
budgetOk(facts, cfg), budgetOk(facts, cfg),
minIntervalOk(facts, cfg, now), minIntervalOk(facts, cfg, now),
backoffElapsed(facts, cfg, now), backoffElapsed(facts, cfg, now),
isLoadAcceptable(load1), isLoadAcceptable(load1, cfg.max_load),
]; ];
const failed = checks.find((c) => !c.allow); const failed = checks.find((c) => !c.allow);
return failed ?? { allow: true, reason: "all guardrails passed" }; return failed ?? { allow: true, reason: "all guardrails passed" };