Module upload
Expand description
Staged-upload contract types — the one canonical UploadPolicy/UploadTier
set (SSoT:
Transfer — Upload: Upload Tiering (Staged Uploads)).
Uploads used to be all-or-nothing; staged uploads add the upload-direction
ladder for low-data situations (a metered plan, weeks from Wi-Fi) where what
matters most is that the index of what exists escapes the device. This module
owns the two closed contract enums and the one pure invariant they carry — the
staged × streaming exclusion. Everything network-facing (the scheduler that
opens sessions in tier order, gated by the connection class) lives in the SDK
half (capsule_sdk::staged); capsule-core stays network-free.
The policy is client-side session ordering only — the server has zero mode
branches (transfer upload doc). Under UploadPolicy::Staged the scheduler opens
each asset’s sessions in UploadTier order, gating each tier on the sync
connection criteria; under UploadPolicy::Full all sessions open eagerly.
Structs§
- Staged
Streaming Conflict - Raised when a staged upload policy is combined with a storage-constrained streaming import for the same run — the combination the planner rejects outright (transfer upload doc: “Staged and streaming import are mutually exclusive per import”).
Enums§
- Upload
Policy - The per-device upload policy: a closed enum with exactly two members.
- Upload
Tier - The upload tier ladder, mirroring the download ladder. Tiers map directly onto
existing blob roles — no new blob kind exists for staging. The derived
Ordis the ladder order (Index < Preview < Original), so a scheduler emits sessions strictly T0 → T1 → T2 by sorting.
Functions§
- ensure_
streaming_ compatible - The pure staged × streaming exclusion invariant.