fix: scope per-repo lore sync to the repo's own sessions - #40
Merged
Conversation
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.
Per-repo
lore syncwas pushing ALL unsynced sessions into whatever repo it ran in, so sharing one repo's store (repo access + passphrase) exposed the user's reasoning from unrelated projects. On a real machine this was 288 sessions across many private projects versus the 18 actually belonging to the repo.Fix:
lore syncnow pushes only sessions whose working directory is the repo root or a subdirectory, using path-boundary matching (so/x/foodoes not match/x/foobar) shared with the existing active-session lookup, with LIKE-metacharacter escaping and symlink canonicalization.perform_synctakes the push set from the caller;lore sync statusreports the repo-scoped pending count. Inbound merge is unchanged (a teammate's sessions for this repo still pull normally).Tests: repo-root and nested-subdir included; unrelated and prefix-sibling directories excluded; already-synced excluded; end-to-end assertion that an out-of-scope session is neither stored nor marked synced. Full suite green, clippy
-D warningsclean.