WIP: ✨ feat(co2): separate cache accounting components #5

Draft
mat wants to merge 2 commits from feat/s4-cache-accounting into feat/s0-foundation
Owner

Context

The estimator previously charged input, cache creation, and cache reads through one input coefficient, hiding which token category drove the result.

Impact

Introduces separate input/cache-creation/cache-read/output accounting, recalibrates the accelerator-only tier coefficients, charges cache reads at 0.15x the input coefficient, and exposes an additive co2_components breakdown in JSON. Existing central totals and APIs remain explicit and testable; full-stack adjustment is deferred to the next slice.

Verification

  • go test ./...
  • go vet ./...
  • git diff --check

This PR is intentionally draft and is stacked on S0.

## Context The estimator previously charged input, cache creation, and cache reads through one input coefficient, hiding which token category drove the result. ## Impact Introduces separate input/cache-creation/cache-read/output accounting, recalibrates the accelerator-only tier coefficients, charges cache reads at 0.15x the input coefficient, and exposes an additive `co2_components` breakdown in JSON. Existing central totals and APIs remain explicit and testable; full-stack adjustment is deferred to the next slice. ## Verification - `go test ./...` - `go vet ./...` - `git diff --check` This PR is intentionally draft and is stacked on S0.
This pull request is marked as a work in progress.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin feat/s4-cache-accounting:feat/s4-cache-accounting
git switch feat/s4-cache-accounting

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch feat/s0-foundation
git merge --no-ff feat/s4-cache-accounting
git switch feat/s4-cache-accounting
git rebase feat/s0-foundation
git switch feat/s0-foundation
git merge --ff-only feat/s4-cache-accounting
git switch feat/s4-cache-accounting
git rebase feat/s0-foundation
git switch feat/s0-foundation
git merge --no-ff feat/s4-cache-accounting
git switch feat/s0-foundation
git merge --squash feat/s4-cache-accounting
git switch feat/s0-foundation
git merge --ff-only feat/s4-cache-accounting
git switch feat/s0-foundation
git merge feat/s4-cache-accounting
git push origin feat/s0-foundation
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
mat/cco2usage!5
No description provided.