Repository navigation
feat(memory): gzip-compress sync blobs before encryption (~3× smaller) - #193
Merged
Merged
Conversation
A SQLite store compresses well (real store 6.3M→2.1M; large ~139M→~30M), which keeps the encrypted blob under a git host's 100MB file limit and speeds every transport — making a private GitHub repo viable as the ephemeral-session hub. - backup.ts: gzip the DB before encrypting (both passphrase V2 and public-key V3 paths); maybeGunzip on restore. Compression is INSIDE the encryption, so the remote still only sees ciphertext. - Backward-compatible on read with NO new format version: an older uncompressed blob decrypts to a raw SQLite file (no gzip magic 0x1f8b) → passed through. 1 new test (blob < half the raw db + passphrase round-trip intact); all existing round-trips still pass (compression transparent). Suite 1986 green, zero new deps. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015ERHw6bVUz39sAuoQZ1iyg
|
✅ Docker image built successfully
|
This was referenced Jul 1, 2026
Merged
sandstream
added a commit
that referenced
this pull request
Jul 1, 2026
#196) Cut 3.1.0 from [Unreleased]: - gzip-compress memory sync blobs before encryption (~3x smaller, #193) - public-key sync mode — ephemeral sessions push with no secret (#192) - kit agent-config wires GitHub Copilot (#195) - external timestamp anchor via command transport (#186) - plus device-identity hardening + transport fixes Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The encrypted memory blob is a full SQLite store — which can exceed a git host's 100 MB file limit (a real large store is ~139 MB). That blocked using a private GitHub repo as the hub for ephemeral sessions (a self-hosted remote has no cap, but GitHub is the zero-SSH, credential-injected path for ephemeral web sessions — see #192).
What
gzip the DB before encryption. A SQLite file compresses ~3×:
Now well under 100 MB, and every transport moves less data.
How (zero new deps,
node:zlib)backup.ts:gzipSyncthe DB in both the passphrase (V2) and public-key (V3) encrypt paths;maybeGunzipon restore. Compression is inside the encryption — the remote still only ever sees ciphertext.0x1f 0x8b), somaybeGunzippasses it through untouched.Tests
1 new: the blob is < half the raw DB and a passphrase-mode blob still round-trips (compression transparent). All existing backup/asymmetric round-trips still pass. Full suite 1986 green.
Together with #192
#192(public-key mode) + this (gzip) = GitHub-viable, seamless ephemeral capture: a web session encrypts to a public key (no secret), the blob fits under 100 MB, and it pushes via the injected git credential (no SSH key). The self-hosted remote (ralph-ollama) already works either way.🤖 Generated with Claude Code
https://claude.ai/code/session_015ERHw6bVUz39sAuoQZ1iyg
Generated by Claude Code