feat: Add impact analysis for component dependency tracking
- New tables: components, component_dependencies, component_files, verification_checks, change_impacts, impact_analysis_runs - 8 new MCP tools: component_register, component_list, component_add_dependency, component_add_file, component_add_check, impact_analysis, impact_learn, component_graph - Seed data: 17 components, 9 dependencies, 12 file patterns, 5 checks - Historical impacts from session 397 issues recorded Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
54
src/index.ts
54
src/index.ts
@@ -26,6 +26,16 @@ import { taskDelegations, taskDelegationQuery } from './tools/delegations.js';
|
||||
import { projectLock, projectUnlock, projectLockStatus, projectContext } from './tools/locks.js';
|
||||
import { versionAdd, versionList, versionShow, versionUpdate, versionRelease, versionAssignTask } from './tools/versions.js';
|
||||
import { taskCommitAdd, taskCommitRemove, taskCommitsList, taskLinkCommits, sessionTasks } from './tools/commits.js';
|
||||
import {
|
||||
componentRegister,
|
||||
componentList,
|
||||
componentAddDependency,
|
||||
componentAddFile,
|
||||
componentAddCheck,
|
||||
impactAnalysis,
|
||||
impactLearn,
|
||||
componentGraph,
|
||||
} from './tools/impact.js';
|
||||
|
||||
// Create MCP server
|
||||
const server = new Server(
|
||||
@@ -266,6 +276,50 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
||||
});
|
||||
break;
|
||||
|
||||
// Impact Analysis
|
||||
case 'component_register':
|
||||
result = JSON.stringify(await componentRegister(a.id, a.name, a.type, {
|
||||
path: a.path,
|
||||
repo: a.repo,
|
||||
description: a.description,
|
||||
health_check: a.health_check,
|
||||
}), null, 2);
|
||||
break;
|
||||
case 'component_list':
|
||||
result = JSON.stringify(await componentList(a.type), null, 2);
|
||||
break;
|
||||
case 'component_add_dependency':
|
||||
result = JSON.stringify(await componentAddDependency(
|
||||
a.component_id,
|
||||
a.depends_on,
|
||||
a.dependency_type,
|
||||
a.description
|
||||
), null, 2);
|
||||
break;
|
||||
case 'component_add_file':
|
||||
result = JSON.stringify(await componentAddFile(a.component_id, a.file_pattern), null, 2);
|
||||
break;
|
||||
case 'component_add_check':
|
||||
result = JSON.stringify(await componentAddCheck(a.component_id, a.name, a.check_type, a.check_command, {
|
||||
expected_result: a.expected_result,
|
||||
timeout_seconds: a.timeout_seconds,
|
||||
}), null, 2);
|
||||
break;
|
||||
case 'impact_analysis':
|
||||
result = JSON.stringify(await impactAnalysis(a.changed_files), null, 2);
|
||||
break;
|
||||
case 'impact_learn':
|
||||
result = JSON.stringify(await impactLearn(
|
||||
a.changed_component,
|
||||
a.affected_component,
|
||||
a.impact_description,
|
||||
{ error_id: a.error_id, task_id: a.task_id }
|
||||
), null, 2);
|
||||
break;
|
||||
case 'component_graph':
|
||||
result = JSON.stringify(await componentGraph(a.component_id), null, 2);
|
||||
break;
|
||||
|
||||
default:
|
||||
throw new Error(`Unknown tool: ${name}`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user