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
{{ message }}
Repository navigation
Metrics and LLM-cost export (CSV, JSON, CLI, MCP) #3438
The only export is GET /api/stats/review-scores.csv. Teams that need a finance breakdown compute it by hand from the UI.
Goal
A cost export by day, repository, model, effort, execution type and outcome.
Acceptance criteria
GET /api/stats/cost (JSON) and GET /api/stats/cost.csv return rows grouped by a group_by list drawn from: day, repository, agent, model, reasoning_level, execution_type, outcome (success/failed). Each row has executions, tasks, input/output/cache tokens and cost in USD.
The standard analytics window parameters and repository filter apply; access control matches the existing stats routes.
CSV follows the conventions of the review-scores CSV (header row, stable column order, proper escaping).
propr stats cost [--period] [--repository] [--group-by] [--json|--csv] in the CLI.
An MCP read tool returns the same data, registered in the tool catalog and documented in docs/mcp.md and docs/mcp-coverage.md.
The OpenAPI description and the generated client types include the new routes.
docs/docs/operations/metrics.md documents the export; docs/ROADMAP.md is updated.
Tests cover grouping, filters, CSV escaping, CLI output and the MCP tool.
Implementation
Key files: packages/api/routes/reviewScoreStats.ts (getCsv, CSV_COLUMNS pattern), packages/api/routeRegistry.ts (stats routes), packages/api/routes/analyticsWindow.ts, packages/api/routes/analyticsModelUsage.ts (executionTokenSums), packages/cli/src/commands/statsCommands.ts, packages/cli/src/api/stats.ts, packages/api/mcp/tools.ts, packages/client/src/generated/apiTypes.ts. Data source: llm_executions joined to tasks for repository; llm_logs for execution type and agent alias where needed. Verify with the standard commands.
Activity
propr-dev commentedon Nov 11, 2026
🤖 AI processing has started for this issue using claude agent with claude-opus-5-5 model.
I'll analyze the problem and work on a solution. This may take a few minutes.
Processing Details:
claudeclaude-opus-5-53438/claude-opus-5-5-metrics-and-llm-cost-expo-20261111-2357-0bs3437-epic-cost-visibility-oluissue-3438-20261111-2357-claude-opus-5-5-0bs🔍 Track Task Execution