agentic-qe 1.4.4 → 1.5.0
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 +397 -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 +535 -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,671 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Deployment Risk Assessment Tool
|
|
4
|
+
*
|
|
5
|
+
* Comprehensive risk assessment for deployments using multi-factor analysis.
|
|
6
|
+
* Evaluates deployment readiness based on quality metrics, environment context,
|
|
7
|
+
* historical data, and change complexity.
|
|
8
|
+
*
|
|
9
|
+
* @module tools/qe/quality-gates/assess-deployment-risk
|
|
10
|
+
* @version 1.0.0
|
|
11
|
+
* @author Agentic QE Team - Phase 3
|
|
12
|
+
* @date 2025-11-09
|
|
13
|
+
*/
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.assessDeploymentRisk = assessDeploymentRisk;
|
|
16
|
+
// ==================== Main Assessment Function ====================
|
|
17
|
+
/**
|
|
18
|
+
* Assess deployment risk using multi-factor analysis
|
|
19
|
+
*
|
|
20
|
+
* Evaluates:
|
|
21
|
+
* - Quality metrics
|
|
22
|
+
* - Security vulnerabilities
|
|
23
|
+
* - Performance indicators
|
|
24
|
+
* - Infrastructure readiness
|
|
25
|
+
* - Change complexity
|
|
26
|
+
* - Historical patterns
|
|
27
|
+
*
|
|
28
|
+
* @param params - Assessment parameters
|
|
29
|
+
* @returns Comprehensive risk assessment
|
|
30
|
+
*/
|
|
31
|
+
async function assessDeploymentRisk(params) {
|
|
32
|
+
const requestId = generateRequestId();
|
|
33
|
+
const startTime = Date.now();
|
|
34
|
+
try {
|
|
35
|
+
// Validate parameters
|
|
36
|
+
validateParameters(params);
|
|
37
|
+
// Assess individual risk categories
|
|
38
|
+
const qualityRisk = assessQualityRisk(params.metrics);
|
|
39
|
+
const securityRisk = assessSecurityRisk(params.metrics);
|
|
40
|
+
const performanceRisk = assessPerformanceRisk(params.metrics);
|
|
41
|
+
const infrastructureRisk = assessInfrastructureRisk(params.deploymentConfig);
|
|
42
|
+
const changeRisk = assessChangeRisk(params.changes || []);
|
|
43
|
+
const categories = {
|
|
44
|
+
quality: qualityRisk,
|
|
45
|
+
security: securityRisk,
|
|
46
|
+
performance: performanceRisk,
|
|
47
|
+
infrastructure: infrastructureRisk,
|
|
48
|
+
change: changeRisk
|
|
49
|
+
};
|
|
50
|
+
// Identify individual risk factors
|
|
51
|
+
const riskFactors = identifyRiskFactors(params);
|
|
52
|
+
// Calculate overall risk score
|
|
53
|
+
const riskScore = calculateOverallRiskScore(categories);
|
|
54
|
+
// Determine risk level
|
|
55
|
+
const riskLevel = determineRiskLevel(riskScore);
|
|
56
|
+
// Assess readiness
|
|
57
|
+
const readinessIndicators = assessReadiness(params);
|
|
58
|
+
// Generate prediction
|
|
59
|
+
const prediction = generatePrediction(params.metrics, params.historicalDeployments || [], riskScore);
|
|
60
|
+
// Generate mitigation strategies
|
|
61
|
+
const mitigationStrategies = generateMitigationStrategies(riskFactors, categories);
|
|
62
|
+
// Calculate confidence
|
|
63
|
+
const confidence = calculateConfidence(params, riskFactors);
|
|
64
|
+
// Make recommendation
|
|
65
|
+
const recommendation = makeRecommendation(riskLevel, readinessIndicators, params.deploymentConfig);
|
|
66
|
+
const assessment = {
|
|
67
|
+
riskLevel,
|
|
68
|
+
riskScore,
|
|
69
|
+
recommendation,
|
|
70
|
+
riskFactors,
|
|
71
|
+
categories,
|
|
72
|
+
mitigationStrategies,
|
|
73
|
+
readinessIndicators,
|
|
74
|
+
prediction,
|
|
75
|
+
confidence
|
|
76
|
+
};
|
|
77
|
+
return createSuccessResponse(assessment, requestId, Date.now() - startTime);
|
|
78
|
+
}
|
|
79
|
+
catch (error) {
|
|
80
|
+
return createErrorResponse(error, requestId, Date.now() - startTime);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
// ==================== Risk Category Assessments ====================
|
|
84
|
+
/**
|
|
85
|
+
* Assess quality risk
|
|
86
|
+
*/
|
|
87
|
+
function assessQualityRisk(metrics) {
|
|
88
|
+
const factors = [];
|
|
89
|
+
const positive = [];
|
|
90
|
+
const negative = [];
|
|
91
|
+
let score = 0;
|
|
92
|
+
// Coverage analysis
|
|
93
|
+
if (metrics.coverage.overallPercentage >= 80) {
|
|
94
|
+
positive.push(`Strong test coverage: ${metrics.coverage.overallPercentage}%`);
|
|
95
|
+
score += 20;
|
|
96
|
+
}
|
|
97
|
+
else {
|
|
98
|
+
negative.push(`Low test coverage: ${metrics.coverage.overallPercentage}%`);
|
|
99
|
+
factors.push('Insufficient test coverage');
|
|
100
|
+
score += 60;
|
|
101
|
+
}
|
|
102
|
+
// Test results analysis
|
|
103
|
+
const failureRate = metrics.testResults.failureRate;
|
|
104
|
+
if (failureRate <= 0.02) {
|
|
105
|
+
positive.push(`Low test failure rate: ${(failureRate * 100).toFixed(1)}%`);
|
|
106
|
+
score += 10;
|
|
107
|
+
}
|
|
108
|
+
else {
|
|
109
|
+
negative.push(`High test failure rate: ${(failureRate * 100).toFixed(1)}%`);
|
|
110
|
+
factors.push('High test failure rate');
|
|
111
|
+
score += 40;
|
|
112
|
+
}
|
|
113
|
+
// Code quality
|
|
114
|
+
if (metrics.codeQuality.maintainabilityIndex >= 70) {
|
|
115
|
+
positive.push(`Good maintainability: ${metrics.codeQuality.maintainabilityIndex}`);
|
|
116
|
+
score += 10;
|
|
117
|
+
}
|
|
118
|
+
else {
|
|
119
|
+
negative.push(`Low maintainability: ${metrics.codeQuality.maintainabilityIndex}`);
|
|
120
|
+
factors.push('Low code maintainability');
|
|
121
|
+
score += 30;
|
|
122
|
+
}
|
|
123
|
+
const level = score >= 60 ? 'high' : score >= 30 ? 'medium' : 'low';
|
|
124
|
+
return {
|
|
125
|
+
level: level,
|
|
126
|
+
score,
|
|
127
|
+
factors,
|
|
128
|
+
indicators: { positive, negative }
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Assess security risk
|
|
133
|
+
*/
|
|
134
|
+
function assessSecurityRisk(metrics) {
|
|
135
|
+
const factors = [];
|
|
136
|
+
const positive = [];
|
|
137
|
+
const negative = [];
|
|
138
|
+
let score = 0;
|
|
139
|
+
const { critical, high, medium } = metrics.security.summary;
|
|
140
|
+
if (critical > 0) {
|
|
141
|
+
negative.push(`${critical} critical vulnerabilities`);
|
|
142
|
+
factors.push('Critical security vulnerabilities present');
|
|
143
|
+
score += 80;
|
|
144
|
+
}
|
|
145
|
+
if (high > 0) {
|
|
146
|
+
negative.push(`${high} high severity vulnerabilities`);
|
|
147
|
+
factors.push('High severity vulnerabilities present');
|
|
148
|
+
score += 50;
|
|
149
|
+
}
|
|
150
|
+
if (medium > 5) {
|
|
151
|
+
negative.push(`${medium} medium severity vulnerabilities`);
|
|
152
|
+
factors.push('Multiple medium severity vulnerabilities');
|
|
153
|
+
score += 20;
|
|
154
|
+
}
|
|
155
|
+
if (critical === 0 && high === 0) {
|
|
156
|
+
positive.push('No critical or high severity vulnerabilities');
|
|
157
|
+
score = Math.max(0, score - 30);
|
|
158
|
+
}
|
|
159
|
+
const level = score >= 60 ? 'critical' : score >= 40 ? 'high' : score >= 20 ? 'medium' : 'low';
|
|
160
|
+
return {
|
|
161
|
+
level: level,
|
|
162
|
+
score,
|
|
163
|
+
factors,
|
|
164
|
+
indicators: { positive, negative }
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Assess performance risk
|
|
169
|
+
*/
|
|
170
|
+
function assessPerformanceRisk(metrics) {
|
|
171
|
+
const factors = [];
|
|
172
|
+
const positive = [];
|
|
173
|
+
const negative = [];
|
|
174
|
+
let score = 0;
|
|
175
|
+
const { errorRate, responseTime } = metrics.performance;
|
|
176
|
+
if (errorRate > 0.05) {
|
|
177
|
+
negative.push(`High error rate: ${(errorRate * 100).toFixed(1)}%`);
|
|
178
|
+
factors.push('Elevated error rate');
|
|
179
|
+
score += 40;
|
|
180
|
+
}
|
|
181
|
+
else {
|
|
182
|
+
positive.push(`Low error rate: ${(errorRate * 100).toFixed(1)}%`);
|
|
183
|
+
}
|
|
184
|
+
if (responseTime.p99 > 5000) {
|
|
185
|
+
negative.push(`Slow p99 response time: ${responseTime.p99}ms`);
|
|
186
|
+
factors.push('High latency detected');
|
|
187
|
+
score += 30;
|
|
188
|
+
}
|
|
189
|
+
else if (responseTime.p99 < 1000) {
|
|
190
|
+
positive.push(`Fast p99 response time: ${responseTime.p99}ms`);
|
|
191
|
+
}
|
|
192
|
+
const level = score >= 50 ? 'high' : score >= 25 ? 'medium' : 'low';
|
|
193
|
+
return {
|
|
194
|
+
level: level,
|
|
195
|
+
score,
|
|
196
|
+
factors,
|
|
197
|
+
indicators: { positive, negative }
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* Assess infrastructure risk
|
|
202
|
+
*/
|
|
203
|
+
function assessInfrastructureRisk(config) {
|
|
204
|
+
const factors = [];
|
|
205
|
+
const positive = [];
|
|
206
|
+
const negative = [];
|
|
207
|
+
let score = 0;
|
|
208
|
+
if (!config.rollbackEnabled) {
|
|
209
|
+
negative.push('Rollback not enabled');
|
|
210
|
+
factors.push('No rollback capability');
|
|
211
|
+
score += 40;
|
|
212
|
+
}
|
|
213
|
+
else {
|
|
214
|
+
positive.push('Rollback enabled');
|
|
215
|
+
}
|
|
216
|
+
if (!config.healthChecks) {
|
|
217
|
+
negative.push('Health checks not configured');
|
|
218
|
+
factors.push('Missing health checks');
|
|
219
|
+
score += 30;
|
|
220
|
+
}
|
|
221
|
+
else {
|
|
222
|
+
positive.push('Health checks configured');
|
|
223
|
+
}
|
|
224
|
+
if (!config.monitoringEnabled) {
|
|
225
|
+
negative.push('Monitoring not enabled');
|
|
226
|
+
factors.push('Insufficient monitoring');
|
|
227
|
+
score += 25;
|
|
228
|
+
}
|
|
229
|
+
else {
|
|
230
|
+
positive.push('Monitoring enabled');
|
|
231
|
+
}
|
|
232
|
+
if (config.strategy === 'recreate') {
|
|
233
|
+
negative.push('High-risk deployment strategy (recreate)');
|
|
234
|
+
factors.push('Non-rolling deployment strategy');
|
|
235
|
+
score += 20;
|
|
236
|
+
}
|
|
237
|
+
else if (config.strategy === 'canary' || config.strategy === 'blue-green') {
|
|
238
|
+
positive.push(`Safe deployment strategy: ${config.strategy}`);
|
|
239
|
+
score = Math.max(0, score - 15);
|
|
240
|
+
}
|
|
241
|
+
const level = score >= 50 ? 'high' : score >= 25 ? 'medium' : 'low';
|
|
242
|
+
return {
|
|
243
|
+
level: level,
|
|
244
|
+
score,
|
|
245
|
+
factors,
|
|
246
|
+
indicators: { positive, negative }
|
|
247
|
+
};
|
|
248
|
+
}
|
|
249
|
+
/**
|
|
250
|
+
* Assess change risk
|
|
251
|
+
*/
|
|
252
|
+
function assessChangeRisk(changes) {
|
|
253
|
+
const factors = [];
|
|
254
|
+
const positive = [];
|
|
255
|
+
const negative = [];
|
|
256
|
+
let score = 0;
|
|
257
|
+
if (changes.length === 0) {
|
|
258
|
+
positive.push('No code changes');
|
|
259
|
+
return {
|
|
260
|
+
level: 'low',
|
|
261
|
+
score: 0,
|
|
262
|
+
factors: [],
|
|
263
|
+
indicators: { positive, negative }
|
|
264
|
+
};
|
|
265
|
+
}
|
|
266
|
+
const totalLines = changes.reduce((sum, c) => sum + c.linesChanged, 0);
|
|
267
|
+
const avgComplexity = changes.reduce((sum, c) => sum + Math.abs(c.complexityDelta), 0) / changes.length;
|
|
268
|
+
const avgCoverage = changes.reduce((sum, c) => sum + c.coverage, 0) / changes.length;
|
|
269
|
+
if (totalLines > 1000) {
|
|
270
|
+
negative.push(`Large changeset: ${totalLines} lines`);
|
|
271
|
+
factors.push('Large volume of changes');
|
|
272
|
+
score += 40;
|
|
273
|
+
}
|
|
274
|
+
else if (totalLines < 100) {
|
|
275
|
+
positive.push(`Small changeset: ${totalLines} lines`);
|
|
276
|
+
}
|
|
277
|
+
if (avgComplexity > 5) {
|
|
278
|
+
negative.push(`High complexity changes: avg ${avgComplexity.toFixed(1)}`);
|
|
279
|
+
factors.push('High complexity modifications');
|
|
280
|
+
score += 35;
|
|
281
|
+
}
|
|
282
|
+
if (avgCoverage < 0.7) {
|
|
283
|
+
negative.push(`Low test coverage for changes: ${(avgCoverage * 100).toFixed(1)}%`);
|
|
284
|
+
factors.push('Insufficient test coverage for changes');
|
|
285
|
+
score += 30;
|
|
286
|
+
}
|
|
287
|
+
else {
|
|
288
|
+
positive.push(`Good test coverage for changes: ${(avgCoverage * 100).toFixed(1)}%`);
|
|
289
|
+
}
|
|
290
|
+
const level = score >= 60 ? 'high' : score >= 30 ? 'medium' : 'low';
|
|
291
|
+
return {
|
|
292
|
+
level: level,
|
|
293
|
+
score,
|
|
294
|
+
factors,
|
|
295
|
+
indicators: { positive, negative }
|
|
296
|
+
};
|
|
297
|
+
}
|
|
298
|
+
// ==================== Risk Factor Identification ====================
|
|
299
|
+
/**
|
|
300
|
+
* Identify individual risk factors
|
|
301
|
+
*/
|
|
302
|
+
function identifyRiskFactors(params) {
|
|
303
|
+
const factors = [];
|
|
304
|
+
// Quality factors
|
|
305
|
+
if (params.metrics.testResults.failureRate > 0.05) {
|
|
306
|
+
factors.push({
|
|
307
|
+
category: 'quality',
|
|
308
|
+
type: 'test-failures',
|
|
309
|
+
severity: 'high',
|
|
310
|
+
probability: params.metrics.testResults.failureRate,
|
|
311
|
+
impact: 8,
|
|
312
|
+
description: 'High test failure rate indicates potential quality issues',
|
|
313
|
+
evidence: [
|
|
314
|
+
`${params.metrics.testResults.failed} of ${params.metrics.testResults.total} tests failing`,
|
|
315
|
+
`Failure rate: ${(params.metrics.testResults.failureRate * 100).toFixed(1)}%`
|
|
316
|
+
]
|
|
317
|
+
});
|
|
318
|
+
}
|
|
319
|
+
// Security factors
|
|
320
|
+
if (params.metrics.security.summary.critical > 0) {
|
|
321
|
+
factors.push({
|
|
322
|
+
category: 'security',
|
|
323
|
+
type: 'critical-vulnerabilities',
|
|
324
|
+
severity: 'critical',
|
|
325
|
+
probability: 0.9,
|
|
326
|
+
impact: 10,
|
|
327
|
+
description: 'Critical security vulnerabilities present',
|
|
328
|
+
evidence: [
|
|
329
|
+
`${params.metrics.security.summary.critical} critical vulnerabilities`,
|
|
330
|
+
'Immediate security risk to production environment'
|
|
331
|
+
]
|
|
332
|
+
});
|
|
333
|
+
}
|
|
334
|
+
// Performance factors
|
|
335
|
+
if (params.metrics.performance.errorRate > 0.05) {
|
|
336
|
+
factors.push({
|
|
337
|
+
category: 'performance',
|
|
338
|
+
type: 'error-rate',
|
|
339
|
+
severity: 'medium',
|
|
340
|
+
probability: 0.6,
|
|
341
|
+
impact: 7,
|
|
342
|
+
description: 'Elevated error rate may impact user experience',
|
|
343
|
+
evidence: [
|
|
344
|
+
`Error rate: ${(params.metrics.performance.errorRate * 100).toFixed(1)}%`,
|
|
345
|
+
'Potential stability issues'
|
|
346
|
+
]
|
|
347
|
+
});
|
|
348
|
+
}
|
|
349
|
+
// Infrastructure factors
|
|
350
|
+
if (!params.deploymentConfig.rollbackEnabled) {
|
|
351
|
+
factors.push({
|
|
352
|
+
category: 'infrastructure',
|
|
353
|
+
type: 'no-rollback',
|
|
354
|
+
severity: 'high',
|
|
355
|
+
probability: 0.3,
|
|
356
|
+
impact: 9,
|
|
357
|
+
description: 'No rollback capability increases deployment risk',
|
|
358
|
+
evidence: ['Rollback not configured', 'Manual intervention required for failures']
|
|
359
|
+
});
|
|
360
|
+
}
|
|
361
|
+
// Change factors
|
|
362
|
+
const changes = params.changes || [];
|
|
363
|
+
const highComplexityChanges = changes.filter((c) => Math.abs(c.complexityDelta) > 5);
|
|
364
|
+
if (highComplexityChanges.length > 0) {
|
|
365
|
+
factors.push({
|
|
366
|
+
category: 'change',
|
|
367
|
+
type: 'high-complexity',
|
|
368
|
+
severity: 'medium',
|
|
369
|
+
probability: 0.5,
|
|
370
|
+
impact: 6,
|
|
371
|
+
description: 'High complexity changes increase defect probability',
|
|
372
|
+
evidence: [
|
|
373
|
+
`${highComplexityChanges.length} high-complexity changes`,
|
|
374
|
+
`Files affected: ${highComplexityChanges.map((c) => c.file).join(', ')}`
|
|
375
|
+
]
|
|
376
|
+
});
|
|
377
|
+
}
|
|
378
|
+
return factors;
|
|
379
|
+
}
|
|
380
|
+
// ==================== Risk Calculation ====================
|
|
381
|
+
/**
|
|
382
|
+
* Calculate overall risk score
|
|
383
|
+
*/
|
|
384
|
+
function calculateOverallRiskScore(categories) {
|
|
385
|
+
const weights = {
|
|
386
|
+
quality: 0.25,
|
|
387
|
+
security: 0.30,
|
|
388
|
+
performance: 0.15,
|
|
389
|
+
infrastructure: 0.15,
|
|
390
|
+
change: 0.15
|
|
391
|
+
};
|
|
392
|
+
const weightedScore = categories.quality.score * weights.quality +
|
|
393
|
+
categories.security.score * weights.security +
|
|
394
|
+
categories.performance.score * weights.performance +
|
|
395
|
+
categories.infrastructure.score * weights.infrastructure +
|
|
396
|
+
categories.change.score * weights.change;
|
|
397
|
+
return Math.round(weightedScore * 100) / 100;
|
|
398
|
+
}
|
|
399
|
+
/**
|
|
400
|
+
* Determine risk level from score
|
|
401
|
+
*/
|
|
402
|
+
function determineRiskLevel(score) {
|
|
403
|
+
if (score >= 70)
|
|
404
|
+
return 'critical';
|
|
405
|
+
if (score >= 50)
|
|
406
|
+
return 'high';
|
|
407
|
+
if (score >= 30)
|
|
408
|
+
return 'medium';
|
|
409
|
+
return 'low';
|
|
410
|
+
}
|
|
411
|
+
// ==================== Readiness Assessment ====================
|
|
412
|
+
/**
|
|
413
|
+
* Assess deployment readiness
|
|
414
|
+
*/
|
|
415
|
+
function assessReadiness(params) {
|
|
416
|
+
const indicators = {
|
|
417
|
+
qualityMetrics: params.metrics.coverage.overallPercentage >= 70,
|
|
418
|
+
testCoverage: params.metrics.coverage.overallPercentage >= 80,
|
|
419
|
+
securityScan: params.metrics.security.summary.critical === 0,
|
|
420
|
+
performanceBaseline: params.metrics.performance.errorRate <= 0.05,
|
|
421
|
+
rollbackPlan: params.deploymentConfig.rollbackEnabled,
|
|
422
|
+
monitoring: params.deploymentConfig.monitoringEnabled,
|
|
423
|
+
documentation: true // Assume true for now
|
|
424
|
+
};
|
|
425
|
+
const missing = [];
|
|
426
|
+
const indicatorCount = Object.keys(indicators).length;
|
|
427
|
+
let readyCount = 0;
|
|
428
|
+
for (const [key, value] of Object.entries(indicators)) {
|
|
429
|
+
if (value) {
|
|
430
|
+
readyCount++;
|
|
431
|
+
}
|
|
432
|
+
else {
|
|
433
|
+
missing.push(key.replace(/([A-Z])/g, ' $1').toLowerCase());
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
const overall = Math.round((readyCount / indicatorCount) * 100);
|
|
437
|
+
return {
|
|
438
|
+
overall,
|
|
439
|
+
indicators,
|
|
440
|
+
missing
|
|
441
|
+
};
|
|
442
|
+
}
|
|
443
|
+
// ==================== Prediction Analysis ====================
|
|
444
|
+
/**
|
|
445
|
+
* Generate deployment prediction
|
|
446
|
+
*/
|
|
447
|
+
function generatePrediction(metrics, historical, riskScore) {
|
|
448
|
+
const recentDeployments = historical.slice(0, 10);
|
|
449
|
+
const successCount = recentDeployments.filter((d) => d.success).length;
|
|
450
|
+
const rollbackCount = recentDeployments.filter((d) => d.rolledBack).length;
|
|
451
|
+
// Base success probability on historical data
|
|
452
|
+
let successProbability = historical.length > 0 ? successCount / recentDeployments.length : 0.7;
|
|
453
|
+
// Adjust based on current risk score
|
|
454
|
+
successProbability *= 1 - riskScore / 200;
|
|
455
|
+
// Predict incidents based on risk and historical data
|
|
456
|
+
const avgIncidents = historical.length > 0
|
|
457
|
+
? recentDeployments.reduce((sum, d) => sum + d.incidents, 0) / recentDeployments.length
|
|
458
|
+
: 0;
|
|
459
|
+
const predictedIncidents = Math.max(0, Math.round(avgIncidents * (riskScore / 50)));
|
|
460
|
+
// Predict rollback probability
|
|
461
|
+
const historicalRollbackRate = historical.length > 0 ? rollbackCount / recentDeployments.length : 0.05;
|
|
462
|
+
const rollbackProbability = Math.min(0.9, historicalRollbackRate + riskScore / 200);
|
|
463
|
+
// Confidence based on historical data availability
|
|
464
|
+
const confidence = Math.min(0.9, 0.5 + (historical.length / 20) * 0.4);
|
|
465
|
+
return {
|
|
466
|
+
successProbability: Math.max(0.1, Math.min(0.99, successProbability)),
|
|
467
|
+
predictedIncidents,
|
|
468
|
+
rollbackProbability: Math.max(0.01, rollbackProbability),
|
|
469
|
+
confidence,
|
|
470
|
+
basedOn: {
|
|
471
|
+
deploymentCount: historical.length,
|
|
472
|
+
timeRange: historical.length > 0 ? `Last ${recentDeployments.length} deployments` : 'N/A'
|
|
473
|
+
}
|
|
474
|
+
};
|
|
475
|
+
}
|
|
476
|
+
// ==================== Mitigation Strategies ====================
|
|
477
|
+
/**
|
|
478
|
+
* Generate mitigation strategies
|
|
479
|
+
*/
|
|
480
|
+
function generateMitigationStrategies(riskFactors, categories) {
|
|
481
|
+
const strategies = [];
|
|
482
|
+
// Critical and high severity risks
|
|
483
|
+
const criticalRisks = riskFactors.filter((rf) => rf.severity === 'critical' || rf.severity === 'high');
|
|
484
|
+
for (const risk of criticalRisks) {
|
|
485
|
+
if (risk.type === 'critical-vulnerabilities') {
|
|
486
|
+
strategies.push({
|
|
487
|
+
riskType: risk.type,
|
|
488
|
+
strategy: 'Address critical security vulnerabilities before deployment',
|
|
489
|
+
steps: [
|
|
490
|
+
'Run comprehensive security scan',
|
|
491
|
+
'Patch all critical vulnerabilities',
|
|
492
|
+
'Re-scan to verify fixes',
|
|
493
|
+
'Update security dependencies'
|
|
494
|
+
],
|
|
495
|
+
expectedImpact: 'Eliminates critical security risk',
|
|
496
|
+
effort: 'high',
|
|
497
|
+
priority: 'critical'
|
|
498
|
+
});
|
|
499
|
+
}
|
|
500
|
+
else if (risk.type === 'test-failures') {
|
|
501
|
+
strategies.push({
|
|
502
|
+
riskType: risk.type,
|
|
503
|
+
strategy: 'Fix failing tests to ensure quality',
|
|
504
|
+
steps: [
|
|
505
|
+
'Investigate root cause of test failures',
|
|
506
|
+
'Fix failing tests',
|
|
507
|
+
'Run full test suite',
|
|
508
|
+
'Verify test stability'
|
|
509
|
+
],
|
|
510
|
+
expectedImpact: 'Improves quality confidence',
|
|
511
|
+
effort: 'medium',
|
|
512
|
+
priority: 'high'
|
|
513
|
+
});
|
|
514
|
+
}
|
|
515
|
+
else if (risk.type === 'no-rollback') {
|
|
516
|
+
strategies.push({
|
|
517
|
+
riskType: risk.type,
|
|
518
|
+
strategy: 'Enable rollback capability',
|
|
519
|
+
steps: [
|
|
520
|
+
'Configure deployment rollback',
|
|
521
|
+
'Test rollback procedure',
|
|
522
|
+
'Document rollback process',
|
|
523
|
+
'Train team on rollback'
|
|
524
|
+
],
|
|
525
|
+
expectedImpact: 'Reduces deployment risk',
|
|
526
|
+
effort: 'medium',
|
|
527
|
+
priority: 'high'
|
|
528
|
+
});
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
// Category-specific strategies
|
|
532
|
+
if (categories.quality.level === 'high') {
|
|
533
|
+
strategies.push({
|
|
534
|
+
riskType: 'quality-risk',
|
|
535
|
+
strategy: 'Improve overall quality metrics',
|
|
536
|
+
steps: [
|
|
537
|
+
'Increase test coverage to 80%+',
|
|
538
|
+
'Fix failing tests',
|
|
539
|
+
'Address code quality issues',
|
|
540
|
+
'Run quality gate validation'
|
|
541
|
+
],
|
|
542
|
+
expectedImpact: 'Reduces quality-related deployment failures',
|
|
543
|
+
effort: 'high',
|
|
544
|
+
priority: 'medium'
|
|
545
|
+
});
|
|
546
|
+
}
|
|
547
|
+
if (categories.performance.level === 'high') {
|
|
548
|
+
strategies.push({
|
|
549
|
+
riskType: 'performance-risk',
|
|
550
|
+
strategy: 'Optimize performance before deployment',
|
|
551
|
+
steps: [
|
|
552
|
+
'Profile application performance',
|
|
553
|
+
'Optimize slow endpoints',
|
|
554
|
+
'Run load testing',
|
|
555
|
+
'Establish performance baselines'
|
|
556
|
+
],
|
|
557
|
+
expectedImpact: 'Prevents performance degradation',
|
|
558
|
+
effort: 'medium',
|
|
559
|
+
priority: 'medium'
|
|
560
|
+
});
|
|
561
|
+
}
|
|
562
|
+
return strategies;
|
|
563
|
+
}
|
|
564
|
+
// ==================== Recommendations ====================
|
|
565
|
+
/**
|
|
566
|
+
* Make deployment recommendation
|
|
567
|
+
*/
|
|
568
|
+
function makeRecommendation(riskLevel, readiness, config) {
|
|
569
|
+
// Block for critical risk
|
|
570
|
+
if (riskLevel === 'critical') {
|
|
571
|
+
return 'block';
|
|
572
|
+
}
|
|
573
|
+
// Block for critical deployments with high risk
|
|
574
|
+
if (config.criticality === 'critical' && riskLevel === 'high') {
|
|
575
|
+
return 'block';
|
|
576
|
+
}
|
|
577
|
+
// Delay for high risk with low readiness
|
|
578
|
+
if (riskLevel === 'high' && readiness.overall < 70) {
|
|
579
|
+
return 'delay';
|
|
580
|
+
}
|
|
581
|
+
// Proceed with caution for medium-high risk
|
|
582
|
+
if (riskLevel === 'high' || riskLevel === 'medium') {
|
|
583
|
+
return 'proceed-with-caution';
|
|
584
|
+
}
|
|
585
|
+
// Proceed for low risk with good readiness
|
|
586
|
+
if (riskLevel === 'low' && readiness.overall >= 80) {
|
|
587
|
+
return 'proceed';
|
|
588
|
+
}
|
|
589
|
+
return 'proceed-with-caution';
|
|
590
|
+
}
|
|
591
|
+
// ==================== Confidence Calculation ====================
|
|
592
|
+
/**
|
|
593
|
+
* Calculate assessment confidence
|
|
594
|
+
*/
|
|
595
|
+
function calculateConfidence(params, riskFactors) {
|
|
596
|
+
let confidence = 0.7; // Base confidence
|
|
597
|
+
// Increase confidence with historical data
|
|
598
|
+
if (params.historicalDeployments && params.historicalDeployments.length > 10) {
|
|
599
|
+
confidence += 0.2;
|
|
600
|
+
}
|
|
601
|
+
else if (params.historicalDeployments && params.historicalDeployments.length > 5) {
|
|
602
|
+
confidence += 0.1;
|
|
603
|
+
}
|
|
604
|
+
// Increase confidence with change data
|
|
605
|
+
if (params.changes && params.changes.length > 0) {
|
|
606
|
+
confidence += 0.1;
|
|
607
|
+
}
|
|
608
|
+
// Decrease confidence with many uncertain factors
|
|
609
|
+
const uncertainRisks = riskFactors.filter((rf) => rf.probability < 0.5);
|
|
610
|
+
confidence -= uncertainRisks.length * 0.05;
|
|
611
|
+
return Math.max(0.3, Math.min(0.95, confidence));
|
|
612
|
+
}
|
|
613
|
+
// ==================== Utility Functions ====================
|
|
614
|
+
/**
|
|
615
|
+
* Validate parameters
|
|
616
|
+
*/
|
|
617
|
+
function validateParameters(params) {
|
|
618
|
+
if (!params.projectId)
|
|
619
|
+
throw new Error('projectId is required');
|
|
620
|
+
if (!params.deploymentId)
|
|
621
|
+
throw new Error('deploymentId is required');
|
|
622
|
+
if (!params.environment)
|
|
623
|
+
throw new Error('environment is required');
|
|
624
|
+
if (!params.metrics)
|
|
625
|
+
throw new Error('metrics are required');
|
|
626
|
+
if (!params.deploymentConfig)
|
|
627
|
+
throw new Error('deploymentConfig is required');
|
|
628
|
+
}
|
|
629
|
+
/**
|
|
630
|
+
* Generate unique request ID
|
|
631
|
+
*/
|
|
632
|
+
function generateRequestId() {
|
|
633
|
+
return `risk-assess-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
|
|
634
|
+
}
|
|
635
|
+
/**
|
|
636
|
+
* Create success response
|
|
637
|
+
*/
|
|
638
|
+
function createSuccessResponse(data, requestId, executionTime) {
|
|
639
|
+
return {
|
|
640
|
+
success: true,
|
|
641
|
+
data,
|
|
642
|
+
metadata: {
|
|
643
|
+
requestId,
|
|
644
|
+
timestamp: new Date().toISOString(),
|
|
645
|
+
executionTime,
|
|
646
|
+
agent: 'deployment-risk-assessor',
|
|
647
|
+
version: '1.0.0'
|
|
648
|
+
}
|
|
649
|
+
};
|
|
650
|
+
}
|
|
651
|
+
/**
|
|
652
|
+
* Create error response
|
|
653
|
+
*/
|
|
654
|
+
function createErrorResponse(error, requestId, executionTime) {
|
|
655
|
+
return {
|
|
656
|
+
success: false,
|
|
657
|
+
error: {
|
|
658
|
+
code: 'RISK_ASSESSMENT_ERROR',
|
|
659
|
+
message: error.message,
|
|
660
|
+
stack: process.env.NODE_ENV === 'development' ? error.stack : undefined
|
|
661
|
+
},
|
|
662
|
+
metadata: {
|
|
663
|
+
requestId,
|
|
664
|
+
timestamp: new Date().toISOString(),
|
|
665
|
+
executionTime,
|
|
666
|
+
agent: 'deployment-risk-assessor',
|
|
667
|
+
version: '1.0.0'
|
|
668
|
+
}
|
|
669
|
+
};
|
|
670
|
+
}
|
|
671
|
+
//# sourceMappingURL=assess-deployment-risk.js.map
|