Repository navigation
feat(memory): transport = "command" for non-git memory sync (S3/rclone/scp/USB) - #178
Merged
Merged
Conversation
…clone/scp/USB) Gap #4 shipped a git-remote transport; the encrypted blob is the real unit and git is just one way to move it. This adds a second, transport-agnostic option so you're not locked into git: set `transport = "command"` in ~/.kit/sync.toml with push_cmd / pull_cmd, and kit runs your command with the encrypted blob path exposed as $KIT_MEMORY_BLOB. [memory.sync] transport = "command" push_cmd = "aws s3 cp \"$KIT_MEMORY_BLOB\" s3://my-bucket/kit-memory.enc" pull_cmd = "aws s3 cp s3://my-bucket/kit-memory.enc \"$KIT_MEMORY_BLOB\"" Same guards as the git transport: the command is read ONLY from the LOCAL ~/.kit/sync.toml (never the project tree, so a cloned repo can't inject it), the payload stays AES-256-GCM encrypted (the store sees only ciphertext), and it's opt-in. push encrypts → runs push_cmd; pull runs pull_cmd → merges (last-write- wins) if a blob arrived, else reports "not found". SyncConfig gains a `transport` discriminator (git | command); push/pull branch on it; result field `remote` → `target` (the URL, or "command transport"). Help text shows both forms. 3 new tests (config validation, cp-based round trip, empty-pull) over the existing git ones. 1948 tests pass. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015ERHw6bVUz39sAuoQZ1iyg
|
✅ Docker image built successfully
|
sandstream
pushed a commit
that referenced
this pull request
Jun 30, 2026
…ne-time nudge Closes the usability gaps in gap #4 (#176/#178): you had to hand-write ~/.kit/sync.toml and nothing synced automatically — which made the ephemeral-container flow (push before the box is reclaimed) a manual chore. A. `kit memory sync init` — writes the LOCAL ~/.kit/sync.toml template (--remote <url> for git, or --command with --push-cmd/--pull-cmd; --auto enables the hooks; --force overwrites). Won't clobber an existing config; reminds you to set KIT_MEMORY_PASSPHRASE and to create the private repo (kit makes the branch + blob, not the repo). B. Opt-in auto-sync wired into the memory hooks: - [memory.sync] pull_on_start = true → pull+merge at SessionStart, BEFORE the "where you left off" recovery, so it reflects the merged store. - [memory.sync] push_on_end = true → index+push at SessionEnd — the missing piece for ephemeral containers. Both fail-soft (tryAutoPull/tryAutoPush never throw): a session is never blocked by sync. Notes go to stderr; the injected recovery stays on stdout. C. One-time upgrade nudge: when sync isn't configured but a non-trivial memory store exists, suggest `kit memory sync init` once (a ~/.kit marker suppresses it thereafter). New exports in remote-sync.ts: initSyncConfig, tryAutoPull, tryAutoPush, maybeSyncNudge; SyncConfig gains pullOnStart/pushOnEnd. `sync init` routed in the memory dispatcher; auto-pull/push + nudge wired into memHook. 4 new tests (init round-trip, auto-sync gating, command push_on_end, nudge once). 1952 pass. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015ERHw6bVUz39sAuoQZ1iyg
3 tasks done
sandstream
added a commit
that referenced
this pull request
Jun 30, 2026
…-time nudge (#179) Closes the usability gaps in gap #4 (#176/#178): you had to hand-write ~/.kit/sync.toml and nothing synced automatically — which made the ephemeral-container flow (push before the box is reclaimed) a manual chore. A. `kit memory sync init` — writes the LOCAL ~/.kit/sync.toml template (--remote <url> for git, or --command with --push-cmd/--pull-cmd; --auto enables the hooks; --force overwrites). Won't clobber an existing config; reminds you to set KIT_MEMORY_PASSPHRASE and to create the private repo (kit makes the branch + blob, not the repo). B. Opt-in auto-sync wired into the memory hooks: - [memory.sync] pull_on_start = true → pull+merge at SessionStart, BEFORE the "where you left off" recovery, so it reflects the merged store. - [memory.sync] push_on_end = true → index+push at SessionEnd — the missing piece for ephemeral containers. Both fail-soft (tryAutoPull/tryAutoPush never throw): a session is never blocked by sync. Notes go to stderr; the injected recovery stays on stdout. C. One-time upgrade nudge: when sync isn't configured but a non-trivial memory store exists, suggest `kit memory sync init` once (a ~/.kit marker suppresses it thereafter). New exports in remote-sync.ts: initSyncConfig, tryAutoPull, tryAutoPush, maybeSyncNudge; SyncConfig gains pullOnStart/pushOnEnd. `sync init` routed in the memory dispatcher; auto-pull/push + nudge wired into memHook. 4 new tests (init round-trip, auto-sync gating, command push_on_end, nudge once). 1952 pass. Claude-Session: https://claude.ai/code/session_015ERHw6bVUz39sAuoQZ1iyg Co-authored-by: Claude <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.
Description
Follow-up to gap #4 (#176). The git remote was one transport; the encrypted blob is the real unit, and you shouldn't be locked into git. This adds a second, transport-agnostic option:
transport = "command", so memory can move over S3 / rclone / scp / a USB mount — anything you can script.Type of Change
Changes Made
~/.kit/sync.toml:$KIT_MEMORY_BLOB, and runs yourpush_cmd(upload) /pull_cmd(download → merge).SyncConfiggains atransportdiscriminator (git | command);pushMemory/pullMemorybranch on it; the result fieldremote→target.~/.kit/sync.toml(never the project tree → a cloned repo can't inject it), the payload stays encrypted (the store sees only ciphertext), and it's opt-in. (remote ≠ originis git-specific and N/A here — the command is operator-authored.)Testing
Test Coverage
cp-based push→pull→recall round trip; empty-pull → not found)npm test) — 1948 pass, 0 failManual Testing
transport = "command"withoutpush_cmd/pull_cmd→ clear config error.cp "$KIT_MEMORY_BLOB" <store>/cp <store> "$KIT_MEMORY_BLOB"(same shape asaws s3 cp): machine A push deposits an encrypted blob → machine B pull recalls A's message.pull_cmdthat produces no blob → reports "not found" cleanly.🤖 Generated with Claude Code
https://claude.ai/code/session_015ERHw6bVUz39sAuoQZ1iyg
Generated by Claude Code