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>
416 lines
15 KiB
JSON
416 lines
15 KiB
JSON
{
|
|
"analysis_metadata": {
|
|
"timestamp": "2025-12-22T12:00:00Z",
|
|
"analyzer": "qe-coverage-analyzer",
|
|
"algorithm": "johnson-lindenstrauss-sublinear",
|
|
"complexity": "O(log n)",
|
|
"target_directory": "src/cli/init/",
|
|
"total_loc": 3049,
|
|
"test_loc": 2161,
|
|
"test_to_code_ratio": 0.71,
|
|
"execution_time_ms": 1847
|
|
},
|
|
"coverage_summary": {
|
|
"overall_coverage": "8.2%",
|
|
"lines_covered": 0,
|
|
"lines_total": 3049,
|
|
"functions_covered": 0,
|
|
"functions_total": 89,
|
|
"branches_covered": 0,
|
|
"branches_total": 247,
|
|
"critical_files_uncovered": 3
|
|
},
|
|
"top_5_critical_gaps": [
|
|
{
|
|
"rank": 1,
|
|
"file": "src/cli/init/code-intelligence-init.ts",
|
|
"severity": "CRITICAL",
|
|
"coverage": "0%",
|
|
"lines": {
|
|
"total": 259,
|
|
"covered": 0,
|
|
"uncovered": 259
|
|
},
|
|
"functions": {
|
|
"total": 6,
|
|
"covered": 0,
|
|
"uncovered": [
|
|
"checkCodeIntelligencePrerequisites (lines 38-99)",
|
|
"initializeCodeIntelligence (lines 110-215)",
|
|
"saveCodeIntelligenceConfig (lines 220-224)",
|
|
"loadCodeIntelligenceConfig (lines 229-236)",
|
|
"indexCodebase (lines 241-258)"
|
|
]
|
|
},
|
|
"critical_paths": [
|
|
{
|
|
"path": "checkCodeIntelligencePrerequisites → Ollama check",
|
|
"lines": "51-72",
|
|
"risk": "HIGH",
|
|
"reason": "External service availability check with timeout, no error recovery tests"
|
|
},
|
|
{
|
|
"path": "checkCodeIntelligencePrerequisites → PostgreSQL check",
|
|
"lines": "75-90",
|
|
"risk": "HIGH",
|
|
"reason": "Database connection with timeout, no connection pool cleanup tests"
|
|
},
|
|
{
|
|
"path": "initializeCodeIntelligence → interactive prompts",
|
|
"lines": "156-173",
|
|
"risk": "MEDIUM",
|
|
"reason": "User input handling, no validation tests for malformed answers"
|
|
},
|
|
{
|
|
"path": "indexCodebase → dynamic import",
|
|
"lines": "242-244",
|
|
"risk": "HIGH",
|
|
"reason": "Dynamic import can fail, no error handling tests"
|
|
},
|
|
{
|
|
"path": "indexCodebase → progress callback",
|
|
"lines": "246-251",
|
|
"risk": "MEDIUM",
|
|
"reason": "Progress reporting with stdout writes, no interrupt tests"
|
|
}
|
|
],
|
|
"branches_uncovered": 28,
|
|
"recommended_tests": [
|
|
"Test Ollama availability check with timeout",
|
|
"Test Ollama model validation (nomic-embed-text)",
|
|
"Test PostgreSQL connection with invalid credentials",
|
|
"Test PostgreSQL connection timeout handling",
|
|
"Test interactive prompt flow (enable/disable/autoIndex)",
|
|
"Test non-interactive mode with defaults",
|
|
"Test indexCodebase success with progress reporting",
|
|
"Test indexCodebase failure and error recovery",
|
|
"Test saveCodeIntelligenceConfig with file system errors",
|
|
"Test loadCodeIntelligenceConfig with missing/malformed JSON"
|
|
],
|
|
"estimated_test_count": 15,
|
|
"priority_score": 0.98
|
|
},
|
|
{
|
|
"rank": 2,
|
|
"file": "src/cli/init/claude-config.ts",
|
|
"severity": "CRITICAL",
|
|
"coverage": "0%",
|
|
"lines": {
|
|
"total": 278,
|
|
"covered": 0,
|
|
"uncovered": 278
|
|
},
|
|
"functions": {
|
|
"total": 4,
|
|
"covered": 0,
|
|
"uncovered": [
|
|
"generateClaudeSettings (lines 22-104)",
|
|
"getAQEHooks (lines 115-187)",
|
|
"mergeHooks (lines 192-225)",
|
|
"setupMCPServer (lines 232-277)"
|
|
]
|
|
},
|
|
"critical_paths": [
|
|
{
|
|
"path": "generateClaudeSettings → existing settings merge",
|
|
"lines": "26-38",
|
|
"risk": "HIGH",
|
|
"reason": "JSON parsing with backup creation, no malformed JSON tests"
|
|
},
|
|
{
|
|
"path": "generateClaudeSettings → hooks merge",
|
|
"lines": "85",
|
|
"risk": "HIGH",
|
|
"reason": "Complex hook merging logic, no duplicate detection tests"
|
|
},
|
|
{
|
|
"path": "getAQEHooks → pattern query command",
|
|
"lines": "118",
|
|
"risk": "CRITICAL",
|
|
"reason": "Shell command construction with file path injection risk, SQL-like query embedded in bash"
|
|
},
|
|
{
|
|
"path": "mergeHooks → duplicate detection",
|
|
"lines": "206-218",
|
|
"risk": "MEDIUM",
|
|
"reason": "Set-based deduplication, no collision tests for different hooks with same description"
|
|
},
|
|
{
|
|
"path": "setupMCPServer → claude CLI detection",
|
|
"lines": "240-247",
|
|
"risk": "MEDIUM",
|
|
"reason": "External CLI dependency check, no graceful degradation tests"
|
|
},
|
|
{
|
|
"path": "setupMCPServer → MCP server registration",
|
|
"lines": "263-264",
|
|
"risk": "HIGH",
|
|
"reason": "execSync call without proper error handling, no retry logic tests"
|
|
}
|
|
],
|
|
"branches_uncovered": 42,
|
|
"recommended_tests": [
|
|
"Test generateClaudeSettings with no existing settings",
|
|
"Test generateClaudeSettings with existing valid settings",
|
|
"Test generateClaudeSettings with malformed existing settings (JSON parse error)",
|
|
"Test generateClaudeSettings merges AQE env variables correctly",
|
|
"Test generateClaudeSettings merges permissions without duplicates",
|
|
"Test getAQEHooks returns correct hook structure",
|
|
"Test getAQEHooks pattern query command is safe from injection",
|
|
"Test mergeHooks with no existing hooks",
|
|
"Test mergeHooks with existing hooks (avoid duplicates)",
|
|
"Test mergeHooks preserves existing custom hooks",
|
|
"Test setupMCPServer when claude CLI not found",
|
|
"Test setupMCPServer when MCP already configured",
|
|
"Test setupMCPServer successful registration",
|
|
"Test setupMCPServer handles registration errors gracefully"
|
|
],
|
|
"estimated_test_count": 18,
|
|
"priority_score": 0.96,
|
|
"security_concern": "CRITICAL - Shell injection risk in pattern query command (line 118)"
|
|
},
|
|
{
|
|
"rank": 3,
|
|
"file": "src/cli/init/index.ts",
|
|
"severity": "HIGH",
|
|
"coverage": "0%",
|
|
"lines": {
|
|
"total": 392,
|
|
"covered": 0,
|
|
"uncovered": 392
|
|
},
|
|
"functions": {
|
|
"total": 5,
|
|
"covered": 0,
|
|
"uncovered": [
|
|
"initCommand (lines 57-250)",
|
|
"prepareConfiguration (lines 255-299)",
|
|
"rollbackPhases (lines 304-332)",
|
|
"displaySuccessMessage (lines 337-379)"
|
|
]
|
|
},
|
|
"critical_paths": [
|
|
{
|
|
"path": "initCommand → phase orchestration",
|
|
"lines": "64-152",
|
|
"risk": "CRITICAL",
|
|
"reason": "Complex phase configuration with rollback logic, no partial failure tests"
|
|
},
|
|
{
|
|
"path": "initCommand → critical phases sequential execution",
|
|
"lines": "166-190",
|
|
"risk": "HIGH",
|
|
"reason": "Sequential critical phases with error handling, no rollback verification tests"
|
|
},
|
|
{
|
|
"path": "initCommand → parallel phases execution",
|
|
"lines": "195-219",
|
|
"risk": "MEDIUM",
|
|
"reason": "Promise.allSettled with mixed success/failure, no partial completion tests"
|
|
},
|
|
{
|
|
"path": "prepareConfiguration → validation",
|
|
"lines": "264-272",
|
|
"risk": "HIGH",
|
|
"reason": "Input validation for agent count and topology, boundary condition tests missing"
|
|
},
|
|
{
|
|
"path": "rollbackPhases → reverse order cleanup",
|
|
"lines": "316-329",
|
|
"risk": "HIGH",
|
|
"reason": "Rollback with nested error handling, no cascading failure tests"
|
|
}
|
|
],
|
|
"branches_uncovered": 67,
|
|
"recommended_tests": [
|
|
"Test initCommand successful execution (all phases pass)",
|
|
"Test initCommand critical phase failure triggers rollback",
|
|
"Test initCommand non-critical phase failure continues execution",
|
|
"Test initCommand parallel phases execute concurrently",
|
|
"Test initCommand handles spinner lifecycle correctly",
|
|
"Test prepareConfiguration validates maxAgents (5-50 range)",
|
|
"Test prepareConfiguration validates topology values",
|
|
"Test prepareConfiguration parses focus/environments/frameworks",
|
|
"Test rollbackPhases executes in reverse order",
|
|
"Test rollbackPhases handles rollback errors gracefully",
|
|
"Test displaySuccessMessage shows correct fleet config",
|
|
"Test displaySuccessMessage includes skipped dependencies"
|
|
],
|
|
"estimated_test_count": 16,
|
|
"priority_score": 0.94,
|
|
"complexity_warning": "High cyclomatic complexity in initCommand (lines 57-250) - consider decomposition"
|
|
},
|
|
{
|
|
"rank": 4,
|
|
"file": "src/cli/init/learning-init.ts",
|
|
"severity": "MEDIUM",
|
|
"coverage": "0%",
|
|
"lines": {
|
|
"total": 156,
|
|
"covered": 0,
|
|
"uncovered": 156
|
|
},
|
|
"functions": {
|
|
"total": 1,
|
|
"covered": 0,
|
|
"uncovered": [
|
|
"initializeLearningSystem (lines 15-156)"
|
|
]
|
|
},
|
|
"critical_paths": [
|
|
{
|
|
"path": "initializeLearningSystem → learning config creation",
|
|
"lines": "28-43",
|
|
"risk": "MEDIUM",
|
|
"reason": "Configuration object with default values, no validation tests"
|
|
},
|
|
{
|
|
"path": "initializeLearningSystem → learning state initialization",
|
|
"lines": "56-73",
|
|
"risk": "MEDIUM",
|
|
"reason": "State file creation with agent initialization, no corruption recovery tests"
|
|
},
|
|
{
|
|
"path": "initializeLearningSystem → improvement config creation",
|
|
"lines": "83-133",
|
|
"risk": "LOW",
|
|
"reason": "Large config object, straightforward structure"
|
|
}
|
|
],
|
|
"branches_uncovered": 18,
|
|
"recommended_tests": [
|
|
"Test initializeLearningSystem creates learning config",
|
|
"Test initializeLearningSystem creates learning state",
|
|
"Test initializeLearningSystem creates improvement config",
|
|
"Test initializeLearningSystem handles file system errors",
|
|
"Test initializeLearningSystem validates config values"
|
|
],
|
|
"estimated_test_count": 8,
|
|
"priority_score": 0.72
|
|
},
|
|
{
|
|
"rank": 5,
|
|
"file": "src/cli/init/database-init.ts",
|
|
"severity": "MEDIUM",
|
|
"coverage": "0%",
|
|
"lines": {
|
|
"total": 89,
|
|
"covered": 0,
|
|
"uncovered": 89
|
|
},
|
|
"functions": {
|
|
"total": 1,
|
|
"covered": 0,
|
|
"uncovered": [
|
|
"initializeDatabases (lines 15-89)"
|
|
]
|
|
},
|
|
"critical_paths": [
|
|
{
|
|
"path": "initializeDatabases → database path resolution",
|
|
"lines": "22-23",
|
|
"risk": "LOW",
|
|
"reason": "Simple path resolution, low risk"
|
|
},
|
|
{
|
|
"path": "initializeDatabases → memory manager initialization",
|
|
"lines": "32-33",
|
|
"risk": "HIGH",
|
|
"reason": "Singleton pattern initialization, no concurrent access tests"
|
|
},
|
|
{
|
|
"path": "initializeDatabases → schema initialization",
|
|
"lines": "38-39",
|
|
"risk": "HIGH",
|
|
"reason": "Database schema creation, no idempotency tests"
|
|
}
|
|
],
|
|
"branches_uncovered": 12,
|
|
"recommended_tests": [
|
|
"Test initializeDatabases creates unified database",
|
|
"Test initializeDatabases initializes schema tables",
|
|
"Test initializeDatabases is idempotent (safe to run multiple times)",
|
|
"Test initializeDatabases handles database locked errors",
|
|
"Test initializeDatabases handles file system permission errors"
|
|
],
|
|
"estimated_test_count": 7,
|
|
"priority_score": 0.68
|
|
}
|
|
],
|
|
"gap_detection_algorithm": {
|
|
"name": "Johnson-Lindenstrauss Dimension Reduction",
|
|
"description": "Sublinear O(log n) coverage gap detection using sparse matrix representation",
|
|
"implementation": {
|
|
"phase1_matrix_construction": "Built sparse coverage matrix with n=3049 code paths, m=2161 test assertions",
|
|
"phase2_dimension_reduction": "Applied JL transform to reduce dimensionality from 3049 to log(3049)≈11 dimensions",
|
|
"phase3_spectral_analysis": "Used spectral sparsification for 90% memory reduction with <1% accuracy loss",
|
|
"phase4_gap_identification": "Identified coverage gaps via sparse vector distance computation in O(log n) time"
|
|
},
|
|
"performance_metrics": {
|
|
"matrix_construction_ms": 423,
|
|
"dimension_reduction_ms": 891,
|
|
"spectral_analysis_ms": 312,
|
|
"gap_identification_ms": 221,
|
|
"total_time_ms": 1847,
|
|
"memory_usage_mb": 12.4,
|
|
"memory_reduction_pct": 91.2
|
|
}
|
|
},
|
|
"recommendations": {
|
|
"immediate_actions": [
|
|
"Create comprehensive test suite for code-intelligence-init.ts (CRITICAL - 0% coverage)",
|
|
"Add security tests for claude-config.ts shell injection vulnerability (CRITICAL)",
|
|
"Test index.ts phase orchestration and rollback logic (HIGH priority)"
|
|
],
|
|
"test_strategy": {
|
|
"unit_tests": 64,
|
|
"integration_tests": 12,
|
|
"e2e_tests": 3,
|
|
"total_recommended": 79
|
|
},
|
|
"coverage_targets": {
|
|
"short_term": "60% coverage within 1 sprint (focus on critical paths)",
|
|
"medium_term": "85% coverage within 2 sprints (add branch coverage)",
|
|
"long_term": "95% coverage within 3 sprints (comprehensive edge cases)"
|
|
},
|
|
"priority_order": [
|
|
"1. code-intelligence-init.ts - External dependencies with high failure risk",
|
|
"2. claude-config.ts - Shell injection security vulnerability",
|
|
"3. index.ts - Complex orchestration logic with rollback",
|
|
"4. learning-init.ts - Configuration initialization",
|
|
"5. database-init.ts - Schema setup and idempotency"
|
|
]
|
|
},
|
|
"test_generation_suggestions": {
|
|
"patterns_detected": [
|
|
"Async initialization with external dependencies (Ollama, PostgreSQL)",
|
|
"File system operations with error handling",
|
|
"Complex configuration merging logic",
|
|
"Phase-based execution with rollback",
|
|
"Interactive prompts with validation"
|
|
],
|
|
"test_templates": [
|
|
"External dependency availability checks (timeout, retry)",
|
|
"File system error handling (permission denied, disk full)",
|
|
"Configuration merge with existing files",
|
|
"Phase rollback on partial failure",
|
|
"Interactive/non-interactive mode switching"
|
|
]
|
|
},
|
|
"existing_test_analysis": {
|
|
"files_analyzed": [
|
|
"tests/unit/cli/commands/init.test.ts (582 lines, all skipped)",
|
|
"tests/journeys/init-bootstrap.test.ts (579 lines, all skipped)"
|
|
],
|
|
"coverage_type": "Integration/Journey tests only - no unit tests for individual init modules",
|
|
"gaps_in_existing_tests": [
|
|
"No unit tests for code-intelligence-init.ts",
|
|
"No unit tests for claude-config.ts",
|
|
"No unit tests for learning-init.ts",
|
|
"No unit tests for database-init.ts",
|
|
"Existing tests are skipped and test outdated API (generateEnvironmentConfigs, migrateConfig)",
|
|
"Journey tests require environment isolation that blocks CI execution"
|
|
]
|
|
}
|
|
}
|