Skip to content

Feature/multi source#4

Open
chrisribe wants to merge 14 commits into
mainfrom
feature/multi-source
Open

Feature/multi source#4
chrisribe wants to merge 14 commits into
mainfrom
feature/multi-source

Conversation

@chrisribe

Copy link
Copy Markdown
Owner

Enables multi source memories to be referenced on search.
This avoids lumping all memories into the same repo (work, personal, AI bot, learnings index)

chrisribe and others added 13 commits June 17, 2026 08:00
- source add <name> <path|url>
- source list with awk parsing
- JSON store at ~/.config/git-mem/sources.json
- KISS: no jq dependency
- Multi-source search walks all enabled sources
- Process substitution preserves raw_results variable
- enable/disable toggle with awk (no jq)
- Fixed awk regex (space not \s)
- Tested: hermes-base + team sources
- Use cases: Hermes base, team sharing, work/personal
- Commands reference
- Architecture diagram
- Edge case test results
- Clean test suite instructions
- 200 LOC, no jq dependency
Handle scp-style SSH remotes correctly in `git-mem source add`
@chrisribe

Copy link
Copy Markdown
Owner Author

@copilot please review and insure this is ready for main. I have been using it for 2-3 weeks now and did not see issues, but only set and forgot about it so.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds multi-source (federated) memory search to git-mem, enabling users/agents to search a primary memory store plus additional read-only “source” repos without merging them into one repo.

Changes:

  • Add git-mem source subcommands (add/list/enable/disable/remove/sync) and update search to query enabled sources with source attribution (including search --json).
  • Add a dedicated multi-source test suite and update existing tests for revised commit-count expectations.
  • Expand documentation to describe multi-source usage and configuration.

Reviewed changes

Copilot reviewed 9 out of 13 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
git-mem Implements federated search across sources and adds source management commands.
tests/test-source.sh New end-to-end suite covering source lifecycle + multi-source search attribution.
tests/test-basic.sh Updates commit-count expectations to include init/meta commit.
tests/test-sync.sh Updates sync commit-count expectations to include init/meta commit.
README.md Documents multi-source feature and updates command/config sections.
MULTI-SOURCE.md Adds standalone multi-source documentation and design explanation.
SKILL.md Updates skill docs to mention sources and new env var.
docs/roadmap.md Marks multi-source work as done and updates test suite counts.
docs/UBIQUITOUS_LANGUAGE.md Formatting-only adjustments (content unchanged).
docs/benchmark.md Formatting-only adjustments (content unchanged).
.gitattributes Enforces LF endings for shell scripts and git-mem for cross-platform safety.
.gitignore Formatting-only adjustment.
LICENSE Formatting-only adjustment.
Comments suppressed due to low confidence (2)

git-mem:865

  • count_memories only recognizes repos with a .git directory. This disagrees with iter_sources (which accepts a .git file too), and will report 0 entries for valid worktree-style repos.
    [[ ! -d "$path/.git" ]] && echo "0" && return

README.md:38

  • The on-disk layout diagram currently claims memory-store/ contains only .git/ and "(no other files)", but git-mem init writes and commits a README.md into the store. Update the diagram so it matches actual behavior.
memory-store/
└── .git/    ← the ENTIRE memory store lives here
             (no other files)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread git-mem Outdated
Comment thread git-mem Outdated
Comment thread README.md

## How It Works

The memory store is a git repository. Every memory is stored as an empty commit. The repo has no files — ever.

Copilot AI commented Jul 23, 2026

Copy link
Copy Markdown

@copilot please review and insure this is ready for main. I have been using it for 2-3 weeks now and did not see issues, but only set and forgot about it so.

Addressed the two reviewer findings and the code looks good to merge:

  • search_repo (line 227) and count_memories (line 865): changed [[ ! -d "$path/.git" ]] to [[ ! -d "$path/.git" && ! -f "$path/.git" ]] so git worktrees/submodules (which use a .git file) are no longer silently skipped during search.
  • source add (line 923): changed [[ -d "$real_path/.git" ]] to [[ -d "$real_path/.git" || -f "$real_path/.git" ]] so worktree-backed repos are correctly detected as local paths instead of falling through to URL detection.

All 7 test suites pass. Commit: fix: accept .git as file (worktree/submodule) in search_repo, count_memories, and source add.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants