Skip to content

feat(atlas-core): record embedding_model in atlas_manifest, refuse mixed-model fan-out (#7646) - #8326

Merged
dezren39 merged 4 commits into
mainfrom
queue/13749-7646-embedding-model
Nov 10, 2026
Merged

dezren39 merged 4 commits into
mainfrom
queue/13749-7646-embedding-model

Conversation

@dezren39

@dezren39 dezren39 commented Nov 10, 2026 •

Copy link
Copy Markdown
Member

Implements contract points M1/M2 of the #6060 decision record for #7646 (triage: task 13749, lane code-y — gap verified live on main: embedding_model appeared nowhere in pkgs/atlas-search).

  • atlas_manifest gains an embedding_model key: Manifest carries it (Option<String> — an absent key parses as None so the refusal can name the shard), and EMBEDDING_MODEL_ID (snowflake-arctic-embed-m-v2.0, the mandated model via atlas-embed) is the recorded identity.
  • Discovery (probe, beside the existing cosine check, same fatal posture): a shard with a missing embedding_model key or one that differs from the consumer's expected identity (DiscoveryOptions.embedding_model, defaulting to the mandated id) is refused with an error naming the shard and both model identities. In lenient discovery this records as a Rejection, as with the other integrity failures.
  • ShardInfo carries the validated identity; fanout_scan additionally refuses a scanned set that mixes identities — failing loud before any shard is scanned or merged (M1). merge_top_k is unchanged (M3).
  • Existing shards are backfilled by stamping the key with the mandated id (all were produced by atlas-embed); the test fixtures do exactly this, so the existing discovery/fan-out tests exercise the new check unchanged in their assertions.

Tests (oracle: the issue's acceptance): manifest round-trip carries the key; discovery refuses a missing key and a mismatched key with both ids named; uniform-model fan-out is covered by the existing oracle/discovery tests. Full atlas-core suite run on the laptop before merge.


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

@dezren39
dezren39 requested a review from a team as a code owner November 10, 2026 22:26
@coderabbitai

coderabbitai Bot commented Nov 10, 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 27 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: f6efe28c-505e-481e-b6eb-b4b85191a67e
Commits

Reviewing files that changed from the base of the PR and between 1f9c97c and 81946d8.

Files selected for processing: 4

  • pkgs/atlas-search/crates/atlas-core/src/shards/mod.rs
  • pkgs/atlas-search/crates/atlas-core/src/shards/scan.rs
  • pkgs/atlas-search/crates/atlas-core/tests/shards.rs
  • pkgs/atlas-search/crates/atlas-search/tests/cli_parity.rs
  • 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 10, 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-10T22:39:27.496400Z 81946d8 New commits
ℹ️ 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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 623f0b0b4c

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +622 to +625
match &m.embedding_model {
None => {
return Err(Error::fatal(format!(
"shard {}: atlas_manifest has no `embedding_model` key; this consumer embeds with `{expected_embedding_model}` and a shard of unknown embedding provenance must not be scanned",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Stamp the CLI shard fixtures with the required model identity

The CLI parity fixture producer, build_shard_dir in pkgs/atlas-search/crates/atlas-search/tests/cli_parity.rs:430–436, still writes manifests without embedding_model. Consequently, this new mandatory check aborts discovery in both cli_shard_fanout_matches_python_vector_results and cli_shard_fanout_default_never_touches_secret_shard, which assert successful CLI execution. These tests are included in the atlas-search test step in .github/workflows/atlas-search-pr.yml. Update that fixture producer alongside the atlas-core fixtures so the existing CLI tests remain compatible with the new manifest contract.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed before merge — thanks. Commit 81946d882 ("test(atlas-search): stamp embedding_model in cli_parity shard fixtures (#7646 backfill)") stamps ("embedding_model", "snowflake-arctic-embed-m-v2.0") in build_shard_dir, mirroring the atlas-core fixture backfill. Verified on the laptop after that commit: cargo test -p atlas-search — 31 lib + 11 cli_parity tests, 0 failures, including both cli_shard_fanout_matches_python_vector_results and cli_shard_fanout_default_never_touches_secret_shard (they failed exactly as you describe before the stamp, which also end-to-end proved the new refusal fires through the real CLI). PR merged as a9a3748eeb.

@dezren39
dezren39 merged commit a9a3748 into main Nov 10, 2026
1 of 7 checks passed
@dezren39
dezren39 deleted the queue/13749-7646-embedding-model branch November 10, 2026 22:38
@dezren39

Copy link
Copy Markdown
Member Author

Salvage note (lane any-b, task 17236): duplicate PR #8283 diffed against this canonical PR — nothing unique

Per the duplicate-PR protocol, PR #8283 (the earlier branch queue/13749-7646-atlas-embedding-model, head 45a8aab) was compared piece by piece against what landed here (623f0b0, merged 2026-11-10T22:38:37Z) and its follow-ons:

Verdict: nothing unique in #8283 — it is a strict subset of the landed implementation. It is being closed as superseded, with the evidence recorded on #8283. Issue #7646 was already closed COMPLETED by this PR.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant