Skip to main content

canic_backup/persistence/integrity/
reports.rs

1//! Module: persistence::integrity::reports
2//!
3//! Responsibility: define read-only backup integrity report projections.
4//! Does not own: integrity verification, persistence, or restore execution.
5//! Boundary: exposes serializable report DTOs for persistence callers.
6
7use serde::{Deserialize, Serialize};
8
9///
10/// BackupIntegrityReport
11///
12/// Read-only integrity projection for manifest, journal, and artifact checks.
13/// Owned by persistence integrity and returned by backup layout verification.
14///
15
16#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)]
17pub struct BackupIntegrityReport {
18    pub backup_id: String,
19    pub verified: bool,
20    pub manifest_members: usize,
21    pub journal_artifacts: usize,
22    pub durable_artifacts: usize,
23    pub artifacts: Vec<ArtifactIntegrityReport>,
24}
25
26///
27/// BackupExecutionIntegrityReport
28///
29/// Read-only integrity projection for backup plan and execution journal checks.
30/// Owned by persistence integrity and returned by execution resume verification.
31///
32
33#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)]
34pub struct BackupExecutionIntegrityReport {
35    pub plan_id: String,
36    pub run_id: String,
37    pub verified: bool,
38    pub plan_operations: usize,
39    pub journal_operations: usize,
40}
41
42///
43/// ArtifactIntegrityReport
44///
45/// Read-only integrity projection for one durable artifact.
46/// Owned by persistence integrity and embedded in backup integrity reports.
47///
48
49#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)]
50pub struct ArtifactIntegrityReport {
51    pub canister_id: String,
52    pub snapshot_id: String,
53    pub artifact_path: String,
54    pub checksum: String,
55}