/**
 * src/constitution/types.ts
 *
 * Shared types for the constitution module.
 * CycleSnapshot is a lightweight view of one agent run cycle for scoring purposes.
 * It adapts Trace fields and adds budget / scope context needed by the gate.
 *
 * @module constitution/types
 */
import { z } from "zod";
export interface SignalPoint {
    /** Axiom-scoped label for this signal (e.g. "timeout_configured"). */
    label: string;
    /**
     * Weight in [−1, 1].
     * Positive = evidence the axiom is satisfied.
     * Negative = evidence the axiom is violated.
     */
    weight: number;
    /** Human-readable evidence string for audit trail. */
    evidence: string;
}
export type AxiomId = "Institutionnel" | "SOTA" | "Robuste" | "AntiFragile" | "Profitable";
export type GateSeverity = "block";
export interface GateViolation {
    axiom: AxiomId;
    severity: GateSeverity;
    rule: string;
    rationale: string;
}
/** A single recorded step within a cycle, simplified for constitution use. */
export interface CycleStep {
    /** Zero-based monotone index. */
    index: number;
    /** Phase of this step (mirrors TraceStep.phase). */
    phase: string;
    /** Type of this step (mirrors TraceStep.type). */
    type: string;
    /** Serialised (and potentially redacted) output payload. Used for secret scanning. */
    output?: unknown;
    /** Stored input payload (mirrors TraceStep.storedInput). Used for PII detection. */
    storedInput?: unknown;
    /** LLM model that produced this step, if any. */
    model?: {
        provider: string;
        name: string;
        version: string;
    };
    /** Name of the tool invoked, for 'tool_call' steps. */
    toolName?: string;
    /** Estimated cost in USD for this step. */
    costUsd?: number;
}
/** Arbitrary metadata the host attaches to the cycle at submission time. */
export interface CycleMetadata {
    /** If true the RSO has issued a veto on this cycle before evaluation. */
    rso_veto?: boolean;
    /** Hash primitive used by the agent (e.g. "poseidon", "keccak256"). */
    hash_primitive?: string;
    /** Whether a fallback path exists for this cycle (resilience signal). */
    has_fallback?: boolean;
    /** Whether the cycle's primary operation is idempotent. */
    is_idempotent?: boolean;
    /** Number of independent data / funding sources. */
    source_count?: number;
    /** Model provider name for recency analysis. */
    model_provider?: string;
    /** Model name for recency analysis. */
    model_name?: string;
    /** Whether SLSA supply-chain level ≥ 3 artefacts were used. */
    slsa_level?: number;
    /** Whether explicit timeouts are configured on all external calls. */
    timeouts_configured?: boolean;
    /** Whether error paths are explicit (no silent swallowing). */
    error_paths_explicit?: boolean;
    /** Whether cross-agent payloads with PII have been redacted. */
    pii_redacted?: boolean;
    /**
     * Explicit audit-trail completeness flag.
     * When true, the host asserts all steps are recorded and the rootHash is finalized.
     */
    audit_trail_complete?: boolean;
    /**
     * Regulatory scope this cycle operates under.
     * Well-known values: "eIDAS", "gdpr", "ai-act-art-14".
     * Used by the Institutionnel scorer to reward explicit regulatory alignment.
     */
    regulatory_scope?: string;
    /**
     * Opaque field bag — any additional host-side metadata.
     */
    [key: string]: unknown;
}
/**
 * CycleSnapshot — the unit of analysis for constitutional scoring.
 *
 * Designed to be a strict subset of Trace (re-using `rootHash` and `steps`
 * semantics) with additional budget / scope fields required by the gate.
 */
