/**
 * 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";
// ---------------------------------------------------------------------------
// Zod schema for CycleSnapshot — used by gate input validation
// ---------------------------------------------------------------------------
const cycleStepSchema = z.object({
    index: z.number().int().nonnegative(),
    phase: z.string(),
    type: z.string(),
    output: z.unknown().optional(),
    storedInput: z.unknown().optional(),
    model: z
        .object({
        provider: z.string(),
        name: z.string(),
        version: z.string(),
    })
        .optional(),
    toolName: z.string().optional(),
    costUsd: z.number().optional(),
});
const cycleMetadataSchema = z
    .object({
    rso_veto: z.boolean().optional(),
    hash_primitive: z.string().optional(),
    has_fallback: z.boolean().optional(),
    is_idempotent: z.boolean().optional(),
    source_count: z.number().optional(),
    model_provider: z.string().optional(),
    model_name: z.string().optional(),
    slsa_level: z.number().optional(),
    timeouts_configured: z.boolean().optional(),
    error_paths_explicit: z.boolean().optional(),
    pii_redacted: z.boolean().optional(),
    audit_trail_complete: z.boolean().optional(),
    regulatory_scope: z.string().optional(),
})
    .passthrough();
export const cycleSnapshotSchema = z
    .object({
    runId: z.string().min(1),
    parentRunId: z.string().optional(),
    steps: z.array(cycleStepSchema),
    budgetUsdMax: z.number().nonnegative(),
    budgetUsdSpent: z.number().nonnegative(),
    scope_id: z.string().optional(),
    metadata: cycleMetadataSchema.optional(),
    rootHash: z.string().min(1),
})
    .strict();
//# sourceMappingURL=types.js.map