Repository navigation
design(atlas): D1 tenant hot cache — admission, invalidation, Turso-hop skip - #13098
Merged
Merged
Conversation
…op skip Design record for the Atlas D1 tenant hot cache: freshness bound settled first (per-class rules over source watermark + TTL, fail-safe degradation, no serve-stale mode), Turso-hop skip eligibility, evidence-based admission with tenant-tier quotas, three-mechanism invalidation against the Turso source of truth, D1 storage shape and eviction, failure modes, and the measurement counters the storage economics prototype consumes. Open questions recorded with chosen defaults; granular implementation follow-ons listed for filing under the design issue once this lands. Refs: the design issue for the D1 tenant hot cache, the Part C epic, and program #9106 section 2.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 50 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This was referenced Nov 23, 2026
Closed
Closed
dezren39
added a commit
that referenced
this pull request
Nov 23, 2026
…TL rules (#13101) Follow-on 2 of 6 under #9134 (design merged via PR #13098), §1 + §8 item 2: the pure freshness evaluator for the D1 tenant hot cache. - Class A: the content hash is the version — fresh on hash match at any age, watermark state irrelevant; a mismatch is never served. - Class B: fresh iff the entry's source_watermark still equals the tenant's current watermark AND age <= TTL_B (60 s) — whichever fails first; a watermark advance is stale even inside the TTL. - Class C: fresh iff age <= TTL_C (15 min) AND no invalidation event for the tenant post-dates the entry. - Fail-safe degradation: watermark source unreachable -> Class B TTL-only with TTL_B halved (divisor config, floored, clamped so it can never extend), Class C not served, Class A unaffected. Clock skew (future filled_at) is never fresh for the TTL classes. - The tenant watermark read is a thin seam (WatermarkSource) that maps every source failure to 'unavailable'; the evaluator itself is pure — no I/O, no clock reads. - Bounds are named config (TTL_B, TTL_C, degraded divisor) with the design's defaults; invalid overrides fall back to the defaults and can never widen a bound. Oracle (per the issue): property tests over generated (watermark, age, class, event) sequences assert exact agreement with an independent transcription of the §1 table; the stale-serves counter is asserted zero (200 sequences, >1000 evaluations, plus 22 unit tests for the named rules). README Shape gains the module. Verification (sandbox): the worker package's node_modules are not installed in the sandbox, so the committed vitest file was run byte-for-byte under bun test with a vitest->bun:test shim: 23/23 pass, 1398 expect() calls; the package's runtime-independent suites (key, body, space) also pass 15/15 under the same shim; mcp/worker suites need the Cloudflare pool and are untouched. Strict tsc (5.9.3, package-equivalent flags) passes on both new files. CI runs the real vitest pool suite.
This was referenced Nov 23, 2026
dezren39
added a commit
that referenced
this pull request
Nov 23, 2026
…rst (#13107) Follow-on 6 of 6 under #9134 (design §7): the §7 counters surfaced as a report for #9098's economics prototype. Tests pin the accumulator + report renderer through its public record API; the module does not exist yet, so this commit fails by design — the implementation follows. Oracle: design #9134 §7 (merged via PR #13098).
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.
Design record for the Atlas D1 tenant hot cache (issue #9134, parent epic #9109, program #9106 §2 items 4–6, 17).
What this settles
Docs-only; no code or config changes. The design issue stays open until the §8 follow-on issues are filed on merge; its acceptance record will be completed there.
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.