ic_backup/model/ic_observation/settlement/mod.rs
1//! Passive attribution for one original stop/start/load effect.
2
3use crate::model::artifacts::ArtifactChecksumRecord;
4
5/// Independently qualified original lifecycle outcome; status alone supplies no claim.
6#[derive(Clone, Debug)]
7pub enum IcLifecycleAttribution {
8 /// Exclusive attribution to the original stop/start/load request.
9 Applied {
10 /// Excludes preexisting state and independent effects. For load, qualifies
11 /// the exact original snapshot state, not merely status or module hash.
12 attribution: ArtifactChecksumRecord,
13 },
14 /// The original mutation never applied, including no transient application.
15 NotApplied {
16 /// Qualified exclusion; later opposite lifecycle state is insufficient.
17 exclusion: ArtifactChecksumRecord,
18 },
19 /// An actually settled authenticated status observation cannot resolve the mutation.
20 Unresolved {
21 /// Settled uncertainty; lost, unavailable or malformed replies stay pending.
22 uncertainty: ArtifactChecksumRecord,
23 },
24}
25
26/// Passive claims for an already reserved exact successful lifecycle observation.
27///
28/// Integrations authenticate the actual context/target, qualify chronology,
29/// permissions, challenge freshness, command custody and original attribution.
30/// Evidence binds every field. No serializable proof flag or spending owner exists.
31#[derive(Clone, Debug)]
32pub struct IcLifecycleSettlement {
33 /// Complete original plan/operation/immutable allowance digest.
34 pub authority: ArtifactChecksumRecord,
35 /// Exact original pending mutation attempt.
36 pub mutation_attempt: u32,
37 /// Exact already consumed pending status observation attempt.
38 pub observation_attempt: u32,
39 /// Current caller-owned qualification challenge, never a spending allowance.
40 pub challenge: ArtifactChecksumRecord,
41 /// Existing lifecycle digest of exact status request and raw reply bytes.
42 pub status: ArtifactChecksumRecord,
43 /// Exact opaque evidence retained with the passive status response.
44 pub observation_evidence: ArtifactChecksumRecord,
45 /// Independently qualified original outcome, never inferred from status values.
46 pub attribution: IcLifecycleAttribution,
47 /// Complete retained qualification evidence for explicit integration settlement.
48 pub evidence: ArtifactChecksumRecord,
49}