Skip to content

id-sync: B15 prioritized remote selection - #11963

Merged
dezren39 merged 1 commit into
mainfrom
claude/b15-peer-priority
Nov 18, 2026
Merged

dezren39 merged 1 commit into
mainfrom
claude/b15-peer-priority

Conversation

@dezren39

@dezren39 dezren39 commented Nov 18, 2026 •

Copy link
Copy Markdown
Member

Before: there was no code for choosing which remotes a federated query asks, in what order, or what a remote's "not found" means. Statements S1.47-S1.53 and fan-out design section 3 described it only in prose.

After: the B15 slice turns the configured remote list into a deterministic order and runs the search. Local goes first. Remotes go by priority, then list position. Only peers whose B31 policy is in force and allows querying are asked. Routing advice can push down peers to the end only when the operator passes it. A remote's "not found" means absent at that peer, never globally.

How: plan() gates each entry (no policy, policy not in force, class forbids query, disabled, duplicate) and does a stable sort on (reported down, priority, position). Search enforces local-first, one remote in flight, each peer answering once, result-id dedup towards the limit, and stop on limit, deadline or exhaustion. A remote still in flight at the deadline counts as failed. Outcome names absent_at, failed_at, pending and not_asked peers. The integration test checks the slice against an independent reference model for ordering, skip reasons and search outcomes (proptest, 512 cases each), plus a permutation property for distinct priorities. 21 of 22 mutants are killed; the survivor drops the explicit position tiebreak, which the stable sort already gives.

Refs #10229


Generated by Claude Code


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

Adds the B15 slice: a plan that orders configured remotes by priority
then list position, gated by the B31 peer-class policy (query only
fully_trusted and accept_signed_from peers in force and not disabled),
with opt-in routing advice that only moves down peers to the end. A
search state machine asks the local store first, then one remote at a
time, deduplicates result ids, and stops at the limit, the deadline or
the end of the list. A remote's "not found" is recorded against that
peer only; the outcome never claims global absence.

Refs #10229

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:55
@coderabbitai

coderabbitai Bot commented Nov 18, 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 56 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: 0da1dbfa-6e52-4670-bc62-4412e5ce52ba
Commits

Reviewing files that changed from the base of the PR and between 846daa2 and c7fee51.

Files selected for processing: 2

  • pkgs/id/crates/id-sync/src/federation/slices/b15_peer_priority.rs
  • pkgs/id/crates/id-sync/tests/federation_b15.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

@dezren39
dezren39 merged commit 5958797 into main Nov 18, 2026
@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:57:18.122456Z c7fee51 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 deleted the claude/b15-peer-priority branch November 18, 2026 22:56
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