/**
 * Brain graph back-fill — populates brain_page_nodes and brain_page_edges from
 * existing typed table rows (decisions, patterns, learnings, observations,
 * sticky notes).
 *
 * Each row in a typed table gets a corresponding node in brain_page_nodes.
 * Relationship edges are derived from:
 *   - decision.contextTaskId / contextEpicId  → applies_to edges
 *   - observation.sourceSessionId             → produced_by edge
 *   - observation text referencing task IDs   → applies_to edges
 *   - pattern entries                         → derived_from stubs
 *
 * Stub nodes (task:<id>, session:<id>, epic:<id>) are created for referenced
 * external entities so edges have valid targets.
 *
 * Duplicate nodes are silently skipped (INSERT OR IGNORE semantics via
 * Drizzle onConflictDoNothing).
 *
 * @task T530
 * @epic T523
 */
/** Result returned by backfillBrainGraph. */
export interface BrainBackfillResult {
    /** Counts before the back-fill ran. */
    before: {
        nodes: number;
        edges: number;
        decisions: number;
        patterns: number;
        learnings: number;
        observations: number;
        stickyNotes: number;
    };
    /** Counts after the back-fill ran. */
    after: {
        nodes: number;
        edges: number;
    };
    /** Number of nodes inserted during this run. */
    nodesInserted: number;
    /** Number of edges inserted during this run. */
    edgesInserted: number;
    /** Number of stub nodes created for external references (tasks, sessions, epics). */
    stubsCreated: number;
    /** Node counts broken down by type. */
    byType: Record<string, number>;
}
/**
 * Back-fill brain_page_nodes and brain_page_edges from all existing typed rows
 * in brain.db.
 *
 * Safe to run multiple times — duplicate nodes and edges are silently ignored
 * via INSERT OR IGNORE semantics.
 *
 * @param projectRoot - Absolute path to the project root (contains .cleo/).
 * @returns BackfillResult with before/after counts and insertion stats.
 */
export declare function backfillBrainGraph(projectRoot: string): Promise<BrainBackfillResult>;
//# sourceMappingURL=brain-backfill.d.ts.map