Expand description
Persistence for the accountability fabric — the on-disk home for the tamper-evident
AccountabilityLedger, the revocable ConsentCredentials, and the durable ConductRecords
(ADR 0011 D2/D4/D5). It turns the tested domain models into something the desktop can actually use.
Design: one small JSON sidecar file (wellfair/accountability.json), loaded/saved whole, matching the
sibling-store convention (personal_profile::EmergencyContactStore). A person’s own accountability set is
small, and whole-file rewrite is the correct shape for a store whose records mutate (a credential is
revoked — the wrapped key destroyed in place — so append-only JSONL would not do).
Every accountability-relevant act is written into the signed hash-chained ledger, not only the
convenience indexes: granting a credential logs a "consent_granted" entry, revoking logs
"consent_revoked", and recording conduct logs a "conduct" entry carrying the record. So the ledger is
the authoritative tamper-evident spine (a betrayer cannot quietly drop the inconvenient act — verify
catches it), and AccountabilityState::credentials / AccountabilityState::conduct are fast views
over it.
Scope: this is tamper-evidence + local durability. Anti-deletion durability across parties (so no one can destroy the only copy) is the commons-replication layer (swarm/WebTorrent; coordinate), and the two compose — replicate this file, and any pruned/rewritten copy is provably tampered. Real envelope encryption of the wrapped key is the vault’s job (deferred); here the wrapped key is carried as opaque bytes, exactly as the model intends.
Structs§
- Accountability
State - The whole persisted accountability set.
- Accountability
Store - On-disk store for the accountability fabric.
- Dead
Mans Switch Record - A persisted dead-man switch together with the party attestations accumulated toward its trigger. The
DeadMansSwitchdomain type carries no attestations (they are passed toenact); the store holds them so the gamified trigger can accumulate across sessions (in the real model, on the friends’ devices).
Constants§
- KIND_
CONDUCT - KIND_
CONSENT_ GRANTED - Ledger record kinds this store writes (the tamper-evident spine’s vocabulary).
- KIND_
CONSENT_ REVOKED - KIND_
DEAD_ MANS_ ALIVE - KIND_
DEAD_ MANS_ ARMED - KIND_
DEAD_ MANS_ ATTESTED - KIND_
DEAD_ MANS_ ENACTED - KIND_
DISCLOSURE - KIND_
INCAPACITY_ ACTIVATED - KIND_
INCAPACITY_ ARMED - KIND_
INCAPACITY_ REVERSED - KIND_
TRANSPARENCY_ CC - STORE_
FILE - Sidecar file, under the same
wellfair/prefix as the other host stores.
Functions§
- parse_
commitment_ hex - Parse a 32-byte hex commitment (helper for the host/command boundary).
Erron wrong length / non-hex.