/**
 * Pack Versioning + Rollback (W1.4 of F-NEW-PRODUCT-AGENT-VISIBILITY-CLUSTER-2026-05-12).
 *
 * Lets a customer publish a new version of a company pack, run it in
 * shadow-mode (record what it WOULD have decided without gating real
 * traffic), then promote to active. One-click rollback to the prior active
 * version. Every transition is an audit event.
 *
 * Storage substrate: in-process Map per-pack. A persistence adapter is a
 * follow-up slice (would wire to Prisma; the API surface is identical).
 *
 * Customer flow:
 *   1. Author v1 of company pack -> publishVersion -> setActive(v1)
 *   2. Author v2 with a new rule -> publishVersion -> setShadow(v2)
 *   3. Observe shadow decisions for N hours -> setActive(v2) (auto-archives v1)
 *   4. Something breaks -> rollback(packId, v1) -> v1 active again, v2 archived
 *
 * @connexum/ai-governance  F-NEW-PRODUCT-PACK-VERSIONING-ROLLBACK
 */
import type { CompliancePackWithClassifiers } from '../classification/pack-driven-classifier.js';
export type VersionState = 'draft' | 'shadow' | 'active' | 'archived';
export interface PackVersionRecord {
    packId: string;
    version: string;
    pack: CompliancePackWithClassifiers;
    state: VersionState;
    /** ISO 8601 publish time. */
    publishedAt: string;
    /** Employee who published this version. */
    publishedBy: string;
    /** Free-text changelog. */
    changelog?: string;
    /** ISO 8601 when state last transitioned. */
    stateChangedAt: string;
    /** Employee who triggered the last state transition. */
    stateChangedBy?: string;
}
export type PackVersionEventKind = 'VERSION_PUBLISHED' | 'VERSION_ACTIVATED' | 'VERSION_SHADOW_ENABLED' | 'VERSION_ARCHIVED' | 'PACK_ROLLED_BACK';
export interface PackVersionEvent {
    kind: PackVersionEventKind;
    packId: string;
    version: string;
    previousVersion?: string;
    actor: string;
    timestamp: string;
    detail?: string;
}
export type PackVersionEventSink = (event: PackVersionEvent) => void;
/**
 * In-process store of pack versions. Tracks one active version + zero-or-one
 * shadow version per packId, plus an arbitrary number of archived versions.
 */
export declare class PackVersionStore {
    private readonly versions;
    private readonly active;
    private readonly shadow;
    private readonly eventSink;
    constructor(eventSink?: PackVersionEventSink);
    publishVersion(pack: CompliancePackWithClassifiers, publishedBy: string, changelog?: string): PackVersionRecord;
    setActive(packId: string, version: string, actor: string): PackVersionRecord;
    setShadow(packId: string, version: string, actor: string): PackVersionRecord;
    /**
     * One-click rollback: promote `toVersion` to active and archive the
     * current active version. Emits PACK_ROLLED_BACK plus the usual
     * activation/archival events.
     */
    rollback(packId: string, toVersion: string, actor: string): PackVersionRecord;
    getActiveVersion(packId: string): PackVersionRecord | undefined;
    getShadowVersion(packId: string): PackVersionRecord | undefined;
    getVersion(packId: string, version: string): PackVersionRecord | undefined;
    listVersions(packId: string): PackVersionRecord[];
    private findRecord;
    private requireRecord;
}
//# sourceMappingURL=pack-versioning.d.ts.map