Repository navigation
Atlas step 4: serve mode — job protocol, temp store, dedupe cache (#5354) - #5392
Merged
Merged
Conversation
… dedupe cache (#5354) New atlas-proto crate carries the wire types shared by server and CLI client: search/job/page/error/health shapes, the per-client recovery list, and the sensitivity ladder used by the server-side clamp. Serve mode (new server.rs, ~2,300 lines with tests): loopback HTTP+JSON on the design endpoints (one-shot, jobs, status, results paging, job-scoped chunk, delete, health, recovery list). One shared embedder behind a load-state handle; Turso backend with a read-only token only. Branches run concurrently through a new atlas-core BranchPoolExecutor seam (run_search_with_executor; standalone semantics unchanged) — hybrid jobs fan out, single-branch jobs (the primary laptop-local unfiltered vector/index path) execute inline under a one-slot reservation. Jobs: a bounded strict-FIFO execution queue sits in front of the <=4 concurrent branch executions (per-client caps 2 running + 8 queued, global queue cap 8); overflow is 429 + Retry-After with queue depth. Accepted queued jobs never expire in the queue; the stored ranking TTL (10 min) runs from completion (60 min hard cap retained as the pre-completion bound). Temp store is in-memory only — a restart fails every job expired-or-unknown, and no result data is ever written to disk. Dedupe cache (Drew's ruling, 2026-11-04): execution is shared by effective request. The cache key is the post-clamp request — query, mode, k, pool, grouping/expand/message flags, model, embedder, trunc, vector backend, the full filter tuple, and the EFFECTIVE ceiling. In-flight coalescing attaches identical submits to a queued/running computation; completed hits within TTL return the ready ranking. Every submitter still gets its own job id + capability handle; failed computations are evicted so later submits retry. Auth: per-client bearer tokens from a 0600 service.json (generated by the new init verb with the v1 client table: drew-cli secret-bearing; openchamber, fork-server, sandbox-scripts personal); requests clamp to the token cap and the effective ceiling is recorded on the job. Job-scoped reads accept the owning client token or the per-job capability token only; get-chunk under a job returns the missing-chunk shape for anything above the job ceiling. The recovery list (GET /v1/search/jobs) returns the caller's own jobs, metadata only. CLI: --via-service now runs the real protocol (submit -> poll -> page) behind step 3's untouched loud-fallback contract; get-chunk keeps the loud fallback (chunk reads are job-scoped in the protocol). Verification: workspace tests green (43 passed, Gate A ignored as a ceremony test), clippy 0 warnings, fmt clean. Protocol tests cover paging without re-execution, ceiling/capability on every path, TTL-from-completion with queue wait > TTL, bounded FIFO + overflow 429, index modes as single-branch jobs, the recovery list, and all four dedupe gates. Live E2E against production (read-only, worktree server on a scratch port/config): 15/15 — hybrid/scan parity x4, index-fixed + index-fill unfiltered parity, dedupe 6s -> 0.00s, recovery list + pickup, 3-parallel queueing, warm health; fallback gate (warning + note + standalone-identical) and restart gate (404 expired-or-unknown, zero result files on disk) also pass.
|
Warning Review limit reachedYou'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 41 minutes. View limit details
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. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This was referenced Nov 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Implements epic #5350 step 4 per the approved design (doc/2026-11-04T08-07-13Z_design_atlas_binary_service §2-§3) plus Drew's two in-flight rulings: the bounded async queue with TTL-from-completion, the per-client job recovery list, and the dedupe cache keyed by the effective (post-clamp) request.
Full detail is in the commit message. Highlights:
BranchPoolExecutorseam (standalone semantics untouched); single-branch vector/index jobs — the primary laptop-local unfiltered path — execute inline under a one-slot reservation.initverb (v1 table: drew-cli secret-bearing cap; openchamber/fork-server/sandbox-scripts personal); job reads via owner client token or per-job capability token; job-scoped get-chunk ceiling-checked with the missing-chunk shape.--via-serviceruns the real submit→poll→page protocol behind step 3's unchanged loud-fallback contract.Gates: workspace tests green (43 passed), clippy 0, fmt clean; protocol tests for paging/no-reexecution, ceilings on every path, TTL-from-completion, FIFO overflow, index modes, recovery list, and all four dedupe cases; live production E2E 15/15 + fallback + restart gates (details on #5354).
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.