Skip to main content

ic_backup/
lib.rs

1//! Host-side snapshot backup and same-release recovery for Internet Computer canisters.
2//!
3//! The library provides directory checksums, no-follow traversal and IC snapshot staging,
4//! verified durable directory publication, bounded JSON persistence and journal
5//! locking, layout lifetime exclusion, durable restore dependencies and
6//! inherited command custody. Local download journals retain exact snapshot
7//! identity and verified publication progress. Local attempt journals bind exact
8//! declared identity and finite mutation/observation allowances, retaining durable
9//! reservations and qualified receipts. These mechanisms do not authorize canister
10//! effects.
11//! Explicit fresh download integrity checks bind the retained original plan and
12//! exact selected set to published directory bytes without changing journals,
13//! replenishing allowances or releasing dependencies. Stable byte custody and
14//! backend transfer completeness remain integration-owned.
15//! Immutable local download manifests reuse that exact v1 journal schema after
16//! fresh byte verification. Exact replay reads original retained records only,
17//! preserving snapshot/checksum provenance even when artifact trees are absent.
18//! Explicit local restore-source verification joins both original plans, retained
19//! safety requirement and exact local manifest before checking every source tree.
20//! Borrowed same-ID selection views grant no upload/load, application or release authority.
21//! Bounded physical inventories retain canonical declared parent forests; pure
22//! selection policy expands exact principals without live discovery or authority.
23//! Explicit effect graphs retain validated operation dependencies and project
24//! deterministic planning order/readiness without authorizing dispatch.
25//! Immutable operation plans bind these declarations to exact target/request digests
26//! and original attempt allowances, deriving journal authority under the full plan digest.
27//! Pure execution progress joins exact retained journals to the original plan and
28//! projects causal Applied evidence, pending attempts and exhaustion without dispatch.
29//! Original-plan-bound local progress reopens every retained journal. Planned
30//! reservations require complete original evidence and Applied mutation prerequisites,
31//! retaining the existing spending owner without dispatching or resetting allowance.
32//! The IC request boundary encodes closed host-ingress management operations and
33//! binds exact method/routing/Candid bytes to original mutation or observation digests.
34//! Codec qualification does not establish IC effects or fresh execution authority.
35//! Bounded capture/inventory reply decoding preserves raw snapshot identity and
36//! exact request/reply evidence without authenticating origin or settling effects.
37//! Bounded snapshot metadata reads preserve ordered globals, optional timer/hook
38//! values and exact chunk identities, without attesting complete data transfer.
39//! Metadata-bound data reads admit checked ranges, exact reply lengths and chunk
40//! hashes while retaining original evidence without effects. Incremental coverage
41//! checks reject gaps and repeated chunks without retaining or publishing bytes.
42//! Snapshot upload payloads preserve representable metadata and bind exact bounded
43//! source slices to a distinct new ID. Explicit local preparation checks retained
44//! source bytes; passive original-attempt reply admission supplies no dispatch,
45//! settlement, complete upload or new spending. A single-update upload provider
46//! contract reuses original accounting and passive replies; no provider is installed.
47//! Pure inventory comparison exposes new candidates and rejects baseline drift;
48//! candidate cardinality never attributes or settles a lost capture.
49//! Bounded lifecycle replies retain exact empty acknowledgements and required
50//! status/controller projections without converting them into fresh authority.
51//! Exact IC mutation envelopes bind already reserved original updates; a single-call
52//! provider contract and bounded passive reply association preserve pending spending.
53//! Existing codecs decode replies without automatic settlement, retries or release.
54//! Exact reserved status/list observations also retain both original attempt identities;
55//! passive association leaves lost observations pending and proves no effect outcome.
56//! A separate membership port binds ephemeral provider results to original intent,
57//! exact current context/full inventory and an integration-owned challenge.
58//! Pure matching views grant neither controller authority nor application continuity.
59//! The separate control port checks direct caller-controller evidence for exact
60//! IC mutation payloads; its matching views still grant no dispatch or restore safety.
61//! A separate snapshot-read port checks current snapshot-list visibility and exact
62//! caller read paths, without granting mutation control or settling lost replies.
63//! Immutable consistency requirements retain the original requested guarantee;
64//! current target/fence checks acquire or release no application obligations.
65//! Immutable restore safety requirements bind exact original source and same-release
66//! targets; fresh application evidence checks load/start safety without effects,
67//! lost-load settlement or fence/reference release.
68//! Immutable fence obligations retain original scope and acquisition identity;
69//! recovery joins their exact original attempt journals without new accounting,
70//! automatic release or a claim of current Active custody.
71//! Reserved fence-acquisition reconciliation matches original-request attribution
72//! under exact pending mutation and observation identities. Passive claims and
73//! late-reply admission perform no automatic settlement, redispatch or release;
74//! authenticated providers and actual application effects remain integration-owned.
75//! Exact application acquisition envelopes bind receiver, update mode, method and
76//! opaque bytes to already reserved original mutations. Passive acknowledgement
77//! association establishes no acquisition outcome or fresh dispatch permission.
78//! Immutable execution settlement checkpoints bind complete original Applied
79//! journals and their exact chronological histories for local replay. They prove
80//! no full backup/restore completion, command quiescence or fence/reference release.
81//! Distinct workflow allocations bind learned stages to one fixed exact child plan
82//! and original ceilings. Predecessor settlement admission reuses retained journal
83//! histories; stage reopen preserves spending without dispatch or repair.
84//! Metadata-derived download plans admit every exact data request against the
85//! original stage allowance before allocation, retaining one accounted update per
86//! request and explicit sequential dependencies. Planning grants no fresh access.
87//!
88//! Applications own membership, release identity, control routing, quiescence
89//! and external-effect settlement. Complete application backup/restore remains integration-owned;
90//! the direct Agent transport lives in the separate `ic-backup-agent` crate.
91//! Filesystem access and credentials remain on the
92//! operator host.
93//! Bounded Unix record reads reuse ic-host-fs regular-file admission while
94//! publication, record validation, confinement and command custody remain local.
95
96pub mod model;
97pub mod ops;
98pub mod policy;
99pub mod ports;
100pub mod view;
101pub mod workflow;
102
103#[cfg(test)]
104mod test_support;