Amikalog upload memories - #1
Merged
Merged
Conversation
beta:push now uploads the Claude memory files
(~/.claude/projects/<project>/memory/*.md) of every project amikalog has
captured Claude sessions for, under the same "<repo>/" key prefix as that
project's sessions ("<repo>/memory/<file>.md").
Memory files are edited in place, unlike append-only session JSONL, so they
can diverge between this machine and the cloud copy other machines pushed. A
dedicated manifest records each file's last-synced content hash and a 3-way
rule decides per file: no cloud copy or only-local change uploads, only-cloud
change pulls the cloud copy down, identical skips, and a file changed on both
sides is merged with the host claude CLI, written back locally, and uploaded.
A failed or unavailable merge never clobbers either side; if claude is not
installed, diverged files are skipped with a warning while the rest upload.
Adds eventlog.Downloader, apiclient.GetObjectByKey for single-object reads,
and a --skip-memories flag.
Uploading Claude memory files is now off by default: beta:push uploads only captured events unless --memories is passed. This keeps memory upload behind an explicit flag while it is being tested, before considering it as a default. Add --all-projects (requires --memories) to also upload memory for projects that have no captured amikalog session. The repository prefix for such a project is recovered from its own Claude transcript working directory and that directory's git repo, falling back to "unknown-repo". Replaces the previous --skip-memories flag.
GetObjectByKey listed the downloads endpoint with the full object key as the `prefix`, then exact-matched. The storage backend treats a listing prefix as a folder path, so a prefix that includes the filename matches nothing and the lookup always reported found=false. That made `amikalog beta:push --memories` re-upload every memory file on every run: reconcileMemory always took the "no cloud copy yet" branch because the cloud read-back never found the object, regardless of the local push manifest. Session/event uploads were unaffected because they dedup via the byte-size manifest and never call GetObjectByKey. List the object's parent folder (up to and including the final "/") and exact-match within it. Add regression tests that fake the downloads endpoint with folder-prefix semantics; they fail against the old full-key listing and pass with the fix.
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.
No description provided.