mirror of
https://github.com/proffesor-for-testing/agentic-qe.git
synced 2026-09-19 08:45:47 +08:00
56d1502089
Phase 1 Track A - Legacy Tool Removal: - Remove 11 legacy tools from agenticQETools array - Remove corresponding TOOL_NAMES entries - Remove legacy handler registrations from server.ts - Legacy tools removed: test_generate, quality_analyze, predict_defects, optimize_tests, quality_gate_execute, quality_validate_metrics, quality_risk_assess, quality_decision_make, quality_policy_check, requirements_validate, requirements_generate_bdd Phase 2 - Lazy Loading Integration: - Wire ListToolsRequestSchema to use lazy loader - Return only 14 core tools on initial load (vs 84 total) - Domain-specific tools loaded on-demand via tools_load_domain - Add tools_discover and tools_load_domain meta-tools - Add tool-categories.ts with domain organization - Add lazy-loader.ts for dynamic tool loading - Add server-instructions.ts for MCP instructions Additional Changes: - Add analysis documentation for optimization work - Add IntervalRegistry utility for timer management - Update jest.setup.ts and MemoryManager for stability - Add coverage tools consolidation plan Verified Metrics: - Tool count: 98 → 84 (-14 legacy tools) - Initial load: 84 → 14 tools - Token reduction: ~16,885 → ~2,612 tokens (85% reduction) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
299 lines
7.9 KiB
JSON
299 lines
7.9 KiB
JSON
{
|
|
"analysis_metadata": {
|
|
"date": "2025-12-05",
|
|
"swarm_id": "swarm_1764923979903_lbcgvbqu3",
|
|
"track": "C - Parameter Schema Analysis",
|
|
"issue": "#115",
|
|
"analyzer": "Code Quality Analyzer Agent"
|
|
},
|
|
"file_metrics": {
|
|
"file_path": "/workspaces/agentic-qe-cf/src/mcp/tools.ts",
|
|
"total_lines": 4168,
|
|
"total_tools": 100,
|
|
"total_boolean_parameters": 137
|
|
},
|
|
"optimization_opportunities": {
|
|
"boolean_consolidation": {
|
|
"tools_affected": 22,
|
|
"total_booleans": 84,
|
|
"estimated_token_savings": 8000,
|
|
"reduction_percentage": 65,
|
|
"high_priority_tools": [
|
|
{
|
|
"name": "test_report_comprehensive",
|
|
"boolean_count": 5,
|
|
"lines": "701-721",
|
|
"proposed": "Single reportDetail enum",
|
|
"savings_percentage": 40
|
|
},
|
|
{
|
|
"name": "qe_test_data_mask",
|
|
"boolean_count": 5,
|
|
"lines": "2727-2763",
|
|
"proposed": "maskingMode enum + 1 boolean",
|
|
"savings_percentage": 35
|
|
},
|
|
{
|
|
"name": "qe_test_data_analyze_schema",
|
|
"boolean_count": 5,
|
|
"lines": "2789-2809",
|
|
"proposed": "analysisScope enum",
|
|
"savings_percentage": 45
|
|
},
|
|
{
|
|
"name": "test_coverage_detailed",
|
|
"boolean_count": 4,
|
|
"lines": "774-793",
|
|
"proposed": "analysisDepth enum",
|
|
"savings_percentage": 35
|
|
},
|
|
{
|
|
"name": "coverage_analyze_with_risk_scoring",
|
|
"boolean_count": 4,
|
|
"lines": "1897-1900",
|
|
"proposed": "riskFactors array",
|
|
"savings_percentage": 30
|
|
}
|
|
]
|
|
},
|
|
"shared_type_extraction": {
|
|
"types_identified": 8,
|
|
"total_usages": 43,
|
|
"estimated_token_savings": 2000,
|
|
"reduction_percentage": 40,
|
|
"common_types": [
|
|
{
|
|
"type": "PriorityLevel",
|
|
"usages": 13,
|
|
"lines": [429, 755, 996, 1033, 1338, 1955, 2296, 2943, 3005, 3177],
|
|
"token_savings_per_usage": 15,
|
|
"total_savings": 195
|
|
},
|
|
{
|
|
"type": "ReportFormat",
|
|
"usages": 8,
|
|
"lines": [264, 692, 2165, 2334, 3435, 3747],
|
|
"token_savings_per_usage": 12,
|
|
"total_savings": 96
|
|
},
|
|
{
|
|
"type": "FleetIdParam",
|
|
"usages": 6,
|
|
"lines": [160, 271, 395, 467, 1817, 3248],
|
|
"token_savings_per_usage": 20,
|
|
"total_savings": 120
|
|
},
|
|
{
|
|
"type": "AgentIdParam",
|
|
"usages": 9,
|
|
"lines": [216, 860, 999, 3282, 3810, 3847],
|
|
"token_savings_per_usage": 18,
|
|
"total_savings": 162
|
|
},
|
|
{
|
|
"type": "TestFramework",
|
|
"usages": 6,
|
|
"lines": [105, 203, 547, 2110],
|
|
"token_savings_per_usage": 15,
|
|
"total_savings": 90
|
|
},
|
|
{
|
|
"type": "DetailLevel",
|
|
"usages": 5,
|
|
"lines": [768, 1548, 3590],
|
|
"token_savings_per_usage": 12,
|
|
"total_savings": 60
|
|
},
|
|
{
|
|
"type": "Environment",
|
|
"usages": 7,
|
|
"lines": [100, 239, 3629, 3672],
|
|
"token_savings_per_usage": 10,
|
|
"total_savings": 70
|
|
},
|
|
{
|
|
"type": "QualityScope",
|
|
"usages": 4,
|
|
"lines": [289, 339, 763],
|
|
"token_savings_per_usage": 14,
|
|
"total_savings": 56
|
|
}
|
|
]
|
|
},
|
|
"verbose_descriptions": {
|
|
"descriptions_identified": 20,
|
|
"estimated_token_savings": 500,
|
|
"reduction_percentage": 65,
|
|
"top_examples": [
|
|
{
|
|
"line": 3806,
|
|
"tool": "learning_store_experience",
|
|
"current_length": 146,
|
|
"proposed_length": 56,
|
|
"savings_percentage": 62
|
|
},
|
|
{
|
|
"line": 3843,
|
|
"tool": "learning_store_qvalue",
|
|
"current_length": 136,
|
|
"proposed_length": 36,
|
|
"savings_percentage": 74
|
|
},
|
|
{
|
|
"line": 3879,
|
|
"tool": "learning_store_pattern",
|
|
"current_length": 146,
|
|
"proposed_length": 35,
|
|
"savings_percentage": 76
|
|
},
|
|
{
|
|
"line": 3926,
|
|
"tool": "learning_query",
|
|
"current_length": 146,
|
|
"proposed_length": 39,
|
|
"savings_percentage": 73
|
|
},
|
|
{
|
|
"line": 1773,
|
|
"tool": "test_execute_stream",
|
|
"current_length": 101,
|
|
"proposed_length": 39,
|
|
"savings_percentage": 61
|
|
}
|
|
]
|
|
},
|
|
"rarely_used_parameters": {
|
|
"parameters_identified": 8,
|
|
"estimated_token_savings": 800,
|
|
"candidates": [
|
|
{
|
|
"tool": "test_execute_parallel",
|
|
"parameter": "collectCoverage",
|
|
"line": "615-618",
|
|
"reason": "Redundant with dedicated coverage tools",
|
|
"recommendation": "Remove"
|
|
},
|
|
{
|
|
"tool": "test_optimize_sublinear",
|
|
"parameter": "predictFailures",
|
|
"line": "658-661",
|
|
"reason": "Separate concern, dedicated tool exists",
|
|
"recommendation": "Remove"
|
|
},
|
|
{
|
|
"tool": "memory_retrieve",
|
|
"parameter": "includeMetadata",
|
|
"line": "855-859",
|
|
"reason": "Rarely needed, advanced use case",
|
|
"recommendation": "Keep but document"
|
|
},
|
|
{
|
|
"tool": "workflow_execute",
|
|
"parameter": "dryRun",
|
|
"line": "1229-1232",
|
|
"reason": "Should be separate validation tool",
|
|
"recommendation": "Extract to workflow_validate"
|
|
},
|
|
{
|
|
"tool": "predict_defects",
|
|
"parameter": "historicalDataDays",
|
|
"line": "356-362",
|
|
"reason": "Over-specified, use enum instead",
|
|
"recommendation": "Simplify to timeWindow enum"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"total_estimated_savings": {
|
|
"tokens": 11300,
|
|
"percentage": 18,
|
|
"breakdown": {
|
|
"boolean_consolidation": 8000,
|
|
"shared_types": 2000,
|
|
"descriptions": 500,
|
|
"rare_parameters": 800
|
|
}
|
|
},
|
|
"implementation_roadmap": {
|
|
"phase_1": {
|
|
"name": "Boolean Consolidation",
|
|
"week": 1,
|
|
"tools_modified": 5,
|
|
"estimated_savings": 5000,
|
|
"deliverables": [
|
|
"New enum parameters",
|
|
"Backward compatibility layer"
|
|
]
|
|
},
|
|
"phase_2": {
|
|
"name": "Shared Types",
|
|
"week": 2,
|
|
"types_created": 8,
|
|
"estimated_savings": 2000,
|
|
"deliverables": [
|
|
"schema-types.ts module",
|
|
"Migration guide"
|
|
]
|
|
},
|
|
"phase_3": {
|
|
"name": "Description Cleanup",
|
|
"week": 3,
|
|
"descriptions_shortened": 20,
|
|
"estimated_savings": 500,
|
|
"deliverables": [
|
|
"Cleaner descriptions",
|
|
"Updated documentation"
|
|
]
|
|
},
|
|
"phase_4": {
|
|
"name": "Deprecation",
|
|
"week": 4,
|
|
"parameters_deprecated": 8,
|
|
"estimated_savings": 800,
|
|
"deliverables": [
|
|
"Deprecation notices",
|
|
"v3.0 plan"
|
|
]
|
|
}
|
|
},
|
|
"validation_results": {
|
|
"total_tools_analyzed": 100,
|
|
"total_boolean_parameters": 137,
|
|
"priority_enum_usages": 13,
|
|
"fleet_id_usages": 6,
|
|
"agent_id_usages": 9,
|
|
"reports_generated": {
|
|
"full_report": {
|
|
"path": "docs/analysis/schema-optimization-report.md",
|
|
"lines": 881
|
|
},
|
|
"summary_report": {
|
|
"path": "docs/analysis/schema-optimization-summary.md",
|
|
"lines": 230
|
|
},
|
|
"metrics_report": {
|
|
"path": "docs/analysis/optimization-metrics.json",
|
|
"lines": "current file"
|
|
}
|
|
}
|
|
},
|
|
"success_criteria": {
|
|
"token_reduction": {
|
|
"target": "15-20%",
|
|
"estimated": "18%"
|
|
},
|
|
"parameter_reduction": {
|
|
"target": "60-70%",
|
|
"estimated": "65%"
|
|
},
|
|
"backward_compatibility": {
|
|
"target": "100%",
|
|
"estimated": "100%"
|
|
},
|
|
"shared_types": {
|
|
"target": "6-8",
|
|
"estimated": "8"
|
|
}
|
|
}
|
|
}
|