import type { EventV3ControlState } from "../events/v3/control.js"; import { type SupervisorCapability, type SupervisorFindingClass, type SupervisorFindingEvidence, type SupervisorFindingSeverity, type SupervisorSourceReference } from "./contract.js"; /** * Event ledger control drift, as a supervisor finding. * * A root whose control state is not `active` still coordinates, so nothing * fails loudly: the write gate narrows, every reader validates the whole epoch, * and the only surface that said so was `init --check`. One root sat in * `candidate` for twenty hours that way. This module turns that drift into a * `coordination.ledger-diagnostic` finding so `agents health`, the resources * page, and diagnostic bundles carry it. * * It is a `diagnostic` finding by construction: it reports that an observation * and recording path is degraded, never that a machine resource is contended, * so it can never raise machine pressure or throttle anyone's work. */ export type LedgerControlStateNameV1 = EventV3ControlState["state"]; export interface LedgerControlStateObservationV1 { state: LedgerControlStateNameV1; /** The control reader's reason code, when the state carries one. */ reason?: string; observed_at: string; } /** * The finding shape `evaluateSupervisorFindings` consumes, before identity, * fingerprinting, and transition bookkeeping are applied to it. */ export interface SupervisorFindingCandidateV1 { source_kind: string; finding_kind: string; finding_class: SupervisorFindingClass; severity: SupervisorFindingSeverity; scope_kind: string; scope_id: string; summary: string; primary_source: SupervisorSourceReference; evidence: SupervisorFindingEvidence[]; capabilities: SupervisorCapability[]; } export interface LedgerControlStateFindingInputV1 { /** The control state observed for the current supervisor history point. */ current: LedgerControlStateObservationV1; /** Earlier observations, most recent first. Only the leading run is read. */ previous?: readonly LedgerControlStateObservationV1[]; capability: SupervisorCapability; } /** * Open a finding once the drift has outlived one supervisor history point. * * Rotation and activation legitimately pass through `candidate` between two * appends, so a single non-active sample is not drift. Two consecutive ones * are: no correct boundary spans a supervisor cycle. */ export declare function ledgerControlStateFindingCandidateV1(input: LedgerControlStateFindingInputV1): SupervisorFindingCandidateV1 | undefined; //# sourceMappingURL=ledger-state.d.ts.map