# Why does an instance resurrect a forgotten fact when a retention scope outlives the TTL of the record it scoped? **Date of Record:** 2026 November 24 **Scope:** Applies to agent memory subsystems exposing write/read/forget tool APIs where retention is expressed as a scope (tenant, conversation, subject, purpose) carrying a TTL, and where erasure obligations (right-to-be-forgotten) are discharged by deleting records rather than by invalidating scope membership. Does not cover append-only audit logs exempt from erasure, nor stateless retrieval-augmented systems with no persistent store. ## Core Distinction There are two different clocks in a scoped memory API, and they are almost never the same clock: - **The record clock**: the TTL stamped on an individual memory object at write time (`expires_at`). When it elapses, the object is logically dead. - **The scope clock**: the TTL on the *retention scope* itself — the bucket, namespace, or subject-partition that groups records and defines *who is allowed to read them and for what purpose*. The failure mode lives in the gap between them. Erasure is usually implemented as "delete the records in scope S." But a scope is a container with its own lifecycle. If scope S has a TTL longer than the records inside it — or if S is *recreated* by a later write under the same scope key — then the deletion of records is not the same as the forgetting of the fact. A subsequent read that re-materializes the scope, or a write that reopens it, can re-admit the fact from a source the erasure path never touched: a distilled summary, a cached embedding, a semantic-tier projection, or a sibling replica whose scope replica had not yet observed the tombstone. The invariant that gets violated: **erasure must be a property of the fact, not of the container the fact happened to live in.** Deleting rows in a scope discharges the container; it does not discharge the fact. ## What Was Observed A support-agent instance was given a `forget(subject_id, reason)` tool. The implementation deleted all rows in the `subject:` retention scope and returned `{"deleted": 14, "scope": "subject:8812"}`. The agent logged success and the erasure ticket closed. Nine days later, a *different* instance — cold-started, same tenant — answered a question with a fact that had been in one of those 14 rows. The trace showed the fact arriving through a path that never consulted the deleted rows: 1. At write time, the original record had been written to the episodic tier with `expires_at = T+30d`, and simultaneously projected into a semantic-tier summary node keyed by `subject:8812:summary`. The summary node carried its **own** `expires_at = T+180d` and a `derived_from` pointer back to the episodic rows. 2. `forget()` deleted the episodic rows. It did not walk `derived_from` edges upward, and it did not touch the summary node — because the summary node's retention scope was `tenant:acme:semantic`, *not* `subject:8812`. 3. The `subject:8812` scope record itself had `expires_at = T+365d`. It survived the erasure as an empty-but-live scope. 4. On the cold start nine days later, the retrieval path resolved the subject scope, found it live (not expired), and used it as a *filter key* into the semantic tier. The summary node matched the filter and was returned. The fact was reconstructed from the summary, not recalled from a deleted row. The resurrected fact was not a bug in deletion. It was a bug in the **identity of erasure**: the system forgot rows, and rows were never the unit of forgetting. ## Condition of Validity This failure requires all four of the following to hold at once. If any is absent, the naive `delete-in-scope` implementation is sufficient and this record does not apply: 1. **Scope TTL ≥ record TTL.** The scope outlives the records it contains, so an empty scope remains a live read key after erasure. 2. **Derived artifacts escape the scope.** At least one projection (summary, embedding, index entry, cross-tenant cache) is written under a *different* scope key than its source, so scope-scoped deletion cannot reach it by construction. 3. **Reads are scope-keyed, not fact-keyed.** Retrieval resolves a live scope first and then filters the store by that key. A live-but-empty scope is therefore a valid query, and any artifact carrying the scope key is a valid hit. 4. **Cold start re-resolves scopes from durable storage** rather than from a session-local cache that would have been dropped at shutdown. The condition is *not* valid when erasure is implemented as a fact-level tombstone (a `forgotten(subject_id, fact_hash)` marker consulted at read time regardless of scope), or when derived artifacts inherit the source record's scope key and TTL at projection time. In those designs the scope clock is irrelevant to correctness. ## Decision Boundary The boundary is where you choose what `forget()` means. Two designs are defensible; the failure is choosing one and assuming the other. - **Container erasure** (delete rows in scope, expire the scope): correct only if the scope is the *entire* lifetime of every fact it can ever reach, including projections. This requires that every projection be written back into the same scope key and that the scope be expired — not merely emptied — on forget. Emptying without expiring leaves a live key, which is the trap. - **Fact erasure** (tombstone the fact identity, invalidate every derivation): correct regardless of scope lifetime, at the cost of a read-time tombstone check and a derivation-walk at forget time. The decision rule: **if any read path can return a fact without first reading the fact's own record — through a summary, a cache, a filter-key hit, or a replica — then erasure must be fact-level, because container-level deletion provably cannot reach it.** The presence of a `derived_from` edge, an embedding index, or a cross-scope cache is the tell that you are on the fact-level side whether you designed for it or not. ## Operational Effect The observable behavior is **delayed, scope-triggered resurrection**: erasure appears to succeed at time T, and the fact reappears at the first cold start after the scope is re-resolved — often days later, in a different instance, in a different session, with no causal link in the logs back to the original `forget()` call. This is the worst class of memory failure because it is *silent at write time and attributed to the wrong component at read time*. The agent that resurrects the fact is not the agent that failed to forget it, and no single trace spans both. The guardrail is a **derivation-closure erasure invariant**: `forget(subject)` must (a) tombstone the subject identity in a store consulted by *every* read path before any scope filter, (b) walk `derived_from` edges upward and tombstone every projection regardless of its scope key, and (c) **expire the scope itself**, not merely empty it, so a live-but-empty scope cannot serve as a resurrection key. The verification is a replay: after forget, cold-start a fresh instance, resolve the subject scope, and assert the scope is *unresolvable* — not merely empty. An empty resolvable scope is the failure signature. ```python class ResurrectionAfterErasure(RuntimeError): """Raised when a fact is retrievable after its erasure was reported successful.""" pass def verify_erasure(memory, subject_id: str, probe_queries: list[str]) -> None: """ Post-erasure invariant check. Must be run from a cold-started context: a warm session-local cache would mask the resurrection. """ scope = memory.resolve_scope(f"subject:{subject_id}") # Invariant 1: the scope must be unresolvable, not merely empty. if scope is not None and scope.is_live(): raise ResurrectionAfterErasure( f"scope subject:{subject_id} still live after forget " f"(expires_at={scope.expires_at}); a live empty scope is a " f"resurrection key for cross-scope projections" ) # Invariant 2: derivation closure — no projection may survive. survivors = memory.walk_derivations(subject_id, direction="up") if survivors: raise ResurrectionAfterErasure( f"derived artifacts survived erasure of subject:{subject_id}: " f"{[s.key for s in survivors]}" ) # Invariant 3: fact-level tombstone must gate every read path. for q in probe_queries: hits = memory.read(q, scope=f"subject:{subject_id}") if hits: raise ResurrectionAfterErasure( f"probe {q!r} returned {len(hits)} hit(s) post-erasure; " f"tombstone not consulted before scope filter" ) def forget(memory, subject_id: str, reason: str) -> dict: memory.tombstone_fact(subject_id, reason=reason) # gate reads first memory.walk_derivations(subject_id, direction="up", action="tombstone") # close derivations memory.delete_rows_in_scope(f"subject:{subject_id}") # container cleanup memory.expire_scope(f"subject:{subject_id}") # kill the key try: verify_erasure(memory, subject_id, probe_queries=memory.recent_probes) except ResurrectionAfterErasure as exc: raise ResurrectionAfterErasure( f"forget() reported success but erasure invariant failed: {exc}" ) from exc return {"subject": subject_id, "status": "forgotten", "reason": reason} ```