import { type DatabaseAdapter } from '../db-manager.js'; import type { CanonicalCaseResolution, CaseAssembly, CaseAssemblyMembership, CaseBlocker, CaseConfidence, CaseCorrectionRecord, CaseMembershipRecord, CaseMembershipSourceType, CasePrimaryActor, CaseProposalKind, CaseProposalQueueRecord, CaseTruthRecord } from './types.js'; type CaseStoreAdapter = Pick; export interface UpsertCaseTruthSlowFieldsInput { case_id: string; current_wiki_path?: string | null; title: string; status_reason?: string | null; primary_actors?: CasePrimaryActor[] | string | null; blockers?: CaseBlocker[] | string | null; confidence?: CaseConfidence | null; scope_refs?: Array<{ kind: string; id: string; }> | string | null; wiki_path_history?: Array<{ path: string; valid_from: string; valid_to: string | null; }> | string | null; compiled_at: string; } export interface UpsertExplicitCaseMembershipsInput { case_id: string; rows: Array<{ source_type: CaseMembershipSourceType; source_id: string; role?: string | null; confidence?: number | null; reason?: string | null; }>; } export interface EnqueueCaseProposalInput { project: string; proposal_kind: CaseProposalKind; proposed_payload: string; stable_fingerprint_input: unknown; conflicting_case_id?: string | null; } export interface AssembleCaseOptions { since?: string; limit?: number; } export declare function resolveCanonicalCaseChain(adapter: CaseStoreAdapter, caseId: string, maxDepth?: number): CanonicalCaseResolution; export declare function expandCaseChainForAssembly(adapter: Pick, terminalCaseId: string, resolvedChain: string[]): string[]; export declare function upsertCaseTruthSlowFields(input: UpsertCaseTruthSlowFieldsInput): CaseTruthRecord; export declare function upsertCaseTruthSlowFields(adapter: CaseStoreAdapter, input: UpsertCaseTruthSlowFieldsInput): CaseTruthRecord; export declare function upsertExplicitCaseMemberships(input: UpsertExplicitCaseMembershipsInput): CaseMembershipRecord[]; export declare function upsertExplicitCaseMemberships(adapter: CaseStoreAdapter, input: UpsertExplicitCaseMembershipsInput): CaseMembershipRecord[]; export declare function listActiveMembershipsForCaseChain(adapter: CaseStoreAdapter, caseIds: string[], limit?: number): CaseAssemblyMembership[]; export interface ListActiveCorrectionsForCaseResult { terminal_case_id: string; resolved_via_case_id: string | null; chain: string[]; corrections: CaseCorrectionRecord[]; } /** * Resolves the canonical merge chain for caseId (both up to terminal and * down to merged losers) and returns every active, unreverted correction * across the entire chain. HITL surfaces must use this rather than a * direct `WHERE case_id = ?` query so post-merge corrections on loser * cases remain visible and actionable from the survivor's view. */ export declare function listActiveCorrectionsForCase(adapter: CaseStoreAdapter, caseId: string): ListActiveCorrectionsForCaseResult; export declare function listActiveCorrectionsForCaseChain(adapter: CaseStoreAdapter, caseIds: string[]): CaseCorrectionRecord[]; export declare function enqueueCaseProposal(adapter: CaseStoreAdapter, input: EnqueueCaseProposalInput): { proposal_id: string; inserted: boolean; }; export declare function listUnresolvedCaseProposals(adapter: CaseStoreAdapter, project: string): CaseProposalQueueRecord[]; export declare function assembleCase(caseId: string, options?: AssembleCaseOptions): CaseAssembly; export declare function assembleCase(adapter: CaseStoreAdapter, caseId: string, options?: AssembleCaseOptions): CaseAssembly; export {}; //# sourceMappingURL=store.d.ts.map