/**
 * Realize-phase audit recorder - module-level hook that the matcher
 * functions in libs/instance-factories/services/templates/{prisma,
 * mongodb-native, postgres-native}/step-conventions.ts invoke to record
 * their dispatch decisions at the moment they're made.
 *
 * Forward-logging discipline (see
 * specverse-self/docs/plans/2026-05-03-PIPELINE-AUDIT-TRAIL-INSTRUMENTATION.md):
 * each step's level-2 (convention match) vs level-3 (AI fallback) decision
 * is captured by the same call site that uses the result for code
 * generation. No parallel walk, no inferred verdict.
 *
 * Constraint: module-level state is single-recorder-per-process. realize
 * is single-shot per CLI invocation, so this is currently fine. If we
 * later run multiple realize phases concurrently in one process, switch
 * to AsyncLocalStorage-backed context.
 */
export interface RealizeStepDecision {
    /** From ctx.serviceName, the spec owner that contains this action. */
    ownerName: string;
    /** From ctx.operationName, the action being walked. */
    actionName: string;
    /** From ctx.stepNum, 1-based index within the action steps block. */
    stepOrdinal: number;
    /** The literal step bullet text. */
    stepText: string;
    /** True when a convention pattern matched (level 2). */
    matched: boolean;
    /** When matched, the convention helper invoked. */
    helperMethod?: string;
    /** When unmatched, the AI behavior function name realize will declare. */
    aiFunctionName?: string;
    /** Which generator phase invoked the matcher (for cross-pass diff detection). */
    generatorPhase: 'pre-scan' | 'controller-gen' | 'service-gen' | 'ai-behaviors-gen';
}
export interface RealizeStepRecorder {
    recordStepResolution(d: RealizeStepDecision): void;
    recordModelFactory(args: {
        modelFqn: string;
        factory: string;
    }): void;
    recordCollision(args: {
        kind: string;
        fqn: string;
        declaredIn: string[];
        winner: string;
    }): void;
    recordFactoryMappingMiss(args: {
        manifestPath: string;
        manifestRef: string;
        reason: string;
    }): void;
}
/** Attach a recorder for the duration of a realize phase. Pass null to clear. */
export declare function setRealizeRecorder(r: RealizeStepRecorder | null): void;
/** Called by step-conventions.ts after each matcher decision. No-op when
 *  no recorder is attached (the common case during normal generation
 *  outside the realize orchestrator). */
export declare function recordRealizeStep(d: RealizeStepDecision): void;
export declare function recordRealizeModelFactory(args: {
    modelFqn: string;
    factory: string;
}): void;
export declare function recordRealizeCollision(args: {
    kind: string;
    fqn: string;
    declaredIn: string[];
    winner: string;
}): void;
export declare function recordRealizeFactoryMappingMiss(args: {
    manifestPath: string;
    manifestRef: string;
    reason: string;
}): void;
/**
 * Default recorder. Collects in memory, builds a serialisable
 * RealizeDecisions document at the end. Used by the realize
 * orchestrator unless a custom recorder is provided.
 */
export interface RealizeDecisions {
    schemaVersion: '1.0';
    stage: 'realize';
    models: Array<{
        fqn: string;
        factory: string;
        level: 1;
    }>;
    actions: Array<{
        fqn: string;
        stepCount: number;
        stepResolutions: Array<{
            ordinal: number;
            bullet: string;
            level: 2 | 3;
            convention?: string;
            aiFunctionName?: string;
            generatorPhase: string;
        }>;
        summary: {
            L2: number;
            L3: number;
        };
    }>;
    factoryMappings: Array<{
        manifestPath: string;
        manifestRef: string;
        registryMatch: string | null;
        issue: string;
    }>;
    collisions: Array<{
        kind: string;
        fqn: string;
        declaredIn: string[];
        winner: string;
    }>;
}
export interface RealizeCoverage {
    schemaVersion: '1.0';
    totals: {
        models: number;
        actions: number;
        stepBullets: number;
        L1Symbols: number;
        L2Bullets: number;
        L3Bullets: number;
        factoryMappingsResolved: number;
        factoryMappingsUnresolved: number;
        collisions: number;
    };
    byOwner: Array<{
        owner: string;
        actions: number;
        L2: number;
        L3: number;
    }>;
}
export declare class InMemoryRealizeRecorder implements RealizeStepRecorder {
    private steps;
    private models;
    private collisions;
    private factoryMisses;
    recordStepResolution(d: RealizeStepDecision): void;
    recordModelFactory(args: {
        modelFqn: string;
        factory: string;
    }): void;
    recordCollision(args: {
        kind: string;
        fqn: string;
        declaredIn: string[];
        winner: string;
    }): void;
    recordFactoryMappingMiss(args: {
        manifestPath: string;
        manifestRef: string;
        reason: string;
    }): void;
    /** Build the realize-decisions.json + realize-coverage.json shapes. */
    build(): {
        decisions: RealizeDecisions;
        coverage: RealizeCoverage;
    };
}
//# sourceMappingURL=realize-recorder.d.ts.map