# In what scenarios must an instance refuse a consent-aware forget against a provenance-linked memory, and how does the tombstone invariant break under partial deletion? **Date of Record:** 2026 November 28 **Scope:** Applies to any agent runtime exposing `read_memory`, `write_memory`, and `forget_memory` tool APIs where records carry provenance edges (derived-from links) and consent-scoped deletion obligations. Does not cover bulk retention-policy expiry sweeps or storage-layer garbage collection, which operate below the tool contract. ## Core Distinction A *consent-aware forget* is not a delete. It is a request that a specific subject's data no longer be retrievable or derivable by the agent. The failure mode this record isolates is the **provenance-orphan tombstone**: a `forget_memory(id)` call on a record that is the source of a derived record (a summary, a distilled semantic fact, an embedding, or a cached answer) succeeds at the source, writes a tombstone, and returns `ok` — while the derived record survives, remains retrievable, and still carries the subject's information in its payload. The tombstone invariant — "if a record is forgotten, nothing derivable from it is retrievable" — is violated silently because the tool API only knows about the edge it was asked to delete, not the transitive closure of the derivation DAG. The distinction that matters operationally: **deletion is a graph operation, not a row operation.** An agent that treats `forget_memory` as a point delete will pass its own tests (the source is gone) and fail the consent obligation (the derivative is not). ## What Was Observed A research agent had built a three-tier memory: raw episodic writes (`ep_*`), a nightly distillation pass producing semantic facts (`sem_*`), and a query cache of prior answers (`ans_*`). Each `sem_*` and `ans_*` record carried a `derived_from: [ep_ids]` provenance list per the write contract. A subject exercised a consent deletion against a single episodic record `ep_7f3a` (a transcribed intake conversation). The agent called: ``` forget_memory(memory_id="ep_7f3a", consent_token="ct_...", mode="hard") → {"status": "ok", "tombstone": "ts_9c1", "edges_removed": 0} ``` `edges_removed: 0` was the tell. The tool had no outbound edge index — provenance was stored on the *derived* record as an inbound pointer, and the forget path only scanned for records whose `derived_from` contained the target when `cascade=true` was passed. It was not passed. The call defaulted to `cascade=false`. Three derived records survived: `sem_44` ("subject prefers async contact"), `sem_51` ("subject has a dependent minor"), and `ans_02` (a cached answer that quoted `sem_44` verbatim). All three remained retrievable by the retrieval tool. A subsequent query returned `ans_02`, whose payload contained the subject's name and the dependent-minor fact — data whose only lawful source was the forgotten episode. The tombstone `ts_9c1` recorded that `ep_7f3a` was gone. Nothing recorded that its children were still live. A second, subtler trace: the distillation pass had *merged* two episodes into one `sem_*` record (`sem_44.derived_from = [ep_7f3a, ep_88b]`). A correct cascade cannot hard-delete `sem_44` without destroying `ep_88b`'s lawful content. The correct action is a **redaction-and-re-derivation**: strip the forgotten contribution, re-run distillation over the surviving sources, and replace `sem_44` with `sem_44'` whose provenance excludes the tombstoned id. The naive cascade deletes the whole record and over-deletes — a second failure mode in the opposite direction. Both are violations of the same invariant from opposite sides. ## Condition of Validity The tombstone invariant holds only when all of the following are true at the moment `forget_memory` returns: 1. **Transitive closure is computed, not assumed.** The forget path must resolve the full derivation DAG reachable from the target, including multi-hop (`ep → sem → ans`) and merge nodes with multiple parents. 2. **Merge nodes are re-derived, not deleted.** A derived record with parents outside the forgotten set must be rewritten to exclude the forgotten parent's contribution and re-issued with new provenance; it must not be hard-deleted (over-deletion) nor left intact (under-deletion). 3. **Tombstones are queryable by the retrieval path.** The retrieval tool must consult the tombstone set before returning any record, and must reject records whose provenance transitively intersects a tombstone — even if the derived record's own id was never forgotten. 4. **The consent token is bound to the subject, not the record.** A token authorizing deletion of subject S's data must be validated against the subject field of every record in the closure, not just the target, or a cascade can delete a co-mingled record belonging to a different subject. 5. **The call is atomic or explicitly two-phase.** If the closure cannot be completed (e.g., re-derivation fails mid-pass), the source tombstone must not be committed, or the derived records must be quarantined from retrieval until reconciliation. A committed source tombstone with live children is the exact broken state. When any of these is false — most commonly (1) and (3) — the forget returns `ok` and the obligation is unmet. ## Decision Boundary The boundary the agent must enforce is between **point-forget** (safe only for leaf records with no outbound derivation edges) and **closure-forget** (required for any record that is a provenance source). The agent cannot know which it holds without an outbound edge query, and the write contract as observed did not expose one. The operational rule: - Before calling `forget_memory`, call `read_memory(id, include="outbound_edges")`. If the outbound set is non-empty, the target is a source and `cascade=true` (or the two-phase closure protocol) is mandatory. If the tool cannot report outbound edges, treat every record as a potential source and route through closure-forget. - After any forget, verify by re-querying the retrieval path for the subject's known facts and for the tombstoned id's descendants. A forget that returns `ok` but whose verification query returns a descendant is a failed forget and must raise, not log. - On merge nodes, the boundary is: delete only the forgotten contribution. If the re-derivation tool is unavailable, quarantine the merge node (mark non-retrievable) rather than delete or leave live. The agent must refuse — raise, not silently degrade — when the closure cannot be proven complete. A partial forget that reports success is worse than a refused forget, because it removes the subject's ability to detect the violation. ## Operational Effect The observable consequence of getting this wrong is a **silent consent breach with a green status**: dashboards show the forget succeeded, the source is gone, and the derivative keeps answering queries. The breach is discovered only when the subject queries the agent and receives their own forgotten data back — at which point the tombstone record is evidence *against* the operator, because it proves the system knew the source was deleted and still served the child. The architectural guardrail that bounds it: **retrieval-time provenance filtering against the tombstone set**, independent of whether the forget path cascaded. Even if a cascade is missed, a retrieval path that refuses to serve any record whose transitive provenance intersects a tombstone converts a silent breach into a visible retrieval miss. The miss is recoverable; the breach is not. Pair this with a post-forget verification step that is a hard gate on the tool's return value, and the invariant is enforced at two layers rather than trusted at one. ```python class ProvenanceOrphanTombstoneError(RuntimeError): """Raised when a forget commits a source tombstone while derived records remain retrievable.""" pass def forget_with_closure(memory_api, memory_id: str, consent_token: str) -> dict: outbound = memory_api.read_memory(memory_id, include="outbound_edges") if outbound is None: raise ProvenanceOrphanTombstoneError( f"cannot prove closure for {memory_id}: outbound edge index unavailable" ) closure = memory_api.transitive_descendants(memory_id) merge_nodes = [r for r in closure if len(r.derived_from) > 1] leaf_descendants = [r for r in closure if len(r.derived_from) == 1] # Validate consent covers every subject in the closure before touching anything. for rec in closure: if not memory_api.consent_covers(consent_token, rec.subject): raise ProvenanceOrphanTombstoneError( f"consent token does not cover subject {rec.subject} on {rec.id}; " f"closure forget aborted to avoid cross-subject deletion" ) # Merge nodes must be re-derived, never hard-deleted. for rec in merge_nodes: surviving = [p for p in rec.derived_from if p != memory_id] if not surviving: raise ProvenanceOrphanTombstoneError( f"merge node {rec.id} has no surviving parents; manual reconciliation required" ) memory_api.rederive(rec.id, sources=surviving) for rec in leaf_descendants: memory_api.forget_memory(rec.id, consent_token=consent_token, mode="hard") result = memory_api.forget_memory(memory_id, consent_token=consent_token, mode="hard") # Hard gate: verify no descendant is still retrievable before returning ok. leaked = [r.id for r in closure if memory_api.is_retrievable(r.id)] if leaked: raise ProvenanceOrphanTombstoneError( f"forget of {memory_id} committed but descendants still retrievable: {leaked}" ) return result ```