fix(usage): keep projected reads off the buckets [ING-631] - #6440
Merged
Merged
Conversation
Contributor
|
Automated pre-review (advisory, not a required check) — verdict: PASS · CI green PASS — The projected-read guard keeps the initial usage and serializer projection on the same event-backed source, while preserving bucket reads for current usage. The focused ClickHouse spec covers both the returned units and absence of a bucket fetch. |
## Context Projected usage is not computed with the rest of a fee: the presentation layer calls `Fees::ProjectionService`, which re-aggregates the charge from the events over a window it rebuilds from the fee's persisted properties. A computation serving its units from the pre-aggregated buckets while the projection counts events would render a projection below the usage it projects, which reads as a nonsense number. ## Description A computation asked for projected usage keeps reading events, whatever the caller opted in to. The three projected call sites do not ask for the buckets today, so nothing changes; the refusal makes that a property of the computation rather than of every caller remembering it. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
vincent-pochet
force-pushed
the
fix/usage-projected-off-buckets
branch
from
September 18, 2026 15:31
f07cbb0 to
46222fe
Compare
Contributor
|
Automated pre-review (advisory, not a required check) — verdict: PASS · CI green PASS — The centralized provider guard keeps projected usage and its presentation-time projection on the event source. The regression spec distinguishes bucket data from event data and verifies that projected reads skip the bucket fetch; no affected sibling path is left inconsistent. |
toommz
approved these changes
Sep 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
Part of the realtime usage project.
Projected usage is not computed with the rest of a fee:
Fees::ProjectionServicere-aggregates thecharge from the events at presentation time, over a window it rebuilds from the fee's persisted
properties. A computation serving its units from the pre-aggregated buckets while the projection
counts events renders a projection below the usage it projects.
Description
The three projected call sites do not ask for the buckets today, so nothing changes; the refusal
makes that a property of the computation rather than of every caller remembering it.