/**
 * 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.
 */
// ─── Typed errors ─────────────────────────────────────────────────────────────
export class TenantNotFoundError extends Error {
    tenantId;
    constructor(tenantId) {
        super(`Tenant not found: ${tenantId}`);
        this.tenantId = tenantId;
        this.name = "TenantNotFoundError";
        Object.setPrototypeOf(this, new.target.prototype);
    }
}
export class DegradedModeExhaustedError extends Error {
    tenantId;
    totalDegradedSeconds;
    capSeconds;
    constructor(tenantId, totalDegradedSeconds, capSeconds) {
        super(`Degraded mode cap exhausted for tenant ${tenantId}: ` +
            `${totalDegradedSeconds}s ≥ ${capSeconds}s (30 days)`);
        this.tenantId = tenantId;
        this.totalDegradedSeconds = totalDegradedSeconds;
        this.capSeconds = capSeconds;
        this.name = "DegradedModeExhaustedError";
        Object.setPrototypeOf(this, new.target.prototype);
    }
}
export class InvalidGlacisAttestationError extends Error {
    tenantId;
    reason;
    constructor(tenantId, reason) {
        super(`Invalid Glacis attestation for tenant ${tenantId}: ${reason}`);
        this.tenantId = tenantId;
        this.reason = reason;
        this.name = "InvalidGlacisAttestationError";
        Object.setPrototypeOf(this, new.target.prototype);
    }
}
//# sourceMappingURL=tenant-context.js.map