GeezerVison is showing github.com — impl(atlas): D1 hot-cache schema, binding, and store module for the atlas-search Worker · Issue #13100 · developing-today/code
impl(atlas): D1 hot-cache schema, binding, and store module for the atlas-search Worker #13100DescriptionImplementation follow-on 1 of 6 under #9134 (Atlas D1 tenant hot cache design, doc/2026-11-23T08-06-00Z_design_atlas_d1_tenant_hot_cache/2026-11-23T08-06-00Z_design_atlas_d1_tenant_hot_cache.md, merged via PR #13098).
Scope (§5, §8 item 1 of the design): the D1 schema from the design's storage section, the wrangler D1 binding for the atlas-search Worker (pkgs/atlas-search/worker — it has no D1 binding today), and a cache store module exposing get/put/evict primitives over the hot_cache table, behind a config flag, default off.
Acceptance: schema migration lands; store module round-trips entries for all three classes (A/B/C) in tests against a local D1 (miniflare or equivalent); flag off = zero behavior change on existing read paths. Activitydeveloping-today commented on Nov 23, 2026 dezren39 commented on Nov 23, 2026
Claimed by Lane OL (sandbox fix lane) for implementation: D1 schema migration, wrangler D1 binding, and the hot-cache store module (get/put/evict over hot_cache, flag-gated, default off) per the #9134 design §5/§8 item 1. Working in a laptop worktree off current main. dezren39 commented on Nov 23, 2026
Done — Lane OL. Landed via PR #13141 (merged 9db2efc7ce0, head SHA-guarded at cfe0eabf758).
- Schema:
pkgs/atlas-search/worker/migrations/0001_hot_cache.sql — the design(atlas): D1 tenant hot cache — admission, invalidation, Turso-hop skip #9134 design §5 hot_cache table + eviction index, verbatim; migrations_dir wired in wrangler.toml.
- Binding:
HOT_CACHE D1 binding + HOT_CACHE_ENABLED flag (default "false") in both wrangler.toml and cloudflare.config.ts. The committed database_id is the repo's local-placeholder convention (mirrors pkgs/id/worker-poc/d1-journal-poc); the real atlas-hot-cache database is created at deploy time and its id replaces the placeholder in both files — recorded in the worker README.
- Store module:
src/hot_cache.ts — HotCacheStore with get/put/touch/evict over the shared table (tenant in the key), plus hotCacheEnabled/hotCacheStore gating: flag off or binding absent → no store, pre-cache path unchanged. Env gained only the optional fields; no read path touched.
- Verification:
test/hot_cache.test.ts applies the real migration file to a local miniflare D1 and round-trips entries for all three classes (A/B/C) byte-for-byte, plus tenant isolation, put-replace bookkeeping reset, touch hit-counting, evict semantics, and flag gating — 10/10. Full package suite 41/41 (31 pre-existing + 10 new); npm run typecheck clean.
Next slices stand as filed: #13101 (freshness evaluator), #13103 (admission/eviction), #13105 (read-path integration), #13106 (invalidation), #13107 (measurement).
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|