Skip to content

feat(sync): fetch target chains, verified against their policy - #129

Open
PiquelChips wants to merge 1 commit into
feat/sync-fetch-changesfrom
feat/sync-fetch-chains
Open

PiquelChips wants to merge 1 commit into
feat/sync-fetch-changesfrom
feat/sync-fetch-chains

Conversation

@PiquelChips

Copy link
Copy Markdown
Member

A fetch must bring the targets' chains, and only accept acceptances their authorities signed.

Chains:

  • It follows policy and the targets this node holds or is asked for, from the last acceptance it holds on. The remote's log must go through this node's head.
  • Each acceptance must match its id and target, and follow the one before it.

Verification:

  • Each acceptance is verified against the authority named by the policy that governs it: for policy, the acceptance before it; for any other target, the policy it names.
  • Only a policy on the verified policy chain counts. Acceptances that are merely stored, such as a revision's base, govern nothing.
  • Nothing of a chain is appended unless all of it verifies.

Each acceptance comes with what it landed and the records of the changes that brings, written before the chains that refer to them, then appended with Store::append_all.

Note

Written by Claude Opus 5.5 in Claude Code (via T3 Code)

@coderabbitai

coderabbitai Bot commented Nov 22, 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 34 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: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 0eb1e5ac-0b39-4ee4-8bef-c8f047772195
Commits

Reviewing files that changed from the base of the PR and between 722b874 and 2831876.

Files selected for processing: 2

  • apps/origin-src/src/sync.rs
  • crates/origin-shared/src/object/acceptance.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

@PiquelChips
PiquelChips added this pull request to stack #165 November 22, 2026 14:59
@PiquelChips
PiquelChips force-pushed the feat/sync-fetch-chains branch from da03fed to b6e628b Compare November 22, 2026 15:04
@PiquelChips
PiquelChips force-pushed the feat/sync-fetch-chains branch 2 times, most recently from 76e40fd to 14f416b Compare November 22, 2026 18:54
A fetch brings the chain of each target this node follows, `policy`
always, from the last acceptance it holds on. The remote's log must go
through this node's head, and each acceptance must match its id, belong
to the target, and follow the one before it.

Each acceptance is verified against the key of the authority named by
the policy governing it (`Policy::governing`): for an acceptance of
`policy`, the one before it, and for any other, the policy it names,
which must be on the chain of `policy` as this node verified it. Only the
first acceptance of `policy` is checked against its own. Acceptances
this node merely stores, such as the base of a revision fetched, never
govern anything. The policies' snapshots are fetched as needed. Nothing
of a chain is appended unless all of it verifies.

Each acceptance comes with what it landed and the records of the changes
that brings, written before the chains that refer to them, then appended
with `Store::append_all`. The names of all the remote's targets are
learnt, so acceptances of those this node doesn't follow can be
described.
@PiquelChips
PiquelChips force-pushed the feat/sync-fetch-chains branch from 14f416b to 2831876 Compare November 22, 2026 19:20
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