/**
 * Guard-Posture Probe — the structural consumer (GUARD-POSTURE-ENDPOINT-SPEC §2.4).
 *
 * A readable posture surface nobody reads is a wish (Structure > Willpower):
 * on the established probe cadence this probe evaluates the local guard
 * inventory plus every peer's heartbeat-sourced posture and raises ONE
 * aggregated, episode-keyed Attention item when an anomaly persists across
 * consecutive probe ticks.
 *
 * Anomaly classes: `diverged-from-default` offs (the load-shed signature),
 * `off-runtime-divergent` (the in-memory disable class), `on-stale`,
 * `missing`, `errored` — and `flapping` (sub-cadence toggling: a guard whose
 * posture flipped more than K times within the probe's recorded window of its
 * own ticks, even when each individual sighting looks settled or quiet).
 * `dark-default` offs are quiet — never anomalies.
 *
 * Data source rule (spec): heartbeat posture (with its age) is the input for
 * every peer; the deep-read fallback fires ONLY for peers the registry
 * currently believes ONLINE whose heartbeat block is missing or stale — for
 * offline/dark peers the probe evaluates the durable last-known posture
 * directly, NEVER a doomed fan-out (a permanently-dark peer must not buy a
 * timeout on every probe tick forever).
 *
 * Episode semantics (P17/P19): ONE aggregated item per episode under the
 * stable healthKey; while an episode is open the probe never re-emits (the
 * attention layer's healthKey dedup is the backstop, not the mechanism); an
 * episode ends only when ALL anomalies clear; a cleared-then-recurring
 * anomaly set is a NEW episode (new id suffix, same healthKey).
 *
 * Episode state is durable JSON (atomic tmp+rename); a corrupt file
 * re-baselines without crashing.
 */
import type { Probe } from '../SystemReviewer.js';
import type { GuardInventoryResult, HeartbeatGuardPosture } from '../guardPostureView.js';
export declare const __verifyScope: readonly ["guard-posture"];
/** An anomaly must be seen on this many CONSECUTIVE ticks before alerting. */
export declare const PERSISTENCE_TICKS = 2;
/** Flapping threshold K — more than K flips within the window raises `flapping`. */
export declare const FLAP_K = 3;
/** Window (in probe ticks) over which posture flips are counted. */
export declare const FLAP_WINDOW_TICKS = 10;
/** A peer heartbeat posture older than this counts as stale for the deep-read fallback. */
export declare const STALE_POSTURE_AGE_MS: number;
/** Stable episode healthKey — same across episodes so the attention layer dedups per-episode. */
export declare const GUARD_POSTURE_HEALTH_KEY = "guard-posture-anomalies";
export type GuardAnomalyClass = 'diverged-from-default' | 'off-runtime-divergent' | 'on-stale' | 'missing' | 'errored' | 'flapping';
export interface PeerPostureRead {
    machineId: string;
    nickname?: string;
    online: boolean;
    /** Heartbeat-sourced compact block; durable last-known for offline peers. */
    posture: HeartbeatGuardPosture | null;
    /** Receiver-side age of the posture block; null when no posture ever received. */
    postureAgeMs: number | null;
}
export interface GuardPostureAttentionItem {
    id: string;
    title: string;
    summary: string;
    category: string;
    priority: 'URGENT' | 'HIGH' | 'NORMAL' | 'LOW';
    sourceContext?: string;
    healthKey?: string;
}
export interface GuardPostureProbeDeps {
    /** One-read local inventory (GET /guards source) or null when unavailable. */
    getLocalPosture: () => GuardInventoryResult | null;
    /** Heartbeat-sourced peer postures (durable last-known for offline peers). */
    getPeerPostures: () => PeerPostureRead[];
    /**
     * Optional deep read — used ONLY for peers reported ONLINE whose posture is
     * null or stale. NEVER called for offline peers (spec §2.4).
     */
    deepReadPeer?: (machineId: string) => Promise<unknown>;
    /** Aggregated emit funnel (P17) — ONE item per episode. */
    emitAttention: (item: GuardPostureAttentionItem) => Promise<void>;
    /** Episode state persists at `<stateDir>/state/guard-posture-episodes.json`. */
    stateDir: string;
    now?: () => number;
}
export declare function createGuardPostureProbes(deps: GuardPostureProbeDeps): Probe[];
//# sourceMappingURL=GuardPostureProbe.d.ts.map