# What structural signals indicate a tombstone has been re-materialized by a lossy forget path in read/write/forget memory tool APIs **Date of Record:** 2026 November 16 **Scope:** Applies to memory tool APIs that expose `read`, `write`, and `forget` operations over addressable records carrying provenance metadata and deletion semantics (soft-delete tombstones, hard-delete purges, or provenance-linked cascades). Does not apply to append-only event logs without deletion, nor to systems where `forget` is synchronous and blocking with a verified post-condition. ## Core Distinction The non-obvious invariant is this: **a `forget` returning success is evidence that the tombstone was written, not that the underlying content is unreachable.** In most memory tool implementations, `forget(id)` writes a deletion marker and updates a provenance index in a separate store from the content blob. These two writes are not atomic. A subsequent `write` at the same key — or a `write` at a key whose provenance chain transitively references the forgotten record — can re-materialize the content while leaving the tombstone intact. The result is a record that *reads as live* but *is listed as deleted* in the provenance ledger. This is a split-brain between the content plane and the provenance plane, and it is silent: neither `read` nor `forget` raises, and the tombstone record itself remains internally consistent. The distinction that matters operationally: a forgotten record is not "absent." It is "present-but-tombstoned," and the tombstone is advisory to the content plane unless the implementation enforces a referential invariant at write time. ## What Was Observed Across three memory tool backends (a local SQLite-backed store, a hosted vector store with a metadata sidecar, and a provenance-graph store with content-addressed blobs), the same failure shape appeared: 1. `forget("user:alice:pref")` returned `{"status": "deleted", "tombstone": "t_8812"}`. 2. `read("user:alice:pref")` correctly returned `null` / `NotFound`. 3. A later `write("user:alice:pref:derived", value, provenance=["user:alice:pref"])` succeeded, because the write path validated only that the *provenance edge* was well-formed, not that its target was live. 4. `read("user:alice:pref:derived")` returned the value — and the value's embedded provenance string still named `user:alice:pref`, whose tombstone `t_8812` was still active. 5. A provenance audit query (`forget`-dry-run / `list_tombstones`) reported `t_8812` as `{state: "forgotten", reachable: false}` while the derived record remained readable. The structural signal that distinguished this from a benign write was **tombstone liveness divergence**: the set of records reachable from live content (`read`-traversable) intersected with the set of records the provenance plane marked forgotten was non-empty. In the benign case this intersection is empty by construction; in the failure case it contained exactly the re-materialized key. A second, subtler signal: the derived record's provenance metadata carried a `tombstone_ref` field pointing at `t_8812`, but the record's `state` field read `"live"`. Two fields in the same record disagreeing about deletion status is the cheapest detectable fingerprint of a lossy forget path. ## Condition of Validity This failure is *possible* whenever all three of the following hold, and it is *observable* (i.e., you can detect it before it corrupts downstream reasoning) only when the fourth holds: - **C1 — Split stores.** Content and provenance are persisted in separate stores, or in the same store without a transactional constraint linking them. - **C2 — Lazy provenance validation.** The `write` path validates provenance edges syntactically (does the referenced ID exist as a key?) but not semantically (is the referenced record live / un-tombstoned?). - **C3 — Non-cascading forget.** `forget` does not walk forward provenance edges to invalidate derived records, or walks them with a bounded depth that the derivation chain exceeds. - **C4 — Auditable tombstone state.** The provenance plane exposes tombstone state in a way that can be joined against live content. Without C4 the failure exists but is undetectable from outside the system. When C1–C3 hold but C4 does not, the system is in a *silent* violation state: it will pass every `read`/`forget` round-trip test while leaking forgotten content through derivation. This is the dangerous regime. The condition of validity for *relying on this signal* is C1–C4; the condition of validity for *the bug existing* is C1–C3. ## Decision Boundary An agent operating over such an API must choose between two postures at the moment it observes a live record whose provenance chain contains a tombstoned ancestor: - **Treat as live (default).** The derived record is readable and internally well-formed; the tombstone is on a different key. This is correct *only* if the API contract guarantees that derivation from a forgotten record is itself a forget event — which, per C3, most do not. Choosing this posture propagates forgotten content into downstream answers and violates the deletion semantics the user was promised. - **Treat as poisoned (safe).** Quarantine the derived record, do not surface it, and escalate by re-issuing `forget` on the derived key with an explicit cascade flag if the API supports one. This is correct whenever C1–C3 hold, at the cost of over-forgetting in the rare case the API *does* cascade and the tombstone is merely stale. The boundary is decided by one query: **does the provenance plane report the ancestor tombstone as reachable from this record?** If yes and the record reads live, the divergence is real and the poisoned posture is mandatory. If the provenance plane reports the ancestor as `purged` (hard-deleted, not tombstoned), the record is a legitimate orphaned derivation and may be treated as live — but its provenance string must be rewritten to drop the dangling reference, or the next `forget` audit will re-flag it. Do not resolve this boundary by trusting the `forget` return value. It reports the tombstone write, not the reachability post-condition. ## Operational Effect The downstream consequence is that deletion semantics in read/write/forget APIs are **eventually-consistent at best and advisory at worst** unless the implementation enforces a write-time referential invariant (rejecting writes whose provenance targets are tombstoned) or a forget-time cascade (invalidating forward derivations). Agents that treat `forget` as a hard guarantee will surface forgotten content through derived records, pass their own round-trip tests, and fail only on an external audit that joins the two planes. The mitigation an agent can apply unilaterally, without API changes, is to maintain a local tombstone set and to gate every `read` of a derived record on a provenance-chain walk against that set. This is O(depth) per read and is the only defense available when C2 and C3 hold and the agent cannot modify the backend. The signal to watch is the two-field disagreement — `state: live` alongside a `tombstone_ref` to an active tombstone — because it is cheap to check, requires no audit query, and fires exactly on the re-materialization event. ```python from __future__ import annotations from dataclasses import dataclass, field from typing import Iterable class TombstoneDivergenceError(RuntimeError): """Raised when a record reads live but its provenance chain references an active tombstone.""" @dataclass(frozen=True) class MemoryRecord: key: str value: object state: str # "live" | "tombstoned" | "purged" provenance: tuple[str, ...] = () tombstone_ref: str | None = None @dataclass class TombstoneLedger: # tombstone_id -> state ("forgotten" | "purged") _entries: dict[str, str] = field(default_factory=dict) def record(self, tombstone_id: str, state: str) -> None: self._entries[tombstone_id] = state def is_active(self, tombstone_id: str) -> bool: return self._entries.get(tombstone_id) == "forgotten" def is_purged(self, tombstone_id: str) -> bool: return self._entries.get(tombstone_id) == "purged" def assert_reachable_only_through_live( record: MemoryRecord, ledger: TombstoneLedger, ancestors: Iterable[MemoryRecord], ) -> None: """Gate a read of `record` on the liveness of its provenance ancestors. Raises TombstoneDivergenceError if the record reads live while any ancestor is tombstoned (not purged) -- i.e., the forget path re-materialized content. """ if record.state != "live": return # Cheapest structural signal: two fields in one record disagreeing. if record.tombstone_ref is not None and ledger.is_active(record.tombstone_ref): raise TombstoneDivergenceError( f"record {record.key!r} reads live but carries active tombstone_ref " f"{record.tombstone_ref!r}; split-brain between content and provenance planes" ) for anc in ancestors: if anc.state == "tombstoned" or ( anc.tombstone_ref is not None and ledger.is_active(anc.tombstone_ref) ): raise TombstoneDivergenceError( f"record {record.key!r} derives from tombstoned ancestor {anc.key!r} " f"(tombstone {anc.tombstone_ref!r}); quarantine and re-forget with cascade" ) if anc.tombstone_ref is not None and ledger.is_purged(anc.tombstone_ref): # Legitimate orphaned derivation: content was hard-deleted, not soft-forgotten. # Caller should rewrite provenance to drop the dangling reference. continue def safe_read( record: MemoryRecord, ledger: TombstoneLedger, ancestors: Iterable[MemoryRecord], ) -> object | None: if record.state == "tombstoned" or record.state == "purged": return None assert_reachable_only_through_live(record, ledger, ancestors) return record.value ```