Task 1: Clean up root-level runtime directories
- Backup live/, backtest/, production/ to runs/_legacy/
- Remove legacy directories from repo root
Task 2: API route semantics cleanup
- Create /api/runs/{run_id}/agents/* routes for runtime agent operations
- Keep /api/workspaces/{id}/agents/* for design-time (deprecated)
- Update frontend runtimeApi.js to use new /runs/ prefix
- Update legacy-inventory.md with completion status
New files:
- backend/api/runs.py - Runtime agent routes with proper run_id semantics
Modified:
- backend/api/__init__.py - Export runs_router
- backend/apps/agent_service.py - Include runs_router, update scope docs
- frontend/src/services/runtimeApi.js - Use /runs/ instead of /workspaces/
- docs/legacy-inventory.md - Mark cleanup as completed
Constraint: Maintain backward compatibility with old /workspaces/ routes
Rejected: Remove old routes entirely | need backward compatibility during transition
Confidence: high
Scope-risk: moderate
Directive: Old /api/workspaces/ routes remain functional but deprecated
Not-tested: Full integration test with active runtime
Frontend Quick Start
cd frontend
npm ci
npm run dev
Default dev URL: http://localhost:5173
The frontend expects the 大时代 gateway WebSocket on ws://localhost:8765 unless overridden.
Recommended Local Backend Stack
Start the split backend services from the project root:
./start-dev.sh
That gives you:
- control plane at
http://localhost:8000/api - trading service at
http://localhost:8001 - news service at
http://localhost:8002 - runtime service at
http://localhost:8003/api/runtime - gateway WebSocket at
ws://localhost:8765
Frontend Environment Variables
You can point the frontend directly at those services with:
VITE_CONTROL_API_BASE_URL=http://localhost:8000/api
VITE_RUNTIME_API_BASE_URL=http://localhost:8003/api/runtime
VITE_NEWS_SERVICE_URL=http://localhost:8002
VITE_TRADING_SERVICE_URL=http://localhost:8001
VITE_WS_URL=ws://localhost:8765
There is also a starter template at frontend/env.template.
For production deployments, prefer:
cd frontend
npm ci
npm run build
This ensures the deployed frontend matches the checked-in package-lock.json.
Direct-Service Coverage
Current direct-call coverage includes:
- runtime panel data loading
- gateway port/runtime discovery
storysimilar daysrange explainnews for datenews categories- selected trading reads such as price history and insider trades
If these variables are not set, the frontend falls back to local defaults and compatibility paths where they still exist.