GeezerVison is showing github.com — design(atlas): D1 tenant hot cache — admission, invalidation, Turso-hop skip by dezren39 · Pull Request #13098 · developing-today/code
Conversation
dezren39
commented
Nov 23, 2026
•
edited by blacksmith-sh
Bot
Loading
Uh oh!
There was an error while loading. Please reload this page.
Design record for the Atlas D1 tenant hot cache (issue #9134, parent epic #9109, program #9106 §2 items 4–6, 17).
What this settles
- Freshness bound first (per the 2026-11-17 triage note): per-class rules over the entry's source watermark + TTL — Class A content-addressed payloads (hash is the version, no TTL), Class B query result sets (watermark equality or 60s TTL, whichever fails first), Class C tenant aggregates (15 min + invalidation events). Fail-safe degradation narrows the bound when the watermark source is unreachable; there is no serve-stale mode.
- Skip eligibility: a Turso hop is skipped only inside the bound, per read path independently, with every skip logged as the measurement surface.
- Admission: heat-based (2 requests / 10 min) plus immediate admission for heavy queries, tenant-tier quota weights 1:4:16 with a 5% per-tenant floor, 256 KB entry cap, 30 s negative-result TTL.
- Invalidation: watermark advance (lazy, primary), tenant invalidation events piggybacked on ingest completion records (eager, Class C), audited operator purge. Turso stays source of truth.
- Storage shape (one shared D1 DB, tenant in the key), eviction, failure modes, and the counters the bench(atlas): embed-storage economics — vectors+hash+metadata in Turso, raw content content-addressed (feeds #9084) #9098 economics prototype consumes.
- Open questions Q1–Q5 recorded with chosen defaults; six granular implementation follow-ons listed in §8, filed under the design issue once this lands.
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-bot with what you need.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
chatgpt-codex-connector[bot] reacted with thumbs up emoji
…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 reached
You'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.
Check out review usage here.
View limit details
-
Limit details: You’ve used the included review currently available.
Learn how review limits work.
Review configuration:
Run configuration
-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: defaults
- Review profile: CHILL
- Plan: Advanced
- Run ID:
873dba63-0506-40e1-862f-289d767fdbea
Commits
-
Reviewing files that changed from the base of the PR and between f69abc3 and 2cadf4c.
Files selected for processing: 1
-
doc/2026-11-23T08-06-00Z_design_atlas_d1_tenant_hot_cache/2026-11-23T08-06-00Z_design_atlas_d1_tenant_hot_cache.md
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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.
Share
-
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Codex Review Summary: ✅ Completed
This comment shows the latest Codex review activity on this pull request.
| Review |
Status |
Commit |
Review trigger |
| 📝 Code Review |
✅ Completed 2026-11-23T08:10:25.668011Z |
2cadf4c |
PR opened |
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review" or "@codex security review".
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
This was referenced Nov 23, 2026
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).
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
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.
|