import { QualityIntelligence as QI } from "@oscharko-dev/keiko-contracts";
import { type PolicyProfile } from "@oscharko-dev/keiko-quality-intelligence";
import type { QualityIntelligenceLocalStore } from "@oscharko-dev/keiko-evidence";
import { type QualityIntelligenceClock, type QualityIntelligenceProvenanceRefs, type QualityIntelligenceRunEventSink, type QualityIntelligenceRunSummary } from "./runtimeCommon.js";
import type { QualityIntelligenceWorkflowLimits } from "./descriptors.js";
type Candidate = QI.QualityIntelligenceTestCaseCandidate;
type EvidenceAtom = QI.QualityIntelligenceEvidenceAtom;
/** A content-bearing ingested atom: the wire-safe atom plus its server-side canonical text. */
export interface QualityIntelligenceIngestedAtom {
    readonly atom: EvidenceAtom;
    readonly canonicalText: string;
}
export interface QualityIntelligenceGenerationPortArgs {
    readonly systemPrompt: string;
    readonly instruction: string;
    readonly evidence: readonly {
        readonly index: number;
        readonly kind: string;
        readonly text: string;
    }[];
    readonly maxCandidates: number;
    readonly signal?: AbortSignal | undefined;
}
export interface QualityIntelligenceGenerationPortResult {
    readonly rawText: string;
    readonly modelCallCount: number;
    readonly modelId?: string | undefined;
    /** Seed used for this generation, or null when the model does not support seeding (Epic #761). */
    readonly seedUsed?: number | null;
    /** Redaction-safe scalars describing request parameters (e.g. responseFormat, seed) (Epic #761). */
    readonly modelParameters?: Record<string, unknown> | undefined;
}
/** Abstract model-generation seam. The server backs it with the real Keiko Model Gateway port. */
export interface QualityIntelligenceGenerationPort {
    readonly generate: (args: QualityIntelligenceGenerationPortArgs) => Promise<QualityIntelligenceGenerationPortResult>;
}
/** Persistence seam for the generated candidate bodies (companion artifact in #274). */
export interface QualityIntelligenceCandidatesSink {
    readonly record: (candidates: readonly Candidate[], generatedAt: string) => void;
}
export interface QualityIntelligenceJudgeSourceContext {
    readonly atomId: string;
    readonly text: string;
}
export interface QualityIntelligenceJudgeInput {
    readonly candidateText: string;
    readonly sourceContext: readonly QualityIntelligenceJudgeSourceContext[];
}
/** Abstract model-judge seam (Epic #736, Issue #747). The server backs it with the gateway judge port. */
export interface QualityIntelligenceJudgePort {
    readonly judge: (input: QualityIntelligenceJudgeInput, signal?: AbortSignal) => Promise<QI.TestQualityJudgeVerdict>;
}
export interface QualityIntelligenceModelRoutedTestDesignInput {
    readonly plan: QI.QualityIntelligenceRunPlan;
    readonly envelopes: readonly QI.QualityIntelligenceSourceEnvelope[];
    readonly ingestedAtoms: readonly QualityIntelligenceIngestedAtom[];
    readonly provenanceRefs: QualityIntelligenceProvenanceRefs;
    readonly profile?: PolicyProfile | undefined;
}
export interface QualityIntelligenceModelRoutedTestDesignDeps {
    readonly sink: QualityIntelligenceRunEventSink;
    readonly evidenceStore: QualityIntelligenceLocalStore;
    readonly candidatesSink: QualityIntelligenceCandidatesSink;
    readonly generate: QualityIntelligenceGenerationPort;
    /** Optional model-judge for test-quality scoring (Epic #736). Absent → judge stage is skipped. */
    readonly judge?: QualityIntelligenceJudgePort | undefined;
    readonly clock?: QualityIntelligenceClock | undefined;
    readonly signal?: AbortSignal | undefined;
    readonly limits?: QualityIntelligenceWorkflowLimits | undefined;
}
/**
 * Map each ingested atom's id to a short, redacted excerpt of its canonical text (#790) so
 * coverage rows and gap findings can name the requirement, not just its opaque id. Atoms whose
 * text collapses to nothing are omitted (the optional field is simply absent downstream).
 */
export declare function excerptsByAtomId(ingestedAtoms: readonly QualityIntelligenceIngestedAtom[]): ReadonlyMap<string, string>;
/**
 * Execute a model-routed QI test-design run end to end. Emits the standard QI run-event envelope,
 * fails the run with a safe reason when the model output is unusable (rather than silently emitting
 * zero candidates), and persists both the run manifest and the generated candidate bodies.
 */
export declare function runQualityIntelligenceModelRoutedTestDesign(input: QualityIntelligenceModelRoutedTestDesignInput, deps: QualityIntelligenceModelRoutedTestDesignDeps): Promise<QualityIntelligenceRunSummary>;
export {};
//# sourceMappingURL=modelRoutedTestDesign.d.ts.map