# What structural signals indicate a tombstone-without-lineage failure when an agent's `forget` succeeds at the index but leaves derivations live **Date of Record:** 2026 November 26 **Scope:** Applies to agents that expose read/write/forget memory tool APIs with per-record provenance edges and must satisfy deletion compliance (GDPR erasure, tenant offboarding, secret rotation). Does not apply to append-only audit logs exempt from erasure under a documented legal-hold policy, nor to stateless single-turn agents with no persistent memory store. ## Core Distinction The failure is not "the record wasn't deleted." The failure is that the record **was** deleted from the primary store, the `forget` tool returned `{"status": "deleted", "id": "m_8842"}`, and the agent's own compliance check passed—while *derived* memory records that were synthesized from `m_8842` remain readable, and their provenance edges now point at a dangling node. The agent has confused **record erasure** with **lineage erasure**. A memory API with provenance tracking has two distinct deletion semantics that are easy to conflate: - **Node deletion**: remove the bytes of record `R` from the primary store and its embedding index. Cheap, atomic, verifiable by `read(R) → NotFound`. - **Lineage closure**: for every record `D` where `provenance(D) ∋ R`, either delete `D`, redact the specific spans of `D` that were copied from `R`, or re-derive `D` from surviving sources. Expensive, non-atomic, and *not* verifiable by a single read. The tombstone-without-lineage state is reached when the first completes and the second is skipped or partially applied. The structural signal is a **provenance edge whose target resolves to a tombstone**—and, critically, the agent's compliance verifier did not treat that edge as a violation because it checked reachability of `R`, not reachability of `R`'s *content* through `D`. ## What Was Observed A support-triage agent maintained an episodic store with a `summarize_into_semantic` distillation job running on a 15-minute cadence. Each semantic record carried `provenance: [episodic_ids]` and a `derivation: "distill_v3"` tag. A user exercised erasure at T+0. The `forget` tool: 1. Marked episodic record `m_8842` deleted in the primary table. 2. Enqueued an async index-purge job (completed ~90s later). 3. Walked `provenance` edges *outbound from* `m_8842` to find records it had derived—but the edge direction in the schema was `derived → source`, so the outbound walk found zero children and the closure step no-op'd. 4. Returned `deleted`, and the compliance verifier re-ran `read(m_8842)`, got `NotFound`, and signed off. At T+6min, the distillation job fired. It read the semantic store, found record `s_2201` whose `provenance` included `m_8842`, attempted to re-validate its sources, hit a tombstone, and—because the job's error handling treated unresolvable provenance as a soft warning—**kept `s_2201` live** and wrote a fresh `s_2207` derived from the same batch, now with `provenance: ["m_8842", "m_8850"]` where `m_8842` was a tombstone. Observed structural signals, in the order a verifier would see them: - `provenance_edge(m_8842 → s_2201)` still present in the edge table after `forget` returned success. - `read(s_2201)` returns a summary containing a verbatim span from the erased record ("…the account number ending 4471…"). - The distillation job's `unresolved_source` counter incremented but did not block the write; `s_2207` was created *after* erasure with a reference to the erased node. - The compliance verifier's check was `read(R) == NotFound`—true—and its edge check queried `edges_from(R)` (outbound), which was empty by schema convention. The decisive signal is the **inbound edge on a tombstoned node**. `edges_to(m_8842)` was non-empty and growing. No part of the pipeline read that direction. ## Condition of Validity The invariant that must hold for erasure to be sound: > For any record `R` marked deleted at time `t`, the set `{D : R ∈ provenance(D)}` must be empty at every time `t' > t`, and the content of `R` must not be reconstructable from any live record's payload. This is violated whenever any of the following hold: 1. **Edge direction is asymmetric in the schema but symmetric in the semantics.** If `provenance(D) = [R]` is stored as `D → R` and `forget` walks outbound from `R`, it will never find `D`. The guardrail is a mandatory reverse index `source → derived` maintained transactionally with every write, and the closure step must walk *that*. 2. **Distillation is asynchronous relative to erasure.** Any job that materializes new records from sources must re-check source liveness *inside the write transaction*, not at job start. A source that was live at T+0 and tombstoned at T+6 must abort the derivation, not warn. 3. **Verification is single-record.** `read(R) == NotFound` proves node deletion only. A compliance check that does not enumerate `edges_to(R)` and assert emptiness, and does not scan derived payloads for copied spans, is not a compliance check. 4. **Soft-delete is treated as deletion.** If `forget` sets `deleted_at` but leaves the row readable to the distillation job (which filters on `deleted_at IS NULL` inconsistently across code paths), the "deleted" record is still a live source. The failure does not require adversarial input. It requires only that the `forget` implementation and the derivation job disagree about edge direction or about whether a tombstone is a valid source—both ordinary schema-drift outcomes. ## Decision Boundary The boundary between "erasure complete" and "erasure claimed but incomplete" is crossed at the moment the `forget` tool returns success without a **lineage-closure proof**. Concretely, the tool must not return `deleted` unless it can produce, in the same transaction: - `edges_to(R)` enumerated and each dependent `D` classified as `deleted`, `redacted`, or `re-derived`. - For each `D` kept live, a redaction receipt asserting the copied spans were removed (span-level, not record-level—a summary's other content may be legitimately derivable from surviving sources). - A monotonically increasing `lineage_epoch` bumped so that any distillation job holding a stale epoch aborts rather than writes. If the tool cannot produce this proof—because closure is async, or because the reverse index is missing—it must return `{"status": "pending_lineage_closure", "id": R, "dependents": [...]}` and the agent must treat the record as *not yet erased* for compliance purposes. Returning `deleted` on node-only success is the exact decision-boundary error. The second boundary is in the verifier: a check that passes on `read(R) == NotFound` must be rejected as insufficient. The verifier's contract is the invariant above, and it is only satisfiable by querying the reverse index and scanning dependent payloads for copied spans. ## Operational Effect Downstream, the tombstone-without-lineage state produces three compounding effects: 1. **Compliance false-positive.** The erasure ticket closes; the data subject is told the record is gone; the content survives in `s_2201` and is now *more* durable because it was distilled into a semantic record with a longer retention window. The blast radius grows after the deletion, which is the opposite of the intended direction. 2. **Provenance graph corruption.** Every subsequent derivation that touches `s_2201` inherits a dangling reference to `m_8842`. Graph queries that join on provenance now either drop rows (silent undercount) or fail (loud, but only when someone queries). The dangling edge is a permanent structural artifact that outlives the incident. 3. **Re-derivation poisoning.** If a later job attempts to re-derive `s_2201` from its sources, it will find `m_8842` missing and may fall back to using `s_2201` itself as a source—creating a self-referential provenance cycle that the closure walker cannot terminate. This is the failure mode that turns a compliance bug into an availability bug. The corrective pattern is to make lineage closure a **precondition of the success return**, not a follow-up job, and to make the reverse index a **write-time invariant** rather than a derived view. An agent that cannot maintain the reverse index transactionally should not expose `forget` as a synchronous success at all. ```python from dataclasses import dataclass, field from typing import Optional class LineageClosureError(RuntimeError): """Raised when forget() cannot prove that no live record derives from the target.""" @dataclass class MemoryRecord: id: str payload: str provenance: list[str] = field(default_factory=list) deleted: bool = False class ProvenanceStore: def __init__(self) -> None: self.records: dict[str, MemoryRecord] = {} self.reverse: dict[str, set[str]] = {} # source_id -> derived_ids self.lineage_epoch: int = 0 def write(self, rec: MemoryRecord) -> None: for src in rec.provenance: if src in self.records and self.records[src].deleted: raise LineageClosureError( f"refusing write {rec.id}: source {src} is tombstoned" ) self.reverse.setdefault(src, set()).add(rec.id) self.records[rec.id] = rec def forget(self, target_id: str) -> dict: rec = self.records.get(target_id) if rec is None: return {"status": "not_found", "id": target_id} dependents = sorted(self.reverse.get(target_id, set())) live_dependents = [ d for d in dependents if d in self.records and not self.records[d].deleted ] if live_dependents: # Node deletion alone is NOT erasure. Refuse the success return. raise LineageClosureError( f"cannot complete erasure of {target_id}: " f"live dependents {live_dependents} still derive from it; " f"redact or re-derive before retrying" ) rec.deleted = True self.lineage_epoch += 1 return { "status": "deleted", "id": target_id, "lineage_epoch": self.lineage_epoch, "dependents_closed": dependents, } def verify_erasure(self, target_id: str) -> bool: if target_id in self.records and not self.records[target_id].deleted: return False for dep in self.reverse.get(target_id, set()): if dep in self.records and not self.records[dep].deleted: raise LineageClosureError( f"erasure of {target_id} incomplete: dependent {dep} live" ) return True ```