Expand description
First-class peer-agreement store — the terms of a relationship between parties.
This is P1 of docs/plans/rights-aware-peer-agreement-addressbook.md, the counterpart to the
directory.rs addressbook (P0). Where the directory hosts the Parties (the addressbook, joined by
pairwise DID) this module hosts the Agreements that govern each relationship.
An Agreement is the recorded terms of a relationship between parties, grounded in
values-credentials (Agreement::values_anchors) — e.g. UDHR articles — rather than asserted from
nowhere. Each term is an Undertaking (a right, obligation, prohibition, or permission) that may cite
the values-credential it derives from (Undertaking::source). Formation is staged
(FormationStage) and each party records its own ConsentState — the agreement is only fully
consented once every party has ConsentState::Granted (see all_granted).
Following the crate’s store conventions (directory.rs, social_peers.rs), the pure list/consent
helpers (set_consent, all_granted) carry the logic and are unit-tested in isolation, while the
*_agreement(s) functions layer a thin pretty-JSON persistence step on top (a Vec<Agreement> at
app_meta_dir()/agreements.json).
Structs§
- Agreement
- The recorded terms of a relationship between parties, grounded in values-credentials.
- Party
Consent - One party’s consent record within an agreement.
- Undertaking
- One term of an agreement: a right, obligation, prohibition, or permission, optionally grounded in a values-credential.
Enums§
- Consent
State - A party’s consent to an agreement.
- Formation
Stage - Where an agreement is in its formation lifecycle.
- Undertaking
Kind - The deontic character of a single term within an agreement.
Functions§
- agreements_
for - Every agreement involving
did— as a party (Agreement::parties) OR as the relationship the agreement governs (Agreement::relationship_did). - all_
granted - Is every party consented?
- list_
agreements - Load every stored agreement. Returns
vec![]if the store file is absent or unreadable. - set_
consent - Set party
did’s consent tostate, in place. - upsert_
agreement - Insert-or-update
a(keyed byAgreement::id), then persist the store.