Skip to content

dir-core: keep the fold's sole Entra→EXO row ordinal in Output - #371

Draft
AdaWorldAPI wants to merge 2 commits into
mainfrom
ccr-fd2682ed-sai06j
Draft

AdaWorldAPI wants to merge 2 commits into
mainfrom
ccr-fd2682ed-sai06j

Conversation

@AdaWorldAPI

Copy link
Copy Markdown
Owner

Summary

fold's cloud merge already decides, per Entra row, whether exactly one Exchange Online row names it. It then threw the row away, and Ruler::from_fold re-ran the same merge to recover it.

This PR keeps the row in Output::entra_mailbox: the EXO row ordinal, or NO_ROW when no row or several rows name the Entra id. A choice is never made. Ruler::from_fold now reads that field instead of merging a second time. The ix parameter is unused now; it stays in the signature (as _ix) so callers keep compiling.

Why: a consumer that binds a hybrid AD→Entra→EXO coordinate (lance-graph's ordinal-chain lab, follow-up to lance-graph #1962) used to need its own Entra→EXO lookup. That lookup was a second correspondence engine, and it goes away.

Behaviour change

None for existing fields. Output gains one public field. No code in OGAR or lance-graph builds Output with a struct literal (checked by grep), so nothing breaks.

Validation

  • ogar-az --test correspond: 18/18. run_encoded now compares entra_mailbox against a scalar linear scan on every fixture, including the randomized one.
  • Pinned cases: one mailbox → [0], two mailboxes → [NO_ROW], and a new mailbox_ordinal_does_not_cross_tenants (same external id in two bound tenants → [1, 0]).
  • Disable run: replacing sole(x) with a first match makes exchange_online_dangling_and_duplicate fail. The randomized fixture does not generate duplicate mailboxes, so the targeted test is the one that catches this.
  • cargo clippy -p ogar-dir-core -p ogar-az --all-targets -- -D warnings: clean. fmt: clean. ogar-dir-core and ogar-az suites: all green.

Merge this before the paired lance-graph PR, whose CI checks out OGAR main.


Generated by Claude Code

fold's cloud merge already decides, per Entra row, whether exactly one
Exchange Online row names it, then discarded the row. Output now keeps it
as entra_mailbox (NO_ROW for none or several), and Ruler::from_fold reads
it instead of running a second merge. Consumers binding a hybrid
AD->Entra->EXO coordinate no longer need their own Entra->EXO lookup.

The ogar-az suite checks the field against a scalar scan on every fixture,
including the randomized one, and pins the duplicate and cross-tenant cases.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XAqKMMJzKZrYnckXRC8x2U
@coderabbitai

coderabbitai Bot commented Nov 5, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • 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

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.

2 participants