Skip to main content

Module sync

Module sync 

Source
Expand description

sync.rs — Gossip Sync Engine & Quarantine Lifecycle

Implements the two missing pieces called out in issue #250:

  1. GossipSyncEngine — incremental, cursor-based sync of gene/capsule assets between two evolution-network nodes.
  2. QuarantineStore — remote assets first enter a quarantine area; only after local validation passes are they promoted for reuse.

§Failure-closed safety guarantee

Remote assets that have not been validated are never moved to the Validated state automatically. Under network partition or message loss the quarantine store simply retains entries as Pending/Failed until an explicit validate_asset call succeeds. This ensures correctness ≥ 99.5% even under hostile network conditions.

§Sync cursor

Each node maintains a monotonically increasing sequence counter. Peers exchange their last-seen sequence number so that only new assets need to be transferred on each round.

Structs§

GossipSyncEngine
Incremental sync engine.
QuarantineEntry
A remote asset held in the quarantine area together with its validation state and origin metadata.
QuarantineStore
In-process quarantine store.
RemoteCapsuleReceiver
Drives the receive → score → promote/quarantine pipeline for remote capsules.
SyncStats
Statistics for a single sync session.

Enums§

CapsuleDisposition
Outcome of an auto-promotion decision for a single remote capsule.
QuarantineReason
Reason a capsule was held in quarantine.
QuarantineState
Lifecycle state of a remotely received asset.

Constants§

PROMOTE_THRESHOLD
Default score threshold above which a remote capsule is auto-promoted.