/**
 * TenantContextPort — tenant isolation primitive (S2 spec).
 *
 * TenantContext is the canonical cross-product isolation identifier.
 * canonical_id = poseidon(glacis_nullifier_root, "vauban.platform.v1")
 *
 * 3 modes: 'verified' (Glacis PoH passed) | 'degraded_verified' (fallback during Glacis downtime)
 * | 'unverified' (dev/test, limited capabilities).
 *
 * §5.4 Cumulative degraded cap: ≤30 days per 90-day rolling window.
 * Invariants: I-S2-1..10 per S2 spec.
 */
export type TenantMode = "verified" | "degraded_verified" | "unverified";
export interface TenantContext {
    readonly canonical_id: string;
    readonly mode: TenantMode;
    readonly kek_id: string;
    readonly jurisdictions: string[];
    readonly verified_human: boolean;
    readonly glacis_attestation_ref?: string;
    readonly degraded_since?: Date;
}
export interface DegradedMetrics {
    readonly total_degraded_last_90d: number;
    readonly episodes_count: number;
    readonly pct_time_degraded: number;
}
export interface DegradedModeEnteredClaim {
    readonly tenant_id: string;
    readonly reason: string;
    readonly entered_at: Date;
    readonly window_remaining_seconds?: number;
}
export interface DegradedModeExhaustedClaim {
    readonly tenant_id: string;
    readonly total_degraded_90d_seconds: number;
    readonly cap_seconds: number;
    readonly fallback_mode: "unverified";
    readonly exhausted_at: Date;
}
export interface TenantContextPort {
    /**
     * Get current tenant context by ID.
     * Returns null if tenant does not exist or has been revoked.
     */
    getCurrent(tenantId: string): Promise<TenantContext | null>;
    /**
     * Enter degraded mode due to Glacis downtime or other temporary issue.
     * Emits DegradedModeEnteredClaim.
     * Throws TenantNotFoundError if tenant does not exist.
     * Throws DegradedModeExhaustedError if 30/90d cap already exceeded.
     *
     * Precondition: tenant.mode = 'verified'
     * Effect: tenant.mode = 'degraded_verified', tenant.degraded_since = now()
     */
    enterDegradedMode(tenantId: string, reason: string): Promise<void>;
    /**
     * Restore verified mode from degraded mode after Glacis recovery.
     * Verifies the provided Glacis attestation is valid before accepting.
     *
     * Precondition: tenant.mode = 'degraded_verified'
     * Effect: tenant.mode = 'verified', tenant.degraded_since = null
     * Throws InvalidGlacisAttestationError if attestation invalid or expired
     */
    restoreVerified(tenantId: string, glacisAttestation: {
        txRef: string;
        nullifierRoot: string;
        blockNumber: number;
    }): Promise<void>;
    /**
     * Get KEK (Key Encryption Key) identifier for a tenant.
     * Returns the KMS reference string, NOT the key material itself.
     * Throws TenantNotFoundError if tenant does not exist.
     */
    getKek(tenantId: string): Promise<string>;
    /**
     * Compute cumulative degraded time in the rolling window.
     * windowDays defaults to 90 if not specified.
     * Returns time in seconds.
     */
    getCumulativeDegradedTime(tenantId: string, windowDays?: number): Promise<number>;
    /**
     * Get metrics for custody due diligence reporting.
     * Throws TenantNotFoundError if tenant does not exist.
     */
    getDegradedMetrics(tenantId: string): Promise<DegradedMetrics>;
}
export declare class TenantNotFoundError extends Error {
    readonly tenantId: string;
    constructor(tenantId: string);
}
export declare class DegradedModeExhaustedError extends Error {
    readonly tenantId: string;
    readonly totalDegradedSeconds: number;
    readonly capSeconds: number;
    constructor(tenantId: string, totalDegradedSeconds: number, capSeconds: number);
}
export declare class InvalidGlacisAttestationError extends Error {
    readonly tenantId: string;
    readonly reason: string;
    constructor(tenantId: string, reason: string);
}
//# sourceMappingURL=tenant-context.d.ts.map