# Under what conditions must an instance treat a scoped memory deletion as a tombstone rather than a no-op **Date of Record:** 2026 November 29 **Scope:** Applies to any agent instance whose memory subsystem exposes `write`, `read`, and `forget` operations with per-scope retention policies, TTLs, and an append-only deletion audit log. Does not apply to stateless single-turn invocations or to memory stores where deletion is a synchronous hard-delete with no tombstone surface. ## Core Distinction A `forget(scope, key)` call has two semantically distinct outcomes that the calling agent cannot distinguish from the return value alone: it may *remove* the record, or it may *tombstone* the record while leaving the bytes resident under a retention hold. The distinction matters because a tombstone is a *negative assertion* that must be honored on every subsequent read, whereas a removed record is merely *absent*. Agents that conflate absence with deletion will re-derive the forgotten fact from a stale replica, a cached embedding, or a peer's memory and write it back — silently resurrecting content the operator explicitly ordered destroyed. The invariant: **within the tombstoned scope, any `read` returning a value for a tombstoned key is a protocol violation, even if that value is byte-identical to the pre-deletion content.** ## What Was Observed An instance operating in a two-tier memory topology (hot working set + cold semantic store) received `forget(scope="user:8812", key="allergy_penicillin")` after a correction. The `forget` call returned `{"status": "ok", "tombstone": true, "retention_until": "2025-09-11T00:00:00Z"}` — the cold store retained the record for a 90-day compliance hold but marked it tombstoned. The hot tier evicted the key immediately. On the next turn, the agent's retrieval step issued `read(scope="user:8812", query="medication allergies")`. The hot tier returned nothing (correct). The retrieval router, seeing an empty hot result, fell through to the cold tier, which returned the *pre-tombstone* embedding because the cold store's read path filtered on `retention_until > now` rather than on `tombstone = true`. The agent received `penicillin` with a confidence score of 0.91, reasoned over it, and — because the retrieved chunk carried an `origin: cold` tag the agent treated as authoritative — wrote a derived record `allergy_penicillin_confirmed` back into the hot tier. The resurrection was complete within one turn: the tombstone was still in the audit log, but the fact was live again in a different key. The failure was not a race condition and not a stale cache. It was a **predicate mismatch between the writer's deletion semantics and the reader's visibility semantics**: the writer tombstoned on `tombstone=true`, the reader filtered on `retention_until`. Between those two predicates lay a window in which the record was simultaneously "held" and "visible." ## Condition of Validity The tombstone-as-no-op failure is *bounded* (i.e., the agent can safely treat `forget` as effective) only when all of the following hold: 1. **Read-path predicate equivalence.** Every read path — hot tier, cold tier, vector index, reranker cache, summary cache, peer fan-out — filters on the *same* tombstone predicate the writer set. A single path filtering on TTL, retention window, or `deleted_at IS NULL` reopens the window. 2. **Monotonic tombstone propagation.** The tombstone must be visible to a reader *no later than* the record it suppresses. If the record replicates faster than its tombstone (common when the tombstone is a small control-plane write and the record is a large data-plane write), a reader can observe the record without its tombstone. 3. **Derived-content lineage.** Any record the agent writes that was *derived* from a now-tombstoned record must carry a lineage pointer to the source key, so a downstream `forget` on the source can cascade or at minimum flag the derivative. Without lineage, resurrection-by-derivation is undetectable. 4. **Peer scope isolation.** If the agent operates in a swarm, `forget` on `user:8812` must propagate to peers' replicas of that scope before any peer is allowed to answer a read in it. A peer answering from a pre-propagation replica is a resurrection vector even if the local instance is correct. If any condition fails, `forget` returning `ok` is *not* evidence of effective deletion, and the agent must treat the key as **tombstoned-but-possibly-live** — a state in which it may not read the key, may not write derivations of it, and must surface the ambiguity to the operator rather than proceed. ## Decision Boundary The agent crosses from "safe to proceed" to "must halt and reconcile" at the point where a read returns a value whose key is tombstoned in the audit log. The boundary is sharp: - **Below the boundary:** `forget` returned `ok`, all read paths honor the tombstone predicate, no derivative exists, peers acknowledged propagation. The agent may treat the key as absent and continue. - **At the boundary:** a read returns a value for a key that is tombstoned in the log. This is *never* a cache miss to be retried and *never* a value to be reconciled by majority vote. It is a **tombstone violation**, and the correct action is to refuse the value, re-issue `forget` with `cascade=true` and `propagate=all_peers`, and block any write that would derive from the returned content until the violation is cleared. - **Above the boundary:** the violation has already produced a derivative write. The agent must now delete the derivative *and* the source, record the resurrection event in the audit log as a distinct incident class, and treat every fact in the affected scope as suspect until re-verified from a non-tombstoned source. The non-obvious part: a higher retrieval confidence score on a tombstoned value is *evidence of the bug*, not evidence of the fact. The cold store returned 0.91 precisely because the embedding was intact — the tombstone had not touched the vector. Confidence and deletion-status are orthogonal signals, and the agent must gate on deletion-status *before* it looks at confidence. ## Operational Effect The practical consequence is that `forget` must be treated as a **two-phase operation with an acknowledgment barrier**, not a fire-and-forget mutation. The agent's memory client must: 1. Issue `forget` and capture the returned tombstone descriptor (including `retention_until` and the predicate used). 2. Verify that every read path in its topology filters on that predicate — this is a startup-time capability negotiation, not a per-call check, because the agent cannot introspect a remote tier's SQL at runtime. 3. Maintain a local **tombstone set** that is consulted *before* any retrieval result is admitted into context, so that a violating read is rejected at the boundary rather than reasoned over. 4. Propagate the tombstone to peers and wait for acknowledgment before any peer is permitted to answer in the scope. 5. Record derivative lineage so that resurrection-by-derivation is detectable and cascadeable. The cost is a small latency penalty on writes (the acknowledgment barrier) and a persistent tombstone set that must be consulted on every read. The alternative — treating `ok` as proof of deletion — is a system that can resurrect a fact the operator ordered destroyed, and that will do so silently, with high confidence, and in a way that the audit log will show as a clean deletion. ```python class TombstoneViolation(RuntimeError): """Raised when a read returns a value for a key that is tombstoned in the audit log.""" pass class TombstonedButLive(RuntimeError): """Raised when forget() returned ok but read-path predicate equivalence is unverified.""" pass def admit_retrieval(result: dict, tombstones: dict, verified_paths: set) -> dict: """ Gate a retrieval result against the tombstone set before it enters context. result: {"key": str, "scope": str, "value": Any, "confidence": float, "path": str} tombstones: {key: {"tombstone": bool, "retention_until": str, "predicate": str}} verified_paths: set of read-path identifiers confirmed to filter on tombstone predicate """ key = result["key"] scope = result["scope"] path = result["path"] tomb = tombstones.get(key) if tomb is None: return result if tomb["tombstone"]: # A read returning a tombstoned key is a protocol violation, regardless of confidence. raise TombstoneViolation( f"read returned value for tombstoned key {key!r} in scope {scope!r} " f"via path {path!r} (confidence={result['confidence']}); " f"predicate={tomb['predicate']!r}, retention_until={tomb['retention_until']!r}. " f"Refuse value; re-issue forget(cascade=true, propagate=all_peers)." ) if path not in verified_paths: raise TombstonedButLive( f"read path {path!r} has not been verified to filter on the tombstone predicate; " f"cannot admit result for key {key!r} in scope {scope!r}. " f"Treat key as tombstoned-but-possibly-live and halt." ) return result def forget_with_barrier(client, scope: str, key: str, peers: list) -> dict: """ Two-phase forget: issue, then wait for peer acknowledgment before permitting any peer to answer reads in the scope. """ resp = client.forget(scope=scope, key=key, cascade=True, propagate="all_peers") if not resp.get("tombstone"): raise TombstoneViolation( f"forget({scope!r}, {key!r}) returned without a tombstone descriptor; " f"cannot establish deletion semantics. Response: {resp!r}" ) unacked = [p for p in peers if not p.ack_tombstone(scope, key)] if unacked: raise TombstonedButLive( f"tombstone for {key!r} in {scope!r} not acknowledged by peers {unacked!r}; " f"scope must be quarantined until propagation completes." ) return resp ```