//! CottonDB's store — one SQLite file per person.//!//! Step 1 of the Rust core.//! Nothing in this crate reads the clock or a random source: every stamping//! function takes `now`, every id takes its bytes from the caller./// The two rows a brand-new file needs before anything can be written into it.pubmod audience;pubmod birth;pubmod canonical;/// The Cotton package: what a database holds, as one `.cottonpkg` file another/// database imports through the mint.pubmod cottonpkg;/// The open bundle: a kit's library as a folder tree other apps open (OPF,/// OPDS, Goodreads CSV, M3U8, OPML …), beside the `.cottonpkg`.pubmod open_bundle;/// An author's own writes, read back out of the tables that hold them — what/// replaced tailing `_ops` at version 8.pubmod changes;pubmod create;/// How far this file has seen each author's writes.pubmod cursors;pubmod derived;pubmod driver;pubmod process_lock;pubmod dump;/// An erase out of the bin leaves no history behind — the one step the fold/// takes for a deleted binned row, in every file.pubmod erase;/// Facts in the fold, and the registry of what folding one sets off.pubmod fact_hooks;pubmod error;pubmod exchange;/// Which file this is and which namespace its derived ids take — the only/// place either is made outside a test.pubmod file_identity;pubmod fold;pubmod fts_fill;pubmod fts_purge;pubmod index_later;/// An OAuth refresh chain's rotations, as facts, and how reuse is read off them.pubmod grant_rotations;/// What a device keeps: the keep rules and the one judge both sides read.pubmod keep;// The link rule (design 5.3): a record in a place never points into Mine.pubmod link_rule;pubmod local_places;/// Nothing waits while it holds a file — the mark every file lock sets and the/// check every wait makes.pubmod held;/// Judge time: the relay's reading carried forward by the continuous clock,/// and the rules for which readings are taken (slice 1).pubmod judge;/// Where a test resolves a path from — the crate directory read at RUN time,/// never the compile-time constant a cached binary carries.pubmod manifest;/// `cotton_media_holdings` — who holds which bytes, and the ONE spelling of/// "who is a live holder": the hold is not dropped and the device is not/// revoked.pubmod media_holdings;/// The budgeted phone cache: which `_media` rows the budget may take, in what/// order, and how many bytes that is.pubmod media_evict;pubmod storage_rules;pubmod media_ledger;/// Media leaves when its last record goes: erasure facts, the dead-key rule.pubmod media_erasure;/// `MEDIA_KEY_HOLDERS` and the `_media_key_names` index of who names a key.pubmod media_keys;pubmod media_unlink;pubmod media_thumbs;/// Separately signed facts binding a member to this database's People row.pubmod member_person;pubmod membership;pubmod meta;pubmod migrate;/// The one way a file of an older schema crosses to this build's: in place,/// from the difference between its flat DDL and this build's, for every stamp/// from the oldest file a shipped build wrote (141). Run by every device's/// open, step by step on a phone.pubmod shape_move;pubmod outbox;/// Every stored phone into libphonenumber's E.164, at each open (22 Oct 2026).pubmod phone_fold;pubmod runner_change;pubmod presence;pubmod protocol;pubmod receipts;/// `_parked` — the writes nobody could fold, kept WHOLE so they can be/// folded again.pubmod rejected;/// Revocation facts and the one reader of a device's standing.pubmod revocation;pubmod schema;pubmod search;/// Which machine serves this database, epoch by epoch.pubmod serving;pubmod serving_handover;pubmod serving_grant;pubmod serving_succession;pubmod signed;pubmod snapshot;pubmod soft_refs;pubmod spans;/// A workspace file for the price of a copy — for the TESTS of the crates that/// depend on this one. `cfg(test)` as well as the feature, so this crate's own/// suite reaches the module: a test no configuration compiles is invisible,/// not skipped.#[cfg(any(test, feature = "test-template"))]pubmod test_template;// Files at a chosen schema version and the synthetic owner file, for the// TESTS of every crate that proves an upgrade. Never in a shipping build.#[cfg(feature = "fixtures")]pubmod fixtures;/// The fixtures the fold, outbox, ledger and search tests share: a file at the/// real v45 shape, with an identity and a workspace row in it.#[cfg(test)]mod test_support;pubuse driver::{Driver, Folded, Row};pubuse error::{Result, StoreError};pubuse manifest::manifest_dir;pubmod media_backup_lock;// The one write path (slice 2a): who asks, where a write is made, and the two// readers that build an op back from bytes or rows.pubmod actor;pubmod mint;pubmod stored;/// Undo of an add: an erase of its own reason, judged once on the device that asks.pubmod take_back;pubmod thread_band;pubmod wire;pubmod device_scope;#[cfg(test)]mod reader_role_tests;/// Read-only world facts on Cotton's server (places, holidays, airports,/// words); never a synced database and never bundled.pubmod published;/// Creator deletion eligibility and the shared thirty-day Bin retention.pubmod database_bin;pubmod server_actions;