Skip to main content

SyncPushBody

Struct SyncPushBody 

Source
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: String

Claimed 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: VectorClock

Vector 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: bool

Preview mode — classify and count, do not write.

Trait Implementations§

Source§

impl<'de> Deserialize<'de> for SyncPushBody

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> ErasedDestructor for T
where T: 'static,