feat(vault): v2 — compressed entries, chunked objects, index pushes, lazy reads, prune (4.14.0)
Some checks failed
Docker build and publish / docker (push) Has been cancelled
Publish / publish (push) Has been cancelled

Entries are deflate-raw compressed when it pays, split into 4 MiB sealed
parts, and manifests are compressed (SVM2). A push with a local index
reuses unchanged files without downloading anything, and a push with no
changes commits nothing. Readers fetch one manifest and only the entries
they need. The relay records what each version references and can prune
old versions signed by the owner. Cross-language vectors in
test-vectors/vault-v2.json.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-10-16 01:38:45 +02:00
parent bcae7b346e
commit b82a803e0c
42 changed files with 2549 additions and 143 deletions

View File

@@ -5,6 +5,42 @@ All notable changes to Shade are documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [4.14.0] — 2026-10-16 — Vault v2: smaller, cheaper pushes, big files, retention
### Added
- **`@shade/vault`: compressed and multi-part entries.** A file is deflated
(raw, kept only if it saves ≥ 5 %, skipped for known compressed formats)
and split into 4 MiB parts. `VaultEntry` gains optional `enc` and `parts`;
`size` stays the plaintext length. Files over the relay's 8 MiB object limit
can now be backed up at all.
- **Manifest v2**: `"SVM2"` + deflate-raw(JSON). Push writes v2; readers
accept v1 and v2 and refuse anything else.
- **`VaultIndex`** — `push(files, at, message?, { index })` returns an `index`
to persist. With a fresh one, an unchanged file is recognised by plaintext
SHA-256 with no download, no seal and no upload (renames and copies too).
- **A push that changes nothing commits nothing** (`unchanged: true`), unless a
`message` asks for a version.
- **Lazy reads**: `VaultClient.manifest(seq?)` and `readEntry(entry)`; `pull`
is built on them. Exported helpers: `openEntryBytes`, `entryObjectHashes`,
`packEntry`, `sealEntry`, `encodeManifest`/`decodeManifest`, `vaultIndexFrom`.
- **Retention**: signed `POST /v1/vault/:id/prune` `{ keep }`,
`VaultClient.prune(keep)` → `{ removedVersions, removedObjects, freedBytes }`.
The relay records each commit's referenced hashes and collects objects no
remaining version uses. Versions from before this pin their objects until
they are pruned themselves. `VaultRoutesOptions.pruneGraceMs` (default 1 h)
protects uploads whose commit is still in flight.
- `VaultStore.prune` and an optional `refs` argument on `appendLog`;
`SqliteVaultStore` migrates its schema in place on open.
- `test-vectors/vault-v2.json` for the Kotlin port; `@shade/vault/testing`
(fixed-nonce sealing, vectors only).
### Changed
- Push without an index reads only the head manifest and downloads a previous
file only when its path and size match — it used to download every file of
the head. Freshly sealed objects are no longer have-checked (their names are
new by construction). A reused entry takes the file's current `mode`.
- `VaultTransport` has a required `prune` method; custom transports must add it.
## [4.13.2] — 2026-10-15 — No prekey-server call can hang an identity open
### Fixed