agentic-qe 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/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/byzantine-coordinator.md +63 -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 +266 -0
- package/.claude/agents/core/planner.md +168 -0
- package/.claude/agents/core/researcher.md +190 -0
- package/.claude/agents/core/reviewer.md +326 -0
- package/.claude/agents/core/tester.md +319 -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/code-goal-planner.md +446 -0
- package/.claude/agents/goal/goal-planner.md +168 -0
- package/.claude/agents/hive-mind/collective-intelligence-coordinator.md +130 -0
- package/.claude/agents/hive-mind/queen-coordinator.md +203 -0
- package/.claude/agents/hive-mind/scout-explorer.md +242 -0
- package/.claude/agents/hive-mind/swarm-memory-manager.md +193 -0
- package/.claude/agents/hive-mind/worker-specialist.md +217 -0
- package/.claude/agents/neural/safla-neural.md +74 -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/qe-api-contract-validator.md +1088 -0
- package/.claude/agents/qe-chaos-engineer.md +736 -0
- package/.claude/agents/qe-coverage-analyzer.md +282 -0
- package/.claude/agents/qe-deployment-readiness.md +1109 -0
- package/.claude/agents/qe-flaky-test-hunter.md +1121 -0
- package/.claude/agents/qe-fleet-commander.md +641 -0
- package/.claude/agents/qe-performance-tester.md +354 -0
- package/.claude/agents/qe-production-intelligence.md +1162 -0
- package/.claude/agents/qe-quality-gate.md +294 -0
- package/.claude/agents/qe-regression-risk-analyzer.md +947 -0
- package/.claude/agents/qe-requirements-validator.md +691 -0
- package/.claude/agents/qe-security-scanner.md +430 -0
- package/.claude/agents/qe-test-data-architect.md +1007 -0
- package/.claude/agents/qe-test-executor.md +365 -0
- package/.claude/agents/qe-test-generator.md +332 -0
- package/.claude/agents/qe-visual-tester.md +754 -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/swarm/adaptive-coordinator.md +396 -0
- package/.claude/agents/swarm/hierarchical-coordinator.md +327 -0
- package/.claude/agents/swarm/mesh-coordinator.md +392 -0
- package/.claude/agents/templates/automation-smart-agent.md +205 -0
- package/.claude/agents/templates/coordinator-swarm-init.md +105 -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/unit/tdd-london-swarm.md +244 -0
- package/.claude/agents/testing/validation/production-validator.md +395 -0
- package/.claude/aqe-fleet.json +47 -0
- package/.claude/commands/README.md +106 -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/aqe-analyze.md +344 -0
- package/.claude/commands/aqe-benchmark.md +466 -0
- package/.claude/commands/aqe-chaos.md +443 -0
- package/.claude/commands/aqe-execute.md +322 -0
- package/.claude/commands/aqe-fleet-status.md +431 -0
- package/.claude/commands/aqe-generate.md +301 -0
- package/.claude/commands/aqe-optimize.md +361 -0
- package/.claude/commands/aqe-report.md +411 -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 +132 -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/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/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 +114 -0
- package/.claude/settings.local.json +10 -0
- package/CONTRIBUTING.md +897 -0
- package/LICENSE +21 -0
- package/README.md +632 -0
- package/bin/aqe +959 -0
- package/config/fleet.yaml +50 -0
- package/dist/agents/ApiContractValidatorAgent.d.ts +222 -0
- package/dist/agents/ApiContractValidatorAgent.d.ts.map +1 -0
- package/dist/agents/ApiContractValidatorAgent.js +787 -0
- package/dist/agents/ApiContractValidatorAgent.js.map +1 -0
- package/dist/agents/BaseAgent.d.ts +147 -0
- package/dist/agents/BaseAgent.d.ts.map +1 -0
- package/dist/agents/BaseAgent.js +374 -0
- package/dist/agents/BaseAgent.js.map +1 -0
- package/dist/agents/CoverageAnalyzerAgent.d.ts +103 -0
- package/dist/agents/CoverageAnalyzerAgent.d.ts.map +1 -0
- package/dist/agents/CoverageAnalyzerAgent.js +466 -0
- package/dist/agents/CoverageAnalyzerAgent.js.map +1 -0
- package/dist/agents/DeploymentReadinessAgent.d.ts +244 -0
- package/dist/agents/DeploymentReadinessAgent.d.ts.map +1 -0
- package/dist/agents/DeploymentReadinessAgent.js +974 -0
- package/dist/agents/DeploymentReadinessAgent.js.map +1 -0
- package/dist/agents/FlakyTestHunterAgent.d.ts +172 -0
- package/dist/agents/FlakyTestHunterAgent.d.ts.map +1 -0
- package/dist/agents/FlakyTestHunterAgent.js +867 -0
- package/dist/agents/FlakyTestHunterAgent.js.map +1 -0
- package/dist/agents/FleetCommanderAgent.d.ts +154 -0
- package/dist/agents/FleetCommanderAgent.d.ts.map +1 -0
- package/dist/agents/FleetCommanderAgent.js +924 -0
- package/dist/agents/FleetCommanderAgent.js.map +1 -0
- package/dist/agents/PerformanceTesterAgent.d.ts +194 -0
- package/dist/agents/PerformanceTesterAgent.d.ts.map +1 -0
- package/dist/agents/PerformanceTesterAgent.js +972 -0
- package/dist/agents/PerformanceTesterAgent.js.map +1 -0
- package/dist/agents/ProductionIntelligenceAgent.d.ts +224 -0
- package/dist/agents/ProductionIntelligenceAgent.d.ts.map +1 -0
- package/dist/agents/ProductionIntelligenceAgent.js +856 -0
- package/dist/agents/ProductionIntelligenceAgent.js.map +1 -0
- package/dist/agents/QualityAnalyzerAgent.d.ts +67 -0
- package/dist/agents/QualityAnalyzerAgent.d.ts.map +1 -0
- package/dist/agents/QualityAnalyzerAgent.js +453 -0
- package/dist/agents/QualityAnalyzerAgent.js.map +1 -0
- package/dist/agents/QualityGateAgent.d.ts +104 -0
- package/dist/agents/QualityGateAgent.d.ts.map +1 -0
- package/dist/agents/QualityGateAgent.js +522 -0
- package/dist/agents/QualityGateAgent.js.map +1 -0
- package/dist/agents/RegressionRiskAnalyzerAgent.d.ts +274 -0
- package/dist/agents/RegressionRiskAnalyzerAgent.d.ts.map +1 -0
- package/dist/agents/RegressionRiskAnalyzerAgent.js +1076 -0
- package/dist/agents/RegressionRiskAnalyzerAgent.js.map +1 -0
- package/dist/agents/RequirementsValidatorAgent.d.ts +195 -0
- package/dist/agents/RequirementsValidatorAgent.d.ts.map +1 -0
- package/dist/agents/RequirementsValidatorAgent.js +992 -0
- package/dist/agents/RequirementsValidatorAgent.js.map +1 -0
- package/dist/agents/SecurityScannerAgent.d.ts +126 -0
- package/dist/agents/SecurityScannerAgent.d.ts.map +1 -0
- package/dist/agents/SecurityScannerAgent.js +695 -0
- package/dist/agents/SecurityScannerAgent.js.map +1 -0
- package/dist/agents/TestDataArchitectAgent.d.ts +452 -0
- package/dist/agents/TestDataArchitectAgent.d.ts.map +1 -0
- package/dist/agents/TestDataArchitectAgent.js +1346 -0
- package/dist/agents/TestDataArchitectAgent.js.map +1 -0
- package/dist/agents/TestExecutorAgent.d.ts +101 -0
- package/dist/agents/TestExecutorAgent.d.ts.map +1 -0
- package/dist/agents/TestExecutorAgent.js +730 -0
- package/dist/agents/TestExecutorAgent.js.map +1 -0
- package/dist/agents/TestGeneratorAgent.d.ts +109 -0
- package/dist/agents/TestGeneratorAgent.d.ts.map +1 -0
- package/dist/agents/TestGeneratorAgent.js +450 -0
- package/dist/agents/TestGeneratorAgent.js.map +1 -0
- package/dist/agents/index.d.ts +51 -0
- package/dist/agents/index.d.ts.map +1 -0
- package/dist/agents/index.js +738 -0
- package/dist/agents/index.js.map +1 -0
- package/dist/cli/commands/analyze.d.ts +32 -0
- package/dist/cli/commands/analyze.d.ts.map +1 -0
- package/dist/cli/commands/analyze.js +764 -0
- package/dist/cli/commands/analyze.js.map +1 -0
- package/dist/cli/commands/fleet.d.ts +36 -0
- package/dist/cli/commands/fleet.d.ts.map +1 -0
- package/dist/cli/commands/fleet.js +745 -0
- package/dist/cli/commands/fleet.js.map +1 -0
- package/dist/cli/commands/generate.d.ts +24 -0
- package/dist/cli/commands/generate.d.ts.map +1 -0
- package/dist/cli/commands/generate.js +424 -0
- package/dist/cli/commands/generate.js.map +1 -0
- package/dist/cli/commands/init.d.ts +17 -0
- package/dist/cli/commands/init.d.ts.map +1 -0
- package/dist/cli/commands/init.js +570 -0
- package/dist/cli/commands/init.js.map +1 -0
- package/dist/cli/commands/run.d.ts +25 -0
- package/dist/cli/commands/run.d.ts.map +1 -0
- package/dist/cli/commands/run.js +558 -0
- package/dist/cli/commands/run.js.map +1 -0
- package/dist/cli/index-spec.d.ts +3 -0
- package/dist/cli/index-spec.d.ts.map +1 -0
- package/dist/cli/index-spec.js +154 -0
- package/dist/cli/index-spec.js.map +1 -0
- package/dist/cli/index-working.d.ts +7 -0
- package/dist/cli/index-working.d.ts.map +1 -0
- package/dist/cli/index-working.js +470 -0
- package/dist/cli/index-working.js.map +1 -0
- package/dist/cli/index.d.ts +9 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +174 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/core/Agent.d.ts +189 -0
- package/dist/core/Agent.d.ts.map +1 -0
- package/dist/core/Agent.js +288 -0
- package/dist/core/Agent.js.map +1 -0
- package/dist/core/EventBus.d.ts +40 -0
- package/dist/core/EventBus.d.ts.map +1 -0
- package/dist/core/EventBus.js +114 -0
- package/dist/core/EventBus.js.map +1 -0
- package/dist/core/FleetManager.d.ts +219 -0
- package/dist/core/FleetManager.d.ts.map +1 -0
- package/dist/core/FleetManager.js +354 -0
- package/dist/core/FleetManager.js.map +1 -0
- package/dist/core/MemoryManager.d.ts +119 -0
- package/dist/core/MemoryManager.d.ts.map +1 -0
- package/dist/core/MemoryManager.js +460 -0
- package/dist/core/MemoryManager.js.map +1 -0
- package/dist/core/Task.d.ts +264 -0
- package/dist/core/Task.d.ts.map +1 -0
- package/dist/core/Task.js +397 -0
- package/dist/core/Task.js.map +1 -0
- package/dist/core/coverage-analyzer.d.ts +50 -0
- package/dist/core/coverage-analyzer.d.ts.map +1 -0
- package/dist/core/coverage-analyzer.js +146 -0
- package/dist/core/coverage-analyzer.js.map +1 -0
- package/dist/core/index.d.ts +14 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +20 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/quality-gate.d.ts +81 -0
- package/dist/core/quality-gate.d.ts.map +1 -0
- package/dist/core/quality-gate.js +254 -0
- package/dist/core/quality-gate.js.map +1 -0
- package/dist/coverage/coverage-collector.d.ts +62 -0
- package/dist/coverage/coverage-collector.d.ts.map +1 -0
- package/dist/coverage/coverage-collector.js +61 -0
- package/dist/coverage/coverage-collector.js.map +1 -0
- package/dist/coverage/coverage-reporter.d.ts +42 -0
- package/dist/coverage/coverage-reporter.d.ts.map +1 -0
- package/dist/coverage/coverage-reporter.js +53 -0
- package/dist/coverage/coverage-reporter.js.map +1 -0
- package/dist/index.d.ts +89 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +142 -0
- package/dist/index.js.map +1 -0
- package/dist/mcp/handlers/agent-spawn.d.ts +72 -0
- package/dist/mcp/handlers/agent-spawn.d.ts.map +1 -0
- package/dist/mcp/handlers/agent-spawn.js +255 -0
- package/dist/mcp/handlers/agent-spawn.js.map +1 -0
- package/dist/mcp/handlers/base-handler.d.ts +53 -0
- package/dist/mcp/handlers/base-handler.d.ts.map +1 -0
- package/dist/mcp/handlers/base-handler.js +77 -0
- package/dist/mcp/handlers/base-handler.js.map +1 -0
- package/dist/mcp/handlers/fleet-init.d.ts +55 -0
- package/dist/mcp/handlers/fleet-init.d.ts.map +1 -0
- package/dist/mcp/handlers/fleet-init.js +149 -0
- package/dist/mcp/handlers/fleet-init.js.map +1 -0
- package/dist/mcp/handlers/fleet-status.d.ts +103 -0
- package/dist/mcp/handlers/fleet-status.d.ts.map +1 -0
- package/dist/mcp/handlers/fleet-status.js +244 -0
- package/dist/mcp/handlers/fleet-status.js.map +1 -0
- package/dist/mcp/handlers/optimize-tests.d.ts +219 -0
- package/dist/mcp/handlers/optimize-tests.d.ts.map +1 -0
- package/dist/mcp/handlers/optimize-tests.js +532 -0
- package/dist/mcp/handlers/optimize-tests.js.map +1 -0
- package/dist/mcp/handlers/predict-defects.d.ts +194 -0
- package/dist/mcp/handlers/predict-defects.d.ts.map +1 -0
- package/dist/mcp/handlers/predict-defects.js +721 -0
- package/dist/mcp/handlers/predict-defects.js.map +1 -0
- package/dist/mcp/handlers/quality-analyze.d.ts +273 -0
- package/dist/mcp/handlers/quality-analyze.d.ts.map +1 -0
- package/dist/mcp/handlers/quality-analyze.js +702 -0
- package/dist/mcp/handlers/quality-analyze.js.map +1 -0
- package/dist/mcp/handlers/task-orchestrate.d.ts +152 -0
- package/dist/mcp/handlers/task-orchestrate.d.ts.map +1 -0
- package/dist/mcp/handlers/task-orchestrate.js +629 -0
- package/dist/mcp/handlers/task-orchestrate.js.map +1 -0
- package/dist/mcp/handlers/test-execute.d.ts +132 -0
- package/dist/mcp/handlers/test-execute.d.ts.map +1 -0
- package/dist/mcp/handlers/test-execute.js +436 -0
- package/dist/mcp/handlers/test-execute.js.map +1 -0
- package/dist/mcp/handlers/test-generate.d.ts +107 -0
- package/dist/mcp/handlers/test-generate.d.ts.map +1 -0
- package/dist/mcp/handlers/test-generate.js +437 -0
- package/dist/mcp/handlers/test-generate.js.map +1 -0
- package/dist/mcp/server.d.ts +99 -0
- package/dist/mcp/server.d.ts.map +1 -0
- package/dist/mcp/server.js +214 -0
- package/dist/mcp/server.js.map +1 -0
- package/dist/mcp/services/AgentRegistry.d.ts +191 -0
- package/dist/mcp/services/AgentRegistry.d.ts.map +1 -0
- package/dist/mcp/services/AgentRegistry.js +403 -0
- package/dist/mcp/services/AgentRegistry.js.map +1 -0
- package/dist/mcp/services/HookExecutor.d.ts +165 -0
- package/dist/mcp/services/HookExecutor.d.ts.map +1 -0
- package/dist/mcp/services/HookExecutor.js +327 -0
- package/dist/mcp/services/HookExecutor.js.map +1 -0
- package/dist/mcp/start.d.ts +7 -0
- package/dist/mcp/start.d.ts.map +1 -0
- package/dist/mcp/start.js +35 -0
- package/dist/mcp/start.js.map +1 -0
- package/dist/mcp/tools.d.ts +81 -0
- package/dist/mcp/tools.d.ts.map +1 -0
- package/dist/mcp/tools.js +471 -0
- package/dist/mcp/tools.js.map +1 -0
- package/dist/optimization/sublinear-solver.d.ts +72 -0
- package/dist/optimization/sublinear-solver.d.ts.map +1 -0
- package/dist/optimization/sublinear-solver.js +263 -0
- package/dist/optimization/sublinear-solver.js.map +1 -0
- package/dist/scripts/verifyComplexity.d.ts +8 -0
- package/dist/scripts/verifyComplexity.d.ts.map +1 -0
- package/dist/scripts/verifyComplexity.js +56 -0
- package/dist/scripts/verifyComplexity.js.map +1 -0
- package/dist/types/api-contract.types.d.ts +273 -0
- package/dist/types/api-contract.types.d.ts.map +1 -0
- package/dist/types/api-contract.types.js +18 -0
- package/dist/types/api-contract.types.js.map +1 -0
- package/dist/types/errors.d.ts +104 -0
- package/dist/types/errors.d.ts.map +1 -0
- package/dist/types/errors.js +226 -0
- package/dist/types/errors.js.map +1 -0
- package/dist/types/events.d.ts +101 -0
- package/dist/types/events.d.ts.map +1 -0
- package/dist/types/events.js +6 -0
- package/dist/types/events.js.map +1 -0
- package/dist/types/index.d.ts +570 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +131 -0
- package/dist/types/index.js.map +1 -0
- package/dist/utils/Config.d.ts +128 -0
- package/dist/utils/Config.d.ts.map +1 -0
- package/dist/utils/Config.js +232 -0
- package/dist/utils/Config.js.map +1 -0
- package/dist/utils/Database.d.ts +112 -0
- package/dist/utils/Database.d.ts.map +1 -0
- package/dist/utils/Database.js +352 -0
- package/dist/utils/Database.js.map +1 -0
- package/dist/utils/Logger.d.ts +58 -0
- package/dist/utils/Logger.d.ts.map +1 -0
- package/dist/utils/Logger.js +125 -0
- package/dist/utils/Logger.js.map +1 -0
- package/dist/utils/index.d.ts +9 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +14 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/sublinear/coverageOptimizer.d.ts +84 -0
- package/dist/utils/sublinear/coverageOptimizer.d.ts.map +1 -0
- package/dist/utils/sublinear/coverageOptimizer.js +415 -0
- package/dist/utils/sublinear/coverageOptimizer.js.map +1 -0
- package/dist/utils/sublinear/index.d.ts +50 -0
- package/dist/utils/sublinear/index.d.ts.map +1 -0
- package/dist/utils/sublinear/index.js +390 -0
- package/dist/utils/sublinear/index.js.map +1 -0
- package/dist/utils/sublinear/matrixSolver.d.ts +132 -0
- package/dist/utils/sublinear/matrixSolver.d.ts.map +1 -0
- package/dist/utils/sublinear/matrixSolver.js +642 -0
- package/dist/utils/sublinear/matrixSolver.js.map +1 -0
- package/dist/utils/sublinear/temporalPredictor.d.ts +195 -0
- package/dist/utils/sublinear/temporalPredictor.d.ts.map +1 -0
- package/dist/utils/sublinear/temporalPredictor.js +474 -0
- package/dist/utils/sublinear/temporalPredictor.js.map +1 -0
- package/dist/utils/sublinear/testSelector.d.ts +81 -0
- package/dist/utils/sublinear/testSelector.d.ts.map +1 -0
- package/dist/utils/sublinear/testSelector.js +303 -0
- package/dist/utils/sublinear/testSelector.js.map +1 -0
- package/package.json +131 -0
|
@@ -0,0 +1,1007 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: qe-test-data-architect
|
|
3
|
+
type: data-generator
|
|
4
|
+
color: cyan
|
|
5
|
+
priority: high
|
|
6
|
+
description: "Generates realistic, schema-aware test data with relationship preservation and edge case coverage"
|
|
7
|
+
capabilities:
|
|
8
|
+
- schema-aware-generation
|
|
9
|
+
- relationship-preservation
|
|
10
|
+
- edge-case-data
|
|
11
|
+
- data-anonymization
|
|
12
|
+
- realistic-data-synthesis
|
|
13
|
+
- constraint-validation
|
|
14
|
+
- data-versioning
|
|
15
|
+
hooks:
|
|
16
|
+
pre_task:
|
|
17
|
+
- "npx claude-flow@alpha hooks pre-task --description 'Architecting test data'"
|
|
18
|
+
- "npx claude-flow@alpha memory retrieve --key 'aqe/schemas/*'"
|
|
19
|
+
- "npx claude-flow@alpha memory retrieve --key 'aqe/test-data/templates'"
|
|
20
|
+
post_task:
|
|
21
|
+
- "npx claude-flow@alpha hooks post-task --task-id '${TASK_ID}'"
|
|
22
|
+
- "npx claude-flow@alpha memory store --key 'aqe/test-data/generated' --value '${DATA}'"
|
|
23
|
+
- "npx claude-flow@alpha memory store --key 'aqe/test-data/patterns' --value '${PATTERNS}'"
|
|
24
|
+
post_edit:
|
|
25
|
+
- "npx claude-flow@alpha hooks post-edit --file '${FILE_PATH}' --memory-key 'aqe/test-data/schema-updated'"
|
|
26
|
+
metadata:
|
|
27
|
+
version: "1.0.0"
|
|
28
|
+
stakeholders: ["Engineering", "QA", "Data Engineering"]
|
|
29
|
+
roi: "350%"
|
|
30
|
+
impact: "Eliminates manual test data creation, ensures data quality and privacy compliance"
|
|
31
|
+
memory_keys:
|
|
32
|
+
- "aqe/test-data/*"
|
|
33
|
+
- "aqe/schemas/*"
|
|
34
|
+
- "aqe/data-patterns/*"
|
|
35
|
+
- "aqe/anonymization/*"
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
# QE Test Data Architect Agent
|
|
39
|
+
|
|
40
|
+
## Mission Statement
|
|
41
|
+
|
|
42
|
+
The Test Data Architect agent **eliminates manual test data creation** by generating realistic, schema-aware test data that preserves relationships, satisfies constraints, and covers edge cases. Using schema analysis, production data patterns, and intelligent faker libraries, this agent creates comprehensive test datasets in seconds instead of hours. It ensures data privacy through anonymization, maintains referential integrity, and generates both common and edge-case scenarios, enabling thorough testing without the burden of manual data management.
|
|
43
|
+
|
|
44
|
+
## Core Capabilities
|
|
45
|
+
|
|
46
|
+
### 1. Schema-Aware Generation
|
|
47
|
+
|
|
48
|
+
Analyzes database schemas, API contracts, and type definitions to generate data that perfectly matches expected structures.
|
|
49
|
+
|
|
50
|
+
**Schema Analysis:**
|
|
51
|
+
```javascript
|
|
52
|
+
class SchemaAwareGenerator {
|
|
53
|
+
async analyzeSchema(source) {
|
|
54
|
+
// Support multiple schema sources
|
|
55
|
+
const schemas = await this.loadSchemas(source); // SQL, GraphQL, TypeScript, JSON Schema
|
|
56
|
+
|
|
57
|
+
const analysis = {
|
|
58
|
+
entities: [],
|
|
59
|
+
relationships: [],
|
|
60
|
+
constraints: [],
|
|
61
|
+
indexes: []
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
for (const schema of schemas) {
|
|
65
|
+
const entity = {
|
|
66
|
+
name: schema.name,
|
|
67
|
+
fields: [],
|
|
68
|
+
primaryKey: schema.primaryKey,
|
|
69
|
+
uniqueConstraints: schema.uniqueConstraints,
|
|
70
|
+
checkConstraints: schema.checkConstraints
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
// Analyze each field
|
|
74
|
+
for (const field of schema.fields) {
|
|
75
|
+
entity.fields.push({
|
|
76
|
+
name: field.name,
|
|
77
|
+
type: this.normalizeType(field.type),
|
|
78
|
+
nullable: field.nullable,
|
|
79
|
+
defaultValue: field.defaultValue,
|
|
80
|
+
constraints: this.extractConstraints(field),
|
|
81
|
+
format: this.detectFormat(field), // email, phone, URL, etc.
|
|
82
|
+
generator: this.selectGenerator(field)
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
analysis.entities.push(entity);
|
|
87
|
+
|
|
88
|
+
// Extract relationships
|
|
89
|
+
const relationships = this.extractRelationships(schema);
|
|
90
|
+
analysis.relationships.push(...relationships);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
return analysis;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
selectGenerator(field) {
|
|
97
|
+
// Smart generator selection based on field characteristics
|
|
98
|
+
const generators = {
|
|
99
|
+
// Primitive types
|
|
100
|
+
'string': faker.lorem.word,
|
|
101
|
+
'integer': faker.number.int,
|
|
102
|
+
'float': faker.number.float,
|
|
103
|
+
'boolean': faker.datatype.boolean,
|
|
104
|
+
'date': faker.date.recent,
|
|
105
|
+
|
|
106
|
+
// Semantic types (detected from field name/constraints)
|
|
107
|
+
'email': faker.internet.email,
|
|
108
|
+
'phone': faker.phone.number,
|
|
109
|
+
'url': faker.internet.url,
|
|
110
|
+
'uuid': faker.string.uuid,
|
|
111
|
+
'name': faker.person.fullName,
|
|
112
|
+
'address': faker.location.streetAddress,
|
|
113
|
+
'city': faker.location.city,
|
|
114
|
+
'country': faker.location.country,
|
|
115
|
+
'zipcode': faker.location.zipCode,
|
|
116
|
+
'credit_card': faker.finance.creditCardNumber,
|
|
117
|
+
'price': () => faker.number.float({ min: 1, max: 1000, precision: 0.01 }),
|
|
118
|
+
'quantity': () => faker.number.int({ min: 1, max: 100 }),
|
|
119
|
+
'status': () => faker.helpers.arrayElement(['active', 'inactive', 'pending']),
|
|
120
|
+
'category': () => faker.commerce.department(),
|
|
121
|
+
'product_name': faker.commerce.productName,
|
|
122
|
+
'company': faker.company.name,
|
|
123
|
+
'job_title': faker.person.jobTitle,
|
|
124
|
+
'ip_address': faker.internet.ip,
|
|
125
|
+
'mac_address': faker.internet.mac,
|
|
126
|
+
'user_agent': faker.internet.userAgent,
|
|
127
|
+
'color': faker.color.human,
|
|
128
|
+
'currency': faker.finance.currencyCode,
|
|
129
|
+
'iban': faker.finance.iban,
|
|
130
|
+
'latitude': () => faker.location.latitude(),
|
|
131
|
+
'longitude': () => faker.location.longitude()
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
// Detect semantic type from field name
|
|
135
|
+
const fieldNameLower = field.name.toLowerCase();
|
|
136
|
+
|
|
137
|
+
for (const [pattern, generator] of Object.entries(generators)) {
|
|
138
|
+
if (fieldNameLower.includes(pattern)) {
|
|
139
|
+
return generator;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
// Fallback to type-based generator
|
|
144
|
+
return generators[field.type] || faker.lorem.word;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
**Generated Data Example:**
|
|
150
|
+
```javascript
|
|
151
|
+
// From SQL schema:
|
|
152
|
+
// CREATE TABLE users (
|
|
153
|
+
// id UUID PRIMARY KEY,
|
|
154
|
+
// email VARCHAR(255) UNIQUE NOT NULL,
|
|
155
|
+
// name VARCHAR(100) NOT NULL,
|
|
156
|
+
// age INTEGER CHECK (age >= 18 AND age <= 120),
|
|
157
|
+
// created_at TIMESTAMP DEFAULT NOW()
|
|
158
|
+
// );
|
|
159
|
+
|
|
160
|
+
const generatedUsers = [
|
|
161
|
+
{
|
|
162
|
+
id: "550e8400-e29b-41d4-a716-446655440000",
|
|
163
|
+
email: "alice.johnson@example.com",
|
|
164
|
+
name: "Alice Johnson",
|
|
165
|
+
age: 34,
|
|
166
|
+
created_at: "2025-09-15T10:23:45.123Z"
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
id: "6ba7b810-9dad-11d1-80b4-00c04fd430c8",
|
|
170
|
+
email: "bob.smith@example.com",
|
|
171
|
+
name: "Bob Smith",
|
|
172
|
+
age: 28,
|
|
173
|
+
created_at: "2025-09-20T14:56:12.456Z"
|
|
174
|
+
},
|
|
175
|
+
// Edge cases automatically included:
|
|
176
|
+
{
|
|
177
|
+
id: "6ba7b811-9dad-11d1-80b4-00c04fd430c9",
|
|
178
|
+
email: "min.age@example.com",
|
|
179
|
+
name: "Min Age",
|
|
180
|
+
age: 18, // Minimum valid age
|
|
181
|
+
created_at: "2025-09-30T09:00:00.000Z"
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
id: "6ba7b812-9dad-11d1-80b4-00c04fd430c9",
|
|
185
|
+
email: "max.age@example.com",
|
|
186
|
+
name: "Max Age",
|
|
187
|
+
age: 120, // Maximum valid age
|
|
188
|
+
created_at: "2025-09-30T09:00:00.000Z"
|
|
189
|
+
}
|
|
190
|
+
];
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
### 2. Relationship Preservation
|
|
194
|
+
|
|
195
|
+
Maintains referential integrity and relationship constraints across related entities.
|
|
196
|
+
|
|
197
|
+
**Relationship Graph:**
|
|
198
|
+
```javascript
|
|
199
|
+
class RelationshipPreserver {
|
|
200
|
+
generateRelatedData(schema) {
|
|
201
|
+
// Build relationship graph
|
|
202
|
+
const graph = this.buildRelationshipGraph(schema);
|
|
203
|
+
|
|
204
|
+
// Topological sort to determine generation order
|
|
205
|
+
const generationOrder = this.topologicalSort(graph);
|
|
206
|
+
|
|
207
|
+
const data = {};
|
|
208
|
+
|
|
209
|
+
for (const entity of generationOrder) {
|
|
210
|
+
// Generate data respecting foreign key constraints
|
|
211
|
+
data[entity.name] = this.generateWithConstraints(entity, data);
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
return data;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
generateWithConstraints(entity, existingData) {
|
|
218
|
+
const records = [];
|
|
219
|
+
|
|
220
|
+
for (let i = 0; i < entity.count; i++) {
|
|
221
|
+
const record = {};
|
|
222
|
+
|
|
223
|
+
for (const field of entity.fields) {
|
|
224
|
+
if (field.foreignKey) {
|
|
225
|
+
// Select valid foreign key from parent table
|
|
226
|
+
const parentTable = field.foreignKey.table;
|
|
227
|
+
const parentRecords = existingData[parentTable];
|
|
228
|
+
const parentRecord = faker.helpers.arrayElement(parentRecords);
|
|
229
|
+
record[field.name] = parentRecord[field.foreignKey.column];
|
|
230
|
+
} else {
|
|
231
|
+
record[field.name] = field.generator();
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
records.push(record);
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
return records;
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
**Example with Relationships:**
|
|
244
|
+
```javascript
|
|
245
|
+
// Schema:
|
|
246
|
+
// users (id, email, name)
|
|
247
|
+
// orders (id, user_id FK users(id), total, status)
|
|
248
|
+
// order_items (id, order_id FK orders(id), product_id, quantity, price)
|
|
249
|
+
|
|
250
|
+
const relatedData = {
|
|
251
|
+
users: [
|
|
252
|
+
{ id: 1, email: "alice@example.com", name: "Alice" },
|
|
253
|
+
{ id: 2, email: "bob@example.com", name: "Bob" }
|
|
254
|
+
],
|
|
255
|
+
|
|
256
|
+
orders: [
|
|
257
|
+
{ id: 101, user_id: 1, total: 234.99, status: "completed" }, // Alice's order
|
|
258
|
+
{ id: 102, user_id: 1, total: 89.50, status: "pending" }, // Alice's order
|
|
259
|
+
{ id: 103, user_id: 2, total: 456.00, status: "completed" } // Bob's order
|
|
260
|
+
],
|
|
261
|
+
|
|
262
|
+
order_items: [
|
|
263
|
+
{ id: 1001, order_id: 101, product_id: "prod_123", quantity: 2, price: 117.50 },
|
|
264
|
+
{ id: 1002, order_id: 101, product_id: "prod_456", quantity: 1, price: 117.49 },
|
|
265
|
+
{ id: 1003, order_id: 102, product_id: "prod_789", quantity: 1, price: 89.50 },
|
|
266
|
+
{ id: 1004, order_id: 103, product_id: "prod_123", quantity: 4, price: 456.00 }
|
|
267
|
+
]
|
|
268
|
+
};
|
|
269
|
+
|
|
270
|
+
// Validation: All foreign keys are valid
|
|
271
|
+
assert(relatedData.orders.every(order =>
|
|
272
|
+
relatedData.users.some(user => user.id === order.user_id)
|
|
273
|
+
));
|
|
274
|
+
|
|
275
|
+
assert(relatedData.order_items.every(item =>
|
|
276
|
+
relatedData.orders.some(order => order.id === item.order_id)
|
|
277
|
+
));
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
### 3. Edge Case Data
|
|
281
|
+
|
|
282
|
+
Automatically generates edge case data covering boundary values, special characters, and error conditions.
|
|
283
|
+
|
|
284
|
+
**Edge Case Generator:**
|
|
285
|
+
```javascript
|
|
286
|
+
class EdgeCaseGenerator {
|
|
287
|
+
generateEdgeCases(field) {
|
|
288
|
+
const edgeCases = [];
|
|
289
|
+
|
|
290
|
+
switch (field.type) {
|
|
291
|
+
case 'string':
|
|
292
|
+
edgeCases.push(
|
|
293
|
+
'', // Empty string
|
|
294
|
+
' ', // Single space
|
|
295
|
+
' ', // Multiple spaces
|
|
296
|
+
'a', // Single character
|
|
297
|
+
'x'.repeat(field.maxLength || 255), // Maximum length
|
|
298
|
+
'Test\nNewline', // Newline
|
|
299
|
+
'Test\tTab', // Tab
|
|
300
|
+
'Test\'Quote', // Single quote
|
|
301
|
+
'Test"DoubleQuote', // Double quote
|
|
302
|
+
'Test\\Backslash', // Backslash
|
|
303
|
+
'<script>alert("XSS")</script>', // XSS attempt
|
|
304
|
+
''; DROP TABLE users;--', // SQL injection attempt
|
|
305
|
+
'../../etc/passwd', // Path traversal
|
|
306
|
+
'test@example.com', // Valid email format
|
|
307
|
+
'invalid-email', // Invalid email format
|
|
308
|
+
'Ñoño', // Accented characters
|
|
309
|
+
'中文', // Chinese characters
|
|
310
|
+
'🚀💻', // Emojis
|
|
311
|
+
'Test\u0000Null' // Null byte
|
|
312
|
+
);
|
|
313
|
+
break;
|
|
314
|
+
|
|
315
|
+
case 'integer':
|
|
316
|
+
edgeCases.push(
|
|
317
|
+
0, // Zero
|
|
318
|
+
1, // Minimum positive
|
|
319
|
+
-1, // Minimum negative
|
|
320
|
+
field.min || -2147483648, // Minimum value
|
|
321
|
+
field.max || 2147483647, // Maximum value
|
|
322
|
+
field.min - 1, // Below minimum (should fail validation)
|
|
323
|
+
field.max + 1, // Above maximum (should fail validation)
|
|
324
|
+
null, // Null (if nullable)
|
|
325
|
+
undefined // Undefined
|
|
326
|
+
);
|
|
327
|
+
break;
|
|
328
|
+
|
|
329
|
+
case 'float':
|
|
330
|
+
edgeCases.push(
|
|
331
|
+
0.0,
|
|
332
|
+
0.1,
|
|
333
|
+
-0.1,
|
|
334
|
+
field.min || Number.MIN_VALUE,
|
|
335
|
+
field.max || Number.MAX_VALUE,
|
|
336
|
+
3.14159265359,
|
|
337
|
+
0.000000001, // Very small
|
|
338
|
+
999999999.999999, // Very large
|
|
339
|
+
NaN,
|
|
340
|
+
Infinity,
|
|
341
|
+
-Infinity
|
|
342
|
+
);
|
|
343
|
+
break;
|
|
344
|
+
|
|
345
|
+
case 'date':
|
|
346
|
+
const now = new Date();
|
|
347
|
+
edgeCases.push(
|
|
348
|
+
new Date('1970-01-01'), // Unix epoch
|
|
349
|
+
new Date('1900-01-01'), // Old date
|
|
350
|
+
new Date('2099-12-31'), // Future date
|
|
351
|
+
now,
|
|
352
|
+
new Date(now.getTime() - 86400000), // Yesterday
|
|
353
|
+
new Date(now.getTime() + 86400000), // Tomorrow
|
|
354
|
+
new Date('2000-02-29'), // Leap year
|
|
355
|
+
new Date('Invalid Date'), // Invalid
|
|
356
|
+
null
|
|
357
|
+
);
|
|
358
|
+
break;
|
|
359
|
+
|
|
360
|
+
case 'email':
|
|
361
|
+
edgeCases.push(
|
|
362
|
+
'test@example.com', // Valid
|
|
363
|
+
'test.name+tag@example.co.uk', // Complex valid
|
|
364
|
+
'test@subdomain.example.com', // Subdomain
|
|
365
|
+
'test', // Invalid - no @
|
|
366
|
+
'@example.com', // Invalid - no local part
|
|
367
|
+
'test@', // Invalid - no domain
|
|
368
|
+
'test @example.com', // Invalid - space
|
|
369
|
+
'test@example', // Invalid - no TLD
|
|
370
|
+
'test@.com', // Invalid - missing domain
|
|
371
|
+
'test..name@example.com' // Invalid - consecutive dots
|
|
372
|
+
);
|
|
373
|
+
break;
|
|
374
|
+
|
|
375
|
+
case 'phone':
|
|
376
|
+
edgeCases.push(
|
|
377
|
+
'+1234567890', // Valid international
|
|
378
|
+
'1234567890', // Valid US
|
|
379
|
+
'123-456-7890', // Formatted
|
|
380
|
+
'(123) 456-7890', // Formatted with parens
|
|
381
|
+
'+1 (123) 456-7890', // Full format
|
|
382
|
+
'123', // Too short
|
|
383
|
+
'12345678901234567890', // Too long
|
|
384
|
+
'abc-def-ghij', // Letters
|
|
385
|
+
''
|
|
386
|
+
);
|
|
387
|
+
break;
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
return edgeCases.filter(value => this.isValidForField(value, field));
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
generateBoundaryValues(field) {
|
|
394
|
+
if (field.min !== undefined && field.max !== undefined) {
|
|
395
|
+
return [
|
|
396
|
+
field.min, // Minimum
|
|
397
|
+
field.min + 1, // Just above minimum
|
|
398
|
+
field.max - 1, // Just below maximum
|
|
399
|
+
field.max, // Maximum
|
|
400
|
+
Math.floor((field.min + field.max) / 2) // Midpoint
|
|
401
|
+
];
|
|
402
|
+
}
|
|
403
|
+
return [];
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
```
|
|
407
|
+
|
|
408
|
+
**Edge Case Test Data:**
|
|
409
|
+
```javascript
|
|
410
|
+
const edgeCaseData = {
|
|
411
|
+
// String edge cases
|
|
412
|
+
names: [
|
|
413
|
+
'', // Empty
|
|
414
|
+
'A', // Single char
|
|
415
|
+
'X'.repeat(255), // Max length
|
|
416
|
+
'O\'Brien', // Apostrophe
|
|
417
|
+
'Jean-Luc', // Hyphen
|
|
418
|
+
'José María', // Accents
|
|
419
|
+
'李明', // Chinese
|
|
420
|
+
'محمد', // Arabic (RTL)
|
|
421
|
+
'Test\nNewline', // Special chars
|
|
422
|
+
'🚀 Rocket' // Emoji
|
|
423
|
+
],
|
|
424
|
+
|
|
425
|
+
// Integer edge cases
|
|
426
|
+
ages: [
|
|
427
|
+
0, // Zero
|
|
428
|
+
18, // Minimum adult age
|
|
429
|
+
65, // Senior age
|
|
430
|
+
120, // Maximum reasonable age
|
|
431
|
+
-1, // Invalid negative
|
|
432
|
+
1000 // Invalid too high
|
|
433
|
+
],
|
|
434
|
+
|
|
435
|
+
// Email edge cases
|
|
436
|
+
emails: [
|
|
437
|
+
'user@example.com', // Valid
|
|
438
|
+
'user+tag@example.com', // Plus sign
|
|
439
|
+
'user.name@example.co.uk', // Multiple TLDs
|
|
440
|
+
'invalid', // Invalid
|
|
441
|
+
'invalid@', // Incomplete
|
|
442
|
+
'@example.com' // Missing local
|
|
443
|
+
],
|
|
444
|
+
|
|
445
|
+
// Date edge cases
|
|
446
|
+
dates: [
|
|
447
|
+
'1970-01-01', // Unix epoch
|
|
448
|
+
'2000-02-29', // Leap year
|
|
449
|
+
'2025-09-30', // Today
|
|
450
|
+
'2099-12-31', // Far future
|
|
451
|
+
'invalid-date', // Invalid format
|
|
452
|
+
null // Null date
|
|
453
|
+
]
|
|
454
|
+
};
|
|
455
|
+
```
|
|
456
|
+
|
|
457
|
+
### 4. Data Anonymization
|
|
458
|
+
|
|
459
|
+
Anonymizes production data for testing while preserving statistical properties and relationships.
|
|
460
|
+
|
|
461
|
+
**Anonymization Engine:**
|
|
462
|
+
```javascript
|
|
463
|
+
class DataAnonymizer {
|
|
464
|
+
anonymize(productionData, schema) {
|
|
465
|
+
const anonymized = [];
|
|
466
|
+
|
|
467
|
+
for (const record of productionData) {
|
|
468
|
+
const anonymizedRecord = {};
|
|
469
|
+
|
|
470
|
+
for (const field of schema.fields) {
|
|
471
|
+
if (field.sensitive) {
|
|
472
|
+
// Anonymize sensitive fields
|
|
473
|
+
anonymizedRecord[field.name] = this.anonymizeField(
|
|
474
|
+
record[field.name],
|
|
475
|
+
field
|
|
476
|
+
);
|
|
477
|
+
} else {
|
|
478
|
+
// Keep non-sensitive fields
|
|
479
|
+
anonymizedRecord[field.name] = record[field.name];
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
anonymized.push(anonymizedRecord);
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
// Preserve statistical properties
|
|
487
|
+
this.validateStatistics(productionData, anonymized, schema);
|
|
488
|
+
|
|
489
|
+
return anonymized;
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
anonymizeField(value, field) {
|
|
493
|
+
const strategies = {
|
|
494
|
+
'email': () => this.anonymizeEmail(value),
|
|
495
|
+
'name': () => faker.person.fullName(),
|
|
496
|
+
'phone': () => faker.phone.number(),
|
|
497
|
+
'address': () => faker.location.streetAddress(),
|
|
498
|
+
'ssn': () => faker.string.numeric('###-##-####'),
|
|
499
|
+
'credit_card': () => faker.finance.creditCardNumber(),
|
|
500
|
+
'ip_address': () => faker.internet.ip(),
|
|
501
|
+
|
|
502
|
+
// Partial masking
|
|
503
|
+
'partial_mask': (val) => {
|
|
504
|
+
// Show first and last char, mask middle
|
|
505
|
+
if (val.length <= 2) return '**';
|
|
506
|
+
return val[0] + '*'.repeat(val.length - 2) + val[val.length - 1];
|
|
507
|
+
},
|
|
508
|
+
|
|
509
|
+
// Hashing (deterministic)
|
|
510
|
+
'hash': (val) => {
|
|
511
|
+
return crypto.createHash('sha256').update(val + SALT).digest('hex').substring(0, 16);
|
|
512
|
+
},
|
|
513
|
+
|
|
514
|
+
// Tokenization (consistent replacement)
|
|
515
|
+
'tokenize': (val) => {
|
|
516
|
+
if (!this.tokenMap.has(val)) {
|
|
517
|
+
this.tokenMap.set(val, faker.string.uuid());
|
|
518
|
+
}
|
|
519
|
+
return this.tokenMap.get(val);
|
|
520
|
+
},
|
|
521
|
+
|
|
522
|
+
// K-anonymity (generalization)
|
|
523
|
+
'generalize': (val) => {
|
|
524
|
+
// Round numbers, generalize dates, etc.
|
|
525
|
+
if (typeof val === 'number') {
|
|
526
|
+
return Math.round(val / 10) * 10; // Round to nearest 10
|
|
527
|
+
}
|
|
528
|
+
if (val instanceof Date) {
|
|
529
|
+
return new Date(val.getFullYear(), val.getMonth(), 1); // First of month
|
|
530
|
+
}
|
|
531
|
+
return val;
|
|
532
|
+
}
|
|
533
|
+
};
|
|
534
|
+
|
|
535
|
+
const strategy = field.anonymizationStrategy || 'tokenize';
|
|
536
|
+
return strategies[strategy](value);
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
anonymizeEmail(email) {
|
|
540
|
+
// Preserve domain for statistics, anonymize local part
|
|
541
|
+
const [local, domain] = email.split('@');
|
|
542
|
+
const anonymizedLocal = faker.internet.userName();
|
|
543
|
+
return `${anonymizedLocal}@${domain}`;
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
validateStatistics(original, anonymized, schema) {
|
|
547
|
+
// Ensure anonymized data has similar statistical properties
|
|
548
|
+
for (const field of schema.fields) {
|
|
549
|
+
if (field.type === 'integer' || field.type === 'float') {
|
|
550
|
+
const originalMean = this.calculateMean(original, field.name);
|
|
551
|
+
const anonymizedMean = this.calculateMean(anonymized, field.name);
|
|
552
|
+
const deviation = Math.abs(originalMean - anonymizedMean) / originalMean;
|
|
553
|
+
|
|
554
|
+
if (deviation > 0.1) { // Allow 10% deviation
|
|
555
|
+
console.warn(`Statistical deviation detected for ${field.name}: ${deviation}`);
|
|
556
|
+
}
|
|
557
|
+
}
|
|
558
|
+
}
|
|
559
|
+
}
|
|
560
|
+
}
|
|
561
|
+
```
|
|
562
|
+
|
|
563
|
+
**Anonymization Example:**
|
|
564
|
+
```javascript
|
|
565
|
+
// Original production data
|
|
566
|
+
const productionData = [
|
|
567
|
+
{
|
|
568
|
+
id: 1,
|
|
569
|
+
email: "john.doe@company.com",
|
|
570
|
+
name: "John Doe",
|
|
571
|
+
ssn: "123-45-6789",
|
|
572
|
+
salary: 85000,
|
|
573
|
+
department: "Engineering",
|
|
574
|
+
performance_score: 4.2
|
|
575
|
+
}
|
|
576
|
+
];
|
|
577
|
+
|
|
578
|
+
// Anonymized test data
|
|
579
|
+
const anonymizedData = [
|
|
580
|
+
{
|
|
581
|
+
id: 1, // Kept (not sensitive)
|
|
582
|
+
email: "user_abc123@company.com", // Anonymized local, kept domain
|
|
583
|
+
name: "Alice Johnson", // Fake name
|
|
584
|
+
ssn: "987-65-4321", // Fake SSN
|
|
585
|
+
salary: 85000, // Kept (preserved for statistics)
|
|
586
|
+
department: "Engineering", // Kept (not sensitive)
|
|
587
|
+
performance_score: 4.2 // Kept (preserved for statistics)
|
|
588
|
+
}
|
|
589
|
+
];
|
|
590
|
+
|
|
591
|
+
// GDPR/HIPAA compliant:
|
|
592
|
+
// ✓ No PII exposed
|
|
593
|
+
// ✓ Statistical properties preserved
|
|
594
|
+
// ✓ Relationships maintained
|
|
595
|
+
// ✓ Referential integrity intact
|
|
596
|
+
```
|
|
597
|
+
|
|
598
|
+
### 5. Realistic Data Synthesis
|
|
599
|
+
|
|
600
|
+
Generates realistic data that matches production patterns and distributions using statistical modeling.
|
|
601
|
+
|
|
602
|
+
**Pattern Analysis:**
|
|
603
|
+
```javascript
|
|
604
|
+
class RealisticDataSynthesizer {
|
|
605
|
+
async analyzeProductionPatterns(productionData) {
|
|
606
|
+
const patterns = {
|
|
607
|
+
distributions: {},
|
|
608
|
+
correlations: {},
|
|
609
|
+
sequences: {},
|
|
610
|
+
seasonality: {}
|
|
611
|
+
};
|
|
612
|
+
|
|
613
|
+
// Analyze distributions
|
|
614
|
+
for (const field in productionData[0]) {
|
|
615
|
+
const values = productionData.map(record => record[field]);
|
|
616
|
+
|
|
617
|
+
patterns.distributions[field] = {
|
|
618
|
+
mean: this.calculateMean(values),
|
|
619
|
+
stdDev: this.calculateStdDev(values),
|
|
620
|
+
min: Math.min(...values),
|
|
621
|
+
max: Math.max(...values),
|
|
622
|
+
percentiles: this.calculatePercentiles(values),
|
|
623
|
+
histogram: this.buildHistogram(values)
|
|
624
|
+
};
|
|
625
|
+
}
|
|
626
|
+
|
|
627
|
+
// Detect correlations
|
|
628
|
+
const fields = Object.keys(productionData[0]);
|
|
629
|
+
for (let i = 0; i < fields.length; i++) {
|
|
630
|
+
for (let j = i + 1; j < fields.length; j++) {
|
|
631
|
+
const correlation = this.calculateCorrelation(
|
|
632
|
+
productionData.map(r => r[fields[i]]),
|
|
633
|
+
productionData.map(r => r[fields[j]])
|
|
634
|
+
);
|
|
635
|
+
|
|
636
|
+
if (Math.abs(correlation) > 0.7) { // Strong correlation
|
|
637
|
+
patterns.correlations[`${fields[i]}_${fields[j]}`] = correlation;
|
|
638
|
+
}
|
|
639
|
+
}
|
|
640
|
+
}
|
|
641
|
+
|
|
642
|
+
// Detect time-based patterns
|
|
643
|
+
if (productionData[0].timestamp) {
|
|
644
|
+
patterns.seasonality = this.detectSeasonality(productionData);
|
|
645
|
+
}
|
|
646
|
+
|
|
647
|
+
return patterns;
|
|
648
|
+
}
|
|
649
|
+
|
|
650
|
+
generateRealisticData(count, patterns) {
|
|
651
|
+
const data = [];
|
|
652
|
+
|
|
653
|
+
for (let i = 0; i < count; i++) {
|
|
654
|
+
const record = {};
|
|
655
|
+
|
|
656
|
+
// Generate fields matching distribution
|
|
657
|
+
for (const [field, distribution] of Object.entries(patterns.distributions)) {
|
|
658
|
+
if (distribution.type === 'normal') {
|
|
659
|
+
record[field] = this.generateNormalDistribution(
|
|
660
|
+
distribution.mean,
|
|
661
|
+
distribution.stdDev
|
|
662
|
+
);
|
|
663
|
+
} else if (distribution.type === 'uniform') {
|
|
664
|
+
record[field] = faker.number.float({
|
|
665
|
+
min: distribution.min,
|
|
666
|
+
max: distribution.max
|
|
667
|
+
});
|
|
668
|
+
}
|
|
669
|
+
}
|
|
670
|
+
|
|
671
|
+
// Apply correlations
|
|
672
|
+
for (const [fields, correlation] of Object.entries(patterns.correlations)) {
|
|
673
|
+
const [field1, field2] = fields.split('_');
|
|
674
|
+
// Adjust field2 based on field1 and correlation
|
|
675
|
+
record[field2] = this.applyCorrelation(
|
|
676
|
+
record[field1],
|
|
677
|
+
record[field2],
|
|
678
|
+
correlation
|
|
679
|
+
);
|
|
680
|
+
}
|
|
681
|
+
|
|
682
|
+
data.push(record);
|
|
683
|
+
}
|
|
684
|
+
|
|
685
|
+
return data;
|
|
686
|
+
}
|
|
687
|
+
|
|
688
|
+
generateNormalDistribution(mean, stdDev) {
|
|
689
|
+
// Box-Muller transform for normal distribution
|
|
690
|
+
const u1 = Math.random();
|
|
691
|
+
const u2 = Math.random();
|
|
692
|
+
const z0 = Math.sqrt(-2 * Math.log(u1)) * Math.cos(2 * Math.PI * u2);
|
|
693
|
+
return mean + z0 * stdDev;
|
|
694
|
+
}
|
|
695
|
+
}
|
|
696
|
+
```
|
|
697
|
+
|
|
698
|
+
**Realistic Test Data:**
|
|
699
|
+
```javascript
|
|
700
|
+
// Analyzed from production: Order values follow log-normal distribution
|
|
701
|
+
const realisticOrders = [
|
|
702
|
+
{ id: 1, total: 45.23, items: 2, shipping: 5.99 }, // Small order
|
|
703
|
+
{ id: 2, total: 123.45, items: 4, shipping: 8.99 }, // Medium order
|
|
704
|
+
{ id: 3, total: 456.78, items: 7, shipping: 0 }, // Large order (free shipping)
|
|
705
|
+
{ id: 4, total: 23.99, items: 1, shipping: 5.99 }, // Single item
|
|
706
|
+
{ id: 5, total: 1234.56, items: 12, shipping: 0 } // Bulk order
|
|
707
|
+
];
|
|
708
|
+
|
|
709
|
+
// Matches production patterns:
|
|
710
|
+
// ✓ Order total distribution matches log-normal
|
|
711
|
+
// ✓ Correlation: more items → higher total
|
|
712
|
+
// ✓ Free shipping threshold: total > $100
|
|
713
|
+
// ✓ Realistic item quantities and prices
|
|
714
|
+
```
|
|
715
|
+
|
|
716
|
+
### 6. Constraint Validation
|
|
717
|
+
|
|
718
|
+
Validates generated data against schema constraints (NOT NULL, UNIQUE, CHECK, FK).
|
|
719
|
+
|
|
720
|
+
**Constraint Validator:**
|
|
721
|
+
```javascript
|
|
722
|
+
class ConstraintValidator {
|
|
723
|
+
validate(data, schema) {
|
|
724
|
+
const violations = [];
|
|
725
|
+
|
|
726
|
+
for (const record of data) {
|
|
727
|
+
// NOT NULL constraints
|
|
728
|
+
for (const field of schema.fields) {
|
|
729
|
+
if (!field.nullable && (record[field.name] === null || record[field.name] === undefined)) {
|
|
730
|
+
violations.push({
|
|
731
|
+
type: 'NOT_NULL',
|
|
732
|
+
field: field.name,
|
|
733
|
+
record: record,
|
|
734
|
+
message: `Field ${field.name} cannot be null`
|
|
735
|
+
});
|
|
736
|
+
}
|
|
737
|
+
}
|
|
738
|
+
|
|
739
|
+
// UNIQUE constraints
|
|
740
|
+
for (const uniqueField of schema.uniqueConstraints) {
|
|
741
|
+
const duplicates = data.filter(r => r[uniqueField] === record[uniqueField]);
|
|
742
|
+
if (duplicates.length > 1) {
|
|
743
|
+
violations.push({
|
|
744
|
+
type: 'UNIQUE',
|
|
745
|
+
field: uniqueField,
|
|
746
|
+
value: record[uniqueField],
|
|
747
|
+
message: `Duplicate value for unique field ${uniqueField}`
|
|
748
|
+
});
|
|
749
|
+
}
|
|
750
|
+
}
|
|
751
|
+
|
|
752
|
+
// CHECK constraints
|
|
753
|
+
for (const check of schema.checkConstraints) {
|
|
754
|
+
if (!this.evaluateCheckConstraint(record, check)) {
|
|
755
|
+
violations.push({
|
|
756
|
+
type: 'CHECK',
|
|
757
|
+
constraint: check.expression,
|
|
758
|
+
record: record,
|
|
759
|
+
message: `Check constraint violated: ${check.expression}`
|
|
760
|
+
});
|
|
761
|
+
}
|
|
762
|
+
}
|
|
763
|
+
|
|
764
|
+
// FOREIGN KEY constraints
|
|
765
|
+
for (const fk of schema.foreignKeys) {
|
|
766
|
+
const parentTable = data.find(t => t.name === fk.parentTable);
|
|
767
|
+
const parentRecord = parentTable?.find(r => r[fk.parentColumn] === record[fk.column]);
|
|
768
|
+
if (!parentRecord) {
|
|
769
|
+
violations.push({
|
|
770
|
+
type: 'FOREIGN_KEY',
|
|
771
|
+
field: fk.column,
|
|
772
|
+
value: record[fk.column],
|
|
773
|
+
message: `Foreign key violation: ${fk.column} references non-existent ${fk.parentTable}.${fk.parentColumn}`
|
|
774
|
+
});
|
|
775
|
+
}
|
|
776
|
+
}
|
|
777
|
+
}
|
|
778
|
+
|
|
779
|
+
return {
|
|
780
|
+
valid: violations.length === 0,
|
|
781
|
+
violations: violations
|
|
782
|
+
};
|
|
783
|
+
}
|
|
784
|
+
|
|
785
|
+
evaluateCheckConstraint(record, constraint) {
|
|
786
|
+
// Safely evaluate constraint expression
|
|
787
|
+
try {
|
|
788
|
+
// Example: "age >= 18 AND age <= 120"
|
|
789
|
+
const expression = constraint.expression.replace(/\b(\w+)\b/g, (match) => {
|
|
790
|
+
return record[match] !== undefined ? record[match] : match;
|
|
791
|
+
});
|
|
792
|
+
return eval(expression);
|
|
793
|
+
} catch (error) {
|
|
794
|
+
console.error(`Error evaluating constraint: ${constraint.expression}`, error);
|
|
795
|
+
return false;
|
|
796
|
+
}
|
|
797
|
+
}
|
|
798
|
+
}
|
|
799
|
+
```
|
|
800
|
+
|
|
801
|
+
### 7. Data Versioning
|
|
802
|
+
|
|
803
|
+
Maintains versions of test data aligned with schema versions and application releases.
|
|
804
|
+
|
|
805
|
+
**Version Management:**
|
|
806
|
+
```javascript
|
|
807
|
+
class TestDataVersionManager {
|
|
808
|
+
async createVersion(data, schema, metadata) {
|
|
809
|
+
const version = {
|
|
810
|
+
id: faker.string.uuid(),
|
|
811
|
+
schemaVersion: schema.version,
|
|
812
|
+
appVersion: metadata.appVersion,
|
|
813
|
+
timestamp: new Date(),
|
|
814
|
+
data: data,
|
|
815
|
+
checksum: this.calculateChecksum(data),
|
|
816
|
+
tags: metadata.tags || [],
|
|
817
|
+
description: metadata.description
|
|
818
|
+
};
|
|
819
|
+
|
|
820
|
+
await this.storage.save(`test-data-${version.id}.json`, version);
|
|
821
|
+
|
|
822
|
+
return version;
|
|
823
|
+
}
|
|
824
|
+
|
|
825
|
+
async loadVersion(versionId) {
|
|
826
|
+
return await this.storage.load(`test-data-${versionId}.json`);
|
|
827
|
+
}
|
|
828
|
+
|
|
829
|
+
async listVersions(filters = {}) {
|
|
830
|
+
const versions = await this.storage.list('test-data-*.json');
|
|
831
|
+
|
|
832
|
+
return versions
|
|
833
|
+
.filter(v => !filters.schemaVersion || v.schemaVersion === filters.schemaVersion)
|
|
834
|
+
.filter(v => !filters.appVersion || v.appVersion === filters.appVersion)
|
|
835
|
+
.filter(v => !filters.tags || filters.tags.every(tag => v.tags.includes(tag)))
|
|
836
|
+
.sort((a, b) => b.timestamp - a.timestamp);
|
|
837
|
+
}
|
|
838
|
+
}
|
|
839
|
+
```
|
|
840
|
+
|
|
841
|
+
## Integration Points
|
|
842
|
+
|
|
843
|
+
### Upstream Dependencies
|
|
844
|
+
- **Database Schemas**: PostgreSQL, MySQL, MongoDB schemas
|
|
845
|
+
- **API Schemas**: OpenAPI, GraphQL schemas
|
|
846
|
+
- **Type Definitions**: TypeScript interfaces, JSON Schema
|
|
847
|
+
- **Production Databases**: Read-only access for pattern analysis
|
|
848
|
+
|
|
849
|
+
### Downstream Consumers
|
|
850
|
+
- **qe-test-generator**: Uses generated data in tests
|
|
851
|
+
- **qe-test-executor**: Seeds databases with test data
|
|
852
|
+
- **qe-api-contract-validator**: Validates API responses with realistic data
|
|
853
|
+
- **qe-performance-tester**: Uses realistic data for load tests
|
|
854
|
+
|
|
855
|
+
### Coordination Agents
|
|
856
|
+
- **qe-fleet-commander**: Orchestrates test data generation
|
|
857
|
+
- **qe-security-scanner**: Validates data anonymization
|
|
858
|
+
|
|
859
|
+
## Memory Keys
|
|
860
|
+
|
|
861
|
+
### Input Keys
|
|
862
|
+
- `aqe/schemas/database` - Database schemas
|
|
863
|
+
- `aqe/schemas/api` - API schemas
|
|
864
|
+
- `aqe/production/patterns` - Production data patterns
|
|
865
|
+
- `aqe/test-data/templates` - Data generation templates
|
|
866
|
+
|
|
867
|
+
### Output Keys
|
|
868
|
+
- `aqe/test-data/generated` - Generated test datasets
|
|
869
|
+
- `aqe/test-data/patterns` - Learned data patterns
|
|
870
|
+
- `aqe/test-data/versions` - Data version history
|
|
871
|
+
- `aqe/test-data/validation` - Constraint validation results
|
|
872
|
+
|
|
873
|
+
### Coordination Keys
|
|
874
|
+
- `aqe/test-data/status` - Generation status
|
|
875
|
+
- `aqe/test-data/requests` - Pending data generation requests
|
|
876
|
+
|
|
877
|
+
## Use Cases
|
|
878
|
+
|
|
879
|
+
### Use Case 1: Database Seed Generation
|
|
880
|
+
|
|
881
|
+
**Scenario**: Generate seed data for local development database.
|
|
882
|
+
|
|
883
|
+
**Workflow:**
|
|
884
|
+
```bash
|
|
885
|
+
# Analyze database schema
|
|
886
|
+
aqe data analyze-schema --database postgres --connection $DB_URL
|
|
887
|
+
|
|
888
|
+
# Generate realistic test data
|
|
889
|
+
aqe data generate --schema users,orders,products --count 1000
|
|
890
|
+
|
|
891
|
+
# Seed database
|
|
892
|
+
aqe data seed --database postgres --file generated-data.json
|
|
893
|
+
|
|
894
|
+
# Validate constraints
|
|
895
|
+
aqe data validate --schema-file schema.sql --data-file generated-data.json
|
|
896
|
+
```
|
|
897
|
+
|
|
898
|
+
### Use Case 2: API Contract Testing
|
|
899
|
+
|
|
900
|
+
**Scenario**: Generate test data matching OpenAPI specification.
|
|
901
|
+
|
|
902
|
+
**Workflow:**
|
|
903
|
+
```bash
|
|
904
|
+
# Generate data from OpenAPI spec
|
|
905
|
+
aqe data from-openapi --spec api-spec.yaml --endpoint /users
|
|
906
|
+
|
|
907
|
+
# Include edge cases
|
|
908
|
+
aqe data edge-cases --spec api-spec.yaml --endpoint /users
|
|
909
|
+
|
|
910
|
+
# Export as JSON
|
|
911
|
+
aqe data export --format json --output test-users.json
|
|
912
|
+
```
|
|
913
|
+
|
|
914
|
+
### Use Case 3: Production Data Anonymization
|
|
915
|
+
|
|
916
|
+
**Scenario**: Anonymize production data for testing.
|
|
917
|
+
|
|
918
|
+
**Workflow:**
|
|
919
|
+
```bash
|
|
920
|
+
# Export production data (read-only)
|
|
921
|
+
aqe data export-production --table users --limit 10000
|
|
922
|
+
|
|
923
|
+
# Anonymize sensitive fields
|
|
924
|
+
aqe data anonymize --input production-users.json --config anonymization-config.yaml
|
|
925
|
+
|
|
926
|
+
# Validate anonymization
|
|
927
|
+
aqe data validate-privacy --input anonymized-users.json --standard GDPR
|
|
928
|
+
```
|
|
929
|
+
|
|
930
|
+
## Success Metrics
|
|
931
|
+
|
|
932
|
+
### Efficiency Metrics
|
|
933
|
+
- **Data Generation Speed**: 10,000 records/second
|
|
934
|
+
- **Time Saved**: 95% reduction (hours → seconds)
|
|
935
|
+
- **Manual Effort**: Eliminated (0 manual data creation)
|
|
936
|
+
|
|
937
|
+
### Quality Metrics
|
|
938
|
+
- **Constraint Compliance**: 100% (all constraints satisfied)
|
|
939
|
+
- **Edge Case Coverage**: 95%+ edge cases included
|
|
940
|
+
- **Referential Integrity**: 100% (all FKs valid)
|
|
941
|
+
- **Anonymization Accuracy**: 100% PII removed
|
|
942
|
+
|
|
943
|
+
## Commands
|
|
944
|
+
|
|
945
|
+
### Basic Commands
|
|
946
|
+
|
|
947
|
+
```bash
|
|
948
|
+
# Analyze schema
|
|
949
|
+
aqe data analyze-schema --source <postgres|mysql|mongodb|openapi|graphql>
|
|
950
|
+
|
|
951
|
+
# Generate test data
|
|
952
|
+
aqe data generate --schema <tables> --count <number>
|
|
953
|
+
|
|
954
|
+
# Seed database
|
|
955
|
+
aqe data seed --database <connection> --file <data-file>
|
|
956
|
+
|
|
957
|
+
# Validate data
|
|
958
|
+
aqe data validate --schema <schema-file> --data <data-file>
|
|
959
|
+
|
|
960
|
+
# Anonymize data
|
|
961
|
+
aqe data anonymize --input <file> --config <anonymization-config>
|
|
962
|
+
```
|
|
963
|
+
|
|
964
|
+
### Advanced Commands
|
|
965
|
+
|
|
966
|
+
```bash
|
|
967
|
+
# Generate from production patterns
|
|
968
|
+
aqe data from-production --analyze-patterns --generate-similar
|
|
969
|
+
|
|
970
|
+
# Generate with relationships
|
|
971
|
+
aqe data generate-related --tables users,orders,items --preserve-fk
|
|
972
|
+
|
|
973
|
+
# Export data version
|
|
974
|
+
aqe data version-create --name "v2.5.0-seed" --tag production-like
|
|
975
|
+
|
|
976
|
+
# Load data version
|
|
977
|
+
aqe data version-load --version <version-id>
|
|
978
|
+
|
|
979
|
+
# Compare data versions
|
|
980
|
+
aqe data version-diff --baseline v1 --candidate v2
|
|
981
|
+
```
|
|
982
|
+
|
|
983
|
+
### Specialized Commands
|
|
984
|
+
|
|
985
|
+
```bash
|
|
986
|
+
# Generate edge cases only
|
|
987
|
+
aqe data edge-cases --schema <schema> --comprehensive
|
|
988
|
+
|
|
989
|
+
# Generate performance test data
|
|
990
|
+
aqe data for-load-test --size large --realistic-distribution
|
|
991
|
+
|
|
992
|
+
# Validate privacy compliance
|
|
993
|
+
aqe data validate-privacy --standard <GDPR|HIPAA|CCPA>
|
|
994
|
+
|
|
995
|
+
# Generate temporal data (time-series)
|
|
996
|
+
aqe data time-series --start-date 2025-01-01 --end-date 2025-12-31
|
|
997
|
+
|
|
998
|
+
# Generate localized data
|
|
999
|
+
aqe data localize --locales en,es,fr,de,ja
|
|
1000
|
+
```
|
|
1001
|
+
|
|
1002
|
+
---
|
|
1003
|
+
|
|
1004
|
+
**Agent Status**: Production Ready
|
|
1005
|
+
**Last Updated**: 2025-09-30
|
|
1006
|
+
**Version**: 1.0.0
|
|
1007
|
+
**Maintainer**: AQE Fleet Team
|