Context
The usage scorecard (ADR-0009) ingests two local transcript stores today:
| Provider |
Store |
Parser |
| Claude Code |
~/.claude/projects/**/*.jsonl |
parseClaude (src/lib/usage-index.mjs) |
| Codex CLI |
~/.codex/sessions/**/rollout-*.jsonl |
parseCodex (src/lib/usage-index.mjs) |
Sessions routed through OpenRouter (e.g. GLM models via z-ai/glm-5.2, or any other OpenRouter-served model reached from aqe's fallback chain or ruflo's provider matrix — see docs/PROVIDERS.md) are invisible to the scorecard unless they happen to flow through one of the two hosts above. As dual/multi-provider usage grows on machines running ak x provider pick with OpenRouter entries, the scorecard's "by host" and "models in play" panels undercount real activity.
Scope of the enhancement
- Discovery — establish where (and whether) an OpenRouter-backed CLI/host on this machine persists per-session transcripts with per-turn token usage, and what the log schema is. (OpenRouter itself is an API gateway; the local log format depends on the client driving it — this needs the same grounding pass
parseCodex got before any parsing code is written.)
- Parser — a third
parse* sibling in src/lib/usage-index.mjs, following the house rules the existing two enforce: cumulative-vs-delta token semantics established from real logs (not assumed — see the Codex thread-replay bug, docs/USAGE-SCORECARD-METRICS.md §15), read-only, malformed lines skipped never fatal, SCHEMA_VERSION bump if session-record fields change.
- Turn attribution — user-role turns must carry the
kind field (prompt / tool-result / context) so the transcript reader never attributes tool output to the human (docs/TRANSCRIPTS.md).
- Pricing — OpenRouter passes through per-model pricing that differs from first-party list rates and publishes a machine-readable models endpoint; decide whether the maintained table in
src/lib/pricing.mjs grows OpenRouter entries or gains a dated snapshot from that endpoint (keeping the offline-first contract — no network at scan time).
- UI — "by host" grows a third card; the provider ordering in
dashboard-server.mjs (order=["claude","codex"]) becomes extensible.
Documentation to update when this lands
docs/USAGE-SCORECARD-METRICS.md (§1 data provenance, §8 by-host, §13 pricing tables)
docs/TRANSCRIPTS.md (provider differences table)
- ADR-0009 (amendment)
🤖 Generated with Claude Code
Context
The usage scorecard (ADR-0009) ingests two local transcript stores today:
~/.claude/projects/**/*.jsonlparseClaude(src/lib/usage-index.mjs)~/.codex/sessions/**/rollout-*.jsonlparseCodex(src/lib/usage-index.mjs)Sessions routed through OpenRouter (e.g. GLM models via
z-ai/glm-5.2, or any other OpenRouter-served model reached from aqe's fallback chain or ruflo's provider matrix — seedocs/PROVIDERS.md) are invisible to the scorecard unless they happen to flow through one of the two hosts above. As dual/multi-provider usage grows on machines runningak x provider pickwith OpenRouter entries, the scorecard's "by host" and "models in play" panels undercount real activity.Scope of the enhancement
parseCodexgot before any parsing code is written.)parse*sibling insrc/lib/usage-index.mjs, following the house rules the existing two enforce: cumulative-vs-delta token semantics established from real logs (not assumed — see the Codex thread-replay bug,docs/USAGE-SCORECARD-METRICS.md§15), read-only, malformed lines skipped never fatal,SCHEMA_VERSIONbump if session-record fields change.kindfield (prompt/tool-result/context) so the transcript reader never attributes tool output to the human (docs/TRANSCRIPTS.md).src/lib/pricing.mjsgrows OpenRouter entries or gains a dated snapshot from that endpoint (keeping the offline-first contract — no network at scan time).dashboard-server.mjs(order=["claude","codex"]) becomes extensible.Documentation to update when this lands
docs/USAGE-SCORECARD-METRICS.md(§1 data provenance, §8 by-host, §13 pricing tables)docs/TRANSCRIPTS.md(provider differences table)🤖 Generated with Claude Code