import type { CodaliStorageDatasetKind, CodaliStorageExportKind, CodaliStorageObjectPrivacyFlags } from "../storage/CodaliStorageContracts.js"; import type { DatasetEligibilityGateAcceptedExample } from "./DatasetEligibilityGate.js"; import type { DatasetExportManifestReaderResult } from "./DatasetExportManifestReader.js"; export declare const CODALI_DOCDEX_RETRIEVAL_CANDIDATE_SCHEMA_VERSION: "codali.improvement.docdex_retrieval_candidate.v1"; export declare const CODALI_DOCDEX_RETRIEVAL_PROPOSAL_ARTIFACT: "docdex-retrieval"; export declare const CODALI_DOCDEX_RETRIEVAL_SOURCE_ARTIFACT_TYPES: readonly ["docdex_retrieval", "query_expander", "query_expander_sft", "rag_reranker", "rerank", "reranker", "retrieval", "freshness", "duplicate_detection", "source_selection"]; export declare const CODALI_DOCDEX_RETRIEVAL_SUPPORTED_EXPORT_KINDS: readonly ["query-expander-sft", "rag-reranker"]; export type CodaliDocdexRetrievalProposalArtifact = typeof CODALI_DOCDEX_RETRIEVAL_PROPOSAL_ARTIFACT; export type CodaliDocdexRetrievalCandidateKind = "docdex_retrieval"; export type CodaliDocdexRetrievalRegressionKind = "freshness" | "duplicate_detection" | "source_selection"; export interface CodaliDocdexRetrievalObjectRefSummary { refId: string; kind: string; contentHash: string; byteSize: number; mimeType: string; deletionGroupId: string; privacyFlags: CodaliStorageObjectPrivacyFlags; uri?: string; mediaType?: string; metadataKeys: string[]; } export interface CodaliDocdexRetrievalPrivacyScope { tenantScoped: boolean; broadReuseAllowed: boolean; rawTextAllowed: boolean; reasons: string[]; policyTags: string[]; } export interface CodaliDocdexRetrievalQueryVariant { variantId: string; queryHash: string; text?: string; } export interface CodaliDocdexRetrievalQuerySummary { queryHash: string; text?: string; storage: "inline_allowed" | "object_ref_or_hash_only"; variants: CodaliDocdexRetrievalQueryVariant[]; } export interface CodaliDocdexRetrievalSourceSelection { sourceHashes: string[]; sourceIds?: string[]; sourceTypes: string[]; selectedCount: number; } export interface CodaliDocdexRetrievalScorecard { recall?: { before?: number; after?: number; delta?: number; }; precision?: { before?: number; after?: number; delta?: number; }; freshness?: { before?: number; after?: number; delta?: number; }; } export interface CodaliDocdexRetrievalSourceExample { recordId: string; sourceGatewayRecordId?: string; datasetKind?: CodaliStorageDatasetKind; artifactTypes: string[]; preferenceSignals: string[]; priorityScore: number; fineTuningPriority: "high" | "medium" | "low"; lineageKey: DatasetEligibilityGateAcceptedExample["lineageKey"]; privacyScope: CodaliDocdexRetrievalPrivacyScope; query: CodaliDocdexRetrievalQuerySummary; sourceSelection: CodaliDocdexRetrievalSourceSelection; scorecard: CodaliDocdexRetrievalScorecard; objectRefs: { inputRef?: CodaliDocdexRetrievalObjectRefSummary; outputRef?: CodaliDocdexRetrievalObjectRefSummary; evidenceRefs: CodaliDocdexRetrievalObjectRefSummary[]; }; metadataShape: { keys: string[]; retrievalKeys: string[]; scorecardKeys: string[]; }; } export interface CodaliDocdexQueryExpanderEvalCandidate { suiteId: string; sourceExportId: string; fineTuningPriority: { strategy: "human_reviewed_then_accepted_correction_then_high_confidence"; orderedRecordIds: string[]; }; cases: Array<{ caseId: string; sourceRecordId: string; query: CodaliDocdexRetrievalQuerySummary; expectedExpansionCount: number; expectedRecallDeltaMin?: number; privacyScope: CodaliDocdexRetrievalPrivacyScope; objectRefs: CodaliDocdexRetrievalSourceExample["objectRefs"]; }>; } export interface CodaliDocdexRerankLabel { labelId: string; source: "accepted_evidence" | "rejected_evidence"; label: "positive" | "negative"; recordId?: string; dedupeKey?: string; queryHash?: string; sourceHashes: string[]; reasonCodes: string[]; weight: number; } export interface CodaliDocdexRetrievalRegressionCase { caseId: string; kind: CodaliDocdexRetrievalRegressionKind; sourceRecordIds: string[]; assertion: string; queryHash?: string; sourceHashes: string[]; reasonCodes: string[]; } export interface CodaliDocdexEvalCommandSpec { commandId: string; command: "docdexd"; args: string[]; dryRunSafe: true; requiresTenantScopedFixture: boolean; expectedScorecards: Array<"recall" | "precision" | "freshness">; } export interface CodaliDocdexRetrievalImprovementCandidateSummary { candidateId: string; candidateKind: CodaliDocdexRetrievalCandidateKind; status: "proposed" | "blocked"; sourceExportIds: string[]; sourceRecordIds: string[]; artifactIds: string[]; exampleCount: number; objectBytes: number; queryExpanderCaseCount: number; rerankLabelCount: number; regressionCaseCount: number; blockedReasons: string[]; } export interface CodaliDocdexRetrievalCandidateBundle { schemaVersion: typeof CODALI_DOCDEX_RETRIEVAL_CANDIDATE_SCHEMA_VERSION; artifact: CodaliDocdexRetrievalProposalArtifact; source: { exportId: string; manifestId: string; manifestPath: string; exportKind: CodaliStorageExportKind; checksum: string; recordCount: number; primaryArtifactRef: CodaliDocdexRetrievalObjectRefSummary; }; generationPolicy: { deterministic: true; modifiesRuntimePrompts: false; modifiesRuntimeCode: false; bodyPolicy: "object_refs_and_hashes_only_for_private_sources"; tenantPrivateExamplesScoped: true; uploadEnabled: false; finalSynthesizerFineTuning: false; }; expectedShape: { schemaVersion: typeof CODALI_DOCDEX_RETRIEVAL_CANDIDATE_SCHEMA_VERSION; artifact: CodaliDocdexRetrievalProposalArtifact; requiredFields: string[]; sourceExampleRequiredFields: string[]; evalCommandRequiredFields: string[]; }; sourceExamples: CodaliDocdexRetrievalSourceExample[]; queryExpanderEval: CodaliDocdexQueryExpanderEvalCandidate; rerankLabels: CodaliDocdexRerankLabel[]; regressionCases: CodaliDocdexRetrievalRegressionCase[]; docdexEvalCommands: CodaliDocdexEvalCommandSpec[]; scorecardSummary: { recallDelta: number; precisionDelta: number; freshnessDelta: number; }; candidates: CodaliDocdexRetrievalImprovementCandidateSummary[]; } export interface BuildCodaliDocdexRetrievalCandidateBundleInput { inspection: DatasetExportManifestReaderResult; artifact?: CodaliDocdexRetrievalProposalArtifact; } export declare const buildCodaliDocdexRetrievalCandidateBundle: ({ inspection, artifact, }: BuildCodaliDocdexRetrievalCandidateBundleInput) => CodaliDocdexRetrievalCandidateBundle; //# sourceMappingURL=DocdexRetrievalCandidateBuilder.d.ts.map