0.1.5: uploading checks everything first; no silent joining

- Before anything is made on the team, upload checks the vault the way the
  hub will (the hub's per-entry check now lives in core): a vault on one
  device only holds every line that looks like a secret as a red card to
  decide; lines marked "not a secret" are told to the team's hub at upload;
  history with a flagged entry offers a fresh start. A refused upload no
  longer leaves an empty vault on the team.
- A vault on one device joins a same-named team vault only when they share
  history; otherwise the team's vault arrives beside it in its own folder.
  (A failed upload's empty vault had silently swallowed Brain.)
- The upload sheet follows the vault live and waits for those decisions.
- Full checks of such a vault are cached by content.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-29 18:23:28 +07:00
parent fdcdecf0f1
commit ac5dba46df
12 changed files with 239 additions and 78 deletions

View File

@@ -76,10 +76,11 @@ pub fn vault_upload(config: &mut Config, name: &str, fresh: bool) -> Result<()>
match lune_core::upload::upload(config, &h, name, fresh) {
Ok(said) => {
println!("{said}.");
println!("Other devices with this vault: `lunesync pair` here, then `lunesync login …` there — it moves over on its own.");
println!("Other devices with this vault: detach it there too, then connect them to the team (`lunesync pair` here, `lunesync login …` there); it joins on its own when it shares this history.");
Ok(())
}
Err(e) if format!("{e}").contains("A fresh start") => bail!("{e}\n`lunesync vault upload {name} --fresh` does that."),
Err(e) if format!("{e}").contains("A fresh start") => bail!("{e}.\n`lunesync vault upload {name} --fresh` does that."),
Err(e) if format!("{e}").contains("Decide about each") => bail!("{e}: `lunesync held`."),
Err(e) if format!("{e}").contains("Detach it") => bail!("{e}: `lunesync vault detach {name}`."),
Err(e) => Err(e),
}