//! CottonDB's domain layer, ported from `packages/core/src` and//! `packages/import-core/src`.//!//! **Pure.** No I/O, no clock, no randomness, no SQLite, no environment —//! every function here takes its world as arguments and returns a value,//! exactly as the TypeScript modules do. Where the TypeScript reads the//! process time zone implicitly (`getHours`, `setDate`, `toLocaleString`) the//! Rust takes the zone as an explicit argument and the doc comment says so.//! `cotton-store` is a dependency only where the TypeScript imports from//! `@cottondb/store` (the JS-faithful string helpers in `protocol::js`,//! `derived_id`, and the content fingerprint that [`import`] must never//! re-derive).//!//! [`import`] is `packages/import-core` and lands INSIDE this crate rather//! than beside it: that package exists in TypeScript only to guarantee//! platform neutrality — nothing in it may import a `node:` module or touch//! `Buffer`, which is what makes every reader's fingerprint match — and that//! constraint is already this crate's own rule.//!//! Where the crate must talk to a database it does so through a TRAIT the//! server implements over crate-local value types, never a `rusqlite` type in//! a signature: [`rules::search_everything::SearchDriver`] is the pattern.//!//! Every module is pinned to its TypeScript original two ways: each case of//! the module's `__tests__` file is ported as a Rust test, and extra vectors//! were computed by RUNNING the TypeScript so that any function whose output//! is a string or a date is compared against what Node actually produced —//! never against a value someone reasoned out.pubmod js_text;// THE OUTBOX A HOUSEHOLD MAC PULLS ITS BACKUP FROM: the routes, the body and// the one path rule the serving Mac and the receiving Mac share.pubmod constants;pubmod definitions;pubmod design;pubmod device;pubmod rules;/// The pure rules, one implementation the Worker runs as WASM too.pubuse cotton_rules;pubmod transforms;pubmod failure;// WHICH APP THIS PROCESS IS — CottonDB or Cotton Dev. Every rule that names// where the data lives or which household a build may reach reads it.pubmod flavor;pubmod lane_sandbox;// THE INVITE LINK a second person joins a database by (KS5): one codec for// the Mac that makes it and the device that claims it, bound to a flavor.pubmod invite_link;// THE INK: the reading rules of letters written above the fan, one// implementation for every shell; the letter model stays the platform's.pubmod ink;pubmod look;// THE ONE DECLARATION OF THE GIT LADDER. Here rather than beside either// caller because there are three: `CottonHost` (a Swift literal twin, held by// `scripts/__tests__/swift-mac.test.ts`), `cotton-client` and `cotton-server`.// Both crates depend on this one.pubmod git;pubmod handles;pubmod import;// PUBLIC because the server needs it too. `Math.round` is a shared// SEMANTIC, not a private convenience: it ties to the LARGER value, so it// disagrees with `f64::round` at every negative half, and any port that// reaches for the wrong one is wrong in a way no type can catch. A second// copy of it in another crate is the same hazard as a second copy of any// rule — the news port had to carry one while this said `pub(crate)`.pubuse cotton_rules::js_number;pubmod keys;/// Cotton Calling: the one-to-one call as a pure rule the shells draw.pubmod calling;pubmod chat;/// Cotton Health: Apple Health readings as a person's own rows, read-only.pubmod health;pubmod language;pubmod mail;pubmod media;pubmod messages;pubmod books;/// Cotton Pages' rules: a web page read into its article, and kept pages exported.pubmod films;pubmod music;pubmod retired;pubmod net;pubmod phrase;pubmod primitives;pubmod qr;pubmod records;pubmod recipes;pubmod front_door;pubmod relay_address;pubmod templates;pubmod vault;pubmod seal;pubmod sites;pubmod kit;pubmod kit_pictures;pubmod toolkits;pubmod genesis;pubmod everything;// Cotton Data: what the app says about the database, read only (assets/design/data).pubmod data;pubmod export;pubmod backup;pubmod albums;