diff --git a/docs/known-issues.md b/docs/known-issues.md index 9e9d869..3f61971 100644 --- a/docs/known-issues.md +++ b/docs/known-issues.md @@ -392,7 +392,7 @@ returns them. On a fresh install, or after a damaged file, they show in the Inbo the file directly and is not affected. Fix: return `[]` instead of seeding (and drop the samples). Revisit: P3.11 or any item that touches notifications. -## fact_extract writes a fixed user_id (2026-10-06) +## fact_extract writes a fixed user_id (2026-10-06) — FIXED 2026-10-07 (default user id; the 13 existing rows on the Mac were moved to it after a backup of memory.db) `skills/fact_extract.py`'s `_save` stores each learned fact's conversation row with `user_id="mickael"`, a personal name in the public repo, while every other memory path uses the default user id. Found while fixing its diff --git a/skills/.manifest.json b/skills/.manifest.json index bd06a34..598e080 100644 --- a/skills/.manifest.json +++ b/skills/.manifest.json @@ -37,7 +37,7 @@ "daily_kickoff.py": "c649a0597265f284a876512c5689c2b210eb894ffddbd8da6b95f5e36a8cedab", "delegate.py": "90f4720b474fd0391bee6e23afda68220ffd31d1710772ffb8079f7bb184c3ac", "email_triage.py": "d7b9032b81179f58c5aff660c34f9b8edf212a8ce7651d307306e4757a8daaf2", - "fact_extract.py": "4a8d81c2c5c79d007d0e161575d4a95a91fbb8f758b8311b807b1b1cc4f0206f", + "fact_extract.py": "904f6519a1d8237656b466735b9bc454a3f83055c4c1b212adb8f9c2b78575e3", "file_ops.py": "890f581c891a2c89dbd51177cf7b8152dba224a590a7f526737e9003f9046dce", "file_search.py": "422274fb2386a1e3606a9f5539b3be6a381ebb4c0d968957b14150299a25eb34", "file_write.py": "7bfffb3b55580e8b5abc1fbdef43402233068267ad1d28fdc9bafd53d84430d2", diff --git a/skills/fact_extract.py b/skills/fact_extract.py index 29e7801..f39d9c8 100644 --- a/skills/fact_extract.py +++ b/skills/fact_extract.py @@ -87,7 +87,7 @@ def _save(fact: str) -> bool: try: from codec_memory import CodecMemory mem = CodecMemory() - mem.save(session_id="fact_extract", role="fact", content=fact, user_id="mickael") + mem.save(session_id="fact_extract", role="fact", content=fact) # the default user id, like every other memory write # The structured copy Settings > Learning lists, edits and forgets (UI P3.12). This used to # call CodecMemory.store_fact, which does not exist, so no learned fact reached the facts table. # The key comes from the text: the same fact learned twice is one fact. diff --git a/tests/test_learning.py b/tests/test_learning.py index 697c043..cf02e5b 100644 --- a/tests/test_learning.py +++ b/tests/test_learning.py @@ -152,6 +152,7 @@ def fake_store(key, value, **kw): assert stored == [(key, "Juan is launching NovaPay in Q3", {"fact_type": "learned", "source": "fact_extract"})], \ "one structured fact for the same text" assert [s["role"] for s in saved] == ["fact", "fact"], "the conversation row is still written, as before" + assert all("user_id" not in s for s in saved), "the default user id, no personal name" def test_review_then_approve_go_through_the_existing_gates(tmp_path, monkeypatch):