chore: record tokens and EUR cost per ticket in the dev log

The agent cannot read /usage, and time leaves out the developer's own work. Tokens come from Claude Code's transcripts, priced at API list rates.
This commit is contained in:
kasun committed 2026-11-15 14:54:54 +01:00
1 parent 9993d70eb2
commit d070b19f03
3 files changed
+149 -3

No files matched your search

+3 -1
View File
@@ -88,4 +88,6 @@ The same permissions apply in every phase: nothing is pushed to `main`, and real
## Metrics
Recorded in the [dev log](devlog.md) for each ticket: time, cost, agent mistakes and what caught them (test, types, lint, agent review, human review, real run), number of rework rounds, and one thing learned.
Recorded in the [dev log](devlog.md) for each ticket: tokens and cost, agent mistakes and what caught them (test, types, lint, agent review, human review, real run), number of rework rounds, and one thing learned.
Tokens and cost come from `.claude/scripts/ticket-cost.py`, which sums the Claude Code transcripts from the start of work on the ticket to the merge. Cost is in EUR at API list prices (ECB rate of the day). On a subscription that is not the amount paid; it is a comparable measure between tickets. Time is not recorded: the agent cannot see the developer's time for writing, research and review, and wall-clock time from branch to merge mostly measures waiting.
+13 -2
View File
@@ -2,13 +2,24 @@
One entry per finished roadmap step, newest first. The agent drafts the entry, the developer corrects it. Rules for the workflow are in [agentic-workflow.md](agentic-workflow.md).
## 2026-11-15 · Setup: Add project docs and agent workflow setup
- **Issue / PR:** #1 / #3
- **Phase:** 1
- **Tokens / cost:** 12.3M tokens (146k output, 11.5M cache read) · ~€9.21 API-equivalent. Covers all sessions up to the merge, i.e. the whole setup work.
- **Rework rounds:** 0
- **Agent mistakes and what caught them:**
- None in the commit/PR step. No CI yet, so only the commit-msg hook and a manual secret scan (grep for tokens, keys, local IPs, personal details) ran.
- **What worked well:** Showing the staged file list and scanning for secrets before the commit. The board, labels and `gitea.sh` worked end to end: PR opened, `Closes #1` closed the issue on merge, ticket moved to Done via the API.
- **Learned:** Gitea's "There is no key available to sign this commit" refers to the merge commit the server would create; the instance has no signing key. It is informational and does not block merging.
- **Workflow change proposed:** Record tokens and EUR cost from the transcripts (`ticket-cost.py`) instead of time and cost from `/usage`. The agent cannot read `/usage`, and time leaves out the developer's own work. Approved by the developer.
<!--
## YYYY-MM-DD · Step N: <title>
- **Issue / PR:** #
- **Phase:** 1
- **Time:** ~h
- **Cost:** (from /cost or /usage)
- **Tokens / cost:** (from `.claude/scripts/ticket-cost.py --since <work started> --until <merged>`)
- **Rework rounds:** 0
- **Agent mistakes and what caught them:**
- <mistake> → caught by <test | types | lint | agent review | human review | real run | nothing (found later)>