/** * Living Brain SDK — unified 5-substrate traversal primitives. * * Exposes the cross-substrate graph to consumers via three traversal queries: * * 1. {@link getSymbolFullContext} — Everything known about a code symbol across * NEXUS (callers/callees/community/process), BRAIN (memories via code_reference, * documents, mentions edges), TASKS (task_touches_symbol), SENTIENT (proposals), * and CONDUIT (conduit_mentions_symbol). * * 2. {@link getTaskCodeImpact} — Full footprint of a task: files, symbols, blast * radius (via analyzeImpact BFS), brain observations with modified_by edges, * brain decisions linked via brain_memory_links, and aggregate risk tier. * * 3. {@link getBrainEntryCodeAnchors} — From a brain memory entry, which code * nodes is it anchored to (via code_reference, documents, applies_to), and * which tasks touched those nodes? * * Design constraints: * - All substrate errors are caught and produce empty collections — never throws. * - conduit.db absence is a graceful no-op: conduitThreads returns []. * - All return shapes are defined in packages/contracts/src/nexus-living-brain-ops.ts. * - REUSES existing primitives: T1067 bridge, T1066 edge writers, existing * analyzeImpact BFS, existing nexus context Drizzle queries. * * @task T1068 * @epic T1042 */ import type { CodeAnchorResult, CodeReasonTrace, ImpactFullReport, SymbolFullContext, TaskCodeImpact } from '@cleocode/contracts'; import { type EngineResult } from '../engine-result.js'; /** * Return the full cross-substrate context for a code symbol. * * Queries five substrates for everything known about `symbolId`: * - **NEXUS**: callers, callees, community membership, process participation * - **BRAIN**: memory nodes linked via code_reference, documents, mentions edges * - **TASKS**: tasks whose files contain this symbol (via T1067 bridge) * - **SENTIENT**: Tier-2 proposals whose sourceId matches this symbol * - **CONDUIT**: message threads mentioning this symbol (empty if conduit.db absent) * * All substrate failures produce empty collections — never throws. * * @param symbolId - Nexus node ID or symbol name (partial match accepted for nexus lookup) * @param projectRoot - Absolute path to project root * @returns Full cross-substrate context */ export declare function getSymbolFullContext(symbolId: string, projectRoot: string): Promise; /** * Return the full code impact footprint of a task. * * For a given task: * - Loads files from task's files_json * - Resolves symbols in those files via T1067 bridge * - Runs impact BFS (analyzeImpact) per symbol and aggregates blast radius * - Queries brain observations with modified_by edges to those files * - Queries brain decisions linked to this task via brain_memory_links * - Computes aggregate risk tier * * All substrate failures produce empty collections — never throws. * * @param taskId - Task ID (e.g., 'T001') * @param projectRoot - Absolute path to project root * @returns Full task code impact analysis */ export declare function getTaskCodeImpact(taskId: string, projectRoot: string): Promise; /** * Return the code anchors for a brain memory entry. * * Given a brain entry ID (e.g., 'observation:abc123'), finds: * - nexusNodes: all code nodes linked via code_reference, documents, applies_to edges * - tasksForNodes: for each code node, which tasks touched it (T1067 reverse-lookup) * - plasticitySignal: sum of weights on all anchoring edges * * All substrate failures produce empty collections — never throws. * * @param entryId - Brain entry node ID (format: ':') * @param projectRoot - Absolute path to project root * @returns Code anchor result */ export declare function getBrainEntryCodeAnchors(entryId: string, projectRoot: string): Promise; /** * Return a merged impact report combining structural blast radius, open-task * references, and brain risk observations for a given code symbol. * * Composes: * 1. `analyzeImpact(symbolId)` — structural callers/callees BFS * 2. `getTasksForSymbol(symbolId)` — tasks that touch this symbol * 3. Brain observations/decisions via `code_reference`, `modified_by`, `documents` edges * * All substrate failures produce empty collections — never throws. * * @param symbolId - Nexus node ID or symbol name (partial match accepted) * @param projectRoot - Absolute path to project root * @returns Merged full impact report * @task T1069 * @epic T1042 */ export declare function reasonImpactOfChange(symbolId: string, projectRoot: string): Promise; export declare function nexusFullContext(symbolId: string, projectRoot: string): Promise>; export declare function nexusTaskFootprint(taskId: string, projectRoot: string): Promise>; export declare function nexusBrainAnchors(entryId: string, projectRoot: string): Promise>; export declare function nexusImpactFull(symbolId: string, projectRoot: string): Promise>; export declare function nexusWhy(symbolId: string, projectRoot: string): Promise>; //# sourceMappingURL=living-brain.d.ts.map