canic-host 0.110.47

Host-side App build and desired-state Fleet reconciliation library for Canic workspaces
Documentation
//! Module: fleet_ensure::view::terminal_source::inventory::evidence
//!
//! Responsibility: project historical source membership and finalized release evidence.
//! Does not own: current executable contracts, defaults, conversion or IC interfaces.
//! Boundary: omitted declaration fields remain bound by the separate receipt audit.

use crate::fleet_ensure::model::{
    DesiredCanister, DesiredFleetBootstrapRoot, FleetEnsureTopologyRecord,
};
use canic_core::{
    dto::fleet_registry::FleetSubnetRootEntry,
    ids::{AppId, CanonicalNetworkId, FleetId, FleetRegistryAuthority, ReleaseBuildId, SubnetId},
};
use serde::Deserialize;
use std::collections::BTreeMap;

/// Identity-only declaration projection. The receipt owner binds every omitted field.
#[derive(Deserialize)]
pub(in crate::fleet_ensure) struct InventoryDeclarationEvidence {
    pub(in crate::fleet_ensure) bootstrap: InventoryBootstrapEvidence,
    pub(in crate::fleet_ensure) canisters: Vec<DesiredCanister>,
}

/// Completed physical placement under the current authority contract.
#[derive(Deserialize)]
pub(in crate::fleet_ensure) struct InventoryBootstrapEvidence {
    pub(in crate::fleet_ensure) app: AppId,
    pub(in crate::fleet_ensure) canonical_network_id: CanonicalNetworkId,
    pub(in crate::fleet_ensure) coordinator: String,
    pub(in crate::fleet_ensure) coordinator_subnet: SubnetId,
    pub(in crate::fleet_ensure) fleet_id: FleetId,
    pub(in crate::fleet_ensure) release_build_id: ReleaseBuildId,
    pub(in crate::fleet_ensure) roots: Vec<DesiredFleetBootstrapRoot>,
    pub(in crate::fleet_ensure) recovery_controllers: Vec<candid::Principal>,
}

/// Source registry identity and Root membership claims, not a current Registry.
#[derive(Deserialize)]
pub(in crate::fleet_ensure) struct RegistryInventoryEvidence {
    pub(in crate::fleet_ensure) authority: FleetRegistryAuthority,
    pub(in crate::fleet_ensure) revision: u64,
    pub(in crate::fleet_ensure) fleet_subnet_roots: Vec<FleetSubnetRootEntry>,
}

/// Historical state has no conversion to current execution state.
#[derive(Deserialize)]
#[serde(deny_unknown_fields)]
pub(in crate::fleet_ensure) struct CompletedStateEvidence {
    pub(in crate::fleet_ensure) active_registry: RegistryInventoryEvidence,
    pub(in crate::fleet_ensure) completed_reinstall_action_sha256: BTreeMap<String, String>,
    #[serde(deserialize_with = "crate::fleet_ensure::model::serialization::required_option")]
    pub(in crate::fleet_ensure) completed_reinstall_operation_id: Option<String>,
    pub(in crate::fleet_ensure) completed_reinstalls: BTreeMap<String, u64>,
    pub(in crate::fleet_ensure) fleet: String,
    pub(in crate::fleet_ensure) pending_principals: BTreeMap<String, String>,
    pub(in crate::fleet_ensure) principals: BTreeMap<String, String>,
    pub(in crate::fleet_ensure) retained_cycles_by_principal: BTreeMap<String, u128>,
    pub(in crate::fleet_ensure) schema_version: u16,
    pub(in crate::fleet_ensure) topology: BTreeMap<String, FleetEnsureTopologyRecord>,
}