Metadata
Unauditedयह कंटेंट अभी तक आपकी भाषा में उपलब्ध नहीं है।
The CBOR sidecar is the canonical metadata record for every asset, plaintext and local only (Client Filesystem). This page is its single source of truth: every implementation must encode it byte-for-byte as specified, or cross-peer signatures break. Other docs name fields and never re-declare them.
Rawshift extracts media metadata and Capsule maps it into these fields. Chromahash is called directly, never through Rawshift.
Sidecar Schema v1
Section titled “Sidecar Schema v1”SidecarV1 { sidecar_schema: u16, // FIELD 0 — readable before parsing the rest. Currently 1. crypto_suite_id: u16, // matches the asset's manifest; see Cryptography uuid: UUIDv7, hash: bytes, // canonical plaintext digest; algorithm + length fixed by crypto_suite_id capture_timestamp: RFC3339, // as imported; never overwritten by a user edit capture_timestamp_user: Lww<RFC3339>, // the user's correction; wire-absent when never written import_timestamp: RFC3339, content_type: String, // closed enum, below dimensions: Option<{ width: u32, height: u32 }>, media_subtype: Option<MediaSubtype>, // as imported; wire-absent when none (Closed Enum Value Sets) original_filename: Option<String>, // as imported; base name only; wire-absent when unknown (Original File Name)
// display placeholder (see Thumbnails — LQIP) lqip: Option<{ chromahash: bytes, format_version: u16, dominant_color: [u8; 3] }>,
// collaborative metadata (see Collaborative Metadata) tags_user: OR_set<(tag: String, add_id)>, tags_ai: OR_set<(tag: String, add_id, model_id: String, model_version: String)>, caption_lww: Option<{ value: String, ts: RFC3339, by: device_id }>, // value ≤ 4096 bytes; ts and by are audit-only superseded_captions: Vec<{ value: String, written_by: device_id, ts: RFC3339 }>, // ≤ 16 rating_lww: Option<{ value: u8, ts: RFC3339, by: device_id }>, sensitivity_ai: Lww<Option<{ flagged: bool, model_id: String, model_version: String }>>, // AI-only; wire-absent when never written
// organization (semantics owned by Asset Organization); LWW, wire-absent when never written stack_membership: Lww<Option<StackMembership>>, // leave = a stamped None regions: Map<UUIDv7, Lww<Option<Region>>>, // labelled image regions; delete = a stamped None cull: Lww<CullFlag>, // pick | neutral | reject hidden: Lww<bool>, edits: Lww<Option<EditRecipe>>, // non-destructive edit (Edit Recipe); wire-absent when never written
// identifiers (Privacy on Export applies) camera_id: Option<{ model: String, serial: String }>, // EXIF Model and BodySerialNumber; serial "" when absent device_id: UUIDv4, session_id: UUIDv7,
// geolocation (Privacy on Export applies to both) gps: Option<Gps>, // as imported; never overwritten by a user edit gps_user: Lww<Option<Gps>>, // the user's edit (source manual); a stamped None = no location // Gps = { lat: f64, lon: f64, source: GpsSource, datum: GpsDatum /* wire-absent ⇒ wgs84 */ }
// how it was taken; as imported, never user-edited (Capture Settings) capture_settings: Option<CaptureSettings>, // wire-absent when the original records none video: Option<VideoInfo>, // video only; as imported, never user-edited (Video Info)
// the PRIOR provenance chain head; absent only on create provenance_chain_hash: Option<[u8; 32]>,
_unknown: Map, // unknown CBOR keys preserved verbatim, never executed signature: Hybrid(Ed25519, ML-DSA-65), // covers every byte above, including _unknown}
CaptureSettings { // every field optional and wire-absent when unknown camera_make: Option<String>, // EXIF Make lens_make: Option<String>, // EXIF LensMake lens_model: Option<String>, // EXIF LensModel focal_length: Option<[u32; 2]>, // EXIF FocalLength: millimetres, the rational as stored focal_length_35mm: Option<u32>, // EXIF FocalLengthIn35mmFilm f_number: Option<[u32; 2]>, // EXIF FNumber: the rational as stored exposure_time: Option<[u32; 2]>, // EXIF ExposureTime: seconds, the rational as stored iso: Option<u32>, // EXIF PhotographicSensitivity exposure_bias: Option<[i32; 2]>, // EXIF ExposureBiasValue: EV, the signed rational as stored flash_fired: Option<bool>, // EXIF Flash, bit 0}
VideoInfo { // every field optional and wire-absent when unknown codec: Option<String>, // the container's codec identifier: ISO BMFF sample entry (`hvc1`), Matroska CodecID (`V_VP9`) frame_rate: Option<[u32; 2]>, // frames per second, the rational as the container records it (30000/1001) duration_ms: Option<u64>, // the presentation duration, in milliseconds, rounded down}
Region { shape: Circle { cx: f32, cy: f32, r: f32 } | Rect { x: f32, y: f32, w: f32, h: f32 }, // [0, 1], display orientation labels: OR_set<(label: String, add_id)>,}tags_user holds the asset’s user labels and regions its labelled image regions. Asset Organization — Labels specifies both, with the stack and album label records. regions was added without a sidecar_schema bump: older readers keep it verbatim as an unknown key. media_subtype, original_filename, capture_settings, video, edits and sensitivity_ai are additive top-level keys under the same rule. They are top-level rather than nested in an existing value because an older reader drops an unknown key nested inside a known one and would re-sign without it.
sensitivity_ai holds the sensitive-content flag (AI/ML Integrations — Sensitive Content). The AI writes it. A user can only dismiss it, which writes flagged: false under the same model_id and model_version. It merges as an LWW register like the fields under Collaborative Metadata.
Original File Name
Section titled “Original File Name”original_filename is the name the original had when it entered the library. Export’s original naming scheme (Export — File and Folder Names) and the info page (Clients) use it.
- Where it comes from. On desktop, the imported file’s name. On Apple platforms, the original filename Photos records for the asset’s resource. On Android, the MediaStore display name. From an exporter archive, the name the exporter’s record gives.
- A base name, never a path. A directory path leaks account names and folder structure, and no feature needs it.
- Bounded. The name is NFC-normalized, with control characters and both
/and\removed. It is truncated on a character boundary to 255 bytes, keeping the extension. An empty result is absent. - As imported, never edited. The user names an asset with its caption. A rename changes nothing here.
- Stripped at a trust boundary by default, because a name such as
anna-birthday-lisbon.jpgcan identify a person or a place (Privacy on Export).
Capture Settings
Section titled “Capture Settings”capture_settings records how the photo was taken: the lens and the exposure. camera_id records which camera body took it. Import fills both from the original’s EXIF. Today it fills neither: camera_id is written as None (capsule-library/src/lifecycle/import.rs:1057), and the extractor reads only Make and Model (capsule-core/src/exif/extract.rs).
- In the sidecar, because the original may not be local. A client’s info page shows the camera, lens, focal length, aperture, shutter speed and ISO for an asset whose original is not on the device: a metadata-only scope, or a thumbnail-only cache. Derivatives carry no EXIF, so re-reading the original is not an option. The sidecar is the only record that reaches every device without the original (Local and Server Metadata Equivalence), so these values must live in it to exist at all.
- As imported, never edited. These are facts about the capture, with no user register. Re-deriving them from the original (the same repair as for capture time, As-Imported and User Values) is a
metadata-updatethat rewrites onlycapture_settingsandcamera_id. - Rationals verbatim. EXIF stores these values as rationals, and they are kept as the
[numerator, denominator]pair the file holds. Rounding to a float would put non-canonical values into a signed structure (Canonical CBOR Encoding), and the display form (f/1.8,1/250 s) is a client concern. A zero denominator makes the field absent. - Bounded strings. Each string is NFC-normalized, has its NUL padding and control characters removed, is trimmed, and is truncated on a character boundary to 128 bytes. An empty result is absent.
- No lens serial. EXIF
LensSerialNumberis not stored. It identifies the owner and no feature needs it. - Searchable. Camera and lens are search axes (Search — Indexed Axes), and
camera,lens,capture_settings.isoandcapture_settings.focal_length_35mmare smart-album terms (Asset Organization — Smart-Album Definition Schema).
Video Info
Section titled “Video Info”video records what a video’s container says about its main video track. Import fills it for every video/* content_type and never for a still.
- In the sidecar, for the same reason as capture settings. The info page shows codec, frame rate and duration for a video whose original is not on the device (Clients — Asset Info Page), and only the sidecar reaches every device without the original.
- As imported, never edited. These are facts about the file. Re-deriving them from the original is a
metadata-updatethat rewrites onlyvideo. - Rational frame rate. The rate is kept as the
[numerator, denominator]pair the container records, so 29.97 fps stays30000/1001and the signed bytes stay canonical (Canonical CBOR Encoding). A zero in either term makes the field absent. A variable-rate track records its nominal rate, else none. - Bounded codec.
codecis the identifier verbatim, with control characters removed and truncated to 32 bytes. An empty result is absent. The display name (HEVC,VP9) is a client concern.
As-Imported and User Values
Section titled “As-Imported and User Values”Capture time and location each have two fields: the value the import recorded and the user’s correction.
capture_timestampandgpshold what the original said when it entered the library: its own EXIF, else the exporter record folded with it. A user edit never overwrites them.capture_timestamp_userandgps_userare LWW registers holding the user’s correction. Both are wire-absent until first written, so an uncorrected sidecar encodes byte-identically to one written before they existed, and older readers keep them verbatim as unknown keys. Agps_uservalue always hassource = manual. A stampedNonemeans “no location”: it hides the imported fix without erasing it.- The effective value is the user’s register if ever written, else the as-imported field. The timeline, search and every client view use it.
- The
media/{YYYY}/{YYYY-MM}shard is fixed at import fromcapture_timestamp; a correction does not move the bundle. - Re-deriving the as-imported value from the original (the capture-time repair for libraries imported before EXIF dates were read) rewrites
capture_timestamponly and never touches the user’s register.
Batch Time Corrections
Section titled “Batch Time Corrections”A camera with a wrong clock or time zone is fixed for a whole selection in one operation:
- Shift adds a signed duration to each asset’s effective capture time.
- Set zone keeps each asset’s local wall-clock time and gives it a new UTC offset or IANA zone.
Both write capture_timestamp_user per asset and never touch capture_timestamp. The batch is staged and committed atomically (Validation Invariants — Atomicity Invariants) and previewed before and after per asset; undo is one more batch that writes the prior effective values back.
Edit Recipe
Section titled “Edit Recipe”An edit never rewrites the original. edits holds a recipe the client applies when it renders:
EditRecipe { recipe_version: u16, // FIELD 0. Currently 1. crop: Option<Rect>, // [0, 1] of the original's display-oriented frame rotate_quarter_turns: u8, // 0–3, clockwise, applied after the original's own orientation mirror: bool, // horizontal, applied last _unknown: Map,}- The original is untouched.
hash, the original blob and its manifest never change, so an edit needs noreplace(Authorization — The Closed Action Set) and a restore is still byte-exact. - Derivatives follow the recipe. A recipe change re-renders the thumbnail and preview tiers on the client as a
derivative-replace, and their provenance names the recipe’s hash (Signed Manifests and Provenance — Derivative Provenance). - Reset is a stamped
None. - Unknown versions. A reader that does not know
recipe_versionkeeps the register verbatim, renders the unedited original and says so. It never applies part of a recipe. - Export offers the edited rendering or the original (Export).
Schema Versioning Rules
Section titled “Schema Versioning Rules”sidecar_schemais CBOR field 0 under deterministic key order, so a reader knows the schema before parsing the rest.- A client whose
max_known_sidecar_schema < sidecar_schemarefuses to write the sidecar and reads it only in opted-in read-only mode (refuse-by-default, Threat Model), so an old client cannot strip-and-resign a newer sidecar. - The signature covers
_unknown, so stripping unknown fields is detectable. - An album’s pinned protocol version constrains which sidecar schemas may be written into it (Versioning — Album Protocol Version Pinning).
Closed Enum Value Sets
Section titled “Closed Enum Value Sets”These value sets are closed (Schema Rules and Open Questions); adding a value requires a new, later-dated protocol_version.
content_type: exactly one canonical MIME value per format, never an alias such asimage/jpg. The still values are exactly thoseStillFormat::mimereturns (capsule-core/src/media/detect.rs).- images:
image/jpeg,image/png,image/webp,image/gif,image/tiff,image/heic,image/avif,image/jxl,image/x-portable-anymap - RAW images, the set search and smart albums call
raw:image/x-adobe-dng,image/x-sony-arw,image/x-canon-cr2,image/x-canon-cr3,image/x-canon-crw,image/x-nikon-nef,image/x-fuji-raf - video:
video/mp4,video/quicktime,video/x-matroska,video/webm
- images:
media_subtype:screenshot|screen_recording. Import sets it from the platform’s own flag where there is one (Photos’ screenshot and screen-recording subtypes), else from a source scope whoseSourceKindisscreenshots(Asset Organization — Scope Grammar (Local Source → Album Mapping)), else from the file’s own screenshot marker. It is never inferred from the pixels. Absent means an ordinary capture. It drives the Screenshots collection and the latest-screenshots shortcut (Platform Integrations).gps.source:exif|manual|derived. Aderivedvalue is computed from other evidence, such as a GPS track or a neighbouring asset’s fix. It is written only by an explicit user action, never automatically, the same rule as promotingtags_aitotags_user, and never over anexiformanualfix.gps.datum:wgs84|gcj02, stored verbatim as supplied and never converted at rest, since GCJ-02 → WGS-84 has no exact inverse. BD-09 is never stored: it is folded to GCJ-02 at the input edge with an error-bounded (sub-meter) iterative inverse.datumis an additive key within schema v1, wire-absent whenwgs84, so pre-datumsidecars stay byte-identical.gpsmerges as one atomic value.
Canonical CBOR Encoding
Section titled “Canonical CBOR Encoding”The sidecar and the encrypted metadata blob (Asset and Metadata Encryption — Metadata Encryption), whose plaintext is this document, MUST serialize byte-identically in every implementation because the signed manifest (Signed Manifests and Provenance — Asset Manifest) commits to the bytes. Encoding is RFC 8949 §4.2 deterministic:
- Definite-length encoding only.
- Shortest-form integers.
- Bignums (tags 2 and 3) in preferred form (RFC 8949 §3.4.3): a magnitude that fits in 64 bits is the plain integer, and the byte string carries no leading zeros. Canonicalization refuses a negative bignum below -2^127.
- Map keys sorted by bytewise order of their encoded form, no duplicates. This includes
_unknown, re-sorted on write so round-trips are byte-stable. - Floats in the shortest IEEE-754 form that round-trips exactly; canonical quiet NaN. Prefer integers or strings in signed structures.
Conformance is a blocking cross-language gate against shared known-answer vectors, the same fixtures the metadata blob wire format uses (Asset and Metadata Encryption — Metadata Blob Wire Format).
Local and Server Metadata Equivalence
Section titled “Local and Server Metadata Equivalence”The plaintext of the server’s encrypted metadata blob is this signed SidecarV1, the same bytes the client stores at media/{uuid}.cbor:
- The signed manifest (Signed Manifests and Provenance — Asset Manifest) commits to
metadata_blob_hashon everycreate,replaceandmetadata-update. - A client that decrypts the blob MUST find it byte-identical to its locally stored signed sidecar, and the blob’s content hash MUST equal
metadata_blob_hash.
A client never persists a sidecar that does not round-trip to the committed hash (Validation Invariants — Client-Side Validation Invariants); the server enforces the blob-hash match as invariant 25 of Validation Invariants — Server-Side Validation Invariants.
Provenance Binding and Sealing Order
Section titled “Provenance Binding and Sealing Order”provenance_chain_hash references the prior chain head, never the write that seals this sidecar: that manifest commits to the sidecar’s hash, so referencing it would be circular. sidecar.provenance_chain_hash MUST equal the sealing manifest’s prior_provenance_hash, both absent on create. Every reader compares the two before it applies a sidecar, and a divergence is quarantined, never applied; a writer setting the field is not enough on its own (Implementation Risk Register).
Sealing order:
- Fix the prior head
H(Noneoncreate). - Author and sign the sidecar with
provenance_chain_hash = H. - Seal it into the metadata blob (Asset and Metadata Encryption — Metadata Blob Wire Format) and compute its content hash.
- Build and sign the manifest with
prior_provenance_hash = Hand thatmetadata_blob_hash; append it as the new head.
Add-id Binding
Section titled “Add-id Binding”add_id = (device_id: UUIDv4, monotonic_counter: u64), the counter incremented per device per (asset, OR-set). Every OR-set remove targets a specific add_id. A remove naming an add_id the receiver never observed is rejected, not a no-op (Damage Scenarios and Quarantine).
Counter durability. A counter MUST never repeat for a (device_id, asset, OR-set) once it reached a written sidecar, or two adds alias. It is persisted in the local index (Client Filesystem — Desktop Library Layout) and on restart reseeded to one past the maximum counter in the device’s own signed sidecars, fetched from the server if not held locally. It resets to zero only when no sidecar bears the device_id; in practice a reinstall enrolls a new device_id.
Identifiers
Section titled “Identifiers”The sidecar uuid, manifest file_id, provenance/server asset_id and metadata-key-salt blob_id are the same UUIDv7, minted once at import and never re-minted; validators assert equality. session_id, stack_id and import_id are UUIDv7. device_id is UUIDv4 so it leaks no creation order.
camera_id: device model plus a per-device identifier such as the serial.device_id: generated on the importing device.session_id: the authenticated import session (Authentication — Session ID).
Privacy on Export
Section titled “Privacy on Export”When an asset crosses a trust boundary (a share link for a non-member, a plaintext export or an external backup handed off, or a federated peer outside the owner’s home server; see Share Links, Export and Federation), these fields are stripped unless the user opts in per export:
| Field | Default on export | Opt-in retains |
|---|---|---|
Camera serial number (the serial of camera_id; the model stays) |
Emptied | Full value |
Device identifier (device_id, every register stamp’s device, every OR-set add_id device) |
Nil UUID; OR-set elements re-issued under it, tombstones dropped | Full value |
| Session ID | Nil UUID | Full value |
Edit history (the superseded log of every LWW register: prior captions, ratings, capture times, flags, locations, region versions) |
Emptied; only each register’s current value leaves | Retained |
GPS coordinates (gps and every gps_user value, superseded ones included when the history is retained) |
Rounded to 2 decimal places (≈1 km) | Full precision |
| Personal contact tags (faces matched to a known person) | Stripped with regions, the only field that names a face |
Retained |
Image regions and their labels (regions) |
Stripped | Retained |
Original file name (original_filename) |
Stripped | Retained |
Sensitive-content flag (sensitivity_ai) |
Stripped; the recipient’s client may flag it again | Retained |
capture_settings,video,media_subtypeand the camera model identify no one and leave unchanged.- Keys the exporting reader does not know (
_unknown) are always dropped, under every opt-in: a key a newer schema added may itself be a boundary-crossing field. - A copy with anything stripped is unsigned, because the library signature covered what was removed.
- Stripping applies to the exported copy only; the library sidecar is untouched. The opt-in is chosen for one export and never stored. Syncing the same user’s own devices is not a boundary crossing.
- Stripping is the issuing client’s obligation, since the server holds no key. The server’s half is containment: a share serves only the content addresses its record enumerates.
A share link carries each covered asset’s stripped sidecar inside its sealed record (Share Links — The share metadata record), so the blob the server stores is already stripped. Plaintext export applies the same strip, through its presets (Export — Trust Boundary).
Collaborative Metadata
Section titled “Collaborative Metadata”User-editable fields may be edited concurrently and offline, so they are CRDTs:
- Tags: OR-sets with
add_idbinding (Add-id Binding). - Single-value fields (
caption_lww,rating_lww,capture_timestamp_user,gps_user,stack_membership,cull,hidden): LWW registers in which the later write on the asset’s provenance chain wins. The chain is the only order (Authorization — Authorizing a Lifecycle Operation). A writer extends it only at its head, and a write made offline against an old head is re-signed on the new head before it is accepted. A register’stsandbyrecord who wrote it and when they said they did, and are audit-only: no merge compares them, so a device whose clock reads 2099 wins nothing it did not append last (Schema Rules and Open Questions).stack_membershipadmits a stampedNone, so join, move and leave are each one LWW write.
Surfacing Concurrent Edits
Section titled “Surfacing Concurrent Edits”The losing value of a concurrent caption edit (one written against a head that another caption write had already superseded) is appended to superseded_captions (≤ 16, oldest evicted) with author and time, so the UI can offer restore. Ratings keep no log. Clients must never strip superseded_captions (Schema Rules and Open Questions — Forbidden Client Behaviors).
How Operations Travel
Section titled “How Operations Travel”Capsule encrypts operations, not state. Merges are commutative and associative, so arrival order and stale replays do not matter. Operations reconcile into the sidecar, which stays the source of truth. They name known fields only (unknown-field ops are version-gated), and reconciliation re-emits _unknown verbatim. Each operation carries the prior_provenance_hash chain link like any lifecycle action (Authorization — The Closed Action Set).
The same path carries each album’s album-group assertion (Federation — The Album-Group Assertion) and the per-owner library-settings document (The Library-Settings Document). The default-album designation (Asset Organization — The Default Album) is separate: a non-secret server-side pointer.
The Library-Settings Document
Section titled “The Library-Settings Document”Deferred post-v1 with the OGK cluster it is keyed under (Key Management — Owner Group Keys (OGKs)). The schema is normative as written.
LibrarySettingsV1 { settings_schema: u16, // FIELD 0. Currently 1. smart_albums: Map<UUIDv7, Lww<Option<SmartAlbumDefinition>>>, // Organization scope_overrides: Map<scope_id, Lww<Option<album_id>>>, // Organization — Scope Grammar source_kind_defaults: Map<SourceKind, Lww<Option<album_id>>>, // Organization — Scope Grammar aggregated_album_covers: Map<group_id, Lww<Option<asset_id>>>, // per-viewer; Federation people: PeopleSection, // People — Corrections memories: Map<memory_id, Lww<Option<MemoryState>>>, // Memories — Synced State _unknown: Map,}This page owns the envelope, keying, versioning and merge. Asset Organization — Smart-Album Definition Schema, Asset Organization — Scope Grammar (Local Source → Album Mapping), Federation — Membership and Rendering, People — Corrections and Memories — Synced State own the section value schemas. An absent or None cover falls back to the newest constituent asset.
- Shape. Every section is a keyed map of LWW registers over
Option<value>; a stampedNoneis a tombstone. The document has nosignaturefield: each mutation is a signed operation. - Keying. Readable by the owner’s devices and owner-set members and by no album co-member, so it is keyed under the OGK, not an AMK.
settings_doc_idis an identifier, not a key, derived from the account master key (Key Management — Key Chain) under a dedicated label. Operations use the metadata-blob wire format (Asset and Metadata Encryption — Metadata Blob Wire Format) with keyHKDF-SHA512(ikm = OGK_v{n}, salt = settings_doc_id || nonce, info = "library-settings/v1", length = 32)and a server-visible big-endianu32ogk_versionbefore the nonce. A fresh nonce per write re-rolls key and nonce; a reused nonce is refused. Rewrites use the current epoch, and removed owner-set members derive no future epoch. - Versioning. Canonical CBOR Encoding, with refuse-to-write when
max_known_settings_schema < settings_schema, as for sidecars. ASmartAlbumDefinitionwith a newerpredicate_schemais preserved verbatim and never evaluated or stripped. - Merge. Each mutation is a device-signed, OGK-sealed
(section, key, stamped value)operation with theprior_provenance_hashlink. Merge is field-wise LWW by position on the document’s own operation chain, under the same rule as an asset’s registers (Collaborative Metadata), with no cross-field invariants. Thetsinside an operation is audit-only. The server sees only ciphertext andogk_version.
Grouping Convergence (Requirement)
Section titled “Grouping Convergence (Requirement)”Every grouping operation, manual or AI, is idempotent and order-independent by construction:
| Structure | Mechanism | Why it converges |
|---|---|---|
Tags (tags_user / tags_ai) |
OR-set | Add/remove keyed by add_id; commutative, associative, idempotent |
Regions (regions) |
Map of LWW registers, each holding an OR-set of labels | Merged as a semilattice: a delete is final, live writes keep the later shape and the union of labels |
Caption / rating / capture_timestamp_user / gps_user / stack_membership / cull / hidden / sensitivity_ai |
LWW register | Total order by provenance-chain position; replay is a no-op |
| Smart albums, unnamed people clusters, aggregated federated albums (Federation) | Computed views | Nothing stored; membership is a deterministic function of inputs (Asset Organization — System & Smart Albums (Views), AI/ML Integrations — AI Output Containment) |
| People corrections (names, merges, assignments) | LWW maps in the library-settings document | People are a pure function of faces plus corrections, so devices that hold the same corrections show the same people (People) |
| Container-album membership | Single home + ordered lifecycle ops | One container per asset; a replayed move no-ops (Asset Organization — Container Albums); concurrency ordered by MLS commits |
Album membership is not a CRDT: MLS commits (MLS Group Membership) already give a total order.
Tag Provenance and Namespacing
Section titled “Tag Provenance and Namespacing”User and AI tags are structurally separate OR-sets (tags_user, tags_ai), so an AI tag can never overwrite user intent.
- Every
tags_aientry carriesmodel_idandmodel_version(AI/ML Integrations — Embedding Provenance). When a new release completes its generation cutover (AI/ML Integrations — Generation Cutover), old tags are stale; cross-model comparison is forbidden (Validation Invariants — Client-Side Validation Invariants). - Promote: an explicit, signed user action, never automatic, copies the entry to
tags_userwith a freshadd_id. - Dismiss: an OR-set remove on
tags_aiby the originaladd_id.
Any future ML field overlaying a user-editable one (face labels, location guesses) uses the same dual namespace.
Geolocation
Section titled “Geolocation”GPS is stored in the datum the source supplied (gps.datum, Closed Enum Value Sets): WGS-84 by default, or GCJ-02 for coordinates from Chinese maps. BD-09 exists only at the input edge. Datum conversion for search, clustering and display is deterministic and client-side, with GCJ-02 → WGS-84 marked approximate (Places — Datum and Basemaps). Place names are derived from the location and never stored in the sidecar (Places — Place Names). A user’s location edit lands in gps_user beside the imported fix (As-Imported and User Values), stored verbatim in the datum the user entered it in.
Failure Modes
Section titled “Failure Modes”| Failure | Detected / contained by | Recovery |
|---|---|---|
| CBOR non-determinism | Canonical CBOR Encoding | Byte-identical re-encode |
| Old client strips unknown sidecar fields | Signature covers all bytes; writes above the client’s max sidecar_schema refused |
Quarantine |
Known Gaps
Section titled “Known Gaps”- A capture whose EXIF has a local time and no offset cannot be stored faithfully:
capture_timestampis an RFC 3339 instant, so import falls back to the import clock (capsule-library/src/lifecycle/import.rs,folded_capture). The sidecar needs a floating form before the format freeze. editsand the batch time corrections are not implemented.
Validation
Section titled “Validation”Each MUST above is a unit test, and the canonical-CBOR known-answer vectors are a blocking cross-language gate. Notable cases:
- Add-id reseed never reuses a counter.
- OR-set and library-settings merges converge byte-identically in every permutation.
- A remove of an unobserved
add_idis rejected. - A near-simultaneous caption loser lands in
superseded_captions. - A capture-time or location edit keeps the as-imported value through a re-import, a reopen and an index rebuild.
- Each privacy-table row strips by default and leaves the local sidecar unchanged.
- A WGS-84 sidecar encodes byte-identically to the pre-
datumvector. - A far-future
tson a register write loses to a later write on the chain. - A sidecar with no
media_subtype,original_filename,capture_settings,videoorsensitivity_aiencodes byte-identically to the pre-field vector; an older reader keeps each verbatim and re-signs nothing. videokeeps a fixture’s30000/1001frame rate exactly, is absent on a still, and drops a zero-term rate and an empty codec.capture_settingsround-trips each EXIF fixture’s rationals exactly; a zero denominator, an over-long or NUL-padded string, and a lens serial are each handled as specified.- A one-byte local mutation fails the local–server equivalence check.
- A sidecar round-trips between schema v1 and v2 readers.
- A sidecar with no
editsencodes byte-identically to the pre-field vector; a recipe with an unknownrecipe_versionrenders the unedited original and is preserved verbatim. - A batch time shift or zone change writes only
capture_timestamp_user, commits atomically, and its undo restores every prior effective value.
Related
Section titled “Related”- Asset Organization: consumes
stack_membership,cull,hidden. - AI/ML Integrations: models behind
tags_ai. - Thumbnails and Previews: the LQIP scheme in
lqip.