/** * @fileoverview Canonical TrustBand definitions for the Vorion Platform. * * This file provides the authoritative definition for trust bands (T0-T7), * including thresholds, conversion utilities, and Zod validation schemas. * * Trust bands represent discrete levels of autonomy granted to agents based * on their accumulated trust score. The system uses an 8-tier model with * variable divisions on a 0-1000 scale. * * @module @vorionsys/contracts/canonical/trust-band */ import { z } from 'zod'; /** * Trust bands representing agent autonomy levels. * * The 8-tier system (T0-T7) maps trust scores to discrete autonomy levels: * - T0: Sandbox - Isolated testing, no real operations * - T1: Observed - Under active observation and supervision * - T2: Provisional - Limited operations with strict constraints * - T3: Monitored - Continuous monitoring with expanding freedom * - T4: Standard - Trusted for routine operations * - T5: Trusted - Expanded capabilities with minimal oversight * - T6: Certified - Independent operation with audit trail * - T7: Autonomous - Full autonomy for mission-critical operations * * @enum {number} */ export declare enum TrustBand { /** Sandbox - Isolated testing environment, no real operations */ T0_SANDBOX = 0, /** Observed - Under active observation and supervision */ T1_OBSERVED = 1, /** Provisional - Limited operations with strict constraints */ T2_PROVISIONAL = 2, /** Monitored - Continuous monitoring with expanding freedom */ T3_MONITORED = 3, /** Standard - Trusted for routine operations */ T4_STANDARD = 4, /** Trusted - Expanded capabilities 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 } /** * Threshold configuration for a single trust band. * * Defines the score range and human-readable label for a trust band. */ export interface TrustBandThreshold { /** Minimum score (inclusive) for this band */ readonly min: number; /** Maximum score (inclusive) for this band */ readonly max: number; /** Human-readable label for display */ readonly label: string; /** Brief description of the autonomy level */ readonly description: string; } /** * Trust band thresholds mapping each band to its score range. * * Uses a 0-1000 scale with variable divisions that tighten at higher tiers * to reflect the increasing difficulty of achieving higher trust levels. * * @constant */ export declare const TRUST_BAND_THRESHOLDS: Readonly>; /** * Array of all trust bands in ascending order. * * Useful for iteration and mapping operations. */ export declare const TRUST_BANDS: readonly [TrustBand.T0_SANDBOX, TrustBand.T1_OBSERVED, TrustBand.T2_PROVISIONAL, TrustBand.T3_MONITORED, TrustBand.T4_STANDARD, TrustBand.T5_TRUSTED, TrustBand.T6_CERTIFIED, TrustBand.T7_AUTONOMOUS]; /** * Converts a trust score (0-1000) to its corresponding trust band. * * Uses the canonical threshold boundaries defined in TRUST_BAND_THRESHOLDS. * * @param score - Trust score on 0-1000 scale * @returns The corresponding TrustBand * @throws {Error} If score is outside valid range (0-1000) * * @example * ```typescript * scoreToTrustBand(0); // TrustBand.T0_SANDBOX * scoreToTrustBand(500); // TrustBand.T3_MONITORED * scoreToTrustBand(975); // TrustBand.T7_AUTONOMOUS * ``` */ export declare function scoreToTrustBand(score: number): TrustBand; /** * Converts a trust band to its midpoint score. * * Returns the midpoint of the band's score range, useful for * initializing agents at a given trust level. * * @param band - The trust band to convert * @returns The midpoint score for the band (0-1000 scale) * * @example * ```typescript * trustBandToScore(TrustBand.T0_SANDBOX); // 100 * trustBandToScore(TrustBand.T4_STANDARD); // 725 * trustBandToScore(TrustBand.T7_AUTONOMOUS); // 976 * ``` */ export declare function trustBandToScore(band: TrustBand): number; /** * Gets the minimum score required to achieve a trust band. * * @param band - The target trust band * @returns The minimum score needed to reach this band * * @example * ```typescript * getTrustBandMinScore(TrustBand.T4_STANDARD); // 650 * getTrustBandMinScore(TrustBand.T7_AUTONOMOUS); // 951 * ``` */ export declare function getTrustBandMinScore(band: TrustBand): number; /** * Gets the maximum score for a trust band. * * @param band - The target trust band * @returns The maximum score within this band * * @example * ```typescript * getTrustBandMaxScore(TrustBand.T0_SANDBOX); // 199 * getTrustBandMaxScore(TrustBand.T7_AUTONOMOUS); // 1000 * ``` */ export declare function getTrustBandMaxScore(band: TrustBand): number; /** * Gets the human-readable label for a trust band. * * @param band - The trust band * @returns Human-readable label string * * @example * ```typescript * getTrustBandLabel(TrustBand.T4_STANDARD); // "Standard" * ``` */ export declare function getTrustBandLabel(band: TrustBand): string; /** * Gets the description for a trust band. * * @param band - The trust band * @returns Description of the autonomy level */ export declare function getTrustBandDescription(band: TrustBand): string; /** * Checks if a given band is higher (more trusted) than another. * * @param band - The band to check * @param otherBand - The band to compare against * @returns True if band is higher than otherBand * * @example * ```typescript * isTrustBandHigher(TrustBand.T5_TRUSTED, TrustBand.T2_PROVISIONAL); // true * isTrustBandHigher(TrustBand.T1_OBSERVED, TrustBand.T4_STANDARD); // false * ``` */ export declare function isTrustBandHigher(band: TrustBand, otherBand: TrustBand): boolean; /** * Checks if a given band meets or exceeds a required minimum band. * * @param band - The band to check * @param requiredBand - The minimum required band * @returns True if band meets or exceeds the requirement * * @example * ```typescript * meetsMinimumTrustBand(TrustBand.T5_TRUSTED, TrustBand.T4_STANDARD); // true * meetsMinimumTrustBand(TrustBand.T2_PROVISIONAL, TrustBand.T4_STANDARD); // false * ``` */ export declare function meetsMinimumTrustBand(band: TrustBand, requiredBand: TrustBand): boolean; /** * Zod schema for TrustBand enum validation. * * Validates that a value is a valid TrustBand enum member. * * @example * ```typescript * trustBandSchema.parse(TrustBand.T4_STANDARD); // Success * trustBandSchema.parse(4); // Success * trustBandSchema.parse(8); // Throws ZodError * ``` */ export declare const trustBandSchema: z.ZodNativeEnum; /** * Zod schema for TrustBandThreshold validation. */ export declare const trustBandThresholdSchema: z.ZodEffects, { description: string; min: number; max: number; label: string; }, { description: string; min: number; max: number; label: string; }>; /** * Zod schema for validating band comparison requests. */ export declare const bandComparisonSchema: z.ZodObject<{ band: z.ZodNativeEnum; otherBand: z.ZodNativeEnum; }, "strip", z.ZodTypeAny, { band: TrustBand; otherBand: TrustBand; }, { band: TrustBand; otherBand: TrustBand; }>;