Skip to content

atlas-search service: query-embedding + snapshot result caching, --no-cache/--wait/--expand/--raw flags #5668

Open

Description

@dezren39

Implementation of §3 of the Scaler-era data architecture revision (design doc PR #5667, doc/2026-11-04T21-27-34Z_design_atlas_scaler_revision/). Builds on the search service from epic #5350 (esp. #5354 serve mode).

Scope:

  • Query-embedding cache: key sha256(model_id || model_rev || normalized_text), no TTL; service-memory LRU (~10k entries) + shared Turso cache DB in the internal tier; cache writes async/best-effort, never in the request path.
  • Result cache: key sha256(query || snapshot_id || ceiling || flags); reused while the snapshot id (publish manifest hash) is current; 24 h TTL as GC bound only; in-service memory per the Atlas step 4: serve mode — job protocol, worker pool, in-memory temp store #5354 privacy rule (no cross-client result sharing by default).
  • Flags end-to-end (CLI + service protocol): --no-cache (bypass reads, refresh writes), --wait (block for full fused result vs job handle + first page), --expand N (hydrate top N to full chunk/file text from the content store), --raw / --raw=branches (ungrouped rows, pre-fusion option). All flags are part of the cache key.
  • Snapshot id plumbing: aggregator promotion batches bump the snapshot id; the service must observe bumps without restart.

Acceptance: golden-311 parity unchanged with caches cold and warm (eval runs use --no-cache); a repeated identical query against an unchanged snapshot is served from cache with no Turso round-trip for the ranking; a snapshot bump invalidates all result entries at once; PBT over cache-key construction (flag sensitivity, ceiling sensitivity) + MBT for the snapshot-rotation invalidation, per the testing doctrine (every test names its oracle).

Design: #5667 §3. Parent context: hatch-personal#21.

Acceptance criteria

Activity

  1. added
    priority/normalOrdinary priority (the default)
    effort/lLarge: multi-day or open-ended; expect staged check-ins
    source/humanFiled directly by a human
    meta/enrichedIntake review done: acceptance criteria, links, and normalized labels added
    on Nov 4, 2026
  2. dezren39 commented on Nov 4, 2026

    @dezren39
    MemberAuthor

    Intake review

    Intake by fleet monitor (repo-fleet-monitor), 2026-11-04 run.

  3. dezren39 commented on Nov 4, 2026

    @dezren39
    MemberAuthor

    Drew approval recorded (2026-11-04 ~17:10 CST): the shared INTERNAL-tier embedding-cache DB (revision §3.1) is CONFIRMED — "yes, all of these things."

    First instance already created under the TursoDB pilot approval: pilot-tursodb-embedcache (Turso-type DB, group great-star-lord, empty, labeled pilot). The cache/flags work in this issue can target it for the embedding-cache store; the query/result cache design (§3) is unchanged.

  4. added
    queue/queuedHas a queued task in the Supabase agent queue
    task/triageQueue packet kind: verify, reproduce, and route this item
    on Nov 5, 2026
  5. dezren39 commented on Nov 5, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · handed off

  6. added
    work/assignedQueue worker lifecycle state
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    status/parkedDeliberately paused with a recorded resume condition
    and removed
    queue/queuedHas a queued task in the Supabase agent queue
    on Nov 5, 2026
  7. dezren39 commented on Nov 5, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · picked up

  8. added
    queue/claimedQueue worker lifecycle state
    and removed
    status/parkedDeliberately paused with a recorded resume condition
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    on Nov 5, 2026
  9. dezren39 commented on Nov 5, 2026

    @dezren39
    MemberAuthor

    Triage findings — task 10102

    Verified against laptop main at 6a06a926a0a0e1f3a1aac661fa65c5bab2b4aacb (fast-forwarded; no tracked local changes). Issue #5668 remains open. Design PR #5667 is merged; #5669, which supplies the snapshot id used by result caching, remains open. No open implementation PR for #5668 or #5669 was found.

    Packet/design defect requiring a decision: the existing Rust CLI --expand N means “include N neighboring chunks” (pkgs/atlas-search/crates/atlas-search/src/main.rs:197-199; pkgs/atlas-search/crates/atlas-core/src/search.rs:70-71). The merged design §3.3 and this issue instead define --expand N as hydrating the top N results to full chunk/file content. Neither says whether the existing neighbor behavior is preserved under another flag or intentionally removed. Please choose and record the compatibility/migration contract before implementation; this lane will not guess.

    Ordering once clarified: query-embedding caching can proceed independently; result caching must use the current snapshot id from #5669 and retain the #5354 per-service privacy boundary (no cross-client result sharing by default).

    🤖 Agent note · blocked

  10. added
    status/blockedQueue or user escalation state
    queue/blockedQueue or user escalation state
    and removed
    queue/claimedQueue worker lifecycle state
    on Nov 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

effort/lLarge: multi-day or open-ended; expect staged check-inskind/enhancementmeta/enrichedIntake review done: acceptance criteria, links, and normalized labels addedpriority/normalOrdinary priority (the default)queue/blockedQueue or user escalation statesource/humanFiled directly by a humanstatus/blockedQueue or user escalation statetask/triageQueue packet kind: verify, reproduce, and route this itemwork/assignedQueue worker lifecycle state

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions