// Copyright 2024-2026 Tymofii Pidlisnyi. Apache-2.0 license. See LICENSE.
// ══════════════════════════════════════════════════════════════════════
// Anomaly v2 — pure primitives (types + uncertainty-compliance predicate).
// ══════════════════════════════════════════════════════════════════════
// The action-history ledger, first-max-authority detector, and
// delegation-concentration (Monolith) scoring have been split out to
// anomaly-detection.ts in @aeoess/gateway (src/sdk-migrated/v2/). This
// module keeps ONLY:
//
//   validateV2UncertaintyCompliance  — pure predicate over attestation shape
//
// Stateful helpers (recordV2Action, getV2ActionHistory,
// checkV2FirstMaxAuthority, computeV2ConcentrationMetrics,
// getV2AnomalyFlags, getV2UnreviewedFlags, reviewV2AnomalyFlag,
// clearV2AnomalyStores) remain exported as deprecation stubs that throw
// and point callers to the gateway module.
// ══════════════════════════════════════════════════════════════════════
const MOVED = 'This function has moved to anomaly-detection in @aeoess/gateway ' +
    '(src/sdk-migrated/v2/anomaly-detection.ts). ' +
    'Pure primitive validateV2UncertaintyCompliance stays in the SDK. See MIGRATION.md.';
// ═══════════════════════════════════════════════
// SEMANTIC UNCERTAINTY VALIDATION (pure)
// ═══════════════════════════════════════════════
export function validateV2UncertaintyCompliance(level, has_attestation, has_outcome_registration, has_external_cosign) {
    const violations = [];
    if ((level === 'medium' || level === 'high' || level === 'critical') && !has_attestation) {
        violations.push(`${level} requires contextual attestation`);
    }
    if ((level === 'medium' || level === 'high' || level === 'critical') && !has_outcome_registration) {
        violations.push(`${level} requires outcome registration`);
    }
    if ((level === 'high' || level === 'critical') && !has_external_cosign) {
        violations.push(`${level} requires external co-signing`);
    }
    return violations;
}
// ══════════════════════════════════════════════════════════════════════
// STATEFUL HELPERS — moved to @aeoess/gateway
// ══════════════════════════════════════════════════════════════════════
export function recordV2Action(_record) { throw new Error(MOVED); }
export function getV2ActionHistory(_agentId) {
    throw new Error(MOVED);
}
export function getV2AnomalyFlags(_agentId) {
    throw new Error(MOVED);
}
export function getV2UnreviewedFlags(_agentId) {
    throw new Error(MOVED);
}
export function checkV2FirstMaxAuthority(_record) {
    throw new Error(MOVED);
}
export function computeV2ConcentrationMetrics(_agentId, _flagThreshold) { throw new Error(MOVED); }
export function reviewV2AnomalyFlag(_flagId, _outcome) {
    throw new Error(MOVED);
}
export function clearV2AnomalyStores() {
    // No-op: SDK no longer holds state. Gateway owns the store.
}
//# sourceMappingURL=anomaly-v2.js.map