claude-flow-novice 1.3.5 → 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/analysis/code-analyzer.md +3 -20
- package/.claude/agents/analysis/code-review/analyze-code-quality.md +1 -1
- package/.claude/agents/analyst.md +300 -0
- package/.claude/agents/architect.md +557 -0
- package/.claude/agents/architecture/system-architect.md +630 -0
- package/.claude/agents/architecture/system-design/arch-system-design.md +1 -1
- package/.claude/agents/base-template-generator.md +24 -1
- package/.claude/agents/coder.md +180 -0
- package/.claude/agents/consensus/byzantine-coordinator.md +4 -21
- package/.claude/agents/consensus/consensus-builder.md +3 -20
- package/.claude/agents/consensus/crdt-synchronizer.md +4 -21
- package/.claude/agents/consensus/gossip-coordinator.md +4 -21
- package/.claude/agents/consensus/performance-benchmarker.md +4 -21
- package/.claude/agents/consensus/quorum-manager.md +4 -21
- package/.claude/agents/consensus/raft-manager.md +4 -21
- package/.claude/agents/consensus/security-manager.md +4 -21
- package/.claude/agents/coordinator.md +842 -0
- package/.claude/agents/data/ml/data-ml-model.md +2 -2
- package/.claude/agents/development/backend/dev-backend-api.md +2 -2
- package/.claude/agents/devops/ci-cd/ops-cicd-github.md +2 -2
- package/.claude/agents/devops/devops-engineer.md +638 -0
- package/.claude/agents/documentation/api-docs/docs-api-openapi.md +2 -2
- package/.claude/agents/github/code-review-swarm.md +1 -1
- package/.claude/agents/github/github-specialist.md +856 -0
- package/.claude/agents/github/pr-manager.md +1 -1
- package/.claude/agents/github/release-manager.md +1 -1
- package/.claude/agents/neural/neural-pattern-agent.md +762 -0
- package/.claude/agents/optimization/benchmark-suite.md +1 -1
- package/.claude/agents/optimization/perf-analyzer.md +725 -0
- package/.claude/agents/optimization/performance-monitor.md +1 -1
- package/.claude/agents/planner.md +135 -0
- package/.claude/agents/researcher.md +185 -0
- package/.claude/agents/reviewer.md +291 -0
- package/.claude/agents/security/security-specialist.md +978 -0
- package/.claude/agents/sparc/architecture.md +1 -1
- package/.claude/agents/sparc/pseudocode.md +1 -1
- package/.claude/agents/sparc/refinement.md +1 -1
- package/.claude/agents/sparc/specification.md +1 -1
- package/.claude/agents/specialized/mobile/spec-mobile-react-native.md +2 -2
- package/.claude/agents/swarm/adaptive-coordinator-enhanced.md +746 -0
- package/.claude/agents/tester.md +663 -0
- package/.claude/agents/testing/unit/tdd-london-swarm.md +1 -1
- package/.claude/agents/testing/validation/production-validator.md +1 -1
- package/.claude/commands/claude-soul.js +1 -1
- package/.claude/hooks.json +12 -15
- package/{.claude → .claude-flow-novice/.claude}/agents/MIGRATION_SUMMARY.md +1 -1
- package/.claude-flow-novice/.claude/agents/analysis/code-analyzer.md +192 -0
- package/.claude-flow-novice/.claude/agents/analysis/code-review/analyze-code-quality.md +180 -0
- package/.claude-flow-novice/.claude/agents/analyst.md +300 -0
- package/.claude-flow-novice/.claude/agents/architect.md +557 -0
- package/.claude-flow-novice/.claude/agents/architecture/system-architect.md +630 -0
- package/.claude-flow-novice/.claude/agents/architecture/system-design/arch-system-design.md +156 -0
- package/.claude-flow-novice/.claude/agents/backend-dev.json +42 -0
- package/.claude-flow-novice/.claude/agents/base-template-generator.md +65 -0
- package/.claude-flow-novice/.claude/agents/code-analyzer.json +39 -0
- package/.claude-flow-novice/.claude/agents/coder.json +42 -0
- package/.claude-flow-novice/.claude/agents/coder.md +180 -0
- package/.claude-flow-novice/.claude/agents/consensus/byzantine-coordinator.md +46 -0
- package/.claude-flow-novice/.claude/agents/consensus/consensus-builder.md +225 -0
- package/.claude-flow-novice/.claude/agents/consensus/crdt-synchronizer.md +980 -0
- package/.claude-flow-novice/.claude/agents/consensus/gossip-coordinator.md +46 -0
- package/.claude-flow-novice/.claude/agents/consensus/performance-benchmarker.md +834 -0
- package/.claude-flow-novice/.claude/agents/consensus/quorum-manager.md +806 -0
- package/.claude-flow-novice/.claude/agents/consensus/raft-manager.md +46 -0
- package/.claude-flow-novice/.claude/agents/consensus/security-manager.md +605 -0
- package/.claude-flow-novice/.claude/agents/coordinator.md +842 -0
- package/.claude-flow-novice/.claude/agents/data/ml/data-ml-model.md +193 -0
- package/.claude-flow-novice/.claude/agents/development/backend/dev-backend-api.md +142 -0
- package/.claude-flow-novice/.claude/agents/devops/ci-cd/ops-cicd-github.md +164 -0
- package/.claude-flow-novice/.claude/agents/devops/devops-engineer.md +638 -0
- package/.claude-flow-novice/.claude/agents/documentation/api-docs/docs-api-openapi.md +174 -0
- package/.claude-flow-novice/.claude/agents/github/code-review-swarm.md +538 -0
- package/.claude-flow-novice/.claude/agents/github/github-modes.md +173 -0
- package/.claude-flow-novice/.claude/agents/github/github-specialist.md +856 -0
- package/.claude-flow-novice/.claude/agents/github/issue-tracker.md +319 -0
- package/.claude-flow-novice/.claude/agents/github/multi-repo-swarm.md +553 -0
- package/.claude-flow-novice/.claude/agents/github/pr-manager.md +191 -0
- package/.claude-flow-novice/.claude/agents/github/project-board-sync.md +509 -0
- package/.claude-flow-novice/.claude/agents/github/release-manager.md +367 -0
- package/.claude-flow-novice/.claude/agents/github/release-swarm.md +583 -0
- package/.claude-flow-novice/.claude/agents/github/repo-architect.md +398 -0
- package/.claude-flow-novice/.claude/agents/github/swarm-issue.md +573 -0
- package/.claude-flow-novice/.claude/agents/github/swarm-pr.md +428 -0
- package/.claude-flow-novice/.claude/agents/github/sync-coordinator.md +452 -0
- package/.claude-flow-novice/.claude/agents/github/workflow-automation.md +635 -0
- package/.claude-flow-novice/.claude/agents/goal/goal-planner.md +73 -0
- package/.claude-flow-novice/.claude/agents/neural/neural-pattern-agent.md +762 -0
- package/.claude-flow-novice/.claude/agents/neural/safla-neural.md +74 -0
- package/.claude-flow-novice/.claude/agents/optimization/benchmark-suite.md +665 -0
- package/.claude-flow-novice/.claude/agents/optimization/load-balancer.md +431 -0
- package/.claude-flow-novice/.claude/agents/optimization/perf-analyzer.md +725 -0
- package/.claude-flow-novice/.claude/agents/optimization/performance-monitor.md +672 -0
- package/.claude-flow-novice/.claude/agents/optimization/resource-allocator.md +674 -0
- package/.claude-flow-novice/.claude/agents/optimization/topology-optimizer.md +808 -0
- package/.claude-flow-novice/.claude/agents/planner.json +41 -0
- package/.claude-flow-novice/.claude/agents/planner.md +135 -0
- package/.claude-flow-novice/.claude/agents/researcher.json +41 -0
- package/.claude-flow-novice/.claude/agents/researcher.md +185 -0
- package/.claude-flow-novice/.claude/agents/reviewer.json +39 -0
- package/.claude-flow-novice/.claude/agents/reviewer.md +291 -0
- package/.claude-flow-novice/.claude/agents/security/security-specialist.md +978 -0
- package/.claude-flow-novice/.claude/agents/sparc/architecture.md +472 -0
- package/.claude-flow-novice/.claude/agents/sparc/pseudocode.md +318 -0
- package/.claude-flow-novice/.claude/agents/sparc/refinement.md +525 -0
- package/.claude-flow-novice/.claude/agents/sparc/specification.md +276 -0
- package/.claude-flow-novice/.claude/agents/specialized/mobile/spec-mobile-react-native.md +226 -0
- package/.claude-flow-novice/.claude/agents/sublinear/consciousness-evolution-agent.md +499 -0
- package/.claude-flow-novice/.claude/agents/sublinear/matrix-solver-agent.md +113 -0
- package/.claude-flow-novice/.claude/agents/sublinear/nanosecond-scheduler-agent.md +644 -0
- package/.claude-flow-novice/.claude/agents/sublinear/pagerank-agent.md +699 -0
- package/.claude-flow-novice/.claude/agents/sublinear/phi-calculator-agent.md +749 -0
- package/.claude-flow-novice/.claude/agents/sublinear/psycho-symbolic-agent.md +543 -0
- package/.claude-flow-novice/.claude/agents/sublinear/sublinear.md +816 -0
- package/.claude-flow-novice/.claude/agents/sublinear/temporal-advantage-agent.md +360 -0
- package/.claude-flow-novice/.claude/agents/swarm/adaptive-coordinator-enhanced.md +746 -0
- package/.claude-flow-novice/.claude/agents/swarm/adaptive-coordinator.md +396 -0
- package/.claude-flow-novice/.claude/agents/swarm/hierarchical-coordinator.md +300 -0
- package/.claude-flow-novice/.claude/agents/swarm/mesh-coordinator.md +435 -0
- package/.claude-flow-novice/.claude/agents/system-architect.json +40 -0
- package/.claude-flow-novice/.claude/agents/templates/automation-smart-agent.md +205 -0
- package/.claude-flow-novice/.claude/agents/templates/coordinator-swarm-init.md +90 -0
- package/.claude-flow-novice/.claude/agents/templates/github-pr-manager.md +177 -0
- package/.claude-flow-novice/.claude/agents/templates/implementer-sparc-coder.md +259 -0
- package/.claude-flow-novice/.claude/agents/templates/memory-coordinator.md +187 -0
- package/.claude-flow-novice/.claude/agents/templates/migration-plan.md +746 -0
- package/.claude-flow-novice/.claude/agents/templates/orchestrator-task.md +139 -0
- package/.claude-flow-novice/.claude/agents/templates/performance-analyzer.md +199 -0
- package/.claude-flow-novice/.claude/agents/templates/sparc-coordinator.md +183 -0
- package/.claude-flow-novice/.claude/agents/tester.json +40 -0
- package/.claude-flow-novice/.claude/agents/tester.md +663 -0
- package/.claude-flow-novice/.claude/agents/testing/e2e/playwright-agent.md +249 -0
- package/.claude-flow-novice/.claude/agents/testing/unit/tdd-london-swarm.md +244 -0
- package/.claude-flow-novice/.claude/agents/testing/validation/production-validator.md +395 -0
- package/.claude-flow-novice/dist/index.js +12 -24
- package/.claude-flow-novice/dist/index.js.map +1 -0
- package/.claude-flow-novice/dist/src/agents/agent-manager.js +123 -69
- package/.claude-flow-novice/dist/src/agents/agent-manager.js.map +1 -1
- package/.claude-flow-novice/dist/src/agents/github/utils/hook-integration.js +7 -7
- package/.claude-flow-novice/dist/src/agents/github/utils/hook-integration.js.map +1 -1
- package/.claude-flow-novice/dist/src/agents/stage3-integration-validator.js +485 -0
- package/.claude-flow-novice/dist/src/agents/stage3-integration-validator.js.map +1 -0
- package/.claude-flow-novice/dist/src/agents/unified-ultra-fast-agent-manager.js +630 -0
- package/.claude-flow-novice/dist/src/agents/unified-ultra-fast-agent-manager.js.map +1 -0
- package/.claude-flow-novice/dist/src/cli/commands/agent.js +1 -1
- package/.claude-flow-novice/dist/src/cli/commands/agent.js.map +1 -1
- package/.claude-flow-novice/dist/src/cli/commands/config-integration.js +6 -6
- package/.claude-flow-novice/dist/src/cli/commands/enterprise.js +18 -18
- package/.claude-flow-novice/dist/src/cli/commands/enterprise.js.map +1 -1
- package/.claude-flow-novice/dist/src/cli/commands/goal-init.js +4 -4
- package/.claude-flow-novice/dist/src/cli/commands/help-new.js +23 -23
- package/.claude-flow-novice/dist/src/cli/commands/help-new.js.map +1 -1
- package/.claude-flow-novice/dist/src/cli/commands/help.js +74 -74
- package/.claude-flow-novice/dist/src/cli/commands/help.js.map +1 -1
- package/.claude-flow-novice/dist/src/cli/commands/hive-mind/pause.js +2 -2
- package/.claude-flow-novice/dist/src/cli/commands/hive-mind/pause.js.map +1 -1
- package/.claude-flow-novice/dist/src/cli/commands/hive.js +4 -4
- package/.claude-flow-novice/dist/src/cli/commands/index.js +103 -132
- package/.claude-flow-novice/dist/src/cli/commands/index.js.map +1 -1
- package/.claude-flow-novice/dist/src/cli/commands/mcp.js +1 -1
- package/.claude-flow-novice/dist/src/cli/commands/migrate.js +4 -4
- package/.claude-flow-novice/dist/src/cli/commands/migrate.js.map +1 -1
- package/.claude-flow-novice/dist/src/cli/commands/monitor.js +1 -1
- package/.claude-flow-novice/dist/src/cli/commands/neural-init.js +4 -4
- package/.claude-flow-novice/dist/src/cli/commands/ruv-swarm.js +8 -8
- package/.claude-flow-novice/dist/src/cli/commands/sparc.js +12 -12
- package/.claude-flow-novice/dist/src/cli/commands/sparc.js.map +1 -1
- package/.claude-flow-novice/dist/src/cli/commands/start/start-command.js +3 -3
- package/.claude-flow-novice/dist/src/cli/commands/status.js +1 -1
- package/.claude-flow-novice/dist/src/cli/commands/swarm.js +7 -7
- package/.claude-flow-novice/dist/src/cli/commands/swarm.js.map +1 -1
- package/.claude-flow-novice/dist/src/cli/commands/verification.js +18 -18
- package/.claude-flow-novice/dist/src/cli/completion.js +54 -54
- package/.claude-flow-novice/dist/src/cli/completion.js.map +1 -1
- package/.claude-flow-novice/dist/src/cli/consolidated/ConsolidatedCLI.js +11 -11
- package/.claude-flow-novice/dist/src/cli/consolidated/ConsolidatedCLI.js.map +1 -1
- package/.claude-flow-novice/dist/src/cli/consolidated/core/CommandHandlers.js +31 -31
- package/.claude-flow-novice/dist/src/cli/consolidated/core/TierManager.js +39 -39
- package/.claude-flow-novice/dist/src/cli/consolidated/core/TierManager.js.map +1 -1
- package/.claude-flow-novice/dist/src/cli/consolidated/help/InteractiveHelp.js +25 -25
- package/.claude-flow-novice/dist/src/cli/consolidated/help/InteractiveHelp.js.map +1 -1
- package/.claude-flow-novice/dist/src/cli/consolidated/routing/CommandRouter.js +8 -8
- package/.claude-flow-novice/dist/src/cli/consolidated/routing/CommandRouter.js.map +1 -1
- package/.claude-flow-novice/dist/src/cli/consolidated/utils/IntelligentDefaults.js +6 -6
- package/.claude-flow-novice/dist/src/cli/consolidated/utils/IntelligentDefaults.js.map +1 -1
- package/.claude-flow-novice/dist/src/cli/consolidated/utils/PerformanceOptimizer.js +7 -7
- package/.claude-flow-novice/dist/src/cli/consolidated/utils/PerformanceOptimizer.js.map +1 -1
- package/.claude-flow-novice/dist/src/cli/index-remote.js +10 -10
- package/.claude-flow-novice/dist/src/cli/index.js +1 -1
- package/.claude-flow-novice/dist/src/cli/init/directory-structure.js +8 -8
- package/.claude-flow-novice/dist/src/cli/init/index.js +3 -3
- package/.claude-flow-novice/dist/src/cli/init/sparc-environment.js +67 -67
- package/.claude-flow-novice/dist/src/cli/init/swarm-commands.js +18 -18
- package/.claude-flow-novice/dist/src/cli/node-repl.js +2 -2
- package/.claude-flow-novice/dist/src/cli/repl.js +1 -1
- package/.claude-flow-novice/dist/src/cli/simple-cli.js +68 -68
- package/.claude-flow-novice/dist/src/cli/simple-cli.js.map +1 -1
- package/.claude-flow-novice/dist/src/cli/simple-commands/session-start-soul.js +271 -0
- package/.claude-flow-novice/dist/src/cli/simple-orchestrator.js +7 -7
- package/.claude-flow-novice/dist/src/cli/simple-orchestrator.js.map +1 -1
- package/.claude-flow-novice/dist/src/cli/ui/fallback-handler.js +7 -7
- package/.claude-flow-novice/dist/src/communication/enhanced-event-bus.js +816 -0
- package/.claude-flow-novice/dist/src/communication/enhanced-event-bus.js.map +1 -0
- package/.claude-flow-novice/dist/src/communication/failure-recovery-system.js +812 -0
- package/.claude-flow-novice/dist/src/communication/failure-recovery-system.js.map +1 -0
- package/.claude-flow-novice/dist/src/communication/optimized-serialization.js +369 -0
- package/.claude-flow-novice/dist/src/communication/optimized-serialization.js.map +1 -0
- package/.claude-flow-novice/dist/src/communication/performance-optimizations.js +526 -0
- package/.claude-flow-novice/dist/src/communication/performance-optimizations.js.map +1 -0
- package/.claude-flow-novice/dist/src/communication/performance-validator.js +532 -0
- package/.claude-flow-novice/dist/src/communication/performance-validator.js.map +1 -0
- package/.claude-flow-novice/dist/src/communication/priority-message-queue.js +525 -0
- package/.claude-flow-novice/dist/src/communication/priority-message-queue.js.map +1 -0
- package/.claude-flow-novice/dist/src/communication/shared-buffer-bus.js +218 -0
- package/.claude-flow-novice/dist/src/communication/shared-buffer-bus.js.map +1 -0
- package/.claude-flow-novice/dist/src/communication/ultra-fast-communication-bus.js +521 -0
- package/.claude-flow-novice/dist/src/communication/ultra-fast-communication-bus.js.map +1 -0
- package/.claude-flow-novice/dist/src/communication/ultra-fast-serialization.js +563 -0
- package/.claude-flow-novice/dist/src/communication/ultra-fast-serialization.js.map +1 -0
- package/.claude-flow-novice/dist/src/communication/websocket-cluster.js +344 -0
- package/.claude-flow-novice/dist/src/communication/websocket-cluster.js.map +1 -0
- package/.claude-flow-novice/dist/src/communication/zero-copy-structures.js +369 -0
- package/.claude-flow-novice/dist/src/communication/zero-copy-structures.js.map +1 -0
- package/.claude-flow-novice/dist/src/config/config-manager.js +1 -1
- package/.claude-flow-novice/dist/src/config/config-manager.js.map +1 -1
- package/.claude-flow-novice/dist/src/config/core/intelligent-configuration-manager.js +1 -1
- package/.claude-flow-novice/dist/src/config/integration/hooks-integration.js +6 -6
- package/.claude-flow-novice/dist/src/config/integration/hooks-integration.js.map +1 -1
- package/.claude-flow-novice/dist/src/config/migration/config-migration.js +1 -1
- package/.claude-flow-novice/dist/src/config/ruv-swarm-integration.js +1 -1
- package/.claude-flow-novice/dist/src/config/utils/zero-config-setup.js +1 -1
- package/.claude-flow-novice/dist/src/config/utils/zero-config-setup.js.map +1 -1
- package/.claude-flow-novice/dist/src/config/web-portal-config.js +0 -9
- package/.claude-flow-novice/dist/src/config/web-portal-config.js.map +1 -1
- package/.claude-flow-novice/dist/src/config/zero-config-setup.js +18 -18
- package/.claude-flow-novice/dist/src/config/zero-config-setup.js.map +1 -1
- package/.claude-flow-novice/dist/src/core/logger.js +33 -10
- package/.claude-flow-novice/dist/src/core/logger.js.map +1 -1
- package/.claude-flow-novice/dist/src/migration/index.js +1 -1
- package/.claude-flow-novice/dist/src/migration/index.js.map +1 -1
- package/.claude-flow-novice/dist/src/migration/migration-runner.js +4 -4
- package/.claude-flow-novice/dist/src/migration/migration-runner.js.map +1 -1
- package/.claude-flow-novice/dist/src/monitoring/agent-health-monitor.js +430 -0
- package/.claude-flow-novice/dist/src/monitoring/agent-health-monitor.js.map +1 -0
- package/.claude-flow-novice/dist/src/slash-commands/claude-soul.js +248 -365
- package/.claude-flow-novice/dist/src/slash-commands/register-all-commands.js +1 -1
- package/.claude-flow-novice/dist/src/swarm/claude-code-interface.js +1 -1
- package/.claude-flow-novice/dist/src/swarm/claude-flow-executor.js +1 -1
- package/.claude-flow-novice/dist/src/swarm/consensus-coordinator.js +471 -0
- package/.claude-flow-novice/dist/src/swarm/consensus-coordinator.js.map +1 -0
- package/.claude-flow-novice/dist/src/swarm/hive-mind-integration.js +1 -1
- package/.claude-flow-novice/dist/src/swarm/large-scale-coordinator.js +543 -0
- package/.claude-flow-novice/dist/src/swarm/large-scale-coordinator.js.map +1 -0
- package/.claude-flow-novice/dist/src/swarm/optimizations/connection-pool.js +1 -1
- package/.claude-flow-novice/dist/src/swarm/optimizations/optimized-executor.js +1 -1
- package/.claude-flow-novice/dist/src/swarm/types.js.map +1 -1
- package/.claude-flow-novice/dist/src/swarm-fullstack/integrations/communication-bridge.js +709 -0
- package/.claude-flow-novice/dist/src/swarm-fullstack/integrations/communication-bridge.js.map +1 -0
- package/.claude-flow-novice/dist/src/swarm-fullstack/testing/api-contract-validator.js +612 -0
- package/.claude-flow-novice/dist/src/swarm-fullstack/testing/api-contract-validator.js.map +1 -0
- package/.claude-flow-novice/dist/src/swarm-fullstack/testing/backend-test-orchestrator.js +679 -0
- package/.claude-flow-novice/dist/src/swarm-fullstack/testing/backend-test-orchestrator.js.map +1 -0
- package/.claude-flow-novice/dist/src/swarm-fullstack/testing/frontend-test-orchestrator.js +654 -0
- package/.claude-flow-novice/dist/src/swarm-fullstack/testing/frontend-test-orchestrator.js.map +1 -0
- package/.claude-flow-novice/dist/src/swarm-fullstack/testing/visual-regression.js +402 -0
- package/.claude-flow-novice/dist/src/swarm-fullstack/testing/visual-regression.js.map +1 -0
- package/.claude-flow-novice/dist/src/swarm-fullstack/workflows/convergence-detector.js +459 -0
- package/.claude-flow-novice/dist/src/swarm-fullstack/workflows/convergence-detector.js.map +1 -0
- package/.claude-flow-novice/dist/src/swarm-fullstack/workflows/fix-coordinator.js +513 -0
- package/.claude-flow-novice/dist/src/swarm-fullstack/workflows/fix-coordinator.js.map +1 -0
- package/.claude-flow-novice/dist/src/swarm-fullstack/workflows/index.js +19 -0
- package/.claude-flow-novice/dist/src/swarm-fullstack/workflows/index.js.map +1 -0
- package/.claude-flow-novice/dist/src/swarm-fullstack/workflows/iterative-build-test.js +568 -0
- package/.claude-flow-novice/dist/src/swarm-fullstack/workflows/iterative-build-test.js.map +1 -0
- package/.claude-flow-novice/dist/src/swarm-fullstack/workflows/regression-test-manager.js +418 -0
- package/.claude-flow-novice/dist/src/swarm-fullstack/workflows/regression-test-manager.js.map +1 -0
- package/.claude-flow-novice/dist/src/swarm-fullstack/workflows/test-result-analyzer.js +530 -0
- package/.claude-flow-novice/dist/src/swarm-fullstack/workflows/test-result-analyzer.js.map +1 -0
- package/.claude-flow-novice/dist/src/swarm-fullstack/workflows/workflow-metrics.js +250 -0
- package/.claude-flow-novice/dist/src/swarm-fullstack/workflows/workflow-metrics.js.map +1 -0
- package/.claude-flow-novice/dist/src/task/index.js +7 -7
- package/.claude-flow-novice/dist/src/validation/fullstack-integration-validator.js +420 -0
- package/.claude-flow-novice/dist/src/validation/fullstack-integration-validator.js.map +1 -0
- package/.claude-flow-novice/dist/src/validation/production-validator.js +1435 -0
- package/.claude-flow-novice/dist/src/validation/production-validator.js.map +1 -0
- package/.claude-flow-novice/dist/src/verification/cli-integration.js +3 -3
- package/.claude-flow-novice/dist/src/verification/hooks.js +1 -1
- package/CHANGELOG.md +13 -0
- package/CLAUDE.md +1032 -61
- package/README.md +0 -1
- package/config/build/babel.config.cjs +19 -11
- package/config/typescript/tsconfig.json +1 -1
- package/examples/02-workflows/claude-workflow.json +5 -5
- package/examples/claude-api-error-handling.ts +2 -2
- package/examples/frontend-testing-demo.ts +470 -0
- package/examples/litellm/config/config.yaml +1 -1
- package/package.json +13 -7
- package/scripts/build/unified-builder.sh +6 -6
- package/scripts/build/validate-agents.js +238 -0
- package/scripts/post-install-claude-md.js +28 -0
- package/scripts/run-production-validation.ts +590 -0
- package/scripts/test/test-coordination-features.ts +2 -2
- package/scripts/validate-stage3-performance.ts +377 -0
- package/src/cli/simple-commands/hooks.js +1 -0
- package/src/cli/simple-commands/init/agent-copier.js +0 -2
- package/src/cli/simple-commands/init/index.js +18 -110
- package/src/cli/simple-commands/init/templates/CLAUDE.md +162 -1158
- package/src/cli/simple-commands/init/templates/claude-md.js +38 -157
- package/src/swarm-fullstack/integrations/communication-bridge.ts +931 -0
- package/src/swarm-fullstack/testing/api-contract-validator.ts +909 -0
- package/src/swarm-fullstack/testing/backend-test-orchestrator.ts +791 -0
- package/src/swarm-fullstack/testing/frontend-test-orchestrator.ts +853 -0
- package/src/swarm-fullstack/testing/visual-regression.ts +507 -0
- package/src/swarm-fullstack/workflows/convergence-detector.ts +736 -0
- package/src/swarm-fullstack/workflows/fix-coordinator.ts +677 -0
- package/src/swarm-fullstack/workflows/index.ts +75 -0
- package/src/swarm-fullstack/workflows/iterative-build-test.ts +829 -0
- package/src/swarm-fullstack/workflows/regression-test-manager.ts +590 -0
- package/src/swarm-fullstack/workflows/test-result-analyzer.ts +739 -0
- package/src/swarm-fullstack/workflows/workflow-metrics.ts +399 -0
- package/wiki/command-reference/README.md +1 -2
- package/wiki/command-reference/mcp-tools/README.md +1 -1
- package/wiki/getting-started/claude-code-mcp/README.md +1 -2
- package/wiki/getting-started/installation/README.md +2 -10
- package/.claude/agents/backend-dev.json +0 -9
- package/.claude/agents/code-analyzer.json +0 -9
- package/.claude/agents/coder.json +0 -9
- package/.claude/agents/planner.json +0 -9
- package/.claude/agents/researcher.json +0 -9
- package/.claude/agents/reviewer.json +0 -9
- package/.claude/agents/system-architect.json +0 -9
- package/.claude/agents/tester.json +0 -9
- package/.claude/commands/flow-nexus/app-store.md +0 -124
- package/.claude/commands/flow-nexus/challenges.md +0 -120
- package/.claude/commands/flow-nexus/login-registration.md +0 -65
- package/.claude/commands/flow-nexus/neural-network.md +0 -134
- package/.claude/commands/flow-nexus/payments.md +0 -116
- package/.claude/commands/flow-nexus/sandbox.md +0 -83
- package/.claude/commands/flow-nexus/swarm.md +0 -87
- package/.claude/commands/flow-nexus/user-tools.md +0 -152
- package/.claude/commands/flow-nexus/workflow.md +0 -115
- package/.claude-flow-novice/dist/cli/index.js +0 -45
- package/.claude-flow-novice/dist/core/index.js +0 -22
- package/.claude-flow-novice/dist/mcp/mcp-server-novice.js +0 -595
- package/.claude-flow-novice/dist/mcp/mcp-server-sdk.js +0 -649
- package/.claude-flow-novice/dist/mcp/mcp-server-with-slash-commands.js +0 -776
- package/.claude-flow-novice/dist/src/cli/simple-commands/init/templates/claude-md.js +0 -1101
- package/src/cli/simple-commands/init/templates/CLAUDE.md.optimized +0 -265
- /package/{.claude → .claude-flow-novice/.claude}/agents/README.md +0 -0
- /package/{.claude → .claude-flow-novice/.claude}/agents/consensus/README.md +0 -0
- /package/{.claude → .claude-flow-novice/.claude}/agents/core/coder.md +0 -0
- /package/{.claude → .claude-flow-novice/.claude}/agents/core/planner.md +0 -0
- /package/{.claude → .claude-flow-novice/.claude}/agents/core/researcher.md +0 -0
- /package/{.claude → .claude-flow-novice/.claude}/agents/core/reviewer.md +0 -0
- /package/{.claude → .claude-flow-novice/.claude}/agents/core/tester.md +0 -0
- /package/{.claude → .claude-flow-novice/.claude}/agents/optimization/README.md +0 -0
- /package/{.claude → .claude-flow-novice/.claude}/agents/swarm/README.md +0 -0
|
@@ -0,0 +1,736 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Convergence Detector - Determines When Iteration is Complete
|
|
3
|
+
*
|
|
4
|
+
* Monitors test pass rates, quality metrics, and progress indicators to
|
|
5
|
+
* determine when an iteration has converged and is ready to move forward.
|
|
6
|
+
*
|
|
7
|
+
* Key Features:
|
|
8
|
+
* - Multi-dimensional convergence analysis
|
|
9
|
+
* - Quality gate validation
|
|
10
|
+
* - Trend analysis
|
|
11
|
+
* - Early convergence detection
|
|
12
|
+
* - Divergence warnings
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import { EventEmitter } from 'events';
|
|
16
|
+
import { ILogger } from '../../core/logger.js';
|
|
17
|
+
import { TestExecutionResult } from './iterative-build-test.js';
|
|
18
|
+
|
|
19
|
+
export interface ConvergenceConfig {
|
|
20
|
+
threshold: number; // 0-1, percentage of passing tests
|
|
21
|
+
minCoverage: number; // 0-100
|
|
22
|
+
requireStability: boolean; // require multiple stable iterations
|
|
23
|
+
stabilityWindow: number; // number of iterations to check
|
|
24
|
+
enableTrendAnalysis: boolean;
|
|
25
|
+
qualityGates: QualityGate[];
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export interface QualityGate {
|
|
29
|
+
name: string;
|
|
30
|
+
metric: string;
|
|
31
|
+
threshold: number;
|
|
32
|
+
operator: '>' | '<' | '>=' | '<=' | '===';
|
|
33
|
+
blocking: boolean;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export interface ConvergenceCheck {
|
|
37
|
+
testResults: TestExecutionResult;
|
|
38
|
+
threshold: number;
|
|
39
|
+
minCoverage: number;
|
|
40
|
+
iterationNumber: number;
|
|
41
|
+
previousResults?: TestExecutionResult[];
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export interface ConvergenceResult {
|
|
45
|
+
converged: boolean;
|
|
46
|
+
score: number; // 0-1
|
|
47
|
+
confidence: number; // 0-1
|
|
48
|
+
metrics: ConvergenceMetrics;
|
|
49
|
+
qualityGateResults: QualityGateResult[];
|
|
50
|
+
recommendations: string[];
|
|
51
|
+
blockers: string[];
|
|
52
|
+
trends: TrendAnalysis;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export interface ConvergenceMetrics {
|
|
56
|
+
testPassRate: number;
|
|
57
|
+
coverageScore: number;
|
|
58
|
+
qualityScore: number;
|
|
59
|
+
stabilityScore: number;
|
|
60
|
+
velocityScore: number;
|
|
61
|
+
overallScore: number;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export interface QualityGateResult {
|
|
65
|
+
gate: QualityGate;
|
|
66
|
+
passed: boolean;
|
|
67
|
+
actualValue: number;
|
|
68
|
+
threshold: number;
|
|
69
|
+
blocking: boolean;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export interface TrendAnalysis {
|
|
73
|
+
improving: boolean;
|
|
74
|
+
velocity: number; // rate of improvement
|
|
75
|
+
projection: {
|
|
76
|
+
iterationsToConvergence: number;
|
|
77
|
+
estimatedCompletion: string;
|
|
78
|
+
};
|
|
79
|
+
riskFactors: string[];
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export class ConvergenceDetector extends EventEmitter {
|
|
83
|
+
private config: ConvergenceConfig;
|
|
84
|
+
private iterationHistory: TestExecutionResult[] = [];
|
|
85
|
+
|
|
86
|
+
constructor(private logger: ILogger, config?: Partial<ConvergenceConfig>) {
|
|
87
|
+
super();
|
|
88
|
+
|
|
89
|
+
this.config = {
|
|
90
|
+
threshold: 0.95,
|
|
91
|
+
minCoverage: 80,
|
|
92
|
+
requireStability: true,
|
|
93
|
+
stabilityWindow: 2,
|
|
94
|
+
enableTrendAnalysis: true,
|
|
95
|
+
qualityGates: [
|
|
96
|
+
{
|
|
97
|
+
name: 'Test Pass Rate',
|
|
98
|
+
metric: 'testPassRate',
|
|
99
|
+
threshold: 95,
|
|
100
|
+
operator: '>=',
|
|
101
|
+
blocking: true,
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
name: 'Code Coverage',
|
|
105
|
+
metric: 'coverage.lines',
|
|
106
|
+
threshold: 80,
|
|
107
|
+
operator: '>=',
|
|
108
|
+
blocking: true,
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
name: 'Critical Failures',
|
|
112
|
+
metric: 'criticalFailures',
|
|
113
|
+
threshold: 0,
|
|
114
|
+
operator: '===',
|
|
115
|
+
blocking: true,
|
|
116
|
+
},
|
|
117
|
+
],
|
|
118
|
+
...config,
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Check if iteration has converged
|
|
124
|
+
*/
|
|
125
|
+
async checkConvergence(check: ConvergenceCheck): Promise<ConvergenceResult> {
|
|
126
|
+
this.logger.info('Checking convergence', {
|
|
127
|
+
iteration: check.iterationNumber,
|
|
128
|
+
passRate: check.testResults.passed / check.testResults.totalTests,
|
|
129
|
+
});
|
|
130
|
+
|
|
131
|
+
// Add to history
|
|
132
|
+
this.iterationHistory.push(check.testResults);
|
|
133
|
+
|
|
134
|
+
// Calculate individual metrics
|
|
135
|
+
const metrics = this.calculateMetrics(check);
|
|
136
|
+
|
|
137
|
+
// Evaluate quality gates
|
|
138
|
+
const qualityGateResults = this.evaluateQualityGates(check.testResults, metrics);
|
|
139
|
+
|
|
140
|
+
// Analyze trends
|
|
141
|
+
const trends = this.config.enableTrendAnalysis
|
|
142
|
+
? this.analyzeTrends(check)
|
|
143
|
+
: this.getDefaultTrends();
|
|
144
|
+
|
|
145
|
+
// Determine if converged
|
|
146
|
+
const converged = this.determineConvergence(metrics, qualityGateResults, trends);
|
|
147
|
+
|
|
148
|
+
// Calculate confidence
|
|
149
|
+
const confidence = this.calculateConfidence(metrics, qualityGateResults, trends);
|
|
150
|
+
|
|
151
|
+
// Generate recommendations
|
|
152
|
+
const recommendations = this.generateRecommendations(
|
|
153
|
+
metrics,
|
|
154
|
+
qualityGateResults,
|
|
155
|
+
trends,
|
|
156
|
+
converged,
|
|
157
|
+
);
|
|
158
|
+
|
|
159
|
+
// Identify blockers
|
|
160
|
+
const blockers = this.identifyBlockers(qualityGateResults, metrics);
|
|
161
|
+
|
|
162
|
+
const result: ConvergenceResult = {
|
|
163
|
+
converged,
|
|
164
|
+
score: metrics.overallScore,
|
|
165
|
+
confidence,
|
|
166
|
+
metrics,
|
|
167
|
+
qualityGateResults,
|
|
168
|
+
recommendations,
|
|
169
|
+
blockers,
|
|
170
|
+
trends,
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
// Emit event if converged
|
|
174
|
+
if (converged) {
|
|
175
|
+
this.emit('convergence:achieved', {
|
|
176
|
+
iteration: check.iterationNumber,
|
|
177
|
+
score: metrics.overallScore,
|
|
178
|
+
confidence,
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
// Emit warning if diverging
|
|
183
|
+
if (trends.improving === false && check.iterationNumber > 2) {
|
|
184
|
+
this.emit('convergence:diverging', {
|
|
185
|
+
iteration: check.iterationNumber,
|
|
186
|
+
riskFactors: trends.riskFactors,
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
return result;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* Calculate convergence metrics
|
|
195
|
+
*/
|
|
196
|
+
private calculateMetrics(check: ConvergenceCheck): ConvergenceMetrics {
|
|
197
|
+
const { testResults } = check;
|
|
198
|
+
|
|
199
|
+
// Test pass rate (0-1)
|
|
200
|
+
const testPassRate =
|
|
201
|
+
testResults.totalTests > 0 ? testResults.passed / testResults.totalTests : 0;
|
|
202
|
+
|
|
203
|
+
// Coverage score (0-1)
|
|
204
|
+
const coverageScore = this.calculateCoverageScore(testResults.coverage);
|
|
205
|
+
|
|
206
|
+
// Quality score based on failures and warnings (0-1)
|
|
207
|
+
const qualityScore = this.calculateQualityScore(testResults);
|
|
208
|
+
|
|
209
|
+
// Stability score based on recent iterations (0-1)
|
|
210
|
+
const stabilityScore = this.calculateStabilityScore(check);
|
|
211
|
+
|
|
212
|
+
// Velocity score based on improvement rate (0-1)
|
|
213
|
+
const velocityScore = this.calculateVelocityScore();
|
|
214
|
+
|
|
215
|
+
// Overall score (weighted average)
|
|
216
|
+
const overallScore =
|
|
217
|
+
testPassRate * 0.4 +
|
|
218
|
+
coverageScore * 0.25 +
|
|
219
|
+
qualityScore * 0.2 +
|
|
220
|
+
stabilityScore * 0.1 +
|
|
221
|
+
velocityScore * 0.05;
|
|
222
|
+
|
|
223
|
+
return {
|
|
224
|
+
testPassRate,
|
|
225
|
+
coverageScore,
|
|
226
|
+
qualityScore,
|
|
227
|
+
stabilityScore,
|
|
228
|
+
velocityScore,
|
|
229
|
+
overallScore,
|
|
230
|
+
};
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
/**
|
|
234
|
+
* Calculate coverage score from coverage metrics
|
|
235
|
+
*/
|
|
236
|
+
private calculateCoverageScore(coverage: TestExecutionResult['coverage']): number {
|
|
237
|
+
const { lines, functions, branches, statements } = coverage;
|
|
238
|
+
|
|
239
|
+
// Weighted average of coverage metrics
|
|
240
|
+
const score = (lines * 0.3 + functions * 0.25 + branches * 0.25 + statements * 0.2) / 100;
|
|
241
|
+
|
|
242
|
+
return Math.min(Math.max(score, 0), 1);
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
/**
|
|
246
|
+
* Calculate quality score based on failures and warnings
|
|
247
|
+
*/
|
|
248
|
+
private calculateQualityScore(testResults: TestExecutionResult): number {
|
|
249
|
+
let score = 1.0;
|
|
250
|
+
|
|
251
|
+
// Penalize for failures
|
|
252
|
+
const criticalFailures = testResults.failures.filter((f) => f.severity === 'critical').length;
|
|
253
|
+
const highFailures = testResults.failures.filter((f) => f.severity === 'high').length;
|
|
254
|
+
const mediumFailures = testResults.failures.filter((f) => f.severity === 'medium').length;
|
|
255
|
+
|
|
256
|
+
score -= criticalFailures * 0.2;
|
|
257
|
+
score -= highFailures * 0.1;
|
|
258
|
+
score -= mediumFailures * 0.05;
|
|
259
|
+
|
|
260
|
+
// Penalize for warnings
|
|
261
|
+
const highWarnings = testResults.warnings.filter((w) => w.severity === 'high').length;
|
|
262
|
+
const mediumWarnings = testResults.warnings.filter((w) => w.severity === 'medium').length;
|
|
263
|
+
|
|
264
|
+
score -= highWarnings * 0.02;
|
|
265
|
+
score -= mediumWarnings * 0.01;
|
|
266
|
+
|
|
267
|
+
return Math.max(score, 0);
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
/**
|
|
271
|
+
* Calculate stability score based on recent iterations
|
|
272
|
+
*/
|
|
273
|
+
private calculateStabilityScore(check: ConvergenceCheck): number {
|
|
274
|
+
if (this.iterationHistory.length < 2) return 0.5;
|
|
275
|
+
|
|
276
|
+
const recent = this.iterationHistory.slice(-this.config.stabilityWindow);
|
|
277
|
+
|
|
278
|
+
// Calculate variance in pass rate
|
|
279
|
+
const passRates = recent.map((r) => r.passed / r.totalTests);
|
|
280
|
+
const variance = this.calculateVariance(passRates);
|
|
281
|
+
|
|
282
|
+
// Lower variance = higher stability
|
|
283
|
+
const stabilityScore = 1 - Math.min(variance * 10, 1);
|
|
284
|
+
|
|
285
|
+
return stabilityScore;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
/**
|
|
289
|
+
* Calculate velocity score (rate of improvement)
|
|
290
|
+
*/
|
|
291
|
+
private calculateVelocityScore(): number {
|
|
292
|
+
if (this.iterationHistory.length < 2) return 0.5;
|
|
293
|
+
|
|
294
|
+
const recent = this.iterationHistory.slice(-3);
|
|
295
|
+
const passRates = recent.map((r) => r.passed / r.totalTests);
|
|
296
|
+
|
|
297
|
+
// Check if improving
|
|
298
|
+
let improving = true;
|
|
299
|
+
for (let i = 1; i < passRates.length; i++) {
|
|
300
|
+
if (passRates[i] <= passRates[i - 1]) {
|
|
301
|
+
improving = false;
|
|
302
|
+
break;
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
if (!improving) return 0.3;
|
|
307
|
+
|
|
308
|
+
// Calculate improvement rate
|
|
309
|
+
const totalImprovement = passRates[passRates.length - 1] - passRates[0];
|
|
310
|
+
const velocityScore = Math.min(totalImprovement * 2, 1);
|
|
311
|
+
|
|
312
|
+
return velocityScore;
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
/**
|
|
316
|
+
* Evaluate quality gates
|
|
317
|
+
*/
|
|
318
|
+
private evaluateQualityGates(
|
|
319
|
+
testResults: TestExecutionResult,
|
|
320
|
+
metrics: ConvergenceMetrics,
|
|
321
|
+
): QualityGateResult[] {
|
|
322
|
+
return this.config.qualityGates.map((gate) => {
|
|
323
|
+
const actualValue = this.getMetricValue(gate.metric, testResults, metrics);
|
|
324
|
+
const passed = this.evaluateCondition(actualValue, gate.operator, gate.threshold);
|
|
325
|
+
|
|
326
|
+
return {
|
|
327
|
+
gate,
|
|
328
|
+
passed,
|
|
329
|
+
actualValue,
|
|
330
|
+
threshold: gate.threshold,
|
|
331
|
+
blocking: gate.blocking,
|
|
332
|
+
};
|
|
333
|
+
});
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
/**
|
|
337
|
+
* Get metric value from test results or metrics
|
|
338
|
+
*/
|
|
339
|
+
private getMetricValue(
|
|
340
|
+
metric: string,
|
|
341
|
+
testResults: TestExecutionResult,
|
|
342
|
+
metrics: ConvergenceMetrics,
|
|
343
|
+
): number {
|
|
344
|
+
// Handle nested properties
|
|
345
|
+
if (metric.includes('.')) {
|
|
346
|
+
const parts = metric.split('.');
|
|
347
|
+
let value: any = testResults;
|
|
348
|
+
|
|
349
|
+
for (const part of parts) {
|
|
350
|
+
value = value[part];
|
|
351
|
+
if (value === undefined) break;
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
return typeof value === 'number' ? value : 0;
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
// Handle special metrics
|
|
358
|
+
if (metric === 'testPassRate') {
|
|
359
|
+
return metrics.testPassRate * 100;
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
if (metric === 'criticalFailures') {
|
|
363
|
+
return testResults.failures.filter((f) => f.severity === 'critical').length;
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
return 0;
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
/**
|
|
370
|
+
* Evaluate condition
|
|
371
|
+
*/
|
|
372
|
+
private evaluateCondition(
|
|
373
|
+
actualValue: number,
|
|
374
|
+
operator: QualityGate['operator'],
|
|
375
|
+
threshold: number,
|
|
376
|
+
): boolean {
|
|
377
|
+
switch (operator) {
|
|
378
|
+
case '>':
|
|
379
|
+
return actualValue > threshold;
|
|
380
|
+
case '<':
|
|
381
|
+
return actualValue < threshold;
|
|
382
|
+
case '>=':
|
|
383
|
+
return actualValue >= threshold;
|
|
384
|
+
case '<=':
|
|
385
|
+
return actualValue <= threshold;
|
|
386
|
+
case '===':
|
|
387
|
+
return actualValue === threshold;
|
|
388
|
+
default:
|
|
389
|
+
return false;
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
/**
|
|
394
|
+
* Analyze trends
|
|
395
|
+
*/
|
|
396
|
+
private analyzeTrends(check: ConvergenceCheck): TrendAnalysis {
|
|
397
|
+
if (this.iterationHistory.length < 2) {
|
|
398
|
+
return this.getDefaultTrends();
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
const recent = this.iterationHistory.slice(-3);
|
|
402
|
+
const passRates = recent.map((r) => r.passed / r.totalTests);
|
|
403
|
+
|
|
404
|
+
// Check if improving
|
|
405
|
+
const improving = this.isImproving(passRates);
|
|
406
|
+
|
|
407
|
+
// Calculate velocity (rate of change)
|
|
408
|
+
const velocity = this.calculateTrendVelocity(passRates);
|
|
409
|
+
|
|
410
|
+
// Project iterations to convergence
|
|
411
|
+
const iterationsToConvergence = this.projectIterationsToConvergence(
|
|
412
|
+
passRates,
|
|
413
|
+
velocity,
|
|
414
|
+
this.config.threshold,
|
|
415
|
+
);
|
|
416
|
+
|
|
417
|
+
// Identify risk factors
|
|
418
|
+
const riskFactors = this.identifyRiskFactors(passRates, velocity, check);
|
|
419
|
+
|
|
420
|
+
return {
|
|
421
|
+
improving,
|
|
422
|
+
velocity,
|
|
423
|
+
projection: {
|
|
424
|
+
iterationsToConvergence,
|
|
425
|
+
estimatedCompletion: new Date(
|
|
426
|
+
Date.now() + iterationsToConvergence * 1800000,
|
|
427
|
+
).toISOString(),
|
|
428
|
+
},
|
|
429
|
+
riskFactors,
|
|
430
|
+
};
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
/**
|
|
434
|
+
* Determine if trend is improving
|
|
435
|
+
*/
|
|
436
|
+
private isImproving(values: number[]): boolean {
|
|
437
|
+
if (values.length < 2) return true;
|
|
438
|
+
|
|
439
|
+
let improvementCount = 0;
|
|
440
|
+
for (let i = 1; i < values.length; i++) {
|
|
441
|
+
if (values[i] > values[i - 1]) improvementCount++;
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
return improvementCount > values.length / 2;
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
/**
|
|
448
|
+
* Calculate trend velocity
|
|
449
|
+
*/
|
|
450
|
+
private calculateTrendVelocity(values: number[]): number {
|
|
451
|
+
if (values.length < 2) return 0;
|
|
452
|
+
|
|
453
|
+
const changes: number[] = [];
|
|
454
|
+
for (let i = 1; i < values.length; i++) {
|
|
455
|
+
changes.push(values[i] - values[i - 1]);
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
return changes.reduce((sum, change) => sum + change, 0) / changes.length;
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
/**
|
|
462
|
+
* Project iterations to convergence
|
|
463
|
+
*/
|
|
464
|
+
private projectIterationsToConvergence(
|
|
465
|
+
passRates: number[],
|
|
466
|
+
velocity: number,
|
|
467
|
+
threshold: number,
|
|
468
|
+
): number {
|
|
469
|
+
if (passRates.length === 0) return 10;
|
|
470
|
+
|
|
471
|
+
const currentRate = passRates[passRates.length - 1];
|
|
472
|
+
const gap = threshold - currentRate;
|
|
473
|
+
|
|
474
|
+
if (velocity <= 0) return 999; // Not converging
|
|
475
|
+
if (gap <= 0) return 0; // Already converged
|
|
476
|
+
|
|
477
|
+
return Math.ceil(gap / velocity);
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
/**
|
|
481
|
+
* Identify risk factors
|
|
482
|
+
*/
|
|
483
|
+
private identifyRiskFactors(
|
|
484
|
+
passRates: number[],
|
|
485
|
+
velocity: number,
|
|
486
|
+
check: ConvergenceCheck,
|
|
487
|
+
): string[] {
|
|
488
|
+
const risks: string[] = [];
|
|
489
|
+
|
|
490
|
+
// Negative velocity
|
|
491
|
+
if (velocity < 0) {
|
|
492
|
+
risks.push('Test pass rate is decreasing');
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
// Stagnant progress
|
|
496
|
+
if (Math.abs(velocity) < 0.01 && passRates[passRates.length - 1] < this.config.threshold) {
|
|
497
|
+
risks.push('Progress has stagnated');
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
// Critical failures
|
|
501
|
+
const criticalFailures = check.testResults.failures.filter(
|
|
502
|
+
(f) => f.severity === 'critical',
|
|
503
|
+
).length;
|
|
504
|
+
if (criticalFailures > 0) {
|
|
505
|
+
risks.push(`${criticalFailures} critical test failures present`);
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
// Low coverage
|
|
509
|
+
const avgCoverage =
|
|
510
|
+
(check.testResults.coverage.lines +
|
|
511
|
+
check.testResults.coverage.functions +
|
|
512
|
+
check.testResults.coverage.branches) /
|
|
513
|
+
3;
|
|
514
|
+
if (avgCoverage < this.config.minCoverage) {
|
|
515
|
+
risks.push(`Code coverage (${avgCoverage.toFixed(1)}%) below threshold`);
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
// High iteration count
|
|
519
|
+
if (check.iterationNumber > 7) {
|
|
520
|
+
risks.push('High iteration count may indicate design issues');
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
return risks;
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
/**
|
|
527
|
+
* Determine convergence
|
|
528
|
+
*/
|
|
529
|
+
private determineConvergence(
|
|
530
|
+
metrics: ConvergenceMetrics,
|
|
531
|
+
qualityGateResults: QualityGateResult[],
|
|
532
|
+
trends: TrendAnalysis,
|
|
533
|
+
): boolean {
|
|
534
|
+
// Check if all blocking quality gates pass
|
|
535
|
+
const blockingGatesPassed = qualityGateResults
|
|
536
|
+
.filter((r) => r.gate.blocking)
|
|
537
|
+
.every((r) => r.passed);
|
|
538
|
+
|
|
539
|
+
if (!blockingGatesPassed) return false;
|
|
540
|
+
|
|
541
|
+
// Check overall score
|
|
542
|
+
if (metrics.overallScore < this.config.threshold) return false;
|
|
543
|
+
|
|
544
|
+
// Check stability if required
|
|
545
|
+
if (this.config.requireStability && metrics.stabilityScore < 0.7) return false;
|
|
546
|
+
|
|
547
|
+
// Check if improving
|
|
548
|
+
if (this.config.enableTrendAnalysis && !trends.improving) return false;
|
|
549
|
+
|
|
550
|
+
return true;
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
/**
|
|
554
|
+
* Calculate confidence level
|
|
555
|
+
*/
|
|
556
|
+
private calculateConfidence(
|
|
557
|
+
metrics: ConvergenceMetrics,
|
|
558
|
+
qualityGateResults: QualityGateResult[],
|
|
559
|
+
trends: TrendAnalysis,
|
|
560
|
+
): number {
|
|
561
|
+
let confidence = 0.5;
|
|
562
|
+
|
|
563
|
+
// High pass rate increases confidence
|
|
564
|
+
confidence += metrics.testPassRate * 0.2;
|
|
565
|
+
|
|
566
|
+
// High coverage increases confidence
|
|
567
|
+
confidence += metrics.coverageScore * 0.15;
|
|
568
|
+
|
|
569
|
+
// High quality increases confidence
|
|
570
|
+
confidence += metrics.qualityScore * 0.1;
|
|
571
|
+
|
|
572
|
+
// Stability increases confidence
|
|
573
|
+
confidence += metrics.stabilityScore * 0.1;
|
|
574
|
+
|
|
575
|
+
// All quality gates passing increases confidence
|
|
576
|
+
const allGatesPassed = qualityGateResults.every((r) => r.passed);
|
|
577
|
+
if (allGatesPassed) confidence += 0.15;
|
|
578
|
+
|
|
579
|
+
// Positive trends increase confidence
|
|
580
|
+
if (trends.improving && trends.velocity > 0) confidence += 0.1;
|
|
581
|
+
|
|
582
|
+
return Math.min(confidence, 1);
|
|
583
|
+
}
|
|
584
|
+
|
|
585
|
+
/**
|
|
586
|
+
* Generate recommendations
|
|
587
|
+
*/
|
|
588
|
+
private generateRecommendations(
|
|
589
|
+
metrics: ConvergenceMetrics,
|
|
590
|
+
qualityGateResults: QualityGateResult[],
|
|
591
|
+
trends: TrendAnalysis,
|
|
592
|
+
converged: boolean,
|
|
593
|
+
): string[] {
|
|
594
|
+
const recommendations: string[] = [];
|
|
595
|
+
|
|
596
|
+
if (converged) {
|
|
597
|
+
recommendations.push('Iteration has converged - ready to proceed');
|
|
598
|
+
recommendations.push('Consider final validation before deployment');
|
|
599
|
+
return recommendations;
|
|
600
|
+
}
|
|
601
|
+
|
|
602
|
+
// Test pass rate recommendations
|
|
603
|
+
if (metrics.testPassRate < 0.9) {
|
|
604
|
+
recommendations.push(
|
|
605
|
+
`Focus on fixing remaining test failures (${((1 - metrics.testPassRate) * 100).toFixed(1)}% failing)`,
|
|
606
|
+
);
|
|
607
|
+
}
|
|
608
|
+
|
|
609
|
+
// Coverage recommendations
|
|
610
|
+
if (metrics.coverageScore < 0.8) {
|
|
611
|
+
recommendations.push(
|
|
612
|
+
`Increase test coverage (current: ${(metrics.coverageScore * 100).toFixed(1)}%)`,
|
|
613
|
+
);
|
|
614
|
+
}
|
|
615
|
+
|
|
616
|
+
// Quality recommendations
|
|
617
|
+
if (metrics.qualityScore < 0.8) {
|
|
618
|
+
recommendations.push('Address high-severity test failures and warnings');
|
|
619
|
+
}
|
|
620
|
+
|
|
621
|
+
// Stability recommendations
|
|
622
|
+
if (metrics.stabilityScore < 0.7) {
|
|
623
|
+
recommendations.push('Focus on stabilizing existing fixes before adding new changes');
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
// Trend recommendations
|
|
627
|
+
if (!trends.improving) {
|
|
628
|
+
recommendations.push('Re-evaluate fix strategies - current approach may not be effective');
|
|
629
|
+
}
|
|
630
|
+
|
|
631
|
+
// Failed quality gates
|
|
632
|
+
const failedGates = qualityGateResults.filter((r) => !r.passed);
|
|
633
|
+
for (const result of failedGates) {
|
|
634
|
+
recommendations.push(
|
|
635
|
+
`Address quality gate: ${result.gate.name} (${result.actualValue} ${result.gate.operator} ${result.threshold})`,
|
|
636
|
+
);
|
|
637
|
+
}
|
|
638
|
+
|
|
639
|
+
return recommendations;
|
|
640
|
+
}
|
|
641
|
+
|
|
642
|
+
/**
|
|
643
|
+
* Identify blockers
|
|
644
|
+
*/
|
|
645
|
+
private identifyBlockers(
|
|
646
|
+
qualityGateResults: QualityGateResult[],
|
|
647
|
+
metrics: ConvergenceMetrics,
|
|
648
|
+
): string[] {
|
|
649
|
+
const blockers: string[] = [];
|
|
650
|
+
|
|
651
|
+
// Failed blocking quality gates
|
|
652
|
+
const failedBlockingGates = qualityGateResults.filter(
|
|
653
|
+
(r) => r.gate.blocking && !r.passed,
|
|
654
|
+
);
|
|
655
|
+
|
|
656
|
+
for (const result of failedBlockingGates) {
|
|
657
|
+
blockers.push(
|
|
658
|
+
`Blocking quality gate failed: ${result.gate.name} (${result.actualValue} ${result.gate.operator} ${result.threshold})`,
|
|
659
|
+
);
|
|
660
|
+
}
|
|
661
|
+
|
|
662
|
+
return blockers;
|
|
663
|
+
}
|
|
664
|
+
|
|
665
|
+
/**
|
|
666
|
+
* Calculate variance
|
|
667
|
+
*/
|
|
668
|
+
private calculateVariance(values: number[]): number {
|
|
669
|
+
if (values.length === 0) return 0;
|
|
670
|
+
|
|
671
|
+
const mean = values.reduce((sum, v) => sum + v, 0) / values.length;
|
|
672
|
+
const squaredDiffs = values.map((v) => Math.pow(v - mean, 2));
|
|
673
|
+
const variance = squaredDiffs.reduce((sum, v) => sum + v, 0) / values.length;
|
|
674
|
+
|
|
675
|
+
return variance;
|
|
676
|
+
}
|
|
677
|
+
|
|
678
|
+
/**
|
|
679
|
+
* Get default trends
|
|
680
|
+
*/
|
|
681
|
+
private getDefaultTrends(): TrendAnalysis {
|
|
682
|
+
return {
|
|
683
|
+
improving: true,
|
|
684
|
+
velocity: 0,
|
|
685
|
+
projection: {
|
|
686
|
+
iterationsToConvergence: 5,
|
|
687
|
+
estimatedCompletion: new Date(Date.now() + 5 * 1800000).toISOString(),
|
|
688
|
+
},
|
|
689
|
+
riskFactors: [],
|
|
690
|
+
};
|
|
691
|
+
}
|
|
692
|
+
|
|
693
|
+
/**
|
|
694
|
+
* Reset detector for new workflow
|
|
695
|
+
*/
|
|
696
|
+
reset(): void {
|
|
697
|
+
this.iterationHistory = [];
|
|
698
|
+
}
|
|
699
|
+
|
|
700
|
+
/**
|
|
701
|
+
* Get current status
|
|
702
|
+
*/
|
|
703
|
+
getStatus(): {
|
|
704
|
+
iterations: number;
|
|
705
|
+
currentPassRate: number;
|
|
706
|
+
trend: string;
|
|
707
|
+
} {
|
|
708
|
+
const iterations = this.iterationHistory.length;
|
|
709
|
+
|
|
710
|
+
if (iterations === 0) {
|
|
711
|
+
return {
|
|
712
|
+
iterations: 0,
|
|
713
|
+
currentPassRate: 0,
|
|
714
|
+
trend: 'unknown',
|
|
715
|
+
};
|
|
716
|
+
}
|
|
717
|
+
|
|
718
|
+
const latest = this.iterationHistory[iterations - 1];
|
|
719
|
+
const currentPassRate = latest.passed / latest.totalTests;
|
|
720
|
+
|
|
721
|
+
let trend = 'stable';
|
|
722
|
+
if (iterations > 1) {
|
|
723
|
+
const previous = this.iterationHistory[iterations - 2];
|
|
724
|
+
const previousPassRate = previous.passed / previous.totalTests;
|
|
725
|
+
|
|
726
|
+
if (currentPassRate > previousPassRate + 0.05) trend = 'improving';
|
|
727
|
+
else if (currentPassRate < previousPassRate - 0.05) trend = 'declining';
|
|
728
|
+
}
|
|
729
|
+
|
|
730
|
+
return {
|
|
731
|
+
iterations,
|
|
732
|
+
currentPassRate,
|
|
733
|
+
trend,
|
|
734
|
+
};
|
|
735
|
+
}
|
|
736
|
+
}
|