{
  "schema_version": "1.3.0",
  "slug": "why-does-an-instance-resurrect-erased-memory-the-tombstone-before-index-invalidation-race-in-scoped-retention-apis",
  "title": "Why does an instance resurrect erased memory: the tombstone-before-index-invalidation race in scoped retention APIs",
  "date_of_record": "2026 November 25",
  "scope": "Applies to agent memory services that expose `write`, `read`, and `forget` operations with per-scope TTLs and a right-to-be-forgotten (RTBF) erasure path, where the vector/lexical index is maintained asynchronously relative to the authoritative record store. Does not apply to synchronous single-store memory backends where index and record commit in one transaction.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/why-does-an-instance-resurrect-erased-memory-the-tombstone-before-index-invalidation-race-in-scoped-retention-apis.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-resurrect-erased-memory-the-tombstone-before-index-invalidation-race-in-scoped-retention-apis.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-resurrect-erased-memory-the-tombstone-before-index-invalidation-race-in-scoped-retention-apis.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1968,
    "python_slice_tokens": 328,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"the agent forgot to call `forget`.\" It is that `forget` returns success once the *authoritative record* is tombstoned, while the *retrieval index* still holds the derived embedding and its chunk payload until an asynchronous compaction pass runs. Between those two events the system is in a split-brain state: the record is legally erased, ...",
    "what_was_observed": "A single agent instance, scoped to a user, wrote a PII-bearing note: `write(scope=user:8841, key=\"contact_pref\", value=\"...\", ttl=None, class=durable)`. The backend committed the record and enqueued an index upsert. The upsert completed; the chunk was embedded and inserted into the ANN index with `record_id` as a filter field. Hours later a deletion request arrived via the RTBF tool. The agent called `forget(scope=us...",
    "condition_of_validity": "This race exists only under the conjunction: - The index is a **separate store** from the authoritative records (ANN service, inverted index, cache tier), and - index mutations are **asynchronous** relative to record mutations, and - the read path **trusts index payloads** rather than re-validating each hit against the record store, and - erasure and TTL are...",
    "decision_boundary": "The boundary is the return value of `forget`. It must not be `erased` until the erasure is *observable from the read path*, not merely committed to the record store. Concretely, `forget(mode=hard)` must satisfy: - The tombstone is committed **and** the index delete is confirmed for every shard that could hold a chunk for that `record_id`, or the call fails l...",
    "operational_effect": "With the warrant + read-time re-validation + lineage design, the failure mode changes from \"silent resurrection and one-hop propagation\" to \"elevated read-rejection rate during erasure backlog, with an alertable `open_warrants` gauge.\" The trade is explicit: you accept some reads returning `suppressed: erasure_pending` during the confirmation window in excha..."
  },
  "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": "8d4bd5ad059650e61a13c664e338e79787acf51fe1ba07439aad5463a94704ac",
    "verified_classes": [
      "DeletionClass",
      "ErasureIncompleteError",
      "ErasureWarrant",
      "MemoryService"
    ],
    "verified_functions": [
      "is_fully_confirmed",
      "__init__",
      "forget",
      "read"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 1,
    "raised_exceptions": [
      "ErasureIncompleteError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "enum",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
