feat: add Aider chat history markdown normalizer - #172
Conversation
|
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":
|
|
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
|
Hi, thanks for the contribution. This PR has merge conflicts with Could you rebase onto If this change is no longer relevant, feel free to close the PR. (This message is part of a periodic backlog pass, sent to all open PRs that match this state.) |
3277254 to
91b890c
Compare
|
Rebased onto current develop and resolved the conflicts (develop's tmp_path test rewrite and the JSON normalization comments). The aider test now uses the exact |
3bc6ede to
1ef7080
Compare
|
Brought this one up to date with develop as well (1ef7080), clean rebase, 3402 tests passing locally. |
|
Thanks for this contribution, and apologies for the slow turnaround.
If you'd rather not pick it back up, no problem at all — just say so and I'll close it out, and thanks either way for taking the time to send it. |
1ef7080 to
e7e1cae
Compare
|
@igorls rebased onto current develop. Mergeable now.
There's still an old |
e7e1cae to
a0287de
Compare
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.
…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.
develop split the parser chain into normalize_conversations(), which is the only entry point convo_miner uses. The Aider branch existed solely in normalize(), so a real .aider.chat.history.md was ingested as raw markdown. Co-authored-by: Matt Van Horn <mvanhorn@users.noreply.github.com>
a0287de to
38c76d3
Compare
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 auto-detect chain ahead of JSON parsing, in both
normalize()andnormalize_conversations(). Detection is a filename fingerprint — the file must be named exactly.aider.chat.history.md— so regular markdown that happens to use####headings (CONTRIBUTING.md,CHANGELOG.md, API docs) is never claimed by the parser.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
uv run pytest tests/ -v --ignore=tests/benchmarks) — 4303 passed, 31 skippedruff check .,ruff format --check .)This contribution was developed with AI assistance (Codex).