mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-09 04:50:59 +00:00
`coach_usage` counted one number per (user, day). A turn served by the user's own ChatGPT plan after the operator's shared key answered 500 was therefore charged to the operator-cost cap, and the operator's chat was locked out every morning by background work he pays for himself. The ledger gains `operator_tokens`: the share of `total_tokens` served by an operator-funded provider. `reserveBudget` books a reservation to the owner of the chain's primary and `reconcileSpend` settles it against the provider that actually served, both inside the same statements as the total so concurrent requests can never see one counter without the other. Every call site names its cost owner and its serving hop; the argument is required, so a new surface cannot inherit the old blind accounting.