pub struct SyncPushBody {
pub sender_agent_id: String,
pub sender_clock: VectorClock,
pub memories: Vec<Memory>,
pub deletions: Vec<String>,
pub archives: Vec<String>,
pub restores: Vec<String>,
pub links: Vec<MemoryLink>,
pub pendings: Vec<PendingAction>,
pub pending_decisions: Vec<PendingDecision>,
pub namespace_meta: Vec<NamespaceMetaEntry>,
pub namespace_meta_clears: Vec<String>,
pub dry_run: bool,
}Expand description
Request body for POST /api/v1/sync/push.
Fields§
§sender_agent_id: StringClaimed agent_id of the peer pushing data. Recorded in
sync_state for vector clock advancement. Treated as identity
only (not attestation) — same NHI model as every other write.
sender_clock: VectorClockVector clock the sender had at push time. Foundation accepts it and stores the latest-seen timestamp; full clock reconciliation lands with Task 3a.1.
memories: Vec<Memory>Memories the sender is offering. Applied via the existing
timestamp-aware merge (insert_if_newer).
deletions: Vec<String>Memory IDs the sender has deleted and wants propagated. Applied
via db::delete. v0.6.0.1: simple remove (no tombstone row); a
concurrent newer insert_if_newer from another peer could revive
the row — a Last-Writer-Wins quirk we live with until v0.7’s
CRDT-lite tombstone table lands. In the common 4-node mesh, the
same delete reaches every peer well before any revival window.
archives: Vec<String>v0.6.2 (S29): memory IDs the sender has explicitly archived and
wants propagated. Applied via db::archive_memory — a soft move
from memories to archived_memories. Missing-on-peer IDs no-op.
Distinct from deletions, which is a hard DELETE.
restores: Vec<String>v0.6.2 (S29): memory IDs the sender has restored from archive and
wants propagated. Applied via db::restore_archived — moves the
row from archived_memories back into memories. The inverse of
archives. Missing-on-peer IDs (no row in the peer’s archive
table, or a live row already exists) no-op so replays are safe.
links: Vec<MemoryLink>v0.6.2 (#325): memory links the sender wants propagated. Applied
via db::create_link on each peer. Duplicates are a no-op thanks
to the unique (source_id, target_id, relation) constraint on
memory_links.
pendings: Vec<PendingAction>v0.6.2 (S34): pending-action rows the sender wants propagated.
Applied via db::upsert_pending_action — preserves the originator’s
id + status + approvals so the cluster agrees on pending state.
Without this, POST /api/v1/pending/{id}/approve on a peer 404s
because the row only exists on the originator.
pending_decisions: Vec<PendingDecision>v0.6.2 (S34): pending-action decisions the sender wants propagated
so approve/reject on any node lands consistently. Applied via
db::decide_pending_action — already-decided rows no-op, replay-safe.
namespace_meta: Vec<NamespaceMetaEntry>v0.6.2 (S35): namespace-standard meta rows the sender wants
propagated. Applied via db::set_namespace_standard(conn, ns, standard_id, parent.as_deref()) so the peer’s inheritance-chain
walk uses the originator’s explicit parent (not a locally
auto-detected one).
namespace_meta_clears: Vec<String>v0.6.2 (S35 follow-up): namespaces whose standard the sender has
cleared and wants propagated. Applied via db::clear_namespace_standard
— missing-on-peer namespaces no-op so replays are safe. Without
this, alice clearing a standard on node-1 left the row visible on
node-2’s peer, breaking cross-peer rule-lifecycle assertions.
dry_run: boolPreview mode — classify and count, do not write.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for SyncPushBody
impl<'de> Deserialize<'de> for SyncPushBody
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for SyncPushBody
impl RefUnwindSafe for SyncPushBody
impl Send for SyncPushBody
impl Sync for SyncPushBody
impl Unpin for SyncPushBody
impl UnsafeUnpin for SyncPushBody
impl UnwindSafe for SyncPushBody
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more