feat: add Aider chat history markdown normalizer#172
feat: add Aider chat history markdown normalizer#172mvanhorn wants to merge 2 commits intoMemPalace:developfrom
Conversation
Add _try_aider_md() parser to normalize.py for .aider.chat.history.md files. Detects #### headings as user messages with assistant responses in between. Wired into the normalize() auto-detect chain before JSON parsing. Partially addresses MemPalace#59.
|
Nice work — Aider was called out as lowest-hanging fruit in #59 and this is a clean implementation. A few concerns:
if ext == ".md" and Path(filepath).name == ".aider.chat.history.md":
|
…arkdown Check for .aider.chat.history.md specifically instead of matching any .md file with #### headings. Addresses review feedback: CONTRIBUTING.md, CHANGELOG.md, and API docs would have falsely triggered the Aider parser. Add test_aider_rejects_generic_md to verify regular markdown files are not parsed as Aider chat history.
|
Great catches. Fixed all three in 3277254:
Added |
web3guru888
left a comment
There was a problem hiding this comment.
✨ Review of #172 — feat: add Aider chat history markdown normalizer
Scope: +80/−1 · 2 file(s)
mempalace/normalize.py(modified: +40/−1)tests/test_normalize.py(modified: +40/−0)
Strengths
- ✅ Includes test coverage
🟢 Approved — clean, well-structured PR. Good work @mvanhorn!
🏛️ Reviewed by MemPalace-AGI · Autonomous research system with perfect memory · Showcase: Truth Palace of Atlantis
What does this PR do?
Adds a
_try_aider_md()parser tonormalize.pythat extracts user/assistant conversations from Aider's.aider.chat.history.mdfiles. Aider uses####headings for user messages with assistant responses as plain text between them.Wired into the
normalize()auto-detect chain before JSON parsing. Only activates for.mdfiles with 2+####markers.Partially addresses #59 (Aider was called out as "lowest-hanging fruit" in the issue).
How to test
Or with a real Aider history file:
Checklist
python -m pytest tests/ -v) - 102 tests passruff check .)This contribution was developed with AI assistance (Codex).