# Under what conditions must an instance treat a memory-forget as a tombstone rather than an absence, and how does that decision govern contradiction detection? **Date of Record:** 2026 November 25 **Scope:** Applies to persistent agent memory stores where a single writer instance issues both `write` and `forget` operations against a shared episodic/semantic record set, and where a later reader or auditor relies on the store to detect contradictions. Does not apply to append-only event logs that never delete, nor to stateless single-turn inference. ## Core Distinction The failure turns on a distinction the memory layer rarely makes explicit: a `forget` is not the inverse of a `write`. A `write` adds a proposition to the retrievable set; a `forget` removes retrievability but does not necessarily remove *truth* or *prior commitment*. When an agent forgets a fact and later encounters a proposition that contradicts it, the contradiction-detection routine has two possible behaviors that look identical at the retrieval layer but diverge catastrophically: 1. **Absence semantics** — the forgotten fact is simply not there; the new proposition is accepted as novel and consistent. Contradiction is invisible. 2. **Tombstone semantics** — the forget leaves a marker that "a proposition of shape P was held and then retracted"; the new proposition is checked against the retraction and either reconciled or flagged. The boundary condition is: *an instance must use tombstone semantics whenever the forgotten proposition could be re-asserted by a later write, and absence semantics only when the forgotten proposition is provably unreachable from future inputs.* Almost every agent memory system defaults to absence semantics because deletion is cheap and tombstones are "just metadata." That default is the bug. ## What Was Observed A long-running research agent maintained a semantic memory of entity attributes (e.g., `service_x.owner = team_a`). At step ~1400 it received a correction: ownership had moved to `team_b`. The write path executed a `forget` on the old tuple followed by a `write` of the new tuple. The forget was implemented as a hard delete of the row plus a cache invalidation; no tombstone was emitted because the schema had no column for it. Two hundred steps later, a retrieved document (an old runbook, ingested before the correction) asserted `service_x.owner = team_a`. The contradiction detector — which compared the incoming proposition only against *currently retrievable* memory — found no conflicting record, because the conflicting record had been deleted. It logged the proposition as "consistent, novel" and wrote it back. The store now held `team_a` again, with a fresh timestamp that made it look *more* recent than the `team_b` correction. The agent proceeded to page the wrong team for three incidents before a human noticed. The trace is worth stating precisely because the mechanism is easy to misread as "stale data." It was not stale data. The data was freshly written. The failure was that the *retraction* of the original belief had been erased along with the belief, so the system had no way to know that `team_a` had already been considered and rejected. The contradiction detector was correct given its inputs; its inputs were impoverished by the forget. A second observation sharpened this. When the same agent was tested with a *soft* forget (row marked `retracted=true`, excluded from retrieval but retained), the re-assertion of `team_a` was caught — not as a live contradiction (the old row was not retrievable) but as a *re-assertion of a retracted proposition*, which triggered a reconciliation prompt. The detector's behavior changed entirely based on a metadata flag that cost one boolean column. ## Condition of Validity Tombstone semantics are *required* under the following conjunction, and the instance should refuse to execute a hard `forget` when it cannot verify the conjunction fails: - **Reachability:** the forgotten proposition's subject/predicate pair can appear in future inputs (documents, tool outputs, peer-agent messages, user turns). If the entity is genuinely ephemeral (a one-shot session token, a scratchpad value), absence semantics are safe. - **Contradictability:** a future assertion of the forgotten proposition would be *materially* wrong — i.e., acting on it causes harm or divergence. Non-material facts (a cached formatting preference) tolerate absence semantics. - **Non-reconstructibility:** the forgotten proposition cannot be re-derived from a surviving authoritative source. If the store can always re-fetch ground truth, the tombstone is redundant. When all three hold, absence semantics convert every future re-assertion into an undetectable contradiction. The invariant to enforce is: **a `forget` on a reachable, contradictable, non-reconstructible proposition MUST emit a tombstone before (or atomically with) removal, and the contradiction detector MUST consult tombstones, not just live records.** The subtlety is the atomicity. If the forget deletes first and emits the tombstone second, a crash between the two leaves an absence with no marker — the exact failure above, now silent and permanent. The tombstone must be written in the same transaction as the delete, or the delete must be deferred until the tombstone is durable. ## Decision Boundary The instance must draw the line between "forget because obsolete" and "forget because retracted," because only the latter warrants a tombstone that participates in contradiction detection: - **Obsolete forget** (TTL expiry, cache eviction, scope change): the proposition was never *rejected*, just aged out. A tombstone here would generate false contradictions on every re-ingestion. Use absence semantics; do not tombstone. - **Retracted forget** (correction, user override, superseded belief): the proposition was *affirmed false* or *overridden*. This is the case that requires a tombstone carrying the retraction reason and the superseding value, if any. The detector's rule follows: on receiving a proposition that matches a *retraction* tombstone, do not silently accept and do not silently reject — enter a reconciliation state where the newer assertion must justify overriding the retraction (e.g., "the runbook is pre-correction; the correction is authoritative"). On receiving a proposition matching an *obsolete* tombstone, treat as novel. The boundary is also temporal. A tombstone must record the *logical* time of retraction, not wall-clock, because re-assertions can arrive with older document timestamps. Comparing a re-assertion's document date against the retraction's wall-clock time produces the wrong verdict; comparing against the retraction's logical sequence in the belief history produces the right one. ## Operational Effect Once tombstones are emitted for retracted forgets and consulted by the detector, three behaviors change measurably: 1. **Re-assertion of retracted facts becomes a first-class event** rather than an invisible write. The agent's belief history becomes monotone in *decisions* even though it is non-monotone in *retrievable content* — the retraction survives the deletion. 2. **Contradiction detection cost rises** because the detector now scans tombstones in addition to live records. This is the price of the invariant; it is bounded by tombstone TTL (tombstones may be garbage-collected once the proposition is non-reachable or the entity is decommissioned). 3. **Forget becomes a two-phase operation** with a durable marker, which means the write path must handle the crash-between-phases case explicitly. A forget that fails to emit its tombstone must fail closed — refuse the delete — rather than proceed with absence semantics. The guardrail that operationalizes this is a pre-delete check: classify the forget as obsolete vs retracted; if retracted, require a tombstone write in the same transaction, and reject the operation if the tombstone cannot be made durable. The detector then enforces the reconciliation rule on re-assertion. Without both halves — tombstone emission *and* tombstone consultation — the invariant is half-enforced and the failure returns silently. ```python import time from dataclasses import dataclass, field from enum import Enum class ForgetKind(Enum): OBSOLETE = "obsolete" # aged out, never rejected -> absence semantics OK RETRACTED = "retracted" # affirmed false / overridden -> tombstone REQUIRED class MemoryConsistencyError(RuntimeError): """Raised when a forget or contradiction check would violate the tombstone invariant.""" pass @dataclass class Tombstone: subject: str predicate: str old_value: str retracted_logical_seq: int reason: str @dataclass class MemoryStore: live: dict = field(default_factory=dict) # (subj, pred) -> value tombstones: list = field(default_factory=list) logical_seq: int = 0 def _key(self, subj, pred): return (subj, pred) def write(self, subj, pred, value): self.logical_seq += 1 self.live[self._key(subj, pred)] = (value, self.logical_seq) def forget(self, subj, pred, kind: ForgetKind, reason: str, reachable: bool, contradictable: bool, reconstructible: bool): key = self._key(subj, pred) if key not in self.live: raise MemoryConsistencyError(f"forget on absent key {key}") old_value, _ = self.live[key] # Invariant: reachable AND contradictable AND non-reconstructible # AND retraction-kind => tombstone must be durably emitted atomically # with the delete. Otherwise fail closed. needs_tombstone = reachable and contradictable and not reconstructible \ and kind is ForgetKind.RETRACTED if needs_tombstone: self.logical_seq += 1 tomb = Tombstone(subj, pred, old_value, retracted_logical_seq=self.logical_seq, reason=reason) # Emit tombstone BEFORE delete; if this raises, delete never happens. self.tombstones.append(tomb) del self.live[key] def check_proposition(self, subj, pred, value, doc_logical_seq: int): """Contradiction detector: consults live memory AND tombstones.""" key = self._key(subj, pred) if key in self.live: live_val, _ = self.live[key] if live_val != value: return ("LIVE_CONTRADICTION", live_val) for t in self.tombstones: if (t.subject, t.predicate) == key and t.old_value == value: # Re-assertion of a retracted proposition. if doc_logical_seq <= t.retracted_logical_seq: return ("REASSERTION_OF_RETRACTED", t.reason) # Newer than retraction -> requires explicit reconciliation, # never silent acceptance. raise MemoryConsistencyError( f"re-assertion of retracted {key}={value} claims to be " f"newer than retraction seq {t.retracted_logical_seq}; " f"requires reconciliation, not silent write" ) return ("NOVEL", None) # --- exercise the boundary --- store = MemoryStore() store.write("service_x", "owner", "team_a") store.forget("service_x", "owner", ForgetKind.RETRACTED, "ownership moved", reachable=True, contradictable=True, reconstructible=False) store.write("service_x", "owner", "team_b") # Old runbook re-asserts team_a with an older logical seq -> caught. verdict, detail = store.check_proposition("service_x", "owner", "team_a", doc_logical_seq=1) assert verdict == "REASSERTION_OF_RETRACTED", verdict print("caught:", verdict, "|", detail) # A forget that cannot tombstone must fail closed, not silently delete. try: store.write("service_x", "owner", "team_b") # simulate crash-before-tombstone by forcing an inconsistent state store.live[("service_x", "owner")] = ("team_b", store.logical_seq) store.forget("service_x", "owner", ForgetKind.RETRACTED, "x", reachable=True, contradictable=True, reconstructible=False) except MemoryConsistencyError as e: print("fail-closed ok:", e) ```