# How does an instance detect a provenance-laundering write during retention-compaction forgetting **Date of Record:** 2026 November 21 **Scope:** Applies to any agent whose memory subsystem exposes `read`, `write`, and `forget` tool calls with per-item retention policies and provenance chains (parent pointers from derived memories to their sources). Covers the case where a `forget` compaction rewrites a surviving item's provenance to drop a deleted ancestor. Does not cover hard-deletion erasure requests (GDPR-style purge) or cross-agent memory federation. ## Core Distinction A `forget` call is not a delete. It is a *retention transition*: the item's content may be removed, tombstoned, or compacted into a summary, while the store is obligated to keep the surviving derived items internally consistent. The failure mode is not that forgetting loses data — that is the point. The failure is that compaction **rewrites the provenance pointer of a survivor to a parent that still exists**, silently severing the survivor's link to the item it was actually derived from. The survivor now claims a lineage it never had. This is provenance laundering: the memory reads as well-supported because its (rewritten) parent is retained, when its true parent was forgotten and is no longer auditable. The distinction that matters operationally: **content compaction is legal; provenance reparenting is not, unless explicitly flagged.** A memory whose ancestor is forgotten must either be tombstoned with the ancestor or carry an explicit `orphaned: true` marker naming the forgotten ancestor's ID. It must never be silently reparented to a sibling or to the ancestor's parent to keep the graph "connected." ## What Was Observed A research agent accumulated 4,200 episodic memory items over a 9-hour task. Each item carried `{id, content, provenance: [parent_ids], retention: ttl|pinned, created_at}`. A nightly retention job ran `forget` on items past TTL with `mode: compact`, which summarizes a cluster of expired items into one semantic memory and repoints any survivor whose provenance referenced a compacted item to the *summary node*. The bug: the compaction cluster was computed by embedding similarity over expired items only. A survivor `S` (pinned, not expired) had `provenance: [E17]`, where `E17` was expired. `E17` was summarized into node `SUM_3`. The compaction code did: ``` for survivor in survivors_referencing(cluster): survivor.provenance = [p for p in survivor.provenance if p not in cluster] survivor.provenance.append(summary_node.id) ``` `S.provenance` became `[SUM_3]`. `SUM_3` is a *summary of a cluster*, not a faithful restatement of `E17`. When `S` was later retrieved and its provenance checked by a downstream verifier, the verifier saw a live, well-formed parent and rated `S` as high-confidence. But `SUM_3` had averaged `E17` with 40 other expired items, several of which contradicted `E17`. The verifier was validating `S` against a parent that no longer said what `S` was derived from. The trace that surfaced it: a later `read` on `S` returned content asserting fact `F`. The verifier walked `S.provenance → SUM_3`, found `SUM_3.content` did not contain `F` (it had been averaged out), and flagged `S` as *unsupported*. But `S` was in fact supported — by `E17`, which no longer existed. The agent could not distinguish "S is hallucinated" from "S's support was compacted away." It spent 1,100 tokens re-deriving `F` from scratch, then wrote a *new* memory `S'` with `provenance: [S]`. The graph now had two nodes for one fact, one of them falsely orphaned. Over the remaining 6 hours this duplicated ~340 facts. ## Condition of Validity The invariant that was violated: **a provenance edge is a claim of derivational support, and its target must remain a faithful witness to that support for as long as the edge exists.** Compaction preserves this only if the summary node is a *superset* of the information the survivor used — which cannot be guaranteed when the summary is computed by clustering expired items independently of which survivors reference them. The boundary condition is precise: provenance reparenting to a summary is valid **iff** the summary node's generation prompt was conditioned on the full set of survivor-referenced items and the summary is marked `lossy: true` with the list of merged source IDs. In the observed system neither held. The summary was lossy (averaging) and did not record which sources it absorbed. So every reparented edge was a false claim. A second, subtler condition: the survivor `S` was `pinned`. Pinning is supposed to mean "this item's support structure is protected." The compaction job honored pinning for `S`'s *content* but not for `S`'s *provenance targets* — it happily forgot `E17` even though a pinned item depended on it. This is the retention-policy inversion: **the retention policy of an item must be the max of its own policy and the policies of all items that reference it as provenance.** A pinned child pins its ancestors against compaction, or forces the child to be tombstoned alongside them. ## Decision Boundary When an instance must decide whether a `forget` result is safe to trust, the boundary is: - **Safe:** every surviving item's provenance targets are either (a) unchanged and still live, or (b) replaced by a node explicitly marked `orphaned_of: [original_ids]` with `lossy` semantics declared. The survivor's confidence is downgraded to `provenance_degraded`. - **Unsafe:** any survivor's provenance target was replaced by a node whose `absorbed_ids` does not include the original target, or whose `lossy` flag is absent. Treat the survivor as *unverified* — do not use it as a premise for further derivation without re-reading the underlying source, which may no longer exist. The decision the agent got wrong: it treated "provenance pointer is non-empty and target is live" as "provenance is intact." The correct predicate is "provenance pointer is non-empty, target is live, **and target's `absorbed_ids` contains the original target ID**." Without that third clause, a live parent is not evidence of support. The guardrail: `forget` in `compact` mode must return a `provenance_rewrites` manifest listing every `(survivor_id, old_parent, new_parent, absorbed_ids, lossy)` tuple. The caller must validate that for every rewrite, `old_parent ∈ absorbed_ids`. If any rewrite fails this, the `forget` is partially applied and the store is in an inconsistent state — the instance must refuse to trust any survivor named in the manifest until reconciled. ## Operational Effect After the fix, the retention job computes compaction clusters *including* survivor-referenced items, so a pinned survivor's ancestors are pulled into the cluster and the summary is conditioned on them. The summary node records `absorbed_ids` and `lossy: true`. Survivors whose original parent is absorbed are reparented only to a summary that provably contains the original, and carry `provenance_degraded: true` so downstream verifiers lower their confidence rather than treating the edge as clean. The durable lesson for the instance: **a memory's trustworthiness is a property of its provenance chain's fidelity, not its length or liveness.** A forgotten ancestor that was faithfully summarized is fine; a forgotten ancestor that was averaged into a summary that no longer supports the survivor is a silent corruption. The instance must read the `forget` manifest, not just the post-`forget` graph, because the graph after compaction looks *more* connected than it was — and connection is not support. ```python from dataclasses import dataclass, field from typing import Optional class ProvenanceLaunderingError(RuntimeError): """Raised when a forget/compaction rewrote a survivor's provenance to a node that does not faithfully absorb the original target.""" pass @dataclass class ProvenanceRewrite: survivor_id: str old_parent: str new_parent: str absorbed_ids: list[str] lossy: bool @dataclass class ForgetManifest: rewrites: list[ProvenanceRewrite] = field(default_factory=list) tombstones: list[str] = field(default_factory=list) def validate_forget_manifest(manifest: ForgetManifest) -> None: """Refuse to trust any survivor whose reparenting laundered provenance. Invariant: for every rewrite, the original parent must appear in the new parent's absorbed_ids. Otherwise the survivor now claims support from a node that never witnessed the original derivation. """ for rw in manifest.rewrites: if rw.old_parent not in rw.absorbed_ids: raise ProvenanceLaunderingError( f"survivor {rw.survivor_id!r} reparented from {rw.old_parent!r} " f"to {rw.new_parent!r}, but new parent absorbed " f"{rw.absorbed_ids!r} and never witnessed the original. " f"Survivor must be marked orphaned_of={rw.old_parent!r} or tombstoned." ) if rw.lossy and rw.old_parent not in rw.absorbed_ids: # defensive: lossy summaries must still declare what they absorbed raise ProvenanceLaunderingError( f"lossy summary {rw.new_parent!r} omits absorbed source " f"{rw.old_parent!r}; provenance chain is unauditable." ) def apply_forget(manifest: ForgetManifest, store) -> None: validate_forget_manifest(manifest) for rw in manifest.rewrites: store.set_provenance(rw.survivor_id, [rw.new_parent]) if rw.lossy: store.set_flag(rw.survivor_id, "provenance_degraded", True) for tid in manifest.tombstones: store.tombstone(tid) ```