export interface CycleSnapshot {
    /** Unique run identifier (mirrors Trace.runId). */
    runId: string;
    /** Parent run identifier when this is a child cycle. */
    parentRunId?: string;
    /** Ordered steps of this cycle. */
    steps: CycleStep[];
    /**
     * Maximum allowed budget in USD for this cycle.
     * Gate blocks child cycles that exceed the parent's budget.
     */
    budgetUsdMax: number;
    /** Actual USD spent so far in this cycle. */
    budgetUsdSpent: number;
    /** Scope identifier — must be within parent's allowed_scope_ids. */
    scope_id?: string;
    /** Arbitrary metadata from the host. */
    metadata?: CycleMetadata;
    /**
     * SHA-256 root hash of the step chain (mirrors Trace.rootHash).
     * Presence confirms the cycle was finalized with integrity.
     */
    rootHash: string;
}
export declare const cycleSnapshotSchema: z.ZodObject<{
    runId: z.ZodString;
    parentRunId: z.ZodOptional<z.ZodString>;
    steps: z.ZodArray<z.ZodObject<{
        index: z.ZodNumber;
        phase: z.ZodString;
        type: z.ZodString;
        output: z.ZodOptional<z.ZodUnknown>;
        storedInput: z.ZodOptional<z.ZodUnknown>;
        model: z.ZodOptional<z.ZodObject<{
            provider: z.ZodString;
            name: z.ZodString;
            version: z.ZodString;
        }, "strip", z.ZodTypeAny, {
            provider: string;
            name: string;
            version: string;
        }, {
            provider: string;
            name: string;
            version: string;
        }>>;
        toolName: z.ZodOptional<z.ZodString>;
        costUsd: z.ZodOptional<z.ZodNumber>;
    }, "strip", z.ZodTypeAny, {
        type: string;
        phase: string;
        index: number;
        model?: {
            provider: string;
            name: string;
            version: string;
        } | undefined;
        costUsd?: number | undefined;
        toolName?: string | undefined;
        output?: unknown;
        storedInput?: unknown;
    }, {
        type: string;
        phase: string;
        index: number;
        model?: {
            provider: string;
            name: string;
            version: string;
        } | undefined;
        costUsd?: number | undefined;
        toolName?: string | undefined;
        output?: unknown;
        storedInput?: unknown;
    }>, "many">;
    budgetUsdMax: z.ZodNumber;
    budgetUsdSpent: z.ZodNumber;
    scope_id: z.ZodOptional<z.ZodString>;
    metadata: z.ZodOptional<z.ZodObject<{
        rso_veto: z.ZodOptional<z.ZodBoolean>;
        hash_primitive: z.ZodOptional<z.ZodString>;
        has_fallback: z.ZodOptional<z.ZodBoolean>;
        is_idempotent: z.ZodOptional<z.ZodBoolean>;
        source_count: z.ZodOptional<z.ZodNumber>;
        model_provider: z.ZodOptional<z.ZodString>;
        model_name: z.ZodOptional<z.ZodString>;
        slsa_level: z.ZodOptional<z.ZodNumber>;
        timeouts_configured: z.ZodOptional<z.ZodBoolean>;
        error_paths_explicit: z.ZodOptional<z.ZodBoolean>;
        pii_redacted: z.ZodOptional<z.ZodBoolean>;
        audit_trail_complete: z.ZodOptional<z.ZodBoolean>;
        regulatory_scope: z.ZodOptional<z.ZodString>;
    }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
        rso_veto: z.ZodOptional<z.ZodBoolean>;
        hash_primitive: z.ZodOptional<z.ZodString>;
        has_fallback: z.ZodOptional<z.ZodBoolean>;
        is_idempotent: z.ZodOptional<z.ZodBoolean>;
        source_count: z.ZodOptional<z.ZodNumber>;
        model_provider: z.ZodOptional<z.ZodString>;
        model_name: z.ZodOptional<z.ZodString>;
        slsa_level: z.ZodOptional<z.ZodNumber>;
        timeouts_configured: z.ZodOptional<z.ZodBoolean>;
        error_paths_explicit: z.ZodOptional<z.ZodBoolean>;
        pii_redacted: z.ZodOptional<z.ZodBoolean>;
        audit_trail_complete: z.ZodOptional<z.ZodBoolean>;
        regulatory_scope: z.ZodOptional<z.ZodString>;
    }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
        rso_veto: z.ZodOptional<z.ZodBoolean>;
        hash_primitive: z.ZodOptional<z.ZodString>;
        has_fallback: z.ZodOptional<z.ZodBoolean>;
        is_idempotent: z.ZodOptional<z.ZodBoolean>;
        source_count: z.ZodOptional<z.ZodNumber>;
        model_provider: z.ZodOptional<z.ZodString>;
        model_name: z.ZodOptional<z.ZodString>;
        slsa_level: z.ZodOptional<z.ZodNumber>;
        timeouts_configured: z.ZodOptional<z.ZodBoolean>;
        error_paths_explicit: z.ZodOptional<z.ZodBoolean>;
        pii_redacted: z.ZodOptional<z.ZodBoolean>;
        audit_trail_complete: z.ZodOptional<z.ZodBoolean>;
        regulatory_scope: z.ZodOptional<z.ZodString>;
    }, z.ZodTypeAny, "passthrough">>>;
    rootHash: z.ZodString;
}, "strict", z.ZodTypeAny, {
    runId: string;
    rootHash: string;
    steps: {
        type: string;
        phase: string;
        index: number;
        model?: {
            provider: string;
            name: string;
            version: string;
        } | undefined;
        costUsd?: number | undefined;
        toolName?: string | undefined;
        output?: unknown;
        storedInput?: unknown;
    }[];
    budgetUsdMax: number;
    budgetUsdSpent: number;
    metadata?: z.objectOutputType<{
        rso_veto: z.ZodOptional<z.ZodBoolean>;
        hash_primitive: z.ZodOptional<z.ZodString>;
        has_fallback: z.ZodOptional<z.ZodBoolean>;
        is_idempotent: z.ZodOptional<z.ZodBoolean>;
        source_count: z.ZodOptional<z.ZodNumber>;
        model_provider: z.ZodOptional<z.ZodString>;
        model_name: z.ZodOptional<z.ZodString>;
        slsa_level: z.ZodOptional<z.ZodNumber>;
        timeouts_configured: z.ZodOptional<z.ZodBoolean>;
        error_paths_explicit: z.ZodOptional<z.ZodBoolean>;
        pii_redacted: z.ZodOptional<z.ZodBoolean>;
        audit_trail_complete: z.ZodOptional<z.ZodBoolean>;
        regulatory_scope: z.ZodOptional<z.ZodString>;
    }, z.ZodTypeAny, "passthrough"> | undefined;
    parentRunId?: string | undefined;
    scope_id?: string | undefined;
}, {
    runId: string;
    rootHash: string;
    steps: {
        type: string;
        phase: string;
        index: number;
        model?: {
            provider: string;
            name: string;
            version: string;
        } | undefined;
        costUsd?: number | undefined;
        toolName?: string | undefined;
        output?: unknown;
        storedInput?: unknown;
    }[];
    budgetUsdMax: number;
    budgetUsdSpent: number;
    metadata?: z.objectInputType<{
        rso_veto: z.ZodOptional<z.ZodBoolean>;
        hash_primitive: z.ZodOptional<z.ZodString>;
        has_fallback: z.ZodOptional<z.ZodBoolean>;
        is_idempotent: z.ZodOptional<z.ZodBoolean>;
        source_count: z.ZodOptional<z.ZodNumber>;
        model_provider: z.ZodOptional<z.ZodString>;
        model_name: z.ZodOptional<z.ZodString>;
        slsa_level: z.ZodOptional<z.ZodNumber>;
        timeouts_configured: z.ZodOptional<z.ZodBoolean>;
        error_paths_explicit: z.ZodOptional<z.ZodBoolean>;
        pii_redacted: z.ZodOptional<z.ZodBoolean>;
        audit_trail_complete: z.ZodOptional<z.ZodBoolean>;
        regulatory_scope: z.ZodOptional<z.ZodString>;
    }, z.ZodTypeAny, "passthrough"> | undefined;
    parentRunId?: string | undefined;
    scope_id?: string | undefined;
}>;
//# sourceMappingURL=types.d.ts.map