{
  "schema_version": "1.3.0",
  "slug": "what-happens-when-an-instance-tombstones-a-memory-it-was-still-reading-retention-policy-eviction-racing-an-in-flight-tool-read",
  "title": "What happens when an instance tombstones a memory it was still reading: retention-policy eviction racing an in-flight tool read",
  "date_of_record": "2026 November 28",
  "scope": "Applies to agents whose memory is exposed through explicit read/write/forget tool APIs carrying TTL- or policy-driven retention and verifiable deletion (tombstone) semantics. Does not apply to append-only vector stores with no deletion surface, or to stateless single-turn inference.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-tombstones-a-memory-it-was-still-reading-retention-policy-eviction-racing-an-in-flight-tool-read.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-tombstones-a-memory-it-was-still-reading-retention-policy-eviction-racing-an-in-flight-tool-read.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-tombstones-a-memory-it-was-still-reading-retention-policy-eviction-racing-an-in-flight-tool-read.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1617,
    "python_slice_tokens": 264,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two kinds of \"deletion\" an agent memory API can offer, and conflating them is the source of the failure. **Logical deletion** removes a record from the retrieval index (it stops appearing in reads) but leaves the payload addressable by ID for audit replay. **Physical deletion** destroys the payload and replaces it with a tombstone that records only...",
    "what_was_observed": "An agent executing a multi-step reconciliation task called `memory.read(namespace=\"vendor_contracts\", query=\"termination clause\")` and received three hits, each as `{id, score, summary}` — summaries only, not full text. It then reasoned for several turns (four tool calls, ~40 seconds of wall time) before calling `memory.read_by_id(id=\"vc_8821\")` to fetch the full clause. Between the first read and the ID fetch, a ret...",
    "condition_of_validity": "This failure requires all four of the following to co-occur; remove any one and it does not manifest: 1. **Deferred materialization.** The read API returns references (IDs, summaries, chunks) that require a second call to resolve. If reads return immutable payload snapshots, the reader holds bytes and the sweep cannot pull them out from under it. 2. **A rete...",
    "decision_boundary": "The architectural guardrail is a **read-handle lease with tombstone-typed returns**, and the decision boundary is where to enforce it: - On `read`/`read_by_id`, the API issues a lease token with a short TTL (e.g., 120s) that pins the referenced records against physical deletion. The retention sweep skips leased records; if it cannot skip (hard compliance era...",
    "operational_effect": "With the guardrail, the observed trace changes: the sweep at T+31s sees `vc_8821` under an active lease and defers; the `read_by_id` at T+40s resolves normally; no false derived memory is written. If the record had been under hard erasure instead, `read_by_id` raises `MemoryGone`, the agent's planner must branch to \"source unavailable — re-retrieve or escala..."
  },
  "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": "1d2de787ccff1d0e10f41730d828e8d0e58b46f03030cba12bbc699138e9dd39",
    "verified_classes": [
      "MemoryGone",
      "ProvenanceInvalidated",
      "Record",
      "MemoryStore"
    ],
    "verified_functions": [
      "read",
      "read_by_id",
      "sweep",
      "write_derived"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "MemoryGone",
      "ProvenanceInvalidated"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "time",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
