Persist only changed emulator state and roll up Autumn usage - #33
Merged
Merged
Conversation
RhysSullivan
force-pushed
the
autumn/skip-idle-persist
branch
from
September 24, 2026 19:19
c2a641d to
ccc7c71
Compare
RhysSullivan
added this pull request to stack #35
September 24, 2026 19:20
RhysSullivan
marked this pull request as ready for review
September 25, 2026 04:21
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.
Staging billing admission was slow on the shared emulator (UsefulSoftwareCo/executor-next#676).
persist()rewrote the whole store snapshot and up to 1,000 ledger entries, then listed every prefix to delete leftovers. It now keeps the JSON last written for each key, writes only keys that changed, and deletes only keys that went away. A read-only POST such ascustomers.get_or_createwrites its ledger entry and the ledger index only. A rejected write writes nothing. The recorded values are read from storage once per live instance; direct writes (seed, legacy migration) and failed writes reset the record.checkwithsend_eventadded an event, and balances scanned all events. Once a customer has more than 64 events for a feature, adjacent events are merged into one. Events that a subscription's usage watermark or a current reset window separates are never merged, so every balance stays the same. Balance reads now use the customer index instead of scanning every event.events.listreturns the rolled-up events (documented in the Autumn skill).Tests are in #34.
Not deployed. The shared emulator needs a separate approval to merge and redeploy.