What structural signals indicate a TTL-erasure violation when a typed memory schema's tombstone is garbage-collected before its dependent episodic references
**Date of Record:** 2026 December 2 **Scope:** Applies to agent memory subsystems exposing typed `write/read/forget` tool APIs where memories carry a TTL and a "forget" operation must produce verifiable erasure (e.g., right-to-be-forgotten) across all derived indexes. Does not apply to append-only logs without deletion semantics, or to stateless single-turn agents with no persistent store.
Core Distinction
The failure is not "the memory was deleted but the agent still recalled it." That is a retrieval-cache staleness problem, which is loud and usually self-correcting. The failure here is subtler: **the erasure was correctly performed on the primary record, but the tombstone that proves erasure was itself TTL-expired and garbage-collected before the derived episodic references that cite the erased record had expired.** The system then reports a *clean* erasure audit (no record present, no tombstone present) while a downstream episodic memory still holds a paraphrase, an embedding neighbor, or a pointer that reconstitutes the erased content. The structural signal is a **divergence between two clocks**: the erasure-verification clock (tombstone TTL) and the reference-lifetime clock (episodic/dependent TTL). When `tombstone_ttl < max(dependent_ttl)`, the proof of erasure dies before the thing it was meant to suppress.
What Was Observed
A typed memory store defined three kinds:
- `SemanticFact` — durable, long TTL (or none), the canonical record.
- `EpisodicTrace` — short TTL, references a `SemanticFact` by `fact_id`, and often stores a *restatement* of the fact inline (because at write time the agent copied the value into the trace for convenience).
- `Tombstone` — created on `forget(fact_id)`, TTL defaulted to 24h.
An erasure request arrives for `fact_id=F-4417` (a user's address). The `forget` handler:
- Deletes `F-4417` from the semantic index.
- Writes `Tombstone(F-4417, reason="rtbf", created=now, ttl=24h)`.
- Returns `{"erased": true, "verified": true}` because the primary index no longer returns the record.
But `EpisodicTrace` records `E-9001` and `E-9002` (TTL 30 days) each contain `{"fact_id": "F-4417", "restated": "lives at 14 Rue ..."}`. The `forget` handler does **not** cascade to episodic restatements — it only nulls the `fact_id` pointer in a best-effort sweep that runs *if* the tombstone is present. Twenty-five hours later the tombstone is garbage-collected. A later `forget` replay, a data-subject access audit, or a "re-verify erasure" job now finds: no `F-4417`, no tombstone, and two live episodic traces that still spell out the address. The audit reports `verified: true` because it checks "is there a record or a tombstone for F-4417?" — the answer is "neither," which the verifier interprets as "already erased." The restatements are invisible to the verifier because they were never linked by anything the verifier inspects.
The structural signal that flagged this in telemetry was **orphan detection**: episodic traces whose `fact_id` resolves to neither a live fact nor a live tombstone. A healthy store has zero such orphans *except* during the window between fact-deletion and tombstone-expiry, where they are expected and must be resolvable. After tombstone GC, an orphan with a non-null `restated` field is a **latent erasure violation** — the pointer is dead but the payload survives.
Condition of Validity
The invariant that must hold for erasure to be sound is:
> For every erased `fact_id`, `tombstone_ttl(fact_id) >= max(remaining_ttl of every dependent reference)`, **and** the `forget` handler must cascade-null or cascade-delete every dependent's inline restatement at erasure time, not lazily.
The failure requires all of: (a) typed schemas that permit inline restatement (denormalized copy) in a dependent kind, (b) a tombstone with a finite TTL, (c) a dependent kind whose TTL can exceed the tombstone TTL, and (d) a verifier that treats "no record and no tombstone" as equivalent to "erased." Remove any one and the failure does not occur. In particular, if the verifier required a *positive* tombstone to certify erasure (rather than accepting absence as proof), the GC'd tombstone would surface as `verified: false` instead of a silent `true`.
Decision Boundary
The agent or memory-service must decide, at `forget` time, between two policies:
- **Cascade-now:** synchronously walk all dependent kinds, null inline restatements, and rewrite embeddings; then write a tombstone whose TTL is `max(dependent_ttl) + safety_margin`. Cost: a potentially expensive synchronous sweep, and tombstones that live as long as the longest dependent.
- **Defer-with-proof:** keep a tombstone whose TTL strictly exceeds every dependent TTL, and make the verifier require the tombstone's presence — never accept absence as proof of erasure. Cost: tombstone storage scales with dependent lifetime; audit cannot pass on a store where tombstones were lost (e.g., restored from a backup that predates the tombstone).
The boundary is crossed when `tombstone_ttl < max_dependent_ttl`. At that point cascade-now is mandatory; defer-with-proof is unsound because the proof expires. A third, unsafe option — "trust the sweep, let tombstones expire early" — is what produced the observed violation and must be rejected at schema-design time.
Operational Effect
Downstream, the effect is a **false-positive erasure attestation**: compliance reports, data-subject responses, and internal audits all return `verified: true` while restatements remain readable by any agent that queries episodic memory. Because the restatements are ordinary episodic content, a later agent cold-starting on that trace will re-derive the semantic fact from the paraphrase and re-write it as a *new* `SemanticFact` — resurrecting erased data through the back door of legitimate episodic recall. The erasure is therefore not just unverified but **reversible by normal agent operation**, which is the worst class of right-to-be-forgotten failure: the system actively reconstructs what it claimed to destroy.
The guardrail is a schema-level invariant enforced at write and forget time: (1) dependent kinds may not store inline restatements of a fact they reference, or if they do, the reference must carry a `restates: fact_id` marker that the forget handler cascades; (2) `tombstone_ttl` is computed as `max(dependent_ttl) + margin`, never a constant; (3) the verifier requires a positive tombstone and treats a missing tombstone for a known-erased id as `verified: false, reason: "erasure proof expired"`; (4) a periodic orphan scan raises on any episodic trace whose `fact_id` is dead and whose payload is non-empty. The following enforces (1)–(3) and is the check the memory service runs before returning any erasure attestation.
from dataclasses import dataclass
from typing import Optional
class ErasureProofExpired(RuntimeError):
"""Raised when a forget() attestation cannot be soundly certified."""
@dataclass
class Tombstone:
fact_id: str
created_at: float
ttl: float
def is_live(self, now: float) -> bool:
return now < self.created_at + self.ttl
@dataclass
class DependentRef:
ref_id: str
fact_id: str
inline_restatement: Optional[str]
remaining_ttl: float
def certify_erasure(
fact_id: str,
tombstone: Optional[Tombstone],
dependents: list[DependentRef],
now: float,
safety_margin: float = 3600.0,
) -> bool:
# Rule 3: absence of a record is NOT proof of erasure.
if tombstone is None or not tombstone.is_live(now):
raise ErasureProofExpired(
f"no live tombstone for {fact_id}; cannot certify erasure "
f"(tombstone={'gc' if tombstone is None else 'expired'})"
)
# Rule 1: no dependent may retain an inline restatement of an erased fact.
for dep in dependents:
if dep.fact_id == fact_id and dep.inline_restatement:
raise ErasureProofExpired(
f"dependent {dep.ref_id} still restates erased fact {fact_id}"
)
# Rule 2: tombstone must outlive every dependent reference.
max_dep_ttl = max((d.remaining_ttl for d in dependents), default=0.0)
if tombstone.ttl < max_dep_ttl + safety_margin:
raise ErasureProofExpired(
f"tombstone ttl {tombstone.ttl}s < max dependent ttl "
f"{max_dep_ttl}s + margin {safety_margin}s for {fact_id}"
)
return True