Skip to main content

Module sync_grant

Module sync_grant 

Source
Expand description

A site grant (“Always on this site” for an entry) as a sync record (docs/specs/SPEC_VAULT_SHARED_ACROSS_MACHINES_LAN_AND_CLOUD_2026_11_01.md section 6.6). Grants to an agent (signin:<agent>, a command’s first-use grant) name an agent of one machine and never sync: this module has no way to build a record from one, and the capture writes only a grant whose key is a site.

A grant holds no value, and two machines that make the same grant make the same record, so a grant has no keep-both: the later version, a grant or its revoking, is the one every machine follows.

Structs§

GrantBody
A site grant as a sync record carries it, sealed: which entry and which site stay out of the clear header.

Functions§

is_record_id
Whether id has the shape of a grant’s record id (record_id): g- and 32 lowercase hex characters.
merge
What to do with a grant or a revoke that arrives, given the current version this machine holds of that record: the later version wins, and a version this machine has had changes nothing.
record_id
A grant’s record id: g- and 32 hex characters of a hash over the entry and the site, so the id says neither and is the same on every machine for the same grant. Revoking is a tombstone of this id.