agent: builder model: sonnet max_turns: 90 budget_usd: 12 —

Brief: agent.nika records every run in docs/tokenspeed.md; tokenspeed moves to Nikaia

Owner approved, 2026-10-26. Tooling: no version raise, no CHANGELOG.

Facts

Files (only these)

scripts/agent.nika, scripts/tokenspeed.nika (new), scripts/tokenspeed.py (deleted at the end, with its callers’ mentions in these files), docs/tokenspeed.md, the test under tests/compiler/tests/. Two other builders run in the same tree (#856 in tools/check_* and the emitter, #857 in emit/mod.rs, tools/emit_stmt.nika): do not touch their files, do not build the compiler unless a finding needs it.

To build

  1. scripts/tokenspeed.nika: the same two modes and the same output as the Python, byte for byte (--short DIR|FILE, and the full tables); same counting and attribution rules. Compare with the Python on two transcripts before deleting it. Keep the row formatting in one function.
  2. Test: tests/compiler/tests/tokenspeed_row_formatting.nika + .stdout (that function, a copy of it if the test cannot use a script: say which in the report): a row with moved lines, one with 0 (-), thousands separator.
  3. agent.nika: after the gate step, run nikaia run scripts/tokenspeed.nika -- --short <transcript> and append the row to the Runs table of docs/tokenspeed.md, idempotent per agent id (a second run with the same id replaces nothing and adds nothing). agent.nika only writes the file and does not commit it; the supervisor’s commit takes it (say so in a comment in agent.nika).
  4. Backfill: rows for today’s (2026-10-25/26) builder runs whose transcripts exist (*.run.json in the scratchpad’s briefs/, the session’s subagents/); a run without a transcript is named in the report, not guessed.
  5. nikaia run both scripts once, scripts/pre-push-check.sh, commit, Fixes #858.

Rules (CLAUDE.md)

Report (at most 15 lines, <brief path>.report.md)

Result, Files, Commit, Fixes, Pushed, Tests, Deviation, Found, Needs, rows backfilled, GB freed, Owner (form: docs/architect.md, Briefs and reports).

This site is open source. Improve this page.