Skip to content

fleet: fleet serve search — rehome the atlas service as the search serve role (#5604) - #6674

Merged
dezren39 merged 2 commits into
mainfrom
fw/fleet5604-serve-search
Nov 7, 2026
Merged

dezren39 merged 2 commits into
mainfrom
fw/fleet5604-serve-search

Conversation

@dezren39

@dezren39 dezren39 commented Nov 7, 2026 •

Copy link
Copy Markdown
Member

Refs #5604 (does not close it: the live unit flip and the pre-flip gates below are still to do).

What

fleet serve search now runs the Atlas service: the atlas-search bin crate's serve half, rehomed into fleet-search behind a new serve cargo feature.

  • crates/fleet-search/src/server.rs: verbatim copy of atlas-search's server.rs (engine, job manager, HTTP surface). Held byte-for-byte by .github/scripts/check-fleet-search-parity.sh, extended here to cover server.rs with its own pinned headers (contract tests extended too).
  • crates/fleet-search/src/serve.rs: the role glue that atlas-search's main.rs carried. It has the arg surface, the lazy shared embedder (one ONNX session per process, state reported on /health), and the wiring. Its only backend is TursoBackend::new, the read-only token chain. There is no local, explicit-token or --backend path, so the service stays mechanically incapable of production writes.
  • The old lib.rs became cli.rs (client surface, unchanged apart from the serve usage message) behind a client feature.
  • atlas-core / atlas-embed / atlas-proto are untouched and consumed by relative path from pkgs/atlas-search.
  • argv0 and rollback: atlas-search serve through the fleet binary is the same role. The standalone atlas-search artifact still builds, so rollback is a single re-point.
  • Bundled fix: fleet: --no-default-features --features serve (fleet-serve variant) does not compile: fleet-queue queue_broker uses crate::client without the client feature #6656. The fleet-serve variant did not compile on main (queue-broker used fleet-queue's client module without the feature). queue-broker now implies client.
  • pkgs/fleet/default.nix builds from the pkgs/ tree so the path deps resolve. It bakes the onnxruntime closure path for the non-static variants (same mechanism as the atlas-search package).

The unit re-point is prepared in code only

home/common/default.nix: the atlas-search user unit's ExecStart is now fleet serve search, behind atlasSearchServeViaFleet (set false to return to the standalone atlas-search serve). This session did not restart, stop or flip the live atlas user unit. Activation rides the normal deploy path (next home-manager activation). Nothing here touches the running service.

Tests (local runs are the gate; all green)

  • cargo test --workspace in pkgs/fleet: all pass.
    • crates/fleet-search/tests/serve_contract.rs (11): request handling (health, submit/poll/page/delete, 401/400 without touching the backend, ceiling clamping), dedupe keyed by the effective request (counting backend and embedder as oracles; never crosses effective ceilings), per-client recovery listing, read-only-posture invariant, and proptest properties on the arg surface.
    • crates/fleet/tests/search_serve.rs (7) and a unit test for the two spellings (serve search / search serve) through the real binary.
    • The 11 existing atlas-search service tests also run as fleet-search unit tests via the verbatim copy.
  • cargo test -p atlas-search in pkgs/atlas-search: pass.
  • check-fleet-search-parity.test.sh and .sh: pass.
  • cargo test -p fleet under --no-default-features --features serve and --features search: the serve/search-specific tests pass.
  • Pre-existing and unrelated: tests::queue_domain_version_rejects_trailing_arguments fails when fleet is built without the queue feature. It does not touch this PR's code and is not a gate.
  • nix build .#fleet-serve succeeds. Smoke run of the built binary on loopback with the live read-only token chain: /health, an FTS job, and a hybrid job (cold embedder, then ready) all complete.
  • smoke.sh has new assertions for the role. I did not run the full smoke.sh.

Not done / gates before the flip (per #5604)

developing-today[bot] added 2 commits November 6, 2026 19:27
…rve role (#5604)

fleet-search gains a serve feature: server.rs (parity-guarded verbatim
copy of atlas-search's service) plus serve.rs glue (arg surface, lazy
shared embedder, read-only Turso backend). atlas-core/embed/proto are
consumed by path, untouched. 'atlas-search serve' through the fleet
argv0 route is the same role. default.nix builds from the pkgs/ tree
and bakes the onnxruntime closure path; the atlas user unit ExecStart
is prepared as 'fleet serve search' behind atlasSearchServeViaFleet
(one-flag rollback to the standalone). Also: queue-broker implies
fleet-queue/client so the fleet-serve variant compiles (#6656).
…rve role (#5604)

fleet-search gains a serve feature: server.rs (parity-guarded verbatim
copy of atlas-search's service) plus serve.rs glue (arg surface, lazy
shared embedder, read-only Turso backend). atlas-core/embed/proto are
consumed by path, untouched. 'atlas-search serve' through the fleet
argv0 route is the same role. default.nix builds from the pkgs/ tree
and bakes the onnxruntime closure path; the atlas user unit ExecStart
is prepared as 'fleet serve search' behind atlasSearchServeViaFleet
(one-flag rollback to the standalone). Also: queue-broker implies
fleet-queue/client so the fleet-serve variant compiles (#6656).
@dezren39
dezren39 requested a review from a team as a code owner November 7, 2026 01:40
@coderabbitai

coderabbitai Bot commented Nov 7, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You'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 58 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 6012255b-b810-46cb-9046-a59c792ed4c1
Commits

Reviewing files that changed from the base of the PR and between 207e612 and 92c8fe2.

Files ignored due to path filters: 1

  • pkgs/fleet/Cargo.lock is excluded by !**/*.lock
Files selected for processing: 19

  • .github/ci-policy.md
  • .github/scripts/check-fleet-search-parity.sh
  • .github/scripts/check-fleet-search-parity.test.sh
  • home/common/default.nix
  • pkgs/atlas-search/crates/atlas-search/src/server.rs
  • pkgs/fleet/Cargo.toml
  • pkgs/fleet/README.md
  • pkgs/fleet/crates/fleet-queue/Cargo.toml
  • pkgs/fleet/crates/fleet-search/Cargo.toml
  • pkgs/fleet/crates/fleet-search/src/cli.rs
  • pkgs/fleet/crates/fleet-search/src/lib.rs
  • pkgs/fleet/crates/fleet-search/src/serve.rs
  • pkgs/fleet/crates/fleet-search/src/server.rs
  • pkgs/fleet/crates/fleet-search/tests/serve_contract.rs
  • pkgs/fleet/crates/fleet/Cargo.toml
  • pkgs/fleet/crates/fleet/src/main.rs
  • pkgs/fleet/crates/fleet/tests/search_serve.rs
  • pkgs/fleet/default.nix
  • pkgs/fleet/smoke.sh
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-07T01:43:24.584533Z 92c8fe2 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant