Skip to content

id-sync: B09 divergence detection and anti-entropy - #11952

Merged
dezren39 merged 1 commit into
mainfrom
b09-anti-entropy
Nov 18, 2026
Merged

dezren39 merged 1 commit into
mainfrom
b09-anti-entropy

Conversation

@dezren39

@dezren39 dezren39 commented Nov 18, 2026 •

Copy link
Copy Markdown
Member

Before: replicas had no way to tell they had drifted apart or to fetch what they were missing. B07 could report a conflict once both versions were present, but nothing carried versions between nodes.

After: a Replica (a B07 store plus the signed envelopes it can resend) summarizes its holdings as one digest per object. Two replicas compare digests, list missing versions only for objects that differ, and reconcile sends each side the envelopes it lacks. The receiver admits every one through B07 and its B32 gate, so two branches meeting on a replica become a conflict report there, and a merge exists only where a writer signed one. Versions outside the link's B08 scope, trust domain or retention are withheld with the B08 reason. A version the receiver refused is recorded and never offered again. A conflicted object never blocks the others.

How: b09_anti_entropy.rs adds Inventory, object_digest (layout documented in the module), divergence, Replica::{produce, receive, inventory, offer}, reconcile and the Exchange/Transfer/Offer results. The model test in tests/federation_b09.rs interleaves writes on four replicas with random pairwise reconciliation. After every step it checks the predicted divergence and offers, that every held version was signed by a writer, that a report is open exactly while an object has two or more heads, and that every merge comes after a report. A final full sync in a random order must reach the reference union and heads on every replica, while a private-scope object never leaves its origin. Explicit tests cover a concurrent edit reported on both sides while another object syncs, a stale version refused once and not re-sent (its child stays held), B08 withholding, and digest equality.

Refs #10262


Generated by Claude Code


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

Replicas summarize what they hold as a per-object inventory digest,
compare digests first and name the missing versions exactly. Each side
then sends the other the original signed envelopes it lacks, checked
against the B08 sync scope, and the receiver admits them through its
B07 conflict store. Reconciliation never creates or merges a version;
refusals are recorded and never re-offered; conflicted objects never
block other objects.

Refs #10262

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dezren39
dezren39 requested a review from a team as a code owner November 18, 2026 22:26
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 18, 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-18T22:33:15.960806Z 7a34fe2 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.

@dezren39
dezren39 merged commit 873bbf3 into main Nov 18, 2026
@dezren39
dezren39 deleted the b09-anti-entropy branch November 18, 2026 22:26
@coderabbitai

coderabbitai Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

Explain Change →

Caution

Review failed

The pull request is closed.

  • 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