Skip to content

ogar-dir-sim: Mail is a label that hydrates the Exchange identity (recipient types + ExchangeGuid + PrimarySmtpAddress) - #332

Merged
AdaWorldAPI merged 2 commits into
mainfrom
ccr-0455e606-wmtsor
Oct 10, 2026
Merged

AdaWorldAPI merged 2 commits into
mainfrom
ccr-0455e606-wmtsor

Conversation

@AdaWorldAPI

@AdaWorldAPI AdaWorldAPI commented Oct 10, 2026 •

Copy link
Copy Markdown
Owner

What

The first commit deprecated AddressRole::Mail. The second commit replaces that with a repurpose; the net diff against main is what's described below.

crates/ogar-dir-sim

  • AddressRole::Mail is not deprecated. It stays the label role and is still never a holder in Violation::AddressConflict. Its doc comment now says what a label is for.
  • exchange::ExchangeIdentity: what Exchange knows an object as, read by its GUID:
    • node: the object's objectGUID;
    • recipient: its recipient types;
    • exchange_guid: its mailbox's ExchangeGuid;
    • primary_smtp: its PrimarySmtpAddress.
  • exchange::MailLabel: where a mail label resolves.
    • Own: the object holds the address itself.
    • Elsewhere { key, holder }: another object holds it; the result carries that holder's identity.
    • Contested { key, holders }: several objects hold it; none is hydrated.
    • Unheld { key }: nobody holds it, so the label is stale.
  • Both types are re-exported from the crate root.
  • The AddressConflict doc fix from the first commit stays.

crates/ogar-ad, schema v6

  • msExchMailboxGuid is stored as a 128-bit id in guid slot 2. It decodes as mixed-endian bytes, like objectGUID, and is never stored as text.
  • exchange_guid(rec) returns AD's 16 bytes for the outbound side.
  • SCHEMA_VERSION is now 6; the attribute table stays append-only.

Why

Deprecation treated "mail is no longer a claim" as "mail carries no information". A mail label still names an address, and the useful question is which object holds that address and what Exchange knows that object as. The label is the trigger for one lookup. Identity stays on GUIDs: the object's objectGUID, and the mailbox's ExchangeGuid, which Exchange Online keeps across a move. The address is a value of the identity, never the key it is looked up by.

Merge order

Merge this first, then the lance-graph PR that consumes it. That PR reads the schema-6 slot and the new types; its Identity CI checks out OGAR main, so it stays red until this is merged. lance-graph main does not use these new items, so merging this alone breaks nothing.

Verified (Rust 1.99.0)

  • OGAR workspace: clippy --workspace --all-targets -D warnings is clean; test --workspace has 1048 passing and 0 failing; fmt --all --check is clean.
  • New test the_exchange_guid_is_an_id_not_a_string:
    • the GUID is stored in its slot, distinct from objectGUID;
    • no pooled string contains its bytes;
    • exchange_guid() returns the same bytes;
    • a value that is not 16 bytes is refused.
  • With the msExchMailboxGuid decode arm removed, that test fails; restored, it passes.

🤖 Generated with Claude Code

https://claude.ai/code/session_01G22yT6htkcdyXsihxxXdrg

`mail` is a display label Exchange does not reserve; only proxyAddresses,
the UPN and a remote mailbox's routing address make an address belong to
an object. lance-graph's validator stopped emitting the Mail role
(lance-graph #1433), so the variant has no producer left. Deprecate it
rather than remove it so existing matches keep compiling, and correct the
AddressConflict doc that still described a `mail` value as a claim.

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

coderabbitai Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

Your organization has reached its usage spending cap. Adjust your spending cap in the billing tab.

Next included review available in 31 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available. Your 65 included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Essentials
  • Run ID: 3f8b458c-cd54-4020-b2b8-847c77c6bb2e

📥 Commits

Reviewing files that changed from the base of the PR and between 2fbae6e and 89991e2.


📒 Files selected for processing (5)
  • crates/ogar-ad/src/lib.rs
  • crates/ogar-ad/tests/main.rs
  • crates/ogar-dir-sim/src/exchange.rs
  • crates/ogar-dir-sim/src/lib.rs
  • crates/ogar-dir-sim/src/violation.rs

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Billing warning: we have not been able to collect payment for this subscription for more than 72 hours. Please update the payment method or pay any pending invoices in Billing to avoid service interruption.


Comment @coderabbitai help to get the list of available commands.

@AdaWorldAPI
AdaWorldAPI marked this pull request as ready for review October 10, 2026 10:31
@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, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

…entity

Deprecating AddressRole::Mail treated "no longer a claim" as "carries no
information". It is still information: a `mail` label names an address,
and the useful question is which object holds that address and what
Exchange knows it as.

- AddressRole::Mail is the label role again, not deprecated. It is still
  never a holder in AddressConflict.
- exchange::ExchangeIdentity: what Exchange knows an object as, read by
  GUID: the recipient types, the mailbox's ExchangeGuid, and its
  PrimarySmtpAddress.
- exchange::MailLabel: where a label resolves. Own (the object holds the
  address itself), Elsewhere (another object holds it; that holder's
  identity), Contested (several holders; none hydrated), Unheld (stale).
- ogar-ad schema v6: msExchMailboxGuid as a 128-bit id in guid slot 2
  (mixed-endian, like objectGUID), with exchange_guid() for the outbound
  bytes. Exchange Online keeps the same value as the mailbox's
  ExchangeGuid across a move.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G22yT6htkcdyXsihxxXdrg
@AdaWorldAPI AdaWorldAPI changed the title ogar-dir-sim: deprecate AddressRole::Mail (no emitter left) ogar-dir-sim: Mail is a label that hydrates the Exchange identity (recipient types + ExchangeGuid + PrimarySmtpAddress) Oct 10, 2026
@AdaWorldAPI
AdaWorldAPI merged commit af8f2fc into main Oct 10, 2026
4 checks passed
AdaWorldAPI pushed a commit that referenced this pull request Oct 10, 2026
MailLabel (from #332) modelled mail as a trigger that resolves to the
address holder's ExchangeIdentity. It does not: mail is a label any
account may carry, it resolves to nothing, and identity is read by GUID
only — the object, then the mailbox's ExchangeGuid once provisioned, and
ExternalDirectoryObjectId across the hybrid join. ExchangeIdentity stays
(read by GUID); MailLabel and its export are removed, and the
AddressRole::Mail doc says so. No consumer used MailLabel (lance-graph
#1444 drops its use in the same step).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G22yT6htkcdyXsihxxXdrg
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