Files
ruflo/v2/scripts/test-phase4.js
T
rUvandClaude Opus 4.5 1b6a1971f7 feat(v3): add comprehensive v3 implementation plans and swarm architecture
- Reorganize v3/ into implementation/ subfolders:
  - planning/, architecture/, migration/, integration/
  - security/, adrs/, research/, swarm-plans/

- Add 15-agent concurrent swarm implementation plans:
  - SWARM-OVERVIEW.md: Hierarchical mesh topology, 4 phases
  - AGENT-SPECIFICATIONS.md: 15 agent configs with capabilities
  - TDD-LONDON-SCHOOL-PLAN.md: Mock-first TDD methodology
  - BENCHMARK-OPTIMIZATION.md: Performance targets (2.49x-7.47x)
  - DEPLOYMENT-PLAN.md: Release strategy, CI/CD, rollback
  - GITHUB-ISSUE-TRACKING.md: Issue workflow with agent replies

- Update .claude/settings.json with proper hooks format
- Add bash aliases for claude --dangerously-skip-permissions

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-04 15:40:51 +00:00

81 lines
3.0 KiB
JavaScript
Executable File

#!/usr/bin/env node
/**
* Phase 4 Session Forking - Runtime Validation
* Tests ParallelSwarmExecutor and RealTimeQueryController
*/
import { createRequire } from 'module';
const require = createRequire(import.meta.url);
console.log('🧪 Testing Phase 4: Session Forking & Real-Time Control\n');
// Test 1: Load Session Forking Module
console.log('Test 1: Loading session-forking module...');
try {
const SessionForking = require('../dist/src/sdk/session-forking.js');
console.log('✅ Module loaded successfully');
console.log(' Exports:', Object.keys(SessionForking).join(', '));
// Test 2: Create ParallelSwarmExecutor Instance
console.log('\nTest 2: Creating ParallelSwarmExecutor instance...');
const executor = new SessionForking.ParallelSwarmExecutor({
maxConcurrency: 5,
batchSize: 3,
enableMetrics: true
});
console.log('✅ Executor instance created');
console.log(' Type:', executor.constructor.name);
// Get methods
const methods = Object.getOwnPropertyNames(Object.getPrototypeOf(executor))
.filter(m => m !== 'constructor' && typeof executor[m] === 'function');
console.log(' Methods:', methods.join(', '));
} catch (error) {
console.error('❌ Session Forking test failed:', error.message);
process.exit(1);
}
// Test 3: Load Query Control Module
console.log('\nTest 3: Loading query-control module...');
try {
const QueryControl = require('../dist/src/sdk/query-control.js');
console.log('✅ Module loaded successfully');
console.log(' Exports:', Object.keys(QueryControl).join(', '));
// Test 4: Create RealTimeQueryController Instance
console.log('\nTest 4: Creating RealTimeQueryController instance...');
const controller = new QueryControl.RealTimeQueryController();
console.log('✅ Controller instance created');
console.log(' Type:', controller.constructor.name);
// Get methods
const methods = Object.getOwnPropertyNames(Object.getPrototypeOf(controller))
.filter(m => m !== 'constructor' && typeof controller[m] === 'function');
console.log(' Methods:', methods.join(', '));
} catch (error) {
console.error('❌ Query Control test failed:', error.message);
process.exit(1);
}
// Test 5: Verify SDK Integration
console.log('\nTest 5: Verifying Claude Code SDK integration...');
try {
const claudeCodeSDK = require('@anthropic-ai/claude-code');
console.log('✅ Claude Code SDK accessible');
console.log(' SDK exports query function:', typeof claudeCodeSDK.query === 'function');
} catch (error) {
console.error('❌ SDK integration test failed:', error.message);
process.exit(1);
}
console.log('\n🎉 All Phase 4 tests passed!');
console.log('\n📊 Summary:');
console.log(' ✅ Session forking module loads correctly');
console.log(' ✅ ParallelSwarmExecutor instantiates');
console.log(' ✅ Query control module loads correctly');
console.log(' ✅ RealTimeQueryController instantiates');
console.log(' ✅ Claude Code SDK integration working');
console.log('\n🚀 Phase 4 is fully operational!');