ic_backup/model/settlement/mod.rs
1//! Passive shared settlement claims; integrations own authentication and attribution.
2
3use crate::model::artifacts::ArtifactChecksumRecord;
4
5/// Original reservation identity and caller-qualified observation evidence.
6/// Equality grants no freshness, authenticated outcome, spending or retry authority.
7#[derive(Clone, Debug)]
8pub struct SettlementContext {
9 /// Full original operation authority and immutable allowance digest.
10 pub authority: ArtifactChecksumRecord,
11 /// Original pending mutation attempt.
12 pub mutation_attempt: u32,
13 /// Separately consumed pending observation attempt.
14 pub observation_attempt: u32,
15 /// Fresh caller-owned qualification challenge.
16 pub challenge: ArtifactChecksumRecord,
17 /// Exact evidence retained with the successful observation.
18 pub observation_evidence: ArtifactChecksumRecord,
19 /// Retained qualification binding every enclosing settlement field.
20 pub evidence: ArtifactChecksumRecord,
21}
22
23/// Independently qualified attribution of one original lifecycle or data-write effect.
24/// The enclosing settlement's method-specific validator retains its own requirements.
25#[derive(Clone, Debug)]
26pub enum EffectAttribution {
27 /// Exclusive original-effect attribution. Loads require exact restored state;
28 /// data writes require original-byte readback and stable destination custody.
29 Applied {
30 /// Excludes preexisting state and independent effects.
31 attribution: ArtifactChecksumRecord,
32 },
33 /// The original effect never applied, including no transient application.
34 NotApplied {
35 /// Independently qualified exclusion; current state alone is insufficient.
36 exclusion: ArtifactChecksumRecord,
37 },
38 /// A settled authenticated observation cannot resolve the original effect.
39 Unresolved {
40 /// Lost or unavailable replies never supply this settled uncertainty.
41 uncertainty: ArtifactChecksumRecord,
42 },
43}