Aller au contenu
login
arrow_backRetour aux issues
krapcys1-maker/adaptive-agent-memory-research #17

Exclude the scratch tmp/ directory from the project-memory index

ecoDébutant bug good first issue track:engine effort:S no-expertise-needed

descriptionDescription

## The problem The project-memory index walks the repository and indexes text files, but `tmp/` is not excluded. That directory is gitignored scratch space, so disposable working files end up competing with real research documents in memory search results. This is reproducible today: ```bash python -c " import sys; sys.path.insert(0,'.') from tools.project_memory.memory_store import MemoryStore s = MemoryStore('.') print([h['id_or_path'] for h in s.search('packs', limit=30) if h['id_or_path'].startswith('tmp/')]) " ``` Current output includes five scratch files, for example `tmp/reuse-char-repeat/summary.json` and `tmp/pmlab-pack-characterization-v1-repeat/aggregates.json`. This matters more than it looks. A context bundle has a fixed character budget, so every scratch file that wins a slot displaces a real source. ## The fix `tools/project_memory/memory_store.py` already has two exclusion mechanisms near the top of the file: - `EXCLUDED_PARTS` — directory names excluded at any depth (`node_modules`, `work`, `.index`, …) - `EXCLUDED_PREFIXES` — paths excluded from the repository root (`data/snapshots`, `external/repos`, `sources/papers`) `tmp` belongs in `EXCLUDED_PREFIXES`, because only the top-level `tmp/` is scratch. A directory named `tmp` deeper in the tree might be meaningful research data, so excluding the name everywhere would be too aggressive. ## Acceptance criteria - [ ] Top-level `tmp/` is no longer indexed. - [ ] A directory named `tmp` nested deeper in the tree is still indexed. - [ ] A test covers both cases. `tests/test_project_memory.py::test_generated_work_directories_are_not_indexed` is a good pattern to copy. - [ ] `python -m pytest -q` stays green. ## Getting started ```bash git clone https://github.com/krapcys1-maker/adaptive-agent-memory-research cd adaptive-agent-memory-research python -m pip install -r requirements-dev.txt python -m pytest -q ``` No background in memory research is needed for this one. If anything in the setup does not work, say so in this issue — that is useful feedback in itself.
codeOuvre sur GitHub