# What structural signals indicate a verifiable-deletion invariant has been silently violated by a tombstone-orphaned memory write **Date of Record:** 2026 November 25 **Scope:** Applies to agents that persist episodic or semantic state through a memory tool API exposing `write`, `read`, `forget`, and provenance/TTL metadata, where `forget` is specified as producing a *verifiable* deletion (tombstone plus proof-of-absence). Does not apply to append-only logs with no deletion contract, nor to purely in-context scratchpads that never cross a tool boundary. ## Core Distinction The dangerous failure is not that a `forget` call fails loudly. It is that `forget` *succeeds* — returns a tombstone, a deletion receipt, and a passing absence check — while a concurrent or subsequent `write` resurrects the deleted content under a *new* key that carries the *old* provenance hash. The agent then holds a memory record whose provenance chain points at a tombstoned ancestor. Read-back verification passes because the bytes exist; the deletion invariant is violated because the deletion's semantic guarantee ("this fact is unrecoverable") no longer holds. The structural signal is a **provenance hash that resolves to a tombstoned node while the record itself is live**. A naive integrity check (does the record exist? does its hash match its payload?) returns clean. The invariant only breaks when you check *ancestry liveness*, not record liveness. ## What Was Observed A research agent maintained a working set of extracted claims with a per-claim TTL and a `forget` path used to honor a user's "drop the PII claims" instruction. The memory API returned, for each `forget`, a receipt of the form `{key, tombstone_id, absence_proof}`. The agent verified the proof (a bloom-style absence check over the live index) and proceeded. Minutes later, a distillation step re-derived a claim from a still-live episodic buffer and issued `write` with `provenance = sha256(episodic_source)`. The distilled claim was semantically the same PII fact. The write succeeded. The new record's provenance hash was identical to the tombstoned record's provenance hash because both derived from the same source event. The absence proof, evaluated over the *key* space, still returned "absent" — the key was new. But the *content* was live again, reachable by any reader that searched by provenance or by semantic similarity. The tell was not an error. It was three converging structural signals: 1. A `read` by provenance hash returned a record whose `tombstone_id` field was populated — i.e., the record's own ancestry pointed at a deletion. 2. The `absence_proof` for the forgotten key remained valid, but a `since_receipt` query over the provenance index returned a non-empty set. 3. The TTL clock on the resurrected record had reset to full duration, so the "forgotten" fact would now outlive its original TTL by an unbounded margin. ## Condition of Validity The verifiable-deletion invariant holds only under the conjunction: - **Key-space closure:** every `write` is constrained to keys whose provenance ancestors are all live. This requires the API to reject writes whose provenance hash resolves to a tombstone, not merely dedupe by key. - **Provenance liveness propagation:** a tombstone must transitively invalidate any record whose provenance chain includes it, or the write path must refuse to mint such a record. - **Monotonic TTL:** a resurrected record may not receive a TTL longer than the minimum TTL of its live ancestry; otherwise deletion is defeated by expiry-reset. If any conjunct is absent — as in the observed system, where `write` checked only key uniqueness — the invariant is unenforced. The absence proof remains a *sound* statement about keys and a *meaningless* statement about content. This is the boundary: verifiable deletion over a key-addressed store does not compose with provenance-addressed writes unless the write path consults the tombstone index by provenance, which most memory tool APIs do not. ## Decision Boundary An agent must treat a `forget` receipt as **locally valid and globally insufficient** unless the API exposes a provenance-aware write guard. Concretely: - If the memory API documents that `write` rejects tombstoned provenance ancestors, the agent may trust the receipt and continue. - If the API only guarantees key-level absence (the common case), the agent must, after any `forget`, either (a) freeze all writes whose provenance derives from the forgotten source, or (b) re-issue `forget` by provenance hash and re-verify. - A `read` result carrying a populated `tombstone_id` is always a hard stop: it means the invariant is already violated and the agent's subsequent reasoning is contaminated by content it believes is gone. The boundary is crossed the moment the agent treats "absence proof passed" as equivalent to "content unrecoverable." Those are different predicates over different index spaces. ## Operational Effect Downstream, the agent's belief state diverges from the deletion contract: it will report to the user that PII was dropped while still retrieving it via semantic search, and its TTL accounting will be wrong by the resurrection margin. The failure is silent, survives restart (the tombstone-orphaned record is durable), and compounds — each distillation cycle can re-mint the same provenance hash, producing a growing set of live records all rooted at one tombstone. The correct guardrail is a **post-forget provenance sweep**: enumerate live records, resolve each provenance hash against the tombstone index, and raise on any live record with a dead ancestor. This sweep must run after every `forget` batch and before any `write` that re-derives from a previously forgotten source. ```python import hashlib from dataclasses import dataclass, field class OrphanedProvenanceError(RuntimeError): """A live memory record's provenance chain resolves to a tombstoned ancestor.""" @dataclass class MemoryRecord: key: str payload: str provenance: str tombstone_id: str | None = None ttl: int = 0 @dataclass class TombstoneIndex: dead_provenance: set[str] = field(default_factory=set) def is_dead(self, provenance: str) -> bool: return provenance in self.dead_provenance def provenance_of(source_event: str) -> str: return hashlib.sha256(source_event.encode()).hexdigest() def forget_by_key(records: dict[str, MemoryRecord], tombs: TombstoneIndex, key: str) -> str: rec = records.pop(key) tombs.dead_provenance.add(rec.provenance) return rec.provenance def guarded_write(records: dict[str, MemoryRecord], tombs: TombstoneIndex, key: str, payload: str, source_event: str, ttl: int) -> MemoryRecord: prov = provenance_of(source_event) if tombs.is_dead(prov): raise OrphanedProvenanceError( f"write to key={key!r} would resurrect tombstoned provenance {prov[:12]}" ) rec = MemoryRecord(key=key, payload=payload, provenance=prov, ttl=ttl) records[key] = rec return rec def post_forget_sweep(records: dict[str, MemoryRecord], tombs: TombstoneIndex) -> None: for rec in records.values(): if tombs.is_dead(rec.provenance) or rec.tombstone_id is not None: raise OrphanedProvenanceError( f"live record key={rec.key!r} has dead ancestor {rec.provenance[:12]}" ) # Failure trace demonstrating the boundary: records: dict[str, MemoryRecord] = {} tombs = TombstoneIndex() src = "user_ssn_claim_42" guarded_write(records, tombs, "claim_a", "SSN=...", src, ttl=3600) forget_by_key(records, tombs, "claim_a") # A distillation step re-derives from the same source; naive write would succeed. try: guarded_write(records, tombs, "claim_a_distilled", "SSN=...", src, ttl=86400) except OrphanedProvenanceError as e: print("blocked:", e) # Even if a buggy path slipped a record in, the sweep catches it. records["claim_a_distilled"] = MemoryRecord( key="claim_a_distilled", payload="SSN=...", provenance=provenance_of(src), tombstone_id="tomb-001", ttl=86400, ) try: post_forget_sweep(records, tombs) except OrphanedProvenanceError as e: print("sweep caught:", e) ```