You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
cd /Users/ryandahlberg/Projects/cortex
# Install WebSocket dependency (only external dep needed)
npm install ws
# Make CLI executable
chmod +x scripts/cortex
⚡ 60-Second Start
# Start Cortex 2.0
./scripts/cortex start
# In another terminal, check status
./scripts/cortex status
# Submit a test task
./scripts/cortex submit implementation --payload='{"feature":"user-auth"}'# View metrics
./scripts/cortex metrics
// Scale worker poolawaitcortex.scale(30);// Scale to 30 workers// Get metricsconstmetrics=cortex.getMetrics();console.log(metrics.workerPool.workers);
# Test coordination daemon
node lib/coordination/examples/performance-test.js
# Test worker pool
node lib/worker-pool/test-pool.js
# Test scheduler
node lib/scheduler/test-scheduler.js
Interactive Demo
./scripts/cortex demo
🔍 API Reference
CortexCore Methods
Method
Description
initialize()
Initialize all components
submitTask(task)
Submit a single task
submitBatch(tasks)
Submit multiple tasks
getStatus()
Get system status
getMetrics()
Get detailed metrics
scale(n)
Scale worker pool
shutdown(graceful)
Shutdown Cortex
HTTP API Endpoints
Endpoint
Method
Description
/health
GET
Health check
/api/state
GET
Get coordination state
/api/metrics
GET
Get all metrics
/api/tasks/assign
POST
Submit task
/api/tasks/complete
POST
Complete task
/api/workers/register
POST
Register worker
WebSocket Events
Event
Direction
Description
task_assigned
Server→Client
New task for worker
heartbeat
Client→Server
Worker heartbeat
task_progress
Client→Server
Progress update
state_changed
Server→Client
State broadcast
🚨 Troubleshooting
"Port already in use"
# Find process using port
lsof -i :9500
# Kill itkill -9 <PID>
# Check training data size
cat coordination/scheduler-training-data.jsonl | wc -l
# Need 50+ samples for accurate ML predictions# Until then, heuristics are used