claude-flow-novice 2.2.4 ā 2.2.5
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/package.json +9 -8
- package/scripts/.claude-flow/metrics/agent-metrics.json +1 -0
- package/scripts/.claude-flow/metrics/performance.json +9 -0
- package/scripts/.claude-flow/metrics/task-metrics.json +10 -0
- package/scripts/CLEANUP_OPTIMIZATION_REPORT.json +312 -0
- package/scripts/CLEANUP_PERFORMANCE_OPTIMIZATION.md +387 -0
- package/scripts/CLEANUP_QUICK_START.md +268 -0
- package/scripts/CLEANUP_TEST_RESULTS.md +205 -0
- package/scripts/README.md +339 -0
- package/scripts/ace-query.sh +384 -0
- package/scripts/agent-token-analysis.js +430 -0
- package/scripts/auto-setup.js +332 -0
- package/scripts/build/README.md +167 -0
- package/scripts/build/build-config.js +27 -0
- package/scripts/build/build-prompt-copier.sh +30 -0
- package/scripts/build/performance-monitor.js +869 -0
- package/scripts/build/prepare-publish.js +150 -0
- package/scripts/build/typescript-fixer.js +621 -0
- package/scripts/build/unified-builder.sh +428 -0
- package/scripts/build/update-bin-version.js +32 -0
- package/scripts/build/validate-agents.js +238 -0
- package/scripts/build-index.js +43 -0
- package/scripts/build-orchestrator.js +320 -0
- package/scripts/check-routing-stats.cjs +122 -0
- package/scripts/ci-validation.js +375 -0
- package/scripts/cleanup-blocking-coordination.sh +420 -0
- package/scripts/cleanup-idle-sessions.sh +59 -0
- package/scripts/collect-build-metrics.js +65 -0
- package/scripts/demo/README.md +79 -0
- package/scripts/demo/autoscaling-demo-simplified.js +963 -0
- package/scripts/demo/comprehensive-dashboard-test.js +693 -0
- package/scripts/demo/confidence-log.js +87 -0
- package/scripts/demo/confidence-report.js +82 -0
- package/scripts/demo/demo-multi-swarm-coordination.js +325 -0
- package/scripts/demo/demo-production-deployment.js +399 -0
- package/scripts/demo/demo-visualization-system.js +149 -0
- package/scripts/demo/performance-analysis.cjs +71 -0
- package/scripts/demo/performance-analysis.js +71 -0
- package/scripts/demo/test-autoscaling-demo.js +314 -0
- package/scripts/dependency-optimizer.js +349 -0
- package/scripts/dependency-security-assessment.js +331 -0
- package/scripts/deploy-sdk.sh +176 -0
- package/scripts/deployment-readiness-report.json +179 -0
- package/scripts/dev/README.md +264 -0
- package/scripts/dev/claude-flow-wrapper.sh +35 -0
- package/scripts/dev/claude-monitor.py +419 -0
- package/scripts/dev/claude-sparc.sh +562 -0
- package/scripts/dev/claude-wrapper.sh +17 -0
- package/scripts/dev/demo-phase3-compliance.js +172 -0
- package/scripts/dev/demo-task-system.ts +224 -0
- package/scripts/dev/deployment-validator.js +315 -0
- package/scripts/dev/spawn-claude-terminal.sh +32 -0
- package/scripts/dev/start-portal.sh +506 -0
- package/scripts/dev/start-web-ui.js +15 -0
- package/scripts/dev/stop-portal.sh +311 -0
- package/scripts/dev/validate-examples.ts +288 -0
- package/scripts/dev/validate-phase2.cjs +451 -0
- package/scripts/dev/validate-phase2.js +785 -0
- package/scripts/dev/validate-phase3.cjs +208 -0
- package/scripts/dev/validate-security-remediation.js +1 -0
- package/scripts/ecosystem.config.cjs +90 -0
- package/scripts/fix-js-extensions.js +167 -0
- package/scripts/generate-basic-types.js +73 -0
- package/scripts/generate-changelog.js +318 -0
- package/scripts/git-hooks/pre-commit.sh +143 -0
- package/scripts/health-checks.js +634 -0
- package/scripts/hook-wrapper.sh +54 -0
- package/scripts/install/README.md +375 -0
- package/scripts/install/REDIS_SETUP_VALIDATION.json +245 -0
- package/scripts/install/check-prerequisites.js +303 -0
- package/scripts/install/config-wizard.js +606 -0
- package/scripts/install/dependency-checker.js +385 -0
- package/scripts/install/health-check.js +765 -0
- package/scripts/install/install.js +256 -0
- package/scripts/install/installation-benchmark.js +461 -0
- package/scripts/install/quick-install.js +720 -0
- package/scripts/install/quick-start-wizard.js +295 -0
- package/scripts/install/redis-cli.js +289 -0
- package/scripts/install/redis-install-guides.md +407 -0
- package/scripts/install/redis-setup.js +559 -0
- package/scripts/install/redis-test.js +278 -0
- package/scripts/install/service-manager.js +672 -0
- package/scripts/install/setup.js +832 -0
- package/scripts/install/uninstall.js +526 -0
- package/scripts/install/update.js +461 -0
- package/scripts/install-pre-commit-hook.sh +127 -0
- package/scripts/legacy/README.md +272 -0
- package/scripts/legacy/batch-fix-ts.sh +54 -0
- package/scripts/legacy/build-migration.sh +105 -0
- package/scripts/legacy/build-monitor.js +209 -0
- package/scripts/legacy/build-with-filter.sh +84 -0
- package/scripts/legacy/build-workaround.sh +71 -0
- package/scripts/legacy/fix-ts-advanced.js +358 -0
- package/scripts/legacy/fix-ts-final.sh +50 -0
- package/scripts/legacy/fix-ts-targeted.sh +49 -0
- package/scripts/legacy/fix-typescript-errors.js +305 -0
- package/scripts/legacy/force-build.sh +63 -0
- package/scripts/legacy/optimize-performance.js +400 -0
- package/scripts/legacy/performance-monitor.js +263 -0
- package/scripts/legacy/performance-monitoring.js +532 -0
- package/scripts/legacy/performance-test-runner.js +645 -0
- package/scripts/legacy/quick-fix-ts.js +281 -0
- package/scripts/legacy/safe-build.sh +63 -0
- package/scripts/memory-monitor-coordinator.js +322 -0
- package/scripts/migrate-to-sdk.sh +520 -0
- package/scripts/migration/QUICK-START.md +189 -0
- package/scripts/migration/QUICK-START.md.backup-1760135091363 +189 -0
- package/scripts/migration/README.md +464 -0
- package/scripts/migration/TASK-1.3.2-COMPLETION-REPORT.md +500 -0
- package/scripts/migration/TASK-1.3.2-COMPLETION-REPORT.md.backup-1760135091348 +500 -0
- package/scripts/migration/UPDATE-PATHS-README.md +464 -0
- package/scripts/migration/UPDATE-PATHS-README.md.backup-1760135091337 +464 -0
- package/scripts/migration/example-patterns.json +19 -0
- package/scripts/migration/install-arm64.js +78 -0
- package/scripts/migration/install.js +83 -0
- package/scripts/migration/migrate-hooks.js +173 -0
- package/scripts/migration/migration-examples.ts +318 -0
- package/scripts/migration/reorganize-workspace.js +504 -0
- package/scripts/migration/test-update-paths.js +359 -0
- package/scripts/migration/update-paths.js +664 -0
- package/scripts/migration/validate-migration.js +647 -0
- package/scripts/monitor-loop.sh +65 -0
- package/scripts/monitor-memory.sh +47 -0
- package/scripts/monitor-migration.js +339 -0
- package/scripts/monitor.py +43 -0
- package/scripts/monitoring/README.md +178 -0
- package/scripts/monitoring/alert-monitor.sh +220 -0
- package/scripts/monitoring/analyze-resources.sh +199 -0
- package/scripts/monitoring/dashboards/rate-limiting-dashboard.json +211 -0
- package/scripts/monitoring/dynamic-monitor.sh +85 -0
- package/scripts/monitoring/launch-stability-test.sh +184 -0
- package/scripts/monitoring/monitor-test.sh +93 -0
- package/scripts/monitoring/pre-test-validation.sh +208 -0
- package/scripts/monitoring/quick-test-alerting.sh +118 -0
- package/scripts/monitoring/quick-test-rate-limiting.sh +206 -0
- package/scripts/monitoring/rate-limiting-monitor.sh +380 -0
- package/scripts/monitoring/resource-monitor.sh +126 -0
- package/scripts/monitoring/stability-monitor.js +429 -0
- package/scripts/monitoring/test-monitor-quick.sh +54 -0
- package/scripts/monitoring/view-alerts.sh +307 -0
- package/scripts/npm-metrics-collector.js +482 -0
- package/scripts/npm-package-validation.cjs +299 -0
- package/scripts/optimization/build-optimizer.js +438 -0
- package/scripts/optimization/config-validator.js +761 -0
- package/scripts/optimization/test-optimization.js +432 -0
- package/scripts/optimization/unified-activation.js +839 -0
- package/scripts/optimize-package-swarm.js +54 -0
- package/scripts/performance/ACTIVATION_COMMANDS.md +292 -0
- package/scripts/performance/sqlite-enhanced-activation.sh +583 -0
- package/scripts/performance/test-enhanced-backend.sh +504 -0
- package/scripts/performance-monitor.js +644 -0
- package/scripts/performance-test-runner.js +698 -0
- package/scripts/post-deployment-monitoring.js +350 -0
- package/scripts/post-edit-pipeline.js +2091 -0
- package/scripts/post-install-claude-md.js +78 -0
- package/scripts/postinstall.js +79 -0
- package/scripts/pre-publish-validation.cjs +212 -0
- package/scripts/pre-publish-validation.js +429 -0
- package/scripts/redis-lua/cleanup-blocking-coordination.lua +198 -0
- package/scripts/release-announcement.js +425 -0
- package/scripts/release-notification.js +248 -0
- package/scripts/release-rollback.js +376 -0
- package/scripts/release-validation.js +460 -0
- package/scripts/rollback-sdk.sh +66 -0
- package/scripts/run-production-validation.ts +590 -0
- package/scripts/run-stability-validation.sh +687 -0
- package/scripts/security/README.md +339 -0
- package/scripts/security/deployment-validation.cjs +279 -0
- package/scripts/security/envelope-encryption-confidence-report.cjs +422 -0
- package/scripts/security/install-git-hooks.sh +132 -0
- package/scripts/security/install-git-secrets.sh +295 -0
- package/scripts/security/rotate-api-keys.js +469 -0
- package/scripts/security/ruv-swarm-safe.js +74 -0
- package/scripts/security/security-audit.cjs +538 -0
- package/scripts/security/setup-redis-auth.sh +397 -0
- package/scripts/security/validate-envelope-encryption.cjs +340 -0
- package/scripts/security-scan.js +492 -0
- package/scripts/src/web/frontend/.claude-flow/metrics/agent-metrics.json +1 -0
- package/scripts/src/web/frontend/.claude-flow/metrics/performance.json +9 -0
- package/scripts/src/web/frontend/.claude-flow/metrics/task-metrics.json +10 -0
- package/scripts/switch-api.sh +158 -0
- package/scripts/sync-agents.js +290 -0
- package/scripts/test/50-agent-test.js +625 -0
- package/scripts/test/NEW_STABILITY_TEST_GUIDE.md +407 -0
- package/scripts/test/README.md +236 -0
- package/scripts/test/STABILITY_TEST_EXAMPLE.md +347 -0
- package/scripts/test/STABILITY_TEST_README.md +480 -0
- package/scripts/test/agent-worker.js +309 -0
- package/scripts/test/ai-coordination-test.js +650 -0
- package/scripts/test/ai-mesh-coordination-test.js +416 -0
- package/scripts/test/check-links.ts +274 -0
- package/scripts/test/check-performance-regression.ts +168 -0
- package/scripts/test/cli-agent-coordination-test.js +313 -0
- package/scripts/test/coordinator-multilingual-test.js +396 -0
- package/scripts/test/coordinator-transparency-demo.js +585 -0
- package/scripts/test/coverage-report.ts +692 -0
- package/scripts/test/generate-swarm-tests.js +633 -0
- package/scripts/test/integration-test-validation.cjs +253 -0
- package/scripts/test/load-test-swarm.js +576 -0
- package/scripts/test/mesh-coordination-zero-overlap-test.js +740 -0
- package/scripts/test/multilingual-hello-world-test.js +390 -0
- package/scripts/test/quick-multilingual-demo.js +464 -0
- package/scripts/test/real-agent-test.js +312 -0
- package/scripts/test/run-phase3-compliance-tests.js +427 -0
- package/scripts/test/run-stability-test-examples.sh +292 -0
- package/scripts/test/stability-results/stability-metrics.jsonl +83 -0
- package/scripts/test/stability-results/stability-test-report.json +128 -0
- package/scripts/test/stability-results/stability-test.log +1827 -0
- package/scripts/test/stability-test-50-agents.js +734 -0
- package/scripts/test/test-batch-tasks.ts +29 -0
- package/scripts/test/test-byzantine-resolution.js +246 -0
- package/scripts/test/test-claude-spawn-options.sh +63 -0
- package/scripts/test/test-cli-wizard.js +331 -0
- package/scripts/test/test-comprehensive.js +401 -0
- package/scripts/test/test-coordination-features.ts +238 -0
- package/scripts/test/test-fallback-systems.js +276 -0
- package/scripts/test/test-init-command.ts +302 -0
- package/scripts/test/test-mcp.ts +251 -0
- package/scripts/test/test-runner.ts +568 -0
- package/scripts/test/test-swarm-integration.sh +92 -0
- package/scripts/test/test-swarm.ts +142 -0
- package/scripts/test/validation-summary.ts +408 -0
- package/scripts/test-cleanup-performance.sh +416 -0
- package/scripts/test-dashboard-auth.cjs +203 -0
- package/scripts/test-docker-deployment.sh +207 -0
- package/scripts/test-npm-package.cjs +167 -0
- package/scripts/test-provider-routing.cjs +226 -0
- package/scripts/test-routing-telemetry.cjs +147 -0
- package/scripts/test-runner.cjs +154 -0
- package/scripts/test-zai-10k.cjs +81 -0
- package/scripts/test-zai-api.cjs +191 -0
- package/scripts/test-zai-diagnostic.cjs +151 -0
- package/scripts/test-zai-final.cjs +128 -0
- package/scripts/test-zai-with-env.cjs +85 -0
- package/scripts/utils/README.md +261 -0
- package/scripts/utils/clean-build-artifacts.sh +94 -0
- package/scripts/utils/cleanup-root.sh +69 -0
- package/scripts/utils/fix-cliffy-imports.js +307 -0
- package/scripts/utils/fix-duplicate-imports.js +114 -0
- package/scripts/utils/fix-error-handling.cjs +70 -0
- package/scripts/utils/fix-import-paths.js +104 -0
- package/scripts/utils/fix-imports.js +116 -0
- package/scripts/utils/fix-shebang.js +78 -0
- package/scripts/utils/fix-test-modules.js +27 -0
- package/scripts/utils/fix-timezone-issue-246.js +200 -0
- package/scripts/utils/fix-ts-comprehensive.py +182 -0
- package/scripts/utils/fix-ts-targeted-batch.js +250 -0
- package/scripts/utils/remove-benchmark-conflicts.sh +140 -0
- package/scripts/utils/simple-test-fixer.js +190 -0
- package/scripts/utils/validate-metrics-structure.cjs +144 -0
- package/scripts/validate-agent-hooks.js +506 -0
- package/scripts/validate-changelog.js +241 -0
- package/scripts/validate-coordination-cli.js +69 -0
- package/scripts/validate-coordination-toggle-integration.cjs +501 -0
- package/scripts/validate-docker-infrastructure.sh +502 -0
- package/scripts/validate-entry-points.js +300 -0
- package/scripts/validate-stage3-performance.ts +377 -0
- package/scripts/validate-template-bundling.js +180 -0
- package/scripts/validation/README.md +33 -0
- package/scripts/validation/acl-security-validation.cjs +214 -0
- package/scripts/validation/acl-security-validation.js +402 -0
- package/scripts/validation/byzantine-verification.js +407 -0
- package/scripts/validation/final-phase-2-consensus.cjs +219 -0
- package/scripts/validation/final-security-validation.js +791 -0
- package/scripts/validation/final-wasm-validation.cjs +840 -0
- package/scripts/validation/integration-test-analysis.js +105 -0
- package/scripts/validation/phase-0-comprehensive-validation.js +474 -0
- package/scripts/validation/phase-0-consensus-report.js +139 -0
- package/scripts/validation/phase-0-final-report.js +112 -0
- package/scripts/validation/phase-0-redis-consensus-report.js +129 -0
- package/scripts/validation/phase-0-validation-improved.js +490 -0
- package/scripts/validation/phase-0-validation-test.js +65 -0
- package/scripts/validation/phase-1-consensus-report.cjs +342 -0
- package/scripts/validation/phase-1-consensus-validation.cjs +551 -0
- package/scripts/validation/phase-1-consensus-validation.js +551 -0
- package/scripts/validation/phase-2-consensus-report.cjs +186 -0
- package/scripts/validation/phase-2-validation.cjs +171 -0
- package/scripts/validation/phase-2-validation.js +171 -0
- package/scripts/validation/phase-4-consensus-report.js +181 -0
- package/scripts/validation/phase-4-final-validation.js +351 -0
- package/scripts/validation/phase-5-consensus-report.cjs +113 -0
- package/scripts/validation/phase-5-consensus-report.js +113 -0
- package/scripts/validation/security-analysis.js +49 -0
- package/scripts/validation/security-validation.js +492 -0
- package/scripts/validation/simple-security-validation.js +464 -0
- package/scripts/verify-installation.js +112 -0
- package/scripts/verify-mcp-server.js +86 -0
- package/scripts/verify-sdk-phase1.cjs +293 -0
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
#!/usr/bin/env -S deno run --allow-all
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Test runner script for Claude-Flow batch task system
|
|
5
|
+
* Run with: deno run --allow-all scripts/test-batch-tasks.ts
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { runBatchTaskTest } from '../tests/integration/batch-task-test.ts';
|
|
9
|
+
|
|
10
|
+
console.log('š Claude-Flow Batch Task System Test Runner\n');
|
|
11
|
+
console.log('This test will demonstrate:');
|
|
12
|
+
console.log(' ⢠Task creation and queuing');
|
|
13
|
+
console.log(' ⢠Agent spawning and assignment');
|
|
14
|
+
console.log(' ⢠Parallel task execution');
|
|
15
|
+
console.log(' ⢠Batch tool usage for efficiency');
|
|
16
|
+
console.log(' ⢠Task completion tracking');
|
|
17
|
+
console.log(' ⢠System coordination\n');
|
|
18
|
+
console.log('Starting test in 3 seconds...\n');
|
|
19
|
+
|
|
20
|
+
// Give user time to read
|
|
21
|
+
await new Promise(resolve => setTimeout(resolve, 3000));
|
|
22
|
+
|
|
23
|
+
try {
|
|
24
|
+
await runBatchTaskTest();
|
|
25
|
+
Deno.exit(0);
|
|
26
|
+
} catch (error) {
|
|
27
|
+
console.error('Test failed:', error);
|
|
28
|
+
Deno.exit(1);
|
|
29
|
+
}
|
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Byzantine Consensus Resolution Test
|
|
5
|
+
*
|
|
6
|
+
* Final integration test to verify all critical issues have been resolved
|
|
7
|
+
* and the completion validation framework can validate its own completion.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import { performance } from 'perf_hooks';
|
|
11
|
+
|
|
12
|
+
console.log('š EXECUTING BYZANTINE CONSENSUS RESOLUTION TEST');
|
|
13
|
+
console.log('===============================================');
|
|
14
|
+
|
|
15
|
+
async function testByzantineResolution() {
|
|
16
|
+
const startTime = performance.now();
|
|
17
|
+
|
|
18
|
+
try {
|
|
19
|
+
console.log('š Phase 1: Testing Memory System Fallback...');
|
|
20
|
+
|
|
21
|
+
// Test 1: Memory System with SQLite Fallback
|
|
22
|
+
const { checkMemoryHealth, testSQLiteAvailability } = await import('../src/memory/index.js');
|
|
23
|
+
|
|
24
|
+
const memoryHealth = await checkMemoryHealth();
|
|
25
|
+
const sqliteTest = await testSQLiteAvailability();
|
|
26
|
+
|
|
27
|
+
console.log(' ā
Memory Health Check:', memoryHealth.overall.healthy ? 'PASSED' : 'FAILED');
|
|
28
|
+
console.log(' š Fallback Ready:', memoryHealth.overall.fallbackReady ? 'YES' : 'NO');
|
|
29
|
+
console.log(' š¾ SQLite Available:', sqliteTest.available ? 'YES' : 'NO (using fallback)');
|
|
30
|
+
|
|
31
|
+
console.log('\\nš Phase 2: Testing Hook System Resilience...');
|
|
32
|
+
|
|
33
|
+
// Test 2: Hook System Resilience
|
|
34
|
+
const { testHookSystemResilience } = await import('../src/hooks/resilient-hook-system.js');
|
|
35
|
+
|
|
36
|
+
const hookTest = await testHookSystemResilience();
|
|
37
|
+
|
|
38
|
+
console.log(' šŖ Hook System Resilient:', hookTest.resilient ? 'YES' : 'NO');
|
|
39
|
+
console.log(' š§Ŗ Hook System Tested:', hookTest.tested ? 'YES' : 'NO');
|
|
40
|
+
console.log(' š”ļø Byzantine Enabled:', hookTest.byzantineEnabled ? 'YES' : 'NO');
|
|
41
|
+
|
|
42
|
+
console.log('\\nš Phase 3: Testing Recursive Validation...');
|
|
43
|
+
|
|
44
|
+
// Test 3: Recursive Validation Capability
|
|
45
|
+
const { testRecursiveValidation } = await import('../src/validation/recursive-validation-system.js');
|
|
46
|
+
|
|
47
|
+
const recursiveTest = await testRecursiveValidation();
|
|
48
|
+
|
|
49
|
+
console.log(' š Recursive Capable:', recursiveTest.recursive ? 'YES' : 'NO');
|
|
50
|
+
console.log(' ā
Self-Validation Passed:', recursiveTest.selfValidationPassed ? 'YES' : 'NO');
|
|
51
|
+
console.log(' š Truth Score:', (recursiveTest.truthScore * 100).toFixed(1) + '%');
|
|
52
|
+
|
|
53
|
+
console.log('\\nš Phase 4: Testing Byzantine Memory Channels...');
|
|
54
|
+
|
|
55
|
+
// Test 4: Byzantine Memory Channels
|
|
56
|
+
const { testByzantineChannels } = await import('../src/coordination/byzantine-memory-channels.js');
|
|
57
|
+
|
|
58
|
+
const byzantineTest = await testByzantineChannels();
|
|
59
|
+
|
|
60
|
+
console.log(' šļø Byzantine Channels:', byzantineTest.byzantine ? 'OPERATIONAL' : 'NOT OPERATIONAL');
|
|
61
|
+
console.log(' šÆ Consensus Enabled:', byzantineTest.consensusEnabled ? 'YES' : 'NO');
|
|
62
|
+
console.log(' š Fallback Ready:', byzantineTest.fallbackReady ? 'YES' : 'NO');
|
|
63
|
+
|
|
64
|
+
console.log('\\nš Phase 5: Full System Integration Test...');
|
|
65
|
+
|
|
66
|
+
// Test 5: Full System Integration
|
|
67
|
+
const { ResilientMemorySystem } = await import('../src/memory/index.js');
|
|
68
|
+
const { ResilientHookEngine } = await import('../src/hooks/resilient-hook-system.js');
|
|
69
|
+
const { RecursiveValidationFramework } = await import('../src/validation/recursive-validation-system.js');
|
|
70
|
+
|
|
71
|
+
// Create integrated system with fallback mode
|
|
72
|
+
const memory = new ResilientMemorySystem({
|
|
73
|
+
enablePersistence: false,
|
|
74
|
+
maxMemoryMB: 10
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
const hooks = new ResilientHookEngine({
|
|
78
|
+
enableByzantineConsensus: true,
|
|
79
|
+
consensusThreshold: 0.85
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
const validation = new RecursiveValidationFramework({
|
|
83
|
+
selfValidationEnabled: true,
|
|
84
|
+
byzantineThreshold: 0.85
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
// Initialize all systems
|
|
88
|
+
await memory.initialize();
|
|
89
|
+
await hooks.initialize();
|
|
90
|
+
await validation.initialize();
|
|
91
|
+
|
|
92
|
+
console.log(' š¾ Memory System:', memory.getSystemInfo().mode.toUpperCase());
|
|
93
|
+
|
|
94
|
+
// Test integrated functionality
|
|
95
|
+
await memory.store('integration-test', 'test-value');
|
|
96
|
+
const retrieved = await memory.retrieve('integration-test');
|
|
97
|
+
const memoryWorking = retrieved === 'test-value';
|
|
98
|
+
|
|
99
|
+
hooks.register({
|
|
100
|
+
name: 'Integration Test Hook',
|
|
101
|
+
type: 'integration',
|
|
102
|
+
handler: async () => ({ integrated: true })
|
|
103
|
+
});
|
|
104
|
+
const hookExecution = await hooks.executeHooks('integration', {});
|
|
105
|
+
const hooksWorking = hookExecution.results.length > 0 && hookExecution.results[0].success;
|
|
106
|
+
|
|
107
|
+
const selfValidation = await validation.performSelfValidation();
|
|
108
|
+
const validationWorking = selfValidation.overallSuccess;
|
|
109
|
+
|
|
110
|
+
console.log(' š Memory Integration:', memoryWorking ? 'WORKING' : 'FAILED');
|
|
111
|
+
console.log(' šŖ Hook Integration:', hooksWorking ? 'WORKING' : 'FAILED');
|
|
112
|
+
console.log(' ā
Validation Integration:', validationWorking ? 'WORKING' : 'FAILED');
|
|
113
|
+
|
|
114
|
+
// Test Byzantine consensus across systems
|
|
115
|
+
console.log('\\nš Phase 6: Byzantine Consensus Verification...');
|
|
116
|
+
|
|
117
|
+
// Record truth scores
|
|
118
|
+
await memory.recordTruthScore('consensus-test', 0.92, {
|
|
119
|
+
test: 'byzantine-consensus',
|
|
120
|
+
evidence: { allSystemsOperational: true }
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
const truthScores = await memory.getTruthScores('consensus-test');
|
|
124
|
+
const consensusWorking = truthScores.consensus.accuracy > 0.8;
|
|
125
|
+
|
|
126
|
+
console.log(' šÆ Truth Scoring Accuracy:', (truthScores.consensus.accuracy * 100).toFixed(1) + '%');
|
|
127
|
+
console.log(' šļø Byzantine Consensus:', consensusWorking ? 'MAINTAINED' : 'NOT MAINTAINED');
|
|
128
|
+
|
|
129
|
+
// Clean up
|
|
130
|
+
await validation.shutdown();
|
|
131
|
+
await hooks.shutdown();
|
|
132
|
+
await memory.close();
|
|
133
|
+
|
|
134
|
+
// Calculate overall results
|
|
135
|
+
const testResults = {
|
|
136
|
+
memorySystemOperational: memoryHealth.overall.healthy && memoryHealth.overall.fallbackReady,
|
|
137
|
+
hookSystemResilient: hookTest.resilient && hookTest.tested,
|
|
138
|
+
recursiveValidationCapable: recursiveTest.recursive && recursiveTest.selfValidationPassed,
|
|
139
|
+
byzantineChannelsOperational: byzantineTest.byzantine && byzantineTest.consensusEnabled,
|
|
140
|
+
systemIntegrationWorking: memoryWorking && hooksWorking && validationWorking,
|
|
141
|
+
byzantineConsensusAchieved: consensusWorking && recursiveTest.truthScore >= 0.85,
|
|
142
|
+
truthScoringAccurate: recursiveTest.truthScore >= 0.85 && truthScores.consensus.accuracy >= 0.85
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
const passedTests = Object.values(testResults).filter(Boolean).length;
|
|
146
|
+
const totalTests = Object.keys(testResults).length;
|
|
147
|
+
const overallScore = passedTests / totalTests;
|
|
148
|
+
|
|
149
|
+
console.log('\\nš FINAL RESULTS:');
|
|
150
|
+
console.log('==================');
|
|
151
|
+
console.log('Tests Passed:', passedTests + '/' + totalTests);
|
|
152
|
+
console.log('Overall Score:', (overallScore * 100).toFixed(1) + '%');
|
|
153
|
+
|
|
154
|
+
// Detailed results
|
|
155
|
+
console.log('\\nš DETAILED TEST RESULTS:');
|
|
156
|
+
console.log('==========================');
|
|
157
|
+
for (const [test, passed] of Object.entries(testResults)) {
|
|
158
|
+
const status = passed ? 'ā
PASS' : 'ā FAIL';
|
|
159
|
+
const testName = test.replace(/([A-Z])/g, ' $1').replace(/^./, str => str.toUpperCase());
|
|
160
|
+
console.log(testName + ':', status);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
const duration = performance.now() - startTime;
|
|
164
|
+
|
|
165
|
+
console.log('\\nšÆ BYZANTINE CONSENSUS RESOLUTION:');
|
|
166
|
+
console.log('===================================');
|
|
167
|
+
|
|
168
|
+
if (overallScore >= 0.85 && testResults.byzantineConsensusAchieved) {
|
|
169
|
+
console.log('ā
RESOLUTION: SUCCESSFUL');
|
|
170
|
+
console.log('š”ļø All critical system failures have been resolved');
|
|
171
|
+
console.log('š Recursive validation is operational');
|
|
172
|
+
console.log('š¾ Memory systems work without SQLite dependency');
|
|
173
|
+
console.log('šŖ Hook systems are decoupled from external dependencies');
|
|
174
|
+
console.log('šÆ Truth scoring achieves >85% accuracy in fallback mode');
|
|
175
|
+
console.log('š Byzantine consensus is maintained across all validation scenarios');
|
|
176
|
+
console.log('ā” Test Duration:', duration.toFixed(2) + 'ms');
|
|
177
|
+
console.log('');
|
|
178
|
+
console.log('š VERDICT: PHASE 2 APPROVED');
|
|
179
|
+
console.log(' The completion validation framework successfully demonstrates');
|
|
180
|
+
console.log(' 100% functionality in minimal dependency environments with');
|
|
181
|
+
console.log(' full recursive validation capability and Byzantine consensus.');
|
|
182
|
+
return true;
|
|
183
|
+
} else {
|
|
184
|
+
console.log('ā RESOLUTION: INCOMPLETE');
|
|
185
|
+
console.log('š§ Critical issues remain:');
|
|
186
|
+
|
|
187
|
+
if (!testResults.memorySystemOperational) {
|
|
188
|
+
console.log(' - Memory system fallback not operational');
|
|
189
|
+
}
|
|
190
|
+
if (!testResults.hookSystemResilient) {
|
|
191
|
+
console.log(' - Hook system not resilient to dependency failures');
|
|
192
|
+
}
|
|
193
|
+
if (!testResults.recursiveValidationCapable) {
|
|
194
|
+
console.log(' - Recursive validation not functional');
|
|
195
|
+
}
|
|
196
|
+
if (!testResults.byzantineConsensusAchieved) {
|
|
197
|
+
console.log(' - Byzantine consensus not achieved');
|
|
198
|
+
}
|
|
199
|
+
if (!testResults.truthScoringAccurate) {
|
|
200
|
+
console.log(' - Truth scoring accuracy below 85% threshold');
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
console.log('ā” Test Duration:', duration.toFixed(2) + 'ms');
|
|
204
|
+
console.log('š Score Required: 85%, Achieved: ' + (overallScore * 100).toFixed(1) + '%');
|
|
205
|
+
console.log('');
|
|
206
|
+
console.log('ā ļø VERDICT: CONTINUE PHASE 1 FIXES');
|
|
207
|
+
return false;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
} catch (error) {
|
|
211
|
+
console.error('ā BYZANTINE RESOLUTION TEST FAILED:', error.message);
|
|
212
|
+
if (error.stack) {
|
|
213
|
+
console.error('š§ Error details:', error.stack.split('\\n').slice(0, 5).join('\\n'));
|
|
214
|
+
}
|
|
215
|
+
return false;
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
// Execute the test
|
|
220
|
+
testByzantineResolution().then(success => {
|
|
221
|
+
console.log('\\n===============================================');
|
|
222
|
+
console.log('š BYZANTINE CONSENSUS RESOLUTION:', success ? 'COMPLETE' : 'INCOMPLETE');
|
|
223
|
+
console.log('===============================================');
|
|
224
|
+
|
|
225
|
+
if (success) {
|
|
226
|
+
console.log('\\nš PHASE 1 COMPLETION VALIDATED');
|
|
227
|
+
console.log(' - All critical integration failures resolved');
|
|
228
|
+
console.log(' - Framework demonstrates recursive validation capability');
|
|
229
|
+
console.log(' - 100% functionality achieved in minimal dependency environments');
|
|
230
|
+
console.log(' - Byzantine consensus maintained across all scenarios');
|
|
231
|
+
console.log(' - Ready for Phase 2 progression');
|
|
232
|
+
} else {
|
|
233
|
+
console.log('\\nā ļø PHASE 1 COMPLETION PENDING');
|
|
234
|
+
console.log(' - Additional fixes required before Phase 2');
|
|
235
|
+
console.log(' - Review failed test results above');
|
|
236
|
+
console.log(' - Address critical system integration issues');
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
process.exit(success ? 0 : 1);
|
|
240
|
+
}).catch(error => {
|
|
241
|
+
console.error('\\nš„ FATAL ERROR:', error.message);
|
|
242
|
+
console.log('\\n===============================================');
|
|
243
|
+
console.log('š BYZANTINE CONSENSUS RESOLUTION: FAILED');
|
|
244
|
+
console.log('===============================================');
|
|
245
|
+
process.exit(1);
|
|
246
|
+
});
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
echo "=================================="
|
|
4
|
+
echo "Claude-Flow Spawn Command Examples"
|
|
5
|
+
echo "=================================="
|
|
6
|
+
echo ""
|
|
7
|
+
|
|
8
|
+
echo "1. Basic Task (default options)"
|
|
9
|
+
echo "-------------------------------"
|
|
10
|
+
echo "Command: claude-flow claude spawn \"implement user login\""
|
|
11
|
+
echo "Features: Basic tools, phase commits, 80% coverage"
|
|
12
|
+
echo ""
|
|
13
|
+
|
|
14
|
+
echo "2. Research Mode"
|
|
15
|
+
echo "----------------"
|
|
16
|
+
echo "Command: claude-flow claude spawn \"research authentication methods\" --research"
|
|
17
|
+
echo "Features: Adds WebFetchTool for web research"
|
|
18
|
+
echo ""
|
|
19
|
+
|
|
20
|
+
echo "3. Parallel Execution"
|
|
21
|
+
echo "---------------------"
|
|
22
|
+
echo "Command: claude-flow claude spawn \"build microservices\" --parallel"
|
|
23
|
+
echo "Features: Adds BatchTool and dispatch_agent for multi-agent coordination"
|
|
24
|
+
echo ""
|
|
25
|
+
|
|
26
|
+
echo "4. Backend-Only Mode"
|
|
27
|
+
echo "--------------------"
|
|
28
|
+
echo "Command: claude-flow claude spawn \"create REST API\" --mode backend-only --coverage 95"
|
|
29
|
+
echo "Features: Focus on server-side, 95% test coverage target"
|
|
30
|
+
echo ""
|
|
31
|
+
|
|
32
|
+
echo "5. Frontend-Only Mode"
|
|
33
|
+
echo "---------------------"
|
|
34
|
+
echo "Command: claude-flow claude spawn \"build React components\" --mode frontend-only --commit feature"
|
|
35
|
+
echo "Features: Focus on client-side, commit after each feature"
|
|
36
|
+
echo ""
|
|
37
|
+
|
|
38
|
+
echo "6. API-Only Mode"
|
|
39
|
+
echo "-----------------"
|
|
40
|
+
echo "Command: claude-flow claude spawn \"design GraphQL schema\" --mode api-only --verbose"
|
|
41
|
+
echo "Features: Focus on API design, verbose output"
|
|
42
|
+
echo ""
|
|
43
|
+
|
|
44
|
+
echo "7. Full Stack with All Options"
|
|
45
|
+
echo "-------------------------------"
|
|
46
|
+
echo "Command: claude-flow claude spawn \"build complete app\" --research --parallel --coverage 90 --commit feature --verbose"
|
|
47
|
+
echo "Features: All tools, multi-agent, research, 90% coverage, feature commits, verbose"
|
|
48
|
+
echo ""
|
|
49
|
+
|
|
50
|
+
echo "8. No Permissions Mode"
|
|
51
|
+
echo "----------------------"
|
|
52
|
+
echo "Command: claude-flow claude spawn \"automated deployment\" --no-permissions"
|
|
53
|
+
echo "Features: Executes without confirmation prompts (useful for CI/CD)"
|
|
54
|
+
echo ""
|
|
55
|
+
|
|
56
|
+
echo "Each spawned Claude instance receives:"
|
|
57
|
+
echo "- Detailed guidance on using npx claude-flow commands"
|
|
58
|
+
echo "- Mode-specific instructions"
|
|
59
|
+
echo "- Examples of memory operations"
|
|
60
|
+
echo "- Configuration management commands"
|
|
61
|
+
echo "- Best practices for the specific options"
|
|
62
|
+
echo ""
|
|
63
|
+
echo "Run any of these commands to see the enhanced guidance in action!"
|
|
@@ -0,0 +1,331 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* CLI Wizard Test Script
|
|
4
|
+
* Phase 2 Implementation Validation
|
|
5
|
+
*
|
|
6
|
+
* Tests CLI wizard functionality and performance requirements
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import { spawn } from 'child_process';
|
|
10
|
+
import { performance } from 'perf_hooks';
|
|
11
|
+
import chalk from 'chalk';
|
|
12
|
+
|
|
13
|
+
const CLI_COMMAND = 'node';
|
|
14
|
+
const CLI_ARGS = ['bin/claude-flow-novice.js', 'validate'];
|
|
15
|
+
|
|
16
|
+
class CLIWizardTester {
|
|
17
|
+
constructor() {
|
|
18
|
+
this.testResults = {
|
|
19
|
+
passed: 0,
|
|
20
|
+
failed: 0,
|
|
21
|
+
total: 0,
|
|
22
|
+
details: []
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
async runTest(testName, testFn) {
|
|
27
|
+
this.testResults.total++;
|
|
28
|
+
console.log(chalk.blue(`\nš§Ŗ Running test: ${testName}`));
|
|
29
|
+
|
|
30
|
+
try {
|
|
31
|
+
const startTime = performance.now();
|
|
32
|
+
await testFn();
|
|
33
|
+
const duration = performance.now() - startTime;
|
|
34
|
+
|
|
35
|
+
this.testResults.passed++;
|
|
36
|
+
this.testResults.details.push({
|
|
37
|
+
name: testName,
|
|
38
|
+
status: 'PASSED',
|
|
39
|
+
duration,
|
|
40
|
+
error: null
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
console.log(chalk.green(`ā
${testName} - PASSED (${Math.round(duration)}ms)`));
|
|
44
|
+
|
|
45
|
+
} catch (error) {
|
|
46
|
+
this.testResults.failed++;
|
|
47
|
+
this.testResults.details.push({
|
|
48
|
+
name: testName,
|
|
49
|
+
status: 'FAILED',
|
|
50
|
+
duration: 0,
|
|
51
|
+
error: error.message
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
console.log(chalk.red(`ā ${testName} - FAILED`));
|
|
55
|
+
console.log(chalk.red(` Error: ${error.message}`));
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
async runCLICommand(args, options = {}) {
|
|
60
|
+
return new Promise((resolve, reject) => {
|
|
61
|
+
const child = spawn(CLI_COMMAND, [...CLI_ARGS, ...args], {
|
|
62
|
+
stdio: ['pipe', 'pipe', 'pipe'],
|
|
63
|
+
timeout: options.timeout || 30000
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
let stdout = '';
|
|
67
|
+
let stderr = '';
|
|
68
|
+
|
|
69
|
+
child.stdout.on('data', (data) => {
|
|
70
|
+
stdout += data.toString();
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
child.stderr.on('data', (data) => {
|
|
74
|
+
stderr += data.toString();
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
child.on('close', (code) => {
|
|
78
|
+
resolve({
|
|
79
|
+
code,
|
|
80
|
+
stdout,
|
|
81
|
+
stderr
|
|
82
|
+
});
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
child.on('error', (error) => {
|
|
86
|
+
reject(error);
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
// Send automated responses for interactive prompts
|
|
90
|
+
if (options.autoRespond) {
|
|
91
|
+
setTimeout(() => {
|
|
92
|
+
child.stdin.write('Y\n'); // Confirm framework detection
|
|
93
|
+
setTimeout(() => {
|
|
94
|
+
child.stdin.write('n\n'); // Don't customize gates
|
|
95
|
+
setTimeout(() => {
|
|
96
|
+
child.stdin.write('n\n'); // Don't configure advanced settings
|
|
97
|
+
child.stdin.end();
|
|
98
|
+
}, 100);
|
|
99
|
+
}, 100);
|
|
100
|
+
}, 1000);
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
async testHelpCommand() {
|
|
106
|
+
const result = await this.runCLICommand(['help']);
|
|
107
|
+
|
|
108
|
+
if (result.code !== 0) {
|
|
109
|
+
throw new Error(`Help command failed with code ${result.code}`);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
if (!result.stdout.includes('Completion Validation Framework')) {
|
|
113
|
+
throw new Error('Help text missing framework information');
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
if (!result.stdout.includes('claude-flow-novice validate setup')) {
|
|
117
|
+
throw new Error('Help text missing setup command');
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
async testShowConfigCommand() {
|
|
122
|
+
const result = await this.runCLICommand(['show-config']);
|
|
123
|
+
|
|
124
|
+
// Should exit gracefully even if no config exists
|
|
125
|
+
if (result.code > 1) {
|
|
126
|
+
throw new Error(`Show-config command failed with code ${result.code}`);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
// Should provide helpful message if no config exists
|
|
130
|
+
if (!result.stdout.includes('Configuration') && !result.stderr.includes('Configuration')) {
|
|
131
|
+
throw new Error('Show-config should provide configuration information or helpful error');
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
async testTestCommand() {
|
|
136
|
+
const result = await this.runCLICommand(['test']);
|
|
137
|
+
|
|
138
|
+
// Should exit gracefully and provide test results
|
|
139
|
+
if (result.code > 1) {
|
|
140
|
+
throw new Error(`Test command failed with code ${result.code}`);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
// Should provide test information
|
|
144
|
+
if (!result.stdout.includes('Test') && !result.stderr.includes('Test')) {
|
|
145
|
+
throw new Error('Test command should provide test information');
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
async testSetupCommandNonInteractive() {
|
|
150
|
+
// Test that setup command doesn't hang without user input
|
|
151
|
+
const result = await this.runCLICommand(['setup'], {
|
|
152
|
+
timeout: 10000 // 10 second timeout
|
|
153
|
+
});
|
|
154
|
+
|
|
155
|
+
// Command should handle non-interactive mode gracefully
|
|
156
|
+
// Even if it fails, it shouldn't hang
|
|
157
|
+
if (result.code === null) {
|
|
158
|
+
throw new Error('Setup command hung without user input');
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
async testCommandLineValidation() {
|
|
163
|
+
// Test invalid commands
|
|
164
|
+
const result = await this.runCLICommand(['invalid-command']);
|
|
165
|
+
|
|
166
|
+
if (result.code === 0) {
|
|
167
|
+
throw new Error('Invalid command should return non-zero exit code');
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
// Should provide helpful error message
|
|
171
|
+
if (!result.stderr.includes('Unknown') && !result.stdout.includes('help')) {
|
|
172
|
+
throw new Error('Invalid command should provide helpful error message');
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
async testPerformanceRequirements() {
|
|
177
|
+
// Test that CLI commands respond quickly
|
|
178
|
+
const startTime = performance.now();
|
|
179
|
+
|
|
180
|
+
try {
|
|
181
|
+
await this.runCLICommand(['help'], { timeout: 5000 });
|
|
182
|
+
} catch (error) {
|
|
183
|
+
if (error.code === 'ETIMEDOUT') {
|
|
184
|
+
throw new Error('Help command took longer than 5 seconds');
|
|
185
|
+
}
|
|
186
|
+
throw error;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
const duration = performance.now() - startTime;
|
|
190
|
+
if (duration > 5000) {
|
|
191
|
+
throw new Error(`Help command took ${Math.round(duration)}ms, should be under 5000ms`);
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
async testErrorHandling() {
|
|
196
|
+
// Test CLI behavior in various error conditions
|
|
197
|
+
const tempDir = '/tmp/non-existent-directory';
|
|
198
|
+
|
|
199
|
+
const result = await this.runCLICommand(['test'], {
|
|
200
|
+
cwd: tempDir,
|
|
201
|
+
timeout: 5000
|
|
202
|
+
});
|
|
203
|
+
|
|
204
|
+
// Should handle invalid directories gracefully
|
|
205
|
+
// Even if it fails, it should provide meaningful error messages
|
|
206
|
+
if (result.stderr.includes('ENOENT') && !result.stderr.includes('helpful')) {
|
|
207
|
+
// This is acceptable - system error in expected location
|
|
208
|
+
} else if (result.code === null) {
|
|
209
|
+
throw new Error('Command should handle invalid directories gracefully');
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
async testFrameworkDetectionAccuracy() {
|
|
214
|
+
// This would require creating test project structures
|
|
215
|
+
// For now, we test that the detection doesn't crash
|
|
216
|
+
try {
|
|
217
|
+
const result = await this.runCLICommand(['test'], { timeout: 10000 });
|
|
218
|
+
|
|
219
|
+
// Should complete without hanging
|
|
220
|
+
if (result.code === null) {
|
|
221
|
+
throw new Error('Framework detection hung');
|
|
222
|
+
}
|
|
223
|
+
} catch (error) {
|
|
224
|
+
if (error.code === 'ETIMEDOUT') {
|
|
225
|
+
throw new Error('Framework detection took longer than 10 seconds');
|
|
226
|
+
}
|
|
227
|
+
// Other errors are acceptable for this test
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
async runAllTests() {
|
|
232
|
+
console.log(chalk.blue.bold('š CLI Wizard Test Suite'));
|
|
233
|
+
console.log(chalk.gray('Testing Phase 2 Implementation Requirements\n'));
|
|
234
|
+
|
|
235
|
+
await this.runTest('Help Command Functionality', () => this.testHelpCommand());
|
|
236
|
+
await this.runTest('Show Config Command', () => this.testShowConfigCommand());
|
|
237
|
+
await this.runTest('Test Command', () => this.testTestCommand());
|
|
238
|
+
await this.runTest('Setup Command Non-Interactive', () => this.testSetupCommandNonInteractive());
|
|
239
|
+
await this.runTest('Command Line Validation', () => this.testCommandLineValidation());
|
|
240
|
+
await this.runTest('Performance Requirements', () => this.testPerformanceRequirements());
|
|
241
|
+
await this.runTest('Error Handling', () => this.testErrorHandling());
|
|
242
|
+
await this.runTest('Framework Detection Performance', () => this.testFrameworkDetectionAccuracy());
|
|
243
|
+
|
|
244
|
+
this.printResults();
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
printResults() {
|
|
248
|
+
console.log(chalk.blue.bold('\nš Test Results Summary'));
|
|
249
|
+
console.log(chalk.green(`ā
Passed: ${this.testResults.passed}`));
|
|
250
|
+
console.log(chalk.red(`ā Failed: ${this.testResults.failed}`));
|
|
251
|
+
console.log(chalk.blue(`š Total: ${this.testResults.total}`));
|
|
252
|
+
|
|
253
|
+
const passRate = (this.testResults.passed / this.testResults.total) * 100;
|
|
254
|
+
console.log(chalk.yellow(`š Pass Rate: ${Math.round(passRate)}%`));
|
|
255
|
+
|
|
256
|
+
if (this.testResults.failed > 0) {
|
|
257
|
+
console.log(chalk.red.bold('\nā Failed Tests:'));
|
|
258
|
+
this.testResults.details
|
|
259
|
+
.filter(test => test.status === 'FAILED')
|
|
260
|
+
.forEach(test => {
|
|
261
|
+
console.log(chalk.red(` ⢠${test.name}: ${test.error}`));
|
|
262
|
+
});
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
console.log(chalk.blue.bold('\nšÆ Requirements Assessment:'));
|
|
266
|
+
|
|
267
|
+
// Check specific Phase 2 requirements
|
|
268
|
+
const requirements = [
|
|
269
|
+
{
|
|
270
|
+
name: 'CLI Commands Implemented',
|
|
271
|
+
met: this.testResults.details.some(t => t.name.includes('Help Command') && t.status === 'PASSED'),
|
|
272
|
+
required: true
|
|
273
|
+
},
|
|
274
|
+
{
|
|
275
|
+
name: 'Interactive Setup Available',
|
|
276
|
+
met: this.testResults.details.some(t => t.name.includes('Setup Command') && t.status === 'PASSED'),
|
|
277
|
+
required: true
|
|
278
|
+
},
|
|
279
|
+
{
|
|
280
|
+
name: 'Configuration Display Working',
|
|
281
|
+
met: this.testResults.details.some(t => t.name.includes('Show Config') && t.status === 'PASSED'),
|
|
282
|
+
required: true
|
|
283
|
+
},
|
|
284
|
+
{
|
|
285
|
+
name: 'Testing Command Functional',
|
|
286
|
+
met: this.testResults.details.some(t => t.name.includes('Test Command') && t.status === 'PASSED'),
|
|
287
|
+
required: true
|
|
288
|
+
},
|
|
289
|
+
{
|
|
290
|
+
name: 'Performance Under 5 Seconds',
|
|
291
|
+
met: this.testResults.details.some(t => t.name.includes('Performance') && t.status === 'PASSED'),
|
|
292
|
+
required: true
|
|
293
|
+
},
|
|
294
|
+
{
|
|
295
|
+
name: 'Error Handling Robust',
|
|
296
|
+
met: this.testResults.details.some(t => t.name.includes('Error Handling') && t.status === 'PASSED'),
|
|
297
|
+
required: true
|
|
298
|
+
}
|
|
299
|
+
];
|
|
300
|
+
|
|
301
|
+
requirements.forEach(req => {
|
|
302
|
+
const status = req.met ? chalk.green('ā
') : chalk.red('ā');
|
|
303
|
+
const priority = req.required ? '(Required)' : '(Optional)';
|
|
304
|
+
console.log(` ${status} ${req.name} ${chalk.gray(priority)}`);
|
|
305
|
+
});
|
|
306
|
+
|
|
307
|
+
const requiredMet = requirements.filter(r => r.required && r.met).length;
|
|
308
|
+
const totalRequired = requirements.filter(r => r.required).length;
|
|
309
|
+
|
|
310
|
+
console.log(chalk.blue(`\nš Requirements Met: ${requiredMet}/${totalRequired}`));
|
|
311
|
+
|
|
312
|
+
if (requiredMet === totalRequired) {
|
|
313
|
+
console.log(chalk.green.bold('\nš All Phase 2 CLI Requirements Met!'));
|
|
314
|
+
console.log(chalk.green('The CLI wizard is ready for production use.'));
|
|
315
|
+
} else {
|
|
316
|
+
console.log(chalk.red.bold('\nā ļø Some Requirements Not Met'));
|
|
317
|
+
console.log(chalk.red('Additional development needed before production deployment.'));
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
// Run tests if script is called directly
|
|
323
|
+
if (import.meta.url === `file://${process.argv[1]}`) {
|
|
324
|
+
const tester = new CLIWizardTester();
|
|
325
|
+
|
|
326
|
+
tester.runAllTests().catch(error => {
|
|
327
|
+
console.error(chalk.red.bold('\nš„ Test Suite Failed:'));
|
|
328
|
+
console.error(chalk.red(error.message));
|
|
329
|
+
process.exit(1);
|
|
330
|
+
});
|
|
331
|
+
}
|