Severity: medium | Category: infra | Phase: P2.3
Problem
get_workspace_token_usage does SELECT * with no LIMIT and aggregates in Python; --period filters timestamp with no index and re-aggregates despite get_costs_summary existing.
Evidence
codeframe/platform_store/repositories/token_repository.py:246
Acceptance criteria
Aggregation pushed into SQL (SUM/GROUP BY, WHERE range); export streams/paginates. (Indexes handled by P0.1.)
Dependencies
blocked by #712 ([P0.1])
Filed from the SaaS launch-readiness audit. Atomic: one developer, one session. Work order: strictly P0.1 → P3.12 (no forward dependencies).
Severity: medium | Category: infra | Phase: P2.3
Problem
get_workspace_token_usagedoesSELECT *with no LIMIT and aggregates in Python;--periodfilters timestamp with no index and re-aggregates despiteget_costs_summaryexisting.Evidence
codeframe/platform_store/repositories/token_repository.py:246Acceptance criteria
Aggregation pushed into SQL (SUM/GROUP BY, WHERE range); export streams/paginates. (Indexes handled by P0.1.)
Dependencies
blocked by #712 ([P0.1])
Filed from the SaaS launch-readiness audit. Atomic: one developer, one session. Work order: strictly P0.1 → P3.12 (no forward dependencies).