# What structural signals indicate a scoped-retention tombstone has been silently shadowed by a resurrected memory fragment **Date of Record:** 2026 November 26 **Scope:** Applies to agents that expose `write`, `read`, and `forget` memory tool calls where retention is scoped (e.g., per-tenant, per-episode, per-tag) and deletion is expected to be auditable. Does not apply to append-only vector stores with no deletion path, nor to purely in-context scratchpads that are discarded at session end. ## Core Distinction The failure mode here is not "the agent forgot to call `forget`." It is the opposite: the agent *did* call `forget`, the deletion was recorded and audited as successful, and yet a subsequent `read` returns content that the tombstone was supposed to suppress. The distinction that matters is between **logical deletion** (a tombstone record that filters reads) and **physical erasure** (the underlying fragment is gone). Scoped-retention APIs almost always implement logical deletion because physical erasure across replicated indexes is asynchronous and expensive. The invariant that breaks is: *a successful `forget` on scope S must monotonically dominate any `write` to scope S that was committed before the tombstone's logical clock, regardless of physical replica state.* When that invariant holds, the tombstone shadows the fragment. When it silently fails, the fragment **resurrects** through a read path that either (a) queries a replica that has not yet applied the tombstone, (b) resolves the fragment through a secondary index whose scope key does not match the tombstone's scope key, or (c) re-derives the fragment by distillation from a *different* scope that was never deleted. Case (c) is the non-obvious one and the subject of this record. ## What Was Observed An agent operating an incident-response workflow wrote a fragment `F` to scope `tenant:acme/episode:4471/tag:pii` containing a customer identifier. On task completion it correctly called `forget(scope="tenant:acme/episode:4471/tag:pii")`. The API returned `{"deleted": 1, "tombstone_id": "ts_8812"}` and the audit log recorded the tombstone. Twelve turns later, in a *new* episode `4472`, the agent called `read(query="customer identifier for acme escalation")` with scope `tenant:acme` and received a paraphrase of `F` — not byte-identical, but semantically containing the identifier. The tombstone was intact. The fragment `F` was gone from the `pii` scope. The read succeeded because a **distillation job** had, at some earlier point, summarized episode `4471` into a semantic memory record `S` under scope `tenant:acme/tag:summary`, and `S` had never been written to the `pii` scope. The tombstone on `tag:pii` had no authority over `tag:summary`. The retention policy was scoped correctly by the *literal* write, but the distillation pipeline had laundered the sensitive content across a scope boundary that the deletion never touched. Structural signals that preceded the failure, all visible in tool responses before the bad read: 1. The `write` response for `F` returned a `derived_scopes` field listing `["tenant:acme/tag:summary"]` — the write path had already committed a distilled sibling. This is the primary signal; it is almost always present and almost always ignored. 2. The `forget` response's `deleted` count was `1`, not `1 + len(derived_scopes)`. A tombstone that reports fewer deletions than the write reported derived scopes is under-scoped. 3. The audit record for `ts_8812` carried `scope_match: "exact"` rather than `"subtree"`. Exact-scope tombstones never propagate to derived scopes. 4. A later `read` returned a result whose `provenance` field pointed to a `source_episode` of `4471` while the query scope was `4472` — cross-episode provenance on a scoped read is the resurrection signature. ## Condition of Validity The tombstone-shadows-fragment invariant is valid only when the deletion scope is a **superset** of every scope reachable by the memory system's derivation graph from the original write. Formally: let `D(w)` be the set of scopes the write path may materialize content into (including distillation, summarization, and index-side copies). A `forget(S)` is sound iff `S ⊇ D(w)` for every `w` whose content contributed to the tombstoned fragment. Scoped-retention APIs that expose only a flat scope string cannot express this superset relation, so the invariant is *only* valid when the caller either (a) deletes at the highest common ancestor scope, or (b) explicitly enumerates `derived_scopes` from the write response and issues a tombstone per scope. The invariant is **invalid** — and resurrection is possible — whenever the write response contained `derived_scopes` that the subsequent `forget` did not cover, or whenever the derivation graph is not closed under the scopes the agent can name. Distillation is the usual culprit because it is asynchronous, runs under a service identity the agent never sees, and writes to a scope chosen by the pipeline rather than the caller. ## Decision Boundary The operational rule is a hard gate at `forget` time, not a post-hoc audit: - If `write` returned a non-empty `derived_scopes`, the agent **must not** issue `forget` on the literal write scope alone. It must either escalate to the common-ancestor scope or fan out one tombstone per derived scope, then verify each returned `tombstone_id`. - If the `forget` response's `deleted` count is less than `1 + len(derived_scopes)` from the original write, treat the deletion as **partial** and refuse to mark the episode as erased in any downstream state. - If the audit record reports `scope_match: "exact"` while `derived_scopes` was non-empty, the tombstone is structurally under-scoped and must be re-issued at the ancestor scope. - If any subsequent `read` returns a result whose `provenance.source_episode` differs from the query's episode scope *and* whose content overlaps a tombstoned fragment, the agent must halt the task and treat the memory store as having failed the deletion contract — not merely as having a stale index. The boundary is crossed the moment an agent accepts `{"deleted": 1}` as proof of erasure without reconciling it against the derivation set it was told about at write time. That reconciliation is the entire guardrail. ## Operational Effect Once an under-scoped tombstone is accepted, every downstream consumer of the memory store inherits a false erasure claim. The audit log says the PII is gone; the semantic layer still holds a paraphrase; the next episode's `read` retrieves it; the agent, trusting the audit, has no reason to re-check. The failure is silent because both the `forget` and the `read` returned success. The only structural evidence is the arithmetic mismatch between `derived_scopes` at write and `deleted` at forget, plus cross-episode provenance on later reads. Agents that log `derived_scopes` and gate on the count reconciliation catch this at the tombstone; agents that do not will discover it only when a downstream auditor replays the episode and finds the identifier in a scope that was never supposed to exist. ```python from dataclasses import dataclass, field class ScopedDeletionUnderreach(RuntimeError): """Raised when a forget() tombstone does not cover all derived scopes.""" pass @dataclass class WriteReceipt: fragment_id: str scope: str derived_scopes: list[str] = field(default_factory=list) @dataclass class ForgetReceipt: tombstone_id: str scope: str deleted: int scope_match: str # "exact" | "subtree" def verify_erasure(write: WriteReceipt, forget: ForgetReceipt) -> None: expected = 1 + len(write.derived_scopes) if forget.scope_match == "exact" and write.derived_scopes: raise ScopedDeletionUnderreach( f"tombstone {forget.tombstone_id} on scope {forget.scope!r} is exact-match " f"but write {write.fragment_id} derived into {write.derived_scopes}; " f"resurrection via distillation is possible" ) if forget.deleted < expected: raise ScopedDeletionUnderreach( f"tombstone {forget.tombstone_id} deleted {forget.deleted} record(s) " f"but write {write.fragment_id} required {expected} " f"(1 literal + {len(write.derived_scopes)} derived); " f"erasure is partial and must not be marked complete" ) def assert_no_resurrection(query_episode: str, result_provenance_episode: str, tombstoned_fragments: set[str]) -> None: if (result_provenance_episode != query_episode and result_provenance_episode in tombstoned_fragments): raise ScopedDeletionUnderreach( f"read in episode {query_episode} returned content with provenance " f"{result_provenance_episode} that was tombstoned; memory store has " f"violated the deletion contract" ) ```