/**
 * IngestClassifier -- P4-RET-01
 *
 * Wires DataClassifier at the audit-event ingress point.
 *
 * classifyAndTag() is the single entry point for all audit events entering
 * the retention engine. It:
 *   1. Resolves the DataClassTag for the event using DataClassifier.classify().
 *   2. Attaches dataClass[] to the event metadata.
 *   3. Enforces the PHI-without-HIPAA block: if the resolved dataClass is
 *      PhiRecord and 'hipaa' is not in activePackIds, the call throws
 *      PhiWithoutHipaaError (fail-closed -- no PHI enters the system without
 *      an active HIPAA binding).
 *   4. Returns the enriched event with dataClass stamped.
 *
 * PT-RET-5 (Unicode lookalike evasion):
 *   The classifier matches write-site strings against the rule table using
 *   exact-string and RegExp matching only. Write-site strings are
 *   normalised to NFC Unicode before matching so Unicode lookalike attacks
 *   (e.g. using Cyrillic 'а' U+0430 to impersonate ASCII 'a' U+0061) are
 *   detected by the rule-miss guard and throw UnclassifiedWriteError.
 *
 * @connexum/ai-governance P4-RET-01
 */
import { DataClassifier, UnboundDataError, UnclassifiedWriteError, RetentionError } from './classifier';
import { type DataClassTag, type SovereigntyZone } from './data-class';
import type { ClassificationRule } from './classification-rules';
/**
 * Thrown when a PHI record arrives without an active HIPAA binding.
 *
 * Fail-closed: PHI must not enter the system without HIPAA governance.
 * The calling layer must activate the hipaa compliance pack for the tenant
 * before storing any protected health information.
 *
 * PT-RET-5 / P4-RET-01 AC 6.
 */
export declare class PhiWithoutHipaaError extends RetentionError {
    readonly tenantId: string;
    constructor(tenantId: string);
}
/**
 * Minimal context supplied by the event source.
 */
export interface ClassifyAndTagInput {
    /**
     * Stable write-site identifier (e.g. 'audit:chain:append').
     * Will be NFC-normalised before rule lookup to defeat Unicode lookalike
     * substitutions (PT-RET-5).
     */
    writeSite: string;
    /** Owning tenant ID. */
    tenantId: string;
    /**
     * Contract under which this event was produced.
     * If not known at call time, callers should use a sentinel like
     * 'default-contract' rather than omitting the field.
     */
    contractId: string;
    /**
     * Pack IDs active for this tenant at event ingestion time.
     * The classifier intersects these with the resolver output.
     * If empty, UnboundDataError is thrown.
     */
    activePackIds: string[];
    /**
     * Optional: explicit sovereignty hint from the caller.
     * When omitted the rule's sovereigntyResolver determines the zone.
     */
    sovereigntyHint?: SovereigntyZone;
}
/**
 * The original event payload type the caller wants to enrich.
 * We accept Record<string, unknown> to remain agnostic about the actual
 * event schema (EventBus payload, AuditChainEntry, etc.).
 */
export type AuditEventRecord = Record<string, unknown>;
/**
 * Return value from classifyAndTag(). Combines the original event with
 * the stamped DataClassTag and the resolved dataClass labels.
 */
export interface ClassifyAndTagResult<T extends AuditEventRecord = AuditEventRecord> {
    /** The original event, unchanged. */
    event: T;
    /** The resolved DataClassTag. */
    tag: DataClassTag;
    /**
     * Array of data class labels attached to the event.
     * Currently always a single-element array (one class per write site)
     * but typed as array for forward-compatibility with multi-class tagging.
     */
    dataClass: string[];
}
/**
 * Return (or create) the shared DataClassifier instance.
 * Custom rules can be injected via `options.rules` in tests.
 */
export declare function getClassifier(options?: {
    rules?: ClassificationRule[];
}): DataClassifier;
/**
 * Reset the shared DataClassifier instance. For tests only.
 * @internal
 */
export declare function __resetClassifierForTest(): void;
/**
 * Classify an incoming audit event and stamp a DataClassTag onto it.
 *
 * Wraps DataClassifier.classify() with:
 *   - NFC Unicode normalisation of writeSite (PT-RET-5 lookalike guard)
 *   - PHI-without-HIPAA enforcement (PhiWithoutHipaaError)
 *   - dataClass[] attachment to the result
 *
 * Throws:
 *   - UnclassifiedWriteError: write site has no rule (fail-closed)
 *   - UnboundDataError: resolved packBinding is empty
 *   - PhiWithoutHipaaError: PHI record without active HIPAA pack
 *
 * @param event  The audit event to enrich (not mutated).
 * @param ctx    Classification context.
 * @param opts   Optional: inject custom classifier rules for tests.
 */
export declare function classifyAndTag<T extends AuditEventRecord = AuditEventRecord>(event: T, ctx: ClassifyAndTagInput, opts?: {
    rules?: ClassificationRule[];
}): ClassifyAndTagResult<T>;
export { UnclassifiedWriteError, UnboundDataError };
//# sourceMappingURL=ingest-classifier.d.ts.map