Repository navigation
fix: init seeds the store the server reads; repo keeps config + hooks (GIT-115) - #57
Merged
1 commit merged intoSep 23, 2026
Merged
1 commit merged into
1 commit merged into
Conversation
…ig + hooks (GIT-115) init seeded <cwd>/.gitmem while the server reads ~/.gitmem (GIT-91), so a fresh install had no starter lessons and was told its store was "NOT being read". The wizard and init-scars now seed learnings, threads, collections and the closing payload + template into the root the server reads (GITMEM_DIR, then GITMEM_HOME/.gitmem, then ~/.gitmem). The repo's .gitmem/ keeps only config.json (project name) and the hook scripts. - A repo .gitmem/ with only config.json and hooks, or only what an older init seeded, is not a stranded store. Real records (a user's learning, thread or decision) now count, which main did not check at all. - The SessionStart hook reads the repo's project name without jq (node). - uninstall removes the repo's config.json and hooks; the shared store is kept unless --all or the user says delete. Hook removal and the wizard's hook merge use the GIT-120 module (bin/hooks-merge.js, identical to #55). - telemetry commands use the server's root. Tests: fresh-install e2e in a clean HOME (9, all fail on main), unit +5, hook suite +1. cli-fresh-install made hermetic (scratch HOME) and repaired; both e2e files wired into CI. Co-Authored-By: Claude Opus 5.5 <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.
GIT-115: init writes the store where the server reads it; the repo keeps config + hooks
Just upgrade the package. Nothing to change on your database. Local files only.
Implements Chris's ruling: move only the store.
config.jsonand the hook scripts stay in the repo's.gitmem/.What was wrong
initseeded<cwd>/.gitmem, but the server has read~/.gitmemsince GIT-91. A fresh install found no starter lessons..gitmem/as "Memory store found but NOT being read", becauseconfig.jsonalone counted as a live store.jq.uninstalland thetelemetrycommands used<cwd>/.gitmem.gitmem uninstallmatched hooks by the bare word "gitmem".Fix
bin/gitmem-root.jsresolves the store the waygitmem-dir.tsdoes:GITMEM_DIR, thenGITMEM_HOME/.gitmem, then~/.gitmem.init-scarsseed learnings, threads, sessions, decisions, scar-usage,closing-payload.jsonand its template into that root..gitmem/holds onlyconfig.jsonwith{ project }andhooks/.feedback_enabledis written to the store'sconfig.json, because the server reads it there. It is written only on opt-in.config.json, starter lessons or the welcome thread as evidence. A learning, thread or decision of the user's own does count now; main ignored those entirely.session-start.shreads the project name with node whenjqis absent.uninstallremoves only the repo'sconfig.jsonandhooks/, and leaves anything else in the repo's.gitmem/alone. The store is shared by every project, so it is kept unless--allis given or the user declines the keep prompt.bin/hooks-merge.js. The file is identical to the one in fix: install/uninstall-hooks merge per event, keep foreign hooks (GIT-120) #55, so the two branches stack without a conflict.gitmem telemetryuses the server's root.Evidence
Fresh-install e2e
tests/e2e/git-115-fresh-install.test.tsuses a clean HOME and clean repo. It runsinit, the real SessionStart hook, then the built server withsession_startandrecall, then uninstall.~/.gitmem/learnings.json, recall returns "No relevant scars found", session_start shows "NOT being read", and the hook gives no project hint without jq.session_start does not list scars on any install. The test checks it two ways: session_start shows the welcome thread that init seeded into the store under the repo's project, and a recall in that session returns the starter scar "Database Migration Without Rollback Plan".
cli-fresh-install.test.tsBoth e2e files are now wired into CI.
Old tests changed
gitmem-root-resolution.test.ts: "counts a deliberate project-scoped install (config.json)" now asserts the opposite, per the ruling.gitmem-root-symlink.test.ts: the live-store fixture now holds a learning instead ofconfig.json.cli-fresh-install.test.ts: every CLI call now runs with a scratch HOME. It used the developer's real HOME, so with this changeinitwrote into the real~/.gitmem. The init assertions now expect the new layout. The Stop-hook wording test names its registry throughGITMEM_DIR, as GIT-99 requires.🤖 Generated with Claude Code