/** * Task analysis and complexity estimation. * @task T10064 * @epic T9834 */ import type { Task, TaskAnalysisResult } from '@cleocode/contracts'; /** Task record shape expected from the data layer. */ type TaskRecord = Task; /** Complexity factor contributing to a task's size estimate. */ export interface ComplexityFactor { /** Factor name (e.g. "descriptionLength", "dependencyDepth"). */ name: string; /** Numeric score contribution from this factor. */ value: number; /** Human-readable explanation of the score (e.g. "short (42 chars)"). */ detail: string; } /** * Walk dependency chain to measure maximum depth. * * @param taskId - Starting task ID. * @param taskMap - Flat lookup map. * @param visited - Tracks visited nodes to avoid cycles. */ export declare function measureDependencyDepth(taskId: string, taskMap: Map, visited?: Set): number; /** * Analyze tasks for priority and leverage. * * @param projectRoot - Absolute path to the CLEO project root directory * @param taskId - Optional task or epic ID to scope the analysis; omit for project-wide * @param params - Optional analysis configuration * @param params.tierLimit - Maximum tasks per priority tier in the response (default: 10) * @returns Analysis with recommended next task, bottlenecks, priority tiers, and aggregate metrics * * @remarks * Computes a leverage score per task (how many other tasks it unblocks) and combines * it with priority to produce a ranked recommendation. Bottlenecks are the top 5 * incomplete tasks that block the most others. * * @example * ```typescript * const analysis = await coreTaskAnalyze('/project', undefined, { tierLimit: 5 }); * if (analysis.recommended) console.log('Work on:', analysis.recommended.id); * ``` * * @task T4790 */ export declare function coreTaskAnalyze(projectRoot: string, taskId?: string, params?: { tierLimit?: number; }): Promise; /** * Deterministic complexity scoring from task metadata. * * @param projectRoot - Absolute path to the CLEO project root directory * @param params - Parameters containing the task ID to estimate * @param params.taskId - The task ID to compute complexity for * @returns Complexity size ("small"/"medium"/"large"), numeric score, contributing factors, and metadata counts * * @remarks * Scores are computed from description length, acceptance criteria count, dependency depth, * subtask count, and file reference count. Each factor contributes 0-3 points. * Total score 0-3 = small, 4-7 = medium, 8+ = large. * * @example * ```typescript * const est = await coreTaskComplexityEstimate('/project', { taskId: 'T042' }); * console.log(`${est.size} (score: ${est.score})`); * ``` * * @task T4790 */ export declare function coreTaskComplexityEstimate(projectRoot: string, params: { taskId: string; }): Promise<{ size: 'small' | 'medium' | 'large'; score: number; factors: ComplexityFactor[]; dependencyDepth: number; subtaskCount: number; fileCount: number; }>; export {}; //# sourceMappingURL=task-analyze.d.ts.map