Expand description
optimize_attestation side-table — persists the user’s per-disposal contemporaneous-ID
attestations (a projection input, not ledger state). The attested_set accessor feeds the
compliance_overlay as its attested: &BTreeSet<EventId> argument; get returns the stored
attestation text so the overlay can enforce attested-binds-the-exact-selection (R2-I1: a later
divergent pick is NOT covered). Modeled on tax_profile.rs discipline (idempotent DDL, defensive
guard on every accessor, BTreeSet for NFR4 determinism).
Functions§
- all
- Return all stored attestations as a
BTreeMap<EventId, (String, String)>, where each value is(attestation, attested_at), keyed by the disposalEventId(NFR4-stable deterministic order). CREATE-IF-NOT-EXISTS guard first. Mirrorstax_profile::alldiscipline. - attested_
set - Return all attested disposal
EventIds as a sortedBTreeSet(NFR4-stable). Feeds thecompliance_overlayas itsattestedinput. Robust to older vaults. - clear
- Delete the
optimize_attestationrow fordisposal(idempotent — no-op if absent). Called byreconcile voidwhen the voided decision is aLotSelection, so that revocation is COMPLETE: the decision void and the row clear are co-persisted in the samesession.save(). - get
- Return the stored attestation text for
disposal, orNoneif none has been recorded. Robust to older vaults (defensiveinit_tableguard). - init_
table - Create the
optimize_attestationside-table if it does not exist (idempotent). Called bySession::from_fresh_vault; also called at the top of every accessor as a defensive ensure-table-then-read guard (robust to older vaults). - set
- Record a narrow attestation for
disposal(upsert — replaces any prior value).attestationis a caller-supplied opaque string (e.g. JSON-encodedLotSelection) that binds the exact lot picks the user attested;attested_atis an ISO-8601 date string.