use super::*; const NOW: i64 = 1_793_000_000_000; /// Cotton on a phone, its copy open and nothing else said. fn cotton() -> Facts { Facts { paired: true, open: Open::Open, signs_in: true, syncs: true, founds: true, name: "Cotton".into(), now_ms: NOW, ..Facts::default() } } fn alone() -> SyncFacts { SyncFacts { alone: true, line: "Everything is on this phone".into(), line_state: "alone".into(), ..SyncFacts::default() } } fn ids(list: &Value) -> Vec<&str> { list.as_array().unwrap().iter().map(|item| item["id"].as_str().unwrap()).collect() } // RULE: a fresh local copy is the app, standing local: Sign in is offered first, Erase last and red, and Home says everything is here alone. #[test] fn a_fresh_local_copy_stands_local_and_offers_sign_in() { let answer = answer(&Facts { sync: Some(alone()), device: Some(Device { id: Some("dev-1".into()), copy_bytes: Some(4096), rows: Some(12), caught_up_at: None }), ..cotton() }); assert_eq!(answer["gate"]["stage"], "open"); assert_eq!(answer["gate"]["refusal"], "none"); assert_eq!(answer["stand"], "local"); assert_eq!(ids(&answer["acts"]), ["sign_in", "erase"]); assert_eq!(answer["acts"][0]["label"], "Sign in"); assert_eq!(answer["acts"][1]["red"], true); assert_eq!(answer["sync"]["state"], "alone"); assert_eq!(ids(&answer["notices"]), ["alone"]); assert_eq!(answer["notices"][0]["words"], "No Mac yet · everything stays on this phone"); assert_eq!(answer["device"]["copy_bytes"], 4096); assert_ne!(answer["backup"]["line"], "", "the Backup card's line stands while the phone is local"); } // RULE: a backup in flight says how many rows went up of how many, and offers only stopping it. #[test] fn a_backup_in_flight_counts_its_rows() { let adopt = Adopt { status: "sending".into(), sent: 40, rows: 120, ..Adopt::default() }; let answer = answer(&Facts { stand: Stand::BackingUp, adopt: Some(adopt), sync: Some(alone()), ..cotton() }); assert_eq!(answer["stand"], "backing_up"); assert_eq!(answer["backup"]["sent"], 40); assert_eq!(answer["backup"]["of"], 120); assert_eq!(answer["backup"]["line"], "Syncing your data to your account… 40 of 120"); assert_eq!(grouped(1_300), "1,300"); assert_eq!(grouped(999), "999"); assert_eq!(ids(&answer["acts"]), ["sign_out"]); assert_eq!(answer["acts"][0]["label"], "Stop syncing"); } // RULE (KEPT FOUR, Android walk 27 Nov 2026): every row sent, the adopt waits for the account to come down to this // phone; the line says it syncs and counts nothing ("1 of 1" for three minutes counted nothing), never saving. #[test] fn a_backup_whose_rows_all_went_says_it_syncs_without_a_count() { let adopt = Adopt { status: "sending".into(), sent: 1, rows: 1, ..Adopt::default() }; let answer = answer(&Facts { stand: Stand::BackingUp, adopt: Some(adopt), sync: Some(alone()), ..cotton() }); assert_eq!(answer["backup"]["line"], "Syncing your data to your account…"); for set in ["board", "boot"] { let text = std::fs::read_to_string(format!("{}/../cotton-core/kits/shell/lines/{set}.json", env!("CARGO_MANIFEST_DIR"))).expect("the lines"); for word in ["Saving your data", "saved to your account"] { assert!(!text.contains(word), "the account's sync lines say sync (owner's rule), never {word:?}: {set}.json"); } } } // RULE: connected and caught up, Home is quiet: the sync line is the core's, the acts are Sync now, Sign out and Erase (no "Back up now": signed in is syncing, owner, 21 Nov 2026). #[test] fn connected_and_caught_up_is_quiet() { let sync = SyncFacts { line: "Up to date · just now".into(), line_state: "up_to_date".into(), loop_state: Some("idle".into()), last_pull_at: Some("2026-11-05T10:00:00.000Z".into()), ..SyncFacts::default() }; let device = Device { id: Some("dev-1".into()), caught_up_at: sync.last_pull_at.clone(), ..Device::default() }; let answer = answer(&Facts { stand: Stand::Connected, sync: Some(sync), device: Some(device), ..cotton() }); assert_eq!(answer["stand"], "connected"); assert_eq!(answer["sync"]["state"], "idle"); assert_eq!(answer["sync"]["line"], "Up to date · just now"); assert_eq!(answer["sync"]["line_state"], "up_to_date"); assert_eq!(ids(&answer["acts"]), ["sync_now", "sign_out", "erase"]); assert_eq!(answer["acts"][0]["rank"], "main"); assert_eq!(answer["acts"][2]["rank"], "away"); assert!(answer["notices"].as_array().unwrap().is_empty(), "{}", answer["notices"]); assert_eq!(answer["device"]["caught_up_at"], "2026-11-05T10:00:00.000Z"); } // RULE: a sync stalled — two failed passes in a row — earns Home's one amber line, since when in words; one failure is a blip and says nothing. #[test] fn a_stalled_sync_says_since_when() { let stalled = |failures| SyncFacts { line: "Cotton not reached since 2 h ago".into(), line_state: "not_reached".into(), loop_state: Some("waiting".into()), failures, ..SyncFacts::default() }; let device = Device { caught_up_at: Some(cotton_store::protocol::js::to_iso_string(NOW - 2 * 3_600_000).unwrap()), ..Device::default() }; let once = answer(&Facts { stand: Stand::Connected, sync: Some(stalled(1)), device: Some(device.clone()), ..cotton() }); assert!(once["notices"].as_array().unwrap().is_empty()); let twice = answer(&Facts { stand: Stand::Connected, sync: Some(stalled(2)), device: Some(device), ..cotton() }); assert_eq!(twice["sync"]["state"], "waiting"); assert_eq!(ids(&twice["notices"]), ["not_synced"]); assert!(twice["notices"][0]["words"].as_str().unwrap().starts_with("Not synced since "), "{}", twice["notices"]); assert_eq!(twice["notices"][0]["kind"], "amber"); } // RULE: a sign-in the object stopped taking is said on Home in the kit's words, and the phone stands local with Sign in offered again. #[test] fn a_refused_sign_in_is_said_and_the_phone_stands_local() { let answer = answer(&Facts { signed_out: Some("credential_revoked".into()), sync: Some(alone()), ..cotton() }); assert_eq!(answer["stand"], "local"); assert_eq!(ids(&answer["notices"]), ["signed_out", "alone"]); assert_eq!(answer["notices"][0]["words"], "You have been signed out. Sign in again with your phone number."); assert_eq!(answer["notices"][0]["kind"], "refusal"); } // RULE: a backup that failed says the object's line and offers Try again, Sign out and Erase. #[test] fn a_failed_backup_offers_try_again() { let adopt = Adopt { status: "failed".into(), sent: 3, rows: 9, code: Some("object_full".into()), line: None, founding: false }; let answer = answer(&Facts { stand: Stand::Failed, adopt: Some(adopt), sync: Some(alone()), ..cotton() }); assert_eq!(answer["stand"], "failed"); assert_eq!(answer["backup"]["line"], "Your database is full. Nothing more fits until something is removed."); assert_eq!(ids(&answer["acts"]), ["try_again", "sign_out", "erase"]); } // RULE: there is no first-open choice: a device of a business app holding no database stands at the business's door, with no words and no way out of the core's; an app that founds its own never does, and a start that failed is the fallback, Try again its one way out. #[test] fn no_choice_only_a_door_or_a_start() { let door = answer(&Facts { paired: false, open: Open::Reading, founds: false, signs_in: false, ..cotton() }); assert_eq!(door["gate"]["stage"], "door"); assert_eq!(door["gate"]["words"], json!({})); assert!(ids(&door["gate"]["ways_out"]).is_empty()); assert!(door["acts"].as_array().unwrap().is_empty(), "no acts stand over the gate"); let moving = answer(&Facts { paired: false, open: Open::Reading, ..cotton() }); assert_eq!(moving["gate"]["stage"], "wait", "a founding app whose copy is being moved waits"); let failed = answer(&Facts { paired: false, open: Open::Reading, start_failed: Some("disk full".into()), ..cotton() }); assert_eq!(failed["gate"]["stage"], "failed"); assert_eq!(failed["gate"]["words"]["body"], "Cotton couldn't make a database on this phone. Check there's space free, then try again."); assert_eq!(failed["gate"]["words"]["detail"], "disk full"); assert_eq!(ids(&failed["gate"]["ways_out"]), ["retry"]); assert!(!failed.to_string().contains("starts_itself")); } // RULE: Rigby never syncs: no sign-in, no acts, and the line says everything is here. #[test] fn rigby_never_syncs() { let answer = answer(&Facts { signs_in: false, syncs: false, sync: Some(alone()), ..cotton() }); assert_eq!(answer["stand"], "local"); assert!(answer["acts"].as_array().unwrap().is_empty()); assert_eq!(answer["sync"]["state"], "alone"); assert_eq!(answer["backup"]["line"], "", "no Backup card where there is nothing to back up to"); } // RULE: a business door has no personal object: no Sign in, Sign out or Erase on its Home, whatever its connection. #[test] fn a_business_door_offers_no_personal_acts() { let sync = SyncFacts { line: "Up to date · just now".into(), line_state: "up_to_date".into(), loop_state: Some("idle".into()), ..SyncFacts::default() }; let answer = answer(&Facts { signs_in: false, stand: Stand::Connected, sync: Some(sync), name: "Naga Kitchen".into(), ..cotton() }); assert_eq!(answer["gate"]["stage"], "open"); assert!(answer["acts"].as_array().unwrap().is_empty()); } // RULE: a wait paints nothing at first, names its step past the ceiling with the m:ss clock, and says it is taking long past the stall bound — never offering a way out while a copy opens. #[test] fn a_wait_names_its_step_and_its_clock() { let wait = |elapsed_ms, quiet_ms, open| answer(&Facts { open, elapsed_ms, quiet_ms, ..cotton() })["gate"].clone(); let first = wait(1_000, 1_000, Open::Reading); assert_eq!(first["stage"], "wait"); let slow = wait(7_000, 2_000, Open::Recovering); assert_eq!(slow["stage"], "opening"); assert_eq!(slow["words"]["clock"], "0:07"); assert!(slow["words"]["body"].as_str().unwrap().contains("stopped before"), "{slow}"); assert!(slow["words"]["usually"].is_string()); let stalled = wait(75_000, 12_000, Open::Reading); assert_eq!(stalled["stage"], "stalled"); assert_eq!(stalled["words"]["clock"], "1:15"); assert!(stalled["words"]["note"].is_string()); assert!(stalled["ways_out"].as_array().unwrap().is_empty()); assert!(waits("stalled") && waits("moving") && !waits("open")); } // RULE: a ladder paints the move with its step and percent, holds its last step through the settle, and a failed move stops on its page with Try again and the details. #[test] fn a_move_paints_its_steps_and_its_failure() { let moving = answer(&Facts { open: Open::Reading, migration: Some(Migration { done: 1, total: 4, ..Migration::default() }), ..cotton() }); assert_eq!(moving["gate"]["stage"], "moving"); assert_eq!(moving["gate"]["progress"], json!({"done": 1, "total": 4})); assert_eq!(moving["gate"]["words"]["progress"], "Step 1 of 4 · 25%"); let settling = answer(&Facts { migration: Some(Migration { finished: true, ..Migration::default() }), settling: true, ..cotton() }); assert_eq!(settling["gate"]["stage"], "moving"); let settled = answer(&Facts { migration: Some(Migration { finished: true, ..Migration::default() }), ..cotton() }); assert_eq!(settled["gate"]["stage"], "open"); let failed = answer(&Facts { migration: Some(Migration { failed: Some("table x has no column y".into()), ..Migration::default() }), ..cotton() }); assert_eq!(failed["gate"]["stage"], "move_failed"); assert_eq!(failed["gate"]["words"]["detail"], "table x has no column y"); assert_eq!(ids(&failed["gate"]["ways_out"]), ["retry", "copy_details"]); } // RULE: a device refusal paints first: a wall with no copy open, a banner over an open copy read-only, nothing over one that stays writable, and a revocation keeps its wall with Erase. #[test] fn a_refusal_is_a_wall_a_banner_or_nothing() { let refusal = |code: &str, erase| Some(Refusal { code: code.into(), erase, server_url: None }); let banner = answer(&Facts { refusal: refusal("device_not_approved", false), ..cotton() }); assert_eq!(banner["gate"]["stage"], "open"); assert_eq!(banner["gate"]["refusal"], "banner"); assert!(banner["gate"]["words"]["title"].is_string()); let writable = answer(&Facts { refusal: refusal("upgrade_required", false), ..cotton() }); assert_eq!(writable["gate"]["refusal"], "none"); assert_eq!(writable["gate"]["stage"], "open"); let held = answer(&Facts { refusal: refusal("device_not_approved", false), open: Open::Reading, ..cotton() }); assert_eq!(held["gate"]["stage"], "wait", "the splash holds until the open says whether there is a copy"); let revoked = answer(&Facts { refusal: refusal("device_revoked", true), ..cotton() }); assert_eq!(revoked["gate"]["stage"], "refused"); assert_eq!(revoked["gate"]["refusal"], "wall"); assert_eq!(revoked["gate"]["erase"], true); assert_eq!(ids(&revoked["gate"]["ways_out"]), ["erase"]); assert_eq!(revoked["gate"]["ways_out"][0]["weight"], "red"); let key = answer(&Facts { refusal: refusal("device_key_unreadable", false), paired: false, ..cotton() }); assert_eq!(key["gate"]["stage"], "refused", "a refusal paints ahead of Start"); assert_eq!(ids(&key["gate"]["ways_out"]), ["reset_key"]); } // RULE: an open that failed is the fallback with the open's reason and Try again; a copy that could not be moved is its own refusal. #[test] fn a_failed_open_is_the_fallback() { let failed = answer(&Facts { open: Open::Failed("disk I/O error".into()), ..cotton() }); assert_eq!(failed["gate"]["stage"], "failed"); assert_eq!(failed["gate"]["words"]["detail"], "disk I/O error"); assert_eq!(ids(&failed["gate"]["ways_out"]), ["retry"]); let not_moved = answer(&Facts { open: Open::NotMoved, ..cotton() }); assert_eq!(not_moved["gate"]["stage"], "refused"); assert_eq!(not_moved["gate"]["code"], "not_moved"); } // RULE: the answer is plain JSON a Kotlin shell decodes: strings, ints, bools, arrays and objects at every level. #[test] fn the_answer_is_plain_json() { fn plain(value: &Value) -> bool { match value { Value::Number(number) => number.is_i64() || number.is_u64(), Value::Array(items) => items.iter().all(plain), Value::Object(fields) => fields.values().all(plain), _ => true, } } let answer = answer(&Facts { sync: Some(alone()), device: Some(Device::default()), ..cotton() }); assert!(plain(&answer), "{answer}"); } /// Asks until the gate opens, answering the last answer. The wait is for the /// copy's open on its own thread, not a speed budget, so it is bounded by time /// (60 s), not by 200 asks: under load on rust-main 17366 (cotton-ffi 8/10) the /// 200 asks, about 4 s, ran out before the open did. fn until_open(handle: &CottonHandle) -> Value { let deadline = std::time::Instant::now() + std::time::Duration::from_secs(60); let mut last = Value::Null; while std::time::Instant::now() < deadline { let answer = crate::methods::dispatch(handle, "shell.home", &json!({})).expect("the gate answers"); if answer["gate"]["stage"] == "open" { return answer; } assert!(!["door", "failed", "refused"].contains(&answer["gate"]["stage"].as_str().unwrap()), "{answer}"); last = answer; std::thread::sleep(std::time::Duration::from_millis(20)); } panic!("the gate never opened in 60 s; its last answer: {last}"); } // RULE: a fresh install starts its own database at the gate's first ask and opens on it, off the caller's thread; a relaunch opens the same copy and starts nothing. #[test] fn a_fresh_install_starts_its_own_copy_at_once() { let root = tempfile::tempdir().expect("a synthetic phone container"); let workspace = { let handle = CottonHandle::open(crate::handle::phone_config(root.path())).expect("an open core"); let first = crate::methods::dispatch(&handle, "shell.home", &json!({"device_name": "Test phone"})).expect("the gate answers"); assert_ne!(first["gate"]["stage"], "door", "{first}"); assert!(handle.client().joined_workspace().expect("readable"), "the first ask started the copy"); let open = until_open(&handle); assert_eq!(open["sync"]["state"], "alone", "{open}"); assert!(open["device"]["copy_bytes"].as_u64().unwrap() > 0, "{open}"); read_workspace(&handle).expect("a workspace") }; let handle = CottonHandle::open(crate::handle::phone_config(root.path())).expect("the relaunch"); until_open(&handle); assert_eq!(read_workspace(&handle).as_deref(), Some(workspace.as_str()), "the relaunch opens the same copy"); } // RULE: a business flavour never says Cotton on its gate: the word becomes the app's name, and an app named Cotton-something keeps its name whole. #[test] fn the_gate_is_said_in_the_apps_name() { assert_eq!(said("Cotton is opening your database", "Naga Kitchen"), "Naga Kitchen is opening your database"); assert_eq!(said("Cotton Books is opening", "Cotton Books"), "Cotton Books is opening"); assert_eq!(said("Cotton is opening", "Cotton Books"), "Cotton Books is opening"); assert_eq!(said("CottonDB for Mac and Cottonwood", "Naga Kitchen"), "Naga Kitchen and Cottonwood"); assert_eq!(said("Cotton is here", "Cotton"), "Cotton is here"); let answer = answer(&Facts { open: Open::Reading, elapsed_ms: 6_000, quiet_ms: 6_000, name: "Naga Kitchen".into(), ..cotton() }); assert!(!answer["gate"]["words"].to_string().contains("Cotton"), "{}", answer["gate"]["words"]); } // RULE: the gate reads the manifest the app opened with: Cotton Cinemas opens as Cotton Dev, never a declared business, starts its own database at once and is named by its own manifest (Cotton Cinemas 1.0 (1) showed Start a new database over `first_open: start`, 6 Nov 2026). #[test] fn an_app_of_cottons_own_reads_its_own_manifest() { let root = tempfile::tempdir().expect("a synthetic phone container"); let mut config = crate::handle::phone_config(root.path()); config.flavor = cotton_core::flavor::Flavor::Dev; config.manifest = Some(crate::fixture::own_app_manifest("cinemas", "Cotton Cinemas")); let handle = CottonHandle::open(config).expect("an open core"); assert_eq!(handle.app_name(), "Cotton Cinemas"); until_open(&handle); } /// RULE (launch-fast, 20 Nov 2026: Cotton Story showed its empty screen for minutes while a signed-in copy filled): while the copy's first pull runs, the open answer says the person's things are on their way, in the kit's words; any other open copy, and a gate that is not open, says nothing of it. #[test] fn an_open_copy_still_on_its_first_pull_says_its_things_are_on_their_way() { let bringing = answer(&Facts { bringing: true, ..cotton() }); assert_eq!(bringing["bringing"]["words"], "Loading your data…"); assert_eq!(bringing["bringing"]["state"], "bringing"); // Waiting for another device to let it in, it says so, not "Loading your data…" (walk on dev, 22 Nov 2026). let waiting = answer(&Facts { bringing: true, waiting: Some("Your things from other devices aren't here yet.".into()), ..cotton() }); assert_eq!(waiting["bringing"]["line"], json!("Your things from other devices aren't here yet."), "{waiting}"); // Its last pass failed (incident, 21 Nov 2026): Cotton could not be reached just now. let unreached = answer(&Facts { bringing: true, unreached: true, ..cotton() }); assert_eq!(unreached["bringing"]["state"], "unreached"); assert_eq!(unreached["bringing"]["words"], "Cotton could not be reached just now. Your things come to this phone once it answers."); assert!(answer(&Facts { bringing: false, ..cotton() })["bringing"].is_null(), "a copy that holds its rows says nothing"); assert!(answer(&Facts { bringing: true, open: Open::Reading, ..cotton() })["bringing"].is_null(), "nor does a gate still opening"); } /// RULE (owner, 21 Nov 2026): while a first pull runs, every app draws ONE quiet line from the core, "Loading your data… 42%" with a thin bar, honest items done of items the account holds (never 100% before it ends, no megabytes: they cannot be known before they are sent), and "then your photos" while files wait to come after; before the first page counts it says no number. #[test] fn a_first_pull_says_how_far_it_has_got() { let counted = answer(&Facts { bringing: true, loading: Loading { done: Some(1306), total: Some(3108), files_after: false }, ..cotton() }); let line = &counted["bringing"]; assert_eq!((line["words"].as_str(), line["percent"].as_u64(), line["done"].as_u64(), line["total"].as_u64()), (Some("Loading your data… 42%"), Some(42), Some(1306), Some(3108)), "{line}"); assert_eq!(line["line"], "Loading your data…"); assert!(line["then"].is_null()); let photos = answer(&Facts { bringing: true, loading: Loading { done: Some(3100), total: Some(3108), files_after: true }, ..cotton() }); assert_eq!(photos["bringing"]["words"], "Loading your data… 99%, then your photos", "never 100% while it runs"); assert_eq!(photos["bringing"]["then"], "then your photos"); let early = answer(&Facts { bringing: true, loading: Loading { done: None, total: None, files_after: true }, ..cotton() }); assert_eq!(early["bringing"]["words"], "Loading your data… then your photos"); assert!(early["bringing"]["percent"].is_null()); let empty = answer(&Facts { bringing: true, loading: Loading { done: Some(0), total: Some(0), files_after: false }, ..cotton() }); assert_eq!(empty["bringing"]["words"], "Loading your data…", "an account with nothing counted says no number"); } /// Probe (not a rule): what a fresh kit app's own database is made of on disk, file by file. #[test] #[ignore = "a measurement, run by hand: cargo test -p cotton-ffi --lib what_a_kit_copy_is_made_of -- --ignored --nocapture"] fn what_a_kit_copy_is_made_of() { fn walk(dir: &std::path::Path, root: &std::path::Path, out: &mut Vec<(String, u64)>) { for entry in std::fs::read_dir(dir).into_iter().flatten().flatten() { let path = entry.path(); if path.is_dir() { walk(&path, root, out); } else if let Ok(meta) = entry.metadata() { out.push((path.strip_prefix(root).unwrap_or(&path).display().to_string(), meta.len())); } } } for (kit, name) in [("days", "Cotton Days"), ("messages", "Cotton Comms"), ("notes", "Cotton Words")] { let root = tempfile::tempdir().expect("a synthetic phone container"); let mut config = crate::handle::phone_config(root.path()); config.flavor = cotton_core::flavor::Flavor::Dev; config.manifest = Some(crate::fixture::own_app_manifest(kit, name)); let handle = CottonHandle::open(config).expect("an open core"); until_open(&handle); std::thread::sleep(std::time::Duration::from_secs(3)); let mut files = Vec::new(); walk(root.path(), root.path(), &mut files); files.sort_by(|a, b| b.1.cmp(&a.1)); let total: u64 = files.iter().map(|f| f.1).sum(); println!("PROBE {name}: {} files, {:.1} MB", files.len(), total as f64 / 1e6); for (path, bytes) in files.iter().take(3) { println!("PROBE {:>10} {path}", bytes); } // What the copy itself holds, by table (rows; the line sets are every app's). let sets = handle.client().with_file(|file| { file.driver.get("SELECT COUNT(*) AS n, COUNT(DISTINCT \"set\") AS s FROM cotton_lines", &[]).map_err(|error| error.to_string()).map(|row| row.map(|row| (row.int("n").unwrap_or(0), row.int("s").unwrap_or(0)))) }); let writes = handle.client().with_file(|file| file.driver.get("SELECT COUNT(*) AS n FROM _writes", &[]).map_err(|error| error.to_string()).map(|row| row.and_then(|row| row.int("n")))); println!("PROBE lines (rows, sets) {sets:?}, write receipts {writes:?}"); let outbox = handle.client().with_file(|file| file.driver.all("SELECT COALESCE(w.tbl, '?') AS tbl, COUNT(*) AS n FROM _outbox o LEFT JOIN _writes w ON w.op_id = o.op_id GROUP BY 1 ORDER BY 2 DESC LIMIT 4", &[]).map_err(|e| e.to_string()).map(|rows| rows.iter().map(|r| (r.text("tbl").unwrap_or_default().to_string(), r.int("n").unwrap_or(0))).collect::>())); println!("PROBE outbox {outbox:?}"); } } /// RULE (SHARED COPY, OLDER CORE, owner 28 Nov 2026): an app on an older core than the shared copy's is refused with /// `older_core`, and the person reads the core's own sentence for it, word for word. #[test] fn an_older_core_is_said_plainly() { assert_eq!(super::refusal_line("older_core", "Words").as_deref(), Some(cotton_client::copy_keep::OLDER_CORE)); }