fix: return room from process_file to fix stats double-detection#45
fix: return room from process_file to fix stats double-detection#45ichoosetoaccept merged 1 commit intobleedingfrom
Conversation
|
This change is part of the following stack: Change managed by git-spice. |
Greptile SummaryThis PR changes
Confidence Score: 5/5Safe to merge; the core fix is correct and all tests pass. The one finding is a cosmetic dry-run edge case. The fix correctly eliminates redundant room detection and all callers are updated. The only remaining finding is a P2: dry-run summaries could show a blank room name for files too small to process, which does not affect real mine runs or data integrity. src/mempalace/miner.py — the else-branch in mine() around line 627 Important Files Changed
Sequence DiagramsequenceDiagram
participant mine
participant process_file
participant detect_room
participant ChromaDB
Note over mine,ChromaDB: After PR — single room detection
mine->>process_file: filepath, rooms, dry_run, ...
process_file->>detect_room: filepath, content, rooms
detect_room-->>process_file: room (str)
process_file->>ChromaDB: delete(source_file)
process_file->>ChromaDB: add drawers
ChromaDB-->>process_file: ok
process_file-->>mine: (drawer_count, room)
mine->>mine: room_counts[room] += 1
Note over mine,ChromaDB: Before PR — room detected twice
mine->>process_file: filepath, rooms, dry_run, ...
process_file->>detect_room: filepath, content, rooms
detect_room-->>process_file: room (internal, unused by caller)
process_file-->>mine: drawer_count (int only)
mine->>detect_room: filepath, content, rooms
detect_room-->>mine: room (redundant call)
mine->>mine: room_counts[room] += 1
|
ba30125 to
520a968
Compare
Remove the ai_lines[:8] truncation in _chunk_by_exchange() so full AI responses are stored. Add _register_empty_file() sentinel drawer for conversation files that produce 0 chunks, preventing infinite re-processing on subsequent runs. Also fix pre-existing test_miner assertion that expected int from process_file (now returns tuple since PR #45). Ports upstream MemPalace#654, MemPalace#692, MemPalace#695.
Remove the ai_lines[:8] truncation in _chunk_by_exchange() so full AI responses are stored. Add _register_empty_file() sentinel drawer for conversation files that produce 0 chunks, preventing infinite re-processing on subsequent runs. Also fix pre-existing test_miner assertion that expected int from process_file (now returns tuple since PR #45). Ports upstream MemPalace#654, MemPalace#692, MemPalace#695.
Closes #