/** * @fileoverview CAR Certification Tiers and Vorion Runtime Tiers * * Defines two distinct tier systems with 8 levels (T0-T7): * * 1. **CertificationTier (T0-T7)**: External attestation status from CAR spec. * Represents the level of external verification and certification an agent * has received from certification authorities. * * 2. **RuntimeTier (T0-T7)**: Vorion deployment-specific autonomy levels. * Represents the operational autonomy granted to an agent in a specific * Vorion deployment context. * * These two systems are conceptually different but can be mapped to each other * for interoperability. * * @module @vorionsys/contracts/car/tiers */ import { z } from 'zod'; /** * CAR ID Certification Tiers representing external attestation status. * * These tiers indicate the level of external verification and certification * an agent has received from certification authorities: * * - T0: No external verification (Sandbox) * - T1: Basic observation period (Observed) * - T2: Initial capabilities verified (Provisional) * - T3: Continuous monitoring active (Monitored) * - T4: Standard certification achieved (Standard) * - T5: Full trust established (Trusted) * - T6: Third-party audit completed (Certified) * - T7: Highest assurance level (Autonomous) */ export declare enum CertificationTier { /** Sandbox - No external verification, isolated testing */ T0_SANDBOX = 0, /** Observed - Basic observation period, identity registered */ T1_OBSERVED = 1, /** Provisional - Initial capabilities verified */ T2_PROVISIONAL = 2, /** Monitored - Continuous behavioral monitoring active */ T3_MONITORED = 3, /** Standard - Standard certification achieved */ T4_STANDARD = 4, /** Trusted - Full trust established through track record */ T5_TRUSTED = 5, /** Certified - Independent third-party audit completed */ T6_CERTIFIED = 6, /** Autonomous - Highest assurance level with full certification */ T7_AUTONOMOUS = 7 } /** * Array of all certification tiers in ascending order. */ export declare const CERTIFICATION_TIERS: readonly [CertificationTier.T0_SANDBOX, CertificationTier.T1_OBSERVED, CertificationTier.T2_PROVISIONAL, CertificationTier.T3_MONITORED, CertificationTier.T4_STANDARD, CertificationTier.T5_TRUSTED, CertificationTier.T6_CERTIFIED, CertificationTier.T7_AUTONOMOUS]; /** * Zod schema for CertificationTier enum validation. */ export declare const certificationTierSchema: z.ZodNativeEnum; /** * Human-readable names for certification tiers. */ export declare const CERTIFICATION_TIER_NAMES: Readonly>; /** * Detailed descriptions for certification tiers. */ export declare const CERTIFICATION_TIER_DESCRIPTIONS: Readonly>; /** * Trust score ranges for certification tiers (CAR ID spec scale: 0-1000). */ export declare const CERTIFICATION_TIER_SCORES: Readonly>; /** * Vorion Runtime Tiers representing deployment-specific autonomy. * * These tiers indicate the operational autonomy granted to an agent * in a specific Vorion deployment context: * * - T0: Sandbox - No autonomy, isolated testing * - T1: Observed - Human observes all actions * - T2: Provisional - Limited autonomy with strict constraints * - T3: Monitored - Continuous monitoring, some autonomy * - T4: Standard - Standard operations permitted * - T5: Trusted - Expanded trust, minimal oversight * - T6: Certified - Independent operation with auditing * - T7: Autonomous - Full autonomy for mission-critical operations */ export declare enum RuntimeTier { /** Sandbox - No autonomy, isolated testing environment */ T0_SANDBOX = 0, /** Observed - Human observes all actions, learning period */ T1_OBSERVED = 1, /** Provisional - Limited autonomy with strict constraints */ T2_PROVISIONAL = 2, /** Monitored - Continuous monitoring, expanding autonomy */ T3_MONITORED = 3, /** Standard - Standard operations without individual approval */ T4_STANDARD = 4, /** Trusted - Expanded trust with minimal oversight */ T5_TRUSTED = 5, /** Certified - Independent operation with audit trail */ T6_CERTIFIED = 6, /** Autonomous - Full autonomy for mission-critical operations */ T7_AUTONOMOUS = 7 } /** * Array of all runtime tiers in ascending order. */ export declare const RUNTIME_TIERS: readonly [RuntimeTier.T0_SANDBOX, RuntimeTier.T1_OBSERVED, RuntimeTier.T2_PROVISIONAL, RuntimeTier.T3_MONITORED, RuntimeTier.T4_STANDARD, RuntimeTier.T5_TRUSTED, RuntimeTier.T6_CERTIFIED, RuntimeTier.T7_AUTONOMOUS]; /** * Zod schema for RuntimeTier enum validation. */ export declare const runtimeTierSchema: z.ZodNativeEnum; /** * Human-readable names for runtime tiers. */ export declare const RUNTIME_TIER_NAMES: Readonly>; /** * Detailed descriptions for runtime tiers. */ export declare const RUNTIME_TIER_DESCRIPTIONS: Readonly>; /** * Trust score ranges for runtime tiers (Vorion scale: 0-1000). */ export declare const RUNTIME_TIER_SCORES: Readonly>; /** * Configuration for a certification tier. */ export interface CertificationTierConfig { /** The certification tier */ readonly tier: CertificationTier; /** Short code (T0-T7) */ readonly code: string; /** Human-readable name */ readonly name: string; /** Detailed description */ readonly description: string; /** Trust score range */ readonly scoreRange: { min: number; max: number; }; /** Required attestation types */ readonly requiredAttestations: readonly string[]; /** Maximum capability level allowed */ readonly maxCapabilityLevel: number; } /** * Configuration for all certification tiers. */ export declare const CERTIFICATION_TIER_CONFIGS: Readonly>; /** * Configuration for a runtime tier. */ export interface RuntimeTierConfig { /** The runtime tier */ readonly tier: RuntimeTier; /** Short code (T0-T7) */ readonly code: string; /** Human-readable name */ readonly name: string; /** Detailed description */ readonly description: string; /** Trust score range */ readonly scoreRange: { min: number; max: number; }; /** Whether human approval is required for actions */ readonly requiresApproval: boolean; /** Whether operations are constrained by guardrails */ readonly hasGuardrails: boolean; /** Whether autonomous operation is permitted */ readonly allowsAutonomy: boolean; } /** * Configuration for all runtime tiers. */ export declare const RUNTIME_TIER_CONFIGS: Readonly>; /** * Checks if one certification tier is higher than another. */ export declare function isCertificationTierHigher(tier: CertificationTier, other: CertificationTier): boolean; /** * Checks if a certification tier meets a minimum requirement. */ export declare function meetsCertificationTier(tier: CertificationTier, minTier: CertificationTier): boolean; /** * Compares two certification tiers. */ export declare function compareCertificationTiers(a: CertificationTier, b: CertificationTier): -1 | 0 | 1; /** * Checks if one runtime tier is higher than another. */ export declare function isRuntimeTierHigher(tier: RuntimeTier, other: RuntimeTier): boolean; /** * Checks if a runtime tier meets a minimum requirement. */ export declare function meetsRuntimeTier(tier: RuntimeTier, minTier: RuntimeTier): boolean; /** * Compares two runtime tiers. */ export declare function compareRuntimeTiers(a: RuntimeTier, b: RuntimeTier): -1 | 0 | 1; /** * Converts a trust score to a certification tier using CAR ID scale (0-1000). * * @param score - Trust score on 0-1000 scale * @returns Corresponding CertificationTier */ export declare function scoreToCertificationTier(score: number): CertificationTier; /** * Converts a trust score to a runtime tier using Vorion scale (0-1000). * * @param score - Trust score on 0-1000 scale * @returns Corresponding RuntimeTier */ export declare function scoreToRuntimeTier(score: number): RuntimeTier; /** * Gets the midpoint score for a certification tier. * * @param tier - The certification tier * @returns Midpoint score for the tier */ export declare function certificationTierToScore(tier: CertificationTier): number; /** * Gets the midpoint score for a runtime tier. * * @param tier - The runtime tier * @returns Midpoint score for the tier */ export declare function runtimeTierToScore(tier: RuntimeTier): number; /** * Gets the minimum score for a certification tier. */ export declare function getCertificationTierMinScore(tier: CertificationTier): number; /** * Gets the maximum score for a certification tier. */ export declare function getCertificationTierMaxScore(tier: CertificationTier): number; /** * Gets the minimum score for a runtime tier. */ export declare function getRuntimeTierMinScore(tier: RuntimeTier): number; /** * Gets the maximum score for a runtime tier. */ export declare function getRuntimeTierMaxScore(tier: RuntimeTier): number; /** * Gets the configuration for a certification tier. */ export declare function getCertificationTierConfig(tier: CertificationTier): CertificationTierConfig; /** * Gets the configuration for a runtime tier. */ export declare function getRuntimeTierConfig(tier: RuntimeTier): RuntimeTierConfig; /** * Gets the name of a certification tier. */ export declare function getCertificationTierName(tier: CertificationTier): string; /** * Gets the name of a runtime tier. */ export declare function getRuntimeTierName(tier: RuntimeTier): string; /** * Gets the description of a certification tier. */ export declare function getCertificationTierDescription(tier: CertificationTier): string; /** * Gets the description of a runtime tier. */ export declare function getRuntimeTierDescription(tier: RuntimeTier): string; /** * Parses a tier string (e.g., "T3" or "3") to a CertificationTier. * * @param tierStr - Tier string to parse * @returns Parsed CertificationTier * @throws Error if the string is not a valid tier */ export declare function parseCertificationTier(tierStr: string): CertificationTier; /** * Parses a tier string (e.g., "T3" or "3") to a RuntimeTier. * * @param tierStr - Tier string to parse * @returns Parsed RuntimeTier * @throws Error if the string is not a valid tier */ export declare function parseRuntimeTier(tierStr: string): RuntimeTier; /** * Type guard to check if a value is a valid CertificationTier. */ export declare function isCertificationTier(value: unknown): value is CertificationTier; /** * Type guard to check if a value is a valid RuntimeTier. */ export declare function isRuntimeTier(value: unknown): value is RuntimeTier; /** * Zod schema for certification tier configuration. */ export declare const certificationTierConfigSchema: z.ZodObject<{ tier: z.ZodNativeEnum; code: z.ZodString; name: z.ZodString; description: z.ZodString; scoreRange: z.ZodObject<{ min: z.ZodNumber; max: z.ZodNumber; }, "strip", z.ZodTypeAny, { min: number; max: number; }, { min: number; max: number; }>; requiredAttestations: z.ZodReadonly>; maxCapabilityLevel: z.ZodNumber; }, "strip", z.ZodTypeAny, { name: string; code: string; description: string; tier: CertificationTier; scoreRange: { min: number; max: number; }; requiredAttestations: readonly string[]; maxCapabilityLevel: number; }, { name: string; code: string; description: string; tier: CertificationTier; scoreRange: { min: number; max: number; }; requiredAttestations: readonly string[]; maxCapabilityLevel: number; }>; /** * Zod schema for runtime tier configuration. */ export declare const runtimeTierConfigSchema: z.ZodObject<{ tier: z.ZodNativeEnum; code: z.ZodString; name: z.ZodString; description: z.ZodString; scoreRange: z.ZodObject<{ min: z.ZodNumber; max: z.ZodNumber; }, "strip", z.ZodTypeAny, { min: number; max: number; }, { min: number; max: number; }>; requiresApproval: z.ZodBoolean; hasGuardrails: z.ZodBoolean; allowsAutonomy: z.ZodBoolean; }, "strip", z.ZodTypeAny, { name: string; code: string; description: string; tier: RuntimeTier; requiresApproval: boolean; scoreRange: { min: number; max: number; }; hasGuardrails: boolean; allowsAutonomy: boolean; }, { name: string; code: string; description: string; tier: RuntimeTier; requiresApproval: boolean; scoreRange: { min: number; max: number; }; hasGuardrails: boolean; allowsAutonomy: boolean; }>; /** * Zod schema for parsing tier strings. */ export declare const tierStringSchema: z.ZodString; /** * Zod schema for parsing and transforming to CertificationTier. */ export declare const certificationTierStringSchema: z.ZodEffects; /** * Zod schema for parsing and transforming to RuntimeTier. */ export declare const runtimeTierStringSchema: z.ZodEffects;