Repository navigation
Enforce state-first telemetry recording transactions - #341
Open
gmemuriuki wants to merge 2 commits into
Open
gmemuriuki wants to merge 2 commits into
gmemuriuki wants to merge 2 commits into
Conversation
gmemuriuki
force-pushed
the
telemetry/recording-transaction
branch
from
October 14, 2026 07:14
ac4f4cb to
9150c22
Compare
gmemuriuki
added this pull request to stack #331
October 14, 2026 07:16
gmemuriuki
force-pushed
the
telemetry/recording-transaction
branch
from
October 14, 2026 07:51
9150c22 to
d8539a6
Compare
nikomatsakis
force-pushed
the
telemetry/recording-transaction
branch
from
October 16, 2026 09:02
d8539a6 to
dc6a328
Compare
gmemuriuki
force-pushed
the
telemetry/recording-transaction
branch
2 times, most recently
from
October 20, 2026 13:26
2a78f34 to
da2b2c5
Compare
Separate private-state validation and serialization from atomic replacement. Pass a bounded prepared value to the locked writer so the recording transaction can finish serialization before changing a file. Keep replacement failures scoped to the atomic write stages and update the storage seam tests for the new boundary.
Stage each accepted recording as one private-state and snapshot unit. Prepare every output before touching storage, then replace private state to mint the only receipt allowed to publish public telemetry. Tie that receipt to the held storage lock. Publish low-volume events before remeasuring and replacing aggregate metrics, while attempting both public writes independently and retaining only bounded failure stages and I/O error kinds. Make skipped publication loud, cover storage-limit and partial-failure boundaries, and document the state-first transaction contract.
gmemuriuki
force-pushed
the
telemetry/recording-transaction
branch
from
October 21, 2026 07:23
da2b2c5 to
7767374
Compare
This branch has not been deployed
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.
What does this PR do?
This PR makes private-state persistence the prerequisite for publishing one telemetry recording. It does not connect recording to production callers yet.
The state layer stages the mutated private state and its aggregate snapshot as one unpublished value. Storage finishes metric, event, and private-state preparation before changing any file, then atomically replaces private state to mint the only lock-bound receipt allowed to publish public telemetry.
Publication gives low-volume events first claim on the remaining daily allowance because they cannot be reconstructed, while the cumulative metric snapshot can recover on a later operation. Event and metric writes are attempted independently, and their outcomes retain only bounded failure stages and I/O error kinds.
Dropping a persisted receipt without attempting publication is loud. Tests cover preparation without writes, private-state failure, event and metric partial failures, storage-marker closure, metric suppression, day mismatches, publication ordering, and receipt behavior during panics and unwinding.
Disclosure questions
AI disclosure.
Questions for reviewers.
Does the staged-value and lock-bound receipt API make publication-before-persistence unrepresentable, and do the partial-failure outcomes preserve the safest recoverable behavior?