mirror of
https://github.com/proffesor-for-testing/agentic-qe.git
synced 2026-09-19 08:45:47 +08:00
fd2f37eaa0
Changes: - Fix README.md agent counts (48 QE agents = 41 main + 7 subagents) - Fix README.md skill counts (15 QE-specific skills) - Fix v3/README.md agent counts (47 → 48) - Fix init-wizard.ts hooks from 'npx @agentic-qe/v3' to 'npx agentic-qe' - Complete v2 → v2/ folder reorganization (54 items moved) - Update root package.json to point to v3 as main version Verified claims: - 48 QE agents (41 main + 7 TDD subagents) - 15 QE-specific skills - 12 DDD bounded contexts - ~5,600+ tests - HNSW, ReasoningBank, Queen Coordinator features exist Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
96 lines
3.2 KiB
JavaScript
96 lines
3.2 KiB
JavaScript
#!/usr/bin/env node
|
||
/**
|
||
* Test Learning MCP Tools Registration
|
||
*
|
||
* Verifies that the three new learning service MCP tools are properly registered
|
||
* in the AQE MCP server and can be instantiated without errors.
|
||
*
|
||
* Phase 1 implementation - Option C (Hybrid Approach)
|
||
*/
|
||
|
||
const { AgenticQEMCPServer } = require('../dist/mcp/server.js');
|
||
|
||
async function testLearningMCPTools() {
|
||
console.log('🧪 Testing Learning MCP Tools Registration\n');
|
||
|
||
try {
|
||
// Step 1: Instantiate MCP server
|
||
console.log('1️⃣ Instantiating AQE MCP Server...');
|
||
const server = new AgenticQEMCPServer();
|
||
console.log(' ✅ Server instantiated successfully\n');
|
||
|
||
// Step 2: Check handler registration
|
||
console.log('2️⃣ Checking learning tool handlers...');
|
||
const handlers = server.handlers;
|
||
|
||
const learningTools = [
|
||
'mcp__agentic_qe__learning_store_experience',
|
||
'mcp__agentic_qe__learning_store_qvalue',
|
||
'mcp__agentic_qe__learning_store_pattern',
|
||
'mcp__agentic_qe__learning_query'
|
||
];
|
||
|
||
let allRegistered = true;
|
||
for (const toolName of learningTools) {
|
||
const hasHandler = handlers.has(toolName);
|
||
console.log(` ${hasHandler ? '✅' : '❌'} ${toolName}`);
|
||
if (!hasHandler) {
|
||
allRegistered = false;
|
||
}
|
||
}
|
||
|
||
if (!allRegistered) {
|
||
throw new Error('Not all learning tools are registered!');
|
||
}
|
||
|
||
console.log(' ✅ All learning tools registered\n');
|
||
|
||
// Step 3: Verify handler types
|
||
console.log('3️⃣ Verifying handler types...');
|
||
for (const toolName of learningTools) {
|
||
const handler = handlers.get(toolName);
|
||
if (!handler || typeof handler.handle !== 'function') {
|
||
throw new Error(`Handler for ${toolName} is invalid!`);
|
||
}
|
||
console.log(` ✅ ${toolName.split('__').pop()}: has handle() method`);
|
||
}
|
||
console.log('\n');
|
||
|
||
// Step 4: Count total MCP tools
|
||
console.log('4️⃣ Tool count verification...');
|
||
const totalTools = handlers.size;
|
||
console.log(` 📊 Total MCP tools: ${totalTools}`);
|
||
console.log(` 📊 Expected: 101 (98 existing + 3 new learning tools)`);
|
||
|
||
if (totalTools < 101) {
|
||
console.warn(` ⚠️ Warning: Expected at least 101 tools, found ${totalTools}`);
|
||
} else {
|
||
console.log(' ✅ Tool count matches expectations\n');
|
||
}
|
||
|
||
// Step 5: Summary
|
||
console.log('✅ VERIFICATION PASSED\n');
|
||
console.log('Summary:');
|
||
console.log(' • All 4 learning service tools registered');
|
||
console.log(' • Handlers properly instantiated');
|
||
console.log(' • Total tools: ' + totalTools);
|
||
console.log('\nLearning Tools:');
|
||
console.log(' 1. learning_store_experience - Store task execution outcomes');
|
||
console.log(' 2. learning_store_qvalue - Store Q-values for strategies');
|
||
console.log(' 3. learning_store_pattern - Store successful patterns');
|
||
console.log(' 4. learning_query - Query past learnings');
|
||
console.log('\nNext Steps:');
|
||
console.log(' 1. Connect MCP server to Claude Code');
|
||
console.log(' 2. Test learning persistence with actual agent\n');
|
||
|
||
process.exit(0);
|
||
|
||
} catch (error) {
|
||
console.error('\n❌ VERIFICATION FAILED\n');
|
||
console.error('Error:', error);
|
||
process.exit(1);
|
||
}
|
||
}
|
||
|
||
testLearningMCPTools();
|