validate_changes
Validate code changes before implementation with AI-powered syntax checking and impact analysis to identify potential issues in modifications.
Instructions
โ Pre-flight validation for code changes - AI-powered syntax checking and impact analysis using DialoGPT-small. Validates proposed modifications before implementation.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file_path | Yes | ||
| language | No | ||
| proposed_changes | Yes | ||
| validation_rules | No |
Input Schema (JSON Schema)
{
"properties": {
"file_path": {
"type": "string"
},
"language": {
"type": "string"
},
"proposed_changes": {
"items": {
"properties": {
"find": {
"type": "string"
},
"line_number": {
"type": "number"
},
"replace": {
"type": "string"
}
},
"required": [
"find",
"replace"
],
"type": "object"
},
"type": "array"
},
"validation_rules": {
"default": [
"syntax",
"logic",
"security",
"performance"
],
"items": {
"type": "string"
},
"type": "array"
}
},
"required": [
"file_path",
"proposed_changes"
],
"type": "object"
}
Implementation Reference
- smart-ai-bridge-v1.1.0.js:1021-1023 (handler)The main handler function for the 'validate_changes' MCP tool. It delegates the validation request to the FileModificationManager's orchestrateOperation method with operation type 'validation'.async handleValidateChanges(args) { return await this.fileManager.orchestrateOperation('validation', args); }
- smart-ai-bridge-v1.1.0.js:366-383 (registration)Registration of the 'validate_changes' tool in the coreToolDefinitions array within SmartAliasResolver.initializeCoreTools(). Includes name, description, handler mapping, and input schema.name: 'validate_changes', description: 'โ AI-powered change validation - FileModificationManager integrated validation. Validates proposed code changes for syntax, logic, security, and performance impact before applying edits. Smart routing to optimal AI backend based on complexity.', handler: 'handleValidateChanges', schema: { type: 'object', properties: { file_path: { type: 'string' }, proposed_changes: { type: 'string' }, language: { type: 'string' }, validation_rules: { type: 'array', items: { type: 'string' }, default: ['syntax', 'logic', 'security', 'performance'] } }, required: ['file_path', 'proposed_changes'] } },
- smart-ai-bridge-v1.1.0.js:369-382 (schema)Input schema definition for the 'validate_changes' tool, specifying parameters like file_path, proposed_changes, language, and validation_rules.schema: { type: 'object', properties: { file_path: { type: 'string' }, proposed_changes: { type: 'string' }, language: { type: 'string' }, validation_rules: { type: 'array', items: { type: 'string' }, default: ['syntax', 'logic', 'security', 'performance'] } }, required: ['file_path', 'proposed_changes'] }
- smart-ai-bridge-v1.1.0.js:701-707 (helper)Helper logic in FileModificationManager.orchestrateOperation() that handles the 'validation' operation type by calling MultiAIRouter.validateCodeChanges().case 'validation': result = await this.router.validateCodeChanges( params.file_path, params.proposed_changes, params.validation_rules, params.language );
- smart-ai-bridge-v1.1.0.js:816-818 (helper)Placeholder implementation of the actual validation logic in the MultiAIRouter class, which is invoked indirectly via the tool handler.async validateCodeChanges(filePath, proposedChanges, validationRules, language) { // Placeholder implementation return { valid: true, issues: [] };