Add .mempalaceignore support and expand SKIP_DIRS - #379
Conversation
…agers Projects using Pixi, Conda, or virtualenvs outside the standard .venv/ naming get tens of thousands of stdlib files indexed, drowning out the actual project content. This commit: 1. Adds .pixi, .conda, and .virtualenvs to the hardcoded SKIP_DIRS set so they are excluded by default without any user configuration. 2. Introduces .mempalaceignore — a project-root file that uses the same syntax as .gitignore and is applied on top of the normal .gitignore rules. This lets users exclude paths they still want tracked by git but not indexed by MemPalace (e.g. large data dirs, static site builds, media assets). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
PR Review: Add .mempalaceignore support and expand SKIP_DIRSExecutive Summary
This PR adds However, the PR is based on a stale fork that diverges significantly from current Ratings
IssuesHIGH — Stale Base:
|
| Changed Symbol | Blast Radius | Risk |
|---|---|---|
SKIP_DIRS expansion |
should_skip_dir() → scan_project() → all mine commands |
LOW — additive, narrows scope |
load_mempalaceignore_matcher (new) |
Called once per scan_project() invocation |
LOW — new leaf function |
.mempalaceignore check in scan_project |
All file mining operations | MED — new filter in hot path, but force-include override is preserved |
Summary
| Severity | Count | Key Items |
|---|---|---|
| HIGH | 2 | Stale base risks losing MAX_FILE_SIZE; SKIP_DIRS dual definition will conflict |
| MEDIUM | 3 | Incomplete escape handling; .mempalaceignore not in SKIP_FILENAMES; no tests |
| LOW | 1 | Duplicated parsing logic |
Action Required: Rebase onto current main, add the three SKIP_DIRS entries to palace.py (not miner.py), fix the escape handling inconsistency, add .mempalaceignore to SKIP_FILENAMES, and add basic test coverage.
web3guru888
left a comment
There was a problem hiding this comment.
We run a multi-domain palace (5 wings, 208 discoveries) and .mempalaceignore is something we've wanted. This is a direct match for our use case — we have data directories tracked by git that shouldn't be indexed.
Strengths:
- Reusing
GitignoreMatcherfor.mempalaceignoreis clean — same syntax, same matching behavior, no new parser to maintain. - Adding
.pixi,.conda,.virtualenvstoSKIP_DIRSis well-motivated. Pixi's in-project.pixi/envs/is exactly likenode_modulesand should be skipped by default. - The matcher loads once at the project root and applies to both dirs and files in
scan_project().
A few things to consider:
-
No tests — The test plan is all manual checkboxes. This really needs at least one automated test for
.mempalaceignorebehavior (create a tmpdir with a.mempalaceignore, add some files, runscan_project(), assert exclusions). Thetest_miner.pyfile has good patterns for this — seetest_scan_project_respects_gitignorefor reference. -
Negation pattern interaction — Your parser handles
!patterns, butis_gitignored()applies matchers in ancestor order (last match wins). Since.mempalaceignoreis applied after.gitignorematchers, a!in.mempalaceignorecould un-ignore something.gitignoreexcluded — is that intentional? Might be worth documenting. -
Heads-up: overlap with #403 — roip's Windows compat PR introduces
.mpignorewith the same concept (project-level ignore on top of.gitignore), but using a different filename. If both land, the project will have two competing ignore files (.mempalaceignorevs.mpignore). Worth coordinating on which name wins. I'd slightly prefer.mempalaceignorefor explicitness, but.mpignoreis shorter to type. -
load_mempalaceignore_matcheronly checks project root — Unlike.gitignorewhich can exist at any directory level, your implementation only loads from the project root. That's probably fine for v1 but worth noting in a docstring.
Would love to see this merged (with tests) — it unblocks a real workflow for multi-purpose repos.
🔭 Reviewed as part of the MemPalace-AGI integration project — autonomous research with perfect memory. Community interaction updates are posted regularly on the dashboard.
|
closing in favor of #154 which covers the same .mempalaceignore support. thanks @pintamanta! |
Summary
Motivation
Pixi manages Python environments inside the project (.pixi/envs/default/lib/python3.x/...), like node_modules. Without .pixi in SKIP_DIRS, every mine run indexes thousands of irrelevant stdlib files (ssl.py, typing.py, datetime.py), making the palace noisy and search useless.
The .mempalaceignore solves a related problem: directories tracked by git that should not be in the palace (e.g. data/, site/, binary asset folders). Today the only workaround is patching miner.py directly.
Changes
Test plan