/** * @fileoverview Live Agent Anchor — real-time trust posture for a governed agent. * * The Live Agent Anchor is the mutable convergence point for all Trust Bus * signals. It represents the current trust state of an agent across every * governance layer, updated in real-time as signals propagate through the * Trust Bus. * * This is the "digital twin" of an agent's trust posture: * - Trust Bus signals WRITE to the anchor (via delta application) * - Enforcement decisions READ from the anchor (current trust context) * - AgentAnchor dashboards SUBSCRIBE to anchor state changes * * Architecture: * Trust Bus Signal → Bus Router → Live Agent Anchor (update) → Subscribers * * Patent relevance: CG-10 (Live Agent Anchor — real-time trust convergence). * * @see {@link trust-bus.ts} for signal schema * @see {@link trust-bus-protocol-v0.md} for protocol specification * @module @vorionsys/contracts/canonical/live-agent-anchor */ import { z } from 'zod'; /** * Per-layer governance health status. * * Each governance layer independently reports its health for this agent. * The anchor aggregates these into a composite view. */ export declare enum LayerHealth { /** Layer is operating normally for this agent */ HEALTHY = "healthy", /** Layer has detected warnings but is still functional */ DEGRADED = "degraded", /** Layer has active blocks or failures for this agent */ IMPAIRED = "impaired", /** Layer has no data for this agent (not yet evaluated) */ UNKNOWN = "unknown" } /** * Observation tier — how much internal visibility we have into the agent's model. * * Determines the trust ceiling: agents we can't inspect get lower max trust. * * @see packages/a3i/src/observation/tiers.ts for runtime implementation */ export declare enum ObservationTier { /** No internal access — API-only interaction */ BLACK_BOX = "black_box", /** Partial access — embeddings, attention weights */ GRAY_BOX = "gray_box", /** Full weight access — open-source model, self-hosted */ WHITE_BOX = "white_box", /** Hardware attestation — TEE-verified execution */ ATTESTED = "attested", /** Formally verified — mathematical proofs of behavior */ VERIFIED = "verified" } /** * Circuit breaker state for this agent. */ export declare enum AgentCircuitState { /** Normal operation */ CLOSED = "closed", /** Failures exceeded threshold — all requests blocked */ OPEN = "open", /** Cooling down — allowing probe requests */ HALF_OPEN = "half_open" } export declare const layerHealthSchema: z.ZodNativeEnum; export declare const observationTierSchema: z.ZodNativeEnum; export declare const agentCircuitStateSchema: z.ZodNativeEnum; /** * Per-layer governance state snapshot. * * Each governance layer reports its current status for this agent. */ export declare const layerStateSchema: z.ZodObject<{ /** Which governance layer */ layer: z.ZodNativeEnum; /** Current health of this layer for the agent */ health: z.ZodDefault>; /** Last signal hash received from this layer */ lastSignalHash: z.ZodOptional; /** When this layer last reported (ISO 8601 UTC) */ lastReportedAt: z.ZodOptional; /** Layer-specific status details */ details: z.ZodOptional>; }, "strip", z.ZodTypeAny, { layer: import("./trust-bus.js").GovernanceLayer; health: LayerHealth; details?: Record | undefined; lastSignalHash?: string | undefined; lastReportedAt?: string | undefined; }, { layer: import("./trust-bus.js").GovernanceLayer; details?: Record | undefined; health?: LayerHealth | undefined; lastSignalHash?: string | undefined; lastReportedAt?: string | undefined; }>; /** * Trust decay state — tracks inactivity-based trust erosion. * * The 182-day stepped decay with 50% floor is a core invariant. */ export declare const decayStateSchema: z.ZodObject<{ /** Days since last qualifying activity */ daysInactive: z.ZodNumber; /** Current decay factor (1.0 = no decay, 0.5 = floor) */ decayFactor: z.ZodNumber; /** Which decay milestone we're at (0-9) */ currentMilestone: z.ZodNumber; /** Score before decay was applied */ preDecayScore: z.ZodNumber; /** When the agent was last active (ISO 8601 UTC) */ lastActivityAt: z.ZodString; }, "strip", z.ZodTypeAny, { daysInactive: number; decayFactor: number; currentMilestone: number; preDecayScore: number; lastActivityAt: string; }, { daysInactive: number; decayFactor: number; currentMilestone: number; preDecayScore: number; lastActivityAt: string; }>; /** * ParameSphere integrity state — model-interior trust evidence. * * ParameSphere provides trust evidence from INSIDE the model (behavioral * envelope analysis), not just from observing I/O behavior. This is the * "fifth force" beyond behavioral fingerprinting. * * Status: PROPOSED — No implementation yet. Target: H2 2026. * When implemented, this will feed into S_composite = S_behavioral × I(θ). */ export declare const parameSphereStateSchema: z.ZodObject<{ /** Whether ParameSphere analysis is available for this agent's model */ available: z.ZodDefault; /** Integrity multiplier I(θ) — multiplicative modifier on trust score */ integrityMultiplier: z.ZodOptional; /** Behavioral envelope hash of the model's behavioral patterns */ envelopeHash: z.ZodOptional; /** Whether the current fingerprint matches the registered baseline */ baselineMatch: z.ZodOptional; /** Cognitive envelope compliance — is the model within expected bounds? */ envelopeCompliant: z.ZodOptional; /** When the last ParameSphere analysis was performed (ISO 8601 UTC) */ lastAnalyzedAt: z.ZodOptional; }, "strip", z.ZodTypeAny, { available: boolean; integrityMultiplier?: number | undefined; envelopeHash?: string | undefined; baselineMatch?: boolean | undefined; envelopeCompliant?: boolean | undefined; lastAnalyzedAt?: string | undefined; }, { available?: boolean | undefined; integrityMultiplier?: number | undefined; envelopeHash?: string | undefined; baselineMatch?: boolean | undefined; envelopeCompliant?: boolean | undefined; lastAnalyzedAt?: string | undefined; }>; /** * Live Agent Anchor — the real-time trust posture of a governed agent. * * This is the convergence point for all Trust Bus signals. Every governance * layer writes to this anchor, and every enforcement decision reads from it. * * The anchor is the mutable state object. The proof chain is the immutable * audit trail. Together they provide real-time governance with cryptographic * accountability. * * Invariants: * - trustScore is always in [0, 1000] * - trustTier must match the score per TIER_THRESHOLDS * - trustCeiling is determined by observationTier * - layerStates has exactly one entry per active governance layer * - signalHash links to the most recent Trust Bus signal */ export declare const liveAgentAnchorSchema: z.ZodObject<{ /** Agent identifier (matches Trust Bus agentId) */ agentId: z.ZodString; /** Tenant/organization scope */ tenantId: z.ZodString; /** CAR string — immutable agent classification identifier */ carString: z.ZodOptional; /** Current trust score (0-1000) */ trustScore: z.ZodNumber; /** Current trust tier (T0-T7) — must match score per TIER_THRESHOLDS */ trustTier: z.ZodEnum<["T0", "T1", "T2", "T3", "T4", "T5", "T6", "T7"]>; /** Maximum trust score achievable given observation tier */ trustCeiling: z.ZodNumber; /** How much visibility we have into the agent's model internals */ observationTier: z.ZodDefault>; /** Per-layer governance health and status */ layerStates: z.ZodDefault; /** Current health of this layer for the agent */ health: z.ZodDefault>; /** Last signal hash received from this layer */ lastSignalHash: z.ZodOptional; /** When this layer last reported (ISO 8601 UTC) */ lastReportedAt: z.ZodOptional; /** Layer-specific status details */ details: z.ZodOptional>; }, "strip", z.ZodTypeAny, { layer: import("./trust-bus.js").GovernanceLayer; health: LayerHealth; details?: Record | undefined; lastSignalHash?: string | undefined; lastReportedAt?: string | undefined; }, { layer: import("./trust-bus.js").GovernanceLayer; details?: Record | undefined; health?: LayerHealth | undefined; lastSignalHash?: string | undefined; lastReportedAt?: string | undefined; }>, "many">>; /** Composite governance health — worst-of across all layers */ compositeHealth: z.ZodDefault>; /** Agent-level circuit breaker state */ circuitState: z.ZodDefault>; /** Consecutive failure count (resets on success) */ consecutiveFailures: z.ZodDefault; /** When circuit breaker was last tripped (ISO 8601 UTC) */ circuitTrippedAt: z.ZodOptional; /** Trust decay tracking */ decay: z.ZodOptional>; /** Model-interior integrity state (future — H2 2026) */ parameSphere: z.ZodOptional; /** Integrity multiplier I(θ) — multiplicative modifier on trust score */ integrityMultiplier: z.ZodOptional; /** Behavioral envelope hash of the model's behavioral patterns */ envelopeHash: z.ZodOptional; /** Whether the current fingerprint matches the registered baseline */ baselineMatch: z.ZodOptional; /** Cognitive envelope compliance — is the model within expected bounds? */ envelopeCompliant: z.ZodOptional; /** When the last ParameSphere analysis was performed (ISO 8601 UTC) */ lastAnalyzedAt: z.ZodOptional; }, "strip", z.ZodTypeAny, { available: boolean; integrityMultiplier?: number | undefined; envelopeHash?: string | undefined; baselineMatch?: boolean | undefined; envelopeCompliant?: boolean | undefined; lastAnalyzedAt?: string | undefined; }, { available?: boolean | undefined; integrityMultiplier?: number | undefined; envelopeHash?: string | undefined; baselineMatch?: boolean | undefined; envelopeCompliant?: boolean | undefined; lastAnalyzedAt?: string | undefined; }>>; /** Hash of the most recent Trust Bus signal applied to this anchor */ lastSignalHash: z.ZodOptional; /** Total signals received and applied */ signalCount: z.ZodDefault; /** When this anchor was created (ISO 8601 UTC) */ createdAt: z.ZodString; /** When this anchor was last updated (ISO 8601 UTC) */ updatedAt: z.ZodString; /** When the agent was last evaluated by enforcement (ISO 8601 UTC) */ lastEnforcedAt: z.ZodOptional; }, "strip", z.ZodTypeAny, { createdAt: string; updatedAt: string; agentId: string; trustScore: number; tenantId: string; signalCount: number; observationTier: ObservationTier; trustTier: "T0" | "T1" | "T2" | "T3" | "T4" | "T5" | "T6" | "T7"; trustCeiling: number; layerStates: { layer: import("./trust-bus.js").GovernanceLayer; health: LayerHealth; details?: Record | undefined; lastSignalHash?: string | undefined; lastReportedAt?: string | undefined; }[]; compositeHealth: LayerHealth; circuitState: AgentCircuitState; consecutiveFailures: number; decay?: { daysInactive: number; decayFactor: number; currentMilestone: number; preDecayScore: number; lastActivityAt: string; } | undefined; lastSignalHash?: string | undefined; carString?: string | undefined; circuitTrippedAt?: string | undefined; parameSphere?: { available: boolean; integrityMultiplier?: number | undefined; envelopeHash?: string | undefined; baselineMatch?: boolean | undefined; envelopeCompliant?: boolean | undefined; lastAnalyzedAt?: string | undefined; } | undefined; lastEnforcedAt?: string | undefined; }, { createdAt: string; updatedAt: string; agentId: string; trustScore: number; tenantId: string; trustTier: "T0" | "T1" | "T2" | "T3" | "T4" | "T5" | "T6" | "T7"; trustCeiling: number; decay?: { daysInactive: number; decayFactor: number; currentMilestone: number; preDecayScore: number; lastActivityAt: string; } | undefined; signalCount?: number | undefined; observationTier?: ObservationTier | undefined; lastSignalHash?: string | undefined; carString?: string | undefined; layerStates?: { layer: import("./trust-bus.js").GovernanceLayer; details?: Record | undefined; health?: LayerHealth | undefined; lastSignalHash?: string | undefined; lastReportedAt?: string | undefined; }[] | undefined; compositeHealth?: LayerHealth | undefined; circuitState?: AgentCircuitState | undefined; consecutiveFailures?: number | undefined; circuitTrippedAt?: string | undefined; parameSphere?: { available?: boolean | undefined; integrityMultiplier?: number | undefined; envelopeHash?: string | undefined; baselineMatch?: boolean | undefined; envelopeCompliant?: boolean | undefined; lastAnalyzedAt?: string | undefined; } | undefined; lastEnforcedAt?: string | undefined; }>; /** * Schema for creating a new Live Agent Anchor (initial registration). * Omits computed fields that are set by the system. */ export declare const createLiveAgentAnchorSchema: z.ZodObject<{ agentId: z.ZodString; tenantId: z.ZodString; carString: z.ZodOptional; trustScore: z.ZodDefault; trustTier: z.ZodDefault>; observationTier: z.ZodDefault>; }, "strip", z.ZodTypeAny, { agentId: string; trustScore: number; tenantId: string; observationTier: ObservationTier; trustTier: "T0" | "T1" | "T2" | "T3" | "T4" | "T5" | "T6" | "T7"; carString?: string | undefined; }, { agentId: string; tenantId: string; trustScore?: number | undefined; observationTier?: ObservationTier | undefined; carString?: string | undefined; trustTier?: "T0" | "T1" | "T2" | "T3" | "T4" | "T5" | "T6" | "T7" | undefined; }>; /** * Schema for anchor state change events (emitted on update). * * AgentAnchor dashboards subscribe to these for real-time display. */ export declare const anchorStateChangeSchema: z.ZodObject<{ /** The agent whose anchor changed */ agentId: z.ZodString; /** Tenant scope */ tenantId: z.ZodString; /** What field(s) changed */ changedFields: z.ZodArray; /** Previous trust score (if trust changed) */ previousScore: z.ZodOptional; /** New trust score (if trust changed) */ newScore: z.ZodOptional; /** Previous tier (if tier changed) */ previousTier: z.ZodOptional>; /** New tier (if tier changed) */ newTier: z.ZodOptional>; /** The signal that triggered this change */ triggerSignalId: z.ZodOptional; /** When this change occurred (ISO 8601 UTC) */ timestamp: z.ZodString; }, "strip", z.ZodTypeAny, { timestamp: string; agentId: string; tenantId: string; changedFields: string[]; previousScore?: number | undefined; newScore?: number | undefined; previousTier?: "T0" | "T1" | "T2" | "T3" | "T4" | "T5" | "T6" | "T7" | undefined; newTier?: "T0" | "T1" | "T2" | "T3" | "T4" | "T5" | "T6" | "T7" | undefined; triggerSignalId?: string | undefined; }, { timestamp: string; agentId: string; tenantId: string; changedFields: string[]; previousScore?: number | undefined; newScore?: number | undefined; previousTier?: "T0" | "T1" | "T2" | "T3" | "T4" | "T5" | "T6" | "T7" | undefined; newTier?: "T0" | "T1" | "T2" | "T3" | "T4" | "T5" | "T6" | "T7" | undefined; triggerSignalId?: string | undefined; }>; /** Real-time trust posture of a governed agent */ export type LiveAgentAnchor = z.infer; /** Input for creating a new agent anchor */ export type CreateLiveAgentAnchor = z.infer; /** Per-layer governance state */ export type LayerState = z.infer; /** Trust decay tracking state */ export type DecayState = z.infer; /** ParameSphere integrity state */ export type ParameSphereState = z.infer; /** Anchor state change event */ export type AnchorStateChange = z.infer;