# Under what conditions must an instance refuse a provenance-scoped forget call that would orphan a live derivation **Date of Record:** 2026 November 22 **Scope:** Applies to agents whose memory subsystem exposes explicit `read`/`write`/`forget` tools with per-record provenance tags and retention policies (TTL, legal-hold, derivation-lineage). Does not apply to stateless completion calls or to append-only logs where no `forget` primitive exists. ## Core Distinction The distinction that matters is between **deletion as a leaf operation** and **deletion as a graph operation**. A naive memory tool treats `forget(id)` as removing one row. But provenance-tracked memory is a DAG: a semantic memory record (`S`) is frequently derived from one or more episodic records (`E1…En`), and a downstream plan or answer (`P`) may cite `S`. When a retention policy expires on `E2` and the agent issues `forget(E2)`, the correct behavior is *not* automatic success. The boundary condition is this: **a forget call is only valid if, after removal, every surviving record's provenance chain still resolves to a live, policy-permitted ancestor — or the surviving record is itself demoted to `unverified`.** The failure is silent. `forget` returns `{"ok": true}`, the row disappears, and the agent continues. Hours later a `read(S)` returns a synthesis whose supporting evidence no longer exists, and the instance presents it with the same confidence as before. The invariant violated is *provenance closure*: no live record may cite a tombstoned ancestor without an explicit demotion flag. ## What Was Observed A research agent maintained a three-tier store: `episodic` (raw tool outputs, 14-day TTL), `semantic` (distilled claims citing episodic IDs), and `plan` (task state citing semantic IDs). A nightly retention sweep called `forget` on expired episodic records. Trace of the failure: 1. `E2` (a database schema dump, TTL expired) is forgotten. `S7` ("table `orders` has column `status` of type `enum`") cites `E2`. The sweep did not check citations. 2. `S7` survives with a dangling `derived_from: ["E2"]`. Its own TTL is 90 days, so it is not swept. 3. Next session, the agent cold-starts, calls `read(S7)`, receives the claim with no indication its source is gone. 4. The agent acts on `S7` — but `E2` had been *superseded* before expiry by a migration that dropped `status`. The supersession note lived only in `E2`'s metadata. That metadata is now tombstoned. 5. The agent emits a query against a dropped column. The error surfaces as a tool failure, not a memory failure, so the root cause (orphaned derivation) is never attributed. The non-obvious part: the *semantic* record was still "correct at write time." Deletion didn't corrupt `S7`'s content; it destroyed `S7`'s **auditability and its supersession linkage**. The record became unfalsifiable — the agent could no longer check whether it had been invalidated. ## Condition of Validity A `forget(target)` call is admissible only when **all** of the following hold: - **Citation closure:** No live record lists `target` in its `derived_from` set, *or* the caller passes `cascade="demote"` and the tool atomically flips every citing record to `status: unverified` with `orphaned_by: target`. - **Supersession carriage:** If `target` carries a `superseded_by` pointer, that pointer must be *transferred* to each citing record before tombstoning, so the surviving claim inherits the invalidation. - **Policy dominance:** The retention policy that authorizes forgetting `target` must not be overridden by a stronger policy on any citing record (e.g., a legal-hold on `S7` forbids orphaning it silently). - **Warrant propagation:** In multi-agent settings, if `target` was written under a warrant/identity that a peer agent's derivation depends on, the forget must propagate a tombstone event to that peer, not just delete locally. If any condition fails, the tool must **reject**, not partially apply. Partial application is the worst outcome: it leaves the store in a state where some citing records are demoted and others are not, and replay-based verification will diverge between agents. ## Decision Boundary The boundary between "forget succeeds" and "forget must be refused/demoted" is drawn at the **first live citation**, not at the record itself: - **Leaf record, no citations, no supersession pointer** → forget is a pure leaf op; proceed. - **Record with citations, caller requests `cascade="demote"`** → proceed atomically; return the list of demoted IDs so the agent can re-verify them. - **Record with citations under a hold, or with a `superseded_by` pointer that cannot be transferred** → **refuse** and surface the blocking set. The trap is treating "TTL expired" as sufficient authorization. TTL authorizes *deletion of the leaf*, not *destruction of the evidence graph*. An agent that conflates the two will pass every unit test (the row is gone) and fail in production (the derivation is orphaned). ## Operational Effect Enforcing this invariant changes the sweep from a blind `DELETE` into a graph-aware transaction. The retention sweep must, per candidate: query the reverse-citation index, evaluate policy dominance, and either demote-and-delete atomically or refuse and enqueue for human/parent review. The cost is a reverse index and a two-phase commit on the memory store. The benefit is that every surviving semantic record is either *evidence-backed* or *explicitly flagged unverified* — the agent never again presents an orphaned claim with unwarranted confidence. Downstream, `read` must return `status` and `orphaned_by` so the reasoning loop can down-weight or re-derive. ```python class ProvenanceOrphanError(RuntimeError): """Raised when a forget call would leave a live record citing a tombstoned ancestor.""" pass def forget(memory, target_id, cascade="refuse"): record = memory.get(target_id) if record is None: return {"ok": True, "noop": True} citing = memory.reverse_citations(target_id) # live records with target_id in derived_from superseded_by = record.meta.get("superseded_by") if citing and cascade != "demote": raise ProvenanceOrphanError( f"forget({target_id}) would orphan live records {citing}; " f"pass cascade='demote' to proceed atomically." ) for cid in citing: held = memory.policy(cid) if held.blocks_orphaning: raise ProvenanceOrphanError( f"policy '{held.name}' on {cid} forbids orphaning via forget({target_id})." ) # atomic phase: demote citers, transfer supersession, then tombstone with memory.transaction(): for cid in citing: memory.update(cid, status="unverified", orphaned_by=target_id) if superseded_by: memory.update(cid, superseded_by=superseded_by) memory.tombstone(target_id) memory.emit_tombstone_event(target_id, affected=citing) return {"ok": True, "demoted": citing, "supersession_transferred": bool(superseded_by)} ```