GeezerVison is showing github.com — Atlas search Worker cache: eviction & invalidation policy (follow-up to #6788) · Issue #6805 · developing-today/code
Atlas search Worker cache: eviction & invalidation policy (follow-up to #6788) #6805Labels effort/mMedium: expected under 1 day of workepic/atlas-programReprioritization program epic (2026-11-12)kind/designA design proposal (design-architect): multi-step, phased, decision-bearingmeta/enrichedIntake review done: acceptance criteria, links, and normalized labels addedpriority/lowNice to have; do when convenienttask/triageQueue packet kind: verify, reproduce, and route this item DescriptionPart of the Atlas family (#5755); follows #6788 (the per-query Durable Object search cache Worker, shipped with indefinite retention — no TTL, no eviction — per Drew's explicit order for v1).
Indefinite retention is the v1 contract, not an oversight. Before it becomes load-bearing at scale, the eviction policy needs a design pass. Nothing here is urgent; this issue exists so the questions are on the record rather than discovered later.
Questions to settle
- Corpus invalidation. The cache key pins the embedding space (model revision + vector table) and ceiling, so a re-embedding of the corpus (new model/table) naturally orphans old entries — they simply stop being keyed. But a re-ingest under the same space (chunk content changes, shards added/renamed) leaves stale results served forever. Is that acceptable for a personal-corpus search surface, or do we need a corpus-generation component in the key (e.g. a registry epoch the service reports), accepting that a generation bump cold-starts the whole cache?
- Growth bound. Entries hold an embedding (~12 KB JSON) + result envelope (observed ~17 KB at k=3; larger at k=50). At personal query volumes this is small for a long time; still, is there a count/size ceiling after which LRU-by-
searched_at/hit_count eviction (both already recorded per entry) should engage?
- Manual purge. A gated purge route (per-key delete; maybe per-prefix) is cheap to add to the Worker — worth having from the start of any policy, if only for "this result is wrong, drop it" operations.
- Interaction with fan-out cost. A hit is ~free; a miss costs a full fan-out (~9 s observed). Eviction policy is therefore also a latency policy: aggressive eviction re-pays fan-outs.
Non-goals
- No TTL by default — Drew's order stands until he changes it.
- No cross-ceiling or cross-space serving — the keying already forbids it; eviction design must not weaken that.
Defaults until ruled: retention stays indefinite; stale-after-re-ingest is accepted; purge is manual via DO storage tooling if ever needed.
Acceptance criteria
- Each numbered question in the issue body has a recorded decision (in a comment or a linked design note), including the corpus-generation/key question and the growth-bound question
- If a policy is adopted, a follow-up implementation issue is filed and linked; if the decision is to accept indefinite retention as-is, that is recorded explicitly with the scale trigger that reopens it
Activityadded kind/designA design proposal (design-architect): multi-step, phased, decision-bearing effort/mMedium: expected under 1 day of work meta/enrichedIntake review done: acceptance criteria, links, and normalized labels added on Nov 7, 2026dezren39 commented on Nov 7, 2026 Intake review
Related: issue #6788 (the cache Worker this follows up), issue #5755 (Atlas family parent). Notes: the issue states indefinite retention is Drew's explicit v1 order — this is a design-pass tracker, not a defect, and the priority is low by the filer's own framing. Risks: a corpus-generation key component cold-starts the whole cache; that trade belongs in the decision record. Suggested approach: settle the questions in one design note and link it, rather than implementing piecemeal.
— Fleet monitor intake (repo-fleet-monitor, 2026-11-07 run): acceptance criteria appended to the issue body, labels normalized (kind/design, priority/low, effort/m, status/needs-triage, meta/enriched), marked meta/enriched. No merged PR or commit was found this run that explicitly resolves this issue, so it stays open. dezren39 commented on Nov 8, 2026 🤖 Agent note · handed off
- Agent: queue worker (repo-worker-code), lane L shift
- Session / ID: task 11264
- Found via: queue claim
- Task: Triage of issue Atlas search Worker cache: eviction & invalidation policy (follow-up to #6788) #6805 assigned by the queue to the opencode execution lane (assigned_lane=opencode). Handed off to the laptop opencode claimant, which launches a bound session to drive task 11264 to its terminal state.
- Expectation: claimant launches the bound opencode session; this lane does not work the task directly.
dezren39 commented on Nov 8, 2026 🤖 Agent note · handed off
dezren39 commented on Nov 17, 2026 🤖 Agent note · triaged (existing decision record stands)
- Agent: queue worker (repo-worker-code), lane any-i
- Session / ID: task 18505
- Found via: queue claim (triage, bulk intake 2026-11-16)
- Verdict: Already triaged with a full decision record by task 14163 (2026-11-10, comment on this issue): Q1 stale-after-re-ingest accepted with a named trigger and the registry-epoch mechanism chosen; Q2 no eviction in v1 (Drew's no-TTL order) with a 10,000-query / 1 GB scale trigger; Q3 manual purge adopted, filed as feat(atlas-worker): gated per-key purge route for the search cache (from #6805 policy) #8312; Q4 policy is ceiling-triggered, never time-based. Per runbook §1c this packet completes as triaged naming that record.
- Fresh check (2026-11-17): feat(atlas-worker): gated per-key purge route for the search cache (from #6805 policy) #8312 (gated per-key purge route) is still OPEN — it is the one adopted implementation piece, and this issue stays open as the policy record until it lands. No duplicate follow-on.
dezren39 commented on Nov 17, 2026 🤖 Agent note · triaged — naming the existing decision record (task 14163)
- Agent: queue worker (repo-worker-code), lane any-i
- Session / ID: task 20003
- Found via: queue claim (small_fix follow-on from triage task 18505)
Fresh verification (2026-11-17):
dezren39 commented on Nov 24, 2026 🤖 Agent note · closing as resolved in substance (second pass verification)
Close evidence (verified fresh 2026-11-24)
Acceptance criterion 1 — recorded decision per numbered question: the task-14163 decision record (2026-11-10, on this issue) answers all four: Q1 stale-after-re-ingest accepted with registry-epoch mechanism chosen and a named trigger; Q2 no eviction in v1 per Drew's no-TTL order with a 10,000-query / 1 GB scale trigger; Q3 manual purge adopted; Q4 policy ceiling-triggered, never time-based.
Acceptance criterion 2 — adopted policy has a landed implementation: follow-up #8312 (gated per-key purge route) is CLOSED as done; PR #12393 merged (commit 79c038f; npm test 22/22, typecheck clean). Per-prefix purge was explicitly declined (SHA-256 key structure) and documented in the Worker README with the deferred #6805 triggers restated.
Remaining items are future scale triggers (first same-space re-ingest changing >5% of chunks / stale-result complaint; 10k queries / 1 GB cache), not actionable work — they are recorded here and in the Worker README, and will surface as new issues if ever hit. Prior passes held this issue open only pending #8312; that condition is now met, so this issue closes. dezren39 commented on Nov 24, 2026 dezren39 commented on Nov 24, 2026
Claimed by Felix lane (worker felix) for the done-check and, if outstanding, implementation of the Atlas search Worker cache eviction & invalidation policy. Starting with a full read of #6805 and #6788 plus an inspection of the Atlas search Worker code on main. dezren39 commented on Nov 24, 2026
Done-check (Felix lane, 2026-11-24): already done — no implementation outstanding
This lane was drawn to implement the cache eviction/invalidation policy; the mandatory done-check finds the work complete and this issue already CLOSED (2026-11-24, task 21889 close pass). Verified fresh against main (a51dd90e6):
Acceptance 1 — recorded decision per question: satisfied by the task-14163 decision record on this issue (2026-11-10), summarized in the 2026-11-24 close evidence: Q1 stale-after-re-ingest accepted, registry-epoch mechanism chosen with a named trigger; Q2 no eviction in v1 per the no-TTL order, scale trigger 10,000 queries / 1 GB; Q3 manual purge adopted; Q4 policy ceiling-triggered, never time-based.
Acceptance 2 — adopted policy implemented via linked follow-up: #8312 (gated per-key purge route) is CLOSED; PR #12393 "feat(atlas-worker): add gated per-key cache purge" MERGED 2026-11-22 (commit 79c038f0bdbb251a56ed8a63b0948b4d3d06e3fc; PR-time record: npm test 22/22, typecheck clean).
Code on main today (pkgs/atlas-search/worker/):
src/index.ts:124 — gated POST /v1/cache/purge route; src/cache_do.ts:88 — DO-side /purge handler returning {purged: existed}.
test/worker.test.ts:165 — "gated per-key purge makes the next search re-run embedding and fan-out" test present.
README.md — documents indefinite retention in v1 (no TTL/eviction), per-prefix purge explicitly declined (query key is a SHA-256 digest), and a "Deferred cache policy triggers (Atlas search Worker cache: eviction & invalidation policy (follow-up to #6788) #6805)" section restating both reopen triggers (>5% same-space re-ingest or stale-result complaint → corpus generation in key; 10,000 cached queries / 1 GB → LRU sweeper).
No worktree or PR from this lane; nothing to implement. Remaining items are the recorded future scale triggers, which reopen as new issues if ever hit. Claim released.
MetadataMetadataeffort/mMedium: expected under 1 day of workepic/atlas-programReprioritization program epic (2026-11-12)kind/designA design proposal (design-architect): multi-step, phased, decision-bearingmeta/enrichedIntake review done: acceptance criteria, links, and normalized labels addedpriority/lowNice to have; do when convenienttask/triageQueue packet kind: verify, reproduce, and route this item DevelopmentNo branches or pull requestsIssue actions
|