Policy rule
One line of a sync policy, a scope, what the peer does about it, with whom, and how often.
Fetching schema…

Part of Stem. This page defines the policy rule struct that makes up a sync policy.

A policy rule says: for this scope, follow, pin, fetch on demand or ignore, exchanging with these peers at this interval.

Fields

field

type

required

meaning

scope

scope

yes

What the rule is about.

mode

one of follow, pin, on-demand, ignore

yes

Follow: reconcile periodically and watch, keep what arrives. Pin: follow and never garbage-collect. On-demand: fetch when a client asks, may be collected. Ignore: never fetch or accept.

peers

list of peer id

no

Peers to exchange with in addition to the space's authority peers.

interval

integer

no

Seconds between reconciliations when not watching.

Rules

Rules are evaluated most specific scope first: a rule on a node beats a rule on its ancestor, and exact beats children beats subtree on the same node. An account's own space is implicitly pin at the root. Joining a space (a contact with join) adds a follow rule by default, which is the roadmap's "subscription derived from what the account has joined and followed". ignore is also what makes Offer refuse a scope. Peers named here are added to, never replace, the authority peers.

Today (HM24)

A subscriptions(iri, is_recursive) row per daemon, invisible to the user and not shared between a user's devices.

Example

{"scope": {"space": {"/": {"bytes": "7QEE...Alex"}}, "depth": "subtree"}, "mode": "follow", "interval": 60}

Do you like what you are reading? Subscribe to receive updates.

Unsubscribe anytime