Milestone 7: the app normal people install (macOS)

A Tauri menu-bar app runs the same sync engine as `lunesync run`. It
connects from the website with no code typed (lune://join and
lune://pair links), shows status in the menu bar, and lets a person
resolve held secrets, held big changes and kept-both notes side by
side. Uninstall shares and hands over first, then removes only what
Lune created.

Releases are signed on the hub that holds the key (`lunehub release
keygen/publish`); other hubs `release import` them. Apps verify the
signature and the signed version. Clients older than the previous
release are asked to update and keep saving locally.

A device can now be on several hubs at once (own and workplace), each
with its own key; the CLI takes --team when it matters. The supervisor
and status summary moved into core, shared by the CLI and the app.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-29 11:47:35 +07:00
parent 8be559817c
commit 6cb85004fb
59 changed files with 6871 additions and 210 deletions

View File

@@ -515,3 +515,54 @@ fn moves_and_appends_are_not_runaway() {
}
assert!(a.save_changes(None, &HashSet::new()).unwrap().unwrap().held.is_some());
}
#[test]
fn uninstall_deletes_only_folders_it_made_and_never_unshared_work() {
let w = World::new();
// Uninstall rewrites the config; keep it inside this test's folder.
unsafe { std::env::set_var("LUNE_HOME", w.folder("home")) };
let other = w.device("Hermes");
let made = w.device_at("Codex", &w.folder("made"));
write(&made, "note.md", "shared\n");
save_and_sync(&made);
// A folder the person already had: Lune adopted it, so it never deletes it.
let own = w.folder("own");
fs::create_dir_all(&own).unwrap();
fs::write(own.join("mine.md"), "mine\n").unwrap();
let remote2 = w.folder("remote2.git");
Repository::init_bare(&remote2).unwrap();
let (own_cfg, _, _) = vault::add("Own", &own, remote2.to_str().unwrap(), "Codex").unwrap();
// A folder Lune made that holds a note with a secret: it can't be shared, so it must stay.
let remote3 = w.folder("remote3.git");
Repository::init_bare(&remote3).unwrap();
let (held_cfg, _, _) = vault::add("Held", &w.folder("held"), remote3.to_str().unwrap(), "Codex").unwrap();
fs::write(w.folder("held").join("aws.md"), format!("# AWS\n{FAKE_KEY}")).unwrap();
let mut config = lune_core::config::Config {
device_name: Some("Codex".into()),
vaults: vec![made_cfg(&w), own_cfg, held_cfg],
..Default::default()
};
let done = lune_core::membership::uninstall(&mut config).unwrap();
assert!(!w.folder("made").exists(), "{done:?}");
assert_eq!(fs::read(own.join("mine.md")).unwrap(), b"mine\n");
assert!(w.folder("held").join("aws.md").exists());
assert_eq!(done.removed.len(), 1);
assert_eq!(done.kept.len(), 2, "{:?}", done.kept);
assert!(config.vaults.is_empty());
// What was shared before uninstalling is still with everyone else.
other.sync().unwrap();
assert_eq!(read(&other, "note.md"), b"shared\n");
}
fn made_cfg(w: &World) -> lune_core::config::VaultConfig {
lune_core::config::VaultConfig {
name: "Test".into(),
path: w.folder("made"),
remote: w.remote.to_str().unwrap().into(),
branch: "main".into(),
hub_vault: None,
hub_url: None,
}
}