Repository navigation
feat(memory): sync onboarding — sync init, opt-in auto pull/push, one-time nudge - #179
Merged
Merged
Conversation
…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
|
✅ Docker image built successfully
|
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
Closes the three onboarding gaps in gap #4 (#176/#178) — confirmed missing in review: you had to hand-write
~/.kit/sync.toml, there was no setup command, no upgrade hint, and nothing pulled/pushed automatically (which made the ephemeral-container flow a manual chore).Type of Change
Changes Made
A —
kit memory sync initwrites the LOCAL~/.kit/sync.tomltemplate:--remote <url>(git, default) or--commandwith--push-cmd/--pull-cmd;--autoturns on the hooks;--forceoverwrites.KIT_MEMORY_PASSPHRASE, and 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 (memory reaches your durable store before the box is reclaimed).tryAutoPull/tryAutoPushnever 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 initonce (a~/.kitmarker suppresses it thereafter).New exports in
remote-sync.ts:initSyncConfig,tryAutoPull,tryAutoPush,maybeSyncNudge;SyncConfiggainspullOnStart/pushOnEnd.Testing
Test Coverage
push_on_endvia command transport; nudge shows-once)npm test) — 1952 pass, 0 failManual Testing
kit memory sync init --remote … --autowrites a config withpull_on_start/push_on_end; re-run without--force→ no clobber.tryAutoPushwithpush_on_end+ acp-based command transport deposits the encrypted blob (the ephemeral path).tryAutoPull/tryAutoPushare no-ops (never throw) without the flags.maybeSyncNudgereturns the tip once for a non-trivial store, then null; null once configured.🤖 Generated with Claude Code
https://claude.ai/code/session_015ERHw6bVUz39sAuoQZ1iyg
Generated by Claude Code