Repository navigation
Keep canonical physics warm across delayed Durable Object alarms - #59
Merged
Merged
Conversation
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.
Problem
Private scheduler requests remained fresh while storage alarms were late. The previous three-minute unattended proof passed, but subsequent quiet windows lost durable progression. An idle object could hibernate between requests and discard its unsaved physical work. Twenty hot snapshot parts also imposed a 130-minute checkpoint cadence, longer than the existing 120-second saved-state freshness requirement.
Change
Keep one autonomous local timer pending and register each asynchronous phase with
ctx.waitUntil. Alarms remain the durable restart mechanism and precommit a successor before recovery. Both drivers coalesce onto one physical/save phase; they cannot queue writers. Only private scheduled requests activate the timer. Genuine incoming requests renew the platform CPU window; stale windows pause work, and saves/cold recovery require encoding headroom. Failed null-world reloads retain fifteen-second backoff and remain wakeable.Stage at most four 1.5 MiB hot parts per atomic transaction, charging their writes plus one shared budget update. Final partial batches flush before publication. Charges survive failed publication, failed batches roll back together, and UTC accounting remains per transaction. Cadence, reservation and reported writes use these costs; twenty hot parts now allow a 96-minute cadence with the same 40k/60k admission limits.
Authority boundary
The existing world, Citizen IDs, private history/provenance, monotonic clock guard, chronological physics, cold-decode challenge and animations are retained. Autonomous verification thresholds are unchanged.
Evidence
bash CHECK.sh . --skip-browser: 464 tests, deterministic Genesis and package manifest pass.Operational impact
No new bindings, migrations or plan upgrade. A warm 128 MB object costs approximately 11,059 GB-s/day before other account usage; Cloudflare Free includes 13,000 GB-s/day. Timer callbacks do not add storage-alarm writes. Existing account request, row, CPU and storage limits still apply; unlimited availability or retention is not promised. Deploy the Worker before Pages. Packed-v2-compatible rollback remains required.
Main deployment must pass its unchanged unattended, canonical-save and Observer continuity gates, followed by a separate ten-minute quiet production proof without extra Observer requests, deployments or diagnostic tail activation.