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
Feature: expose per-day one-shot data in daily JSON output #279
Currently `codeburn report --format json` exposes one-shot metrics only at the period level via `activities[].oneShotRate` / `oneShotTurns` / `editTurns` / `turns`. The `daily[]` array only carries `date / cost / calls`.
For consumers building daily-resolution efficiency tracking (daily score, streak, heatmap), per-day one-shot data would be valuable.
Option B is more flexible — consumers can aggregate over arbitrary windows (7-day rolling avg, weekly, monthly) without re-deriving from activity-level data.
Use case
Daily-resolution efficiency dashboard. Currently we score each day with `cache hit` (from ccusage tokens) + `cost/call` (from codeburn daily). Adding per-day one-shot would let us include the "skill" signal alongside infrastructure (cache) and model selection (cost). Without per-day data the rate becomes noisy when derived from period-level rollups.
The data already exists internally — `activities[].oneShotTurns` / `turns` per period. This request is just to surface it bucketed by date in `daily[]`.
Hey @eugene-eee-hongkyu — thanks for the detailed report and especially for naming the consumer (ai-usage-tracker), that helped me lock in the right shape.
I went with Option B + the pre-computed rate — both raw counts and oneShotRate. Raw counts let you sum across arbitrary windows correctly (you can't average rates), and the pre-computed oneShotRate keeps simple consumers simple. This matches what activities[] and models[] already do in the same JSON output.
editTurns — turns that triggered file edits (Edit/Write/MultiEdit/NotebookEdit/cursor:edit)
oneShotTurns — edit turns that succeeded with zero retries
oneShotRate — Math.round((oneShotTurns / editTurns) * 1000) / 10. null when editTurns === 0 so a chat-only day doesn't read as 0% one-shot. Heads-up: handle null in your scoring logic.
Cross-check invariant
For the same period, sum(daily[].editTurns) === sum(activities[].editTurns) (and same for oneShotTurns, turns). Verified empirically on real data: 940/940 weekly editTurns, 856/856 weekly oneShotTurns, exact match on today as well.
Validation request
PR is open at #280. Could you pull the branch and validate against ai-usage-tracker before we merge? Specifically:
Schema matches what your daily scoring needs?
Naming (oneShotRate vs alternatives like oneShotPct) feels right?
The null semantics for chat-only days don't break your aggregator?
(week period also passed: 2037 / 406 / 270 across 8 daily rows.)
Rate formula spot check (5 random days, expecting Math.round((oneShotTurns / editTurns) * 1000) / 10):
date
editTurns
oneShotTurns
expected
actual
2026-04-10
19
16
84.2
84.2 ✅
2026-04-13
3
2
66.7
66.7 ✅
2026-04-14
40
37
92.5
92.5 ✅
2026-04-15
96
91
94.8
94.8 ✅
2026-04-16
108
89
82.4
82.4 ✅
null semantics — couldn't directly validate (no editTurns === 0 days in my 30d data, every active day had at least one edit), but reviewed the code path. Guarding editTurns === 0 → null is exactly what we want for downstream aggregators.
Feedback on the 3 questions
Schema — both raw counts + pre-computed rate is the right call. Raw counts let us aggregate over arbitrary windows (rolling avg, weekly, historical backfill) without re-deriving from rates. Matching activities[] / models[] shape keeps the JSON consistent.
Naming — oneShotRate matches existing activities[].oneShotRate. Already consistent with codebase convention. No change needed.
Null on chat-only days — actually a feature for us, not a concern. Defaulting to 0% would penalize legitimate chat days and skew rolling averages. We'll guard with editTurns > 0 (or oneShotRate !== null) before folding into our daily efficiency score formula.
What we'll do once merged
Adding one-shot as a third signal to our daily efficiency score (currently cache 85 + cost 15, see fb3cc9c). Probably landing at cache 60 + one-shot 25 + cost 15 to treat one-shot as the "skill" axis (cache = infrastructure, cost = model selection, one-shot = clear instructions). Will report back with the resulting distribution across our 10 developers once shipped.
Thanks for the quick turnaround and for getting the invariants right — the reconciliation guarantee is what makes this safe to consume. 🙏
Awesome — thanks for shipping this. We've already wired our scoring logic for the new fields behind a oneShotRate ?? null guard, so it'll switch on automatically once the package lands on npm.
Quick question: any rough ETA on the next publish? Just so I can time our team's install.sh re-run and the distribution writeup. No pressure if it's not soon — we're not blocked.
@eugene-eee-hongkyu Aiming for tomorrow (2026-05-10). Quite a few things have landed since 0.9.7 - multi-Claude-config-dir support, Crush provider, the new `codeburn models` command, the per-day one-shot fields you validated - so I want to revalidate the bundle end-to-end before cutting the tag.
Will ping you here the moment it is on npm so you can re-run your `install.sh` and roll the writeup. Thanks for guarding behind `oneShotRate ?? null` already - that means there is nothing on your end blocking us either way.
Activity
iamtoruk commentedon May 9, 2026
Hey @eugene-eee-hongkyu — thanks for the detailed report and especially for naming the consumer (ai-usage-tracker), that helped me lock in the right shape.
I went with Option B + the pre-computed rate — both raw counts and
oneShotRate. Raw counts let you sum across arbitrary windows correctly (you can't average rates), and the pre-computedoneShotRatekeeps simple consumers simple. This matches whatactivities[]andmodels[]already do in the same JSON output.New
daily[]shape{ "date": "2026-05-08", "cost": 241.27, "calls": 2480, "turns": 2234, "editTurns": 150, "oneShotTurns": 146, "oneShotRate": 97.3 }Semantics:
turns— every classified turn that dayeditTurns— turns that triggered file edits (Edit/Write/MultiEdit/NotebookEdit/cursor:edit)oneShotTurns— edit turns that succeeded with zero retriesoneShotRate—Math.round((oneShotTurns / editTurns) * 1000) / 10.nullwheneditTurns === 0so a chat-only day doesn't read as 0% one-shot. Heads-up: handlenullin your scoring logic.Cross-check invariant
For the same period,
sum(daily[].editTurns) === sum(activities[].editTurns)(and same foroneShotTurns,turns). Verified empirically on real data: 940/940 weekly editTurns, 856/856 weekly oneShotTurns, exact match on today as well.Validation request
PR is open at #280. Could you pull the branch and validate against
ai-usage-trackerbefore we merge? Specifically:oneShotRatevs alternatives likeoneShotPct) feels right?nullsemantics for chat-only days don't break your aggregator?Once you confirm it works for your consumer, we'll merge and it'll ship in the next publish.
eugene-eee-hongkyu commentedon May 10, 2026
Validated
feat/json-daily-oneshotagainst ai-usage-tracker — looks great, ready to merge from our side.Validation results
Built
8682a88(Strengthen daily/activities reconciliation + CHANGELOG entry) locally and ran against my own 30-day Claude Code data.Cross-check invariant — all PASS (
-p 30days --format json --provider claude):(week period also passed: 2037 / 406 / 270 across 8 daily rows.)
Rate formula spot check (5 random days, expecting
Math.round((oneShotTurns / editTurns) * 1000) / 10):null semantics — couldn't directly validate (no
editTurns === 0days in my 30d data, every active day had at least one edit), but reviewed the code path. GuardingeditTurns === 0 → nullis exactly what we want for downstream aggregators.Feedback on the 3 questions
Schema — both raw counts + pre-computed rate is the right call. Raw counts let us aggregate over arbitrary windows (rolling avg, weekly, historical backfill) without re-deriving from rates. Matching
activities[]/models[]shape keeps the JSON consistent.Naming —
oneShotRatematches existingactivities[].oneShotRate. Already consistent with codebase convention. No change needed.Null on chat-only days — actually a feature for us, not a concern. Defaulting to
0%would penalize legitimate chat days and skew rolling averages. We'll guard witheditTurns > 0(oroneShotRate !== null) before folding into our daily efficiency score formula.What we'll do once merged
Adding one-shot as a third signal to our daily efficiency score (currently
cache 85 + cost 15, see fb3cc9c). Probably landing atcache 60 + one-shot 25 + cost 15to treat one-shot as the "skill" axis (cache = infrastructure, cost = model selection, one-shot = clear instructions). Will report back with the resulting distribution across our 10 developers once shipped.Thanks for the quick turnaround and for getting the invariants right — the reconciliation guarantee is what makes this safe to consume. 🙏
Expose per-day one-shot data in daily JSON output
iamtoruk commentedon May 10, 2026
Merged via #280 (d1eb13f). The new
turns/editTurns/oneShotTurns/oneShotRatefields ondaily[]are onmainand will ship in the next npm publish.Thanks @eugene-eee-hongkyu for the thorough validation — the empirical reconciliation table you posted made this an easy merge call.
eugene-eee-hongkyu commentedon May 10, 2026
Awesome — thanks for shipping this. We've already wired our scoring logic for the new fields behind a
oneShotRate ?? nullguard, so it'll switch on automatically once the package lands on npm.Quick question: any rough ETA on the next publish? Just so I can time our team's
install.shre-run and the distribution writeup. No pressure if it's not soon — we're not blocked.Expose per-day one-shot data in daily JSON output (getagentseal#279) (g…
iamtoruk commentedon May 10, 2026
@eugene-eee-hongkyu Aiming for tomorrow (2026-05-10). Quite a few things have landed since 0.9.7 - multi-Claude-config-dir support, Crush provider, the new `codeburn models` command, the per-day one-shot fields you validated - so I want to revalidate the bundle end-to-end before cutting the tag.
Will ping you here the moment it is on npm so you can re-run your `install.sh` and roll the writeup. Thanks for guarding behind `oneShotRate ?? null` already - that means there is nothing on your end blocking us either way.