/** * Operational signals derived from `VaultState` v0.6+ flags. * * These are NOT inputs to the calibrated 14-factor weighted risk score in * `src/utils/risk-scoring.ts` — adding a 15th factor would force a weight * reallocation and invalidate test calibration. Instead, signals: * * 1. Are surfaced as a separate output block (`operationalSignals[]`). * 2. Apply a *risk-level floor* on the bucket (Critical/High/Medium/Low), * following the same pattern as `CRITICAL_FACTOR_THRESHOLD` in * `calculateOverallRisk` — the numeric score is unchanged, only the * bucket can move up. * * Recomputed on every `analyze_risk` call (no separate cache horizon) — they * derive from already-cached vault state, so the cost is negligible, and a * `stale_total_assets` signal would silently expire if we cached it. */ export type OperationalSignalCode = 'paused' | 'safe_unlocked' | 'super_operator_unlocked' | 'blacklist_mode_active' | 'stale_total_assets'; export type OperationalSeverity = 'Critical' | 'High' | 'Medium'; export interface OperationalSignal { code: OperationalSignalCode; severity: OperationalSeverity; message: string; } /** * VaultState shape consumed by this evaluator. Intentionally a structural * subset of `VaultData['state']` (from `src/graphql/fragments/vault.fragment.ts`) * so we don't depend on the full fragment for unit-testable signal evaluation. */ export interface OperationalSignalsState { isPaused?: boolean; safeLocked?: boolean; superOperatorLocked?: boolean | null; accessMode?: 'Whitelist' | 'Blacklist' | null; blacklist?: string[] | null; totalAssetsExpiration?: string; } /** * Evaluate `state` against each signal rule. `nowSeconds` is injected for * deterministic testability (don't read `Date.now()` here). */ export declare function evaluateOperationalSignals(state: OperationalSignalsState | null | undefined, nowSeconds: number): OperationalSignal[]; /** * The risk-level floor implied by a set of signals. Critical > High > Medium. * Returns null when no signals are present. * * Pair with `riskLevelMax(weightedLevel, floor)` to compute the effective * level: the floor can only move the bucket up, never down. */ export declare function operationalSignalFloor(signals: OperationalSignal[]): 'Critical' | 'High' | 'Medium' | null; /** * Take the worse (higher) of two risk levels. */ export declare function riskLevelMax(a: 'Low' | 'Medium' | 'High' | 'Critical', b: 'Low' | 'Medium' | 'High' | 'Critical' | null): 'Low' | 'Medium' | 'High' | 'Critical'; //# sourceMappingURL=operational-signals.d.ts.map