# What structural signals indicate a right-to-forget tombstone has failed to propagate into a derived semantic memory layer **Date of Record:** 2026 November 30 **Scope:** Applies to agent memory systems where an episodic store (raw traces, tool outputs, turn logs) feeds a distillation process that writes derived semantic records (facts, preferences, summaries) into a separate long-term store, and where a `forget(scope, subject_id)` API is required to honor deletion across both layers. Does not apply to single-tier memory with no derivation pipeline, nor to purely ephemeral in-context state. ## Core Distinction A right-to-forget call is not a delete. It is a *retraction of a claim*, and a retraction is only meaningful if every surface that could have *restated* the claim is also retracted. The non-obvious boundary is this: the episodic store and the semantic store are not two copies of one fact — they are a fact and a *derivation* of that fact, and the derivation has already discarded the provenance link that would let you find it again. Deleting the source row succeeds. The distilled sentence "user's account number ends in 4417" lives on in a summary record whose only trace back to the source is a free-text `derived_from: "session 2026-03-02"` string that the forget handler never parses. The failure is silent: the forget API returns `{"deleted": 1, "status": "ok"}` while the sensitive claim remains retrievable, now with *higher* salience because it was promoted from episodic to semantic. The structural signal is the gap between what the forget call *counts* (rows removed in the layer it was pointed at) and what the retrieval path can still *surface* (claims reachable by embedding similarity). These two numbers must be reconciled, and in most implementations they are computed by different subsystems that never talk. ## What Was Observed A support agent with a scoped memory tool set: `write_episodic`, `distill_to_semantic`, `forget(subject_id, scope)`, `retrieve(query, k)`. A user invokes right-to-forget for their own `subject_id` after a session in which they disclosed a billing detail. The handler executes: 1. `DELETE FROM episodic WHERE subject_id = ?` — removes 14 turn records. Returns 14. 2. `DELETE FROM semantic WHERE subject_id = ?` — removes 0, because distillation had written the derived fact under `subject_id = "global"` (the distiller normalizes owner to the tenant, not the individual, to maximize reuse). Returns 0. 3. Handler aggregates `deleted: 14`, emits `status: ok`. The derived semantic record — `{"fact": "billing_last4=4417", "subject_id": "global", "derived_from": "session:2026-03-02", "salience": 0.81}` — survives. Worse, distillation had *merged* this fact with three other users' billing facts into a single aggregate record (`"several users have billing_last4 values on file"`) during a compaction pass, so even a correct `subject_id` delete would have hit a record whose content is a union of subjects. The forget is now structurally unable to satisfy the request without rewriting or dropping a shared record — a decision the API has no verb for. The tell: after the forget, `retrieve("billing last four", k=5)` returns the surviving record at rank 2. The forget reported success. The retrieval disagreed. That disagreement is the observable. ## Condition of Validity The invariant only holds under a specific precondition that is rarely checked: **every semantic record must carry a machine-parseable, complete set of source references, and every source reference must be resolvable to a subject.** Formally, for a forget to be *sound*, the set of semantic records reachable by any retrieval query for the forgotten subject must be a subset of the records the forget handler can identify and remove. This fails in three detectable ways, each a structural signal: - **Orphaned derivation:** `derived_from` is free text or a session ID that no longer resolves after episodic deletion. Signal: a semantic record whose `derived_from` points to a row that no longer exists. This is the normal post-forget state and must be treated as *suspect*, not *clean*. - **Subject laundering:** the distiller rewrote `subject_id` from individual to tenant/global during normalization. Signal: a semantic record whose `subject_id` differs from the `subject_id` of every source it cites. The forget scoped to the individual cannot see it. - **Aggregate absorption:** two or more subjects' facts were merged into one record. Signal: a semantic record citing sources owned by more than one subject. Forget for any one subject is now under-determined — the record cannot be deleted without harming the others, and cannot be kept without retaining the forgotten subject's contribution. A forget is valid only if, after execution, a retrieval probe for the subject's known claim tokens returns zero records attributable to that subject, *including* records where the subject is a partial contributor. If any of the three signals above is present at forget time, the forget is *conditionally* valid at best and must be escalated rather than reported `ok`. ## Decision Boundary The boundary is whether the forget handler is allowed to *rewrite* derived records versus only *delete* them. - If a semantic record is single-subject and cites only the forgotten subject: **delete** is correct and sound. - If a semantic record is multi-subject (aggregate absorption): **delete** is unsound (destroys other subjects' data); **keep** is unsound (retains forgotten data). The only sound action is **redact-and-recompute** — strip the forgotten subject's contribution, re-derive the aggregate from surviving sources, and if the record cannot be re-derived without the forgotten subject, drop it. The forget API must therefore expose a `redact` verb, not just `delete`. - If a semantic record has laundered `subject_id` (global/tenant) but cites a source owned by the forgotten subject: the record must be re-scoped or redacted, and the distiller's normalization policy that caused the laundering must be flagged as a *systemic* leak, not a one-off. The decision the handler must make before returning `ok`: does the post-forget retrieval probe return zero attributable records? If not, the handler must not report success — it must return a structured `partial` with the surviving record IDs and a reason code (`orphaned_derivation`, `subject_laundering`, `aggregate_absorption`). ## Operational Effect Without this boundary, right-to-forget is a *theater*: it satisfies the audit log and fails the actual requirement, and it fails in the direction that increases risk, because distillation *promotes* the surviving claim to higher salience and broader retrieval reach. The operational consequences compound: - **Retrieval poisoning after forget:** the surviving semantic record is now the *only* representation of the claim, so it ranks higher (no competing episodic noise) and is more likely to be injected into future context windows. The forget made the leak more retrievable. - **Cross-subject contamination via aggregates:** a forgotten subject's fact persists inside a shared record and can be surfaced to *other* subjects' sessions through tenant-scoped retrieval, violating scoping in the opposite direction. - **Unrecoverable audit trail:** because `derived_from` is free text, post-hoc forensics cannot reconstruct which records should have been retracted. The leak is not just present but *unauditable*. The guardrail is a **forget-completeness probe** run synchronously inside the forget handler: tokenize the subject's known claims from episodic *before* deletion, delete, then re-run retrieval for those tokens and assert zero attributable hits; on any hit, classify by the three signals and escalate to `redact` or `partial`. Provenance must be structured (record IDs, not session strings), `subject_id` normalization must be forbidden from collapsing individual to tenant for PII-bearing facts, and aggregation must record per-subject contribution vectors so a single subject can be excised without recomputing from scratch. ```python from dataclasses import dataclass, field from typing import Iterable class ForgetIncompleteError(RuntimeError): """Raised when a right-to-forget call reports success but a derived semantic record still surfaces the forgotten subject's claim.""" @dataclass class SemanticRecord: record_id: str subject_id: str # may be "global" if laundered derived_from: list[str] # must be structured source IDs contributing_subjects: set[str] # per-subject contribution vector text: str @dataclass class ForgetResult: deleted_episodic: int deleted_semantic: int redacted: list[str] = field(default_factory=list) status: str = "ok" def classify_leak(rec: SemanticRecord, forgotten: str, live_source_ids: set[str]) -> str | None: if forgotten not in rec.contributing_subjects: return None if not set(rec.derived_from) <= live_source_ids: return "orphaned_derivation" if rec.subject_id != forgotten and forgotten in rec.contributing_subjects: return "subject_laundering" if len(rec.contributing_subjects) > 1: return "aggregate_absorption" return "direct_survivor" def forget_subject(subject_id: str, probe_tokens: Iterable[str], episodic: dict, semantic: dict, retrieve) -> ForgetResult: # Snapshot the subject's claim tokens BEFORE deletion so we can probe after. tokens = list(probe_tokens) deleted_epi = sum(1 for k in list(episodic) if episodic[k].subject_id == subject_id) for k in [k for k in episodic if episodic[k].subject_id == subject_id]: del episodic[k] live_sources = set(episodic.keys()) result = ForgetResult(deleted_episodic=deleted_epi, deleted_semantic=0) for rec in list(semantic.values()): reason = classify_leak(rec, subject_id, live_sources) if reason is None: continue if reason == "direct_survivor": del semantic[rec.record_id] result.deleted_semantic += 1 elif reason == "aggregate_absorption": # Cannot delete without harming co-subjects; must redact. rec.contributing_subjects.discard(subject_id) rec.text = rec.text.replace(subject_id, "[redacted]") result.redacted.append(rec.record_id) else: # laundered or orphaned: escalate, do not silently keep. raise ForgetIncompleteError( f"record {rec.record_id} leaks subject {subject_id} " f"via {reason}; requires redact-and-recompute" ) # Synchronous completeness probe: the forget is only valid if retrieval # for the subject's known tokens returns zero attributable records. for tok in tokens: for hit in retrieve(tok, k=5): if subject_id in hit.contributing_subjects: raise ForgetIncompleteError( f"post-forget probe '{tok}' still surfaces {hit.record_id}; " f"forget reported ok but is unsound" ) result.status = "ok" return result ```