claude-flow-novice 1.0.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/MIGRATION_SUMMARY.md +222 -0
- package/.claude/agents/README.md +89 -0
- package/.claude/agents/analysis/code-analyzer.md +209 -0
- package/.claude/agents/analysis/code-review/analyze-code-quality.md +180 -0
- package/.claude/agents/architecture/system-design/arch-system-design.md +156 -0
- package/.claude/agents/base-template-generator.md +42 -0
- package/.claude/agents/consensus/README.md +253 -0
- package/.claude/agents/consensus/byzantine-coordinator.md +63 -0
- package/.claude/agents/consensus/consensus-builder.md +242 -0
- package/.claude/agents/consensus/crdt-synchronizer.md +997 -0
- package/.claude/agents/consensus/gossip-coordinator.md +63 -0
- package/.claude/agents/consensus/performance-benchmarker.md +851 -0
- package/.claude/agents/consensus/quorum-manager.md +823 -0
- package/.claude/agents/consensus/raft-manager.md +63 -0
- package/.claude/agents/consensus/security-manager.md +622 -0
- package/.claude/agents/core/coder.md +211 -0
- package/.claude/agents/core/planner.md +116 -0
- package/.claude/agents/core/researcher.md +136 -0
- package/.claude/agents/core/reviewer.md +272 -0
- package/.claude/agents/core/tester.md +266 -0
- package/.claude/agents/data/ml/data-ml-model.md +193 -0
- package/.claude/agents/development/backend/dev-backend-api.md +142 -0
- package/.claude/agents/devops/ci-cd/ops-cicd-github.md +164 -0
- package/.claude/agents/documentation/api-docs/docs-api-openapi.md +174 -0
- package/.claude/agents/flow-nexus/app-store.md +88 -0
- package/.claude/agents/flow-nexus/authentication.md +69 -0
- package/.claude/agents/flow-nexus/challenges.md +81 -0
- package/.claude/agents/flow-nexus/neural-network.md +88 -0
- package/.claude/agents/flow-nexus/payments.md +83 -0
- package/.claude/agents/flow-nexus/sandbox.md +76 -0
- package/.claude/agents/flow-nexus/swarm.md +76 -0
- package/.claude/agents/flow-nexus/user-tools.md +96 -0
- package/.claude/agents/flow-nexus/workflow.md +84 -0
- package/.claude/agents/github/code-review-swarm.md +538 -0
- package/.claude/agents/github/github-modes.md +173 -0
- package/.claude/agents/github/issue-tracker.md +319 -0
- package/.claude/agents/github/multi-repo-swarm.md +553 -0
- package/.claude/agents/github/pr-manager.md +191 -0
- package/.claude/agents/github/project-board-sync.md +509 -0
- package/.claude/agents/github/release-manager.md +367 -0
- package/.claude/agents/github/release-swarm.md +583 -0
- package/.claude/agents/github/repo-architect.md +398 -0
- package/.claude/agents/github/swarm-issue.md +573 -0
- package/.claude/agents/github/swarm-pr.md +428 -0
- package/.claude/agents/github/sync-coordinator.md +452 -0
- package/.claude/agents/github/workflow-automation.md +635 -0
- package/.claude/agents/goal/goal-planner.md +73 -0
- package/.claude/agents/neural/safla-neural.md +74 -0
- package/.claude/agents/optimization/README.md +250 -0
- package/.claude/agents/optimization/benchmark-suite.md +665 -0
- package/.claude/agents/optimization/load-balancer.md +431 -0
- package/.claude/agents/optimization/performance-monitor.md +672 -0
- package/.claude/agents/optimization/resource-allocator.md +674 -0
- package/.claude/agents/optimization/topology-optimizer.md +808 -0
- package/.claude/agents/sparc/architecture.md +472 -0
- package/.claude/agents/sparc/pseudocode.md +318 -0
- package/.claude/agents/sparc/refinement.md +525 -0
- package/.claude/agents/sparc/specification.md +276 -0
- package/.claude/agents/specialized/mobile/spec-mobile-react-native.md +226 -0
- package/.claude/agents/sublinear/consciousness-evolution-agent.md +499 -0
- package/.claude/agents/sublinear/matrix-solver-agent.md +113 -0
- package/.claude/agents/sublinear/nanosecond-scheduler-agent.md +644 -0
- package/.claude/agents/sublinear/pagerank-agent.md +699 -0
- package/.claude/agents/sublinear/phi-calculator-agent.md +749 -0
- package/.claude/agents/sublinear/psycho-symbolic-agent.md +543 -0
- package/.claude/agents/sublinear/sublinear.md +816 -0
- package/.claude/agents/sublinear/temporal-advantage-agent.md +360 -0
- package/.claude/agents/swarm/README.md +190 -0
- package/.claude/agents/swarm/adaptive-coordinator.md +396 -0
- package/.claude/agents/swarm/hierarchical-coordinator.md +300 -0
- package/.claude/agents/swarm/mesh-coordinator.md +435 -0
- package/.claude/agents/templates/automation-smart-agent.md +205 -0
- package/.claude/agents/templates/coordinator-swarm-init.md +90 -0
- package/.claude/agents/templates/github-pr-manager.md +177 -0
- package/.claude/agents/templates/implementer-sparc-coder.md +259 -0
- package/.claude/agents/templates/memory-coordinator.md +187 -0
- package/.claude/agents/templates/migration-plan.md +746 -0
- package/.claude/agents/templates/orchestrator-task.md +139 -0
- package/.claude/agents/templates/performance-analyzer.md +199 -0
- package/.claude/agents/templates/sparc-coordinator.md +183 -0
- package/.claude/agents/testing/e2e/playwright-agent.md +249 -0
- package/.claude/agents/testing/unit/tdd-london-swarm.md +244 -0
- package/.claude/agents/testing/validation/production-validator.md +395 -0
- package/.claude/commands/agents/README.md +10 -0
- package/.claude/commands/agents/agent-capabilities.md +21 -0
- package/.claude/commands/agents/agent-coordination.md +28 -0
- package/.claude/commands/agents/agent-spawning.md +28 -0
- package/.claude/commands/agents/agent-types.md +26 -0
- package/.claude/commands/analysis/COMMAND_COMPLIANCE_REPORT.md +54 -0
- package/.claude/commands/analysis/README.md +9 -0
- package/.claude/commands/analysis/bottleneck-detect.md +162 -0
- package/.claude/commands/analysis/performance-bottlenecks.md +59 -0
- package/.claude/commands/analysis/performance-report.md +25 -0
- package/.claude/commands/analysis/token-efficiency.md +45 -0
- package/.claude/commands/analysis/token-usage.md +25 -0
- package/.claude/commands/automation/README.md +9 -0
- package/.claude/commands/automation/auto-agent.md +122 -0
- package/.claude/commands/automation/self-healing.md +106 -0
- package/.claude/commands/automation/session-memory.md +90 -0
- package/.claude/commands/automation/smart-agents.md +73 -0
- package/.claude/commands/automation/smart-spawn.md +25 -0
- package/.claude/commands/automation/workflow-select.md +25 -0
- package/.claude/commands/coordination/README.md +9 -0
- package/.claude/commands/coordination/agent-spawn.md +25 -0
- package/.claude/commands/coordination/init.md +44 -0
- package/.claude/commands/coordination/orchestrate.md +43 -0
- package/.claude/commands/coordination/spawn.md +45 -0
- package/.claude/commands/coordination/swarm-init.md +85 -0
- package/.claude/commands/coordination/task-orchestrate.md +25 -0
- package/.claude/commands/flow-nexus/app-store.md +124 -0
- package/.claude/commands/flow-nexus/challenges.md +120 -0
- package/.claude/commands/flow-nexus/login-registration.md +65 -0
- package/.claude/commands/flow-nexus/neural-network.md +134 -0
- package/.claude/commands/flow-nexus/payments.md +116 -0
- package/.claude/commands/flow-nexus/sandbox.md +83 -0
- package/.claude/commands/flow-nexus/swarm.md +87 -0
- package/.claude/commands/flow-nexus/user-tools.md +152 -0
- package/.claude/commands/flow-nexus/workflow.md +115 -0
- package/.claude/commands/github/README.md +11 -0
- package/.claude/commands/github/code-review-swarm.md +514 -0
- package/.claude/commands/github/code-review.md +25 -0
- package/.claude/commands/github/github-modes.md +147 -0
- package/.claude/commands/github/github-swarm.md +121 -0
- package/.claude/commands/github/issue-tracker.md +292 -0
- package/.claude/commands/github/issue-triage.md +25 -0
- package/.claude/commands/github/multi-repo-swarm.md +519 -0
- package/.claude/commands/github/pr-enhance.md +26 -0
- package/.claude/commands/github/pr-manager.md +170 -0
- package/.claude/commands/github/project-board-sync.md +471 -0
- package/.claude/commands/github/release-manager.md +338 -0
- package/.claude/commands/github/release-swarm.md +544 -0
- package/.claude/commands/github/repo-analyze.md +25 -0
- package/.claude/commands/github/repo-architect.md +367 -0
- package/.claude/commands/github/swarm-issue.md +482 -0
- package/.claude/commands/github/swarm-pr.md +285 -0
- package/.claude/commands/github/sync-coordinator.md +301 -0
- package/.claude/commands/github/workflow-automation.md +442 -0
- package/.claude/commands/hive-mind/README.md +17 -0
- package/.claude/commands/hive-mind/hive-mind-consensus.md +8 -0
- package/.claude/commands/hive-mind/hive-mind-init.md +18 -0
- package/.claude/commands/hive-mind/hive-mind-memory.md +8 -0
- package/.claude/commands/hive-mind/hive-mind-metrics.md +8 -0
- package/.claude/commands/hive-mind/hive-mind-resume.md +8 -0
- package/.claude/commands/hive-mind/hive-mind-sessions.md +8 -0
- package/.claude/commands/hive-mind/hive-mind-spawn.md +21 -0
- package/.claude/commands/hive-mind/hive-mind-status.md +8 -0
- package/.claude/commands/hive-mind/hive-mind-stop.md +8 -0
- package/.claude/commands/hive-mind/hive-mind-wizard.md +8 -0
- package/.claude/commands/hive-mind/hive-mind.md +27 -0
- package/.claude/commands/hooks/README.md +11 -0
- package/.claude/commands/hooks/overview.md +58 -0
- package/.claude/commands/hooks/post-edit.md +117 -0
- package/.claude/commands/hooks/post-task.md +112 -0
- package/.claude/commands/hooks/pre-edit.md +113 -0
- package/.claude/commands/hooks/pre-task.md +111 -0
- package/.claude/commands/hooks/session-end.md +118 -0
- package/.claude/commands/hooks/setup.md +103 -0
- package/.claude/commands/memory/README.md +9 -0
- package/.claude/commands/memory/memory-persist.md +25 -0
- package/.claude/commands/memory/memory-search.md +25 -0
- package/.claude/commands/memory/memory-usage.md +25 -0
- package/.claude/commands/memory/neural.md +47 -0
- package/.claude/commands/memory/usage.md +46 -0
- package/.claude/commands/monitoring/README.md +9 -0
- package/.claude/commands/monitoring/agent-metrics.md +25 -0
- package/.claude/commands/monitoring/agents.md +44 -0
- package/.claude/commands/monitoring/real-time-view.md +25 -0
- package/.claude/commands/monitoring/status.md +46 -0
- package/.claude/commands/monitoring/swarm-monitor.md +25 -0
- package/.claude/commands/optimization/README.md +9 -0
- package/.claude/commands/optimization/auto-topology.md +62 -0
- package/.claude/commands/optimization/cache-manage.md +25 -0
- package/.claude/commands/optimization/parallel-execute.md +25 -0
- package/.claude/commands/optimization/parallel-execution.md +50 -0
- package/.claude/commands/optimization/topology-optimize.md +25 -0
- package/.claude/commands/pair/README.md +261 -0
- package/.claude/commands/pair/commands.md +546 -0
- package/.claude/commands/pair/config.md +510 -0
- package/.claude/commands/pair/examples.md +512 -0
- package/.claude/commands/pair/modes.md +348 -0
- package/.claude/commands/pair/session.md +407 -0
- package/.claude/commands/pair/start.md +209 -0
- package/.claude/commands/sparc/analyzer.md +52 -0
- package/.claude/commands/sparc/architect.md +53 -0
- package/.claude/commands/sparc/batch-executor.md +54 -0
- package/.claude/commands/sparc/coder.md +54 -0
- package/.claude/commands/sparc/debugger.md +54 -0
- package/.claude/commands/sparc/designer.md +53 -0
- package/.claude/commands/sparc/documenter.md +54 -0
- package/.claude/commands/sparc/innovator.md +54 -0
- package/.claude/commands/sparc/memory-manager.md +54 -0
- package/.claude/commands/sparc/optimizer.md +54 -0
- package/.claude/commands/sparc/orchestrator.md +132 -0
- package/.claude/commands/sparc/researcher.md +54 -0
- package/.claude/commands/sparc/reviewer.md +54 -0
- package/.claude/commands/sparc/sparc-modes.md +174 -0
- package/.claude/commands/sparc/swarm-coordinator.md +54 -0
- package/.claude/commands/sparc/tdd.md +54 -0
- package/.claude/commands/sparc/tester.md +54 -0
- package/.claude/commands/sparc/workflow-manager.md +54 -0
- package/.claude/commands/stream-chain/pipeline.md +121 -0
- package/.claude/commands/stream-chain/run.md +70 -0
- package/.claude/commands/swarm/README.md +15 -0
- package/.claude/commands/swarm/analysis.md +95 -0
- package/.claude/commands/swarm/development.md +96 -0
- package/.claude/commands/swarm/examples.md +168 -0
- package/.claude/commands/swarm/maintenance.md +102 -0
- package/.claude/commands/swarm/optimization.md +117 -0
- package/.claude/commands/swarm/research.md +136 -0
- package/.claude/commands/swarm/swarm-analysis.md +8 -0
- package/.claude/commands/swarm/swarm-background.md +8 -0
- package/.claude/commands/swarm/swarm-init.md +19 -0
- package/.claude/commands/swarm/swarm-modes.md +8 -0
- package/.claude/commands/swarm/swarm-monitor.md +8 -0
- package/.claude/commands/swarm/swarm-spawn.md +19 -0
- package/.claude/commands/swarm/swarm-status.md +8 -0
- package/.claude/commands/swarm/swarm-strategies.md +8 -0
- package/.claude/commands/swarm/swarm.md +27 -0
- package/.claude/commands/swarm/testing.md +131 -0
- package/.claude/commands/testing/playwright-e2e.md +288 -0
- package/.claude/commands/training/README.md +9 -0
- package/.claude/commands/training/model-update.md +25 -0
- package/.claude/commands/training/neural-patterns.md +74 -0
- package/.claude/commands/training/neural-train.md +25 -0
- package/.claude/commands/training/pattern-learn.md +25 -0
- package/.claude/commands/training/specialization.md +63 -0
- package/.claude/commands/truth/start.md +143 -0
- package/.claude/commands/verify/check.md +50 -0
- package/.claude/commands/verify/start.md +128 -0
- package/.claude/commands/workflows/README.md +9 -0
- package/.claude/commands/workflows/development.md +78 -0
- package/.claude/commands/workflows/research.md +63 -0
- package/.claude/commands/workflows/workflow-create.md +25 -0
- package/.claude/commands/workflows/workflow-execute.md +25 -0
- package/.claude/commands/workflows/workflow-export.md +25 -0
- package/.claude/helpers/checkpoint-manager.sh +251 -0
- package/.claude/helpers/github-safe.js +106 -0
- package/.claude/helpers/github-setup.sh +28 -0
- package/.claude/helpers/quick-start.sh +19 -0
- package/.claude/helpers/setup-mcp.sh +18 -0
- package/.claude/helpers/standard-checkpoint-hooks.sh +179 -0
- package/.claude/settings.json +112 -0
- package/.claude/settings.local.json +10 -0
- package/CHANGELOG.md +1517 -0
- package/LICENSE +21 -0
- package/README.md +338 -0
- package/dist/src/adapters/cliffy-node.js +70 -0
- package/dist/src/adapters/cliffy-node.js.map +1 -0
- package/dist/src/agents/agent-loader.js +208 -0
- package/dist/src/agents/agent-loader.js.map +1 -0
- package/dist/src/agents/agent-manager.js +1786 -0
- package/dist/src/agents/agent-manager.js.map +1 -0
- package/dist/src/agents/agent-registry.js +356 -0
- package/dist/src/agents/agent-registry.js.map +1 -0
- package/dist/src/agents/agent-validator.js +273 -0
- package/dist/src/agents/agent-validator.js.map +1 -0
- package/dist/src/agents/github/agent-factory.js +553 -0
- package/dist/src/agents/github/agent-factory.js.map +1 -0
- package/dist/src/agents/github/compatibility/legacy-agent-mappings.js +307 -0
- package/dist/src/agents/github/compatibility/legacy-agent-mappings.js.map +1 -0
- package/dist/src/agents/github/compatibility/legacy-agent-proxy.js +334 -0
- package/dist/src/agents/github/compatibility/legacy-agent-proxy.js.map +1 -0
- package/dist/src/agents/github/core/github-collaboration-manager.js +796 -0
- package/dist/src/agents/github/core/github-collaboration-manager.js.map +1 -0
- package/dist/src/agents/github/core/github-integration-manager.js +546 -0
- package/dist/src/agents/github/core/github-integration-manager.js.map +1 -0
- package/dist/src/agents/github/core/github-release-coordinator.js +718 -0
- package/dist/src/agents/github/core/github-release-coordinator.js.map +1 -0
- package/dist/src/agents/github/index.js +68 -0
- package/dist/src/agents/github/index.js.map +1 -0
- package/dist/src/agents/github/types/index.js +6 -0
- package/dist/src/agents/github/types/index.js.map +1 -0
- package/dist/src/agents/github/utils/error-handling.js +496 -0
- package/dist/src/agents/github/utils/error-handling.js.map +1 -0
- package/dist/src/agents/github/utils/github-client.js +158 -0
- package/dist/src/agents/github/utils/github-client.js.map +1 -0
- package/dist/src/agents/github/utils/hook-integration.js +450 -0
- package/dist/src/agents/github/utils/hook-integration.js.map +1 -0
- package/dist/src/agents/github/utils/performance-optimizer.js +501 -0
- package/dist/src/agents/github/utils/performance-optimizer.js.map +1 -0
- package/dist/src/agents/hierarchical-coordinator.js +775 -0
- package/dist/src/agents/hierarchical-coordinator.js.map +1 -0
- package/dist/src/agents/lifecycle-manager.js +613 -0
- package/dist/src/agents/lifecycle-manager.js.map +1 -0
- package/dist/src/agents/mesh-coordinator.js +580 -0
- package/dist/src/agents/mesh-coordinator.js.map +1 -0
- package/dist/src/agents/simple-agent.js +89 -0
- package/dist/src/agents/simple-agent.js.map +1 -0
- package/dist/src/agents/task-agent-integration.js +240 -0
- package/dist/src/agents/task-agent-integration.js.map +1 -0
- package/dist/src/api/auth-service.js +474 -0
- package/dist/src/api/auth-service.js.map +1 -0
- package/dist/src/api/claude-api-errors.js +171 -0
- package/dist/src/api/claude-api-errors.js.map +1 -0
- package/dist/src/api/claude-client-enhanced.js +473 -0
- package/dist/src/api/claude-client-enhanced.js.map +1 -0
- package/dist/src/api/claude-client.js +527 -0
- package/dist/src/api/claude-client.js.map +1 -0
- package/dist/src/api/database-service.js +666 -0
- package/dist/src/api/database-service.js.map +1 -0
- package/dist/src/api/swarm-api.js +585 -0
- package/dist/src/api/swarm-api.js.map +1 -0
- package/dist/src/automation/test-pipeline/E2ETestGenerator.js +448 -0
- package/dist/src/automation/test-pipeline/E2ETestGenerator.js.map +1 -0
- package/dist/src/automation/test-pipeline/PerformanceMonitor.js +572 -0
- package/dist/src/automation/test-pipeline/PerformanceMonitor.js.map +1 -0
- package/dist/src/automation/test-pipeline/PipelineValidator.js +654 -0
- package/dist/src/automation/test-pipeline/PipelineValidator.js.map +1 -0
- package/dist/src/automation/test-pipeline/RegressionTestManager.js +545 -0
- package/dist/src/automation/test-pipeline/RegressionTestManager.js.map +1 -0
- package/dist/src/automation/test-pipeline/SwarmTestCoordinator.js +450 -0
- package/dist/src/automation/test-pipeline/SwarmTestCoordinator.js.map +1 -0
- package/dist/src/automation/test-pipeline/TestDataManager.js +708 -0
- package/dist/src/automation/test-pipeline/TestDataManager.js.map +1 -0
- package/dist/src/automation/test-pipeline/TestReportingSystem.js +527 -0
- package/dist/src/automation/test-pipeline/TestReportingSystem.js.map +1 -0
- package/dist/src/automation/test-pipeline/utils/chrome-mcp-integration.js +353 -0
- package/dist/src/automation/test-pipeline/utils/chrome-mcp-integration.js.map +1 -0
- package/dist/src/automation/test-pipeline/utils/swarm-coordinator.js +448 -0
- package/dist/src/automation/test-pipeline/utils/swarm-coordinator.js.map +1 -0
- package/dist/src/ci-cd/deployment-orchestrator.js +477 -0
- package/dist/src/ci-cd/deployment-orchestrator.js.map +1 -0
- package/dist/src/ci-cd/github-actions-templates.js +972 -0
- package/dist/src/ci-cd/github-actions-templates.js.map +1 -0
- package/dist/src/ci-cd/performance/PerformanceGate.js +383 -0
- package/dist/src/ci-cd/performance/PerformanceGate.js.map +1 -0
- package/dist/src/cli/agents/analyst.js +788 -0
- package/dist/src/cli/agents/analyst.js.map +1 -0
- package/dist/src/cli/agents/architect.js +846 -0
- package/dist/src/cli/agents/architect.js.map +1 -0
- package/dist/src/cli/agents/base-agent.js +437 -0
- package/dist/src/cli/agents/base-agent.js.map +1 -0
- package/dist/src/cli/agents/capabilities.js +701 -0
- package/dist/src/cli/agents/capabilities.js.map +1 -0
- package/dist/src/cli/agents/coder.js +936 -0
- package/dist/src/cli/agents/coder.js.map +1 -0
- package/dist/src/cli/agents/coordinator.js +489 -0
- package/dist/src/cli/agents/coordinator.js.map +1 -0
- package/dist/src/cli/agents/hive-agents.js +708 -0
- package/dist/src/cli/agents/hive-agents.js.map +1 -0
- package/dist/src/cli/agents/index.js +299 -0
- package/dist/src/cli/agents/index.js.map +1 -0
- package/dist/src/cli/agents/researcher.js +388 -0
- package/dist/src/cli/agents/researcher.js.map +1 -0
- package/dist/src/cli/agents/tester.js +634 -0
- package/dist/src/cli/agents/tester.js.map +1 -0
- package/dist/src/cli/cli-core.js +264 -0
- package/dist/src/cli/cli-core.js.map +1 -0
- package/dist/src/cli/commands/advanced-memory-commands.js +834 -0
- package/dist/src/cli/commands/advanced-memory-commands.js.map +1 -0
- package/dist/src/cli/commands/agent-simple.js +346 -0
- package/dist/src/cli/commands/agent-simple.js.map +1 -0
- package/dist/src/cli/commands/agent.js +368 -0
- package/dist/src/cli/commands/agent.js.map +1 -0
- package/dist/src/cli/commands/claude-api.js +237 -0
- package/dist/src/cli/commands/claude-api.js.map +1 -0
- package/dist/src/cli/commands/claude.js +132 -0
- package/dist/src/cli/commands/claude.js.map +1 -0
- package/dist/src/cli/commands/config-integration.js +395 -0
- package/dist/src/cli/commands/config-integration.js.map +1 -0
- package/dist/src/cli/commands/config.js +67 -0
- package/dist/src/cli/commands/config.js.map +1 -0
- package/dist/src/cli/commands/enterprise.js +1523 -0
- package/dist/src/cli/commands/enterprise.js.map +1 -0
- package/dist/src/cli/commands/goal-init.js +262 -0
- package/dist/src/cli/commands/goal-init.js.map +1 -0
- package/dist/src/cli/commands/help-new.js +276 -0
- package/dist/src/cli/commands/help-new.js.map +1 -0
- package/dist/src/cli/commands/help.js +1055 -0
- package/dist/src/cli/commands/help.js.map +1 -0
- package/dist/src/cli/commands/hive-mind/index.js +20 -0
- package/dist/src/cli/commands/hive-mind/index.js.map +1 -0
- package/dist/src/cli/commands/hive-mind/init.js +58 -0
- package/dist/src/cli/commands/hive-mind/init.js.map +1 -0
- package/dist/src/cli/commands/hive-mind/optimize-memory.js +362 -0
- package/dist/src/cli/commands/hive-mind/optimize-memory.js.map +1 -0
- package/dist/src/cli/commands/hive-mind/pause.js +73 -0
- package/dist/src/cli/commands/hive-mind/pause.js.map +1 -0
- package/dist/src/cli/commands/hive-mind/ps.js +104 -0
- package/dist/src/cli/commands/hive-mind/ps.js.map +1 -0
- package/dist/src/cli/commands/hive-mind/resume.js +56 -0
- package/dist/src/cli/commands/hive-mind/resume.js.map +1 -0
- package/dist/src/cli/commands/hive-mind/spawn.js +242 -0
- package/dist/src/cli/commands/hive-mind/spawn.js.map +1 -0
- package/dist/src/cli/commands/hive-mind/status.js +250 -0
- package/dist/src/cli/commands/hive-mind/status.js.map +1 -0
- package/dist/src/cli/commands/hive-mind/stop.js +116 -0
- package/dist/src/cli/commands/hive-mind/stop.js.map +1 -0
- package/dist/src/cli/commands/hive-mind/task.js +302 -0
- package/dist/src/cli/commands/hive-mind/task.js.map +1 -0
- package/dist/src/cli/commands/hive-mind/wizard.js +705 -0
- package/dist/src/cli/commands/hive-mind/wizard.js.map +1 -0
- package/dist/src/cli/commands/hive.js +506 -0
- package/dist/src/cli/commands/hive.js.map +1 -0
- package/dist/src/cli/commands/hook-types.js +5 -0
- package/dist/src/cli/commands/hook-types.js.map +1 -0
- package/dist/src/cli/commands/hook-validator.js +177 -0
- package/dist/src/cli/commands/hook-validator.js.map +1 -0
- package/dist/src/cli/commands/hook.js +303 -0
- package/dist/src/cli/commands/hook.js.map +1 -0
- package/dist/src/cli/commands/index.js +2745 -0
- package/dist/src/cli/commands/index.js.map +1 -0
- package/dist/src/cli/commands/maestro.js +242 -0
- package/dist/src/cli/commands/maestro.js.map +1 -0
- package/dist/src/cli/commands/mcp.js +148 -0
- package/dist/src/cli/commands/mcp.js.map +1 -0
- package/dist/src/cli/commands/memory.js +193 -0
- package/dist/src/cli/commands/memory.js.map +1 -0
- package/dist/src/cli/commands/migrate.js +107 -0
- package/dist/src/cli/commands/migrate.js.map +1 -0
- package/dist/src/cli/commands/monitor.js +574 -0
- package/dist/src/cli/commands/monitor.js.map +1 -0
- package/dist/src/cli/commands/neural-init.js +211 -0
- package/dist/src/cli/commands/neural-init.js.map +1 -0
- package/dist/src/cli/commands/ruv-swarm.js +555 -0
- package/dist/src/cli/commands/ruv-swarm.js.map +1 -0
- package/dist/src/cli/commands/session.js +517 -0
- package/dist/src/cli/commands/session.js.map +1 -0
- package/dist/src/cli/commands/sparc.js +486 -0
- package/dist/src/cli/commands/sparc.js.map +1 -0
- package/dist/src/cli/commands/start/event-emitter.js +35 -0
- package/dist/src/cli/commands/start/event-emitter.js.map +1 -0
- package/dist/src/cli/commands/start/index.js +9 -0
- package/dist/src/cli/commands/start/index.js.map +1 -0
- package/dist/src/cli/commands/start/process-manager.js +294 -0
- package/dist/src/cli/commands/start/process-manager.js.map +1 -0
- package/dist/src/cli/commands/start/process-ui-simple.js +322 -0
- package/dist/src/cli/commands/start/process-ui-simple.js.map +1 -0
- package/dist/src/cli/commands/start/process-ui.js +5 -0
- package/dist/src/cli/commands/start/process-ui.js.map +1 -0
- package/dist/src/cli/commands/start/start-command.js +463 -0
- package/dist/src/cli/commands/start/start-command.js.map +1 -0
- package/dist/src/cli/commands/start/system-monitor.js +268 -0
- package/dist/src/cli/commands/start/system-monitor.js.map +1 -0
- package/dist/src/cli/commands/start/types.js +22 -0
- package/dist/src/cli/commands/start/types.js.map +1 -0
- package/dist/src/cli/commands/start.js +6 -0
- package/dist/src/cli/commands/start.js.map +1 -0
- package/dist/src/cli/commands/status.js +328 -0
- package/dist/src/cli/commands/status.js.map +1 -0
- package/dist/src/cli/commands/swarm-spawn.js +56 -0
- package/dist/src/cli/commands/swarm-spawn.js.map +1 -0
- package/dist/src/cli/commands/swarm.js +567 -0
- package/dist/src/cli/commands/swarm.js.map +1 -0
- package/dist/src/cli/commands/task.js +44 -0
- package/dist/src/cli/commands/task.js.map +1 -0
- package/dist/src/cli/commands/validate-integration.js +122 -0
- package/dist/src/cli/commands/validate-integration.js.map +1 -0
- package/dist/src/cli/commands/verification.js +351 -0
- package/dist/src/cli/commands/verification.js.map +1 -0
- package/dist/src/cli/commands/workflow.js +615 -0
- package/dist/src/cli/commands/workflow.js.map +1 -0
- package/dist/src/cli/completion.js +578 -0
- package/dist/src/cli/completion.js.map +1 -0
- package/dist/src/cli/consolidated/ConsolidatedCLI.js +379 -0
- package/dist/src/cli/consolidated/ConsolidatedCLI.js.map +1 -0
- package/dist/src/cli/consolidated/core/CommandHandlers.js +833 -0
- package/dist/src/cli/consolidated/core/CommandHandlers.js.map +1 -0
- package/dist/src/cli/consolidated/core/TierManager.js +291 -0
- package/dist/src/cli/consolidated/core/TierManager.js.map +1 -0
- package/dist/src/cli/consolidated/help/InteractiveHelp.js +714 -0
- package/dist/src/cli/consolidated/help/InteractiveHelp.js.map +1 -0
- package/dist/src/cli/consolidated/index.js +62 -0
- package/dist/src/cli/consolidated/index.js.map +1 -0
- package/dist/src/cli/consolidated/intelligence/IntelligenceEngine.js +457 -0
- package/dist/src/cli/consolidated/intelligence/IntelligenceEngine.js.map +1 -0
- package/dist/src/cli/consolidated/routing/CommandRouter.js +526 -0
- package/dist/src/cli/consolidated/routing/CommandRouter.js.map +1 -0
- package/dist/src/cli/consolidated/utils/IntelligentDefaults.js +729 -0
- package/dist/src/cli/consolidated/utils/IntelligentDefaults.js.map +1 -0
- package/dist/src/cli/consolidated/utils/PerformanceOptimizer.js +416 -0
- package/dist/src/cli/consolidated/utils/PerformanceOptimizer.js.map +1 -0
- package/dist/src/cli/formatter.js +284 -0
- package/dist/src/cli/formatter.js.map +1 -0
- package/dist/src/cli/help-formatter.js +111 -0
- package/dist/src/cli/help-formatter.js.map +1 -0
- package/dist/src/cli/index-remote.js +125 -0
- package/dist/src/cli/index-remote.js.map +1 -0
- package/dist/src/cli/index.js +159 -0
- package/dist/src/cli/index.js.map +1 -0
- package/dist/src/cli/init/batch-tools.js +388 -0
- package/dist/src/cli/init/batch-tools.js.map +1 -0
- package/dist/src/cli/init/claude-config.js +401 -0
- package/dist/src/cli/init/claude-config.js.map +1 -0
- package/dist/src/cli/init/directory-structure.js +146 -0
- package/dist/src/cli/init/directory-structure.js.map +1 -0
- package/dist/src/cli/init/index.js +52 -0
- package/dist/src/cli/init/index.js.map +1 -0
- package/dist/src/cli/init/sparc-environment.js +543 -0
- package/dist/src/cli/init/sparc-environment.js.map +1 -0
- package/dist/src/cli/init/swarm-commands.js +796 -0
- package/dist/src/cli/init/swarm-commands.js.map +1 -0
- package/dist/src/cli/init/utils.js +15 -0
- package/dist/src/cli/init/utils.js.map +1 -0
- package/dist/src/cli/maestro-cli-bridge.js +426 -0
- package/dist/src/cli/maestro-cli-bridge.js.map +1 -0
- package/dist/src/cli/main.js +26 -0
- package/dist/src/cli/main.js.map +1 -0
- package/dist/src/cli/node-repl.js +652 -0
- package/dist/src/cli/node-repl.js.map +1 -0
- package/dist/src/cli/repl.js +1078 -0
- package/dist/src/cli/repl.js.map +1 -0
- package/dist/src/cli/simple-cli.js +3026 -0
- package/dist/src/cli/simple-cli.js.map +1 -0
- package/dist/src/cli/simple-mcp.js +87 -0
- package/dist/src/cli/simple-mcp.js.map +1 -0
- package/dist/src/cli/simple-orchestrator.js +857 -0
- package/dist/src/cli/simple-orchestrator.js.map +1 -0
- package/dist/src/cli/ui/compatible-ui.js +322 -0
- package/dist/src/cli/ui/compatible-ui.js.map +1 -0
- package/dist/src/cli/ui/fallback-handler.js +156 -0
- package/dist/src/cli/ui/fallback-handler.js.map +1 -0
- package/dist/src/cli/ui/index.js +32 -0
- package/dist/src/cli/ui/index.js.map +1 -0
- package/dist/src/cli/utils/environment-detector.js +228 -0
- package/dist/src/cli/utils/environment-detector.js.map +1 -0
- package/dist/src/cli/utils/prompt-defaults.js +234 -0
- package/dist/src/cli/utils/prompt-defaults.js.map +1 -0
- package/dist/src/cli/validation-helper.js +66 -0
- package/dist/src/cli/validation-helper.js.map +1 -0
- package/dist/src/communication/message-bus.js +1007 -0
- package/dist/src/communication/message-bus.js.map +1 -0
- package/dist/src/communication/reliable-communication-manager.js +374 -0
- package/dist/src/communication/reliable-communication-manager.js.map +1 -0
- package/dist/src/config/ai/decision-tree-generator.js +763 -0
- package/dist/src/config/ai/decision-tree-generator.js.map +1 -0
- package/dist/src/config/ai/project-detection-engine.js +1081 -0
- package/dist/src/config/ai/project-detection-engine.js.map +1 -0
- package/dist/src/config/config-manager.js +1285 -0
- package/dist/src/config/config-manager.js.map +1 -0
- package/dist/src/config/consent-manager.js +433 -0
- package/dist/src/config/consent-manager.js.map +1 -0
- package/dist/src/config/core/intelligent-configuration-manager.js +674 -0
- package/dist/src/config/core/intelligent-configuration-manager.js.map +1 -0
- package/dist/src/config/index.js +110 -0
- package/dist/src/config/index.js.map +1 -0
- package/dist/src/config/integration/hooks-integration.js +548 -0
- package/dist/src/config/integration/hooks-integration.js.map +1 -0
- package/dist/src/config/migration/config-migration.js +285 -0
- package/dist/src/config/migration/config-migration.js.map +1 -0
- package/dist/src/config/migration/version-migration-engine.js +984 -0
- package/dist/src/config/migration/version-migration-engine.js.map +1 -0
- package/dist/src/config/migration-manager.js +529 -0
- package/dist/src/config/migration-manager.js.map +1 -0
- package/dist/src/config/ruv-swarm-config.js +332 -0
- package/dist/src/config/ruv-swarm-config.js.map +1 -0
- package/dist/src/config/ruv-swarm-integration.js +285 -0
- package/dist/src/config/ruv-swarm-integration.js.map +1 -0
- package/dist/src/config/storage/multi-tier-storage.js +626 -0
- package/dist/src/config/storage/multi-tier-storage.js.map +1 -0
- package/dist/src/config/test-migration-fixer.js +332 -0
- package/dist/src/config/test-migration-fixer.js.map +1 -0
- package/dist/src/config/ui/progressive-disclosure-engine.js +876 -0
- package/dist/src/config/ui/progressive-disclosure-engine.js.map +1 -0
- package/dist/src/config/utils/config-export-import.js +454 -0
- package/dist/src/config/utils/config-export-import.js.map +1 -0
- package/dist/src/config/utils/zero-config-setup.js +238 -0
- package/dist/src/config/utils/zero-config-setup.js.map +1 -0
- package/dist/src/config/validation/config-validator.js +462 -0
- package/dist/src/config/validation/config-validator.js.map +1 -0
- package/dist/src/config/web-portal-config.js +343 -0
- package/dist/src/config/web-portal-config.js.map +1 -0
- package/dist/src/config/zero-config-setup.js +294 -0
- package/dist/src/config/zero-config-setup.js.map +1 -0
- package/dist/src/constants/agent-types.js +51 -0
- package/dist/src/constants/agent-types.js.map +1 -0
- package/dist/src/coordination/advanced-scheduler.js +370 -0
- package/dist/src/coordination/advanced-scheduler.js.map +1 -0
- package/dist/src/coordination/advanced-task-executor.js +481 -0
- package/dist/src/coordination/advanced-task-executor.js.map +1 -0
- package/dist/src/coordination/background-executor.js +366 -0
- package/dist/src/coordination/background-executor.js.map +1 -0
- package/dist/src/coordination/circuit-breaker.js +286 -0
- package/dist/src/coordination/circuit-breaker.js.map +1 -0
- package/dist/src/coordination/conflict-resolution.js +348 -0
- package/dist/src/coordination/conflict-resolution.js.map +1 -0
- package/dist/src/coordination/dependency-graph.js +398 -0
- package/dist/src/coordination/dependency-graph.js.map +1 -0
- package/dist/src/coordination/hive-orchestrator.js +309 -0
- package/dist/src/coordination/hive-orchestrator.js.map +1 -0
- package/dist/src/coordination/hive-protocol.js +363 -0
- package/dist/src/coordination/hive-protocol.js.map +1 -0
- package/dist/src/coordination/index.js +21 -0
- package/dist/src/coordination/index.js.map +1 -0
- package/dist/src/coordination/load-balancer.js +737 -0
- package/dist/src/coordination/load-balancer.js.map +1 -0
- package/dist/src/coordination/manager.js +360 -0
- package/dist/src/coordination/manager.js.map +1 -0
- package/dist/src/coordination/messaging.js +221 -0
- package/dist/src/coordination/messaging.js.map +1 -0
- package/dist/src/coordination/metrics.js +415 -0
- package/dist/src/coordination/metrics.js.map +1 -0
- package/dist/src/coordination/resources.js +276 -0
- package/dist/src/coordination/resources.js.map +1 -0
- package/dist/src/coordination/scheduler.js +322 -0
- package/dist/src/coordination/scheduler.js.map +1 -0
- package/dist/src/coordination/swarm-coordinator.js +585 -0
- package/dist/src/coordination/swarm-coordinator.js.map +1 -0
- package/dist/src/coordination/swarm-monitor.js +359 -0
- package/dist/src/coordination/swarm-monitor.js.map +1 -0
- package/dist/src/coordination/work-stealing.js +164 -0
- package/dist/src/coordination/work-stealing.js.map +1 -0
- package/dist/src/core/agent-manager.js +80 -0
- package/dist/src/core/agent-manager.js.map +1 -0
- package/dist/src/core/config.js +1221 -0
- package/dist/src/core/config.js.map +1 -0
- package/dist/src/core/event-bus.js +136 -0
- package/dist/src/core/event-bus.js.map +1 -0
- package/dist/src/core/index.js +6 -0
- package/dist/src/core/index.js.map +1 -0
- package/dist/src/core/json-persistence.js +112 -0
- package/dist/src/core/json-persistence.js.map +1 -0
- package/dist/src/core/logger.js +245 -0
- package/dist/src/core/logger.js.map +1 -0
- package/dist/src/core/orchestrator-fixed.js +236 -0
- package/dist/src/core/orchestrator-fixed.js.map +1 -0
- package/dist/src/core/orchestrator.js +1136 -0
- package/dist/src/core/orchestrator.js.map +1 -0
- package/dist/src/core/persistence.js +185 -0
- package/dist/src/core/persistence.js.map +1 -0
- package/dist/src/core/project-manager.js +80 -0
- package/dist/src/core/project-manager.js.map +1 -0
- package/dist/src/core/version.js +35 -0
- package/dist/src/core/version.js.map +1 -0
- package/dist/src/crdt/types.js +509 -0
- package/dist/src/crdt/types.js.map +1 -0
- package/dist/src/enterprise/analytics-manager.js +1133 -0
- package/dist/src/enterprise/analytics-manager.js.map +1 -0
- package/dist/src/enterprise/audit-manager.js +1112 -0
- package/dist/src/enterprise/audit-manager.js.map +1 -0
- package/dist/src/enterprise/cloud-manager.js +886 -0
- package/dist/src/enterprise/cloud-manager.js.map +1 -0
- package/dist/src/enterprise/deployment-manager.js +963 -0
- package/dist/src/enterprise/deployment-manager.js.map +1 -0
- package/dist/src/enterprise/index.js +8 -0
- package/dist/src/enterprise/index.js.map +1 -0
- package/dist/src/enterprise/project-manager.js +577 -0
- package/dist/src/enterprise/project-manager.js.map +1 -0
- package/dist/src/enterprise/security-manager.js +987 -0
- package/dist/src/enterprise/security-manager.js.map +1 -0
- package/dist/src/feature-flags/cli/Phase4CLI.js +463 -0
- package/dist/src/feature-flags/cli/Phase4CLI.js.map +1 -0
- package/dist/src/feature-flags/core/FeatureFlagManager.js +324 -0
- package/dist/src/feature-flags/core/FeatureFlagManager.js.map +1 -0
- package/dist/src/feature-flags/index.js +237 -0
- package/dist/src/feature-flags/index.js.map +1 -0
- package/dist/src/feature-flags/monitoring/RolloutMonitor.js +275 -0
- package/dist/src/feature-flags/monitoring/RolloutMonitor.js.map +1 -0
- package/dist/src/feature-flags/rollout/RolloutController.js +301 -0
- package/dist/src/feature-flags/rollout/RolloutController.js.map +1 -0
- package/dist/src/feature-flags/validation/HookInterceptor.js +310 -0
- package/dist/src/feature-flags/validation/HookInterceptor.js.map +1 -0
- package/dist/src/feature-flags/validation/TruthBasedValidator.js +263 -0
- package/dist/src/feature-flags/validation/TruthBasedValidator.js.map +1 -0
- package/dist/src/hive-mind/core/Agent.js +569 -0
- package/dist/src/hive-mind/core/Agent.js.map +1 -0
- package/dist/src/hive-mind/core/Communication.js +411 -0
- package/dist/src/hive-mind/core/Communication.js.map +1 -0
- package/dist/src/hive-mind/core/DatabaseManager.js +599 -0
- package/dist/src/hive-mind/core/DatabaseManager.js.map +1 -0
- package/dist/src/hive-mind/core/HiveMind.js +575 -0
- package/dist/src/hive-mind/core/HiveMind.js.map +1 -0
- package/dist/src/hive-mind/core/Memory.js +1159 -0
- package/dist/src/hive-mind/core/Memory.js.map +1 -0
- package/dist/src/hive-mind/core/MemoryMonitor.js +525 -0
- package/dist/src/hive-mind/core/MemoryMonitor.js.map +1 -0
- package/dist/src/hive-mind/core/Queen.js +753 -0
- package/dist/src/hive-mind/core/Queen.js.map +1 -0
- package/dist/src/hive-mind/index.js +21 -0
- package/dist/src/hive-mind/index.js.map +1 -0
- package/dist/src/hive-mind/integration/ConsensusEngine.js +460 -0
- package/dist/src/hive-mind/integration/ConsensusEngine.js.map +1 -0
- package/dist/src/hive-mind/integration/MCPToolWrapper.js +243 -0
- package/dist/src/hive-mind/integration/MCPToolWrapper.js.map +1 -0
- package/dist/src/hive-mind/integration/SwarmOrchestrator.js +812 -0
- package/dist/src/hive-mind/integration/SwarmOrchestrator.js.map +1 -0
- package/dist/src/hive-mind/types.js +9 -0
- package/dist/src/hive-mind/types.js.map +1 -0
- package/dist/src/hooks/index.js +197 -0
- package/dist/src/hooks/index.js.map +1 -0
- package/dist/src/index.js +11 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/integration/mock-components.js +362 -0
- package/dist/src/integration/mock-components.js.map +1 -0
- package/dist/src/integration/system-integration.js +428 -0
- package/dist/src/integration/system-integration.js.map +1 -0
- package/dist/src/integration/types.js +5 -0
- package/dist/src/integration/types.js.map +1 -0
- package/dist/src/lifecycle/communication-protocols.js +568 -0
- package/dist/src/lifecycle/communication-protocols.js.map +1 -0
- package/dist/src/lifecycle/dependency-tracker.js +799 -0
- package/dist/src/lifecycle/dependency-tracker.js.map +1 -0
- package/dist/src/lifecycle/memory-schema.js +622 -0
- package/dist/src/lifecycle/memory-schema.js.map +1 -0
- package/dist/src/maestro/maestro-swarm-coordinator.js +504 -0
- package/dist/src/maestro/maestro-swarm-coordinator.js.map +1 -0
- package/dist/src/maestro/maestro-types.js +3 -0
- package/dist/src/maestro/maestro-types.js.map +1 -0
- package/dist/src/maestro/tests/native-hive-mind-integration.test.js +382 -0
- package/dist/src/maestro/tests/native-hive-mind-integration.test.js.map +1 -0
- package/dist/src/mcp/auth.js +347 -0
- package/dist/src/mcp/auth.js.map +1 -0
- package/dist/src/mcp/claude-code-wrapper.js +717 -0
- package/dist/src/mcp/claude-code-wrapper.js.map +1 -0
- package/dist/src/mcp/claude-flow-tools.js +1365 -0
- package/dist/src/mcp/claude-flow-tools.js.map +1 -0
- package/dist/src/mcp/client.js +201 -0
- package/dist/src/mcp/client.js.map +1 -0
- package/dist/src/mcp/index.js +192 -0
- package/dist/src/mcp/index.js.map +1 -0
- package/dist/src/mcp/integrate-wrapper.js +85 -0
- package/dist/src/mcp/integrate-wrapper.js.map +1 -0
- package/dist/src/mcp/lifecycle-manager.js +348 -0
- package/dist/src/mcp/lifecycle-manager.js.map +1 -0
- package/dist/src/mcp/load-balancer.js +386 -0
- package/dist/src/mcp/load-balancer.js.map +1 -0
- package/dist/src/mcp/orchestration-integration.js +800 -0
- package/dist/src/mcp/orchestration-integration.js.map +1 -0
- package/dist/src/mcp/performance-monitor.js +489 -0
- package/dist/src/mcp/performance-monitor.js.map +1 -0
- package/dist/src/mcp/protocol-manager.js +376 -0
- package/dist/src/mcp/protocol-manager.js.map +1 -0
- package/dist/src/mcp/recovery/connection-health-monitor.js +240 -0
- package/dist/src/mcp/recovery/connection-health-monitor.js.map +1 -0
- package/dist/src/mcp/recovery/connection-state-manager.js +309 -0
- package/dist/src/mcp/recovery/connection-state-manager.js.map +1 -0
- package/dist/src/mcp/recovery/fallback-coordinator.js +288 -0
- package/dist/src/mcp/recovery/fallback-coordinator.js.map +1 -0
- package/dist/src/mcp/recovery/index.js +10 -0
- package/dist/src/mcp/recovery/index.js.map +1 -0
- package/dist/src/mcp/recovery/reconnection-manager.js +219 -0
- package/dist/src/mcp/recovery/reconnection-manager.js.map +1 -0
- package/dist/src/mcp/recovery/recovery-manager.js +262 -0
- package/dist/src/mcp/recovery/recovery-manager.js.map +1 -0
- package/dist/src/mcp/router.js +220 -0
- package/dist/src/mcp/router.js.map +1 -0
- package/dist/src/mcp/ruv-swarm-tools.js +671 -0
- package/dist/src/mcp/ruv-swarm-tools.js.map +1 -0
- package/dist/src/mcp/server-with-wrapper.js +32 -0
- package/dist/src/mcp/server-with-wrapper.js.map +1 -0
- package/dist/src/mcp/server-wrapper-mode.js +26 -0
- package/dist/src/mcp/server-wrapper-mode.js.map +1 -0
- package/dist/src/mcp/server.js +539 -0
- package/dist/src/mcp/server.js.map +1 -0
- package/dist/src/mcp/session-manager.js +338 -0
- package/dist/src/mcp/session-manager.js.map +1 -0
- package/dist/src/mcp/sparc-modes.js +455 -0
- package/dist/src/mcp/sparc-modes.js.map +1 -0
- package/dist/src/mcp/swarm-tools.js +903 -0
- package/dist/src/mcp/swarm-tools.js.map +1 -0
- package/dist/src/mcp/tests/mcp-integration.test.js +493 -0
- package/dist/src/mcp/tests/mcp-integration.test.js.map +1 -0
- package/dist/src/mcp/tools.js +426 -0
- package/dist/src/mcp/tools.js.map +1 -0
- package/dist/src/mcp/transports/base.js +5 -0
- package/dist/src/mcp/transports/base.js.map +1 -0
- package/dist/src/mcp/transports/http.js +414 -0
- package/dist/src/mcp/transports/http.js.map +1 -0
- package/dist/src/mcp/transports/stdio.js +217 -0
- package/dist/src/mcp/transports/stdio.js.map +1 -0
- package/dist/src/memory/advanced-memory-manager.js +1522 -0
- package/dist/src/memory/advanced-memory-manager.js.map +1 -0
- package/dist/src/memory/backends/base.js +5 -0
- package/dist/src/memory/backends/base.js.map +1 -0
- package/dist/src/memory/backends/markdown.js +235 -0
- package/dist/src/memory/backends/markdown.js.map +1 -0
- package/dist/src/memory/backends/sqlite.js +295 -0
- package/dist/src/memory/backends/sqlite.js.map +1 -0
- package/dist/src/memory/cache.js +177 -0
- package/dist/src/memory/cache.js.map +1 -0
- package/dist/src/memory/distributed-memory.js +745 -0
- package/dist/src/memory/distributed-memory.js.map +1 -0
- package/dist/src/memory/indexer.js +184 -0
- package/dist/src/memory/indexer.js.map +1 -0
- package/dist/src/memory/manager.js +457 -0
- package/dist/src/memory/manager.js.map +1 -0
- package/dist/src/memory/sqlite-enhanced-backend.js +529 -0
- package/dist/src/memory/sqlite-enhanced-backend.js.map +1 -0
- package/dist/src/memory/swarm-memory.js +446 -0
- package/dist/src/memory/swarm-memory.js.map +1 -0
- package/dist/src/migration/index.js +94 -0
- package/dist/src/migration/index.js.map +1 -0
- package/dist/src/migration/logger.js +110 -0
- package/dist/src/migration/logger.js.map +1 -0
- package/dist/src/migration/migration-analyzer.js +255 -0
- package/dist/src/migration/migration-analyzer.js.map +1 -0
- package/dist/src/migration/migration-runner.js +511 -0
- package/dist/src/migration/migration-runner.js.map +1 -0
- package/dist/src/migration/migration-validator.js +272 -0
- package/dist/src/migration/migration-validator.js.map +1 -0
- package/dist/src/migration/progress-reporter.js +139 -0
- package/dist/src/migration/progress-reporter.js.map +1 -0
- package/dist/src/migration/rollback-manager.js +310 -0
- package/dist/src/migration/rollback-manager.js.map +1 -0
- package/dist/src/migration/tests/migration-system.test.js +9 -0
- package/dist/src/migration/tests/migration-system.test.js.map +1 -0
- package/dist/src/migration/types.js +5 -0
- package/dist/src/migration/types.js.map +1 -0
- package/dist/src/monitoring/diagnostics.js +532 -0
- package/dist/src/monitoring/diagnostics.js.map +1 -0
- package/dist/src/monitoring/health-check.js +355 -0
- package/dist/src/monitoring/health-check.js.map +1 -0
- package/dist/src/monitoring/phase4/analytics/consensus-tracker.js +764 -0
- package/dist/src/monitoring/phase4/analytics/consensus-tracker.js.map +1 -0
- package/dist/src/monitoring/phase4/analytics/performance-assessor.js +859 -0
- package/dist/src/monitoring/phase4/analytics/performance-assessor.js.map +1 -0
- package/dist/src/monitoring/phase4/analytics/truth-score-analyzer.js +667 -0
- package/dist/src/monitoring/phase4/analytics/truth-score-analyzer.js.map +1 -0
- package/dist/src/monitoring/phase4/dashboard/monitoring-dashboard.js +1008 -0
- package/dist/src/monitoring/phase4/dashboard/monitoring-dashboard.js.map +1 -0
- package/dist/src/monitoring/phase4/rollout-decision-engine.js +849 -0
- package/dist/src/monitoring/phase4/rollout-decision-engine.js.map +1 -0
- package/dist/src/monitoring/real-time-feedback-system.js +688 -0
- package/dist/src/monitoring/real-time-feedback-system.js.map +1 -0
- package/dist/src/monitoring/real-time-monitor.js +981 -0
- package/dist/src/monitoring/real-time-monitor.js.map +1 -0
- package/dist/src/monitoring/regression/RegressionDetector.js +525 -0
- package/dist/src/monitoring/regression/RegressionDetector.js.map +1 -0
- package/dist/src/neural/NeuralDomainMapper.js +1137 -0
- package/dist/src/neural/NeuralDomainMapper.js.map +1 -0
- package/dist/src/neural/index.js +418 -0
- package/dist/src/neural/index.js.map +1 -0
- package/dist/src/neural/integration.js +590 -0
- package/dist/src/neural/integration.js.map +1 -0
- package/dist/src/providers/anthropic-provider.js +245 -0
- package/dist/src/providers/anthropic-provider.js.map +1 -0
- package/dist/src/providers/base-provider.js +389 -0
- package/dist/src/providers/base-provider.js.map +1 -0
- package/dist/src/providers/cohere-provider.js +405 -0
- package/dist/src/providers/cohere-provider.js.map +1 -0
- package/dist/src/providers/google-provider.js +376 -0
- package/dist/src/providers/google-provider.js.map +1 -0
- package/dist/src/providers/index.js +18 -0
- package/dist/src/providers/index.js.map +1 -0
- package/dist/src/providers/ollama-provider.js +400 -0
- package/dist/src/providers/ollama-provider.js.map +1 -0
- package/dist/src/providers/openai-provider.js +364 -0
- package/dist/src/providers/openai-provider.js.map +1 -0
- package/dist/src/providers/provider-manager.js +487 -0
- package/dist/src/providers/provider-manager.js.map +1 -0
- package/dist/src/providers/types.js +55 -0
- package/dist/src/providers/types.js.map +1 -0
- package/dist/src/providers/utils.js +343 -0
- package/dist/src/providers/utils.js.map +1 -0
- package/dist/src/quality-gates/automated-review-system.js +645 -0
- package/dist/src/quality-gates/automated-review-system.js.map +1 -0
- package/dist/src/resources/resource-manager.js +1275 -0
- package/dist/src/resources/resource-manager.js.map +1 -0
- package/dist/src/rollback/recovery-manager.js +1065 -0
- package/dist/src/rollback/recovery-manager.js.map +1 -0
- package/dist/src/services/agent-manager.js +308 -0
- package/dist/src/services/agent-manager.js.map +1 -0
- package/dist/src/services/agentic-flow-hooks/hook-manager.js +506 -0
- package/dist/src/services/agentic-flow-hooks/hook-manager.js.map +1 -0
- package/dist/src/services/agentic-flow-hooks/index.js +322 -0
- package/dist/src/services/agentic-flow-hooks/index.js.map +1 -0
- package/dist/src/services/agentic-flow-hooks/llm-hooks.js +445 -0
- package/dist/src/services/agentic-flow-hooks/llm-hooks.js.map +1 -0
- package/dist/src/services/agentic-flow-hooks/memory-hooks.js +558 -0
- package/dist/src/services/agentic-flow-hooks/memory-hooks.js.map +1 -0
- package/dist/src/services/agentic-flow-hooks/neural-hooks.js +595 -0
- package/dist/src/services/agentic-flow-hooks/neural-hooks.js.map +1 -0
- package/dist/src/services/agentic-flow-hooks/performance-hooks.js +640 -0
- package/dist/src/services/agentic-flow-hooks/performance-hooks.js.map +1 -0
- package/dist/src/services/agentic-flow-hooks/types.js +8 -0
- package/dist/src/services/agentic-flow-hooks/types.js.map +1 -0
- package/dist/src/services/agentic-flow-hooks/workflow-hooks.js +746 -0
- package/dist/src/services/agentic-flow-hooks/workflow-hooks.js.map +1 -0
- package/dist/src/services/performance-metrics-collector.js +529 -0
- package/dist/src/services/performance-metrics-collector.js.map +1 -0
- package/dist/src/services/swarm-coordinator.js +431 -0
- package/dist/src/services/swarm-coordinator.js.map +1 -0
- package/dist/src/services/swarm-memory-manager.js +513 -0
- package/dist/src/services/swarm-memory-manager.js.map +1 -0
- package/dist/src/services/swarm-relaunch-manager.js +408 -0
- package/dist/src/services/swarm-relaunch-manager.js.map +1 -0
- package/dist/src/services/task-handoff-service.js +361 -0
- package/dist/src/services/task-handoff-service.js.map +1 -0
- package/dist/src/swarm/__tests__/integration.test.js +229 -0
- package/dist/src/swarm/__tests__/integration.test.js.map +1 -0
- package/dist/src/swarm/__tests__/prompt-copier.test.js +346 -0
- package/dist/src/swarm/__tests__/prompt-copier.test.js.map +1 -0
- package/dist/src/swarm/advanced-orchestrator.js +1093 -0
- package/dist/src/swarm/advanced-orchestrator.js.map +1 -0
- package/dist/src/swarm/claude-code-interface.js +959 -0
- package/dist/src/swarm/claude-code-interface.js.map +1 -0
- package/dist/src/swarm/claude-flow-executor.js +218 -0
- package/dist/src/swarm/claude-flow-executor.js.map +1 -0
- package/dist/src/swarm/coordinator.js +3001 -0
- package/dist/src/swarm/coordinator.js.map +1 -0
- package/dist/src/swarm/direct-executor.js +1169 -0
- package/dist/src/swarm/direct-executor.js.map +1 -0
- package/dist/src/swarm/executor-v2.js +312 -0
- package/dist/src/swarm/executor-v2.js.map +1 -0
- package/dist/src/swarm/executor.js +813 -0
- package/dist/src/swarm/executor.js.map +1 -0
- package/dist/src/swarm/hive-mind-integration.js +700 -0
- package/dist/src/swarm/hive-mind-integration.js.map +1 -0
- package/dist/src/swarm/index.js +43 -0
- package/dist/src/swarm/index.js.map +1 -0
- package/dist/src/swarm/json-output-aggregator.js +269 -0
- package/dist/src/swarm/json-output-aggregator.js.map +1 -0
- package/dist/src/swarm/mcp-integration-wrapper.js +623 -0
- package/dist/src/swarm/mcp-integration-wrapper.js.map +1 -0
- package/dist/src/swarm/memory.js +1119 -0
- package/dist/src/swarm/memory.js.map +1 -0
- package/dist/src/swarm/optimizations/__tests__/optimization.test.js +350 -0
- package/dist/src/swarm/optimizations/__tests__/optimization.test.js.map +1 -0
- package/dist/src/swarm/optimizations/async-file-manager.js +273 -0
- package/dist/src/swarm/optimizations/async-file-manager.js.map +1 -0
- package/dist/src/swarm/optimizations/circular-buffer.js +148 -0
- package/dist/src/swarm/optimizations/circular-buffer.js.map +1 -0
- package/dist/src/swarm/optimizations/connection-pool.js +239 -0
- package/dist/src/swarm/optimizations/connection-pool.js.map +1 -0
- package/dist/src/swarm/optimizations/index.js +30 -0
- package/dist/src/swarm/optimizations/index.js.map +1 -0
- package/dist/src/swarm/optimizations/optimized-executor.js +318 -0
- package/dist/src/swarm/optimizations/optimized-executor.js.map +1 -0
- package/dist/src/swarm/optimizations/ttl-map.js +223 -0
- package/dist/src/swarm/optimizations/ttl-map.js.map +1 -0
- package/dist/src/swarm/prompt-cli.js +202 -0
- package/dist/src/swarm/prompt-cli.js.map +1 -0
- package/dist/src/swarm/prompt-copier-enhanced.js +193 -0
- package/dist/src/swarm/prompt-copier-enhanced.js.map +1 -0
- package/dist/src/swarm/prompt-copier.js +376 -0
- package/dist/src/swarm/prompt-copier.js.map +1 -0
- package/dist/src/swarm/prompt-manager.js +287 -0
- package/dist/src/swarm/prompt-manager.js.map +1 -0
- package/dist/src/swarm/prompt-utils.js +299 -0
- package/dist/src/swarm/prompt-utils.js.map +1 -0
- package/dist/src/swarm/result-aggregator.js +713 -0
- package/dist/src/swarm/result-aggregator.js.map +1 -0
- package/dist/src/swarm/sparc-executor.js +1557 -0
- package/dist/src/swarm/sparc-executor.js.map +1 -0
- package/dist/src/swarm/strategies/auto.js +751 -0
- package/dist/src/swarm/strategies/auto.js.map +1 -0
- package/dist/src/swarm/strategies/base.js +117 -0
- package/dist/src/swarm/strategies/base.js.map +1 -0
- package/dist/src/swarm/strategies/research.js +911 -0
- package/dist/src/swarm/strategies/research.js.map +1 -0
- package/dist/src/swarm/strategies/strategy-metrics-patch.js +4 -0
- package/dist/src/swarm/strategies/strategy-metrics-patch.js.map +1 -0
- package/dist/src/swarm/types.js +54 -0
- package/dist/src/swarm/types.js.map +1 -0
- package/dist/src/swarm/workers/copy-worker.js +58 -0
- package/dist/src/swarm/workers/copy-worker.js.map +1 -0
- package/dist/src/swarm-fullstack/adapters/chrome-mcp-adapter.js +412 -0
- package/dist/src/swarm-fullstack/adapters/chrome-mcp-adapter.js.map +1 -0
- package/dist/src/swarm-fullstack/adapters/shadcn-mcp-adapter.js +560 -0
- package/dist/src/swarm-fullstack/adapters/shadcn-mcp-adapter.js.map +1 -0
- package/dist/src/swarm-fullstack/cli/fullstack-cli.js +582 -0
- package/dist/src/swarm-fullstack/cli/fullstack-cli.js.map +1 -0
- package/dist/src/swarm-fullstack/config/fullstack-config.js +369 -0
- package/dist/src/swarm-fullstack/config/fullstack-config.js.map +1 -0
- package/dist/src/swarm-fullstack/core/dynamic-agent-spawner.js +687 -0
- package/dist/src/swarm-fullstack/core/dynamic-agent-spawner.js.map +1 -0
- package/dist/src/swarm-fullstack/core/enhanced-swarm-message-router.js +589 -0
- package/dist/src/swarm-fullstack/core/enhanced-swarm-message-router.js.map +1 -0
- package/dist/src/swarm-fullstack/core/fullstack-orchestrator.js +538 -0
- package/dist/src/swarm-fullstack/core/fullstack-orchestrator.js.map +1 -0
- package/dist/src/swarm-fullstack/types/index.js +8 -0
- package/dist/src/swarm-fullstack/types/index.js.map +1 -0
- package/dist/src/task/commands.js +130 -0
- package/dist/src/task/commands.js.map +1 -0
- package/dist/src/task/coordination.js +737 -0
- package/dist/src/task/coordination.js.map +1 -0
- package/dist/src/task/engine.js +490 -0
- package/dist/src/task/engine.js.map +1 -0
- package/dist/src/task/index.js +269 -0
- package/dist/src/task/index.js.map +1 -0
- package/dist/src/task/types.js +5 -0
- package/dist/src/task/types.js.map +1 -0
- package/dist/src/terminal/adapters/base.js +5 -0
- package/dist/src/terminal/adapters/base.js.map +1 -0
- package/dist/src/terminal/adapters/native.js +473 -0
- package/dist/src/terminal/adapters/native.js.map +1 -0
- package/dist/src/terminal/adapters/vscode.js +285 -0
- package/dist/src/terminal/adapters/vscode.js.map +1 -0
- package/dist/src/terminal/manager.js +237 -0
- package/dist/src/terminal/manager.js.map +1 -0
- package/dist/src/terminal/pool.js +209 -0
- package/dist/src/terminal/pool.js.map +1 -0
- package/dist/src/terminal/session.js +211 -0
- package/dist/src/terminal/session.js.map +1 -0
- package/dist/src/terminal/vscode-bridge.js +186 -0
- package/dist/src/terminal/vscode-bridge.js.map +1 -0
- package/dist/src/testing/performance/PerformanceTestRunner.js +401 -0
- package/dist/src/testing/performance/PerformanceTestRunner.js.map +1 -0
- package/dist/src/testing-integration/chrome-mcp-integration.js +556 -0
- package/dist/src/testing-integration/chrome-mcp-integration.js.map +1 -0
- package/dist/src/testing-integration/continuous-test-runner.js +509 -0
- package/dist/src/testing-integration/continuous-test-runner.js.map +1 -0
- package/dist/src/tests/validation-consistency.test.js +52 -0
- package/dist/src/tests/validation-consistency.test.js.map +1 -0
- package/dist/src/topology/adaptive-coordinator.js +691 -0
- package/dist/src/topology/adaptive-coordinator.js.map +1 -0
- package/dist/src/topology/communication-bridge.js +551 -0
- package/dist/src/topology/communication-bridge.js.map +1 -0
- package/dist/src/topology/enhanced-hierarchical-coordinator.js +1732 -0
- package/dist/src/topology/enhanced-hierarchical-coordinator.js.map +1 -0
- package/dist/src/topology/enhanced-mesh-coordinator.js +1271 -0
- package/dist/src/topology/enhanced-mesh-coordinator.js.map +1 -0
- package/dist/src/topology/topology-manager.js +797 -0
- package/dist/src/topology/topology-manager.js.map +1 -0
- package/dist/src/topology/types.js +8 -0
- package/dist/src/topology/types.js.map +1 -0
- package/dist/src/types/agent-lifecycle-types.js +172 -0
- package/dist/src/types/agent-lifecycle-types.js.map +1 -0
- package/dist/src/types/agent-types.js +11 -0
- package/dist/src/types/agent-types.js.map +1 -0
- package/dist/src/types/cliffy.d.js +9 -0
- package/dist/src/types/cliffy.d.js.map +1 -0
- package/dist/src/types/global.d.js +5 -0
- package/dist/src/types/global.d.js.map +1 -0
- package/dist/src/types/index.js +16 -0
- package/dist/src/types/index.js.map +1 -0
- package/dist/src/types/mcp.d.js +3 -0
- package/dist/src/types/mcp.d.js.map +1 -0
- package/dist/src/types/vscode.d.js +4 -0
- package/dist/src/types/vscode.d.js.map +1 -0
- package/dist/src/ui/hive-dashboard.js +284 -0
- package/dist/src/ui/hive-dashboard.js.map +1 -0
- package/dist/src/utils/error-handler.js +27 -0
- package/dist/src/utils/error-handler.js.map +1 -0
- package/dist/src/utils/errors.js +195 -0
- package/dist/src/utils/errors.js.map +1 -0
- package/dist/src/utils/formatters.js +66 -0
- package/dist/src/utils/formatters.js.map +1 -0
- package/dist/src/utils/helpers.js +451 -0
- package/dist/src/utils/helpers.js.map +1 -0
- package/dist/src/utils/paths.js +43 -0
- package/dist/src/utils/paths.js.map +1 -0
- package/dist/src/utils/type-guards.js +119 -0
- package/dist/src/utils/type-guards.js.map +1 -0
- package/dist/src/utils/types.js +38 -0
- package/dist/src/utils/types.js.map +1 -0
- package/dist/src/verification/agent-scorer.js +633 -0
- package/dist/src/verification/agent-scorer.js.map +1 -0
- package/dist/src/verification/alert-manager.js +1126 -0
- package/dist/src/verification/alert-manager.js.map +1 -0
- package/dist/src/verification/api/types/index.js +6 -0
- package/dist/src/verification/api/types/index.js.map +1 -0
- package/dist/src/verification/checkpoint-manager.js +519 -0
- package/dist/src/verification/checkpoint-manager.js.map +1 -0
- package/dist/src/verification/cli-integration.js +500 -0
- package/dist/src/verification/cli-integration.js.map +1 -0
- package/dist/src/verification/conflict-resolver.js +534 -0
- package/dist/src/verification/conflict-resolver.js.map +1 -0
- package/dist/src/verification/crdt-coordinator.js +506 -0
- package/dist/src/verification/crdt-coordinator.js.map +1 -0
- package/dist/src/verification/dashboard-exporter.js +876 -0
- package/dist/src/verification/dashboard-exporter.js.map +1 -0
- package/dist/src/verification/demo.js +320 -0
- package/dist/src/verification/demo.js.map +1 -0
- package/dist/src/verification/examples.js +508 -0
- package/dist/src/verification/examples.js.map +1 -0
- package/dist/src/verification/hooks.js +961 -0
- package/dist/src/verification/hooks.js.map +1 -0
- package/dist/src/verification/index.js +73 -0
- package/dist/src/verification/index.js.map +1 -0
- package/dist/src/verification/interfaces.js +7 -0
- package/dist/src/verification/interfaces.js.map +1 -0
- package/dist/src/verification/memory-manager.js +510 -0
- package/dist/src/verification/memory-manager.js.map +1 -0
- package/dist/src/verification/middleware.js +579 -0
- package/dist/src/verification/middleware.js.map +1 -0
- package/dist/src/verification/rollback-engine.js +511 -0
- package/dist/src/verification/rollback-engine.js.map +1 -0
- package/dist/src/verification/rollback.js +1710 -0
- package/dist/src/verification/rollback.js.map +1 -0
- package/dist/src/verification/security-bypass-test.js +704 -0
- package/dist/src/verification/security-bypass-test.js.map +1 -0
- package/dist/src/verification/security.js +1125 -0
- package/dist/src/verification/security.js.map +1 -0
- package/dist/src/verification/simple-hooks.js +189 -0
- package/dist/src/verification/simple-hooks.js.map +1 -0
- package/dist/src/verification/system-tracker.js +657 -0
- package/dist/src/verification/system-tracker.js.map +1 -0
- package/dist/src/verification/telemetry.js +922 -0
- package/dist/src/verification/telemetry.js.map +1 -0
- package/dist/src/verification/test-verification.js +43 -0
- package/dist/src/verification/test-verification.js.map +1 -0
- package/dist/src/verification/tests/e2e/verification-pipeline.test.js +1027 -0
- package/dist/src/verification/tests/e2e/verification-pipeline.test.js.map +1 -0
- package/dist/src/verification/tests/integration/cross-agent-communication.test.js +638 -0
- package/dist/src/verification/tests/integration/cross-agent-communication.test.js.map +1 -0
- package/dist/src/verification/tests/mocks/false-reporting-scenarios.test.js +1029 -0
- package/dist/src/verification/tests/mocks/false-reporting-scenarios.test.js.map +1 -0
- package/dist/src/verification/tests/performance/verification-overhead.test.js +587 -0
- package/dist/src/verification/tests/performance/verification-overhead.test.js.map +1 -0
- package/dist/src/verification/tests/unit/truth-scoring.test.js +579 -0
- package/dist/src/verification/tests/unit/truth-scoring.test.js.map +1 -0
- package/dist/src/verification/tests.js +611 -0
- package/dist/src/verification/tests.js.map +1 -0
- package/dist/src/verification/truth-scorer.js +584 -0
- package/dist/src/verification/truth-scorer.js.map +1 -0
- package/dist/src/verification/types.js +56 -0
- package/dist/src/verification/types.js.map +1 -0
- package/dist/src/verification/verification-pipeline.js +884 -0
- package/dist/src/verification/verification-pipeline.js.map +1 -0
- package/dist/src/web/messaging/agent-status-tracker.js +447 -0
- package/dist/src/web/messaging/agent-status-tracker.js.map +1 -0
- package/dist/src/web/messaging/human-intervention-system.js +298 -0
- package/dist/src/web/messaging/human-intervention-system.js.map +1 -0
- package/dist/src/web/messaging/message-filter.js +289 -0
- package/dist/src/web/messaging/message-filter.js.map +1 -0
- package/dist/src/web/messaging/swarm-message-router.js +320 -0
- package/dist/src/web/messaging/swarm-message-router.js.map +1 -0
- package/dist/src/web/messaging/transparency-logger.js +415 -0
- package/dist/src/web/messaging/transparency-logger.js.map +1 -0
- package/dist/src/web/portal-server.js +440 -0
- package/dist/src/web/portal-server.js.map +1 -0
- package/dist/src/web/server.js +311 -0
- package/dist/src/web/server.js.map +1 -0
- package/dist/src/web/websocket/websocket-manager.js +509 -0
- package/dist/src/web/websocket/websocket-manager.js.map +1 -0
- package/dist/src/workflows/feature-lifecycle-manager.js +386 -0
- package/dist/src/workflows/feature-lifecycle-manager.js.map +1 -0
- package/dist/src/workflows/fullstack-coordination-manager.js +801 -0
- package/dist/src/workflows/fullstack-coordination-manager.js.map +1 -0
- package/dist/src/workflows/iterative-development-orchestrator.js +1128 -0
- package/dist/src/workflows/iterative-development-orchestrator.js.map +1 -0
- package/dist/src/workflows/progressive-rollout-manager.js +710 -0
- package/dist/src/workflows/progressive-rollout-manager.js.map +1 -0
- package/package.json +264 -0
- package/scripts/README.md +339 -0
- package/scripts/post-install-claude-md.js +50 -0
- package/src/commands/dependency-recommendations.js +551 -0
- package/src/commands/suggest-improvements.js +492 -0
- package/src/commands/suggest-templates.js +916 -0
- package/src/npx/claude-md-protection.js +169 -0
- package/wiki/INDEX.md +264 -0
- package/wiki/NAVIGATION.md +270 -0
- package/wiki/README.md +101 -0
- package/wiki/accessibility/README.md +103 -0
- package/wiki/accessibility/assistive-tech/screen-reader-support.md +912 -0
- package/wiki/accessibility/automation/agent-testing-automation.md +880 -0
- package/wiki/accessibility/guidelines/wcag-compliance.md +278 -0
- package/wiki/accessibility/i18n/internationalization-strategies.md +1022 -0
- package/wiki/accessibility/motor-accessibility/keyboard-navigation.md +1182 -0
- package/wiki/accessibility/patterns/inclusive-design-patterns.md +715 -0
- package/wiki/accessibility/testing/automated-testing.md +665 -0
- package/wiki/accessibility/visual-design/color-contrast.md +926 -0
- package/wiki/accessibility/workflows/accessibility-first-development.md +916 -0
- package/wiki/accessibility/workflows/inclusive-design-review.md +835 -0
- package/wiki/api-reference/README.md +565 -0
- package/wiki/api-reference/agent-management-api.md +931 -0
- package/wiki/api-reference/cli-api.md +630 -0
- package/wiki/api-reference/configuration-api.md +1355 -0
- package/wiki/api-reference/examples-code-samples.md +2241 -0
- package/wiki/api-reference/hooks-coordination-api.md +1406 -0
- package/wiki/api-reference/mcp-tool-specifications.md +944 -0
- package/wiki/api-reference/plugin-development.md +1695 -0
- package/wiki/api-reference/technical-architecture.md +1729 -0
- package/wiki/command-reference/README.md +305 -0
- package/wiki/command-reference/agent-commands.md +571 -0
- package/wiki/command-reference/cli-commands.md +516 -0
- package/wiki/command-reference/command-syntax.md +676 -0
- package/wiki/command-reference/expert/README.md +616 -0
- package/wiki/command-reference/expert-tier.md +791 -0
- package/wiki/command-reference/intermediate/README.md +628 -0
- package/wiki/command-reference/intermediate-tier.md +1024 -0
- package/wiki/command-reference/mcp-integration.md +412 -0
- package/wiki/command-reference/mcp-tools/README.md +1743 -0
- package/wiki/command-reference/mcp-tools/dual-access-workflows.md +911 -0
- package/wiki/command-reference/mcp-tools/index.md +201 -0
- package/wiki/command-reference/mcp-tools/integration-patterns.md +830 -0
- package/wiki/command-reference/mcp-tools/quick-reference.md +383 -0
- package/wiki/command-reference/mcp-tools/session-management.md +1183 -0
- package/wiki/command-reference/mcp-tools/task-tool-integration.md +827 -0
- package/wiki/command-reference/novice/README.md +661 -0
- package/wiki/command-reference/novice-tier.md +1142 -0
- package/wiki/command-reference/progression-guide.md +772 -0
- package/wiki/command-reference/troubleshooting.md +803 -0
- package/wiki/command-reference/workflows.md +752 -0
- package/wiki/community/README.md +328 -0
- package/wiki/community/contributing/README.md +623 -0
- package/wiki/community/contributing/code-of-conduct.md +388 -0
- package/wiki/community/contributing/collaboration-workflows.md +1 -0
- package/wiki/community/contributing/issue-reporting.md +1 -0
- package/wiki/community/contributing/onboarding-guide.md +1 -0
- package/wiki/community/contributing/recognition-system.md +1 -0
- package/wiki/community/discussions/README.md +54 -0
- package/wiki/community/learning-resources.md +476 -0
- package/wiki/community/showcase/README.md +1 -0
- package/wiki/core-concepts/README.md +656 -0
- package/wiki/core-concepts/agent-feedback-hooks/README.md +298 -0
- package/wiki/core-concepts/agents/README.md +392 -0
- package/wiki/core-concepts/agents/agent-creation-guide.md +431 -0
- package/wiki/core-concepts/agents.md +301 -0
- package/wiki/core-concepts/architecture.md +227 -0
- package/wiki/core-concepts/hooks-lifecycle/README.md +543 -0
- package/wiki/core-concepts/integration.md +507 -0
- package/wiki/core-concepts/memory-system/README.md +521 -0
- package/wiki/core-concepts/performance.md +463 -0
- package/wiki/core-concepts/sparc-methodology/README.md +465 -0
- package/wiki/core-concepts/sparc-workflow.md +407 -0
- package/wiki/core-concepts/swarm-coordination/README.md +525 -0
- package/wiki/core-concepts/swarm-coordination.md +453 -0
- package/wiki/cost-optimization/enterprise-cost-management.md +1356 -0
- package/wiki/deployment/enterprise-deployment-patterns.md +1739 -0
- package/wiki/enterprise-architecture/enterprise-architecture-overview.md +348 -0
- package/wiki/enterprise-architecture/enterprise-scaling-patterns.md +1184 -0
- package/wiki/examples/README.md +288 -0
- package/wiki/examples/automation/cicd-pipeline/README.md +1265 -0
- package/wiki/examples/basic/hello-world/README.md +434 -0
- package/wiki/examples/basic-projects/README.md +427 -0
- package/wiki/examples/enterprise-integration/README.md +602 -0
- package/wiki/examples/integration-patterns.md +825 -0
- package/wiki/examples/legacy-migration/README.md +656 -0
- package/wiki/examples/multi-cloud/README.md +1071 -0
- package/wiki/examples/performance-benchmarks.md +729 -0
- package/wiki/examples/performance-optimization/README.md +1214 -0
- package/wiki/examples/projects/rest-api/README.md +845 -0
- package/wiki/examples/real-time-collaboration/README.md +1092 -0
- package/wiki/examples/scenarios/ecommerce/README.md +1273 -0
- package/wiki/examples/swarm-patterns.md +1026 -0
- package/wiki/examples/templates/download-system.md +993 -0
- package/wiki/examples/templates/javascript/README.md +487 -0
- package/wiki/examples/templates/javascript/package.json +119 -0
- package/wiki/examples/troubleshooting/README.md +1317 -0
- package/wiki/examples/utilities/patterns/README.md +1347 -0
- package/wiki/examples/videos/01-setup.md +403 -0
- package/wiki/examples/workflow-automation/README.md +1023 -0
- package/wiki/getting-started/README.md +398 -0
- package/wiki/getting-started/benefits.md +451 -0
- package/wiki/getting-started/claude-code-mcp/README.md +319 -0
- package/wiki/getting-started/claude-code-mcp/setup.md +431 -0
- package/wiki/getting-started/claude-code-mcp/usage-examples.md +501 -0
- package/wiki/getting-started/cli-access/README.md +300 -0
- package/wiki/getting-started/cli-access/first-commands.md +319 -0
- package/wiki/getting-started/installation/README.md +469 -0
- package/wiki/getting-started/installation/troubleshooting.md +617 -0
- package/wiki/getting-started/learning-path.md +494 -0
- package/wiki/getting-started/learning-plan-generator.md +434 -0
- package/wiki/getting-started/quick-start/README.md +255 -0
- package/wiki/getting-started/quick-start/cli-tutorial.md +680 -0
- package/wiki/getting-started/quick-start/mcp-tutorial.md +544 -0
- package/wiki/governance/multi-project-coordination.md +820 -0
- package/wiki/languages/README.md +349 -0
- package/wiki/languages/go/README.md +124 -0
- package/wiki/languages/go/examples/README.md +1066 -0
- package/wiki/languages/go/frameworks/README.md +708 -0
- package/wiki/languages/go/integration/README.md +748 -0
- package/wiki/languages/go/microservices/README.md +1185 -0
- package/wiki/languages/go/performance/README.md +1310 -0
- package/wiki/languages/go/setup/README.md +397 -0
- package/wiki/languages/go/systems/README.md +1116 -0
- package/wiki/languages/go/testing/README.md +999 -0
- package/wiki/languages/java/README.md +217 -0
- package/wiki/languages/java/claude-flow-integration.md +1220 -0
- package/wiki/languages/java/enterprise-java.md +1247 -0
- package/wiki/languages/java/examples.md +1712 -0
- package/wiki/languages/java/microservices.md +1600 -0
- package/wiki/languages/java/performance.md +1122 -0
- package/wiki/languages/java/project-setup.md +504 -0
- package/wiki/languages/java/spring-boot.md +756 -0
- package/wiki/languages/java/testing.md +1323 -0
- package/wiki/languages/javascript/README.md +575 -0
- package/wiki/languages/javascript/api/README.md +1445 -0
- package/wiki/languages/javascript/backend/README.md +748 -0
- package/wiki/languages/javascript/frontend/README.md +1048 -0
- package/wiki/languages/javascript/integration.md +1107 -0
- package/wiki/languages/javascript/setup/README.md +438 -0
- package/wiki/languages/javascript/testing/README.md +1775 -0
- package/wiki/languages/python/README.md +1002 -0
- package/wiki/languages/python/data-science/README.md +1317 -0
- package/wiki/languages/python/examples/README.md +911 -0
- package/wiki/languages/python/integration.md +1515 -0
- package/wiki/languages/python/mcp-integration.md +843 -0
- package/wiki/languages/python/setup/README.md +622 -0
- package/wiki/languages/python/testing/README.md +1680 -0
- package/wiki/languages/python/web-development/README.md +974 -0
- package/wiki/languages/rust/README.md +936 -0
- package/wiki/languages/rust/examples/cli-mcp-workflows.md +850 -0
- package/wiki/languages/rust/examples/rest-api.md +1927 -0
- package/wiki/languages/rust/setup/cargo-integration.md +780 -0
- package/wiki/languages/rust/testing/quality-validation.md +1098 -0
- package/wiki/languages/rust/web-development/axum.md +1497 -0
- package/wiki/languages/rust/workflows/systems-programming.md +1189 -0
- package/wiki/languages/typescript/README.md +581 -0
- package/wiki/languages/typescript/automation.md +1070 -0
- package/wiki/languages/typescript/coordination.md +971 -0
- package/wiki/languages/typescript/enterprise.md +1368 -0
- package/wiki/languages/typescript/frameworks.md +970 -0
- package/wiki/languages/typescript/migration.md +1384 -0
- package/wiki/languages/typescript/patterns.md +694 -0
- package/wiki/languages/typescript/performance.md +1195 -0
- package/wiki/languages/typescript/setup.md +516 -0
- package/wiki/languages/typescript/workflows.md +481 -0
- package/wiki/monitoring/enterprise-observability.md +1141 -0
- package/wiki/security/enterprise-security-framework.md +1174 -0
- package/wiki/team-coordination/team-scaling-strategies.md +1486 -0
- package/wiki/troubleshooting/README.md +654 -0
- package/wiki/troubleshooting/common-issues/README.md +659 -0
- package/wiki/troubleshooting/common-issues.md +458 -0
- package/wiki/troubleshooting/error-resolution.md +763 -0
- package/wiki/troubleshooting/performance-optimization.md +540 -0
- package/wiki/tutorials/README.md +607 -0
- package/wiki/tutorials/advanced/01-multi-agent-orchestration-patterns.md +585 -0
- package/wiki/tutorials/advanced/02-enterprise-architecture-development.md +661 -0
- package/wiki/tutorials/advanced/03-advanced-sparc-methodology.md +595 -0
- package/wiki/tutorials/advanced/04-performance-optimization-workflows.md +613 -0
- package/wiki/tutorials/advanced/05-custom-agent-development.md +681 -0
- package/wiki/tutorials/advanced/06-legacy-system-integration.md +574 -0
- package/wiki/tutorials/advanced/07-production-deployment-monitoring.md +684 -0
- package/wiki/tutorials/advanced/08-enterprise-scenarios.md +700 -0
- package/wiki/tutorials/advanced/README.md +577 -0
- package/wiki/tutorials/advanced/performance-optimization.md +476 -0
- package/wiki/tutorials/advanced/swarm-orchestration.md +627 -0
- package/wiki/tutorials/beginner/01-first-project.md +532 -0
- package/wiki/tutorials/beginner/02-basic-workflows.md +523 -0
- package/wiki/tutorials/beginner/03-simple-automation.md +641 -0
- package/wiki/tutorials/beginner/04-quality-testing.md +984 -0
- package/wiki/tutorials/beginner/README.md +388 -0
- package/wiki/tutorials/exercises/ecommerce-platform.md +1370 -0
- package/wiki/tutorials/intermediate/01-multi-agent-teams.md +961 -0
- package/wiki/tutorials/intermediate/README.md +452 -0
- package/wiki/tutorials/intermediate/optimization.md +402 -0
- package/wiki/tutorials/skill-assessment.md +522 -0
- package/wiki/tutorials/skill-competency-matrix.md +548 -0
- package/wiki/tutorials/troubleshooting/command-cheatsheet.md +425 -0
- package/wiki/tutorials/troubleshooting/setup-issues.md +717 -0
- package/wiki/video-tutorials/README.md +202 -0
- package/wiki/video-tutorials/accessibility/README.md +1349 -0
- package/wiki/video-tutorials/community/README.md +1366 -0
- package/wiki/video-tutorials/content-organization/README.md +1295 -0
- package/wiki/video-tutorials/distribution/README.md +1093 -0
- package/wiki/video-tutorials/editing/README.md +751 -0
- package/wiki/video-tutorials/interactive/README.md +1151 -0
- package/wiki/video-tutorials/multi-language/README.md +1384 -0
- package/wiki/video-tutorials/planning/README.md +461 -0
- package/wiki/video-tutorials/recording/README.md +619 -0
- package/wiki/video-tutorials/technical-specs/README.md +1018 -0
|
@@ -0,0 +1,1680 @@
|
|
|
1
|
+
# Python Testing with Claude-Flow
|
|
2
|
+
|
|
3
|
+
Comprehensive guide to Python testing strategies, automation, and continuous integration using claude-flow orchestration for robust, reliable applications.
|
|
4
|
+
|
|
5
|
+
## 🧪 Testing Overview
|
|
6
|
+
|
|
7
|
+
### Testing Philosophy with Claude-Flow
|
|
8
|
+
|
|
9
|
+
| Testing Level | Agent Type | Framework | Coverage Goal |
|
|
10
|
+
|---------------|------------|-----------|---------------|
|
|
11
|
+
| **Unit Tests** | `tester` | pytest | 90%+ |
|
|
12
|
+
| **Integration Tests** | `backend-dev` | pytest + TestClient | 80%+ |
|
|
13
|
+
| **E2E Tests** | `cicd-engineer` | Selenium/Playwright | 70%+ |
|
|
14
|
+
| **Performance Tests** | `performance-optimizer` | locust, pytest-benchmark | Key paths |
|
|
15
|
+
|
|
16
|
+
## ⚡ Quick Start: Testing Setup
|
|
17
|
+
|
|
18
|
+
### Automated Testing Environment
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
# Initialize testing environment with claude-flow
|
|
22
|
+
npx claude-flow@alpha sparc run architect "Comprehensive Python testing framework"
|
|
23
|
+
|
|
24
|
+
# Spawn testing team
|
|
25
|
+
Task("Test Engineer", "Setup pytest framework with fixtures and mocks", "tester")
|
|
26
|
+
Task("Quality Engineer", "Configure code coverage and quality gates", "reviewer")
|
|
27
|
+
Task("Performance Tester", "Create performance testing suite", "performance-optimizer")
|
|
28
|
+
Task("CI/CD Engineer", "Setup automated testing pipeline", "cicd-engineer")
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### Testing Project Structure
|
|
32
|
+
|
|
33
|
+
```
|
|
34
|
+
project/
|
|
35
|
+
├── src/
|
|
36
|
+
│ └── app/
|
|
37
|
+
│ ├── __init__.py
|
|
38
|
+
│ ├── main.py
|
|
39
|
+
│ ├── models/
|
|
40
|
+
│ ├── services/
|
|
41
|
+
│ └── utils/
|
|
42
|
+
├── tests/
|
|
43
|
+
│ ├── __init__.py
|
|
44
|
+
│ ├── conftest.py # Shared fixtures
|
|
45
|
+
│ ├── unit/
|
|
46
|
+
│ │ ├── test_models.py
|
|
47
|
+
│ │ ├── test_services.py
|
|
48
|
+
│ │ └── test_utils.py
|
|
49
|
+
│ ├── integration/
|
|
50
|
+
│ │ ├── test_api.py
|
|
51
|
+
│ │ └── test_database.py
|
|
52
|
+
│ ├── e2e/
|
|
53
|
+
│ │ └── test_workflows.py
|
|
54
|
+
│ ├── performance/
|
|
55
|
+
│ │ └── test_load.py
|
|
56
|
+
│ └── fixtures/
|
|
57
|
+
│ └── sample_data.py
|
|
58
|
+
├── pytest.ini
|
|
59
|
+
├── tox.ini
|
|
60
|
+
└── .coveragerc
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## 🔬 Unit Testing with Pytest
|
|
64
|
+
|
|
65
|
+
### Core Testing Framework
|
|
66
|
+
|
|
67
|
+
```python
|
|
68
|
+
# tests/conftest.py - Shared test configuration
|
|
69
|
+
import pytest
|
|
70
|
+
import tempfile
|
|
71
|
+
import os
|
|
72
|
+
from unittest.mock import Mock, patch
|
|
73
|
+
from sqlalchemy import create_engine
|
|
74
|
+
from sqlalchemy.orm import sessionmaker
|
|
75
|
+
from fastapi.testclient import TestClient
|
|
76
|
+
|
|
77
|
+
from app.main import app
|
|
78
|
+
from app.core.database import get_db, Base
|
|
79
|
+
from app.models.user import User
|
|
80
|
+
from app.core.config import settings
|
|
81
|
+
|
|
82
|
+
# Test database setup
|
|
83
|
+
@pytest.fixture(scope="session")
|
|
84
|
+
def test_engine():
|
|
85
|
+
"""Create test database engine."""
|
|
86
|
+
# Use in-memory SQLite for testing
|
|
87
|
+
engine = create_engine(
|
|
88
|
+
"sqlite:///:memory:",
|
|
89
|
+
connect_args={"check_same_thread": False}
|
|
90
|
+
)
|
|
91
|
+
Base.metadata.create_all(bind=engine)
|
|
92
|
+
yield engine
|
|
93
|
+
Base.metadata.drop_all(bind=engine)
|
|
94
|
+
|
|
95
|
+
@pytest.fixture
|
|
96
|
+
def test_db_session(test_engine):
|
|
97
|
+
"""Create test database session."""
|
|
98
|
+
TestingSessionLocal = sessionmaker(
|
|
99
|
+
autocommit=False,
|
|
100
|
+
autoflush=False,
|
|
101
|
+
bind=test_engine
|
|
102
|
+
)
|
|
103
|
+
session = TestingSessionLocal()
|
|
104
|
+
try:
|
|
105
|
+
yield session
|
|
106
|
+
finally:
|
|
107
|
+
session.close()
|
|
108
|
+
|
|
109
|
+
@pytest.fixture
|
|
110
|
+
def test_client(test_db_session):
|
|
111
|
+
"""Create test client with database override."""
|
|
112
|
+
def override_get_db():
|
|
113
|
+
try:
|
|
114
|
+
yield test_db_session
|
|
115
|
+
finally:
|
|
116
|
+
test_db_session.close()
|
|
117
|
+
|
|
118
|
+
app.dependency_overrides[get_db] = override_get_db
|
|
119
|
+
with TestClient(app) as client:
|
|
120
|
+
yield client
|
|
121
|
+
app.dependency_overrides.clear()
|
|
122
|
+
|
|
123
|
+
@pytest.fixture
|
|
124
|
+
def sample_user_data():
|
|
125
|
+
"""Sample user data for testing."""
|
|
126
|
+
return {
|
|
127
|
+
"email": "test@example.com",
|
|
128
|
+
"password": "testpassword123",
|
|
129
|
+
"full_name": "Test User",
|
|
130
|
+
"is_active": True
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
@pytest.fixture
|
|
134
|
+
def test_user(test_db_session, sample_user_data):
|
|
135
|
+
"""Create test user in database."""
|
|
136
|
+
from app.services.user_service import UserService
|
|
137
|
+
from app.schemas.user import UserCreate
|
|
138
|
+
|
|
139
|
+
user_service = UserService(test_db_session)
|
|
140
|
+
user_create = UserCreate(**sample_user_data)
|
|
141
|
+
user = user_service.create(user_create)
|
|
142
|
+
test_db_session.commit()
|
|
143
|
+
test_db_session.refresh(user)
|
|
144
|
+
return user
|
|
145
|
+
|
|
146
|
+
# Notification helpers for claude-flow integration
|
|
147
|
+
def notify_test_progress(message):
|
|
148
|
+
"""Notify claude-flow of test progress."""
|
|
149
|
+
try:
|
|
150
|
+
import subprocess
|
|
151
|
+
subprocess.run([
|
|
152
|
+
"npx", "claude-flow@alpha", "hooks", "notify",
|
|
153
|
+
"--message", f"Test: {message}"
|
|
154
|
+
], check=True, capture_output=True)
|
|
155
|
+
except:
|
|
156
|
+
print(f"Test: {message}")
|
|
157
|
+
|
|
158
|
+
# Hooks for test lifecycle
|
|
159
|
+
@pytest.fixture(autouse=True)
|
|
160
|
+
def test_lifecycle():
|
|
161
|
+
"""Test lifecycle hooks."""
|
|
162
|
+
notify_test_progress("Test started")
|
|
163
|
+
yield
|
|
164
|
+
notify_test_progress("Test completed")
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
### Model Testing
|
|
168
|
+
|
|
169
|
+
```python
|
|
170
|
+
# tests/unit/test_models.py - Model unit tests
|
|
171
|
+
import pytest
|
|
172
|
+
from datetime import datetime
|
|
173
|
+
from sqlalchemy.exc import IntegrityError
|
|
174
|
+
|
|
175
|
+
from app.models.user import User
|
|
176
|
+
from app.models.product import Product, Category
|
|
177
|
+
|
|
178
|
+
class TestUserModel:
|
|
179
|
+
"""Test User model functionality."""
|
|
180
|
+
|
|
181
|
+
def test_user_creation(self, test_db_session):
|
|
182
|
+
"""Test user creation with valid data."""
|
|
183
|
+
user = User(
|
|
184
|
+
email="test@example.com",
|
|
185
|
+
username="testuser",
|
|
186
|
+
full_name="Test User"
|
|
187
|
+
)
|
|
188
|
+
user.set_password("password123")
|
|
189
|
+
|
|
190
|
+
test_db_session.add(user)
|
|
191
|
+
test_db_session.commit()
|
|
192
|
+
|
|
193
|
+
assert user.id is not None
|
|
194
|
+
assert user.email == "test@example.com"
|
|
195
|
+
assert user.check_password("password123")
|
|
196
|
+
assert not user.check_password("wrongpassword")
|
|
197
|
+
|
|
198
|
+
def test_user_email_uniqueness(self, test_db_session):
|
|
199
|
+
"""Test email uniqueness constraint."""
|
|
200
|
+
user1 = User(email="duplicate@example.com", username="user1")
|
|
201
|
+
user2 = User(email="duplicate@example.com", username="user2")
|
|
202
|
+
|
|
203
|
+
test_db_session.add(user1)
|
|
204
|
+
test_db_session.commit()
|
|
205
|
+
|
|
206
|
+
test_db_session.add(user2)
|
|
207
|
+
with pytest.raises(IntegrityError):
|
|
208
|
+
test_db_session.commit()
|
|
209
|
+
|
|
210
|
+
def test_user_password_hashing(self, test_db_session):
|
|
211
|
+
"""Test password hashing functionality."""
|
|
212
|
+
user = User(email="hash@example.com", username="hashuser")
|
|
213
|
+
password = "securepassword123"
|
|
214
|
+
user.set_password(password)
|
|
215
|
+
|
|
216
|
+
# Password should be hashed, not stored in plain text
|
|
217
|
+
assert user.password_hash != password
|
|
218
|
+
assert user.check_password(password)
|
|
219
|
+
assert not user.check_password("wrongpassword")
|
|
220
|
+
|
|
221
|
+
def test_user_representation(self, test_db_session):
|
|
222
|
+
"""Test user string representation."""
|
|
223
|
+
user = User(email="repr@example.com", username="repruser")
|
|
224
|
+
test_db_session.add(user)
|
|
225
|
+
test_db_session.commit()
|
|
226
|
+
|
|
227
|
+
assert str(user) == "repr@example.com"
|
|
228
|
+
|
|
229
|
+
class TestProductModel:
|
|
230
|
+
"""Test Product model functionality."""
|
|
231
|
+
|
|
232
|
+
@pytest.fixture
|
|
233
|
+
def sample_category(self, test_db_session):
|
|
234
|
+
"""Create sample category for testing."""
|
|
235
|
+
category = Category(
|
|
236
|
+
name="Test Category",
|
|
237
|
+
slug="test-category",
|
|
238
|
+
description="Test category description"
|
|
239
|
+
)
|
|
240
|
+
test_db_session.add(category)
|
|
241
|
+
test_db_session.commit()
|
|
242
|
+
test_db_session.refresh(category)
|
|
243
|
+
return category
|
|
244
|
+
|
|
245
|
+
@pytest.fixture
|
|
246
|
+
def sample_user(self, test_db_session):
|
|
247
|
+
"""Create sample user for testing."""
|
|
248
|
+
user = User(email="product@example.com", username="productuser")
|
|
249
|
+
test_db_session.add(user)
|
|
250
|
+
test_db_session.commit()
|
|
251
|
+
test_db_session.refresh(user)
|
|
252
|
+
return user
|
|
253
|
+
|
|
254
|
+
def test_product_creation(self, test_db_session, sample_category, sample_user):
|
|
255
|
+
"""Test product creation with relationships."""
|
|
256
|
+
product = Product(
|
|
257
|
+
name="Test Product",
|
|
258
|
+
slug="test-product",
|
|
259
|
+
description="Test product description",
|
|
260
|
+
price=99.99,
|
|
261
|
+
category=sample_category,
|
|
262
|
+
created_by=sample_user,
|
|
263
|
+
stock_quantity=10
|
|
264
|
+
)
|
|
265
|
+
|
|
266
|
+
test_db_session.add(product)
|
|
267
|
+
test_db_session.commit()
|
|
268
|
+
|
|
269
|
+
assert product.id is not None
|
|
270
|
+
assert product.name == "Test Product"
|
|
271
|
+
assert product.price == 99.99
|
|
272
|
+
assert product.category_id == sample_category.id
|
|
273
|
+
assert product.created_by_id == sample_user.id
|
|
274
|
+
|
|
275
|
+
def test_product_category_relationship(self, test_db_session, sample_category, sample_user):
|
|
276
|
+
"""Test product-category relationship."""
|
|
277
|
+
product = Product(
|
|
278
|
+
name="Related Product",
|
|
279
|
+
slug="related-product",
|
|
280
|
+
description="Product with category relationship",
|
|
281
|
+
price=149.99,
|
|
282
|
+
category=sample_category,
|
|
283
|
+
created_by=sample_user
|
|
284
|
+
)
|
|
285
|
+
|
|
286
|
+
test_db_session.add(product)
|
|
287
|
+
test_db_session.commit()
|
|
288
|
+
test_db_session.refresh(product)
|
|
289
|
+
|
|
290
|
+
# Test forward relationship
|
|
291
|
+
assert product.category.name == "Test Category"
|
|
292
|
+
|
|
293
|
+
# Test reverse relationship
|
|
294
|
+
assert product in sample_category.products
|
|
295
|
+
|
|
296
|
+
def test_product_slug_uniqueness(self, test_db_session, sample_category, sample_user):
|
|
297
|
+
"""Test product slug uniqueness."""
|
|
298
|
+
product1 = Product(
|
|
299
|
+
name="Product 1",
|
|
300
|
+
slug="duplicate-slug",
|
|
301
|
+
description="First product",
|
|
302
|
+
price=99.99,
|
|
303
|
+
category=sample_category,
|
|
304
|
+
created_by=sample_user
|
|
305
|
+
)
|
|
306
|
+
|
|
307
|
+
product2 = Product(
|
|
308
|
+
name="Product 2",
|
|
309
|
+
slug="duplicate-slug",
|
|
310
|
+
description="Second product",
|
|
311
|
+
price=149.99,
|
|
312
|
+
category=sample_category,
|
|
313
|
+
created_by=sample_user
|
|
314
|
+
)
|
|
315
|
+
|
|
316
|
+
test_db_session.add(product1)
|
|
317
|
+
test_db_session.commit()
|
|
318
|
+
|
|
319
|
+
test_db_session.add(product2)
|
|
320
|
+
with pytest.raises(IntegrityError):
|
|
321
|
+
test_db_session.commit()
|
|
322
|
+
```
|
|
323
|
+
|
|
324
|
+
### Service Layer Testing
|
|
325
|
+
|
|
326
|
+
```python
|
|
327
|
+
# tests/unit/test_services.py - Service layer tests
|
|
328
|
+
import pytest
|
|
329
|
+
from unittest.mock import Mock, patch, MagicMock
|
|
330
|
+
from datetime import datetime, timedelta
|
|
331
|
+
|
|
332
|
+
from app.services.user_service import UserService
|
|
333
|
+
from app.services.email_service import EmailService
|
|
334
|
+
from app.services.auth_service import AuthService
|
|
335
|
+
from app.schemas.user import UserCreate, UserUpdate
|
|
336
|
+
from app.core.exceptions import UserNotFoundError, InvalidCredentialsError
|
|
337
|
+
|
|
338
|
+
class TestUserService:
|
|
339
|
+
"""Test UserService functionality."""
|
|
340
|
+
|
|
341
|
+
@pytest.fixture
|
|
342
|
+
def user_service(self, test_db_session):
|
|
343
|
+
"""Create UserService instance."""
|
|
344
|
+
return UserService(test_db_session)
|
|
345
|
+
|
|
346
|
+
def test_create_user_success(self, user_service, sample_user_data):
|
|
347
|
+
"""Test successful user creation."""
|
|
348
|
+
user_create = UserCreate(**sample_user_data)
|
|
349
|
+
user = user_service.create(user_create)
|
|
350
|
+
|
|
351
|
+
assert user.email == sample_user_data["email"]
|
|
352
|
+
assert user.full_name == sample_user_data["full_name"]
|
|
353
|
+
assert user.check_password(sample_user_data["password"])
|
|
354
|
+
assert user.is_active
|
|
355
|
+
|
|
356
|
+
def test_create_user_duplicate_email(self, user_service, sample_user_data):
|
|
357
|
+
"""Test user creation with duplicate email."""
|
|
358
|
+
user_create = UserCreate(**sample_user_data)
|
|
359
|
+
|
|
360
|
+
# Create first user
|
|
361
|
+
user_service.create(user_create)
|
|
362
|
+
|
|
363
|
+
# Attempt to create second user with same email
|
|
364
|
+
with pytest.raises(ValueError, match="Email already registered"):
|
|
365
|
+
user_service.create(user_create)
|
|
366
|
+
|
|
367
|
+
def test_get_user_by_id(self, user_service, test_user):
|
|
368
|
+
"""Test retrieving user by ID."""
|
|
369
|
+
retrieved_user = user_service.get(test_user.id)
|
|
370
|
+
|
|
371
|
+
assert retrieved_user.id == test_user.id
|
|
372
|
+
assert retrieved_user.email == test_user.email
|
|
373
|
+
|
|
374
|
+
def test_get_user_not_found(self, user_service):
|
|
375
|
+
"""Test retrieving non-existent user."""
|
|
376
|
+
with pytest.raises(UserNotFoundError):
|
|
377
|
+
user_service.get(99999)
|
|
378
|
+
|
|
379
|
+
def test_update_user(self, user_service, test_user):
|
|
380
|
+
"""Test user update functionality."""
|
|
381
|
+
update_data = UserUpdate(
|
|
382
|
+
full_name="Updated Name",
|
|
383
|
+
bio="Updated bio"
|
|
384
|
+
)
|
|
385
|
+
|
|
386
|
+
updated_user = user_service.update(test_user, update_data)
|
|
387
|
+
|
|
388
|
+
assert updated_user.full_name == "Updated Name"
|
|
389
|
+
assert updated_user.bio == "Updated bio"
|
|
390
|
+
assert updated_user.email == test_user.email # Unchanged
|
|
391
|
+
|
|
392
|
+
def test_delete_user(self, user_service, test_user):
|
|
393
|
+
"""Test user deletion."""
|
|
394
|
+
user_id = test_user.id
|
|
395
|
+
user_service.delete(test_user)
|
|
396
|
+
|
|
397
|
+
with pytest.raises(UserNotFoundError):
|
|
398
|
+
user_service.get(user_id)
|
|
399
|
+
|
|
400
|
+
@patch('app.services.user_service.send_welcome_email')
|
|
401
|
+
def test_create_user_sends_email(self, mock_send_email, user_service, sample_user_data):
|
|
402
|
+
"""Test that user creation sends welcome email."""
|
|
403
|
+
user_create = UserCreate(**sample_user_data)
|
|
404
|
+
user = user_service.create(user_create)
|
|
405
|
+
|
|
406
|
+
mock_send_email.assert_called_once_with(user.email, user.full_name)
|
|
407
|
+
|
|
408
|
+
class TestEmailService:
|
|
409
|
+
"""Test EmailService functionality."""
|
|
410
|
+
|
|
411
|
+
@pytest.fixture
|
|
412
|
+
def email_service(self):
|
|
413
|
+
"""Create EmailService instance."""
|
|
414
|
+
return EmailService()
|
|
415
|
+
|
|
416
|
+
@patch('smtplib.SMTP')
|
|
417
|
+
def test_send_email_success(self, mock_smtp, email_service):
|
|
418
|
+
"""Test successful email sending."""
|
|
419
|
+
mock_server = Mock()
|
|
420
|
+
mock_smtp.return_value.__enter__.return_value = mock_server
|
|
421
|
+
|
|
422
|
+
result = email_service.send_email(
|
|
423
|
+
to_email="test@example.com",
|
|
424
|
+
subject="Test Subject",
|
|
425
|
+
body="Test body"
|
|
426
|
+
)
|
|
427
|
+
|
|
428
|
+
assert result is True
|
|
429
|
+
mock_server.starttls.assert_called_once()
|
|
430
|
+
mock_server.login.assert_called_once()
|
|
431
|
+
mock_server.send_message.assert_called_once()
|
|
432
|
+
|
|
433
|
+
@patch('smtplib.SMTP')
|
|
434
|
+
def test_send_email_failure(self, mock_smtp, email_service):
|
|
435
|
+
"""Test email sending failure."""
|
|
436
|
+
mock_smtp.side_effect = Exception("SMTP Error")
|
|
437
|
+
|
|
438
|
+
result = email_service.send_email(
|
|
439
|
+
to_email="test@example.com",
|
|
440
|
+
subject="Test Subject",
|
|
441
|
+
body="Test body"
|
|
442
|
+
)
|
|
443
|
+
|
|
444
|
+
assert result is False
|
|
445
|
+
|
|
446
|
+
def test_email_template_rendering(self, email_service):
|
|
447
|
+
"""Test email template rendering."""
|
|
448
|
+
template_vars = {
|
|
449
|
+
"user_name": "John Doe",
|
|
450
|
+
"activation_link": "https://example.com/activate"
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
rendered = email_service.render_template("welcome.html", template_vars)
|
|
454
|
+
|
|
455
|
+
assert "John Doe" in rendered
|
|
456
|
+
assert "https://example.com/activate" in rendered
|
|
457
|
+
|
|
458
|
+
class TestAuthService:
|
|
459
|
+
"""Test AuthService functionality."""
|
|
460
|
+
|
|
461
|
+
@pytest.fixture
|
|
462
|
+
def auth_service(self, test_db_session):
|
|
463
|
+
"""Create AuthService instance."""
|
|
464
|
+
return AuthService(test_db_session)
|
|
465
|
+
|
|
466
|
+
def test_authenticate_success(self, auth_service, test_user):
|
|
467
|
+
"""Test successful authentication."""
|
|
468
|
+
# Set known password for test user
|
|
469
|
+
test_user.set_password("testpassword")
|
|
470
|
+
|
|
471
|
+
authenticated_user = auth_service.authenticate(
|
|
472
|
+
test_user.email,
|
|
473
|
+
"testpassword"
|
|
474
|
+
)
|
|
475
|
+
|
|
476
|
+
assert authenticated_user.id == test_user.id
|
|
477
|
+
|
|
478
|
+
def test_authenticate_invalid_email(self, auth_service):
|
|
479
|
+
"""Test authentication with invalid email."""
|
|
480
|
+
with pytest.raises(InvalidCredentialsError):
|
|
481
|
+
auth_service.authenticate("nonexistent@example.com", "password")
|
|
482
|
+
|
|
483
|
+
def test_authenticate_invalid_password(self, auth_service, test_user):
|
|
484
|
+
"""Test authentication with invalid password."""
|
|
485
|
+
test_user.set_password("correctpassword")
|
|
486
|
+
|
|
487
|
+
with pytest.raises(InvalidCredentialsError):
|
|
488
|
+
auth_service.authenticate(test_user.email, "wrongpassword")
|
|
489
|
+
|
|
490
|
+
@patch('app.core.security.create_access_token')
|
|
491
|
+
def test_create_access_token(self, mock_create_token, auth_service, test_user):
|
|
492
|
+
"""Test access token creation."""
|
|
493
|
+
mock_create_token.return_value = "mock_token"
|
|
494
|
+
|
|
495
|
+
token = auth_service.create_access_token(test_user)
|
|
496
|
+
|
|
497
|
+
assert token == "mock_token"
|
|
498
|
+
mock_create_token.assert_called_once_with(
|
|
499
|
+
data={"sub": test_user.email}
|
|
500
|
+
)
|
|
501
|
+
|
|
502
|
+
def test_refresh_token_valid(self, auth_service, test_user):
|
|
503
|
+
"""Test token refresh with valid token."""
|
|
504
|
+
# Create initial token
|
|
505
|
+
access_token = auth_service.create_access_token(test_user)
|
|
506
|
+
|
|
507
|
+
# Refresh token
|
|
508
|
+
new_token = auth_service.refresh_token(access_token)
|
|
509
|
+
|
|
510
|
+
assert new_token is not None
|
|
511
|
+
assert new_token != access_token
|
|
512
|
+
|
|
513
|
+
def test_refresh_token_invalid(self, auth_service):
|
|
514
|
+
"""Test token refresh with invalid token."""
|
|
515
|
+
with pytest.raises(InvalidCredentialsError):
|
|
516
|
+
auth_service.refresh_token("invalid_token")
|
|
517
|
+
```
|
|
518
|
+
|
|
519
|
+
## 🔗 Integration Testing
|
|
520
|
+
|
|
521
|
+
### API Integration Tests
|
|
522
|
+
|
|
523
|
+
```python
|
|
524
|
+
# tests/integration/test_api.py - API integration tests
|
|
525
|
+
import pytest
|
|
526
|
+
from fastapi import status
|
|
527
|
+
import json
|
|
528
|
+
|
|
529
|
+
class TestUserAPI:
|
|
530
|
+
"""Test User API endpoints."""
|
|
531
|
+
|
|
532
|
+
def test_register_user_success(self, test_client):
|
|
533
|
+
"""Test successful user registration."""
|
|
534
|
+
user_data = {
|
|
535
|
+
"email": "newuser@example.com",
|
|
536
|
+
"password": "securepassword123",
|
|
537
|
+
"full_name": "New User"
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
response = test_client.post("/auth/register", json=user_data)
|
|
541
|
+
|
|
542
|
+
assert response.status_code == status.HTTP_201_CREATED
|
|
543
|
+
data = response.json()
|
|
544
|
+
assert data["email"] == user_data["email"]
|
|
545
|
+
assert data["full_name"] == user_data["full_name"]
|
|
546
|
+
assert "id" in data
|
|
547
|
+
assert "password" not in data # Password should not be returned
|
|
548
|
+
|
|
549
|
+
def test_register_user_duplicate_email(self, test_client, test_user):
|
|
550
|
+
"""Test user registration with duplicate email."""
|
|
551
|
+
user_data = {
|
|
552
|
+
"email": test_user.email,
|
|
553
|
+
"password": "password123",
|
|
554
|
+
"full_name": "Duplicate User"
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
response = test_client.post("/auth/register", json=user_data)
|
|
558
|
+
|
|
559
|
+
assert response.status_code == status.HTTP_400_BAD_REQUEST
|
|
560
|
+
assert "already registered" in response.json()["detail"]
|
|
561
|
+
|
|
562
|
+
def test_login_success(self, test_client, test_user):
|
|
563
|
+
"""Test successful user login."""
|
|
564
|
+
# Set password for test user
|
|
565
|
+
test_user.set_password("testpassword")
|
|
566
|
+
|
|
567
|
+
login_data = {
|
|
568
|
+
"username": test_user.email,
|
|
569
|
+
"password": "testpassword"
|
|
570
|
+
}
|
|
571
|
+
|
|
572
|
+
response = test_client.post("/auth/login", data=login_data)
|
|
573
|
+
|
|
574
|
+
assert response.status_code == status.HTTP_200_OK
|
|
575
|
+
data = response.json()
|
|
576
|
+
assert "access_token" in data
|
|
577
|
+
assert data["token_type"] == "bearer"
|
|
578
|
+
|
|
579
|
+
def test_login_invalid_credentials(self, test_client, test_user):
|
|
580
|
+
"""Test login with invalid credentials."""
|
|
581
|
+
login_data = {
|
|
582
|
+
"username": test_user.email,
|
|
583
|
+
"password": "wrongpassword"
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
response = test_client.post("/auth/login", data=login_data)
|
|
587
|
+
|
|
588
|
+
assert response.status_code == status.HTTP_401_UNAUTHORIZED
|
|
589
|
+
|
|
590
|
+
def test_get_current_user(self, test_client, test_user):
|
|
591
|
+
"""Test getting current user information."""
|
|
592
|
+
# Login and get token
|
|
593
|
+
test_user.set_password("testpassword")
|
|
594
|
+
login_data = {
|
|
595
|
+
"username": test_user.email,
|
|
596
|
+
"password": "testpassword"
|
|
597
|
+
}
|
|
598
|
+
login_response = test_client.post("/auth/login", data=login_data)
|
|
599
|
+
token = login_response.json()["access_token"]
|
|
600
|
+
|
|
601
|
+
# Get user info
|
|
602
|
+
headers = {"Authorization": f"Bearer {token}"}
|
|
603
|
+
response = test_client.get("/users/me", headers=headers)
|
|
604
|
+
|
|
605
|
+
assert response.status_code == status.HTTP_200_OK
|
|
606
|
+
data = response.json()
|
|
607
|
+
assert data["email"] == test_user.email
|
|
608
|
+
|
|
609
|
+
def test_update_user_profile(self, test_client, test_user):
|
|
610
|
+
"""Test updating user profile."""
|
|
611
|
+
# Login and get token
|
|
612
|
+
test_user.set_password("testpassword")
|
|
613
|
+
login_data = {
|
|
614
|
+
"username": test_user.email,
|
|
615
|
+
"password": "testpassword"
|
|
616
|
+
}
|
|
617
|
+
login_response = test_client.post("/auth/login", data=login_data)
|
|
618
|
+
token = login_response.json()["access_token"]
|
|
619
|
+
|
|
620
|
+
# Update profile
|
|
621
|
+
update_data = {
|
|
622
|
+
"full_name": "Updated Name",
|
|
623
|
+
"bio": "Updated bio"
|
|
624
|
+
}
|
|
625
|
+
headers = {"Authorization": f"Bearer {token}"}
|
|
626
|
+
response = test_client.put(f"/users/{test_user.id}", json=update_data, headers=headers)
|
|
627
|
+
|
|
628
|
+
assert response.status_code == status.HTTP_200_OK
|
|
629
|
+
data = response.json()
|
|
630
|
+
assert data["full_name"] == "Updated Name"
|
|
631
|
+
assert data["bio"] == "Updated bio"
|
|
632
|
+
|
|
633
|
+
def test_unauthorized_access(self, test_client):
|
|
634
|
+
"""Test accessing protected endpoint without authentication."""
|
|
635
|
+
response = test_client.get("/users/me")
|
|
636
|
+
|
|
637
|
+
assert response.status_code == status.HTTP_401_UNAUTHORIZED
|
|
638
|
+
|
|
639
|
+
class TestProductAPI:
|
|
640
|
+
"""Test Product API endpoints."""
|
|
641
|
+
|
|
642
|
+
@pytest.fixture
|
|
643
|
+
def authenticated_headers(self, test_client, test_user):
|
|
644
|
+
"""Get authentication headers."""
|
|
645
|
+
test_user.set_password("testpassword")
|
|
646
|
+
login_data = {
|
|
647
|
+
"username": test_user.email,
|
|
648
|
+
"password": "testpassword"
|
|
649
|
+
}
|
|
650
|
+
login_response = test_client.post("/auth/login", data=login_data)
|
|
651
|
+
token = login_response.json()["access_token"]
|
|
652
|
+
return {"Authorization": f"Bearer {token}"}
|
|
653
|
+
|
|
654
|
+
@pytest.fixture
|
|
655
|
+
def sample_category(self, test_db_session):
|
|
656
|
+
"""Create sample category."""
|
|
657
|
+
from app.models.product import Category
|
|
658
|
+
category = Category(
|
|
659
|
+
name="Test Category",
|
|
660
|
+
slug="test-category",
|
|
661
|
+
description="Test category"
|
|
662
|
+
)
|
|
663
|
+
test_db_session.add(category)
|
|
664
|
+
test_db_session.commit()
|
|
665
|
+
test_db_session.refresh(category)
|
|
666
|
+
return category
|
|
667
|
+
|
|
668
|
+
def test_create_product(self, test_client, authenticated_headers, sample_category):
|
|
669
|
+
"""Test product creation."""
|
|
670
|
+
product_data = {
|
|
671
|
+
"name": "Test Product",
|
|
672
|
+
"slug": "test-product",
|
|
673
|
+
"description": "Test product description",
|
|
674
|
+
"price": 99.99,
|
|
675
|
+
"category_id": sample_category.id,
|
|
676
|
+
"stock_quantity": 10
|
|
677
|
+
}
|
|
678
|
+
|
|
679
|
+
response = test_client.post("/products/", json=product_data, headers=authenticated_headers)
|
|
680
|
+
|
|
681
|
+
assert response.status_code == status.HTTP_201_CREATED
|
|
682
|
+
data = response.json()
|
|
683
|
+
assert data["name"] == product_data["name"]
|
|
684
|
+
assert data["price"] == product_data["price"]
|
|
685
|
+
|
|
686
|
+
def test_list_products(self, test_client):
|
|
687
|
+
"""Test product listing (public endpoint)."""
|
|
688
|
+
response = test_client.get("/products/")
|
|
689
|
+
|
|
690
|
+
assert response.status_code == status.HTTP_200_OK
|
|
691
|
+
data = response.json()
|
|
692
|
+
assert "results" in data
|
|
693
|
+
assert isinstance(data["results"], list)
|
|
694
|
+
|
|
695
|
+
def test_get_product_detail(self, test_client, sample_category, test_user, test_db_session):
|
|
696
|
+
"""Test getting product details."""
|
|
697
|
+
from app.models.product import Product
|
|
698
|
+
|
|
699
|
+
# Create test product
|
|
700
|
+
product = Product(
|
|
701
|
+
name="Detail Product",
|
|
702
|
+
slug="detail-product",
|
|
703
|
+
description="Product for detail test",
|
|
704
|
+
price=149.99,
|
|
705
|
+
category=sample_category,
|
|
706
|
+
created_by=test_user,
|
|
707
|
+
stock_quantity=5
|
|
708
|
+
)
|
|
709
|
+
test_db_session.add(product)
|
|
710
|
+
test_db_session.commit()
|
|
711
|
+
test_db_session.refresh(product)
|
|
712
|
+
|
|
713
|
+
response = test_client.get(f"/products/{product.id}")
|
|
714
|
+
|
|
715
|
+
assert response.status_code == status.HTTP_200_OK
|
|
716
|
+
data = response.json()
|
|
717
|
+
assert data["name"] == "Detail Product"
|
|
718
|
+
assert data["slug"] == "detail-product"
|
|
719
|
+
|
|
720
|
+
def test_filter_products_by_category(self, test_client, sample_category):
|
|
721
|
+
"""Test filtering products by category."""
|
|
722
|
+
response = test_client.get(f"/products/?category_id={sample_category.id}")
|
|
723
|
+
|
|
724
|
+
assert response.status_code == status.HTTP_200_OK
|
|
725
|
+
data = response.json()
|
|
726
|
+
# All returned products should belong to the specified category
|
|
727
|
+
for product in data["results"]:
|
|
728
|
+
assert product["category"]["id"] == sample_category.id
|
|
729
|
+
|
|
730
|
+
def test_search_products(self, test_client):
|
|
731
|
+
"""Test product search functionality."""
|
|
732
|
+
response = test_client.get("/products/?search=test")
|
|
733
|
+
|
|
734
|
+
assert response.status_code == status.HTTP_200_OK
|
|
735
|
+
data = response.json()
|
|
736
|
+
# Results should contain search term (case-insensitive)
|
|
737
|
+
for product in data["results"]:
|
|
738
|
+
assert "test" in product["name"].lower() or "test" in product["description"].lower()
|
|
739
|
+
```
|
|
740
|
+
|
|
741
|
+
### Database Integration Tests
|
|
742
|
+
|
|
743
|
+
```python
|
|
744
|
+
# tests/integration/test_database.py - Database integration tests
|
|
745
|
+
import pytest
|
|
746
|
+
from sqlalchemy import text
|
|
747
|
+
from sqlalchemy.exc import IntegrityError
|
|
748
|
+
|
|
749
|
+
from app.core.database import engine, SessionLocal
|
|
750
|
+
from app.models.user import User
|
|
751
|
+
from app.models.product import Product, Category
|
|
752
|
+
|
|
753
|
+
class TestDatabaseOperations:
|
|
754
|
+
"""Test database operations and constraints."""
|
|
755
|
+
|
|
756
|
+
def test_database_connection(self):
|
|
757
|
+
"""Test database connection."""
|
|
758
|
+
with engine.connect() as connection:
|
|
759
|
+
result = connection.execute(text("SELECT 1"))
|
|
760
|
+
assert result.fetchone()[0] == 1
|
|
761
|
+
|
|
762
|
+
def test_create_tables(self, test_db_session):
|
|
763
|
+
"""Test that all tables are created correctly."""
|
|
764
|
+
# Check if tables exist
|
|
765
|
+
tables = ['users', 'categories', 'products']
|
|
766
|
+
for table in tables:
|
|
767
|
+
result = test_db_session.execute(
|
|
768
|
+
text(f"SELECT name FROM sqlite_master WHERE type='table' AND name='{table}';")
|
|
769
|
+
)
|
|
770
|
+
assert result.fetchone() is not None
|
|
771
|
+
|
|
772
|
+
def test_foreign_key_constraints(self, test_db_session):
|
|
773
|
+
"""Test foreign key constraints."""
|
|
774
|
+
# Create user and category
|
|
775
|
+
user = User(email="fk@example.com", username="fkuser")
|
|
776
|
+
category = Category(name="FK Category", slug="fk-category")
|
|
777
|
+
|
|
778
|
+
test_db_session.add(user)
|
|
779
|
+
test_db_session.add(category)
|
|
780
|
+
test_db_session.commit()
|
|
781
|
+
|
|
782
|
+
# Create product with valid foreign keys
|
|
783
|
+
product = Product(
|
|
784
|
+
name="FK Product",
|
|
785
|
+
slug="fk-product",
|
|
786
|
+
description="Product with foreign keys",
|
|
787
|
+
price=99.99,
|
|
788
|
+
category_id=category.id,
|
|
789
|
+
created_by_id=user.id
|
|
790
|
+
)
|
|
791
|
+
|
|
792
|
+
test_db_session.add(product)
|
|
793
|
+
test_db_session.commit()
|
|
794
|
+
|
|
795
|
+
assert product.category_id == category.id
|
|
796
|
+
assert product.created_by_id == user.id
|
|
797
|
+
|
|
798
|
+
def test_cascade_operations(self, test_db_session):
|
|
799
|
+
"""Test cascade delete operations."""
|
|
800
|
+
# Create category with products
|
|
801
|
+
category = Category(name="Cascade Category", slug="cascade-category")
|
|
802
|
+
user = User(email="cascade@example.com", username="cascadeuser")
|
|
803
|
+
|
|
804
|
+
test_db_session.add(category)
|
|
805
|
+
test_db_session.add(user)
|
|
806
|
+
test_db_session.commit()
|
|
807
|
+
|
|
808
|
+
# Create products in category
|
|
809
|
+
for i in range(3):
|
|
810
|
+
product = Product(
|
|
811
|
+
name=f"Product {i}",
|
|
812
|
+
slug=f"product-{i}",
|
|
813
|
+
description=f"Product {i} description",
|
|
814
|
+
price=99.99 + i,
|
|
815
|
+
category_id=category.id,
|
|
816
|
+
created_by_id=user.id
|
|
817
|
+
)
|
|
818
|
+
test_db_session.add(product)
|
|
819
|
+
|
|
820
|
+
test_db_session.commit()
|
|
821
|
+
|
|
822
|
+
# Verify products exist
|
|
823
|
+
product_count = test_db_session.query(Product).filter(
|
|
824
|
+
Product.category_id == category.id
|
|
825
|
+
).count()
|
|
826
|
+
assert product_count == 3
|
|
827
|
+
|
|
828
|
+
# Delete category (should handle cascading)
|
|
829
|
+
test_db_session.delete(category)
|
|
830
|
+
test_db_session.commit()
|
|
831
|
+
|
|
832
|
+
# Verify cascade behavior based on your model configuration
|
|
833
|
+
remaining_products = test_db_session.query(Product).filter(
|
|
834
|
+
Product.category_id == category.id
|
|
835
|
+
).count()
|
|
836
|
+
# This depends on your CASCADE configuration
|
|
837
|
+
# assert remaining_products == 0 # If CASCADE DELETE
|
|
838
|
+
# assert remaining_products == 3 # If RESTRICT
|
|
839
|
+
|
|
840
|
+
def test_unique_constraints(self, test_db_session):
|
|
841
|
+
"""Test unique constraints."""
|
|
842
|
+
# Test user email uniqueness
|
|
843
|
+
user1 = User(email="unique@example.com", username="user1")
|
|
844
|
+
user2 = User(email="unique@example.com", username="user2")
|
|
845
|
+
|
|
846
|
+
test_db_session.add(user1)
|
|
847
|
+
test_db_session.commit()
|
|
848
|
+
|
|
849
|
+
test_db_session.add(user2)
|
|
850
|
+
with pytest.raises(IntegrityError):
|
|
851
|
+
test_db_session.commit()
|
|
852
|
+
|
|
853
|
+
test_db_session.rollback()
|
|
854
|
+
|
|
855
|
+
# Test product slug uniqueness
|
|
856
|
+
category = Category(name="Unique Category", slug="unique-category")
|
|
857
|
+
test_db_session.add(category)
|
|
858
|
+
test_db_session.commit()
|
|
859
|
+
|
|
860
|
+
product1 = Product(
|
|
861
|
+
name="Product 1",
|
|
862
|
+
slug="unique-slug",
|
|
863
|
+
description="First product",
|
|
864
|
+
price=99.99,
|
|
865
|
+
category_id=category.id,
|
|
866
|
+
created_by_id=user1.id
|
|
867
|
+
)
|
|
868
|
+
|
|
869
|
+
product2 = Product(
|
|
870
|
+
name="Product 2",
|
|
871
|
+
slug="unique-slug",
|
|
872
|
+
description="Second product",
|
|
873
|
+
price=149.99,
|
|
874
|
+
category_id=category.id,
|
|
875
|
+
created_by_id=user1.id
|
|
876
|
+
)
|
|
877
|
+
|
|
878
|
+
test_db_session.add(product1)
|
|
879
|
+
test_db_session.commit()
|
|
880
|
+
|
|
881
|
+
test_db_session.add(product2)
|
|
882
|
+
with pytest.raises(IntegrityError):
|
|
883
|
+
test_db_session.commit()
|
|
884
|
+
|
|
885
|
+
def test_transaction_rollback(self, test_db_session):
|
|
886
|
+
"""Test transaction rollback functionality."""
|
|
887
|
+
initial_user_count = test_db_session.query(User).count()
|
|
888
|
+
|
|
889
|
+
try:
|
|
890
|
+
# Start transaction
|
|
891
|
+
user1 = User(email="rollback1@example.com", username="rollback1")
|
|
892
|
+
user2 = User(email="rollback2@example.com", username="rollback2")
|
|
893
|
+
|
|
894
|
+
test_db_session.add(user1)
|
|
895
|
+
test_db_session.add(user2)
|
|
896
|
+
|
|
897
|
+
# Force an error (duplicate email)
|
|
898
|
+
user3 = User(email="rollback1@example.com", username="rollback3")
|
|
899
|
+
test_db_session.add(user3)
|
|
900
|
+
|
|
901
|
+
test_db_session.commit()
|
|
902
|
+
except IntegrityError:
|
|
903
|
+
test_db_session.rollback()
|
|
904
|
+
|
|
905
|
+
# Verify no users were added due to rollback
|
|
906
|
+
final_user_count = test_db_session.query(User).count()
|
|
907
|
+
assert final_user_count == initial_user_count
|
|
908
|
+
|
|
909
|
+
def test_query_performance(self, test_db_session):
|
|
910
|
+
"""Test query performance with indexes."""
|
|
911
|
+
import time
|
|
912
|
+
|
|
913
|
+
# Create test data
|
|
914
|
+
category = Category(name="Performance Category", slug="perf-category")
|
|
915
|
+
user = User(email="perf@example.com", username="perfuser")
|
|
916
|
+
|
|
917
|
+
test_db_session.add(category)
|
|
918
|
+
test_db_session.add(user)
|
|
919
|
+
test_db_session.commit()
|
|
920
|
+
|
|
921
|
+
# Create multiple products
|
|
922
|
+
products = []
|
|
923
|
+
for i in range(100):
|
|
924
|
+
product = Product(
|
|
925
|
+
name=f"Performance Product {i}",
|
|
926
|
+
slug=f"perf-product-{i}",
|
|
927
|
+
description=f"Product {i} for performance testing",
|
|
928
|
+
price=99.99 + i,
|
|
929
|
+
category_id=category.id,
|
|
930
|
+
created_by_id=user.id
|
|
931
|
+
)
|
|
932
|
+
products.append(product)
|
|
933
|
+
|
|
934
|
+
test_db_session.add_all(products)
|
|
935
|
+
test_db_session.commit()
|
|
936
|
+
|
|
937
|
+
# Test query performance
|
|
938
|
+
start_time = time.time()
|
|
939
|
+
|
|
940
|
+
# Query that should use index (email)
|
|
941
|
+
user_query = test_db_session.query(User).filter(
|
|
942
|
+
User.email == "perf@example.com"
|
|
943
|
+
).first()
|
|
944
|
+
|
|
945
|
+
# Query that should use index (slug)
|
|
946
|
+
product_query = test_db_session.query(Product).filter(
|
|
947
|
+
Product.slug == "perf-product-50"
|
|
948
|
+
).first()
|
|
949
|
+
|
|
950
|
+
end_time = time.time()
|
|
951
|
+
query_time = end_time - start_time
|
|
952
|
+
|
|
953
|
+
assert user_query is not None
|
|
954
|
+
assert product_query is not None
|
|
955
|
+
# Query should be fast (less than 100ms for small dataset)
|
|
956
|
+
assert query_time < 0.1
|
|
957
|
+
```
|
|
958
|
+
|
|
959
|
+
## 🚀 Performance Testing
|
|
960
|
+
|
|
961
|
+
### Load Testing with Locust
|
|
962
|
+
|
|
963
|
+
```python
|
|
964
|
+
# tests/performance/test_load.py - Load testing
|
|
965
|
+
from locust import HttpUser, task, between
|
|
966
|
+
import random
|
|
967
|
+
import json
|
|
968
|
+
|
|
969
|
+
class WebsiteUser(HttpUser):
|
|
970
|
+
"""Simulated user for load testing."""
|
|
971
|
+
wait_time = between(1, 3)
|
|
972
|
+
|
|
973
|
+
def on_start(self):
|
|
974
|
+
"""Setup for user session."""
|
|
975
|
+
self.register_and_login()
|
|
976
|
+
|
|
977
|
+
def register_and_login(self):
|
|
978
|
+
"""Register and login user."""
|
|
979
|
+
# Register user
|
|
980
|
+
user_data = {
|
|
981
|
+
"email": f"loadtest{random.randint(1, 10000)}@example.com",
|
|
982
|
+
"password": "loadtest123",
|
|
983
|
+
"full_name": "Load Test User"
|
|
984
|
+
}
|
|
985
|
+
|
|
986
|
+
register_response = self.client.post("/auth/register", json=user_data)
|
|
987
|
+
|
|
988
|
+
if register_response.status_code == 201:
|
|
989
|
+
# Login
|
|
990
|
+
login_data = {
|
|
991
|
+
"username": user_data["email"],
|
|
992
|
+
"password": user_data["password"]
|
|
993
|
+
}
|
|
994
|
+
|
|
995
|
+
login_response = self.client.post("/auth/login", data=login_data)
|
|
996
|
+
|
|
997
|
+
if login_response.status_code == 200:
|
|
998
|
+
token = login_response.json()["access_token"]
|
|
999
|
+
self.client.headers.update({"Authorization": f"Bearer {token}"})
|
|
1000
|
+
|
|
1001
|
+
@task(3)
|
|
1002
|
+
def browse_products(self):
|
|
1003
|
+
"""Browse products (most common action)."""
|
|
1004
|
+
self.client.get("/products/")
|
|
1005
|
+
|
|
1006
|
+
@task(2)
|
|
1007
|
+
def view_product_detail(self):
|
|
1008
|
+
"""View product details."""
|
|
1009
|
+
# Get random product ID (assuming products exist)
|
|
1010
|
+
product_id = random.randint(1, 100)
|
|
1011
|
+
self.client.get(f"/products/{product_id}")
|
|
1012
|
+
|
|
1013
|
+
@task(1)
|
|
1014
|
+
def search_products(self):
|
|
1015
|
+
"""Search for products."""
|
|
1016
|
+
search_terms = ["test", "product", "item", "gadget"]
|
|
1017
|
+
term = random.choice(search_terms)
|
|
1018
|
+
self.client.get(f"/products/?search={term}")
|
|
1019
|
+
|
|
1020
|
+
@task(1)
|
|
1021
|
+
def view_profile(self):
|
|
1022
|
+
"""View user profile."""
|
|
1023
|
+
self.client.get("/users/me")
|
|
1024
|
+
|
|
1025
|
+
@task(1)
|
|
1026
|
+
def update_profile(self):
|
|
1027
|
+
"""Update user profile."""
|
|
1028
|
+
update_data = {
|
|
1029
|
+
"bio": f"Updated bio {random.randint(1, 1000)}"
|
|
1030
|
+
}
|
|
1031
|
+
# Note: This assumes we have the user ID
|
|
1032
|
+
self.client.put("/users/1", json=update_data)
|
|
1033
|
+
|
|
1034
|
+
class APIUser(HttpUser):
|
|
1035
|
+
"""API-focused load testing."""
|
|
1036
|
+
wait_time = between(0.5, 2)
|
|
1037
|
+
|
|
1038
|
+
def on_start(self):
|
|
1039
|
+
"""API setup."""
|
|
1040
|
+
# Get API token
|
|
1041
|
+
login_data = {
|
|
1042
|
+
"username": "api@example.com",
|
|
1043
|
+
"password": "apipassword"
|
|
1044
|
+
}
|
|
1045
|
+
response = self.client.post("/auth/login", data=login_data)
|
|
1046
|
+
if response.status_code == 200:
|
|
1047
|
+
token = response.json()["access_token"]
|
|
1048
|
+
self.client.headers.update({"Authorization": f"Bearer {token}"})
|
|
1049
|
+
|
|
1050
|
+
@task(5)
|
|
1051
|
+
def api_get_products(self):
|
|
1052
|
+
"""API: Get products."""
|
|
1053
|
+
self.client.get("/api/products/")
|
|
1054
|
+
|
|
1055
|
+
@task(3)
|
|
1056
|
+
def api_get_categories(self):
|
|
1057
|
+
"""API: Get categories."""
|
|
1058
|
+
self.client.get("/api/categories/")
|
|
1059
|
+
|
|
1060
|
+
@task(2)
|
|
1061
|
+
def api_create_product(self):
|
|
1062
|
+
"""API: Create product."""
|
|
1063
|
+
product_data = {
|
|
1064
|
+
"name": f"API Product {random.randint(1, 10000)}",
|
|
1065
|
+
"slug": f"api-product-{random.randint(1, 10000)}",
|
|
1066
|
+
"description": "Product created via API load test",
|
|
1067
|
+
"price": round(random.uniform(10, 1000), 2),
|
|
1068
|
+
"category_id": random.randint(1, 10),
|
|
1069
|
+
"stock_quantity": random.randint(1, 100)
|
|
1070
|
+
}
|
|
1071
|
+
|
|
1072
|
+
self.client.post("/api/products/", json=product_data)
|
|
1073
|
+
|
|
1074
|
+
@task(1)
|
|
1075
|
+
def api_health_check(self):
|
|
1076
|
+
"""API: Health check."""
|
|
1077
|
+
self.client.get("/health")
|
|
1078
|
+
|
|
1079
|
+
# Performance testing configuration
|
|
1080
|
+
class PerformanceTestConfig:
|
|
1081
|
+
"""Configuration for performance tests."""
|
|
1082
|
+
|
|
1083
|
+
@staticmethod
|
|
1084
|
+
def run_load_test():
|
|
1085
|
+
"""Run load test using Locust programmatically."""
|
|
1086
|
+
import subprocess
|
|
1087
|
+
import time
|
|
1088
|
+
|
|
1089
|
+
# Start load test
|
|
1090
|
+
process = subprocess.Popen([
|
|
1091
|
+
"locust",
|
|
1092
|
+
"-f", "tests/performance/test_load.py",
|
|
1093
|
+
"--host", "http://localhost:8000",
|
|
1094
|
+
"--users", "50",
|
|
1095
|
+
"--spawn-rate", "5",
|
|
1096
|
+
"--run-time", "60s",
|
|
1097
|
+
"--headless",
|
|
1098
|
+
"--csv", "reports/load_test"
|
|
1099
|
+
])
|
|
1100
|
+
|
|
1101
|
+
# Wait for completion
|
|
1102
|
+
process.wait()
|
|
1103
|
+
|
|
1104
|
+
# Notify claude-flow
|
|
1105
|
+
try:
|
|
1106
|
+
subprocess.run([
|
|
1107
|
+
"npx", "claude-flow@alpha", "hooks", "notify",
|
|
1108
|
+
"--message", "Load testing completed"
|
|
1109
|
+
], check=True)
|
|
1110
|
+
except:
|
|
1111
|
+
print("Load testing completed")
|
|
1112
|
+
|
|
1113
|
+
@staticmethod
|
|
1114
|
+
def run_stress_test():
|
|
1115
|
+
"""Run stress test with higher load."""
|
|
1116
|
+
import subprocess
|
|
1117
|
+
|
|
1118
|
+
process = subprocess.Popen([
|
|
1119
|
+
"locust",
|
|
1120
|
+
"-f", "tests/performance/test_load.py",
|
|
1121
|
+
"--host", "http://localhost:8000",
|
|
1122
|
+
"--users", "200",
|
|
1123
|
+
"--spawn-rate", "10",
|
|
1124
|
+
"--run-time", "300s",
|
|
1125
|
+
"--headless",
|
|
1126
|
+
"--csv", "reports/stress_test"
|
|
1127
|
+
])
|
|
1128
|
+
|
|
1129
|
+
process.wait()
|
|
1130
|
+
```
|
|
1131
|
+
|
|
1132
|
+
### Benchmark Testing with pytest-benchmark
|
|
1133
|
+
|
|
1134
|
+
```python
|
|
1135
|
+
# tests/performance/test_benchmarks.py - Micro-benchmarks
|
|
1136
|
+
import pytest
|
|
1137
|
+
from pytest_benchmark import benchmark
|
|
1138
|
+
import pandas as pd
|
|
1139
|
+
import numpy as np
|
|
1140
|
+
|
|
1141
|
+
from app.services.user_service import UserService
|
|
1142
|
+
from app.services.product_service import ProductService
|
|
1143
|
+
from app.utils.data_processor import DataProcessor
|
|
1144
|
+
|
|
1145
|
+
class TestServiceBenchmarks:
|
|
1146
|
+
"""Benchmark service layer performance."""
|
|
1147
|
+
|
|
1148
|
+
def test_user_creation_benchmark(self, benchmark, test_db_session):
|
|
1149
|
+
"""Benchmark user creation performance."""
|
|
1150
|
+
user_service = UserService(test_db_session)
|
|
1151
|
+
|
|
1152
|
+
def create_user():
|
|
1153
|
+
from app.schemas.user import UserCreate
|
|
1154
|
+
import uuid
|
|
1155
|
+
|
|
1156
|
+
user_data = UserCreate(
|
|
1157
|
+
email=f"bench{uuid.uuid4()}@example.com",
|
|
1158
|
+
password="benchpassword",
|
|
1159
|
+
full_name="Benchmark User"
|
|
1160
|
+
)
|
|
1161
|
+
return user_service.create(user_data)
|
|
1162
|
+
|
|
1163
|
+
result = benchmark(create_user)
|
|
1164
|
+
assert result.id is not None
|
|
1165
|
+
|
|
1166
|
+
def test_product_search_benchmark(self, benchmark, test_db_session):
|
|
1167
|
+
"""Benchmark product search performance."""
|
|
1168
|
+
product_service = ProductService(test_db_session)
|
|
1169
|
+
|
|
1170
|
+
# Create test data
|
|
1171
|
+
self._create_test_products(test_db_session, count=1000)
|
|
1172
|
+
|
|
1173
|
+
def search_products():
|
|
1174
|
+
return product_service.search("test", limit=10)
|
|
1175
|
+
|
|
1176
|
+
results = benchmark(search_products)
|
|
1177
|
+
assert len(results) <= 10
|
|
1178
|
+
|
|
1179
|
+
def test_data_processing_benchmark(self, benchmark):
|
|
1180
|
+
"""Benchmark data processing utilities."""
|
|
1181
|
+
# Create test dataset
|
|
1182
|
+
data = pd.DataFrame({
|
|
1183
|
+
'id': range(10000),
|
|
1184
|
+
'value': np.random.randn(10000),
|
|
1185
|
+
'category': np.random.choice(['A', 'B', 'C'], 10000)
|
|
1186
|
+
})
|
|
1187
|
+
|
|
1188
|
+
processor = DataProcessor()
|
|
1189
|
+
|
|
1190
|
+
def process_data():
|
|
1191
|
+
return processor.aggregate_by_category(data)
|
|
1192
|
+
|
|
1193
|
+
result = benchmark(process_data)
|
|
1194
|
+
assert len(result) == 3 # Three categories
|
|
1195
|
+
|
|
1196
|
+
def test_database_query_benchmark(self, benchmark, test_db_session):
|
|
1197
|
+
"""Benchmark database query performance."""
|
|
1198
|
+
# Create test data
|
|
1199
|
+
self._create_test_users(test_db_session, count=1000)
|
|
1200
|
+
|
|
1201
|
+
def complex_query():
|
|
1202
|
+
from app.models.user import User
|
|
1203
|
+
return test_db_session.query(User).filter(
|
|
1204
|
+
User.email.contains("bench"),
|
|
1205
|
+
User.is_active == True
|
|
1206
|
+
).limit(100).all()
|
|
1207
|
+
|
|
1208
|
+
results = benchmark(complex_query)
|
|
1209
|
+
assert len(results) <= 100
|
|
1210
|
+
|
|
1211
|
+
def _create_test_products(self, db_session, count=100):
|
|
1212
|
+
"""Helper to create test products."""
|
|
1213
|
+
from app.models.product import Product, Category
|
|
1214
|
+
from app.models.user import User
|
|
1215
|
+
|
|
1216
|
+
# Create category and user
|
|
1217
|
+
category = Category(name="Bench Category", slug="bench-category")
|
|
1218
|
+
user = User(email="bench@example.com", username="benchuser")
|
|
1219
|
+
|
|
1220
|
+
db_session.add(category)
|
|
1221
|
+
db_session.add(user)
|
|
1222
|
+
db_session.commit()
|
|
1223
|
+
|
|
1224
|
+
# Create products
|
|
1225
|
+
products = []
|
|
1226
|
+
for i in range(count):
|
|
1227
|
+
product = Product(
|
|
1228
|
+
name=f"Test Product {i}",
|
|
1229
|
+
slug=f"test-product-{i}",
|
|
1230
|
+
description=f"Test product {i} description",
|
|
1231
|
+
price=99.99 + i,
|
|
1232
|
+
category_id=category.id,
|
|
1233
|
+
created_by_id=user.id
|
|
1234
|
+
)
|
|
1235
|
+
products.append(product)
|
|
1236
|
+
|
|
1237
|
+
db_session.add_all(products)
|
|
1238
|
+
db_session.commit()
|
|
1239
|
+
|
|
1240
|
+
def _create_test_users(self, db_session, count=100):
|
|
1241
|
+
"""Helper to create test users."""
|
|
1242
|
+
from app.models.user import User
|
|
1243
|
+
|
|
1244
|
+
users = []
|
|
1245
|
+
for i in range(count):
|
|
1246
|
+
user = User(
|
|
1247
|
+
email=f"bench{i}@example.com",
|
|
1248
|
+
username=f"benchuser{i}",
|
|
1249
|
+
full_name=f"Bench User {i}"
|
|
1250
|
+
)
|
|
1251
|
+
users.append(user)
|
|
1252
|
+
|
|
1253
|
+
db_session.add_all(users)
|
|
1254
|
+
db_session.commit()
|
|
1255
|
+
```
|
|
1256
|
+
|
|
1257
|
+
## 🔄 Continuous Integration
|
|
1258
|
+
|
|
1259
|
+
### GitHub Actions Workflow
|
|
1260
|
+
|
|
1261
|
+
```yaml
|
|
1262
|
+
# .github/workflows/python-tests.yml
|
|
1263
|
+
name: Python Testing Pipeline
|
|
1264
|
+
|
|
1265
|
+
on:
|
|
1266
|
+
push:
|
|
1267
|
+
branches: [ main, develop ]
|
|
1268
|
+
pull_request:
|
|
1269
|
+
branches: [ main ]
|
|
1270
|
+
|
|
1271
|
+
jobs:
|
|
1272
|
+
test:
|
|
1273
|
+
runs-on: ubuntu-latest
|
|
1274
|
+
strategy:
|
|
1275
|
+
matrix:
|
|
1276
|
+
python-version: [3.9, 3.10, 3.11]
|
|
1277
|
+
|
|
1278
|
+
services:
|
|
1279
|
+
postgres:
|
|
1280
|
+
image: postgres:15
|
|
1281
|
+
env:
|
|
1282
|
+
POSTGRES_PASSWORD: postgres
|
|
1283
|
+
POSTGRES_DB: test_db
|
|
1284
|
+
options: >-
|
|
1285
|
+
--health-cmd pg_isready
|
|
1286
|
+
--health-interval 10s
|
|
1287
|
+
--health-timeout 5s
|
|
1288
|
+
--health-retries 5
|
|
1289
|
+
ports:
|
|
1290
|
+
- 5432:5432
|
|
1291
|
+
|
|
1292
|
+
redis:
|
|
1293
|
+
image: redis:7
|
|
1294
|
+
options: >-
|
|
1295
|
+
--health-cmd "redis-cli ping"
|
|
1296
|
+
--health-interval 10s
|
|
1297
|
+
--health-timeout 5s
|
|
1298
|
+
--health-retries 5
|
|
1299
|
+
ports:
|
|
1300
|
+
- 6379:6379
|
|
1301
|
+
|
|
1302
|
+
steps:
|
|
1303
|
+
- uses: actions/checkout@v4
|
|
1304
|
+
|
|
1305
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
1306
|
+
uses: actions/setup-python@v4
|
|
1307
|
+
with:
|
|
1308
|
+
python-version: ${{ matrix.python-version }}
|
|
1309
|
+
|
|
1310
|
+
- name: Install Poetry
|
|
1311
|
+
uses: snok/install-poetry@v1
|
|
1312
|
+
with:
|
|
1313
|
+
version: latest
|
|
1314
|
+
virtualenvs-create: true
|
|
1315
|
+
virtualenvs-in-project: true
|
|
1316
|
+
|
|
1317
|
+
- name: Load cached venv
|
|
1318
|
+
id: cached-poetry-dependencies
|
|
1319
|
+
uses: actions/cache@v3
|
|
1320
|
+
with:
|
|
1321
|
+
path: .venv
|
|
1322
|
+
key: venv-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('**/poetry.lock') }}
|
|
1323
|
+
|
|
1324
|
+
- name: Install dependencies
|
|
1325
|
+
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
|
|
1326
|
+
run: poetry install --no-interaction --no-root
|
|
1327
|
+
|
|
1328
|
+
- name: Install project
|
|
1329
|
+
run: poetry install --no-interaction
|
|
1330
|
+
|
|
1331
|
+
- name: Lint with flake8
|
|
1332
|
+
run: |
|
|
1333
|
+
poetry run flake8 app tests --count --select=E9,F63,F7,F82 --show-source --statistics
|
|
1334
|
+
poetry run flake8 app tests --count --exit-zero --max-complexity=10 --max-line-length=88 --statistics
|
|
1335
|
+
|
|
1336
|
+
- name: Type check with mypy
|
|
1337
|
+
run: poetry run mypy app
|
|
1338
|
+
|
|
1339
|
+
- name: Test with pytest
|
|
1340
|
+
env:
|
|
1341
|
+
DATABASE_URL: postgresql://postgres:postgres@localhost:5432/test_db
|
|
1342
|
+
REDIS_URL: redis://localhost:6379
|
|
1343
|
+
run: |
|
|
1344
|
+
poetry run pytest \
|
|
1345
|
+
--cov=app \
|
|
1346
|
+
--cov-report=xml \
|
|
1347
|
+
--cov-report=term-missing \
|
|
1348
|
+
--cov-fail-under=90 \
|
|
1349
|
+
--junitxml=reports/junit.xml \
|
|
1350
|
+
-v
|
|
1351
|
+
|
|
1352
|
+
- name: Upload coverage to Codecov
|
|
1353
|
+
uses: codecov/codecov-action@v3
|
|
1354
|
+
with:
|
|
1355
|
+
file: ./coverage.xml
|
|
1356
|
+
flags: unittests
|
|
1357
|
+
name: codecov-umbrella
|
|
1358
|
+
|
|
1359
|
+
- name: Performance Tests
|
|
1360
|
+
run: |
|
|
1361
|
+
poetry run pytest tests/performance/ -v --benchmark-only
|
|
1362
|
+
|
|
1363
|
+
- name: Load Testing
|
|
1364
|
+
run: |
|
|
1365
|
+
poetry run uvicorn app.main:app --host 0.0.0.0 --port 8000 &
|
|
1366
|
+
sleep 10
|
|
1367
|
+
poetry run locust -f tests/performance/test_load.py --host http://localhost:8000 --users 10 --spawn-rate 2 --run-time 30s --headless --csv reports/load_test
|
|
1368
|
+
pkill -f uvicorn
|
|
1369
|
+
|
|
1370
|
+
- name: Upload test reports
|
|
1371
|
+
uses: actions/upload-artifact@v3
|
|
1372
|
+
if: always()
|
|
1373
|
+
with:
|
|
1374
|
+
name: test-reports-${{ matrix.python-version }}
|
|
1375
|
+
path: reports/
|
|
1376
|
+
|
|
1377
|
+
security:
|
|
1378
|
+
runs-on: ubuntu-latest
|
|
1379
|
+
steps:
|
|
1380
|
+
- uses: actions/checkout@v4
|
|
1381
|
+
|
|
1382
|
+
- name: Set up Python
|
|
1383
|
+
uses: actions/setup-python@v4
|
|
1384
|
+
with:
|
|
1385
|
+
python-version: 3.11
|
|
1386
|
+
|
|
1387
|
+
- name: Install Poetry
|
|
1388
|
+
uses: snok/install-poetry@v1
|
|
1389
|
+
|
|
1390
|
+
- name: Install dependencies
|
|
1391
|
+
run: poetry install
|
|
1392
|
+
|
|
1393
|
+
- name: Security check with bandit
|
|
1394
|
+
run: poetry run bandit -r app/
|
|
1395
|
+
|
|
1396
|
+
- name: Dependency vulnerability check
|
|
1397
|
+
run: poetry run safety check
|
|
1398
|
+
```
|
|
1399
|
+
|
|
1400
|
+
### Pre-commit Configuration
|
|
1401
|
+
|
|
1402
|
+
```yaml
|
|
1403
|
+
# .pre-commit-config.yaml
|
|
1404
|
+
repos:
|
|
1405
|
+
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
1406
|
+
rev: v4.4.0
|
|
1407
|
+
hooks:
|
|
1408
|
+
- id: trailing-whitespace
|
|
1409
|
+
- id: end-of-file-fixer
|
|
1410
|
+
- id: check-yaml
|
|
1411
|
+
- id: check-added-large-files
|
|
1412
|
+
- id: check-merge-conflict
|
|
1413
|
+
|
|
1414
|
+
- repo: https://github.com/psf/black
|
|
1415
|
+
rev: 23.11.0
|
|
1416
|
+
hooks:
|
|
1417
|
+
- id: black
|
|
1418
|
+
language_version: python3.11
|
|
1419
|
+
|
|
1420
|
+
- repo: https://github.com/pycqa/isort
|
|
1421
|
+
rev: 5.12.0
|
|
1422
|
+
hooks:
|
|
1423
|
+
- id: isort
|
|
1424
|
+
args: ["--profile", "black"]
|
|
1425
|
+
|
|
1426
|
+
- repo: https://github.com/pycqa/flake8
|
|
1427
|
+
rev: 6.1.0
|
|
1428
|
+
hooks:
|
|
1429
|
+
- id: flake8
|
|
1430
|
+
additional_dependencies: [flake8-docstrings, flake8-black]
|
|
1431
|
+
|
|
1432
|
+
- repo: https://github.com/pre-commit/mirrors-mypy
|
|
1433
|
+
rev: v1.7.1
|
|
1434
|
+
hooks:
|
|
1435
|
+
- id: mypy
|
|
1436
|
+
additional_dependencies: [types-requests, types-redis]
|
|
1437
|
+
|
|
1438
|
+
- repo: https://github.com/PyCQA/bandit
|
|
1439
|
+
rev: 1.7.5
|
|
1440
|
+
hooks:
|
|
1441
|
+
- id: bandit
|
|
1442
|
+
args: ["-c", "pyproject.toml"]
|
|
1443
|
+
|
|
1444
|
+
- repo: local
|
|
1445
|
+
hooks:
|
|
1446
|
+
- id: claude-flow-test-hook
|
|
1447
|
+
name: Claude-Flow Test Integration
|
|
1448
|
+
entry: npx claude-flow@alpha hooks pre-commit
|
|
1449
|
+
language: system
|
|
1450
|
+
pass_filenames: false
|
|
1451
|
+
always_run: true
|
|
1452
|
+
```
|
|
1453
|
+
|
|
1454
|
+
## 📊 Testing Metrics and Reporting
|
|
1455
|
+
|
|
1456
|
+
### Test Coverage Analysis
|
|
1457
|
+
|
|
1458
|
+
```python
|
|
1459
|
+
# scripts/coverage_analysis.py - Coverage reporting
|
|
1460
|
+
import subprocess
|
|
1461
|
+
import json
|
|
1462
|
+
import xml.etree.ElementTree as ET
|
|
1463
|
+
|
|
1464
|
+
class CoverageAnalyzer:
|
|
1465
|
+
"""Analyze test coverage and generate reports."""
|
|
1466
|
+
|
|
1467
|
+
def __init__(self):
|
|
1468
|
+
self.coverage_threshold = 90
|
|
1469
|
+
|
|
1470
|
+
def run_coverage_analysis(self):
|
|
1471
|
+
"""Run comprehensive coverage analysis."""
|
|
1472
|
+
# Run tests with coverage
|
|
1473
|
+
subprocess.run([
|
|
1474
|
+
"poetry", "run", "pytest",
|
|
1475
|
+
"--cov=app",
|
|
1476
|
+
"--cov-report=xml",
|
|
1477
|
+
"--cov-report=html",
|
|
1478
|
+
"--cov-report=json",
|
|
1479
|
+
"--cov-report=term-missing"
|
|
1480
|
+
], check=True)
|
|
1481
|
+
|
|
1482
|
+
# Analyze results
|
|
1483
|
+
coverage_data = self.parse_coverage_results()
|
|
1484
|
+
self.generate_coverage_report(coverage_data)
|
|
1485
|
+
|
|
1486
|
+
return coverage_data
|
|
1487
|
+
|
|
1488
|
+
def parse_coverage_results(self):
|
|
1489
|
+
"""Parse coverage results from multiple formats."""
|
|
1490
|
+
# Parse JSON report
|
|
1491
|
+
with open('coverage.json', 'r') as f:
|
|
1492
|
+
json_data = json.load(f)
|
|
1493
|
+
|
|
1494
|
+
# Parse XML report
|
|
1495
|
+
tree = ET.parse('coverage.xml')
|
|
1496
|
+
root = tree.getroot()
|
|
1497
|
+
|
|
1498
|
+
coverage_data = {
|
|
1499
|
+
'total_coverage': json_data['totals']['percent_covered'],
|
|
1500
|
+
'files': {},
|
|
1501
|
+
'missing_lines': {}
|
|
1502
|
+
}
|
|
1503
|
+
|
|
1504
|
+
for filename, file_data in json_data['files'].items():
|
|
1505
|
+
coverage_data['files'][filename] = {
|
|
1506
|
+
'coverage': file_data['summary']['percent_covered'],
|
|
1507
|
+
'lines_covered': file_data['summary']['covered_lines'],
|
|
1508
|
+
'lines_missing': file_data['summary']['missing_lines'],
|
|
1509
|
+
'missing_line_numbers': file_data['missing_lines']
|
|
1510
|
+
}
|
|
1511
|
+
|
|
1512
|
+
return coverage_data
|
|
1513
|
+
|
|
1514
|
+
def generate_coverage_report(self, coverage_data):
|
|
1515
|
+
"""Generate human-readable coverage report."""
|
|
1516
|
+
report = f"""
|
|
1517
|
+
# Test Coverage Report
|
|
1518
|
+
|
|
1519
|
+
## Overall Coverage: {coverage_data['total_coverage']:.1f}%
|
|
1520
|
+
|
|
1521
|
+
## File Coverage Details:
|
|
1522
|
+
|
|
1523
|
+
"""
|
|
1524
|
+
|
|
1525
|
+
for filename, file_data in coverage_data['files'].items():
|
|
1526
|
+
status = "✅" if file_data['coverage'] >= self.coverage_threshold else "❌"
|
|
1527
|
+
report += f"{status} {filename}: {file_data['coverage']:.1f}%\n"
|
|
1528
|
+
|
|
1529
|
+
if file_data['coverage'] < self.coverage_threshold:
|
|
1530
|
+
report += f" Missing lines: {file_data['missing_line_numbers']}\n"
|
|
1531
|
+
|
|
1532
|
+
# Save report
|
|
1533
|
+
with open('reports/coverage_report.md', 'w') as f:
|
|
1534
|
+
f.write(report)
|
|
1535
|
+
|
|
1536
|
+
# Notify claude-flow
|
|
1537
|
+
try:
|
|
1538
|
+
subprocess.run([
|
|
1539
|
+
"npx", "claude-flow@alpha", "hooks", "notify",
|
|
1540
|
+
"--message", f"Coverage analysis completed: {coverage_data['total_coverage']:.1f}%"
|
|
1541
|
+
], check=True)
|
|
1542
|
+
except:
|
|
1543
|
+
print(f"Coverage analysis completed: {coverage_data['total_coverage']:.1f}%")
|
|
1544
|
+
|
|
1545
|
+
return report
|
|
1546
|
+
|
|
1547
|
+
# Test quality metrics
|
|
1548
|
+
class TestQualityAnalyzer:
|
|
1549
|
+
"""Analyze test quality and provide recommendations."""
|
|
1550
|
+
|
|
1551
|
+
def analyze_test_quality(self):
|
|
1552
|
+
"""Analyze test suite quality."""
|
|
1553
|
+
metrics = {
|
|
1554
|
+
'test_count': self.count_tests(),
|
|
1555
|
+
'test_types': self.analyze_test_types(),
|
|
1556
|
+
'fixture_usage': self.analyze_fixture_usage(),
|
|
1557
|
+
'mock_usage': self.analyze_mock_usage(),
|
|
1558
|
+
'assertion_patterns': self.analyze_assertions()
|
|
1559
|
+
}
|
|
1560
|
+
|
|
1561
|
+
self.generate_quality_report(metrics)
|
|
1562
|
+
return metrics
|
|
1563
|
+
|
|
1564
|
+
def count_tests(self):
|
|
1565
|
+
"""Count total number of tests."""
|
|
1566
|
+
result = subprocess.run([
|
|
1567
|
+
"poetry", "run", "pytest", "--collect-only", "-q"
|
|
1568
|
+
], capture_output=True, text=True)
|
|
1569
|
+
|
|
1570
|
+
# Parse output to count tests
|
|
1571
|
+
lines = result.stdout.split('\n')
|
|
1572
|
+
test_count = 0
|
|
1573
|
+
for line in lines:
|
|
1574
|
+
if 'test session starts' in line:
|
|
1575
|
+
continue
|
|
1576
|
+
elif 'tests collected' in line:
|
|
1577
|
+
test_count = int(line.split()[0])
|
|
1578
|
+
break
|
|
1579
|
+
|
|
1580
|
+
return test_count
|
|
1581
|
+
|
|
1582
|
+
def analyze_test_types(self):
|
|
1583
|
+
"""Analyze distribution of test types."""
|
|
1584
|
+
import os
|
|
1585
|
+
from pathlib import Path
|
|
1586
|
+
|
|
1587
|
+
test_types = {
|
|
1588
|
+
'unit': 0,
|
|
1589
|
+
'integration': 0,
|
|
1590
|
+
'e2e': 0,
|
|
1591
|
+
'performance': 0
|
|
1592
|
+
}
|
|
1593
|
+
|
|
1594
|
+
for test_dir in ['unit', 'integration', 'e2e', 'performance']:
|
|
1595
|
+
test_path = Path(f'tests/{test_dir}')
|
|
1596
|
+
if test_path.exists():
|
|
1597
|
+
for test_file in test_path.glob('test_*.py'):
|
|
1598
|
+
with open(test_file, 'r') as f:
|
|
1599
|
+
content = f.read()
|
|
1600
|
+
test_types[test_dir] += content.count('def test_')
|
|
1601
|
+
|
|
1602
|
+
return test_types
|
|
1603
|
+
|
|
1604
|
+
def analyze_fixture_usage(self):
|
|
1605
|
+
"""Analyze pytest fixture usage."""
|
|
1606
|
+
# This would analyze fixture patterns in conftest.py and test files
|
|
1607
|
+
return {
|
|
1608
|
+
'total_fixtures': 0,
|
|
1609
|
+
'shared_fixtures': 0,
|
|
1610
|
+
'parametrized_tests': 0
|
|
1611
|
+
}
|
|
1612
|
+
|
|
1613
|
+
def analyze_mock_usage(self):
|
|
1614
|
+
"""Analyze mock usage patterns."""
|
|
1615
|
+
# This would analyze @patch, Mock, and MagicMock usage
|
|
1616
|
+
return {
|
|
1617
|
+
'patch_usage': 0,
|
|
1618
|
+
'mock_objects': 0,
|
|
1619
|
+
'proper_isolation': True
|
|
1620
|
+
}
|
|
1621
|
+
|
|
1622
|
+
def analyze_assertions(self):
|
|
1623
|
+
"""Analyze assertion patterns."""
|
|
1624
|
+
# This would analyze assertion styles and patterns
|
|
1625
|
+
return {
|
|
1626
|
+
'total_assertions': 0,
|
|
1627
|
+
'assertion_types': {},
|
|
1628
|
+
'descriptive_messages': 0
|
|
1629
|
+
}
|
|
1630
|
+
|
|
1631
|
+
def generate_quality_report(self, metrics):
|
|
1632
|
+
"""Generate test quality report."""
|
|
1633
|
+
report = f"""
|
|
1634
|
+
# Test Quality Analysis
|
|
1635
|
+
|
|
1636
|
+
## Test Distribution
|
|
1637
|
+
- Total Tests: {metrics['test_count']}
|
|
1638
|
+
- Unit Tests: {metrics['test_types']['unit']}
|
|
1639
|
+
- Integration Tests: {metrics['test_types']['integration']}
|
|
1640
|
+
- E2E Tests: {metrics['test_types']['e2e']}
|
|
1641
|
+
- Performance Tests: {metrics['test_types']['performance']}
|
|
1642
|
+
|
|
1643
|
+
## Quality Metrics
|
|
1644
|
+
- Fixture Usage: {metrics['fixture_usage']['total_fixtures']} fixtures
|
|
1645
|
+
- Mock Usage: {'Good' if metrics['mock_usage']['proper_isolation'] else 'Needs Improvement'}
|
|
1646
|
+
|
|
1647
|
+
## Recommendations
|
|
1648
|
+
"""
|
|
1649
|
+
|
|
1650
|
+
# Add recommendations based on metrics
|
|
1651
|
+
if metrics['test_types']['unit'] < metrics['test_count'] * 0.7:
|
|
1652
|
+
report += "- ⚠️ Consider adding more unit tests (target: 70% of total tests)\n"
|
|
1653
|
+
|
|
1654
|
+
if metrics['test_types']['integration'] < 5:
|
|
1655
|
+
report += "- ⚠️ Consider adding integration tests\n"
|
|
1656
|
+
|
|
1657
|
+
# Save report
|
|
1658
|
+
with open('reports/test_quality_report.md', 'w') as f:
|
|
1659
|
+
f.write(report)
|
|
1660
|
+
|
|
1661
|
+
return report
|
|
1662
|
+
|
|
1663
|
+
if __name__ == "__main__":
|
|
1664
|
+
analyzer = CoverageAnalyzer()
|
|
1665
|
+
analyzer.run_coverage_analysis()
|
|
1666
|
+
|
|
1667
|
+
quality_analyzer = TestQualityAnalyzer()
|
|
1668
|
+
quality_analyzer.analyze_test_quality()
|
|
1669
|
+
```
|
|
1670
|
+
|
|
1671
|
+
## 📚 Next Steps
|
|
1672
|
+
|
|
1673
|
+
1. **[Practical Examples](../examples/README.md)** - Complete testing examples
|
|
1674
|
+
2. **[Web Development](../web-development/README.md)** - Testing web applications
|
|
1675
|
+
3. **[Data Science Testing](../data-science/README.md)** - ML model testing
|
|
1676
|
+
4. **[CI/CD Optimization](../examples/cicd.md)** - Advanced CI/CD patterns
|
|
1677
|
+
|
|
1678
|
+
---
|
|
1679
|
+
|
|
1680
|
+
**Ready to implement comprehensive testing?** Start with [unit testing setup](./unit-testing-guide.md) or explore [integration testing patterns](./integration-testing-guide.md).
|