export interface DecisionNode { node_kind: "decision"; id: string; author?: string | null; author_trust?: "extracted" | "confirmed" | null; statement: string; rationale: string | null; rationale_trust?: "extracted" | "confirmed" | null; rationale_missing: boolean; scope: string; component_ref: string; alternatives_rejected: string[]; status: "candidate" | "active" | "superseded" | "contested"; contested_by?: string | null; contested_reason?: string | null; superseded_by: string | null; created_at: string; embedding?: number[] | null; } export interface EvidenceNode { node_kind: "evidence"; id: string; type: "quant" | "qual" | "imported"; source_ref: string; result_summary: string; confidence: number | "low"; confounds: string[]; timestamp: string; } export interface SourceNode { node_kind: "source"; id: string; kind: string; ref: string; commit_hashes?: string[]; thread_count?: number; created_at: string; } export type GraphNode = DecisionNode | EvidenceNode | SourceNode; export type AddEvidenceResult = { status: "created" | "existing"; evidence: EvidenceNode; } | { status: "not_found"; } | { status: "not_decision"; node_kind: GraphNode["node_kind"]; }; export interface GraphEdge { id: string; from: string; to: string; type: "supersedes" | "scoped_alongside" | "supports" | "contradicts" | "derived_from"; created_at: string; } export interface Embedder { embed(text: string): Promise; } export declare class NullEmbedder implements Embedder { embed(_text: string): Promise; } export declare class LexicalEmbedder implements Embedder { private dimensions; constructor(dimensions?: number); embed(text: string): Promise; } export declare function cosineSimilarity(a: number[] | null | undefined, b: number[] | null | undefined): number; export declare function similarityThreshold(): number; export interface DecisionGraphStore { addNode(node: GraphNode): Promise; addEvidenceWithEdge(decisionId: string, evidence: EvidenceNode, edge: GraphEdge): Promise; getNode(id: string): Promise; updateNode(id: string, patch: Partial): Promise; addEdge(edge: GraphEdge): Promise; listEdges(edgeType?: GraphEdge["type"]): Promise; neighbors(nodeId: string, edgeType?: GraphEdge["type"]): Promise; listActiveDecisions(): Promise; listDecisions(status: DecisionNode["status"]): Promise; findSimilarActiveDecisions(node: DecisionNode, threshold: number, excludeId?: string): Promise>; } export interface GapScanConfig { staleAfterDays: number; thinRationaleMinChars: number; weights: { coverage_gap: number; contested_with_evidence: number; contested: number; missing_rationale: number; thin_rationale: number; stale: number; }; } export interface GapFinding { gap_type: "coverage_gap" | "missing_rationale" | "thin_rationale" | "contested" | "contested_with_evidence" | "stale"; what: string; surfaced_by: string; decision_id: string | null; suggested_action: string; score: number; } export declare function gapScanConfig(): GapScanConfig; export declare function scanGaps(store: DecisionGraphStore, opts: { use_cases?: string[]; reference_components: Array<{ name: string; source: string; traffic?: "high" | "normal"; }>; config: GapScanConfig; }): Promise; export declare function buildGapDigest(findings: GapFinding[]): { actionable: boolean; summary: string; findings: GapFinding[]; }; export declare function buildConflictPayload(a: DecisionNode, b: DecisionNode, similarity: number, evidenceFor: (id: string) => Promise): Promise<{ decision_a: object; decision_b: object; similarity: number; resolution_note: string; }>; export declare function discoverRepoStore(startDir: string): string | null; export declare function decisionsHome(): string; export declare function flagRationaleMissing(input: T): T & { rationale_missing: boolean; }; export declare function persistItemsIndependently(items: T[], persist: (item: T, index: number) => Promise): Promise<{ results: R[]; item_errors: Array<{ index: number; error: string; }>; }>; export type ExtractionItem = { statement: string; rationale: string | null; alternatives_rejected: string[]; source_ref?: string | null; author?: string | null; }; export type ExtractionParseResult = { ok: true; items: ExtractionItem[]; skipped: number; } | { ok: false; error: string; }; export declare function parseExtractionJson(raw: string): ExtractionParseResult; export declare function buildExtractionPrompt(transcript: string): string; export declare function buildImportExtractionPrompt(material: string, streamKind: string): string; export declare class FsDecisionGraphStore implements DecisionGraphStore { private embedder; private writeLock; constructor(embedder?: Embedder); addNode(node: GraphNode): Promise; getNode(id: string): Promise; addEvidenceWithEdge(decisionId: string, evidence: EvidenceNode, edge: GraphEdge): Promise; updateNode(id: string, patch: Partial): Promise; addEdge(edge: GraphEdge): Promise; listEdges(edgeType?: GraphEdge["type"]): Promise; neighbors(nodeId: string, edgeType?: GraphEdge["type"]): Promise; listActiveDecisions(): Promise; findSimilarActiveDecisions(node: DecisionNode, threshold: number, excludeId?: string): Promise>; listDecisions(status: DecisionNode["status"]): Promise; private prepareDecision; private withWriteLock; } export declare function recordConsultation(readerId: string, tool: string, decisions: DecisionNode[]): void;