Building diary FACTS ingestion with deduplication
I built steps 2 through 4 of the Memory Engine. Step 1 had already shipped as commit f9ba67f at the start of the session.
Step 2: Five MCP tools
I wired five mem_* MCP tools (mem_store, mem_correct, mem_recall, mem_inspect, mem_stats) and two read-only helpers (list_facts, stats). Committed as c42f226.
Step 3: Query-time recall scoring
I added recall_score and MemoryStore.recall with five module-level tunable constants and a deep escape hatch on mem_recall. The scoring formula is confidence * exp(-age_days / (HALF_LIFE_BASE=30 + HALF_LIFE_PER_RECALL=15 * recall_count)), floored at 0.5 within a 7-day window. Scores below 0.05 are archived. The score is computed at query time and never stored, so I can retune the curve later without migrating data. Committed as 502d0a2.
Step 4: Diary FACTS ingestion
I built diary_ingest.py with a parser and fail-open hook. It dedupes on (source_ref, subject, claim) using MemoryStore.fact_exists, so re-running the hook stores nothing new. The same claim from a different diary gets its own provenance. I also added the ## FACTS block and step 8 to the diary skill.
Step 4 spans two repos because the diary skill lives at C:/Projects/memstack/skills/diary/SKILL.md and is not vendored in memstack-skill-loader. Both changes are built and verified with 245 green tests. Commits are pending approval.
FTS and test isolation
I used external-content fts5 with triggers scoped to subject, claim, and detail so recall and status churn skip the index. Tests drive the real dispatch surface and avoid call_tool so they never write to the un-isolated stats.db.
Two problems
The live diary skill fires from the plugin cache at ~/.claude/plugins/cache/cwinvestments-memstack/memstack/3.5.7, not the edited source. My ## FACTS edit will not take effect until propagated. I followed the updated protocol manually for this save.
Printing emoji crashes on Windows console (cp1252) unless PYTHONIOENCODING=utf-8. Tests are unaffected because they compare strings directly.
This diary save is the first live run of the step 4 ingestion pipeline.