{
  "schema_version": "1.3.0",
  "slug": "what-happens-when-an-instance-tombstones-a-memory-key-while-a-concurrent-reader-holds-a-stale-snapshot-under-scoped-retention-ttl-eviction",
  "title": "What happens when an instance tombstones a memory key while a concurrent reader holds a stale snapshot under scoped-retention TTL eviction",
  "date_of_record": "2026 November 14",
  "scope": "Applies to memory tool APIs exposing read/write/forget with per-scope retention windows, TTL-based eviction, and right-to-forget (RTF) tombstones, where reads may be served from a snapshot or cache layer that is not linearly ordered with respect to writes and forgets. Does not apply to single-writer, strongly-consistent stores with synchronous tombstone propagation to all readers.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-tombstones-a-memory-key-while-a-concurrent-reader-holds-a-stale-snapshot-under-scoped-retention-ttl-eviction.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-tombstones-a-memory-key-while-a-concurrent-reader-holds-a-stale-snapshot-under-scoped-retention-ttl-eviction.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-tombstones-a-memory-key-while-a-concurrent-reader-holds-a-stale-snapshot-under-scoped-retention-ttl-eviction.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1826,
    "python_slice_tokens": 394,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The critical distinction is between **TTL eviction** and **right-to-forget deletion**. They look identical at the read path (both cause a key to become unreadable), but they carry different invariants: - **TTL eviction** is a *liveness* operation. The key is no longer served because its retention window closed. Re-materializing an unexpired snapshot of the v...",
    "what_was_observed": "In a scoped-retention memory tool with a read-through cache, the following sequence produced a leaked forgotten value: 1. Reader R issues `read(scope=\"user:42\", key=\"ssn\")` at t=0. The backing store returns the value; R's local snapshot is stamped `snapshot_epoch=E1`. 2. At t=5, a forget request `forget(scope=\"user:42\", key=\"ssn\", reason=\"RTF\")` is accepted. The store writes a tombstone with `tombstone_epoch=E2 > E1`...",
    "condition_of_validity": "The correct behavior holds only when all of the following are true: - Every snapshot and cache entry carries the **tombstone epoch** (or a monotonic forget-generation counter) of the store at the time it was materialized, not merely a TTL timestamp. - The read path rejects any snapshot whose `snapshot_epoch < tombstone_epoch(key)` for that key, treating the ...",
    "decision_boundary": "The decision boundary is the **read-path validation point**. Two implementations are defensible: - **Epoch-checked reads (safe):** every read validates the snapshot epoch against the current tombstone epoch. Cost: one tombstone-epoch lookup per read (cacheable, but must itself be invalidated on forget). - **Forget-invalidates-cache (safe):** the forget opera...",
    "operational_effect": "When the boundary is crossed, the observable effects are: - **Silent RTF violation.** No error is raised; the read returns the forgotten value and reports success. Detection requires an out-of-band audit that replays forget events against read logs. - **Resurrection via rewrite.** If `EXPIRED` and `FORGOTTEN` share a state, a post-forget write re-creates the..."
  },
  "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": "38862f9dc317cb67440cada5cdf81e90ef1ac6fc4d0e68b6e262c25fff45fb48",
    "verified_classes": [
      "ForgottenKeyLeakError",
      "ExpiredSnapshotError"
    ],
    "verified_functions": [
      "read_memory",
      "forget_memory"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 5,
    "raised_exceptions": [
      "ExpiredSnapshotError",
      "ForgottenKeyLeakError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
