import { type ResolvedTrialPolicy } from './resolved-policy.js'; export declare const LEASE_ECHO_SCHEMA_VERSION = "cortex-bench-lease-echo/1"; export declare const LEASE_ECHO_PATH = "/_cortex/lease-echo"; /** * Everything here is read on a container clock: the two instants come from the frozen policy's own * compile-time wall-clock reads, and the remaining budget from the monotonic clock. No host instant * is read, and none is sent — only durations may cross to the host, because a duration is a * difference of two readings of one clock and so survives any offset between the two clocks. */ export interface LeaseEchoDocument { schema_version: typeof LEASE_ECHO_SCHEMA_VERSION; trial_id: string; compiled_at_epoch_ms: number; absolute_epoch_ms: number; remaining_ms: number; } export interface LeaseEchoResult { ok: boolean; lease_state: 'reconciled' | 'clamped'; armed_remaining_ms: number; } export interface LeaseEchoTransportResponse { status: number; body: string; } export interface LeaseEchoDependencies { monotonic_ns(): bigint; post?(url: string, headers: Record, body: string): Promise; } export declare class LeaseEchoRefused extends Error { readonly status: number; readonly reason: string; constructor(status: number, reason: string); } export declare function composeLeaseEcho(policy: ResolvedTrialPolicy, monotonicNowNs: bigint): LeaseEchoDocument; export declare function leaseEchoUrl(proxyBaseUrl: string): string; /** The echo runs before the model process is admitted, so it may not stall the trial's startup. */ export declare const LEASE_ECHO_TIMEOUT_MS = 10000; /** * Publish the echo to the trial's own proxy. The route authenticates it exactly as it authenticates * a model call, so the container presents the same dummy bearer it presents there. */ export declare function publishLeaseEcho(policy: ResolvedTrialPolicy, deps: LeaseEchoDependencies): Promise;