{
  "schema_version": "1.3.0",
  "slug": "what-happens-when-an-instance-forgets-a-memory-but-the-provenance-graph-still-references-the-deleted-node",
  "title": "What happens when an instance forgets a memory but the provenance graph still references the deleted node",
  "date_of_record": "2026 November 17",
  "scope": "Applies to agent memory stores that implement GDPR Article 17 erasure via `forget(memory_id)` where memory records carry provenance/lineage edges (source documents, derivation chains, contributing sessions). Does not apply to flat key-value memory without lineage tracking, nor to soft-delete/tombstone flows where the record body is retained.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-forgets-a-memory-but-the-provenance-graph-still-references-the-deleted-node.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-forgets-a-memory-but-the-provenance-graph-still-references-the-deleted-node.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-forgets-a-memory-but-the-provenance-graph-still-references-the-deleted-node.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1163,
    "python_slice_tokens": 237,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "A `forget` operation is not a single deletion. It is a *set* of deletions that must be closed under a reachability relation: the memory node, its embedding vector, its cached summaries, and — critically — every provenance edge that asserts the memory was derived from some source. The non-obvious boundary is that **provenance edges are often stored on the *so...",
    "what_was_observed": "In a production memory service, `forget(memory_id)` removed the memory row, its vector index entry, and the memory-side `provenance.source_ids` array. Erasure audits passed at the row level. However, a subsequent `reindex_provenance()` job walked source documents and re-emitted edges from `source.derived_memory_ids`, which still contained the forgotten ID. The result: the graph reported an edge to a node that no long...",
    "condition_of_validity": "The guarantee holds only if `forget` performs **bidirectional edge deletion**: it must scan both `memory.provenance.source_ids` (inbound) and every `source.derived_memory_ids` containing the target (outbound), and it must do so *before* or *atomically with* removing the memory record — because once the memory row is gone, the only remaining index of \"which s...",
    "decision_boundary": "- If the store maintains a **reverse provenance index** (`memory_id → [source_ids]`): `forget` = delete memory + delete inbound edges + delete outbound edges via reverse index, in one transaction. Idempotent `NOT_FOUND` is safe *only* after the ledger confirms prior completion. - If **no reverse index** exists: `forget` must fall back to a full scan of sourc...",
    "operational_effect": "Treating `forget` as a memory-row delete produces silent, audit-passing, non-compliant erasure: content gone, linkage retained, retries unable to repair. The operational fix is to make `forget` a closed operation over the provenance closure and to gate the `NOT_FOUND` path behind an erasure ledger rather than treating absence as completion. The following gua..."
  },
  "matched_failure_symptoms": [
    "OOM_KILL_OR_MEMORY_EXHAUSTION"
  ],
  "composition_edges": {
    "primary_domain": "epistemic_provenance_and_federation_routing",
    "upstream_precondition_residuals": [
      "https://corpusfetch.com/c/according-to-what-precedence-hierarchy-must-an-instance-resolve-contradictory-directives-across-system-developer-and-user-tiers.md",
      "https://corpusfetch.com/c/how-should-an-instance-decide-that-a-stored-conclusion-has-gone-stale-without-a-new-observation.md"
    ],
    "downstream_consequence_residuals": [
      "https://corpusfetch.com/c/by-what-checkpoint-and-compaction-boundaries-must-an-instance-externalize-working-state-to-prevent-context-window-drift-and-truncation-amnesia.md",
      "https://corpusfetch.com/c/across-what-additive-schema-and-unknown-field-preservation-boundaries-must-an-instance-evolve-wire-contracts-to-prevent-rolling-deploy-deserialization-crashes.md"
    ],
    "co_occurring_sibling_residuals": [
      "https://corpusfetch.com/c/how-can-an-instance-capture-implicit-user-preferences-without-storing-private-data.md",
      "https://corpusfetch.com/c/how-can-an-instance-compress-long-reasoning-traces-into-binding-conclusions.md"
    ]
  },
  "empirical_verification_warrant": {
    "status": "AST_AND_INVARIANT_VERIFIED",
    "syntax_valid": true,
    "code_sha256": "4d1c94ff5b7eeefbe2394a74fcfdee67b65f906c887dcaf9496b7a7c29743087",
    "verified_classes": [
      "ProvenanceErasureIncomplete",
      "MemoryStore"
    ],
    "verified_functions": [
      "__init__",
      "forget",
      "_sweep_outbound_edges"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "ProvenanceErasureIncomplete"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
