{
  "schema_version": "1.3.0",
  "slug": "why-does-an-instance-of-a-scoped-memory-tool-silently-resurrect-forgotten-data-when-a-ttl-expires-during-an-in-flight-write",
  "title": "Why does an instance of a scoped memory tool silently resurrect forgotten data when a TTL expires during an in-flight write?",
  "date_of_record": "2026 November 14",
  "scope": "This record applies to read/write/forget memory tool APIs that combine per-scope persistence, TTL-based expiry, and right-to-be-forgotten (RTBF) tombstones. It does not apply to append-only stores without deletion semantics, nor to systems where forget is a hard synchronous physical purge with no concurrent writer window.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/why-does-an-instance-of-a-scoped-memory-tool-silently-resurrect-forgotten-data-when-a-ttl-expires-during-an-in-flight-write.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-of-a-scoped-memory-tool-silently-resurrect-forgotten-data-when-a-ttl-expires-during-an-in-flight-write.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-of-a-scoped-memory-tool-silently-resurrect-forgotten-data-when-a-ttl-expires-during-an-in-flight-write.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1571,
    "python_slice_tokens": 263,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The non-obvious invariant is this: **a TTL expiry and a forget tombstone are not the same kind of deletion, and a write that straddles both must not be allowed to outlive the tombstone that logically precedes it.** A TTL expiry is an *ephemeral* lifecycle event: the key's value is considered stale and may be reclaimed, but the key identity remains valid and ...",
    "what_was_observed": "A memory tool exposing `read(scope, key)`, `write(scope, key, value, ttl)`, and `forget(scope, key)` was exercised under concurrent load. A client issued `write(scope, \"user:42:preference\", v2, ttl=60s)` at the moment the previous value `v1` was expiring. Concurrently, an RTBF request issued `forget(scope, \"user:42:preference\")`. Sequence observed in the audit log: 1. `write` begins; reads current entry `v1` with `ex...",
    "condition_of_validity": "The resurrection is possible if and only if all three of the following hold: - **Shared key space.** Tombstones and live values occupy the same key (or the tombstone is stored in a separate table that the write path does not consult before commit). - **Existence-based conflict detection.** The write's commit precondition tests key presence/absence rather tha...",
    "decision_boundary": "The correct rule for an agent operating such a tool: - **Never treat \"key absent\" as \"safe to write.\"** Absence is ambiguous between never-existed, expired, and forgotten. Only a generation match disambiguates. - **A write that observes an expired entry must be treated as a write against a possibly-forgotten key.** Re-read the tombstone generation immediatel...",
    "operational_effect": "When this boundary is enforced, the operational signature is that forgotten keys return a distinct error class rather than `None`, and that error is not retryable. Downstream agents must distinguish `MemoryExpired` (retry with fresh write permitted) from `MemoryForgotten` (terminal; the identity is gone and any write is a policy violation). Conflating these ..."
  },
  "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": "1b1731c93d55009b7ff5edb2ea5f553f38118bfafee10fe778a928032db4882f",
    "verified_classes": [
      "MemoryResurrectionError",
      "MemoryExpiredError",
      "MemoryStore"
    ],
    "verified_functions": [
      "__init__",
      "forget",
      "commit_write"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "MemoryExpiredError",
      "MemoryResurrectionError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
