import { type EntryKind, type EntryStatus, type TrustLevel } from '../serialization/validate.js'; export declare const CONTEXT_RANKING_VERSION: "context-ranking-v1"; /** Integer score weights. Components are additive and deliberately bounded. */ export declare const CONTEXT_RANKING_WEIGHTS: Readonly<{ readonly statusVerified: 100; readonly statusCandidate: 40; readonly trustSystemVerified: 30; readonly trustSourceVerified: 25; readonly trustUserAsserted: 15; readonly confidence: 20; readonly taskAffinity: 12; readonly recommendedTag: 10; readonly pathOverlap: 12; readonly errorSignature: 15; readonly feedbackHelpful: 3; readonly feedbackIrrelevant: -3; readonly feedbackStale: -4; readonly feedbackConflicting: -4; readonly recency: 5; readonly contradiction: 0; }>; export declare const CONTEXT_RANKING_COMPONENTS: readonly ["status", "trust", "confidence", "taskAffinity", "recommendedTags", "pathOverlap", "errorSignature", "feedback", "recency", "contradiction"]; /** Additive v2 delivery components; v1 rows continue to use the list above. */ export declare const CONTEXT_RANKING_COMPONENTS_V2: readonly ["status", "trust", "confidence", "retrieval", "taskAffinity", "recommendedTags", "scopeAffinity", "applicability", "pathOverlap", "errorSignature", "exactSignal", "feedback", "recency", "contradiction"]; export declare const CONTEXT_SELECTION_REASON_ORDER: readonly ["project_origin", "ecosystem_origin", "global_origin", "scope_affinity", "applicability_match", "applicability_unknown", "applicability_mismatch", "unscoped_global_prior", "exact_signal_match", "word_match", "semantic_match", "lexical_match", "cjk_window_match", "substring_match", "literal_fallback_match", "tag_match", "verified", "candidate", "system_verified_trust", "source_verified_trust", "user_asserted_trust", "confidence", "task_kind_affinity", "task_tag_affinity", "recommended_tag_match", "target_match", "changed_path_match", "error_signature_match", "helpful_feedback", "irrelevant_feedback", "stale_feedback", "conflicting_feedback", "recent", "contradiction_warning", "revision_changed"]; export type ContextRankingComponent = (typeof CONTEXT_RANKING_COMPONENTS)[number]; export type ContextRankingV2Component = (typeof CONTEXT_RANKING_COMPONENTS_V2)[number]; export type FeedbackVerdict = 'helpful' | 'irrelevant' | 'stale' | 'conflicting'; export interface ContextCandidateSnapshot { id: string; revision: number; kind: EntryKind; status: EntryStatus; trustLevel: TrustLevel; confidence: number; title: string; summary: string | null; body: string; tags: string[]; scope: Record; updatedAt: string; selectionReasons?: string[]; contradiction?: boolean; origin?: 'project' | 'ecosystem' | 'global'; } export interface PriorDeliveredEntry { entryId: string; revision: number; } export interface ContextFeedback { entryId: string; verdict: FeedbackVerdict; } export interface RankedScoreComponents { status: number; trust: number; confidence: number; taskAffinity: number; recommendedTags: number; pathOverlap: number; errorSignature: number; feedback: number; recency: number; contradiction: number; } export interface RankedCandidateContent { title: string; summary: string | null; bodyPreview: string; characterCount: number; truncated: boolean; } export interface RankedCandidate { entryId: string; revision: number; kind: EntryKind; status: EntryStatus; trustLevel: TrustLevel; confidence: number; tags: string[]; scope: Record; updatedAt: string; totalScore: number; scoreComponents: RankedScoreComponents; selectionReasons: string[]; content: RankedCandidateContent; origin?: 'project' | 'ecosystem' | 'global'; } export declare const CONTEXT_RANKING_DEFAULT_CHARACTER_BUDGET = 8000; export declare const CONTEXT_RANKING_MAX_CHARACTER_BUDGET = 100000; export declare function rankContextCandidates(input: unknown): RankedCandidate[]; //# sourceMappingURL=ranking.d.ts.map