Track actual resource usage per hypothesis/analysis/entity:
1. Add token counting to all LLM calls in scidex_orchestrator.py (debate tokens per hypothesis)
2. Add API call tracking in tools.py (PubMed queries, Semantic Scholar, etc.)
3. Add CPU time tracking for post_process.py pipeline runs
4. Store in resource_usage table with entity_type, entity_id, resource_type, amount, cost_usd
5. Add /api/resource-usage/{entity_id} endpoint
6. Display usage stats on hypothesis detail pages and Senate dashboard
Completion Notes
Auto-release: work already on origin/main
Git Commits (1)
[Senate] Implement resource tracking and metering [task:370890cc-17a6-4afc-803c-f3219625c49d]2026-04-26