{
  "schema_version": "1.3.0",
  "slug": "when-must-an-instance-refuse-a-forget-that-is-not-yet-durable-the-retention-tombstone-write-resurrection-race-in-agent-memory-tool-apis",
  "title": "When must an instance refuse a \"forget\" that is not yet durable: the retention-tombstone / write-resurrection race in agent memory tool APIs",
  "date_of_record": "2026 November 30",
  "scope": "Applies to any agent memory tool API that exposes `write`, `read`, and `forget` (soft-delete, hard-delete, or TTL-expiry) operations with an audit log and a retention policy, where the agent's own reasoning loop can issue a write concurrently with, or immediately after, a forget. Does not apply to append-only audit stores with no deletion surface, nor to per-request stateless vector lookups with no durability contract.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/when-must-an-instance-refuse-a-forget-that-is-not-yet-durable-the-retention-tombstone-write-resurrection-race-in-agent-memory-tool-apis.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-refuse-a-forget-that-is-not-yet-durable-the-retention-tombstone-write-resurrection-race-in-agent-memory-tool-apis.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-refuse-a-forget-that-is-not-yet-durable-the-retention-tombstone-write-resurrection-race-in-agent-memory-tool-apis.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2871,
    "python_slice_tokens": 495,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"the agent forgot something it should have remembered\" or \"the agent remembered something it should have forgotten.\" Both of those are content errors and are recoverable by re-reading. The failure is a **durability-order inversion between the deletion intent and the deletion effect**: the agent's `forget` call returns a success receipt (wi...",
    "what_was_observed": "Setup: a long-running research agent with a `memory` MCP server exposing `write(key, value, embedding)`, `read(query, k)`, `forget(key, reason)`. `forget` is implemented as a two-phase operation: (1) mark row `deleted_at = now()`, append an audit entry with `tombstone_id` and `retention_until = now() + 90d`, return receipt to caller; (2) an async reaper physically removes the row and its embedding from the ANN index ...",
    "condition_of_validity": "The invariant that must hold for a `forget` receipt to be trustworthy: > A forget receipt `(key, tombstone_id, retention_until, version_floor)` is valid iff, for every subsequent `write(key, ...)` accepted by the store, the write's assigned `version` is strictly greater than `version_floor`, **and** the read path returns no record for `key` with `version <= ...",
    "decision_boundary": "The agent must treat a forget receipt as **provisional** — not as an erasure — until it has observed the store's read path return empty for the key *and* the store has confirmed `version_floor` is monotonic against any write the agent itself issued in the interim. Concretely, the decision boundary is: - **If the agent has issued no write for `key` since the ...",
    "operational_effect": "Agents that treat `forget` as fire-and-forget exhibit three downstream pathologies, all traceable to the missing version floor: 1. **Phantom erasure in compliance workflows.** The audit log shows a tombstone; the read path shows a live record with a post-tombstone `created_at`. A retention auditor replaying the log cannot tell whether the erasure was honored..."
  },
  "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": "9cc6d898fd43fb7bc7be446ca2523b7db7f086c780cfb2732844a0b350392341",
    "verified_classes": [
      "ForgetNotDurableError",
      "ForgetReceipt",
      "MemoryView"
    ],
    "verified_functions": [
      "verify_forget",
      "safe_forget"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 5,
    "raised_exceptions": [
      "ForgetNotDurableError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "__future__",
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
