Add index-time path exclusion via config and --exclude - #94
Merged
Conversation
Transcripts matched by `exclude_paths` in ~/.memex/config.toml (or repeatable `--exclude GLOB` on `memex index`) are now skipped during source discovery, so their content never enters the Tantivy index, the analytics store, or the vector store. This keeps the indexed corpus aligned with the trust boundary when one tool's session tree mixes projects with different confidentiality obligations. - New `exclude_paths` config key with `~/` expansion, and a repeatable `--exclude` CLI flag for one-off runs (both merged). - Exclusions apply at discovery for every source (Claude, Codex, OpenCode, Cursor, Pi, OMP, OpenClaw, Copilot), before metadata access, not at query time. - Records previously indexed from now-excluded paths are deleted from the index and analytics store on the next run, and pruned from ingest state, so adding a pattern does not require --reindex. - Glob matching uses globset with literal_separator(false), and also matches symlink-resolved canonical paths so patterns work with either spelling on systems where temp/home dirs are symlinked. - The background index service command builder forwards --exclude.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
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.
Closes #93.
Problem
memex indexes each supported tool's session store wholesale. When a transcript tree mixes work with different confidentiality obligations (client, employer, personal projects as sibling directories under
~/.claude/projects), indexing is all-or-nothing: whole-source toggles exclude entire tools, and--sourcetakes a single path. Since the Tantivy schema storestext/tool_input/tool_output, andmemex transfer/sharecan move indexed content off-machine, the current answer is to decline the whole tool.Change
An index-time exclusion list, applied during source discovery so matched transcripts never enter the index:
plus a repeatable
--exclude GLOBflag onmemex indexfor one-off runs (merged on top of config patterns).globset(literal_separator(false)so*crosses path separators, and**works as expected). A leading~/is expanded to the home directory.transfer/sharereachability is unchanged for excluded content.--reindexrequired.--exclude; auto-index paths (search, TUI, machine RPC) honor config exclusions.is_excludedalso matches symlink-resolved canonical paths, so patterns work with either spelling where temp/home dirs are symlinked (e.g. macOS/var→/private/var).Verification
cargo fmt --checkandcargo clippy -- -D warningspass.**separator behavior, invalid-pattern rejection,~expansion, empty-pattern no-op, and service command forwarding.cargo test --lib: 356 passed, 2 failures that reproduce identically on cleanmain(sources::hermes::wal_dependency_preserves_invalid_utf8_path_bytes_and_invalidates_on_changefails in isolation;analytics::repository_grouping_uses_git_common_dir_projectis order-dependent and passes alone). Neither touches this change.