Skip to content

feat(accounting): normalize provider usage evidence - #50

Merged
diegosouzapw merged 2 commits into
mainfrom
feat/port-pr-222-accounting-normalization
Aug 17, 2026
Merged

feat(accounting): normalize provider usage evidence#50
diegosouzapw merged 2 commits into
mainfrom
feat/port-pr-222-accounting-normalization

Conversation

@diegosouzapw

Copy link
Copy Markdown
Owner

Summary

  • add provider-neutral physical usage normalization as an additive public API
  • distinguish provider-reported, estimated, bytes-only and unavailable evidence
  • handle Anthropic disjoint cache buckets without double-counting OpenAI-compatible cache subsets
  • reject malformed, fractional and unsafe discrete counters
  • preserve measured expansion as a negative reduction
  • keep cache-weighted economic counterfactuals in the existing baseline module

Validation

  • 17 normalization regressions added before the implementation
  • lint passed
  • typecheck passed
  • build passed
  • full suite: 1,133 tests passed

Add a fail-closed physical-usage contract that distinguishes provider reports, estimates and byte-only evidence without changing the cache-weighted baseline model.

Co-authored-by: Alexandre Teixeira <alexandremagteixeira@gmail.com>

Inspired-by: teamchong/pxpipe#222
…unting-normalization

# Conflicts:
#	CHANGELOG.md
@sonarqubecloud

Copy link
Copy Markdown

❌ The last analysis has failed.

See analysis details on SonarQube Cloud

@diegosouzapw
diegosouzapw merged commit 02b78e1 into main Aug 17, 2026
9 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant