claude-flow-novice 1.3.6 → 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 +208 -550
- package/.claude/agents/architect.md +136 -469
- package/.claude/agents/architecture/system-architect.md +20 -1
- 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 +87 -303
- 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 +22 -11
- 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 +134 -402
- 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 +1 -1
- package/.claude/agents/optimization/performance-monitor.md +1 -1
- package/.claude/agents/planner.md +135 -0
- package/.claude/agents/researcher.md +22 -9
- package/.claude/agents/reviewer.md +291 -0
- package/.claude/agents/security/security-specialist.md +1 -1
- 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/tester.md +21 -11
- 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/base-template-generator.md +65 -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.md +135 -0
- package/.claude-flow-novice/.claude/agents/researcher.md +185 -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/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.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 +1029 -68
- package/README.md +0 -1
- package/config/build/babel.config.cjs +19 -11
- package/config/typescript/tsconfig.json +1 -1
- 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/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 +5 -97
- 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/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/backend-dev.json +0 -0
- /package/{.claude → .claude-flow-novice/.claude}/agents/code-analyzer.json +0 -0
- /package/{.claude → .claude-flow-novice/.claude}/agents/coder.json +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/planner.json +0 -0
- /package/{.claude → .claude-flow-novice/.claude}/agents/researcher.json +0 -0
- /package/{.claude → .claude-flow-novice/.claude}/agents/reviewer.json +0 -0
- /package/{.claude → .claude-flow-novice/.claude}/agents/swarm/README.md +0 -0
- /package/{.claude → .claude-flow-novice/.claude}/agents/system-architect.json +0 -0
- /package/{.claude → .claude-flow-novice/.claude}/agents/tester.json +0 -0
|
@@ -0,0 +1,677 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Fix Coordinator - Intelligent Failure Analysis and Fix Assignment
|
|
3
|
+
*
|
|
4
|
+
* Analyzes test failures, assigns fixes to appropriate agents, tracks progress,
|
|
5
|
+
* and triggers regression testing after fixes are applied.
|
|
6
|
+
*
|
|
7
|
+
* Key Features:
|
|
8
|
+
* - Intelligent failure categorization
|
|
9
|
+
* - Agent assignment based on expertise
|
|
10
|
+
* - Parallel fix execution
|
|
11
|
+
* - Fix validation and rollback
|
|
12
|
+
* - Learning from fix patterns
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import { EventEmitter } from 'events';
|
|
16
|
+
import { SwarmMemoryManager } from '../../memory/swarm-memory.js';
|
|
17
|
+
import { ILogger } from '../../core/logger.js';
|
|
18
|
+
import { FullStackAgentType } from '../types/index.js';
|
|
19
|
+
import { TestFailure, FixExecutionResult, CodeChange, ValidationResult } from './iterative-build-test.js';
|
|
20
|
+
|
|
21
|
+
export interface FixPlan {
|
|
22
|
+
id: string;
|
|
23
|
+
featureId: string;
|
|
24
|
+
failures: TestFailure[];
|
|
25
|
+
fixStrategies: FixStrategy[];
|
|
26
|
+
priority: FixPriority[];
|
|
27
|
+
estimatedDuration: number;
|
|
28
|
+
dependencies: Map<string, string[]>; // fixId -> dependent fixIds
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export interface FixStrategy {
|
|
32
|
+
id: string;
|
|
33
|
+
failureId: string;
|
|
34
|
+
strategy: 'quick-fix' | 'refactor' | 'redesign' | 'workaround';
|
|
35
|
+
assignedAgent: FullStackAgentType;
|
|
36
|
+
description: string;
|
|
37
|
+
steps: string[];
|
|
38
|
+
estimatedEffort: number; // minutes
|
|
39
|
+
confidence: number; // 0-1
|
|
40
|
+
alternatives: string[];
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export interface FixPriority {
|
|
44
|
+
failureId: string;
|
|
45
|
+
priority: number; // 0-100, higher is more urgent
|
|
46
|
+
reasoning: string;
|
|
47
|
+
blocking: boolean;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export interface FixPattern {
|
|
51
|
+
pattern: string;
|
|
52
|
+
category: string;
|
|
53
|
+
successRate: number;
|
|
54
|
+
averageTime: number;
|
|
55
|
+
bestAgent: FullStackAgentType;
|
|
56
|
+
commonSolutions: string[];
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export class FixCoordinator extends EventEmitter {
|
|
60
|
+
private memory: SwarmMemoryManager;
|
|
61
|
+
private fixPatterns = new Map<string, FixPattern>();
|
|
62
|
+
private activeFixe = new Map<string, FixExecutionResult>();
|
|
63
|
+
private fixHistory = new Map<string, FixExecutionResult[]>();
|
|
64
|
+
|
|
65
|
+
constructor(memory: SwarmMemoryManager, private logger: ILogger) {
|
|
66
|
+
super();
|
|
67
|
+
this.memory = memory;
|
|
68
|
+
this.loadFixPatterns();
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Create comprehensive fix plan from test failures
|
|
73
|
+
*/
|
|
74
|
+
async createFixPlan(failures: TestFailure[], featureId: string): Promise<FixPlan> {
|
|
75
|
+
this.logger.info('Creating fix plan', { failures: failures.length, featureId });
|
|
76
|
+
|
|
77
|
+
try {
|
|
78
|
+
// Categorize and analyze failures
|
|
79
|
+
const categorized = this.categorizeFailures(failures);
|
|
80
|
+
|
|
81
|
+
// Create fix strategies for each failure
|
|
82
|
+
const fixStrategies = await Promise.all(
|
|
83
|
+
failures.map((failure) => this.createFixStrategy(failure)),
|
|
84
|
+
);
|
|
85
|
+
|
|
86
|
+
// Prioritize fixes
|
|
87
|
+
const priorities = this.prioritizeFixes(failures, fixStrategies);
|
|
88
|
+
|
|
89
|
+
// Identify dependencies between fixes
|
|
90
|
+
const dependencies = this.identifyFixDependencies(fixStrategies);
|
|
91
|
+
|
|
92
|
+
// Estimate total duration
|
|
93
|
+
const estimatedDuration = this.estimatePlanDuration(fixStrategies, dependencies);
|
|
94
|
+
|
|
95
|
+
const plan: FixPlan = {
|
|
96
|
+
id: `fix-plan_${Date.now()}`,
|
|
97
|
+
featureId,
|
|
98
|
+
failures,
|
|
99
|
+
fixStrategies,
|
|
100
|
+
priority: priorities,
|
|
101
|
+
estimatedDuration,
|
|
102
|
+
dependencies,
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
// Store plan in memory
|
|
106
|
+
await this.memory.remember('fix-coordinator', 'state', plan, {
|
|
107
|
+
tags: ['fix-plan', featureId],
|
|
108
|
+
shareLevel: 'team',
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
this.emit('fix-plan:created', { plan });
|
|
112
|
+
|
|
113
|
+
return plan;
|
|
114
|
+
} catch (error) {
|
|
115
|
+
this.logger.error('Failed to create fix plan', { error, featureId });
|
|
116
|
+
throw error;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* Execute fixes with parallel limit
|
|
122
|
+
*/
|
|
123
|
+
async executeFixes(plan: FixPlan, maxParallel: number): Promise<FixExecutionResult[]> {
|
|
124
|
+
this.logger.info('Executing fixes', {
|
|
125
|
+
featureId: plan.featureId,
|
|
126
|
+
totalFixes: plan.fixStrategies.length,
|
|
127
|
+
maxParallel,
|
|
128
|
+
});
|
|
129
|
+
|
|
130
|
+
const results: FixExecutionResult[] = [];
|
|
131
|
+
const queue = [...plan.fixStrategies];
|
|
132
|
+
const inProgress = new Map<string, Promise<FixExecutionResult>>();
|
|
133
|
+
|
|
134
|
+
while (queue.length > 0 || inProgress.size > 0) {
|
|
135
|
+
// Start new fixes up to parallel limit
|
|
136
|
+
while (queue.length > 0 && inProgress.size < maxParallel) {
|
|
137
|
+
const strategy = this.getNextExecutableStrategy(queue, inProgress, plan.dependencies);
|
|
138
|
+
if (!strategy) break;
|
|
139
|
+
|
|
140
|
+
const promise = this.executeFix(strategy, plan.featureId);
|
|
141
|
+
inProgress.set(strategy.id, promise);
|
|
142
|
+
|
|
143
|
+
// Remove from queue
|
|
144
|
+
const index = queue.findIndex((s) => s.id === strategy.id);
|
|
145
|
+
if (index >= 0) queue.splice(index, 1);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
// Wait for at least one to complete
|
|
149
|
+
if (inProgress.size > 0) {
|
|
150
|
+
const completed = await Promise.race(inProgress.values());
|
|
151
|
+
results.push(completed);
|
|
152
|
+
inProgress.delete(completed.id);
|
|
153
|
+
|
|
154
|
+
this.emit('fix:completed', { fix: completed });
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
// Store results
|
|
159
|
+
this.fixHistory.set(plan.featureId, results);
|
|
160
|
+
|
|
161
|
+
return results;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* Analyze failures and group by category
|
|
166
|
+
*/
|
|
167
|
+
private categorizeFailures(failures: TestFailure[]): Map<string, TestFailure[]> {
|
|
168
|
+
const categories = new Map<string, TestFailure[]>();
|
|
169
|
+
|
|
170
|
+
for (const failure of failures) {
|
|
171
|
+
const category = this.determineFailureCategory(failure);
|
|
172
|
+
if (!categories.has(category)) {
|
|
173
|
+
categories.set(category, []);
|
|
174
|
+
}
|
|
175
|
+
categories.get(category)!.push(failure);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
return categories;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* Determine failure category from patterns
|
|
183
|
+
*/
|
|
184
|
+
private determineFailureCategory(failure: TestFailure): string {
|
|
185
|
+
const error = failure.error.toLowerCase();
|
|
186
|
+
|
|
187
|
+
// API/Backend failures
|
|
188
|
+
if (error.includes('api') || error.includes('endpoint') || error.includes('status code')) {
|
|
189
|
+
return 'backend-api';
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
// Database failures
|
|
193
|
+
if (error.includes('database') || error.includes('query') || error.includes('connection')) {
|
|
194
|
+
return 'database';
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
// UI/Frontend failures
|
|
198
|
+
if (error.includes('render') || error.includes('component') || error.includes('dom')) {
|
|
199
|
+
return 'frontend-ui';
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
// State management failures
|
|
203
|
+
if (error.includes('state') || error.includes('store') || error.includes('reducer')) {
|
|
204
|
+
return 'state-management';
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
// Integration failures
|
|
208
|
+
if (error.includes('integration') || error.includes('e2e')) {
|
|
209
|
+
return 'integration';
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
// Performance failures
|
|
213
|
+
if (error.includes('timeout') || error.includes('performance') || error.includes('slow')) {
|
|
214
|
+
return 'performance';
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
// Security failures
|
|
218
|
+
if (error.includes('auth') || error.includes('security') || error.includes('permission')) {
|
|
219
|
+
return 'security';
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
return 'unknown';
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
/**
|
|
226
|
+
* Create fix strategy for a specific failure
|
|
227
|
+
*/
|
|
228
|
+
private async createFixStrategy(failure: TestFailure): Promise<FixStrategy> {
|
|
229
|
+
const category = this.determineFailureCategory(failure);
|
|
230
|
+
|
|
231
|
+
// Check for known patterns
|
|
232
|
+
const pattern = this.fixPatterns.get(category);
|
|
233
|
+
|
|
234
|
+
// Assign to appropriate agent based on layer and category
|
|
235
|
+
const assignedAgent = this.assignAgentForFix(failure, category);
|
|
236
|
+
|
|
237
|
+
// Determine strategy type
|
|
238
|
+
const strategyType = this.determineStrategyType(failure, pattern);
|
|
239
|
+
|
|
240
|
+
// Generate steps
|
|
241
|
+
const steps = this.generateFixSteps(failure, strategyType, pattern);
|
|
242
|
+
|
|
243
|
+
const strategy: FixStrategy = {
|
|
244
|
+
id: `fix_${failure.id}`,
|
|
245
|
+
failureId: failure.id,
|
|
246
|
+
strategy: strategyType,
|
|
247
|
+
assignedAgent,
|
|
248
|
+
description: `Fix ${category} issue in ${failure.testName}`,
|
|
249
|
+
steps,
|
|
250
|
+
estimatedEffort: this.estimateFixEffort(failure, strategyType),
|
|
251
|
+
confidence: pattern ? pattern.successRate : 0.5,
|
|
252
|
+
alternatives: pattern?.commonSolutions || [],
|
|
253
|
+
};
|
|
254
|
+
|
|
255
|
+
return strategy;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
/**
|
|
259
|
+
* Assign agent based on failure characteristics
|
|
260
|
+
*/
|
|
261
|
+
private assignAgentForFix(failure: TestFailure, category: string): FullStackAgentType {
|
|
262
|
+
// Layer-based assignment
|
|
263
|
+
if (failure.layer === 'frontend') {
|
|
264
|
+
if (category === 'frontend-ui') return 'frontend-developer';
|
|
265
|
+
if (category === 'state-management') return 'frontend-developer';
|
|
266
|
+
if (category === 'performance') return 'performance-tester';
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
if (failure.layer === 'backend') {
|
|
270
|
+
if (category === 'backend-api') return 'backend-developer';
|
|
271
|
+
if (category === 'database') return 'database-developer';
|
|
272
|
+
if (category === 'performance') return 'performance-tester';
|
|
273
|
+
if (category === 'security') return 'security-tester';
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
if (failure.layer === 'integration') {
|
|
277
|
+
return 'integration-specialist';
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
// Category-based fallback
|
|
281
|
+
if (category === 'database') return 'database-developer';
|
|
282
|
+
if (category === 'security') return 'security-tester';
|
|
283
|
+
if (category === 'performance') return 'performance-tester';
|
|
284
|
+
|
|
285
|
+
// Default based on test category
|
|
286
|
+
if (failure.category === 'unit') return 'coder';
|
|
287
|
+
if (failure.category === 'integration') return 'integration-specialist';
|
|
288
|
+
if (failure.category === 'e2e') return 'e2e-tester';
|
|
289
|
+
|
|
290
|
+
return 'coder'; // fallback
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
/**
|
|
294
|
+
* Determine fix strategy type
|
|
295
|
+
*/
|
|
296
|
+
private determineStrategyType(
|
|
297
|
+
failure: TestFailure,
|
|
298
|
+
pattern?: FixPattern,
|
|
299
|
+
): FixStrategy['strategy'] {
|
|
300
|
+
// Critical failures often need redesign
|
|
301
|
+
if (failure.severity === 'critical') {
|
|
302
|
+
return 'refactor';
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
// Use pattern success rate to determine strategy
|
|
306
|
+
if (pattern && pattern.successRate > 0.8) {
|
|
307
|
+
return 'quick-fix';
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
// Complex failures need refactoring
|
|
311
|
+
if (failure.affectedComponents.length > 3) {
|
|
312
|
+
return 'refactor';
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
// Low priority can use workarounds
|
|
316
|
+
if (failure.severity === 'low') {
|
|
317
|
+
return 'workaround';
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
return 'quick-fix';
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
/**
|
|
324
|
+
* Generate fix steps based on failure and strategy
|
|
325
|
+
*/
|
|
326
|
+
private generateFixSteps(
|
|
327
|
+
failure: TestFailure,
|
|
328
|
+
strategy: FixStrategy['strategy'],
|
|
329
|
+
pattern?: FixPattern,
|
|
330
|
+
): string[] {
|
|
331
|
+
const steps: string[] = [];
|
|
332
|
+
|
|
333
|
+
// Common first steps
|
|
334
|
+
steps.push('Analyze failure root cause');
|
|
335
|
+
steps.push('Review affected code components');
|
|
336
|
+
|
|
337
|
+
// Strategy-specific steps
|
|
338
|
+
if (strategy === 'quick-fix') {
|
|
339
|
+
steps.push('Implement targeted fix');
|
|
340
|
+
steps.push('Add/update unit tests');
|
|
341
|
+
} else if (strategy === 'refactor') {
|
|
342
|
+
steps.push('Design refactoring approach');
|
|
343
|
+
steps.push('Implement refactored code');
|
|
344
|
+
steps.push('Update comprehensive tests');
|
|
345
|
+
} else if (strategy === 'redesign') {
|
|
346
|
+
steps.push('Redesign affected architecture');
|
|
347
|
+
steps.push('Implement new design');
|
|
348
|
+
steps.push('Create comprehensive test suite');
|
|
349
|
+
} else if (strategy === 'workaround') {
|
|
350
|
+
steps.push('Implement temporary workaround');
|
|
351
|
+
steps.push('Document technical debt');
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
// Common final steps
|
|
355
|
+
steps.push('Validate fix with local tests');
|
|
356
|
+
steps.push('Submit for regression testing');
|
|
357
|
+
|
|
358
|
+
return steps;
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
/**
|
|
362
|
+
* Prioritize fixes based on severity and impact
|
|
363
|
+
*/
|
|
364
|
+
private prioritizeFixes(
|
|
365
|
+
failures: TestFailure[],
|
|
366
|
+
strategies: FixStrategy[],
|
|
367
|
+
): FixPriority[] {
|
|
368
|
+
return failures.map((failure) => {
|
|
369
|
+
const strategy = strategies.find((s) => s.failureId === failure.id);
|
|
370
|
+
|
|
371
|
+
let priority = 50; // base priority
|
|
372
|
+
|
|
373
|
+
// Severity adjustment
|
|
374
|
+
if (failure.severity === 'critical') priority += 40;
|
|
375
|
+
else if (failure.severity === 'high') priority += 25;
|
|
376
|
+
else if (failure.severity === 'medium') priority += 10;
|
|
377
|
+
|
|
378
|
+
// Layer adjustment (backend is often blocking)
|
|
379
|
+
if (failure.layer === 'backend') priority += 15;
|
|
380
|
+
else if (failure.layer === 'integration') priority += 10;
|
|
381
|
+
|
|
382
|
+
// Category adjustment
|
|
383
|
+
if (failure.category === 'e2e') priority += 10;
|
|
384
|
+
|
|
385
|
+
// Component impact
|
|
386
|
+
priority += Math.min(failure.affectedComponents.length * 5, 20);
|
|
387
|
+
|
|
388
|
+
return {
|
|
389
|
+
failureId: failure.id,
|
|
390
|
+
priority: Math.min(priority, 100),
|
|
391
|
+
reasoning: `Priority based on ${failure.severity} severity, ${failure.layer} layer, ${failure.affectedComponents.length} affected components`,
|
|
392
|
+
blocking: failure.severity === 'critical' || failure.layer === 'backend',
|
|
393
|
+
};
|
|
394
|
+
});
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
/**
|
|
398
|
+
* Identify dependencies between fixes
|
|
399
|
+
*/
|
|
400
|
+
private identifyFixDependencies(strategies: FixStrategy[]): Map<string, string[]> {
|
|
401
|
+
const dependencies = new Map<string, string[]>();
|
|
402
|
+
|
|
403
|
+
// Simple dependency detection based on affected components
|
|
404
|
+
for (const strategy of strategies) {
|
|
405
|
+
const deps: string[] = [];
|
|
406
|
+
|
|
407
|
+
// Backend fixes should complete before frontend fixes
|
|
408
|
+
if (strategy.assignedAgent === 'frontend-developer') {
|
|
409
|
+
const backendFixes = strategies.filter(
|
|
410
|
+
(s) => s.assignedAgent === 'backend-developer' || s.assignedAgent === 'api-developer',
|
|
411
|
+
);
|
|
412
|
+
deps.push(...backendFixes.map((f) => f.id));
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
// Database fixes should complete before backend fixes
|
|
416
|
+
if (strategy.assignedAgent === 'backend-developer') {
|
|
417
|
+
const dbFixes = strategies.filter((s) => s.assignedAgent === 'database-developer');
|
|
418
|
+
deps.push(...dbFixes.map((f) => f.id));
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
if (deps.length > 0) {
|
|
422
|
+
dependencies.set(strategy.id, deps);
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
return dependencies;
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
/**
|
|
430
|
+
* Estimate total plan duration considering dependencies
|
|
431
|
+
*/
|
|
432
|
+
private estimatePlanDuration(
|
|
433
|
+
strategies: FixStrategy[],
|
|
434
|
+
dependencies: Map<string, string[]>,
|
|
435
|
+
): number {
|
|
436
|
+
// Critical path calculation
|
|
437
|
+
const strategyMap = new Map(strategies.map((s) => [s.id, s]));
|
|
438
|
+
const visited = new Set<string>();
|
|
439
|
+
let maxDuration = 0;
|
|
440
|
+
|
|
441
|
+
const calculatePath = (strategyId: string): number => {
|
|
442
|
+
if (visited.has(strategyId)) return 0;
|
|
443
|
+
visited.add(strategyId);
|
|
444
|
+
|
|
445
|
+
const strategy = strategyMap.get(strategyId);
|
|
446
|
+
if (!strategy) return 0;
|
|
447
|
+
|
|
448
|
+
const deps = dependencies.get(strategyId) || [];
|
|
449
|
+
const depDuration = Math.max(...deps.map((d) => calculatePath(d)), 0);
|
|
450
|
+
|
|
451
|
+
return depDuration + strategy.estimatedEffort;
|
|
452
|
+
};
|
|
453
|
+
|
|
454
|
+
for (const strategy of strategies) {
|
|
455
|
+
const duration = calculatePath(strategy.id);
|
|
456
|
+
maxDuration = Math.max(maxDuration, duration);
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
return maxDuration * 60 * 1000; // convert to milliseconds
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
/**
|
|
463
|
+
* Get next executable strategy respecting dependencies
|
|
464
|
+
*/
|
|
465
|
+
private getNextExecutableStrategy(
|
|
466
|
+
queue: FixStrategy[],
|
|
467
|
+
inProgress: Map<string, Promise<FixExecutionResult>>,
|
|
468
|
+
dependencies: Map<string, string[]>,
|
|
469
|
+
): FixStrategy | null {
|
|
470
|
+
for (const strategy of queue) {
|
|
471
|
+
const deps = dependencies.get(strategy.id) || [];
|
|
472
|
+
|
|
473
|
+
// Check if all dependencies are completed
|
|
474
|
+
const allDepsCompleted = deps.every((depId) => !inProgress.has(depId));
|
|
475
|
+
|
|
476
|
+
if (allDepsCompleted) {
|
|
477
|
+
return strategy;
|
|
478
|
+
}
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
return null;
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
/**
|
|
485
|
+
* Execute individual fix
|
|
486
|
+
*/
|
|
487
|
+
private async executeFix(
|
|
488
|
+
strategy: FixStrategy,
|
|
489
|
+
featureId: string,
|
|
490
|
+
): Promise<FixExecutionResult> {
|
|
491
|
+
const startTime = new Date().toISOString();
|
|
492
|
+
|
|
493
|
+
const result: FixExecutionResult = {
|
|
494
|
+
id: strategy.id,
|
|
495
|
+
failureId: strategy.failureId,
|
|
496
|
+
assignedAgent: strategy.assignedAgent,
|
|
497
|
+
strategy: strategy.strategy,
|
|
498
|
+
startTime,
|
|
499
|
+
status: 'active',
|
|
500
|
+
changes: [],
|
|
501
|
+
validation: {
|
|
502
|
+
passed: false,
|
|
503
|
+
testsPassed: 0,
|
|
504
|
+
testsFailed: 0,
|
|
505
|
+
regressionDetected: false,
|
|
506
|
+
issues: [],
|
|
507
|
+
},
|
|
508
|
+
};
|
|
509
|
+
|
|
510
|
+
this.activeFixe.set(strategy.id, result);
|
|
511
|
+
|
|
512
|
+
try {
|
|
513
|
+
this.logger.info('Executing fix', {
|
|
514
|
+
fixId: strategy.id,
|
|
515
|
+
agent: strategy.assignedAgent,
|
|
516
|
+
strategy: strategy.strategy,
|
|
517
|
+
});
|
|
518
|
+
|
|
519
|
+
// Simulate fix execution (in production, delegate to actual agent)
|
|
520
|
+
const changes = await this.simulateFixExecution(strategy);
|
|
521
|
+
result.changes = changes;
|
|
522
|
+
|
|
523
|
+
// Validate fix
|
|
524
|
+
const validation = await this.validateFix(strategy, changes);
|
|
525
|
+
result.validation = validation;
|
|
526
|
+
|
|
527
|
+
if (validation.passed) {
|
|
528
|
+
result.status = 'completed';
|
|
529
|
+
|
|
530
|
+
// Learn from successful fix
|
|
531
|
+
await this.learnFromFix(strategy, result);
|
|
532
|
+
} else {
|
|
533
|
+
result.status = 'failed';
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
result.endTime = new Date().toISOString();
|
|
537
|
+
|
|
538
|
+
// Store in memory
|
|
539
|
+
await this.memory.remember('fix-coordinator', 'result', result, {
|
|
540
|
+
tags: ['fix-result', featureId, strategy.assignedAgent],
|
|
541
|
+
shareLevel: 'team',
|
|
542
|
+
});
|
|
543
|
+
|
|
544
|
+
this.activeFixe.delete(strategy.id);
|
|
545
|
+
|
|
546
|
+
return result;
|
|
547
|
+
} catch (error) {
|
|
548
|
+
this.logger.error('Fix execution failed', { error, fixId: strategy.id });
|
|
549
|
+
result.status = 'failed';
|
|
550
|
+
result.endTime = new Date().toISOString();
|
|
551
|
+
result.validation.issues.push(error.message);
|
|
552
|
+
this.activeFixe.delete(strategy.id);
|
|
553
|
+
return result;
|
|
554
|
+
}
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
/**
|
|
558
|
+
* Simulate fix execution (placeholder for real agent work)
|
|
559
|
+
*/
|
|
560
|
+
private async simulateFixExecution(strategy: FixStrategy): Promise<CodeChange[]> {
|
|
561
|
+
// In production, this would delegate to the assigned agent
|
|
562
|
+
return [
|
|
563
|
+
{
|
|
564
|
+
file: 'src/component.ts',
|
|
565
|
+
type: 'modify',
|
|
566
|
+
linesChanged: 15,
|
|
567
|
+
description: `Applied ${strategy.strategy} for ${strategy.description}`,
|
|
568
|
+
},
|
|
569
|
+
];
|
|
570
|
+
}
|
|
571
|
+
|
|
572
|
+
/**
|
|
573
|
+
* Validate fix effectiveness
|
|
574
|
+
*/
|
|
575
|
+
private async validateFix(strategy: FixStrategy, changes: CodeChange[]): Promise<ValidationResult> {
|
|
576
|
+
// In production, run targeted tests to validate the fix
|
|
577
|
+
return {
|
|
578
|
+
passed: true,
|
|
579
|
+
testsPassed: 10,
|
|
580
|
+
testsFailed: 0,
|
|
581
|
+
regressionDetected: false,
|
|
582
|
+
issues: [],
|
|
583
|
+
};
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
/**
|
|
587
|
+
* Learn from successful fixes to improve pattern matching
|
|
588
|
+
*/
|
|
589
|
+
private async learnFromFix(strategy: FixStrategy, result: FixExecutionResult): Promise<void> {
|
|
590
|
+
const category = this.determineFailureCategory({
|
|
591
|
+
id: strategy.failureId,
|
|
592
|
+
error: strategy.description,
|
|
593
|
+
} as TestFailure);
|
|
594
|
+
|
|
595
|
+
let pattern = this.fixPatterns.get(category);
|
|
596
|
+
|
|
597
|
+
if (!pattern) {
|
|
598
|
+
pattern = {
|
|
599
|
+
pattern: category,
|
|
600
|
+
category,
|
|
601
|
+
successRate: 0,
|
|
602
|
+
averageTime: 0,
|
|
603
|
+
bestAgent: strategy.assignedAgent,
|
|
604
|
+
commonSolutions: [],
|
|
605
|
+
};
|
|
606
|
+
}
|
|
607
|
+
|
|
608
|
+
// Update success rate
|
|
609
|
+
const totalFixes = (pattern.successRate * 100) + 1;
|
|
610
|
+
pattern.successRate = ((pattern.successRate * 100) + 1) / totalFixes;
|
|
611
|
+
|
|
612
|
+
// Update average time
|
|
613
|
+
const duration = new Date(result.endTime!).getTime() - new Date(result.startTime).getTime();
|
|
614
|
+
pattern.averageTime = (pattern.averageTime + duration) / 2;
|
|
615
|
+
|
|
616
|
+
this.fixPatterns.set(category, pattern);
|
|
617
|
+
}
|
|
618
|
+
|
|
619
|
+
/**
|
|
620
|
+
* Estimate fix effort based on failure characteristics
|
|
621
|
+
*/
|
|
622
|
+
private estimateFixEffort(failure: TestFailure, strategy: FixStrategy['strategy']): number {
|
|
623
|
+
let baseEffort = 15; // minutes
|
|
624
|
+
|
|
625
|
+
// Strategy multiplier
|
|
626
|
+
if (strategy === 'quick-fix') baseEffort *= 1;
|
|
627
|
+
else if (strategy === 'refactor') baseEffort *= 2;
|
|
628
|
+
else if (strategy === 'redesign') baseEffort *= 4;
|
|
629
|
+
else if (strategy === 'workaround') baseEffort *= 0.5;
|
|
630
|
+
|
|
631
|
+
// Severity multiplier
|
|
632
|
+
if (failure.severity === 'critical') baseEffort *= 1.5;
|
|
633
|
+
else if (failure.severity === 'low') baseEffort *= 0.7;
|
|
634
|
+
|
|
635
|
+
// Component complexity
|
|
636
|
+
baseEffort += failure.affectedComponents.length * 5;
|
|
637
|
+
|
|
638
|
+
return Math.round(baseEffort);
|
|
639
|
+
}
|
|
640
|
+
|
|
641
|
+
/**
|
|
642
|
+
* Load fix patterns from memory
|
|
643
|
+
*/
|
|
644
|
+
private async loadFixPatterns(): Promise<void> {
|
|
645
|
+
try {
|
|
646
|
+
const patterns = await this.memory.recall({
|
|
647
|
+
type: 'knowledge',
|
|
648
|
+
tags: ['fix-pattern'],
|
|
649
|
+
limit: 100,
|
|
650
|
+
});
|
|
651
|
+
|
|
652
|
+
for (const entry of patterns) {
|
|
653
|
+
if (entry.content.pattern) {
|
|
654
|
+
this.fixPatterns.set(entry.content.pattern, entry.content);
|
|
655
|
+
}
|
|
656
|
+
}
|
|
657
|
+
|
|
658
|
+
this.logger.info('Loaded fix patterns', { count: this.fixPatterns.size });
|
|
659
|
+
} catch (error) {
|
|
660
|
+
this.logger.warn('Failed to load fix patterns', { error });
|
|
661
|
+
}
|
|
662
|
+
}
|
|
663
|
+
|
|
664
|
+
/**
|
|
665
|
+
* Get fix execution status
|
|
666
|
+
*/
|
|
667
|
+
getActiveFixes(): FixExecutionResult[] {
|
|
668
|
+
return Array.from(this.activeFixe.values());
|
|
669
|
+
}
|
|
670
|
+
|
|
671
|
+
/**
|
|
672
|
+
* Get fix history for feature
|
|
673
|
+
*/
|
|
674
|
+
getFixHistory(featureId: string): FixExecutionResult[] {
|
|
675
|
+
return this.fixHistory.get(featureId) || [];
|
|
676
|
+
}
|
|
677
|
+
}
|