import type { QualityIntelligence } from "@oscharko-dev/keiko-contracts";
type Envelope = QualityIntelligence.QualityIntelligenceSourceEnvelope;
type EnvelopeId = QualityIntelligence.QualityIntelligenceSourceEnvelopeId;
/** A logical group of envelopes (e.g. one Conversation Center thread, one repo scan). */
export interface SourceGroup {
    /** Stable label for the group; used as the provenance origin. */
    readonly groupLabel: string;
    readonly envelopes: readonly Envelope[];
}
export interface ProvenanceEntry {
    readonly envelopeId: EnvelopeId;
    /** First group label that contributed this envelope. */
    readonly firstGroupLabel: string;
    /** All distinct group labels that contributed this envelope (insertion-stable). */
    readonly contributingGroupLabels: readonly string[];
}
export interface ReconciledSourceSet {
    /** Distinct envelopes in encounter order across the input groups. */
    readonly envelopes: readonly Envelope[];
    /** One provenance entry per distinct envelope id. */
    readonly provenance: readonly ProvenanceEntry[];
    /** Envelope ids that appeared in more than one group. */
    readonly duplicatedAcrossGroups: readonly EnvelopeId[];
    /** Envelopes that were skipped because the same id appeared with mismatched kind. */
    readonly conflictingEnvelopeIds: readonly EnvelopeId[];
}
/**
 * Merge multiple envelope groups into a single non-overlapping set. Pure.
 *
 * Invariants:
 *   * Order: first appearance wins (encounter order across groups, then within group).
 *   * Conflict: same id with different kind = both contributors are recorded in
 *     `conflictingEnvelopeIds` and neither appears in `envelopes`.
 *   * Duplicate: same id with same kind = first envelope kept; later groups appear in
 *     the provenance entry's `contributingGroupLabels`.
 */
export declare const reconcileSourceGroups: (groups: readonly SourceGroup[]) => ReconciledSourceSet;
export {};
//# sourceMappingURL=sourceReconciliation.d.ts.map