Populate the drawers collection with 6 entries covering all buckets.
(palace_path, repo_path, deleted_path, elsewhere_path)
| 13 | |
| 14 | |
| 15 | def _seed_drawers(palace_path, repo_path, deleted_path, elsewhere_path): |
| 16 | """Populate the drawers collection with 6 entries covering all buckets.""" |
| 17 | client = chromadb.PersistentClient(path=palace_path) |
| 18 | col = client.get_or_create_collection("mempalace_drawers", metadata={"hnsw:space": "cosine"}) |
| 19 | |
| 20 | metas = [ |
| 21 | { |
| 22 | "wing": "demo", |
| 23 | "room": "src", |
| 24 | "source_file": str(repo_path / "src" / "keep.py"), |
| 25 | "chunk_index": 0, |
| 26 | "added_by": "miner", |
| 27 | "filed_at": "2026-05-09T00:00:00", |
| 28 | }, |
| 29 | { |
| 30 | "wing": "demo", |
| 31 | "room": "build", |
| 32 | "source_file": str(repo_path / "build" / "ignored.py"), |
| 33 | "chunk_index": 0, |
| 34 | "added_by": "miner", |
| 35 | "filed_at": "2026-05-09T00:00:00", |
| 36 | }, |
| 37 | { |
| 38 | "wing": "demo", |
| 39 | "room": "logs", |
| 40 | "source_file": str(repo_path / "app.log"), |
| 41 | "chunk_index": 0, |
| 42 | "added_by": "miner", |
| 43 | "filed_at": "2026-05-09T00:00:00", |
| 44 | }, |
| 45 | { |
| 46 | "wing": "demo", |
| 47 | "room": "stale", |
| 48 | "source_file": str(deleted_path), |
| 49 | "chunk_index": 0, |
| 50 | "added_by": "miner", |
| 51 | "filed_at": "2026-05-09T00:00:00", |
| 52 | }, |
| 53 | { |
| 54 | "wing": "demo", |
| 55 | "room": "convo", |
| 56 | # No source_file key — convo / explicit-add drawers. |
| 57 | "chunk_index": 0, |
| 58 | "added_by": "convo_miner", |
| 59 | "filed_at": "2026-05-09T00:00:00", |
| 60 | }, |
| 61 | { |
| 62 | "wing": "demo", |
| 63 | "room": "elsewhere", |
| 64 | "source_file": str(elsewhere_path), |
| 65 | "chunk_index": 0, |
| 66 | "added_by": "miner", |
| 67 | "filed_at": "2026-05-09T00:00:00", |
| 68 | }, |
| 69 | ] |
| 70 | |
| 71 | col.add( |
| 72 | ids=[ |
no test coverage detected