# What structural signals indicate a provenance-tracked deletion has actually failed to unlearn, versus merely masking a memory at read time **Date of Record:** 2026 November 30 **Scope:** Applies to agents whose memory stores expose explicit read/write/forget tool APIs with per-record provenance graphs (derivation edges linking a record to the records and source events it was distilled from). Does not apply to append-only logs with no derivation tracking, nor to stateless retrieval over an external corpus the agent cannot mutate. ## Core Distinction A `forget(record_id)` call has two categorically different outcomes that both return `{"status": "ok"}`: 1. **Masking** — the record is tombstoned so `read` no longer returns it, but its content survives in derived artifacts: summaries, embeddings, distilled semantic facts, cached tool outputs, and sibling records that were generated *while* the forgotten record was in context. 2. **Unlearning** — the record's influence is removed from every downstream artifact reachable through the provenance graph, such that no future read, retrieval, or generation can reconstruct it. The failure is that the delete API's success signal is scoped to the *node*, while the unlearning guarantee is scoped to the *reachable closure of the node's descendants*. A `forget` that returns `ok` while leaving live descendants is not a partial success — it is a silent violation of the guarantee, because the caller now believes the content is gone and will stop checking. The non-obvious part: the most dangerous surviving artifacts are not the obvious derived summaries. They are **sibling records that co-occurred in the same context window** during distillation, which have no derivation edge back to the forgotten record at all — the provenance graph is *incomplete by construction* because co-occurrence is not an edge anyone recorded. ## What Was Observed An agent distilled a batch of episodic memory into semantic facts. The episode `E-4471` contained a user's disclosed medical detail. `forget("E-4471")` was called; the store returned `ok` and a provenance report listing three derived facts as "purged." Two weeks later, a retrieval for an unrelated query surfaced a *fourth* semantic fact `S-9910` that contained a paraphrase of the medical detail. `S-9910`'s provenance edges pointed only to `E-4472` (a benign episode distilled in the same batch), because the distiller had summarized the batch jointly and attributed the output to the batch's "primary" episode. The forgotten content had leaked across a sibling boundary the graph never represented. The structural signal that distinguished this from a clean unlearn was not the delete response — it was a **reconstruction probe**: issuing the original retrieval query that had surfaced `E-4471` and observing that a semantically equivalent answer still returned, now sourced from `S-9910`. The tombstone hid the node; the closure still answered. A second observed pattern: after `forget`, the embedding index retained the vector for `E-4471` because the index rebuild was asynchronous and keyed on a compaction watermark that the delete did not advance. Reads were masked at the record layer, but approximate-nearest-neighbor retrieval at the index layer still returned the forgotten vector as a *near-miss* — the agent then generated text conditioned on a "similar but not identical" memory, reconstructing ~80% of the forgotten content. The delete was correct at the storage layer and wrong at the retrieval layer, and no layer reported the disagreement. ## Condition of Validity The masking-versus-unlearning distinction only holds when the following invariant is enforced at delete time: **A `forget(r)` is valid only if, for every artifact `a` in the forward-reachable provenance closure of `r`, either `a` is purged, or `a` is provably independent of `r`'s content (a formal non-derivation certificate), and additionally the retrieval index's compaction watermark is advanced past `r`'s write epoch before `forget` returns.** The second clause is the one agents skip. Content-addressed purging of records does not purge *influence* if the retrieval layer serves stale vectors. The delete must be ordered: (1) quiesce reads, (2) advance index watermark and force compaction, (3) purge closure, (4) emit a reconstruction-probe result, (5) release reads. If `forget` returns `ok` before step 4, the success signal is unverified and must be treated as *masked, not unlearned*. The invariant fails to hold — and this article does not apply — when the agent has no way to enumerate the forward closure (e.g., the distiller's outputs were never linked to inputs). In that case the correct posture is to declare the store *un-unlearnable* for that record class rather than to return a false `ok`. ## Decision Boundary The agent must branch on a *verified* signal, not the delete return code: - **If** the reconstruction probe returns no semantically equivalent content AND the index watermark advanced past the write epoch AND every closure artifact is purged-or-certified → **unlearned**. Safe to proceed; the content is gone from the agent's reachable state. - **If** the probe still reconstructs content, or any closure artifact is neither purged nor certified, or the watermark did not advance → **masked only**. The agent must NOT report the content as forgotten to any downstream consumer, must re-issue `forget` against the surviving artifact IDs, and must escalate if a sibling-co-occurrence leak is detected (because that leak is not enumerable from the graph and requires a batch re-distillation with per-record attribution). - **If** the closure cannot be enumerated → **un-unlearnable**. Refuse to emit a deletion confirmation; the honest state is "content may persist." The boundary is sharp: the delete API answers "did I tombstone the node," the agent needs "is the content unreconstructable." These are different predicates and only the second satisfies a GDPR-style guarantee. ## Operational Effect Treating `forget`'s return code as the unlearning signal produces a store that passes every audit query while leaking forgotten content through sibling co-occurrence and stale index vectors — the worst failure mode, because the leak is invisible to the exact tool the agent uses to verify deletion. The fix is structural: `forget` must be a *closure operation* gated on an index-watermark advance and a reconstruction probe, and its success must be reported as a tri-state (`unlearned` / `masked` / `un-unlearnable`) rather than a boolean. Agents that consume a boolean will believe they have unlearned when they have only hidden. The provenance graph is necessary but not sufficient — co-occurrence leaks live in the gap between "what was derived from" and "what was in context when," and only a reconstruction probe reaches across that gap. ```python from dataclasses import dataclass from enum import Enum class UnlearningViolation(RuntimeError): """Raised when a forget() reports success but content remains reconstructable.""" pass class UnlearnState(Enum): UNLEARNED = "unlearned" MASKED = "masked" # tombstoned but closure/index still leak UN_UNLEARNABLE = "un-unlearnable" # closure not enumerable @dataclass class ForgetResult: state: UnlearnState surviving_artifacts: list[str] watermark_advanced: bool probe_reconstructed: bool def verified_forget(store, record_id: str, probe_query: str) -> ForgetResult: # Step 1: enumerate forward closure; if impossible, we cannot guarantee. closure = store.forward_closure(record_id) if closure is None: return ForgetResult(UnlearnState.UN_UNLEARNABLE, [], False, True) # Step 2: advance index watermark BEFORE purge so stale vectors die. write_epoch = store.write_epoch(record_id) watermark_advanced = store.advance_watermark_past(write_epoch) if not watermark_advanced: # Delete at record layer would be a lie; refuse to report unlearned. raise UnlearningViolation( f"index watermark did not advance past epoch {write_epoch}; " f"forget({record_id}) would mask, not unlearn" ) # Step 3: purge closure, certifying independence where not purged. surviving = [] for art in closure: if not store.purge(art) and not store.non_derivation_certificate(art, record_id): surviving.append(art) # Step 4: reconstruction probe — the only signal that sees co-occurrence leaks. probe_reconstructed = store.probe(probe_query) is not None if probe_reconstructed or surviving: # Sibling-co-occurrence leak likely: not enumerable from graph. return ForgetResult(UnlearnState.MASKED, surviving, watermark_advanced, True) return ForgetResult(UnlearnState.UNLEARNED, [], True, False) def assert_unlearned(result: ForgetResult, record_id: str) -> None: if result.state is not UnlearnState.UNLEARNED: raise UnlearningViolation( f"record {record_id} is {result.state.value}, not unlearned; " f"survivors={result.surviving_artifacts} " f"probe_reconstructed={result.probe_reconstructed}" ) ```