Asset Organization
UnauditedQuesti contenuti non sono ancora disponibili nella tua lingua.
Container albums (Container Albums) are the cryptographic unit every asset belongs to; view albums (System & Smart Albums (Views)) are derived, key-free presentations. Stacks, culling, hiding and trash are metadata-only and never touch asset bytes. The load-bearing security piece is retention_until, signed into the delete manifest so a hostile server cannot accelerate purges.
Albums
Section titled “Albums”- Container albums (Container Albums) are the real cryptographic unit. Every asset belongs to exactly one.
- View albums (System & Smart Albums (Views)) are computed client-side, hold no keys and own no assets.
Container Albums
Section titled “Container Albums”A container album is the sharing and access-control boundary and is an MLS group. Key Management and MLS Group Membership own its keys and membership operations, and Server Filesystem its storage shape. This section owns the interaction surface.
- Moves are idempotent. A move is a signed lifecycle action naming
(asset, target album, epoch). A replay finds the target state and no-ops, and concurrent moves resolve by MLS commit order (Metadata — Grouping Convergence (Requirement)). - Roles are read (AMK), write (AMK + write-tier key) or admin (also admin-tier key), delivered over MLS (Key Management — Album Master Keys (AMKs)). A role change is an MLS commit and bumps the AMK epoch.
- Invite and join is an MLS
Addfor all of the invitee’s verified devices (Key Management — Device Directory), whoseWelcomedelivers AMKs perhistory_policy(MLS Group Membership — History Delivery for New Joiners). Remote users also get a federation capability (Federation — Federation Capabilities); non-account recipients use a share link (Share Links). Removal is an MLSRemove+ epoch bump. Pending the MLS implementation. - Album policy (
history_policy,protocol_versionpin, defaultretention_until) is fixed at creation and changed only by an album upgrade ceremony (Versioning — Album Upgrade Ceremony).
The Default Album
Section titled “The Default Album”Every owner has a nameless, otherwise ordinary default album from first-device enrollment (Device Enrollment — First-Device Enrollment) onward, so an import always has a container to land in.
- Stored id. Its album id is derived once, at account creation, from the account’s first master key (an identifier, not a key), and stored from then on: sealed beside the identity key, so any of the owner’s devices, a recovering one included, reads it rather than computing it (Key Management — Key Chain). Nothing re-derives it: after a master-key rotation the derivation would name a different, empty album.
- Designation is a server-side pointer. The current default is a non-secret
default_album_idon the owner record (Server Filesystem — Ownership, Partitioning, and Quota), defaulting to the stored default album. It is not security-bearing, since writes still need album write capability (invariant 6 of Validation Invariants — Server-Side Validation Invariants). - Always a container.
resolve_default_album(context)never returns a view. The import planner (Import Pipeline — Plan & Confirm) uses it when the user picks no album. - Undeletable while designated. The user must repoint first.
Scope Grammar (Local Source → Album Mapping)
Section titled “Scope Grammar (Local Source → Album Mapping)”A scope is the canonical identity of an import source:
Scope { platform: PlatformTag, // closed enum (shared with device cohorts) source_kind: SourceKind, // closed enum: camera_roll | screenshots | app_collection | folder | watched_dir | removable_volume locator: String, // canonical, per the table below}// scope_id = SHA-256( canonical-CBOR([ "capsule-import-scope/v1", platform, source_kind, locator ]) )scope_id is deterministic, so same-platform devices agree. Locators are chosen for stability across reinstall:
| Platform | Source | Canonical locator | Notes |
|---|---|---|---|
| iOS | camera roll / screenshots / user collection | smart-album subtype name, or the collection’s localIdentifier |
localIdentifier is per-device; cross-device only via override rows |
| Android | MediaStore bucket | relative path (DCIM/Camera) |
never BUCKET_ID (differs across devices and OS versions) |
| Desktop | folder / watched dir | canonicalized path (symlinks resolved) | |
| Any | removable volume | volume UUID + relative path | stable across mount points |
- Resolution order (first match wins): explicit user pick →
scope_idoverride row → per-SourceKinddefault row →default_album_idpointer → the stored default album id (The Default Album). The planner records which rule fired. - Rows (
scope_overrides,source_kind_defaults) live in the library-settings document (Metadata — The Library-Settings Document), E2E-encrypted, LWW per key. - Unmapped sources ask once, and the answer becomes the scope’s override row. Automated imports never invent destinations.
v1 ships only explicit pick → pointer → stored default album; the override and default rows are deferred with the library-settings document.
Album Order and Recency
Section titled “Album Order and Recency”Every native app and the CLI list container albums in one order, computed once in capsule-library, which the CLI links directly and the native apps reach through the FFI. No app sorts albums on its own.
- Most recent asset first. An album ranks by the latest effective capture time (Metadata — As-Imported and User Values) among its assets that are neither hidden nor trashed. An album with no such asset ranks by its own creation time. Ties break by ascending
album_id. - What ranks. Albums shared by another owner rank like the user’s own, and smart and aggregated albums rank by their members. The system albums (All, Trash) and the Hidden view are listed apart from that order.
- The web client is the exception. It holds no keys in v1, so it cannot read capture times and keeps its key-free order from the sync feed until in-browser decrypt lands.
- Derived, never stored. Recency is a query over the local index (Client Filesystem — Local Index Staleness), so imports, moves, deletes, restores and capture-date edits change it with nothing extra to keep in step.
- Not on the server. Capture times are inside the encrypted metadata, so the server cannot compute album recency and is never asked to.
- No viewing history. Albums record no viewing or opening time, synced or on the server, because that would put viewing habits into metadata that leaves the device. Any state a later “recently viewed” view needs is per-device and local only.
System & Smart Albums (Views)
Section titled “System & Smart Albums (Views)”Views are computed client-side from the local index (Client Filesystem — Local Index Staleness). A view is not an MLS group, holds no AMK, owns no assets and is not a sharing boundary. The aggregated federated album (Federation — Federated Shared Albums (Aggregated Albums)) is a view.
- System albums are All (every visible asset; The Default Album says why one is needed) and Trash (Recycling).
- Smart albums are user-defined predicates over sidecar and AI fields. Membership is computed, never stored, so editing a definition or asset moves and re-encrypts nothing. Definitions are carried in the library-settings document (Metadata — The Library-Settings Document); this doc owns their shape.
- A saved search is a smart album. The search grammar compiles into this predicate tree (Search — Compiling to a Predicate), so saving a search stores the predicate the live search ran, and opening a smart album in search shows it as the same chips.
Smart-Album Definition Schema
Section titled “Smart-Album Definition Schema”Deferred post-v1 with the library-settings document; System views ship in v1. Normative as written. Today only the tags_user contains term is evaluated (capsule-core::sidecar::smart_album).
The grammar is closed, versioned and declarative: definitions sync to every device, so they must evaluate identically and carry no code, regex or unbounded input.
SmartAlbumDefinition { smart_album_id: UUIDv7, predicate_schema: u16, // currently 1; a later value gates evaluation on older clients display_name: Lww<String>, // ≤ 256 bytes predicate: Predicate, sort: Option<SortSpec>, // closed key set; default (capture_time, desc)}
Predicate = // depth ≤ 8, ≤ 64 terms total | All(Vec<Predicate>) // AND — empty ⇒ matches every asset | Any(Vec<Predicate>) // OR — empty ⇒ matches none | Not(Box<Predicate>) | Term(Term)
Term { field: QueryField, op: Operator, operand: Operand } // operand shape fixed by (field, op)Every field reads the asset’s effective value: the user’s register if written, else the as-imported field (Metadata — As-Imported and User Values).
| Class | Fields | Valid operators | Operand |
|---|---|---|---|
| temporal | capture_time, import_time |
before, after, in_range |
RFC 3339 full-date or date-time (half-open [start, end) for in_range). Without an offset it compares the capture’s local wall-clock time; with one, the instant |
| enum | content_type, media_kind (photo|video|live), media_subtype (Metadata — Closed Enum Value Sets), gps.datum |
eq, in |
value(s) from the field’s closed enum; content_type also accepts the named set raw |
| numeric | rating, dimensions.width, dimensions.height, capture_settings.iso, capture_settings.focal_length_35mm |
eq, gte, lte, in_range |
u32 ([lo, hi] for in_range) |
| trinary/bool | cull, hidden |
is |
pick|neutral|reject; true|false |
| set | tags_user, tags_ai, stack_type, people_cluster, album_id, device_id |
contains, contains_any, contains_all |
≤ 64 members, each ≤ 256 bytes |
| text | text (caption and labels at every level), camera (capture_settings.camera_make, camera_id.model), lens (capture_settings.lens_make, capture_settings.lens_model) |
matches (substring), eq (whole value) |
1–256 bytes |
| spatial | gps |
within, near |
within: south, west, north, east in WGS-84 degrees (west > east crosses the antimeridian); near: a WGS-84 point and a radius of 1 m–20,000 km |
| presence | gps, caption, tags_user, camera_id, capture_settings |
exists |
bool |
- Closed. An unknown
field/opor a mistypedoperandis a structural rejection, not a tolerated unknown. Extending the grammar needs a laterpredicate_schema, plus a sidecar-schema bump (Metadata — Schema Versioning Rules) for a new sidecar field. A newerpredicate_schemais preserved verbatim and never evaluated. - No local state. A term names only synced data. Search resolves names, places and fuzzy matches before saving (Search — Compiling to a Predicate), so no term refers to a place-name cache, a suggester or an embedding, and semantic similarity is never a term.
- Text folding is pinned.
text,cameraandlenscompare after NFC normalization, Unicode default case folding and diacritic removal, using the tables of the Unicode version thatpredicate_schemanames (Unicode 16.0 for schema 1). A newer Unicode version is a newpredicate_schema, so two devices never fold differently. - Spatial terms are exact and pinned.
withinandnearevaluate on the location normalized to WGS-84 (Places — The Location Index), with geodesic distance on the WGS-84 ellipsoid, computed with the pure-Rustlibmon every target. A GCJ-02 location is normalized approximately and so can sit just inside or outside a boundary, but it does so the same way on every device. hiddenis gated. A definition with ahidden is trueterm is evaluated only in a context that passed the Hidden view’s fresh-local-auth gate (Hidden Assets). Elsewhere it matches nothing.- AI terms.
tags_aiterms are evaluated against the current generation of the task that produces them, never a pinned release. AI outputs from a superseded generation evaluate as excluded (AI staleness, AI/ML Integrations — Generation Cutover), so a weight release moves an album to the new generation at cutover instead of emptying it. Apeople_clusterterm names aperson_id, which survives model bumps (People — Search and Smart Albums). - Convergence. The whole definition is one LWW register (a stamped
Nonedeletes it), so there is no partial-predicate merge. Evaluation is a pure function of(definition, decryptable assets)in sortedasset_idorder.
Asset Stacking
Section titled “Asset Stacking”Stacks group related files (RAW+JPEG, bursts, live photos) by best-effort auto-detection. v1 auto-detects only RAW+JPEG (plus XMP sidecar attachment); manual stacking works for every type.
Stacking is metadata-only. A stack edit writes each member’s stack_membership LWW register (leave = stamped None) and emits a metadata-update provenance record per asset. It never deletes, rewrites or merges bytes; “best photo” is just role = primary. Multi-asset edits are staged and committed atomically (Library Maintenance and Atomic Writes — Atomic Writes and Crash Recovery, Validation Invariants — Atomicity Invariants).
Stack Membership Schema
Section titled “Stack Membership Schema”StackMembership { stack_id: UUIDv7, stack_type: StackType, // closed enum per protocol_version role: StackRole, // primary | member | proxy member_index: Option<u32>, // burst sequence, chapter index}A new stack type requires a later-dated protocol_version; the Rust enum is normative.
Stack Types
Section titled “Stack Types”- Photography & mobile: RAW + JPEG pair; burst (best photo in front); Live Photo (still + short clip, including an Android motion photo’s extracted clip, Import Pipeline); portrait/depth (image + depth map); smart selection (AI-grouped near-duplicates, Near-Duplicate Review); edited copy (an original + an edited file another app saved beside it), which needs a later-dated
protocol_version. - Technical & creative: exposure bracketing (HDR); focus stack; pixel shift; panorama.
- Video & audio: proxy/optimized (master + proxy); chaptered video (e.g.
GOPR001.mp4,GOPR002.mp4); dual-system audio (video + external WAV/AIFF).
Planned auto-detection. Live Photos (by the platform’s pairing identifier, or a motion photo’s embedded clip) and edited copies (the platform’s edit relationship, else a -edited/_edited sibling with the same capture time) are stacked at import, under the same metadata-only rule.
Near-Duplicate Review
Section titled “Near-Duplicate Review”Near-duplicates (re-saves, resized copies, near-identical frames) are found from the synced semantic embeddings (AI/ML Integrations — Synced Embeddings) and resolved in one review that never loses metadata.
- Grouping. Assets of one library within the model’s near-duplicate distance form a group. Members of one stack are never grouped against each other. Grouping is a pure function of
(embeddings, model_id, model_version). - Keeper suggestion. The largest original, then the most set user fields, then the earliest import. The user may pick another.
- Resolve. Either stack the group (
smart selection, keeper asprimary), or keep one and trash the rest. Trashed copies follow the retention window (Retention Window); the review never purges. - Merge into the keeper. Before anything is trashed, the keeper receives, in one atomic batch:
| Field | Merge |
|---|---|
| Container album | Unchanged; the others’ albums gain nothing, because a trashed copy’s album keeps its own entry until purge |
tags_user, labels |
Union |
rating_lww |
Maximum |
caption_lww |
The keeper’s caption; every other distinct caption is appended to superseded_captions |
gps_user |
Set only when every member’s effective location agrees within 10 m |
capture_timestamp_user |
Unchanged |
hidden |
true if any member is hidden |
cull |
Pick if any member is a pick |
Labels
Section titled “Labels”Users attach free-form labels at four levels. Every level stores labels as an OR-set with add_id binding (Metadata — Add-id Binding), so concurrent adds and removes from any number of devices converge deterministically, and every change is a signed metadata-update.
| Level | Where the labels live | Readable by |
|---|---|---|
| Asset | tags_user in the asset’s sidecar (Metadata — Sidecar Schema v1) |
the asset’s album members |
| Region of an image | regions in the asset’s sidecar, one OR-set per region |
the asset’s album members |
| Stack | the stack’s StackDocV1 |
the stack’s album members |
| Album | the album’s AlbumDocV1 |
the album’s members |
- A label is a Unicode string, NFC-normalized and trimmed, 1–256 bytes, case-preserving. It carries no hierarchy and no type; meaning is the user’s.
- User and AI labels never mix. AI suggestions live only in
tags_aiand reach a user label only by an explicit promote (Metadata — Tag Provenance and Namespacing). - A region is a circle
{cx, cy, r}or rectangle{x, y, w, h}in coordinates normalized to[0, 1]over the original’s display orientation (after EXIF orientation), so it survives every derivative size. A circle’s centre is a fraction of width and height and its radiusra fraction of the shorter side,min(width, height), so a circle is round on any aspect ratio. A circle or rectangle lies wholly inside the image. Each region has a UUIDv7 and its own labels OR-set, and deleting a region is a stampedNonein its LWW register. - Stack and album records.
StackDocV1(keyed bystack_id) andAlbumDocV1(keyed byalbum_id) are signed, versioned documents sealed under the album’s current AMK, following the sidecar’s rules: version first, unknown keys preserved under the signature, CRDT fields only.AlbumDocV1also carries the album’s name (LWW), so a restored or newly joined device sees it; the name follows the label rule at creation and at every rename. On the device the records are plaintext at rest like sidecars (Client Filesystem — Desktop Library Layout). Every member of a stack belongs to the same container album, and moving one member out removes it from the stack. - Privacy. Region labels can name people, so regions are stripped by default on export and from share links (Share Links), and kept only when the user opts in for that export (Metadata — Privacy on Export). Asset, stack and album labels follow the same rule as captions.
- Search. Smart-album
containspredicates overtags_user, and thetextterm, match a label at any level attached to the asset: its own, its live regions’, its stack’s and its album’s. A deleted region’s labels never match, and a stack’s labels match only while the asset is a current member of that stack. - Merge. Asset, stack and album labels merge as OR-sets. A region’s register merges as a semilattice: deleting a region is final (its tombstone absorbs any concurrent or later edit, and a region id is never reused), and two live writes keep the later shape and the union of their labels. Album names merge by LWW.
- Restore. A backup artifact carries each album’s and stack’s record sealed under its AMK, so a restored device recovers album names and labels rather than showing
Recovered album.
Culling
Section titled “Culling”Culling is a trinary flag per asset, pick | neutral | reject, in the sidecar’s cull LWW register (Metadata — Sidecar Schema v1). neutral is the wire-absent default, and the flag is independent of the star rating.
- Workflow. Flagging never touches bytes and is reversible. The only destructive step is moving rejects to trash (Recycling), soft per retention.
- Groups. A stack has no flag of its own; its state is derived from members (all-rejected, any-pick, else mixed). Flagging a collapsed stack writes each member atomically like any stack edit (Asset Stacking).
- Sync. Converges like every LWW field (Metadata — Grouping Convergence (Requirement)).
Culling UI
Section titled “Culling UI”Culling is a high-volume, repetitive pass, so every native client’s culling surface is built for speed without a pointer and for use without sight.
- Keyboard first. With a hardware keyboard attached, the whole pass works without a pointer: one key each for pick, neutral and reject, next and previous asset, expand and collapse a stack, and the reject sweep. A verdict advances to the next asset. Bindings are discoverable in the platform’s usual way: the menu bar on macOS, the hold-⌘ shortcut overlay on iPadOS, an in-app shortcut list on iPhone, the keyboard shortcuts helper on Android.
- Accessible. Each verdict is also an accessibility action on the focused asset (VoiceOver and TalkBack custom actions), with no gesture as its only path. The asset’s current flag and its position in the pass are announced. Flag state is never shown by colour alone.
- Audited before it ships. A culling surface passes each platform’s full automated accessibility audit with no exclusions:
performAccessibilityAudit(for: .all)on Apple platforms and the Compose UI accessibility checks on Android.
Import Rules
Section titled “Import Rules”A rule organizes assets automatically: a trigger, a filter and one or more actions. Rules run on a client; the server never evaluates one.
- Triggers. An asset is imported; its embeddings become available (AI/ML Integrations — Synced Embeddings); its recognised text becomes available (AI/ML Integrations — Text Recognition).
- Filter. A smart-album predicate (Smart-Album Definition Schema), evaluated on the triggering asset.
- Actions. Add a label, move to a container album, hide, set a cull flag. Each action is the ordinary signed operation the user could have performed, written by the device that ran the rule.
- Never destructive. No action deletes, trashes or replaces bytes. A run that would act on more than 500 assets pauses and asks.
- Preview. Creating or editing a rule shows what it would do to the existing library as a dry run, and applies to existing assets only when the user confirms.
- Once per asset. A rule acts on an asset once, recorded per
(rule_id, asset_id)in the local index. Its actions are idempotent, so two devices running the same rule converge on the same state. - Storage. Rules are a section of the library-settings document (Metadata — The Library-Settings Document), one LWW register per
rule_id.
Hidden Assets
Section titled “Hidden Assets”A hidden asset (sidecar LWW, wire-absent = visible) is excluded from default views (timeline, search, system views) and appears only in the Hidden view behind the fresh-local-auth gate (SR1 in Local Gallery — Security Requirements). Hiding is view-layer only, neither deletion nor access control: the asset keeps its album and keeps syncing.
Recycling
Section titled “Recycling”Delete defaults to trash, a soft delete synced as a signed delete lifecycle record. A hard delete happens only when the user empties trash, retention expires, or the user requests immediate deletion. Deletion is a lifecycle action like any other (Signed Manifests and Provenance — Provenance of Library Modifications, Authorization — The Closed Action Set).
Deletion State Machine
Section titled “Deletion State Machine”Deletion is owned entirely by capsule-library’s Workspace and reaches the apps through the FFI as verbs: delete, restore, purge and list trash. An app holds no deletion or retention logic of its own and never writes the index row directly.
Live and Trashed are derived from the asset’s signed chain, never stored on their own, so rebuilding the index reproduces them. Purged is recorded as a tombstone only on the evidence Sync — Discovering What Changed names (the retention window seen closed, or a delete entry marked purged) or by this device’s own purge. Missing bytes are never read as a purge, because a device whose scope is metadata-only holds no bytes for a Trashed asset either.
| From | Verb | To | Record | Refused when |
|---|---|---|---|---|
| live | delete | trashed | signed delete carrying retention_until |
never; a delete of a trashed asset signs nothing and keeps its window |
| trashed | restore | live | signed trash-restore |
now is at or after retention_until |
| trashed | purge | purged | before retention_until, a signed shorter-retention delete re-issue first |
the asset is not trashed: a purge never skips the trash |
Delete appends a signed delete record carrying retention_until, then updates the index from it. A delete that writes only the index is not a delete: it never syncs, and a rebuild brings the asset back.
Expiry is judged by the signed retention_until, on the device as on the server, never by when the local row changed. A late purge loses nothing; an early one can.
- Every expiry and restore decision reads the
retention_untilof the asset’s latestdeleterecord, and adeletewith no readable window never expires. - The device judges expiry exactly as Peering — Sync does: only once a sync has drained the feed to its head, so a restore made on another device is applied first, and by the server’s clock as that drain saw it (the latest
changed_at), never its own. A device clock running ahead would purge early, and its tombstone would then refuse a restore the server accepted in time. - It never purges on expiry an asset whose
deletethe server has not indexed (a held delete, below), since the server has no window running for it; only the user’s own purge removes that asset. - A device that cannot drain the feed does not purge on expiry. One that never signed in has no drained feed, so its trash empties only when the user purges.
Purge before retention_until (emptying the trash, or immediate deletion) first appends the signed shorter-retention re-issue the retention window (Retention Window) requires, so the chain and the server agree that the purge is due. Purge then removes the original, the sidecar, every derivative and cache entry, and the index row, including its stack memberships. The provenance file stays as the tombstone-with-history (Client Filesystem). That kept chain is the peering tombstone itself: no other file records a purge, whether this device purged by its own decision or on the evidence Sync — Discovering What Changed names, so an index rebuild reproduces Purged from the provenance file alone.
Tombstone. A kept chain headed by a delete with no sidecar and no original beside it is the library’s peering tombstone. The workspace reads it back on open, holds the asset at that head, and refuses any backup or peer copy of it. Its head is also the re-issue an early purge must deliver, so a failed delivery is resent from it. A chain with a lost sidecar and any other head is damage, not a purge.
An upload in flight is redacted. Deleting an asset whose upload has not finished aborts this device’s open upload sessions for it, drops its pending tiers (Upload — Upload Tiering (Staged Uploads)), and removes it from this device’s upload queue on every server it was queued for. A restore returns it to Live, and so to the queue. Every device redacts the same way: a device that learns of the delete over peering (Peering — Sync) holds the asset Trashed, so it uploads no create of it either. No device uploads an asset in the trash only so that its delete can follow.
- Held records. The server never sees a lifecycle record for an asset it has not indexed (Peering — Delegation). A record goes to the server only once the server’s feed lists the asset, whichever device uploaded its create. It then goes as every record after the head the server holds, in chain order, so the
deletesupersedes the create and each later record chains onto the one before. Until then it is held and travels to the user’s other devices over peering, and any device holding the chain sends it once the create is indexed. If the create never reaches the server, no record after it does either. - An upload carries the create. The server takes nothing but a
createthrough an upload, so whatever an asset’s chain holds when it is uploaded, the upload carries itscreaterecord, and every record after it is a held record, Live asset or Trashed. A push sends them once its own uploads are done and a fresh drain lists the create.- The create carries the exact sealed metadata blob it binds, which cannot be sealed again. So the first edit that replaces that blob keeps a copy of it beside the chain, in the capture-month shard, for the asset’s life; only a purge removes it. An asset edited before its first upload therefore uploads its create with the create’s blob, and its edits follow as held records.
- A library edited before it kept that copy cannot upload such a create, and the upload is refused before any byte is sent.
- Where the server already holds the create (the feed lists the asset and holds its original) and an edit has superseded its blob, nothing of it is left to upload, so the push skips it rather than failing and sends only the records after it.
- Where held records live. In the asset’s own provenance chain, the only thing any delivery sends from. The delegation ledger (Peering — Delegation) keeps a copy of a delegated asset’s stretch only to know which assets wait on a hand-off’s custody; once it releases them, they are delivered like any other. Every delivery compares the chain with the head a fresh feed drain names and sends only what the server lacks, so losing the upload queue, the delegation ledger or the index loses nothing, and a stretch one command delivered is not sent again by another. A purge keeps the chain as the tombstone, so a held
delete, and the shorter-retention re-issue an early purge appends, outlive the purge and are sent from the tombstone if the create is indexed later. The server then purges by that re-issued window. - A restore while the delete is held is sent after the delete it undoes, in the same delivery. A restore that undoes a held delete whose
retention_untilhas passed is never sent, and neither is the delete or anything after them. This is judged by the later of the device’s clock and the latest serverchanged_atthe drain saw, and it is the case where the server would apply the delete, refuse the restore and purge an asset the user restored in time. The server keeps the asset Live at the head it holds, and the library keeps every record. The chain is hash-linked, so a later delete of the asset never reaches the server either: it stays Live there, and only the library’s trash holds it. - Redaction never weakens what keeps data safe. The local original stays pinned exactly as an unredacted staged upload pins it, until T2 is custody-confirmed or the asset’s purge. A restore of an asset whose delete is still held, made before
retention_untilby the device’s clock, is never lost because the held records reached the server late.
Retention Window
Section titled “Retention Window”retention_until is signed into the delete manifest at delete time, in its server-visible envelope, so the keyless purge worker enforces it against the server’s trusted clock (Server Filesystem — PostgreSQL: What the Server Knows). The default is 30 days, extendable per delete or album policy.
- The server cannot accelerate a purge: a hard purge before
retention_untilis rejected, whatever the server config. - The server cannot delay a purge beyond a user-issued
trash-restoreor signed shorter-retention re-issue. trash-restorebeforeretention_untilrecovers the asset and appends a record; the delete manifest stays in the chain.- A
trash-restorethe server accepts at or afterretention_until, by the same trusted clock, is refused409 error.upload.retention_elapsedand writes nothing, whether or not the purge has run. - A purged asset cannot be restored. A restore that reaches the asset after its purge committed is refused the same way, even if the server accepted it just before the window closed. No restore ever meets a purged row, and a refused one leaves the asset in the trash until the purge.
Known Gaps
Section titled “Known Gaps”- Auto-detection covers only RAW+JPEG; Live Photo, motion-photo and edited-copy detection are not implemented, and the edited-copy stack type does not exist.
- Near-duplicate review and import rules are not implemented; both wait on synced embeddings, and rules on the library-settings document.
Validation
Section titled “Validation”Each rule above is a unit or smoke test. Notably, under a mocked clock purge is refused before retention_until and trash-restore at or after it, and smart-album evaluation is byte-identical across platforms. A near-duplicate resolution applies the merge table before any trash and never purges. An import rule never deletes, pauses past its cap, and acts once per asset however many devices run it.