Files
proffesor-for-testing__agen…/v2/scripts/test-learning-mcp-tools.js
Profa fd2f37eaa0 fix(v3): update README claims and init hooks to use correct package name
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>
2026-01-17 18:03:40 +00:00

96 lines
3.2 KiB
JavaScript
Raw Permalink Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/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();