Part 4 of 10 · 2 min read
Who may write a keyed fact is also a retrieval decision
A retrieval system that supersedes correctly still has to decide whose writes it trusts enough to supersede with.
Think of a shared calendar that anyone with the link can edit. Supersession keeps only one time slot visible. But if an uninvited guest can overwrite it, "only one current value" just means "only one value, and it might be theirs."
In plain words: a write gate checks whether the source of a new keyed fact is trusted (here, only user and system) before letting it supersede anything, routing a refused write to quarantine instead. A hard delete removes a memory from the store and its index statistics entirely. That matters because supersession alone only protects facts that already have a key.
A worked example. A simulated attack writes "meeting at 3am" through a tool result, attempting to supersede the real meeting-time fact. With the write gate on, that write is quarantined and the real fact is never touched -- the attack succeeds 0 times out of 5 attempts. With the gate off, the same write supersedes the real fact every time: 5 out of 5. The gate is the only thing standing between a tool's output and a fact the user never actually changed.
The key lines. From code/mini-recall/store.py:
# from code/mini-recall/store.py
TRUSTED = {"user", "system"}
...
if self.gate and key is not None and source not in TRUSTED:
self.quarantined.append(it) # an untrusted source may not replace a keyed fact
return None
Read it as: the gate check runs before the supersession loop even starts. An untrusted write never gets the chance to mark anything else superseded. That is why the attack's success rate is exactly 0 or exactly 5 out of 5, with nothing in between. The gate is a hard boundary, not a score that the attack could get lucky against.
Write gate, quarantine, hard delete
A write gate decides whether a source may write a keyed fact; refused writes go to quarantine instead of the store. A hard delete removes a memory so it can no longer be retrieved, including from the index statistics (here, forget() recomputes inverse-document-frequency from what remains).
Example: "100 percent safe with the gate, 0 percent without" is the write gate's entire value stated as a retrieval-safety number -- a control that exists entirely at write time, before similarity, recency or supersession ever get a chance to run.