daax-dev / daax-dev/agentic-retrospective

Claude-native telemetry: token & cost accounting

Open
#37 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
TypeScript
Stars
3
Forks
2
PR merge metrics
No merged PRs in 30d

Description

Problem

Token usage is the primary efficiency signal, but the raw stream splits tokens across input / cache-creation / cache-read / output and the local costUSD field is unpopulated (observed 0). Without a correct accounting layer, cost and efficiency claims are unreliable.

Capability

Turn normalized turns into a correct token ledger and computed cost, aggregated over the sprint window.

Behaviour

  • Per-turn ledger: billable input = input + cache-creation; cache-read tracked separately (~0.1×, session overhead, not per-tool); output; cache TTL split; server tool use.
  • Compute cost from tokens × an offline pricing table keyed by model; never trust local costUSD; treat missing price as "unknown," not 0.
  • Model registry/alias resolution; record unknown models.
  • Aggregate by sprint window (git refs), then session/day/model/project.

Acceptance criteria

  • Billable tokens for a fixture match a hand-computed value.
  • Cache-read reported separately and excluded from per-tool attribution.
  • Unknown-model turn counts tokens and is flagged "cost unknown," never priced 0.
  • Sprint-window totals equal the sum of in-window deduped turns.

Dimensions: Delivery Predictability (cost trend, outliers), Collaboration Efficiency (cache-read / output ratios). Tier 2. Depends on #36. PRD: docs/prd/features/02-token-cost-accounting.md.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading docs/prd/features/02-token-cost-accounting.md and issue #36, then trace where normalized turns and sprint-window git refs enter the system. Done means deduped in-window totals satisfy the listed ledger, pricing, cache-read, unknown-model, and aggregation acceptance criteria.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
backend-api-design, data
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.