You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Found by the Atlas book survey (#13251, survey B: Worker/MCP/REST source walk). Disagreements between the atlas-search Worker's README/comments and its code. The book documents the code.
README's cache-key description predates KEY_SCHEMA 2. README "Shape": key = sha256 over normalized query + fingerprint (ceiling, model revision, vector table, k). Code (key.ts): the material also contains "v": 2 and "context": "hosted-per-user" (the disclosure context added by atlas(worker): state the disclosure context on hosted search requests and key the result cache by it #12622 — precisely why KEY_SCHEMA bumped to 2 and all v1 entries were orphaned). A reader building a key from the README computes the wrong digest.
The D1 hot cache reads as flag-gated; in code it is entirely unwired. README: "with the flag off nothing reads or writes the cache" — implying on activates it. Code: HotCacheStore has no caller in the request path (only tests call it); with the flag on and the binding present, the Worker still never touches D1. Read-path integration is impl(atlas): D1 hot-cache read-path integration — Turso-hop skip with skip logging #13105.
wrangler.toml's secret comment scopes the gate to /v1/ only.* "GATE_TOKEN — inbound bearer for /v1/*". Code + the same file's header: the gate also covers POST /mcp.
README credits ceiling enforcement to the service only; the Worker also enforces it. service.ts verifies effective_ceiling === "personal" after every search and refuses (502, before caching) any result reporting a different ceiling. The README's "Shape" section omits the Worker-side check.
README's module map misattributes keying. "src/index.ts — gate, normalization, keying, routing." Keying lives in key.ts (queryKey/keyMaterial), invoked for search from search.ts (executeSearch); index.ts calls queryKey directly only for inspect/purge. Normalization likewise lives in key.ts.
Book chapters: pkgs/atlas-search/book/reference/worker-api.md, mcp.md; concepts/service-and-worker.md.
🤖 Lane XG claiming this issue (2026-11-23) — premise check + fix for the five Atlas Worker README/wrangler comment disagreements against the worker code in pkgs/atlas-search/worker/. Working in a laptop worktree off main; will re-read this thread (count-confirmed) before merging.
wrangler.toml GATE_TOKEN comment now scopes the gate to /v1/* and POST /mcp, matching the file's own header and src/index.ts.
src/service.ts verifies effective_ceiling after every search and throws 502 on mismatch, before caching — README's Shape section now credits the Worker-side check.
Module map corrected: normalization + keying live in key.ts; search keying runs in search.ts (executeSearch); index.ts calls queryKey directly only for inspect/purge.
Verification: worker vitest suite on the laptop at the PR head — 41/41 pass (key, hot_cache, worker suites included; they load wrangler.toml). Change is docs/comment-only. Worktree and branches cleaned up.
Activity
developing-today commentedon Nov 23, 2026
CODE-4844
dezren39 commentedon Nov 23, 2026
🤖 Lane XG claiming this issue (2026-11-23) — premise check + fix for the five Atlas Worker README/wrangler comment disagreements against the worker code in
pkgs/atlas-search/worker/. Working in a laptop worktree off main; will re-read this thread (count-confirmed) before merging.dezren39 commentedon Nov 23, 2026
✅ Lane XG done — all five disagreements fixed in PR #13317, merged at
7e5810283fe(head SHA-guarded atc32d0a318a4); this issue auto-closed on merge.Each point was verified first-hand against the code on main before editing:
src/key.ts:KEY_SCHEMA = 2; material carries"v": 2and"context"(hosted-per-user,src/space.ts) — README now lists both.HotCacheStoreis imported only bytest/hot_cache.test.ts— no request-path caller; README now says the store is unwired and the flag alone does not activate it (read-path integration stays impl(atlas): D1 hot-cache read-path integration — Turso-hop skip with skip logging #13105).wrangler.tomlGATE_TOKEN comment now scopes the gate to /v1/* and POST /mcp, matching the file's own header andsrc/index.ts.src/service.tsverifieseffective_ceilingafter every search and throws 502 on mismatch, before caching — README's Shape section now credits the Worker-side check.key.ts; search keying runs insearch.ts(executeSearch);index.tscallsqueryKeydirectly only for inspect/purge.Verification: worker vitest suite on the laptop at the PR head — 41/41 pass (key, hot_cache, worker suites included; they load wrangler.toml). Change is docs/comment-only. Worktree and branches cleaned up.