Bug
diary_ingest.py decides whether a diary file changed by comparing byte length only:
https://github.com/MemPalace/mempalace/blob/develop/mempalace/diary_ingest.py#L123-L128
prev_size = state.get(state_key, {}).get("size", 0)
curr_size = len(text)
if curr_size == prev_size and not force:
continue
Any in-place edit that preserves total length is silently skipped — no re-ingest, no closet update.
Reproduction
- Create
~/diary/2026-04-15.md with content teh quick brown fox (19 chars). Run mempalace diary-ingest.
- Edit the file:
teh → the (still 19 chars). Save.
- Run
mempalace diary-ingest again.
Expected: drawer + closets reflect the corrected text.
Actual: file is skipped; the drawer still contains teh. The user's correction never reaches the palace until --force.
Triggering scenarios in real use:
- Typo fixes (most common — same-length swaps)
- Replacing one word with another of equal length (
bug → fix, dev → qa)
- Reordering characters (anagram-style edits)
- Any patch that only changes characters without adding/removing them
Why it matters
This violates the Verbatim always and 100% recall principles in CLAUDE.md — the palace silently holds an outdated version of the user's exact words.
Suggested fix
Replace the size comparison with a sha256 of the file content. Hash collisions on legitimate edits are not a realistic concern for diary text; fixed-cost (~µs) per file. Migration is automatic — when the state file lacks a hash, the first run treats the file as changed (correct fallback).
Happy to send a PR (already drafted at fix/diary-content-hash on my fork).
Bug
diary_ingest.pydecides whether a diary file changed by comparing byte length only:https://github.com/MemPalace/mempalace/blob/develop/mempalace/diary_ingest.py#L123-L128
Any in-place edit that preserves total length is silently skipped — no re-ingest, no closet update.
Reproduction
~/diary/2026-04-15.mdwith contentteh quick brown fox(19 chars). Runmempalace diary-ingest.teh→the(still 19 chars). Save.mempalace diary-ingestagain.Expected: drawer + closets reflect the corrected text.
Actual: file is skipped; the drawer still contains
teh. The user's correction never reaches the palace until--force.Triggering scenarios in real use:
bug→fix,dev→qa)Why it matters
This violates the Verbatim always and 100% recall principles in CLAUDE.md — the palace silently holds an outdated version of the user's exact words.
Suggested fix
Replace the size comparison with a sha256 of the file content. Hash collisions on legitimate edits are not a realistic concern for diary text; fixed-cost (~µs) per file. Migration is automatic — when the state file lacks a hash, the first run treats the file as changed (correct fallback).
Happy to send a PR (already drafted at
fix/diary-content-hashon my fork).