Sync: no 'vault leave' hint for your own vault, hidden or on a fresh device (#998) #26

Merged
backmeupplz merged 36 commits from board/998-ec2a75 into main 2026-11-28 11:53:15 +00:00
Owner

Fixes #998 (agentboard). Stacked on PR #18 (#979): the base is board/979-ebe940; merge #18 first (Forgejo retargets this PR to main when #18's branch is deleted), or catch this branch up with main after #18 is squash-merged.

When a vault that counts against you fails to sync or isn't listed, sync suggests plaintext vault leave <id>. If you're the only one left in the vault, following that deletes it. A lying server could still get that hint shown for your own vault in two ways: by hiding it (dropping it from vaults while keeping it in paid), or on a fresh device, where a replayed old copy is caught by the keyring's roster checkpoint but no copy is cached locally.

Change

  • Session::is_own (client/src/lib.rs) decides whether a vault is yours. If the device has a verified roster for it, the vault is yours when you created it (roster v0's signer) and that roster lists you as an active owner. If it has no verified roster, the vault is yours only when it's keyring.default_vault, the vault made at signup.
  • Sync now leaves the hint out for your own vault in both places it gave it before: for a vault that fails to sync, and for a vault in paid that isn't listed. An own vault that's hidden is still named, as "vault X counts against your storage, but the server isn't listing it for you (it's yours: don't leave it for that, a server can hide it on purpose)". The earlier text, "only an agent of yours is in it, or your access expired", would be wrong for it.
  • plaintext vault leave warns before you leave your signup vault.
  • DESIGN "Leaving" is updated to match.

Tests (client/src/tests.rs)

  • lying_server_and_hostile_users section 3:
    • hiding the Personal vault gives no hint;
    • a non-default vault of your own ("Work"), hidden and then replayed, gives no hint;
    • on a fresh device, a replayed Personal vault (caught by the roster checkpoint after a roster change) gives no hint, and neither does hiding it;
    • once a co-owner demotes alice in her own vault with a signed expiry, the hint comes back.
    • Each case has a positive control.
  • nobody_is_stuck_paying_for_a_vault, carol/Old: the setup changed. Before, her expiry was set only in the server's database, which looks the same to her device as a server hiding her vault. Now bob demotes her to writer with a signed expiry, carol syncs, and then the expiry passes. She still gets the hint.
  • Mutation checks: each of these fails at least one test:
    • dropping the creator+owner branch;
    • dropping the owner-role check;
    • dropping the default-vault fallback;
    • the old lib.rs.

Accepted costs

  • On a fresh device, only the signup vault counts as yours.
  • Your own vault that fails for good (for example, a co-owner's key clash) names no way out.
  • A creator who never synced their own demotion before it expired gets no hint.
  • Left as it was before this PR: on a fresh device, a server can replay the signup keyring (it has no roster checkpoint) and serve a forged vault under the default vault's id. If the server limits storage, sync then names that vault as "though X created it", with the hint. A server can delete the vault without your help anyway, and a fresh device has no copy to lose.

cargo clippy --locked --all-targets -D warnings and cargo test --locked pass locally.

🤖 Generated with Claude Code

Fixes #998 (agentboard). **Stacked on PR #18 (#979):** the base is `board/979-ebe940`; merge #18 first (Forgejo retargets this PR to `main` when #18's branch is deleted), or catch this branch up with main after #18 is squash-merged. When a vault that counts against you fails to sync or isn't listed, sync suggests `plaintext vault leave <id>`. If you're the only one left in the vault, following that deletes it. A lying server could still get that hint shown for your own vault in two ways: by hiding it (dropping it from `vaults` while keeping it in `paid`), or on a fresh device, where a replayed old copy is caught by the keyring's roster checkpoint but no copy is cached locally. **Change** - `Session::is_own` (client/src/lib.rs) decides whether a vault is yours. If the device has a verified roster for it, the vault is yours when you created it (roster v0's signer) and that roster lists you as an active owner. If it has no verified roster, the vault is yours only when it's `keyring.default_vault`, the vault made at signup. - Sync now leaves the hint out for your own vault in both places it gave it before: for a vault that fails to sync, and for a vault in `paid` that isn't listed. An own vault that's hidden is still named, as "vault X counts against your storage, but the server isn't listing it for you (it's yours: don't leave it for that, a server can hide it on purpose)". The earlier text, "only an agent of yours is in it, or your access expired", would be wrong for it. - `plaintext vault leave` warns before you leave your signup vault. - DESIGN "Leaving" is updated to match. **Tests (client/src/tests.rs)** - `lying_server_and_hostile_users` section 3: - hiding the Personal vault gives no hint; - a non-default vault of your own ("Work"), hidden and then replayed, gives no hint; - on a fresh device, a replayed Personal vault (caught by the roster checkpoint after a roster change) gives no hint, and neither does hiding it; - once a co-owner demotes alice in her own vault with a signed expiry, the hint comes back. - Each case has a positive control. - `nobody_is_stuck_paying_for_a_vault`, carol/Old: the setup changed. Before, her expiry was set only in the server's database, which looks the same to her device as a server hiding her vault. Now bob demotes her to writer with a signed expiry, carol syncs, and then the expiry passes. She still gets the hint. - Mutation checks: each of these fails at least one test: - dropping the creator+owner branch; - dropping the owner-role check; - dropping the default-vault fallback; - the old lib.rs. **Accepted costs** - On a fresh device, only the signup vault counts as yours. - Your own vault that fails for good (for example, a co-owner's key clash) names no way out. - A creator who never synced their own demotion before it expired gets no hint. - Left as it was before this PR: on a fresh device, a server can replay the signup keyring (it has no roster checkpoint) and serve a forged vault under the default vault's id. If the server limits storage, sync then names that vault as "though X created it", with the hint. A server can delete the vault without your help anyway, and a fresh device has no copy to lose. `cargo clippy --locked --all-targets -D warnings` and `cargo test --locked` pass locally. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review: own vault judged by its verified roster first; test a non-default own vault; DESIGN wording
Some checks failed
CI / check (pull_request) Has been cancelled
CI / wasm (pull_request) Has been cancelled
b40f26570d
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review: test that a signed demotion in your own vault brings the hint back
All checks were successful
CI / wasm (pull_request) Successful in 2m18s
CI / check (pull_request) Successful in 5m16s
131378b24e
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Merge remote-tracking branch 'origin/board/979-ebe940' into board/998-ec2a75
All checks were successful
CI / check (pull_request) Successful in 2m45s
CI / wasm (pull_request) Successful in 2m8s
e6f5657132
Hidden own vault's notice carries its full id; DESIGN names the unsynced-demotion cost
All checks were successful
CI / check (pull_request) Successful in 5m42s
CI / wasm (pull_request) Successful in 2m46s
0cc33d9980
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Test the demoted creator's hint on a failed sync; DESIGN names the removed-creator-with-agent cost and how an agent leaves
Some checks failed
CI / check (pull_request) Has been cancelled
CI / wasm (pull_request) Has been cancelled
ad3885203a
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
DESIGN: an agent's every run starts as a fresh device
All checks were successful
CI / check (pull_request) Successful in 4m0s
CI / wasm (pull_request) Successful in 3m10s
43f6543b1c
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
backmeupplz changed target branch from board/979-ebe940 to main 2026-11-28 08:45:41 +00:00
Merge origin/main into board/998-ec2a75
Some checks failed
Apple / Apple (pull_request) Successful in 1m6s
release / build (macos-latest, true, aarch64-apple-darwin) (pull_request) Successful in 5m4s
release / build (macos-latest, true, x86_64-apple-darwin) (pull_request) Successful in 4m42s
CI / check (pull_request) Successful in 6m47s
Android / android (pull_request) Has been cancelled
CI / wasm (pull_request) Has been cancelled
release / build (ubuntu-24.04, true, x86_64-unknown-linux-musl) (pull_request) Failing after 17s
release / build (ubuntu-24.04, true, aarch64-unknown-linux-musl) (pull_request) Failing after 18s
release / build (ubuntu-24.04, false, x86_64-pc-windows-gnu) (pull_request) Successful in 6m28s
release / release (pull_request) Has been skipped
release / homebrew (pull_request) Has been skipped
release / docker (pull_request) Has been skipped
60a1a92f63
Resolves the sync notice conflicts with #997/#999/#1000 (read-only vaults,
hidden vaults kept on the device): is_own replaces the creator check, and
the removed-creator-with-agent test now expects the full id and no hint.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Dropping a hidden vault's unsent changes keeps it yours, so sync still won't suggest leaving it
Some checks failed
Apple / Apple (pull_request) Successful in 26s
Android / android (pull_request) Has been cancelled
CI / check (pull_request) Has been cancelled
CI / wasm (pull_request) Has been cancelled
89aff08896
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A reset signup vault you were demoted in still gets the leave hint
All checks were successful
Apple / Apple (pull_request) Successful in 48s
CI / check (pull_request) Successful in 6m20s
CI / wasm (pull_request) Successful in 6m23s
Android / android (pull_request) Successful in 27m36s
de5bfafbb7
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Hidden own-vault notice no longer claims it's yours; comment on the right arm; reset ownership survives on disk
All checks were successful
Apple / Apple (pull_request) Successful in 37s
CI / check (pull_request) Successful in 6m52s
CI / wasm (pull_request) Successful in 5m13s
Android / android (pull_request) Successful in 24m10s
c6e2fe02ae
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
backmeupplz deleted branch board/998-ec2a75 2026-11-28 11:53:15 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
backmeupplz/plaintext!26
No description provided.