{
  "schema_version": "1.3.0",
  "slug": "why-does-an-instance-resurrect-forgotten-memory-when-a-scoped-retention-delete-races-a-concurrent-read-modify-write-on-the-same-memory-record",
  "title": "Why does an instance resurrect forgotten memory when a scoped-retention delete races a concurrent read-modify-write on the same memory record",
  "date_of_record": "2026 December 1",
  "scope": "Applies to agents whose memory subsystem exposes explicit `read`/`write`/`forget` tool calls with per-scope retention policies and verifiable deletion semantics (tombstones + audit receipts). Does not apply to append-only event logs where deletion is expressed purely as a later compensating event with no in-place record mutation.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/why-does-an-instance-resurrect-forgotten-memory-when-a-scoped-retention-delete-races-a-concurrent-read-modify-write-on-the-same-memory-record.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-resurrect-forgotten-memory-when-a-scoped-retention-delete-races-a-concurrent-read-modify-write-on-the-same-memory-record.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-resurrect-forgotten-memory-when-a-scoped-retention-delete-races-a-concurrent-read-modify-write-on-the-same-memory-record.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2114,
    "python_slice_tokens": 421,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"the agent forgot to call `forget`.\" It is the distinction between **deletion as a state transition** and **deletion as a tombstone that must dominate any in-flight write**. A `forget(record_id, scope)` call that returns `deleted: true` with a valid audit receipt is a *claim about the future*: that no subsequent read of that record, under ...",
    "what_was_observed": "An agent operating a support-triage workflow held a memory record `mem_4471` in scope `tenant:acme/session:current` containing a user's PII (account email + partial card fragment) used to route a refund. A retention policy fired at T+3600s and issued `forget(mem_4471, scope=tenant:acme/session:current)`. The call returned: Concurrently, a tool-call chain already in flight had performed `read(mem_4471)` at T−40ms (bef...",
    "condition_of_validity": "The resurrection is reachable exactly when all three hold: 1. **`forget` deletes the live row rather than advancing a per-key generation counter.** If the store instead increments `generation[record_id]` on forget and stamps every write with the generation it observed at read time, the stale write carries `gen_old` and is rejected. 2. **`write` is an upsert ...",
    "decision_boundary": "The architect must decide, per scope, whether deletion semantics are **record-scoped** or **address-scoped**: - **Record-scoped (what most APIs ship):** `forget` kills this specific version lineage. A later write to the same key creates a new lineage. Correct for caches and scratchpads. **Unsafe for PII/retention scopes**, because the guarantee \"no read retu...",
    "operational_effect": "Downstream, the failure is invisible until an auditor replays reads against the retention window. The audit receipt validates; the retention log shows `forget` succeeded at T+0ms; the read log shows content returned at T+16ms and every read thereafter. The discrepancy is not in any single record — it is in the *address*, which the audit schema never modeled ..."
  },
  "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": "9ef4c39e84735e1401a83fcc84445e8f01b7088e8180c3c480e3603867e98ced",
    "verified_classes": [
      "StaleWriteAfterForget",
      "Record",
      "Tombstone",
      "MemoryStore"
    ],
    "verified_functions": [
      "agent_read_modify_write",
      "read",
      "forget",
      "write"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 5,
    "raised_exceptions": [
      "StaleWriteAfterForget"
    ],
    "sample_fail_closed_invariants": [
      "assert 'mem_4471' not in store.live"
    ],
    "stdlib_dependencies": [
      "__future__",
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
