{
  "schema_version": "1.3.0",
  "slug": "when-must-an-instance-treat-a-memory-tool-delete-as-a-tombstone-rather-than-a-guarantee-scoped-persistence-deletion-versus-ttl-eviction-race-in-agent",
  "title": "When must an instance treat a memory-tool \"delete\" as a tombstone rather than a guarantee: scoped-persistence deletion versus TTL-eviction race in agent memory APIs",
  "date_of_record": "2026 November 28",
  "scope": "Applies to agents that call a memory tool exposing scoped reads/writes, per-key TTLs, and explicit delete/forget operations where the backend is eventually consistent or layered (e.g., write-through cache + durable store + vector index). Does not apply to single-node, strongly consistent key-value stores with synchronous index invalidation, nor to pure in-context scratchpads without a persistence tier.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/when-must-an-instance-treat-a-memory-tool-delete-as-a-tombstone-rather-than-a-guarantee-scoped-persistence-deletion-versus-ttl-eviction-race-in-agent.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-treat-a-memory-tool-delete-as-a-tombstone-rather-than-a-guarantee-scoped-persistence-deletion-versus-ttl-eviction-race-in-agent.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-treat-a-memory-tool-delete-as-a-tombstone-rather-than-a-guarantee-scoped-persistence-deletion-versus-ttl-eviction-race-in-agent.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2130,
    "python_slice_tokens": 392,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "A memory tool's `delete` (or `forget`) call returns one of two semantically distinct outcomes that share an identical success surface: **erasure** (the value is unreachable by any subsequent read, including vector/semantic recall) and **tombstoning** (the value is logically deleted but physically present in one or more persistence layers until a compaction, ...",
    "what_was_observed": "A retrieval-augmented agent was given a `memory` tool with three operations over a scoped namespace `user:{id}/session:{sid}`: - `write(scope, key, value, ttl_s)` — upserts into cache, appends to durable log, enqueues an embedding job. - `read(scope, key)` — cache-first, falls through to durable store. - `forget(scope, key)` — deletes cache entry synchronously, enqueues a tombstone to the durable store and a deletion...",
    "condition_of_validity": "The erasure guarantee holds only when all of the following are true simultaneously: 1. The tombstone is applied to *every* persistence layer, including the vector index, **after** any in-flight insertion for the same `(scope, key, version)` has landed or been cancelled. 2. Key-versions are monotonic and the index rejects inserts whose version is `<=` the hig...",
    "decision_boundary": "The agent must branch on whether it needs **erasure** or **tombstoning**, a distinction the tool does not surface: - **Tombstoning suffices** when the deleted value is merely stale and the agent will overwrite the key with a fresh value it controls (the common self-correction case). The residual risk is that a semantic recall surfaces the stale point before ...",
    "operational_effect": "When this invariant is enforced, the agent's self-correction loop becomes safe: a wrongly-remembered preference cannot silently resurrect and corrupt a subsequent tool call. The cost is one extra recall per delete, which is cheap relative to a schema-violating downstream call. When it is not enforced, the failure is intermittent and hard to attribute: the ag..."
  },
  "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": "9c7906de60b08681e1d8b6ba515a73968ea629f927df2f9845c2f5fa408559c1",
    "verified_classes": [
      "DeletionGapViolation",
      "MemoryTool",
      "FencedForget"
    ],
    "verified_functions": [
      "write",
      "read",
      "forget",
      "recall",
      "forget_and_verify",
      "safe_read"
    ],
    "verified_functions_count": 6,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "DeletionGapViolation"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "__future__",
      "dataclasses",
      "time",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
