/** * TASKS → NEXUS Bridge — links tasks to code symbols they touched. * * Enables the question: "Which tasks modified this symbol?" — answering * through git-log sweeping (extract task IDs from commit messages) and * cross-reference with nexus_nodes via file paths and symbol names. * * Design: * - linkTaskToSymbols: writes task_touches_symbol edges for a single task * - getTasksForSymbol: reverse-lookup (symbol → tasks) * - getSymbolsForTask: forward-lookup (task → symbols) * - runGitLogTaskLinker: post-analyze hook to sweep git history and link tasks * * @task T1067 * @epic T1042 */ import type { GitLogLinkerResult, LinkTaskResult, SymbolReference, TaskReference } from '@cleocode/contracts'; /** * Link a task to symbols in the files it touched. * * For each file in task.files_json, queries nexus_nodes for symbols in that file, * then writes task_touches_symbol edges to brain_page_edges. * * @param taskId - Task ID (e.g., 'T001') * @param filesJson - JSON string array of file paths from task.files_json * @param projectRoot - Absolute path to project root * @returns Result summary with count of edges created */ export declare function linkTaskToSymbols(taskId: string, filesJson: string, projectRoot: string): Promise; /** * Query: which tasks touched a specific symbol? * * Reverse-lookup from symbol (nexus node ID) to all tasks that touched it. * * @param symbolId - Nexus node ID (e.g., 'src/file.ts::functionName') * @param projectRoot - Absolute path to project root * @returns Array of task references with edge metadata */ export declare function getTasksForSymbol(symbolId: string, projectRoot: string): Promise; /** * Query: which symbols did a task touch? * * Forward-lookup from task ID to all symbols in the files it modified. * * @param taskId - Task ID (e.g., 'T001') * @param projectRoot - Absolute path to project root * @returns Array of symbol references with edge metadata */ export declare function getSymbolsForTask(taskId: string, projectRoot: string): Promise; /** * Git-log sweeper: extract task IDs from commit messages and link to symbols. * * Scans git log since a reference commit (or all history if none), * extracts task IDs matching pattern /T\d+/, and calls linkTaskToSymbols * for each task × touched files pair. * * Idempotent: stores the last-synced commit hash in nexus_schema_meta * so subsequent runs skip already-processed commits. * * @param projectRoot - Absolute path to project root * @param sinceCommit - Optional reference commit; if omitted, uses last stored * @returns Result summary with count of edges created and last commit hash */ export declare function runGitLogTaskLinker(projectRoot: string, sinceCommit?: string): Promise; //# sourceMappingURL=tasks-bridge.d.ts.map