Skip to content

feat(atlas): aggregator embed-at-promotion — staged unit to core scan shard (#1518, #5669) - #10832

Merged
dezren39 merged 1 commit into
mainfrom
queue/17164-1518-promotion
Nov 16, 2026
Merged

dezren39 merged 1 commit into
mainfrom
queue/17164-1518-promotion

Conversation

@dezren39

@dezren39 dezren39 commented Nov 16, 2026 •

Copy link
Copy Markdown
Member

What

The staging aggregator's embed-at-promotion step (#5669 aggregator slice; the sequenced remainder of #1518 after the definition in #10350 and the item writer in #10788):

  • atlas_core::aggregate::embed_unit_into_shard — reads one staging unit's items + chunks_raw, embeds every chunk document-side with the mandated model, writes one new local core scan shard (atlas-core-<tier>-<topic>-<nn>.db with the exact chunks / vec-table / atlas_manifest schema shard discovery and the fan-out scan already read), stamps the unit DB's atlas_manifest embedding_model, and promotes the unit through Registry::promote — whose M6 gate (atlas: embed pipeline and staging promotion assert the mandated embedding model (#6060 M6) #7648, now closed) re-reads the stamp. No new read path: promoted entries are searchable by the existing fan-out.
  • DocEmbedder (embed.rs) — the document-side twin of QueryEmbedder: prompt-free, stored as produced, per the corpus contract in embed.rs's module docs. AtlasEmbedder::embed_doc_raw + FixedDocEmbedder included.
  • atlas-stage promote CLI verb — production wiring: builds the real embedder with the same model/ORT resolution as the atlas-search binary (ATLAS_MODEL_DIR / ATLAS_ORT_LIB, state-dir / HF-cache snapshots), loud failure when absent.
  • Chunk sensitivity is written in the scan vocabulary via the tier mapping (shareable/personal/secret-bearing, the inverse of TierCeiling::from_sensitivity), so an internal unit's chunks are admitted under the default personal ceiling.

Failure shape: embed/write failures before the stamp remove any partial shard and leave the unit open; the stamp closes the staging DB to further stage_artifact writes (exact v1 table-set check), matching merge-on-close.

Tests

  • New oracle suite crates/atlas-core/tests/aggregate.rs (3 tests): promotion of a staged unit (DNS config + prose) into a shard that open_from_spec("dir:…") discovers and fanout_scan ranks correctly (DNS chunk first for a DNS-shaped query); the registry gate refuses before the aggregator runs; empty-unit and second-run refusals; tier→sensitivity mapping.
  • cargo test -p atlas-core -p atlas-search: all green (126 lib tests + every integration suite, incl. the 3 new ones). cargo fmt applied to the touched files only.
  • Clippy via the shared broker target dir fails with a pre-existing rustc-version mismatch in cached crates (E0514 on serde/serde_json/sha2) — environment artifact, not this change; CI for this workspace is tests-only.

Remaining on #1518 (recorded, sequenced)

Live promotion run against the real model + retrieval proof on #1518, shard-size benchmarks, and closing/linking #2469 — landing in the same task 17164 shift as follow-on steps after this PR merges (promotion needs the merged verb).

Refs #1518, #5669. Part of task 17164.


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 16, 2026 16:49
@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

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

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-16T16:49:43.101101Z
We couldn’t complete this review. Comment @codex review to try again.
cf9368e 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.

@coderabbitai

coderabbitai Bot commented Nov 16, 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 38 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: 68eccfca-b8ed-48f7-9898-b2dc2b7efe6f
Commits

Reviewing files that changed from the base of the PR and between 86ebce1 and cf9368e.

Files selected for processing: 5

  • pkgs/atlas-search/crates/atlas-core/src/aggregate.rs
  • pkgs/atlas-search/crates/atlas-core/src/embed.rs
  • pkgs/atlas-search/crates/atlas-core/src/lib.rs
  • pkgs/atlas-search/crates/atlas-core/tests/aggregate.rs
  • pkgs/atlas-search/crates/atlas-search/src/bin/atlas-stage.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

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

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