//! CottonDB's CLIENT half — a client of a server, never a second writer.//!//! Step 3 of the Rust core (M6). What lives here is everything the Mac app does//! that is not the server and not the screen: the data directory and its//! refusals, the device key's use, which server this Mac talks to, and — as the//! later sub-steps land — the replica, the sync loop, the media drain and the//! ingest sources.//!//! It is its own crate rather than part of `cotton-server` because a client is//! not a server, and because Android will want exactly this code.//!//! Two rules hold across all of it, and both are older than this crate://! **pull always precedes push**, and **every fixture is synthetic** — a real//! number, name or message text anywhere in this tree is a hard failure.//! **What a PHONE gets is this crate with `--no-default-features`** (design//! P2): `data_dir`, `identity`, `layout`, `replica`, `media`, `seams`, `sync`,//! `connection` and `transport` — the client half a phone has always been.//! `ingest` and `ci` are the `host`//! feature, on by default, and every dependency only they need is `optional`//! in `Cargo.toml`. A module absent from a build cannot be reached by mistake,//! which is stronger than a stub that compiles and refuses at runtime./// The first copy of the file: the snapshot, streamed to disk, and the four/// corrections that make it this device's own.pubmod bootstrap;/// CI on a Mac: the bundled runner this machine runs jobs with, registered/// once and supervised on the backup's pattern.////// `host` only: a phone runs no jobs, has no login shell to capture and/// carries no helper to supervise.#[cfg(feature = "ci")]pubmod ci;pubmod connection;pubmod data_dir;pubmod dev_heal;pubmod moves;pubmod copy_keep;pubmod vault_keep;pubmod first_sync;pubmod unsent;pubmod unsent_heal;pubmod identity;/// Git on a Mac — the stat-only ladder that finds it, and the one credential/// this Mac installs for itself. `/usr/bin/git` is never executed.////// `host` only: a phone has no git, no keychain a checkout reads and no/// repository on disk, and the whole module is about a machine that clones.#[cfg(feature = "host")]pubmod git;/// Reading this machine's own Messages, call history, WhatsApp backup and/// Photos library. `host` only: an iPhone has no `~/Library` to read.#[cfg(feature = "ingest")]pubmod ingest;/// The joining half of pairing: this device presents its key, shows the six/// digits the server answered, and waits for somebody to type them.pubmod join;pubmod layout;pubmod media;/// The applier a message import writes through — the Mac's ingest sources and/// the phone's WhatsApp export alike. Feature-free on purpose.pubmod messages_import;pubmod replica;pubmod seams;/// The Stories table's shared pieces, on every build (the phone imports stories too).pubmod stories;/// The Code tool's client half on a phone: a session's terminal bytes.pubmod session_host;/// Starting a database on a device that is nobody's client yet./// Judge time, as this process holds it. On every device, a phone included: a/// replica takes its readings from the serving Mac's answers.pubmod judge;pubmod start;pubmod founding;pubmod sync;pubmod seal;pubmod transport;/// The vault's rows on a device: which devices wait to open it (every/// device's), and writing a secret onto THIS machine as a file (a machine that/// HOSTS, never a phone).pubmod vault;/// The fixtures every suite in this crate shares — synthetic, all of them.#[cfg(test)]mod test_support;pubuse data_dir::{prepare_data_dir, DataDirRefusal, EarlyLog, PrepareDataDirResult, PrepareOps};pubuse identity::{ identity_storage_for, load_or_mint_rehearsal_seed, DeviceIdentity, IdentityStorage, REHEARSAL_MARK,};pubuse layout::Layout;pubuse replica::{ open_replica, open_replica_with, read_ingest_cursor, write_ingest_cursor, MigrationEvent, ReplicaJudge,OpenReplicaInput, Replica, ReplicaError,};pubuse seams::{Clock, Random, SystemClock, SystemRandom};pubuse start::{ start_local, start_place, StartLocal, StartLocalError, StartPlace, StartedLocal, StartedPlace, DATABASE_NAME_MAX,};#[cfg(all(feature = "host", unix))]pubmod file_keys;pubmod hardware_identity;pubmod whole_file;