A vault no longer listed: its unsent changes are reported and can be dropped (#1000) #27

Merged
backmeupplz merged 11 commits from board/1000-7093ac into main 2026-11-28 07:14:48 +00:00
Owner

Ticket: https://agentboard.icefish-betta.ts.net/#1000

Merge order: stacked on PR #25 (#999), which is stacked on PR #24 (#997), which waits on PR #18 (#979). Merge those first. Then run git merge origin/main --no-edit here and the diff shrinks to this ticket. Until then, review against board/999-5d4440.

When the server stops listing a vault (you were removed, or it hides the vault), sync() moves it into Session::hidden. Unsent changes to it used to stay on the device with no warning, and nothing could drop them.

  • Sync warning: every sync now reports a hidden vault with pending changes: "vault X isn't listed for you any more, so this device's changes to it can't be sent unless it's shared with you again; to drop them, run plaintext vault reset ". The hint uses the id prefix because names are attacker-controlled.
  • Dropping the changes: Session::discard_changes now accepts a hidden vault. It can't be downloaded, so Vault::forget resets it to its rollback guard (manifest counter and hash) and nothing else, so nothing can push the dropped changes. Its items were already invisible.
  • If it's listed again: with no roster, the next pull is a full download (since=0&latest=true). apply lets such a vault start from the latest manifest, but refuses (Rollback) one older than the kept counter, or a different one at the same counter.
  • The guard survives a refused copy: in sync's error arm, a guarded vault without a roster now goes back to hidden instead of being dropped, so the next sync is still guarded (this matters for long sessions such as MCP and the apps).
  • CLI: plaintext vault reset resolves hidden vaults too (Session::vault_or_hidden). Session::vault is unchanged, because other commands index vaults with its result.
  • Known limit, written into DESIGN.md: after such a reset, the new latest manifest isn't checked to link to the kept one, as on a new device. A server can prompt the reset by hiding a vault. Any branch it serves must still be signed by a current writer, and the roster is still guarded by the keyring checkpoint.
  • PARITY.md is updated.

Tests

  • New: a_vault_no_longer_listed_can_drop_its_unsent_changes, in two parts.
    • A real removal: an offline edit, delete and add, then the warning on every sync, the lookup, a reset of 3 changes, a clean sync, and a re-share where Bob gets the server's copy and nothing he dropped reaches Alice.
    • A hide/unhide with no new key: a reset, two syncs that each refuse a replayed older copy and keep the guard, then a clean full download equal to Alice's.
  • Core: sync_and_server_tampering checks that a reset vault refuses an older copy and a same-counter fork, and accepts the real one.
  • Each check was confirmed to fail when its fix is removed: the apply guard, the same-counter half, and the error-arm change.
  • cargo clippy --all-targets -D warnings and cargo test --workspace --locked pass.

🤖 Generated with Claude Code

Ticket: https://agentboard.icefish-betta.ts.net/#1000 **Merge order:** stacked on PR #25 (#999), which is stacked on PR #24 (#997), which waits on PR #18 (#979). Merge those first. Then run `git merge origin/main --no-edit` here and the diff shrinks to this ticket. Until then, review against `board/999-5d4440`. When the server stops listing a vault (you were removed, or it hides the vault), `sync()` moves it into `Session::hidden`. Unsent changes to it used to stay on the device with no warning, and nothing could drop them. - **Sync warning:** every sync now reports a hidden vault with pending changes: "vault X isn't listed for you any more, so this device's changes to it can't be sent unless it's shared with you again; to drop them, run plaintext vault reset <id prefix>". The hint uses the id prefix because names are attacker-controlled. - **Dropping the changes:** `Session::discard_changes` now accepts a hidden vault. It can't be downloaded, so `Vault::forget` resets it to its rollback guard (manifest counter and hash) and nothing else, so nothing can push the dropped changes. Its items were already invisible. - **If it's listed again:** with no roster, the next pull is a full download (`since=0&latest=true`). `apply` lets such a vault start from the latest manifest, but refuses (`Rollback`) one older than the kept counter, or a different one at the same counter. - **The guard survives a refused copy:** in sync's error arm, a guarded vault without a roster now goes back to `hidden` instead of being dropped, so the next sync is still guarded (this matters for long sessions such as MCP and the apps). - **CLI:** `plaintext vault reset` resolves hidden vaults too (`Session::vault_or_hidden`). `Session::vault` is unchanged, because other commands index `vaults` with its result. - **Known limit, written into DESIGN.md:** after such a reset, the new latest manifest isn't checked to link to the kept one, as on a new device. A server can prompt the reset by hiding a vault. Any branch it serves must still be signed by a current writer, and the roster is still guarded by the keyring checkpoint. - PARITY.md is updated. **Tests** - New: `a_vault_no_longer_listed_can_drop_its_unsent_changes`, in two parts. - A real removal: an offline edit, delete and add, then the warning on every sync, the lookup, a reset of 3 changes, a clean sync, and a re-share where Bob gets the server's copy and nothing he dropped reaches Alice. - A hide/unhide with no new key: a reset, two syncs that each refuse a replayed older copy and keep the guard, then a clean full download equal to Alice's. - Core: `sync_and_server_tampering` checks that a reset vault refuses an older copy and a same-counter fork, and accepts the real one. - Each check was confirmed to fail when its fix is removed: the `apply` guard, the same-counter half, and the error-arm change. - `cargo clippy --all-targets -D warnings` and `cargo test --workspace --locked` pass. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review: same-counter fork test, warning wording, known limit in DESIGN
All checks were successful
CI / wasm (pull_request) Successful in 2m6s
CI / check (pull_request) Successful in 3m4s
7d3c6c89b7
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
backmeupplz changed target branch from board/999-5d4440 to main 2026-11-28 06:06:33 +00:00
Merge main: port the unlisted-vault reset onto the async Session (#1000)
Some checks failed
Apple / Apple (pull_request) Successful in 33s
release / build (macos-latest, true, aarch64-apple-darwin) (pull_request) Successful in 4m13s
release / build (macos-latest, true, x86_64-apple-darwin) (pull_request) Successful in 4m49s
Android / android (pull_request) Has been cancelled
CI / check (pull_request) Has been cancelled
CI / wasm (pull_request) Has been cancelled
release / build (ubuntu-24.04, true, aarch64-unknown-linux-musl) (pull_request) Failing after 7s
release / build (ubuntu-24.04, false, x86_64-pc-windows-gnu) (pull_request) Failing after 7s
release / build (ubuntu-24.04, true, x86_64-unknown-linux-musl) (pull_request) Failing after 11s
release / release (pull_request) Has been skipped
release / homebrew (pull_request) Has been skipped
release / docker (pull_request) Has been skipped
cb8377ca33
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review: show a removed vault's changes in full on reset; its guard pins the manifest it saw
Some checks failed
Apple / Apple (pull_request) Successful in 35s
Android / android (pull_request) Has been cancelled
CI / check (pull_request) Has been cancelled
CI / wasm (pull_request) Has been cancelled
094362eae2
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review: a removed vault's reset preview prints each change as JSON, secrets included
All checks were successful
Apple / Apple (pull_request) Successful in 21s
CI / check (pull_request) Successful in 3m54s
CI / wasm (pull_request) Successful in 5m4s
Android / android (pull_request) Successful in 17m55s
476b5d1c5f
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
backmeupplz deleted branch board/1000-7093ac 2026-11-28 07:14:49 +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!27
No description provided.