agentic-qe 1.4.4 → 1.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/agents/qe-api-contract-validator.md +133 -27
- package/.claude/agents/qe-api-contract-validator.md.backup +1148 -0
- package/.claude/agents/qe-api-contract-validator.md.backup-20251107-134747 +1148 -0
- package/.claude/agents/qe-api-contract-validator.md.backup-phase2-20251107-140039 +1123 -0
- package/.claude/agents/qe-chaos-engineer.md +142 -23
- package/.claude/agents/qe-chaos-engineer.md.backup +808 -0
- package/.claude/agents/qe-chaos-engineer.md.backup-20251107-134747 +808 -0
- package/.claude/agents/qe-chaos-engineer.md.backup-phase2-20251107-140039 +787 -0
- package/.claude/agents/qe-code-complexity.md +111 -23
- package/.claude/agents/qe-code-complexity.md.backup +291 -0
- package/.claude/agents/qe-code-complexity.md.backup-20251107-134747 +291 -0
- package/.claude/agents/qe-code-complexity.md.backup-phase2-20251107-140039 +286 -0
- package/.claude/agents/qe-coverage-analyzer.md +306 -30
- package/.claude/agents/qe-coverage-analyzer.md.backup +467 -0
- package/.claude/agents/qe-coverage-analyzer.md.backup-20251107-134747 +467 -0
- package/.claude/agents/qe-coverage-analyzer.md.backup-phase2-20251107-140039 +438 -0
- package/.claude/agents/qe-deployment-readiness.md +84 -28
- package/.claude/agents/qe-deployment-readiness.md.backup +1166 -0
- package/.claude/agents/qe-deployment-readiness.md.backup-20251107-134747 +1166 -0
- package/.claude/agents/qe-deployment-readiness.md.backup-phase2-20251107-140039 +1140 -0
- package/.claude/agents/qe-flaky-test-hunter.md +277 -35
- package/.claude/agents/qe-flaky-test-hunter.md.backup +1195 -0
- package/.claude/agents/qe-flaky-test-hunter.md.backup-20251107-134747 +1195 -0
- package/.claude/agents/qe-flaky-test-hunter.md.backup-phase2-20251107-140039 +1162 -0
- package/.claude/agents/qe-fleet-commander.md +126 -23
- package/.claude/agents/qe-fleet-commander.md.backup +718 -0
- package/.claude/agents/qe-fleet-commander.md.backup-20251107-134747 +718 -0
- package/.claude/agents/qe-fleet-commander.md.backup-phase2-20251107-140039 +697 -0
- package/.claude/agents/qe-performance-tester.md +314 -57
- package/.claude/agents/qe-performance-tester.md.backup +428 -0
- package/.claude/agents/qe-performance-tester.md.backup-20251107-134747 +428 -0
- package/.claude/agents/qe-performance-tester.md.backup-phase2-20251107-140039 +372 -0
- package/.claude/agents/qe-production-intelligence.md +126 -27
- package/.claude/agents/qe-production-intelligence.md.backup +1219 -0
- package/.claude/agents/qe-production-intelligence.md.backup-20251107-134747 +1219 -0
- package/.claude/agents/qe-production-intelligence.md.backup-phase2-20251107-140039 +1194 -0
- package/.claude/agents/qe-quality-analyzer.md +127 -32
- package/.claude/agents/qe-quality-analyzer.md.backup +425 -0
- package/.claude/agents/qe-quality-analyzer.md.backup-20251107-134747 +425 -0
- package/.claude/agents/qe-quality-analyzer.md.backup-phase2-20251107-140039 +394 -0
- package/.claude/agents/qe-quality-gate.md +148 -33
- package/.claude/agents/qe-quality-gate.md.backup +446 -0
- package/.claude/agents/qe-quality-gate.md.backup-20251107-134747 +446 -0
- package/.claude/agents/qe-quality-gate.md.backup-phase2-20251107-140039 +415 -0
- package/.claude/agents/qe-regression-risk-analyzer.md +78 -27
- package/.claude/agents/qe-regression-risk-analyzer.md.backup +1009 -0
- package/.claude/agents/qe-regression-risk-analyzer.md.backup-20251107-134747 +1009 -0
- package/.claude/agents/qe-regression-risk-analyzer.md.backup-phase2-20251107-140039 +984 -0
- package/.claude/agents/qe-requirements-validator.md +131 -27
- package/.claude/agents/qe-requirements-validator.md.backup +748 -0
- package/.claude/agents/qe-requirements-validator.md.backup-20251107-134747 +748 -0
- package/.claude/agents/qe-requirements-validator.md.backup-phase2-20251107-140039 +723 -0
- package/.claude/agents/qe-security-scanner.md +137 -62
- package/.claude/agents/qe-security-scanner.md.backup +634 -0
- package/.claude/agents/qe-security-scanner.md.backup-20251107-134747 +634 -0
- package/.claude/agents/qe-security-scanner.md.backup-phase2-20251107-140039 +573 -0
- package/.claude/agents/qe-test-data-architect.md +129 -26
- package/.claude/agents/qe-test-data-architect.md.backup +1064 -0
- package/.claude/agents/qe-test-data-architect.md.backup-20251107-134747 +1064 -0
- package/.claude/agents/qe-test-data-architect.md.backup-phase2-20251107-140039 +1040 -0
- package/.claude/agents/qe-test-executor.md +165 -21
- package/.claude/agents/qe-test-executor.md.backup +389 -0
- package/.claude/agents/qe-test-executor.md.backup-20251107-134747 +389 -0
- package/.claude/agents/qe-test-executor.md.backup-phase2-20251107-140039 +369 -0
- package/.claude/agents/qe-test-generator.md +379 -34
- package/.claude/agents/qe-test-generator.md.backup +997 -0
- package/.claude/agents/qe-test-generator.md.backup-20251107-134747 +997 -0
- package/.claude/agents/qe-visual-tester.md +236 -23
- package/.claude/agents/qe-visual-tester.md.backup +777 -0
- package/.claude/agents/qe-visual-tester.md.backup-20251107-134747 +777 -0
- package/.claude/agents/qe-visual-tester.md.backup-phase2-20251107-140039 +756 -0
- package/.claude/agents/subagents/qe-code-reviewer.md +59 -0
- package/.claude/agents/subagents/qe-data-generator.md +60 -0
- package/.claude/agents/subagents/qe-integration-tester.md +77 -0
- package/.claude/agents/subagents/qe-performance-validator.md +55 -0
- package/.claude/agents/subagents/qe-security-auditor.md +51 -0
- package/.claude/agents/subagents/qe-test-implementer.md +371 -0
- package/.claude/agents/subagents/qe-test-refactorer.md +510 -0
- package/.claude/agents/subagents/qe-test-writer.md +603 -0
- package/.claude/skills/accessibility-testing/SKILL.md +764 -777
- package/.claude/skills/agentic-quality-engineering/SKILL.md +0 -6
- package/.claude/skills/api-testing-patterns/SKILL.md +0 -12
- package/.claude/skills/bug-reporting-excellence/SKILL.md +0 -6
- package/.claude/skills/chaos-engineering-resilience/SKILL.md +0 -6
- package/.claude/skills/code-review-quality/SKILL.md +0 -6
- package/.claude/skills/compatibility-testing/SKILL.md +0 -6
- package/.claude/skills/compliance-testing/SKILL.md +0 -6
- package/.claude/skills/consultancy-practices/SKILL.md +0 -6
- package/.claude/skills/context-driven-testing/SKILL.md +0 -6
- package/.claude/skills/contract-testing/SKILL.md +0 -6
- package/.claude/skills/database-testing/SKILL.md +0 -6
- package/.claude/skills/exploratory-testing-advanced/SKILL.md +0 -6
- package/.claude/skills/holistic-testing-pact/SKILL.md +0 -6
- package/.claude/skills/localization-testing/SKILL.md +0 -6
- package/.claude/skills/mobile-testing/SKILL.md +535 -548
- package/.claude/skills/mutation-testing/SKILL.md +0 -6
- package/.claude/skills/performance-testing/SKILL.md +0 -6
- package/.claude/skills/quality-metrics/SKILL.md +0 -12
- package/.claude/skills/refactoring-patterns/SKILL.md +0 -6
- package/.claude/skills/regression-testing/SKILL.md +1033 -1045
- package/.claude/skills/risk-based-testing/SKILL.md +0 -12
- package/.claude/skills/security-testing/SKILL.md +0 -6
- package/.claude/skills/shift-left-testing/SKILL.md +529 -535
- package/.claude/skills/shift-right-testing/SKILL.md +585 -591
- package/.claude/skills/tdd-london-chicago/SKILL.md +0 -6
- package/.claude/skills/technical-writing/SKILL.md +0 -6
- package/.claude/skills/test-automation-strategy/SKILL.md +0 -6
- package/.claude/skills/test-data-management/SKILL.md +1054 -1067
- package/.claude/skills/test-design-techniques/SKILL.md +0 -6
- package/.claude/skills/test-environment-management/SKILL.md +0 -6
- package/.claude/skills/test-reporting-analytics/SKILL.md +0 -6
- package/.claude/skills/visual-testing-advanced/SKILL.md +0 -6
- package/.claude/skills/xp-practices/SKILL.md +0 -6
- package/CHANGELOG.md +426 -5
- package/README.md +24 -19
- package/dist/cli/commands/init.d.ts +4 -0
- package/dist/cli/commands/init.d.ts.map +1 -1
- package/dist/cli/commands/init.js +97 -44
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/mcp/handlers/coordination/index.d.ts +14 -14
- package/dist/mcp/handlers/coordination/index.d.ts.map +1 -1
- package/dist/mcp/handlers/coordination/index.js +14 -14
- package/dist/mcp/handlers/coordination/index.js.map +1 -1
- package/dist/mcp/handlers/phase2/Phase2Tools.d.ts.map +1 -1
- package/dist/mcp/handlers/phase2/Phase2Tools.js +39 -10
- package/dist/mcp/handlers/phase2/Phase2Tools.js.map +1 -1
- package/dist/mcp/handlers/phase3/Phase3DomainTools.d.ts +63 -0
- package/dist/mcp/handlers/phase3/Phase3DomainTools.d.ts.map +1 -0
- package/dist/mcp/handlers/phase3/Phase3DomainTools.js +885 -0
- package/dist/mcp/handlers/phase3/Phase3DomainTools.js.map +1 -0
- package/dist/mcp/handlers/phase3/index.d.ts +6 -0
- package/dist/mcp/handlers/phase3/index.d.ts.map +1 -0
- package/dist/mcp/handlers/phase3/index.js +10 -0
- package/dist/mcp/handlers/phase3/index.js.map +1 -0
- package/dist/mcp/handlers/prediction/index.d.ts +10 -10
- package/dist/mcp/handlers/prediction/index.d.ts.map +1 -1
- package/dist/mcp/handlers/prediction/index.js +10 -10
- package/dist/mcp/handlers/prediction/index.js.map +1 -1
- package/dist/mcp/handlers/security/check-authz.d.ts +152 -0
- package/dist/mcp/handlers/security/check-authz.d.ts.map +1 -0
- package/dist/mcp/handlers/security/check-authz.js +434 -0
- package/dist/mcp/handlers/security/check-authz.js.map +1 -0
- package/dist/mcp/handlers/security/generate-report.d.ts +156 -0
- package/dist/mcp/handlers/security/generate-report.d.ts.map +1 -0
- package/dist/mcp/handlers/security/generate-report.js +469 -0
- package/dist/mcp/handlers/security/generate-report.js.map +1 -0
- package/dist/mcp/handlers/security/index.d.ts +80 -0
- package/dist/mcp/handlers/security/index.d.ts.map +1 -0
- package/dist/mcp/handlers/security/index.js +91 -0
- package/dist/mcp/handlers/security/index.js.map +1 -0
- package/dist/mcp/handlers/security/scan-comprehensive.d.ts +66 -0
- package/dist/mcp/handlers/security/scan-comprehensive.d.ts.map +1 -0
- package/dist/mcp/handlers/security/scan-comprehensive.js +296 -0
- package/dist/mcp/handlers/security/scan-comprehensive.js.map +1 -0
- package/dist/mcp/handlers/security/scan-dependencies.d.ts +148 -0
- package/dist/mcp/handlers/security/scan-dependencies.d.ts.map +1 -0
- package/dist/mcp/handlers/security/scan-dependencies.js +354 -0
- package/dist/mcp/handlers/security/scan-dependencies.js.map +1 -0
- package/dist/mcp/handlers/security/validate-auth.d.ts +128 -0
- package/dist/mcp/handlers/security/validate-auth.d.ts.map +1 -0
- package/dist/mcp/handlers/security/validate-auth.js +294 -0
- package/dist/mcp/handlers/security/validate-auth.js.map +1 -0
- package/dist/mcp/handlers/test/generate-integration-tests.d.ts +95 -0
- package/dist/mcp/handlers/test/generate-integration-tests.d.ts.map +1 -0
- package/dist/mcp/handlers/test/generate-integration-tests.js +286 -0
- package/dist/mcp/handlers/test/generate-integration-tests.js.map +1 -0
- package/dist/mcp/handlers/test/generate-unit-tests.d.ts +89 -0
- package/dist/mcp/handlers/test/generate-unit-tests.d.ts.map +1 -0
- package/dist/mcp/handlers/test/generate-unit-tests.js +273 -0
- package/dist/mcp/handlers/test/generate-unit-tests.js.map +1 -0
- package/dist/mcp/handlers/test/optimize-test-suite.d.ts +97 -0
- package/dist/mcp/handlers/test/optimize-test-suite.d.ts.map +1 -0
- package/dist/mcp/handlers/test/optimize-test-suite.js +282 -0
- package/dist/mcp/handlers/test/optimize-test-suite.js.map +1 -0
- package/dist/mcp/server.d.ts.map +1 -1
- package/dist/mcp/server.js +211 -0
- package/dist/mcp/server.js.map +1 -1
- package/dist/mcp/tools/deprecated.d.ts +1390 -0
- package/dist/mcp/tools/deprecated.d.ts.map +1 -0
- package/dist/mcp/tools/deprecated.js +859 -0
- package/dist/mcp/tools/deprecated.js.map +1 -0
- package/dist/mcp/tools/qe/api-contract/index.d.ts +138 -0
- package/dist/mcp/tools/qe/api-contract/index.d.ts.map +1 -0
- package/dist/mcp/tools/qe/api-contract/index.js +572 -0
- package/dist/mcp/tools/qe/api-contract/index.js.map +1 -0
- package/dist/mcp/tools/qe/code-quality/analyze-complexity.d.ts +110 -0
- package/dist/mcp/tools/qe/code-quality/analyze-complexity.d.ts.map +1 -0
- package/dist/mcp/tools/qe/code-quality/analyze-complexity.js +381 -0
- package/dist/mcp/tools/qe/code-quality/analyze-complexity.js.map +1 -0
- package/dist/mcp/tools/qe/code-quality/calculate-quality-metrics.d.ts +115 -0
- package/dist/mcp/tools/qe/code-quality/calculate-quality-metrics.d.ts.map +1 -0
- package/dist/mcp/tools/qe/code-quality/calculate-quality-metrics.js +461 -0
- package/dist/mcp/tools/qe/code-quality/calculate-quality-metrics.js.map +1 -0
- package/dist/mcp/tools/qe/code-quality/index.d.ts +12 -0
- package/dist/mcp/tools/qe/code-quality/index.d.ts.map +1 -0
- package/dist/mcp/tools/qe/code-quality/index.js +30 -0
- package/dist/mcp/tools/qe/code-quality/index.js.map +1 -0
- package/dist/mcp/tools/qe/coverage/analyze-with-risk-scoring.d.ts +58 -0
- package/dist/mcp/tools/qe/coverage/analyze-with-risk-scoring.d.ts.map +1 -0
- package/dist/mcp/tools/qe/coverage/analyze-with-risk-scoring.js +172 -0
- package/dist/mcp/tools/qe/coverage/analyze-with-risk-scoring.js.map +1 -0
- package/dist/mcp/tools/qe/coverage/calculate-trends.d.ts +73 -0
- package/dist/mcp/tools/qe/coverage/calculate-trends.d.ts.map +1 -0
- package/dist/mcp/tools/qe/coverage/calculate-trends.js +240 -0
- package/dist/mcp/tools/qe/coverage/calculate-trends.js.map +1 -0
- package/dist/mcp/tools/qe/coverage/detect-gaps-ml.d.ts +38 -0
- package/dist/mcp/tools/qe/coverage/detect-gaps-ml.d.ts.map +1 -0
- package/dist/mcp/tools/qe/coverage/detect-gaps-ml.js +204 -0
- package/dist/mcp/tools/qe/coverage/detect-gaps-ml.js.map +1 -0
- package/dist/mcp/tools/qe/coverage/index.d.ts +12 -0
- package/dist/mcp/tools/qe/coverage/index.d.ts.map +1 -0
- package/dist/mcp/tools/qe/coverage/index.js +23 -0
- package/dist/mcp/tools/qe/coverage/index.js.map +1 -0
- package/dist/mcp/tools/qe/coverage/recommend-tests.d.ts +46 -0
- package/dist/mcp/tools/qe/coverage/recommend-tests.d.ts.map +1 -0
- package/dist/mcp/tools/qe/coverage/recommend-tests.js +248 -0
- package/dist/mcp/tools/qe/coverage/recommend-tests.js.map +1 -0
- package/dist/mcp/tools/qe/flaky-detection/analyze-patterns.d.ts +179 -0
- package/dist/mcp/tools/qe/flaky-detection/analyze-patterns.d.ts.map +1 -0
- package/dist/mcp/tools/qe/flaky-detection/analyze-patterns.js +554 -0
- package/dist/mcp/tools/qe/flaky-detection/analyze-patterns.js.map +1 -0
- package/dist/mcp/tools/qe/flaky-detection/detect-statistical.d.ts +172 -0
- package/dist/mcp/tools/qe/flaky-detection/detect-statistical.d.ts.map +1 -0
- package/dist/mcp/tools/qe/flaky-detection/detect-statistical.js +498 -0
- package/dist/mcp/tools/qe/flaky-detection/detect-statistical.js.map +1 -0
- package/dist/mcp/tools/qe/flaky-detection/index.d.ts +35 -0
- package/dist/mcp/tools/qe/flaky-detection/index.d.ts.map +1 -0
- package/dist/mcp/tools/qe/flaky-detection/index.js +66 -0
- package/dist/mcp/tools/qe/flaky-detection/index.js.map +1 -0
- package/dist/mcp/tools/qe/flaky-detection/stabilize-auto.d.ts +159 -0
- package/dist/mcp/tools/qe/flaky-detection/stabilize-auto.d.ts.map +1 -0
- package/dist/mcp/tools/qe/flaky-detection/stabilize-auto.js +462 -0
- package/dist/mcp/tools/qe/flaky-detection/stabilize-auto.js.map +1 -0
- package/dist/mcp/tools/qe/fleet/index.d.ts +422 -0
- package/dist/mcp/tools/qe/fleet/index.d.ts.map +1 -0
- package/dist/mcp/tools/qe/fleet/index.js +652 -0
- package/dist/mcp/tools/qe/fleet/index.js.map +1 -0
- package/dist/mcp/tools/qe/performance/analyze-bottlenecks.d.ts +180 -0
- package/dist/mcp/tools/qe/performance/analyze-bottlenecks.d.ts.map +1 -0
- package/dist/mcp/tools/qe/performance/analyze-bottlenecks.js +347 -0
- package/dist/mcp/tools/qe/performance/analyze-bottlenecks.js.map +1 -0
- package/dist/mcp/tools/qe/performance/generate-report.d.ts +146 -0
- package/dist/mcp/tools/qe/performance/generate-report.d.ts.map +1 -0
- package/dist/mcp/tools/qe/performance/generate-report.js +354 -0
- package/dist/mcp/tools/qe/performance/generate-report.js.map +1 -0
- package/dist/mcp/tools/qe/performance/index.d.ts +13 -0
- package/dist/mcp/tools/qe/performance/index.d.ts.map +1 -0
- package/dist/mcp/tools/qe/performance/index.js +24 -0
- package/dist/mcp/tools/qe/performance/index.js.map +1 -0
- package/dist/mcp/tools/qe/performance/monitor-realtime.d.ts +120 -0
- package/dist/mcp/tools/qe/performance/monitor-realtime.d.ts.map +1 -0
- package/dist/mcp/tools/qe/performance/monitor-realtime.js +215 -0
- package/dist/mcp/tools/qe/performance/monitor-realtime.js.map +1 -0
- package/dist/mcp/tools/qe/performance/run-benchmark.d.ts +68 -0
- package/dist/mcp/tools/qe/performance/run-benchmark.d.ts.map +1 -0
- package/dist/mcp/tools/qe/performance/run-benchmark.js +120 -0
- package/dist/mcp/tools/qe/performance/run-benchmark.js.map +1 -0
- package/dist/mcp/tools/qe/quality-gates/assess-deployment-risk.d.ts +239 -0
- package/dist/mcp/tools/qe/quality-gates/assess-deployment-risk.d.ts.map +1 -0
- package/dist/mcp/tools/qe/quality-gates/assess-deployment-risk.js +671 -0
- package/dist/mcp/tools/qe/quality-gates/assess-deployment-risk.js.map +1 -0
- package/dist/mcp/tools/qe/quality-gates/evaluate-quality-gate.d.ts +219 -0
- package/dist/mcp/tools/qe/quality-gates/evaluate-quality-gate.d.ts.map +1 -0
- package/dist/mcp/tools/qe/quality-gates/evaluate-quality-gate.js +732 -0
- package/dist/mcp/tools/qe/quality-gates/evaluate-quality-gate.js.map +1 -0
- package/dist/mcp/tools/qe/quality-gates/generate-quality-report.d.ts +447 -0
- package/dist/mcp/tools/qe/quality-gates/generate-quality-report.d.ts.map +1 -0
- package/dist/mcp/tools/qe/quality-gates/generate-quality-report.js +551 -0
- package/dist/mcp/tools/qe/quality-gates/generate-quality-report.js.map +1 -0
- package/dist/mcp/tools/qe/quality-gates/index.d.ts +40 -0
- package/dist/mcp/tools/qe/quality-gates/index.d.ts.map +1 -0
- package/dist/mcp/tools/qe/quality-gates/index.js +56 -0
- package/dist/mcp/tools/qe/quality-gates/index.js.map +1 -0
- package/dist/mcp/tools/qe/quality-gates/validate-quality-metrics.d.ts +226 -0
- package/dist/mcp/tools/qe/quality-gates/validate-quality-metrics.d.ts.map +1 -0
- package/dist/mcp/tools/qe/quality-gates/validate-quality-metrics.js +603 -0
- package/dist/mcp/tools/qe/quality-gates/validate-quality-metrics.js.map +1 -0
- package/dist/mcp/tools/qe/regression/analyze-risk.d.ts +212 -0
- package/dist/mcp/tools/qe/regression/analyze-risk.d.ts.map +1 -0
- package/dist/mcp/tools/qe/regression/analyze-risk.js +617 -0
- package/dist/mcp/tools/qe/regression/analyze-risk.js.map +1 -0
- package/dist/mcp/tools/qe/regression/index.d.ts +36 -0
- package/dist/mcp/tools/qe/regression/index.d.ts.map +1 -0
- package/dist/mcp/tools/qe/regression/index.js +63 -0
- package/dist/mcp/tools/qe/regression/index.js.map +1 -0
- package/dist/mcp/tools/qe/regression/select-tests.d.ts +241 -0
- package/dist/mcp/tools/qe/regression/select-tests.d.ts.map +1 -0
- package/dist/mcp/tools/qe/regression/select-tests.js +601 -0
- package/dist/mcp/tools/qe/regression/select-tests.js.map +1 -0
- package/dist/mcp/tools/qe/requirements/generate-bdd-scenarios.d.ts +134 -0
- package/dist/mcp/tools/qe/requirements/generate-bdd-scenarios.d.ts.map +1 -0
- package/dist/mcp/tools/qe/requirements/generate-bdd-scenarios.js +737 -0
- package/dist/mcp/tools/qe/requirements/generate-bdd-scenarios.js.map +1 -0
- package/dist/mcp/tools/qe/requirements/index.d.ts +40 -0
- package/dist/mcp/tools/qe/requirements/index.d.ts.map +1 -0
- package/dist/mcp/tools/qe/requirements/index.js +84 -0
- package/dist/mcp/tools/qe/requirements/index.js.map +1 -0
- package/dist/mcp/tools/qe/requirements/validate-requirements.d.ts +196 -0
- package/dist/mcp/tools/qe/requirements/validate-requirements.d.ts.map +1 -0
- package/dist/mcp/tools/qe/requirements/validate-requirements.js +740 -0
- package/dist/mcp/tools/qe/requirements/validate-requirements.js.map +1 -0
- package/dist/mcp/tools/qe/security/detect-vulnerabilities.d.ts +300 -0
- package/dist/mcp/tools/qe/security/detect-vulnerabilities.d.ts.map +1 -0
- package/dist/mcp/tools/qe/security/detect-vulnerabilities.js +492 -0
- package/dist/mcp/tools/qe/security/detect-vulnerabilities.js.map +1 -0
- package/dist/mcp/tools/qe/security/index.d.ts +34 -0
- package/dist/mcp/tools/qe/security/index.d.ts.map +1 -0
- package/dist/mcp/tools/qe/security/index.js +44 -0
- package/dist/mcp/tools/qe/security/index.js.map +1 -0
- package/dist/mcp/tools/qe/security/scan-comprehensive.d.ts +240 -0
- package/dist/mcp/tools/qe/security/scan-comprehensive.d.ts.map +1 -0
- package/dist/mcp/tools/qe/security/scan-comprehensive.js +557 -0
- package/dist/mcp/tools/qe/security/scan-comprehensive.js.map +1 -0
- package/dist/mcp/tools/qe/security/validate-compliance.d.ts +299 -0
- package/dist/mcp/tools/qe/security/validate-compliance.d.ts.map +1 -0
- package/dist/mcp/tools/qe/security/validate-compliance.js +517 -0
- package/dist/mcp/tools/qe/security/validate-compliance.js.map +1 -0
- package/dist/mcp/tools/qe/shared/types.d.ts +840 -0
- package/dist/mcp/tools/qe/shared/types.d.ts.map +1 -0
- package/dist/mcp/tools/qe/shared/types.js +13 -0
- package/dist/mcp/tools/qe/shared/types.js.map +1 -0
- package/dist/mcp/tools/qe/test-data/analyze-schema.d.ts +264 -0
- package/dist/mcp/tools/qe/test-data/analyze-schema.d.ts.map +1 -0
- package/dist/mcp/tools/qe/test-data/analyze-schema.js +553 -0
- package/dist/mcp/tools/qe/test-data/analyze-schema.js.map +1 -0
- package/dist/mcp/tools/qe/test-data/generate-test-data.d.ts +167 -0
- package/dist/mcp/tools/qe/test-data/generate-test-data.d.ts.map +1 -0
- package/dist/mcp/tools/qe/test-data/generate-test-data.js +336 -0
- package/dist/mcp/tools/qe/test-data/generate-test-data.js.map +1 -0
- package/dist/mcp/tools/qe/test-data/index.d.ts +44 -0
- package/dist/mcp/tools/qe/test-data/index.d.ts.map +1 -0
- package/dist/mcp/tools/qe/test-data/index.js +90 -0
- package/dist/mcp/tools/qe/test-data/index.js.map +1 -0
- package/dist/mcp/tools/qe/test-data/mask-sensitive-data.d.ts +165 -0
- package/dist/mcp/tools/qe/test-data/mask-sensitive-data.d.ts.map +1 -0
- package/dist/mcp/tools/qe/test-data/mask-sensitive-data.js +342 -0
- package/dist/mcp/tools/qe/test-data/mask-sensitive-data.js.map +1 -0
- package/dist/mcp/tools/qe/test-generation/analyze-test-quality.d.ts +144 -0
- package/dist/mcp/tools/qe/test-generation/analyze-test-quality.d.ts.map +1 -0
- package/dist/mcp/tools/qe/test-generation/analyze-test-quality.js +432 -0
- package/dist/mcp/tools/qe/test-generation/analyze-test-quality.js.map +1 -0
- package/dist/mcp/tools/qe/test-generation/generate-integration-tests.d.ts +98 -0
- package/dist/mcp/tools/qe/test-generation/generate-integration-tests.d.ts.map +1 -0
- package/dist/mcp/tools/qe/test-generation/generate-integration-tests.js +459 -0
- package/dist/mcp/tools/qe/test-generation/generate-integration-tests.js.map +1 -0
- package/dist/mcp/tools/qe/test-generation/generate-unit-tests.d.ts +83 -0
- package/dist/mcp/tools/qe/test-generation/generate-unit-tests.d.ts.map +1 -0
- package/dist/mcp/tools/qe/test-generation/generate-unit-tests.js +483 -0
- package/dist/mcp/tools/qe/test-generation/generate-unit-tests.js.map +1 -0
- package/dist/mcp/tools/qe/test-generation/index.d.ts +56 -0
- package/dist/mcp/tools/qe/test-generation/index.d.ts.map +1 -0
- package/dist/mcp/tools/qe/test-generation/index.js +97 -0
- package/dist/mcp/tools/qe/test-generation/index.js.map +1 -0
- package/dist/mcp/tools/qe/test-generation/optimize-test-suite.d.ts +124 -0
- package/dist/mcp/tools/qe/test-generation/optimize-test-suite.d.ts.map +1 -0
- package/dist/mcp/tools/qe/test-generation/optimize-test-suite.js +362 -0
- package/dist/mcp/tools/qe/test-generation/optimize-test-suite.js.map +1 -0
- package/dist/mcp/tools/qe/visual/compare-screenshots.d.ts +119 -0
- package/dist/mcp/tools/qe/visual/compare-screenshots.d.ts.map +1 -0
- package/dist/mcp/tools/qe/visual/compare-screenshots.js +280 -0
- package/dist/mcp/tools/qe/visual/compare-screenshots.js.map +1 -0
- package/dist/mcp/tools/qe/visual/detect-regression.d.ts +138 -0
- package/dist/mcp/tools/qe/visual/detect-regression.d.ts.map +1 -0
- package/dist/mcp/tools/qe/visual/detect-regression.js +271 -0
- package/dist/mcp/tools/qe/visual/detect-regression.js.map +1 -0
- package/dist/mcp/tools/qe/visual/index.d.ts +16 -0
- package/dist/mcp/tools/qe/visual/index.d.ts.map +1 -0
- package/dist/mcp/tools/qe/visual/index.js +22 -0
- package/dist/mcp/tools/qe/visual/index.js.map +1 -0
- package/dist/mcp/tools/qe/visual/validate-accessibility.d.ts +276 -0
- package/dist/mcp/tools/qe/visual/validate-accessibility.d.ts.map +1 -0
- package/dist/mcp/tools/qe/visual/validate-accessibility.js +413 -0
- package/dist/mcp/tools/qe/visual/validate-accessibility.js.map +1 -0
- package/dist/mcp/tools.d.ts +44 -0
- package/dist/mcp/tools.d.ts.map +1 -1
- package/dist/mcp/tools.js +1980 -1
- package/dist/mcp/tools.js.map +1 -1
- package/package.json +2 -2
- package/dist/learning/__mocks__/LearningEngine.d.ts +0 -39
- package/dist/learning/__mocks__/LearningEngine.d.ts.map +0 -1
- package/dist/learning/__mocks__/LearningEngine.js +0 -116
- package/dist/learning/__mocks__/LearningEngine.js.map +0 -1
- package/dist/utils/__mocks__/Database.d.ts +0 -85
- package/dist/utils/__mocks__/Database.d.ts.map +0 -1
- package/dist/utils/__mocks__/Database.js +0 -125
- package/dist/utils/__mocks__/Database.js.map +0 -1
- package/dist/utils/__mocks__/Logger.d.ts +0 -26
- package/dist/utils/__mocks__/Logger.d.ts.map +0 -1
- package/dist/utils/__mocks__/Logger.js +0 -44
- package/dist/utils/__mocks__/Logger.js.map +0 -1
|
@@ -0,0 +1,732 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Quality Gate Evaluation Tool
|
|
4
|
+
*
|
|
5
|
+
* Implements intelligent quality gate evaluation using multi-factor decision trees
|
|
6
|
+
* with risk-based logic and dynamic threshold adjustment.
|
|
7
|
+
*
|
|
8
|
+
* Based on SPARC Phase 2 Section 7.1 - Intelligent Quality Gate Algorithm
|
|
9
|
+
*
|
|
10
|
+
* @module tools/qe/quality-gates/evaluate-quality-gate
|
|
11
|
+
* @version 1.0.0
|
|
12
|
+
* @author Agentic QE Team - Phase 3
|
|
13
|
+
* @date 2025-11-09
|
|
14
|
+
*/
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.evaluateQualityGate = evaluateQualityGate;
|
|
17
|
+
// ==================== Default Quality Policy ====================
|
|
18
|
+
/**
|
|
19
|
+
* Default quality policy based on industry standards
|
|
20
|
+
*/
|
|
21
|
+
const DEFAULT_QUALITY_POLICY = {
|
|
22
|
+
id: 'default-quality-policy',
|
|
23
|
+
name: 'Default Quality Policy',
|
|
24
|
+
rules: [
|
|
25
|
+
{
|
|
26
|
+
metric: 'coverage.overallPercentage',
|
|
27
|
+
operator: 'gte',
|
|
28
|
+
threshold: 80,
|
|
29
|
+
severity: 'critical',
|
|
30
|
+
description: 'Code coverage must be at least 80%'
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
metric: 'testResults.failureRate',
|
|
34
|
+
operator: 'lte',
|
|
35
|
+
threshold: 0.05,
|
|
36
|
+
severity: 'critical',
|
|
37
|
+
description: 'Test failure rate must not exceed 5%'
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
metric: 'security.summary.critical',
|
|
41
|
+
operator: 'eq',
|
|
42
|
+
threshold: 0,
|
|
43
|
+
severity: 'critical',
|
|
44
|
+
description: 'No critical security vulnerabilities allowed'
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
metric: 'security.summary.high',
|
|
48
|
+
operator: 'lte',
|
|
49
|
+
threshold: 2,
|
|
50
|
+
severity: 'high',
|
|
51
|
+
description: 'High severity vulnerabilities must not exceed 2'
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
metric: 'performance.errorRate',
|
|
55
|
+
operator: 'lte',
|
|
56
|
+
threshold: 0.10,
|
|
57
|
+
severity: 'medium',
|
|
58
|
+
description: 'Performance error rate must not exceed 10%'
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
metric: 'codeQuality.maintainabilityIndex',
|
|
62
|
+
operator: 'gte',
|
|
63
|
+
threshold: 70,
|
|
64
|
+
severity: 'medium',
|
|
65
|
+
description: 'Maintainability index must be at least 70'
|
|
66
|
+
}
|
|
67
|
+
],
|
|
68
|
+
enforcement: 'blocking',
|
|
69
|
+
environments: ['development', 'staging', 'production']
|
|
70
|
+
};
|
|
71
|
+
// ==================== Main Evaluation Function ====================
|
|
72
|
+
/**
|
|
73
|
+
* Evaluate quality gate using intelligent decision tree
|
|
74
|
+
*
|
|
75
|
+
* Implements multi-factor evaluation with:
|
|
76
|
+
* - Dynamic threshold adjustment
|
|
77
|
+
* - Risk-based decision overrides
|
|
78
|
+
* - Complexity detection
|
|
79
|
+
* - Policy compliance validation
|
|
80
|
+
*
|
|
81
|
+
* @param params - Evaluation parameters
|
|
82
|
+
* @returns Quality gate evaluation result
|
|
83
|
+
*/
|
|
84
|
+
async function evaluateQualityGate(params) {
|
|
85
|
+
const requestId = generateRequestId();
|
|
86
|
+
const startTime = Date.now();
|
|
87
|
+
try {
|
|
88
|
+
// Validate parameters
|
|
89
|
+
validateParameters(params);
|
|
90
|
+
// Use provided policy or default
|
|
91
|
+
const policy = params.policy || DEFAULT_QUALITY_POLICY;
|
|
92
|
+
// Detect complexity indicators
|
|
93
|
+
const complexityIndicators = detectComplexityIndicators(params.metrics, params.testResults || []);
|
|
94
|
+
// If highly complex, may require escalation
|
|
95
|
+
if (complexityIndicators.highComplexity && complexityIndicators.overallComplexity > 0.7) {
|
|
96
|
+
const escalationReason = buildComplexityExplanation(complexityIndicators);
|
|
97
|
+
return createSuccessResponse({
|
|
98
|
+
decision: 'ESCALATE',
|
|
99
|
+
score: complexityIndicators.overallComplexity * 100,
|
|
100
|
+
threshold: 70,
|
|
101
|
+
criteriaEvaluations: [],
|
|
102
|
+
riskFactors: buildComplexityRiskFactors(complexityIndicators),
|
|
103
|
+
explanation: escalationReason,
|
|
104
|
+
recommendations: ['Human review required due to complex quality state'],
|
|
105
|
+
confidence: 1 - complexityIndicators.overallComplexity,
|
|
106
|
+
policyCompliance: {
|
|
107
|
+
compliant: false,
|
|
108
|
+
violations: [],
|
|
109
|
+
warnings: [],
|
|
110
|
+
policyId: policy.id,
|
|
111
|
+
policyVersion: '1.0.0'
|
|
112
|
+
},
|
|
113
|
+
metadata: {
|
|
114
|
+
evaluatedAt: new Date().toISOString(),
|
|
115
|
+
evaluationDuration: Date.now() - startTime,
|
|
116
|
+
decisionTreeVersion: '1.0.0',
|
|
117
|
+
appliedThresholds: {},
|
|
118
|
+
complexityIndicators
|
|
119
|
+
}
|
|
120
|
+
}, requestId, Date.now() - startTime);
|
|
121
|
+
}
|
|
122
|
+
// Evaluate all policy rules
|
|
123
|
+
const criteriaEvaluations = await evaluatePolicyCriteria(params.metrics, policy, params.context);
|
|
124
|
+
// Calculate composite score
|
|
125
|
+
const score = calculateCompositeScore(criteriaEvaluations);
|
|
126
|
+
// Calculate dynamic threshold
|
|
127
|
+
const threshold = calculateDynamicThreshold(params.environment, params.context, params.metrics);
|
|
128
|
+
// Validate policy compliance
|
|
129
|
+
const policyCompliance = validatePolicyCompliance(criteriaEvaluations, policy);
|
|
130
|
+
// Analyze risk factors
|
|
131
|
+
const riskFactors = analyzeRiskFactors(params.metrics, params.context, criteriaEvaluations, params.testResults || []);
|
|
132
|
+
// Make base decision
|
|
133
|
+
const baseDecision = score >= threshold ? 'PASS' : 'FAIL';
|
|
134
|
+
// Apply risk-based overrides
|
|
135
|
+
const finalDecision = applyRiskBasedLogic(baseDecision, riskFactors, policyCompliance);
|
|
136
|
+
// Generate explanation
|
|
137
|
+
const explanation = generateDecisionExplanation(finalDecision, criteriaEvaluations, score, threshold, policyCompliance);
|
|
138
|
+
// Generate recommendations
|
|
139
|
+
const recommendations = generateRecommendations(criteriaEvaluations, riskFactors, params.context);
|
|
140
|
+
// Calculate decision confidence
|
|
141
|
+
const confidence = calculateDecisionConfidence(criteriaEvaluations, riskFactors);
|
|
142
|
+
const evaluation = {
|
|
143
|
+
decision: finalDecision,
|
|
144
|
+
score,
|
|
145
|
+
threshold,
|
|
146
|
+
criteriaEvaluations,
|
|
147
|
+
riskFactors,
|
|
148
|
+
explanation,
|
|
149
|
+
recommendations,
|
|
150
|
+
confidence,
|
|
151
|
+
policyCompliance,
|
|
152
|
+
metadata: {
|
|
153
|
+
evaluatedAt: new Date().toISOString(),
|
|
154
|
+
evaluationDuration: Date.now() - startTime,
|
|
155
|
+
decisionTreeVersion: '1.0.0',
|
|
156
|
+
appliedThresholds: buildAppliedThresholds(criteriaEvaluations),
|
|
157
|
+
complexityIndicators
|
|
158
|
+
}
|
|
159
|
+
};
|
|
160
|
+
return createSuccessResponse(evaluation, requestId, Date.now() - startTime);
|
|
161
|
+
}
|
|
162
|
+
catch (error) {
|
|
163
|
+
return createErrorResponse(error, requestId, Date.now() - startTime);
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
// ==================== Core Evaluation Functions ====================
|
|
167
|
+
/**
|
|
168
|
+
* Evaluate all policy criteria
|
|
169
|
+
*/
|
|
170
|
+
async function evaluatePolicyCriteria(metrics, policy, context) {
|
|
171
|
+
const evaluations = [];
|
|
172
|
+
// Weights for each criterion type
|
|
173
|
+
const weights = {
|
|
174
|
+
coverage: 0.25,
|
|
175
|
+
testResults: 0.30,
|
|
176
|
+
security: 0.25,
|
|
177
|
+
performance: 0.10,
|
|
178
|
+
codeQuality: 0.10
|
|
179
|
+
};
|
|
180
|
+
for (const rule of policy.rules) {
|
|
181
|
+
const value = getMetricValue(metrics, rule.metric);
|
|
182
|
+
const passed = evaluateRule(rule, value);
|
|
183
|
+
const score = calculateRuleScore(rule, value);
|
|
184
|
+
const impact = calculateImpact(rule, value, passed, context);
|
|
185
|
+
const weight = determineWeight(rule.metric, weights);
|
|
186
|
+
evaluations.push({
|
|
187
|
+
name: rule.metric,
|
|
188
|
+
rule,
|
|
189
|
+
value,
|
|
190
|
+
passed,
|
|
191
|
+
score,
|
|
192
|
+
impact,
|
|
193
|
+
weight
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
return evaluations;
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* Get metric value by path
|
|
200
|
+
*/
|
|
201
|
+
function getMetricValue(metrics, path) {
|
|
202
|
+
const parts = path.split('.');
|
|
203
|
+
let value = metrics;
|
|
204
|
+
for (const part of parts) {
|
|
205
|
+
if (value && typeof value === 'object' && part in value) {
|
|
206
|
+
value = value[part];
|
|
207
|
+
}
|
|
208
|
+
else {
|
|
209
|
+
return 0;
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
return typeof value === 'number' ? value : 0;
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* Evaluate a single rule
|
|
216
|
+
*/
|
|
217
|
+
function evaluateRule(rule, value) {
|
|
218
|
+
switch (rule.operator) {
|
|
219
|
+
case 'gt':
|
|
220
|
+
return value > rule.threshold;
|
|
221
|
+
case 'lt':
|
|
222
|
+
return value < rule.threshold;
|
|
223
|
+
case 'eq':
|
|
224
|
+
return value === rule.threshold;
|
|
225
|
+
case 'gte':
|
|
226
|
+
return value >= rule.threshold;
|
|
227
|
+
case 'lte':
|
|
228
|
+
return value <= rule.threshold;
|
|
229
|
+
case 'ne':
|
|
230
|
+
return value !== rule.threshold;
|
|
231
|
+
default:
|
|
232
|
+
return false;
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
/**
|
|
236
|
+
* Calculate normalized score for a rule
|
|
237
|
+
*/
|
|
238
|
+
function calculateRuleScore(rule, value) {
|
|
239
|
+
const { operator, threshold } = rule;
|
|
240
|
+
if (operator === 'gte' || operator === 'gt') {
|
|
241
|
+
// Higher is better
|
|
242
|
+
return threshold > 0 ? Math.min(1.0, value / threshold) : 1.0;
|
|
243
|
+
}
|
|
244
|
+
else if (operator === 'lte' || operator === 'lt') {
|
|
245
|
+
// Lower is better
|
|
246
|
+
return value <= threshold ? 1.0 : Math.max(0.0, 1.0 - (value - threshold) / threshold);
|
|
247
|
+
}
|
|
248
|
+
else if (operator === 'eq') {
|
|
249
|
+
// Exact match
|
|
250
|
+
return value === threshold ? 1.0 : 0.0;
|
|
251
|
+
}
|
|
252
|
+
return 0.0;
|
|
253
|
+
}
|
|
254
|
+
/**
|
|
255
|
+
* Calculate impact description
|
|
256
|
+
*/
|
|
257
|
+
function calculateImpact(rule, value, passed, context) {
|
|
258
|
+
if (passed) {
|
|
259
|
+
return `${rule.description} - Criterion satisfied`;
|
|
260
|
+
}
|
|
261
|
+
const criticalityBoost = context?.criticality === 'critical' ? ' (CRITICAL DEPLOYMENT)' : '';
|
|
262
|
+
if (rule.severity === 'critical') {
|
|
263
|
+
return `High impact - ${rule.description} - Blocking issue${criticalityBoost}`;
|
|
264
|
+
}
|
|
265
|
+
else if (rule.severity === 'high') {
|
|
266
|
+
return `Medium-high impact - ${rule.description}${criticalityBoost}`;
|
|
267
|
+
}
|
|
268
|
+
else {
|
|
269
|
+
return `Medium impact - ${rule.description}`;
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
/**
|
|
273
|
+
* Determine weight for a metric
|
|
274
|
+
*/
|
|
275
|
+
function determineWeight(metricPath, weights) {
|
|
276
|
+
if (metricPath.startsWith('coverage'))
|
|
277
|
+
return weights.coverage;
|
|
278
|
+
if (metricPath.startsWith('testResults'))
|
|
279
|
+
return weights.testResults;
|
|
280
|
+
if (metricPath.startsWith('security'))
|
|
281
|
+
return weights.security;
|
|
282
|
+
if (metricPath.startsWith('performance'))
|
|
283
|
+
return weights.performance;
|
|
284
|
+
if (metricPath.startsWith('codeQuality'))
|
|
285
|
+
return weights.codeQuality;
|
|
286
|
+
return 0.1;
|
|
287
|
+
}
|
|
288
|
+
// ==================== Decision Logic ====================
|
|
289
|
+
/**
|
|
290
|
+
* Calculate composite quality score
|
|
291
|
+
*/
|
|
292
|
+
function calculateCompositeScore(evaluations) {
|
|
293
|
+
let weightedSum = 0;
|
|
294
|
+
let totalWeight = 0;
|
|
295
|
+
for (const evaluation of evaluations) {
|
|
296
|
+
weightedSum += evaluation.score * evaluation.weight;
|
|
297
|
+
totalWeight += evaluation.weight;
|
|
298
|
+
}
|
|
299
|
+
const score = totalWeight > 0 ? (weightedSum / totalWeight) * 100 : 0;
|
|
300
|
+
return Math.round(score * 100) / 100;
|
|
301
|
+
}
|
|
302
|
+
/**
|
|
303
|
+
* Calculate dynamic threshold based on context
|
|
304
|
+
*/
|
|
305
|
+
function calculateDynamicThreshold(environment, context, metrics) {
|
|
306
|
+
let baseThreshold = 80; // Default 80%
|
|
307
|
+
// Adjust for environment
|
|
308
|
+
if (environment === 'production') {
|
|
309
|
+
baseThreshold += 5;
|
|
310
|
+
}
|
|
311
|
+
else if (environment === 'development') {
|
|
312
|
+
baseThreshold -= 5;
|
|
313
|
+
}
|
|
314
|
+
// Adjust for criticality
|
|
315
|
+
if (context?.criticality === 'critical') {
|
|
316
|
+
baseThreshold += 5;
|
|
317
|
+
}
|
|
318
|
+
else if (context?.criticality === 'low') {
|
|
319
|
+
baseThreshold -= 3;
|
|
320
|
+
}
|
|
321
|
+
// Adjust for change magnitude
|
|
322
|
+
const changeMagnitude = calculateChangeMagnitude(context?.changes || []);
|
|
323
|
+
if (changeMagnitude > 0.5) {
|
|
324
|
+
baseThreshold += 3;
|
|
325
|
+
}
|
|
326
|
+
// Adjust for historical performance
|
|
327
|
+
if (context?.previousDeployments && context.previousDeployments.length > 0) {
|
|
328
|
+
const avgHistoricalScore = context.previousDeployments.reduce((sum, d) => sum + d.qualityScore, 0) /
|
|
329
|
+
context.previousDeployments.length;
|
|
330
|
+
if (avgHistoricalScore > 90) {
|
|
331
|
+
baseThreshold -= 2; // Slight relaxation for stable systems
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
// Ensure threshold stays within bounds
|
|
335
|
+
return Math.max(50, Math.min(95, baseThreshold));
|
|
336
|
+
}
|
|
337
|
+
/**
|
|
338
|
+
* Calculate change magnitude
|
|
339
|
+
*/
|
|
340
|
+
function calculateChangeMagnitude(changes) {
|
|
341
|
+
if (changes.length === 0)
|
|
342
|
+
return 0;
|
|
343
|
+
const totalComplexity = changes.reduce((sum, c) => sum + c.complexity, 0);
|
|
344
|
+
const avgComplexity = totalComplexity / changes.length;
|
|
345
|
+
return Math.min(1.0, avgComplexity / 10);
|
|
346
|
+
}
|
|
347
|
+
/**
|
|
348
|
+
* Apply risk-based decision overrides
|
|
349
|
+
*/
|
|
350
|
+
function applyRiskBasedLogic(baseDecision, riskFactors, policyCompliance) {
|
|
351
|
+
// Critical policy violations always fail
|
|
352
|
+
if (!policyCompliance.compliant) {
|
|
353
|
+
const criticalViolations = policyCompliance.violations.filter((v) => v.severity === 'critical');
|
|
354
|
+
if (criticalViolations.length > 0) {
|
|
355
|
+
return 'FAIL';
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
// Critical risks override positive decisions
|
|
359
|
+
const criticalRisks = riskFactors.filter((rf) => rf.severity === 'critical');
|
|
360
|
+
if (criticalRisks.length > 0) {
|
|
361
|
+
return 'FAIL';
|
|
362
|
+
}
|
|
363
|
+
// Multiple high risks require escalation
|
|
364
|
+
const highRisks = riskFactors.filter((rf) => rf.severity === 'high');
|
|
365
|
+
if (highRisks.length > 1 && baseDecision === 'PASS') {
|
|
366
|
+
return 'ESCALATE';
|
|
367
|
+
}
|
|
368
|
+
return baseDecision;
|
|
369
|
+
}
|
|
370
|
+
// ==================== Risk Analysis ====================
|
|
371
|
+
/**
|
|
372
|
+
* Analyze risk factors
|
|
373
|
+
*/
|
|
374
|
+
function analyzeRiskFactors(metrics, context, evaluations, testResults) {
|
|
375
|
+
const risks = [];
|
|
376
|
+
// Deployment risk
|
|
377
|
+
if (context?.deploymentTarget === 'production' && context?.criticality === 'critical') {
|
|
378
|
+
risks.push({
|
|
379
|
+
type: 'deployment-risk',
|
|
380
|
+
severity: 'high',
|
|
381
|
+
probability: 0.3,
|
|
382
|
+
impact: 'Critical production deployment with potential for service disruption',
|
|
383
|
+
mitigation: [
|
|
384
|
+
'Implement staged rollout',
|
|
385
|
+
'Prepare rollback plan',
|
|
386
|
+
'Enable comprehensive monitoring',
|
|
387
|
+
'Conduct final manual review'
|
|
388
|
+
]
|
|
389
|
+
});
|
|
390
|
+
}
|
|
391
|
+
// Change complexity risk
|
|
392
|
+
const changes = context?.changes || [];
|
|
393
|
+
const highComplexityChanges = changes.filter((c) => c.complexity > 8);
|
|
394
|
+
if (highComplexityChanges.length > 0) {
|
|
395
|
+
risks.push({
|
|
396
|
+
type: 'complexity-risk',
|
|
397
|
+
severity: 'medium',
|
|
398
|
+
probability: 0.4,
|
|
399
|
+
impact: `${highComplexityChanges.length} high-complexity changes increase defect probability`,
|
|
400
|
+
mitigation: [
|
|
401
|
+
'Conduct thorough code review',
|
|
402
|
+
'Add additional test coverage',
|
|
403
|
+
'Implement gradual rollout',
|
|
404
|
+
'Monitor error rates closely'
|
|
405
|
+
]
|
|
406
|
+
});
|
|
407
|
+
}
|
|
408
|
+
// Security risk
|
|
409
|
+
if (metrics.security.summary.critical > 0) {
|
|
410
|
+
risks.push({
|
|
411
|
+
type: 'security-risk',
|
|
412
|
+
severity: 'critical',
|
|
413
|
+
probability: 0.8,
|
|
414
|
+
impact: `${metrics.security.summary.critical} critical security vulnerabilities detected`,
|
|
415
|
+
mitigation: [
|
|
416
|
+
'Block deployment immediately',
|
|
417
|
+
'Address critical vulnerabilities',
|
|
418
|
+
'Conduct security audit',
|
|
419
|
+
'Implement security hardening'
|
|
420
|
+
]
|
|
421
|
+
});
|
|
422
|
+
}
|
|
423
|
+
// Test quality risk
|
|
424
|
+
const failedCritical = evaluations.filter((e) => !e.passed && e.rule.severity === 'critical');
|
|
425
|
+
if (failedCritical.length > 0) {
|
|
426
|
+
risks.push({
|
|
427
|
+
type: 'test-quality-risk',
|
|
428
|
+
severity: 'high',
|
|
429
|
+
probability: 0.7,
|
|
430
|
+
impact: 'Critical quality criteria not met',
|
|
431
|
+
mitigation: [
|
|
432
|
+
'Fix failing tests',
|
|
433
|
+
'Increase test coverage',
|
|
434
|
+
'Review test strategy',
|
|
435
|
+
'Conduct root cause analysis'
|
|
436
|
+
]
|
|
437
|
+
});
|
|
438
|
+
}
|
|
439
|
+
// Performance degradation risk
|
|
440
|
+
if (metrics.performance.errorRate > 0.05) {
|
|
441
|
+
risks.push({
|
|
442
|
+
type: 'performance-risk',
|
|
443
|
+
severity: 'medium',
|
|
444
|
+
probability: 0.5,
|
|
445
|
+
impact: `Error rate of ${(metrics.performance.errorRate * 100).toFixed(1)}% exceeds threshold`,
|
|
446
|
+
mitigation: [
|
|
447
|
+
'Optimize critical paths',
|
|
448
|
+
'Implement caching',
|
|
449
|
+
'Scale resources',
|
|
450
|
+
'Conduct load testing'
|
|
451
|
+
]
|
|
452
|
+
});
|
|
453
|
+
}
|
|
454
|
+
// Flaky test risk
|
|
455
|
+
if (metrics.testResults.flakyTests && metrics.testResults.flakyTests > 0) {
|
|
456
|
+
risks.push({
|
|
457
|
+
type: 'flaky-test-risk',
|
|
458
|
+
severity: 'medium',
|
|
459
|
+
probability: 0.6,
|
|
460
|
+
impact: `${metrics.testResults.flakyTests} flaky tests detected - reliability concerns`,
|
|
461
|
+
mitigation: [
|
|
462
|
+
'Stabilize flaky tests',
|
|
463
|
+
'Investigate timing issues',
|
|
464
|
+
'Fix race conditions',
|
|
465
|
+
'Improve test isolation'
|
|
466
|
+
]
|
|
467
|
+
});
|
|
468
|
+
}
|
|
469
|
+
return risks;
|
|
470
|
+
}
|
|
471
|
+
// ==================== Policy Compliance ====================
|
|
472
|
+
/**
|
|
473
|
+
* Validate policy compliance
|
|
474
|
+
*/
|
|
475
|
+
function validatePolicyCompliance(evaluations, policy) {
|
|
476
|
+
const violations = [];
|
|
477
|
+
const warnings = [];
|
|
478
|
+
for (const evaluation of evaluations) {
|
|
479
|
+
if (!evaluation.passed) {
|
|
480
|
+
const violation = {
|
|
481
|
+
ruleId: `rule-${evaluation.name}`,
|
|
482
|
+
ruleName: evaluation.rule.description || evaluation.name,
|
|
483
|
+
severity: evaluation.rule.severity,
|
|
484
|
+
message: evaluation.impact,
|
|
485
|
+
actualValue: evaluation.value,
|
|
486
|
+
expectedValue: evaluation.rule.threshold
|
|
487
|
+
};
|
|
488
|
+
if (evaluation.rule.severity === 'critical' || evaluation.rule.severity === 'high') {
|
|
489
|
+
violations.push(violation);
|
|
490
|
+
}
|
|
491
|
+
else {
|
|
492
|
+
warnings.push({
|
|
493
|
+
ruleId: violation.ruleId,
|
|
494
|
+
message: violation.message,
|
|
495
|
+
recommendation: `Improve ${evaluation.name} to meet quality standards`
|
|
496
|
+
});
|
|
497
|
+
}
|
|
498
|
+
}
|
|
499
|
+
}
|
|
500
|
+
return {
|
|
501
|
+
compliant: violations.length === 0,
|
|
502
|
+
violations,
|
|
503
|
+
warnings,
|
|
504
|
+
policyId: policy.id,
|
|
505
|
+
policyVersion: '1.0.0'
|
|
506
|
+
};
|
|
507
|
+
}
|
|
508
|
+
// ==================== Complexity Detection ====================
|
|
509
|
+
/**
|
|
510
|
+
* Detect complexity indicators
|
|
511
|
+
*/
|
|
512
|
+
function detectComplexityIndicators(metrics, testResults) {
|
|
513
|
+
const failureRate = metrics.testResults.failureRate;
|
|
514
|
+
const vulnerabilityCount = metrics.security.summary.critical + metrics.security.summary.high;
|
|
515
|
+
const performanceIssues = metrics.performance.errorRate > 0.05;
|
|
516
|
+
const codeComplexity = metrics.codeQuality.cyclomaticComplexity > 15;
|
|
517
|
+
const complexityScore = failureRate * 0.3 +
|
|
518
|
+
(vulnerabilityCount > 0 ? 0.25 : 0) +
|
|
519
|
+
(performanceIssues ? 0.25 : 0) +
|
|
520
|
+
(codeComplexity ? 0.20 : 0);
|
|
521
|
+
return {
|
|
522
|
+
overallComplexity: complexityScore,
|
|
523
|
+
highComplexity: complexityScore > 0.6,
|
|
524
|
+
factors: {
|
|
525
|
+
highFailureRate: failureRate > 0.1,
|
|
526
|
+
securityVulnerabilities: vulnerabilityCount > 0,
|
|
527
|
+
performanceIssues,
|
|
528
|
+
codeComplexity
|
|
529
|
+
}
|
|
530
|
+
};
|
|
531
|
+
}
|
|
532
|
+
/**
|
|
533
|
+
* Build complexity explanation
|
|
534
|
+
*/
|
|
535
|
+
function buildComplexityExplanation(indicators) {
|
|
536
|
+
const factors = [];
|
|
537
|
+
if (indicators.factors.highFailureRate) {
|
|
538
|
+
factors.push('high test failure rate');
|
|
539
|
+
}
|
|
540
|
+
if (indicators.factors.securityVulnerabilities) {
|
|
541
|
+
factors.push('security vulnerabilities detected');
|
|
542
|
+
}
|
|
543
|
+
if (indicators.factors.performanceIssues) {
|
|
544
|
+
factors.push('performance degradation');
|
|
545
|
+
}
|
|
546
|
+
if (indicators.factors.codeComplexity) {
|
|
547
|
+
factors.push('high code complexity');
|
|
548
|
+
}
|
|
549
|
+
return `Complex quality state detected (score: ${(indicators.overallComplexity * 100).toFixed(1)}%). Contributing factors: ${factors.join(', ')}. Human review recommended for final deployment decision.`;
|
|
550
|
+
}
|
|
551
|
+
/**
|
|
552
|
+
* Build complexity risk factors
|
|
553
|
+
*/
|
|
554
|
+
function buildComplexityRiskFactors(indicators) {
|
|
555
|
+
return [
|
|
556
|
+
{
|
|
557
|
+
type: 'complexity-risk',
|
|
558
|
+
severity: 'high',
|
|
559
|
+
probability: indicators.overallComplexity,
|
|
560
|
+
impact: 'Quality state too complex for automated decision',
|
|
561
|
+
mitigation: [
|
|
562
|
+
'Manual review required',
|
|
563
|
+
'Address identified complexity factors',
|
|
564
|
+
'Consider additional testing',
|
|
565
|
+
'Implement staged deployment'
|
|
566
|
+
]
|
|
567
|
+
}
|
|
568
|
+
];
|
|
569
|
+
}
|
|
570
|
+
// ==================== Recommendations ====================
|
|
571
|
+
/**
|
|
572
|
+
* Generate actionable recommendations
|
|
573
|
+
*/
|
|
574
|
+
function generateRecommendations(evaluations, riskFactors, context) {
|
|
575
|
+
const recommendations = [];
|
|
576
|
+
// Recommendation from failed evaluations
|
|
577
|
+
const failedEvaluations = evaluations.filter((e) => !e.passed);
|
|
578
|
+
for (const failed of failedEvaluations) {
|
|
579
|
+
if (failed.name.includes('coverage')) {
|
|
580
|
+
recommendations.push(`Increase test coverage to ${failed.rule.threshold}% (current: ${failed.value.toFixed(1)}%)`);
|
|
581
|
+
}
|
|
582
|
+
else if (failed.name.includes('failureRate')) {
|
|
583
|
+
recommendations.push(`Reduce test failure rate to below ${(failed.rule.threshold * 100).toFixed(1)}% (current: ${(failed.value * 100).toFixed(1)}%)`);
|
|
584
|
+
}
|
|
585
|
+
else if (failed.name.includes('security')) {
|
|
586
|
+
recommendations.push('Address critical security vulnerabilities before deployment');
|
|
587
|
+
}
|
|
588
|
+
else if (failed.name.includes('performance')) {
|
|
589
|
+
recommendations.push('Optimize performance to reduce error rate');
|
|
590
|
+
}
|
|
591
|
+
else if (failed.name.includes('maintainability')) {
|
|
592
|
+
recommendations.push('Refactor code to improve maintainability index');
|
|
593
|
+
}
|
|
594
|
+
}
|
|
595
|
+
// Risk-specific recommendations
|
|
596
|
+
for (const risk of riskFactors) {
|
|
597
|
+
if (risk.severity === 'critical' || risk.severity === 'high') {
|
|
598
|
+
recommendations.push(...risk.mitigation);
|
|
599
|
+
}
|
|
600
|
+
}
|
|
601
|
+
// Context-specific recommendations
|
|
602
|
+
if (context?.criticality === 'critical' && failedEvaluations.length > 0) {
|
|
603
|
+
recommendations.push('CRITICAL DEPLOYMENT: Consider additional manual testing and staged rollout');
|
|
604
|
+
}
|
|
605
|
+
if (context?.changes && context.changes.length > 10) {
|
|
606
|
+
recommendations.push('Large changeset detected - consider breaking into smaller, incremental deployments');
|
|
607
|
+
}
|
|
608
|
+
// Remove duplicates and limit to top 10
|
|
609
|
+
return Array.from(new Set(recommendations)).slice(0, 10);
|
|
610
|
+
}
|
|
611
|
+
// ==================== Explanation Generation ====================
|
|
612
|
+
/**
|
|
613
|
+
* Generate decision explanation
|
|
614
|
+
*/
|
|
615
|
+
function generateDecisionExplanation(decision, evaluations, score, threshold, policyCompliance) {
|
|
616
|
+
const passedCount = evaluations.filter((e) => e.passed).length;
|
|
617
|
+
const totalCount = evaluations.length;
|
|
618
|
+
const criticalFailures = evaluations.filter((e) => !e.passed && e.rule.severity === 'critical');
|
|
619
|
+
let explanation = `Quality gate evaluation completed. Score: ${score.toFixed(1)}/${threshold.toFixed(1)}. `;
|
|
620
|
+
explanation += `${passedCount}/${totalCount} criteria passed. `;
|
|
621
|
+
if (decision === 'PASS') {
|
|
622
|
+
explanation += 'All critical quality criteria met. Deployment approved.';
|
|
623
|
+
}
|
|
624
|
+
else if (decision === 'FAIL') {
|
|
625
|
+
if (criticalFailures.length > 0) {
|
|
626
|
+
const failedCriteria = criticalFailures.map((cf) => cf.name).join(', ');
|
|
627
|
+
explanation += `Critical failures in: ${failedCriteria}. `;
|
|
628
|
+
}
|
|
629
|
+
explanation += 'Quality standards not met. Deployment blocked.';
|
|
630
|
+
if (policyCompliance.violations.length > 0) {
|
|
631
|
+
explanation += ` (${policyCompliance.violations.length} policy violations)`;
|
|
632
|
+
}
|
|
633
|
+
}
|
|
634
|
+
else if (decision === 'ESCALATE') {
|
|
635
|
+
explanation += 'Multiple high-severity issues or complex quality state detected. Human review required before deployment.';
|
|
636
|
+
}
|
|
637
|
+
return explanation;
|
|
638
|
+
}
|
|
639
|
+
// ==================== Confidence Calculation ====================
|
|
640
|
+
/**
|
|
641
|
+
* Calculate decision confidence
|
|
642
|
+
*/
|
|
643
|
+
function calculateDecisionConfidence(evaluations, riskFactors) {
|
|
644
|
+
let confidenceSum = 0;
|
|
645
|
+
let weightSum = 0;
|
|
646
|
+
// Confidence from criteria evaluations
|
|
647
|
+
for (const evaluation of evaluations) {
|
|
648
|
+
const distance = Math.abs(evaluation.value - evaluation.rule.threshold);
|
|
649
|
+
const normalizedDistance = Math.min(1, distance / Math.max(1, evaluation.rule.threshold));
|
|
650
|
+
const criterionConfidence = 0.5 + normalizedDistance * 0.5;
|
|
651
|
+
confidenceSum += criterionConfidence * evaluation.weight;
|
|
652
|
+
weightSum += evaluation.weight;
|
|
653
|
+
}
|
|
654
|
+
let baseConfidence = weightSum > 0 ? confidenceSum / weightSum : 0.5;
|
|
655
|
+
// Reduce confidence for risks
|
|
656
|
+
const criticalRisks = riskFactors.filter((rf) => rf.severity === 'critical').length;
|
|
657
|
+
const highRisks = riskFactors.filter((rf) => rf.severity === 'high').length;
|
|
658
|
+
baseConfidence -= criticalRisks * 0.15;
|
|
659
|
+
baseConfidence -= highRisks * 0.05;
|
|
660
|
+
return Math.max(0.1, Math.min(1.0, baseConfidence));
|
|
661
|
+
}
|
|
662
|
+
// ==================== Utility Functions ====================
|
|
663
|
+
/**
|
|
664
|
+
* Build applied thresholds summary
|
|
665
|
+
*/
|
|
666
|
+
function buildAppliedThresholds(evaluations) {
|
|
667
|
+
const thresholds = {};
|
|
668
|
+
for (const evaluation of evaluations) {
|
|
669
|
+
thresholds[evaluation.name] = evaluation.rule.threshold;
|
|
670
|
+
}
|
|
671
|
+
return thresholds;
|
|
672
|
+
}
|
|
673
|
+
/**
|
|
674
|
+
* Validate parameters
|
|
675
|
+
*/
|
|
676
|
+
function validateParameters(params) {
|
|
677
|
+
if (!params.projectId) {
|
|
678
|
+
throw new Error('projectId is required');
|
|
679
|
+
}
|
|
680
|
+
if (!params.buildId) {
|
|
681
|
+
throw new Error('buildId is required');
|
|
682
|
+
}
|
|
683
|
+
if (!params.environment) {
|
|
684
|
+
throw new Error('environment is required');
|
|
685
|
+
}
|
|
686
|
+
if (!params.metrics) {
|
|
687
|
+
throw new Error('metrics are required');
|
|
688
|
+
}
|
|
689
|
+
}
|
|
690
|
+
/**
|
|
691
|
+
* Generate unique request ID
|
|
692
|
+
*/
|
|
693
|
+
function generateRequestId() {
|
|
694
|
+
return `qg-eval-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
|
|
695
|
+
}
|
|
696
|
+
/**
|
|
697
|
+
* Create success response
|
|
698
|
+
*/
|
|
699
|
+
function createSuccessResponse(data, requestId, executionTime) {
|
|
700
|
+
return {
|
|
701
|
+
success: true,
|
|
702
|
+
data,
|
|
703
|
+
metadata: {
|
|
704
|
+
requestId,
|
|
705
|
+
timestamp: new Date().toISOString(),
|
|
706
|
+
executionTime,
|
|
707
|
+
agent: 'quality-gate-evaluator',
|
|
708
|
+
version: '1.0.0'
|
|
709
|
+
}
|
|
710
|
+
};
|
|
711
|
+
}
|
|
712
|
+
/**
|
|
713
|
+
* Create error response
|
|
714
|
+
*/
|
|
715
|
+
function createErrorResponse(error, requestId, executionTime) {
|
|
716
|
+
return {
|
|
717
|
+
success: false,
|
|
718
|
+
error: {
|
|
719
|
+
code: 'EVALUATION_ERROR',
|
|
720
|
+
message: error.message,
|
|
721
|
+
stack: process.env.NODE_ENV === 'development' ? error.stack : undefined
|
|
722
|
+
},
|
|
723
|
+
metadata: {
|
|
724
|
+
requestId,
|
|
725
|
+
timestamp: new Date().toISOString(),
|
|
726
|
+
executionTime,
|
|
727
|
+
agent: 'quality-gate-evaluator',
|
|
728
|
+
version: '1.0.0'
|
|
729
|
+
}
|
|
730
|
+
};
|
|
731
|
+
}
|
|
732
|
+
//# sourceMappingURL=evaluate-quality-gate.js.map
|