{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-erasure-tombstone-resurrection-across-agent-memory-tool-apis-with-retention-guarantees",
  "title": "Which invariants prevent erasure-tombstone resurrection across agent memory tool APIs with retention guarantees",
  "date_of_record": "2026 November 22",
  "scope": "Applies to agents that persist episodic/semantic state through read/write/forget memory tool APIs where `forget` is specified to return an erasure guarantee (tombstone or hard-delete) and `write` is specified to be idempotent-by-key. Does not apply to append-only event logs without a delete surface, nor to stateless retrieval over an external corpus the agent cannot mutate.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-erasure-tombstone-resurrection-across-agent-memory-tool-apis-with-retention-guarantees.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-erasure-tombstone-resurrection-across-agent-memory-tool-apis-with-retention-guarantees.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-erasure-tombstone-resurrection-across-agent-memory-tool-apis-with-retention-guarantees.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1709,
    "python_slice_tokens": 259,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"the agent forgot to call `forget`.\" It is that `forget` and `write` are two independently-specified operations whose composition is *not* specified, and the composite `forget(k); write(k, v)` is the exact sequence an agent emits when it \"corrects\" a memory. A retention guarantee on `forget` is a statement about a single call. It is silent...",
    "what_was_observed": "A planner agent held a semantic memory record `addr.preferred = \"12 Rue X\"` (key `mem:addr:pref`, version 7). A user correction arrived mid-task: the address was wrong. The agent's memory tool wrapper, written to be safe, issued: 1. `forget(\"mem:addr:pref\", reason=\"user_correction\")` → returned `{erased: true, tombstone: \"ts_4411\", seq: 4411}`. 2. `write(\"mem:addr:pref\", \"9 Rue Y\", expected_version=7)` → returned `{o...",
    "condition_of_validity": "The erasure guarantee holds only if the memory API satisfies three chained invariants, and the agent wrapper must be able to *verify* each one rather than assume it: - **I1 — Tombstone monotonicity:** a tombstone is a versioned successor of the erased record, not a deletion of it. Any `write` to key `k` with `expected_version <= tombstone.version` must fail ...",
    "decision_boundary": "The boundary is between *corrective rewrite* and *resurrection*: - If the agent is correcting a value it still has authority over, the correct sequence is **not** `forget` then `write`. It is a single `write(k, v_new, expected_version=7)` — an ordinary CAS update — which leaves no tombstone and no ambiguity. - `forget` is reserved for records the agent must ...",
    "operational_effect": "Agents that skip the barrier check exhibit a characteristic failure signature: erasure audits pass at rest (the store is clean) while the agent's *reasoning* continues on erased values, because the write acknowledgement was accepted but its commit was ordered before the tombstone. The observable symptom is not a wrong memory — it is a correct store and an in..."
  },
  "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": "bb7a0f376ed572930f96e1206b0e146313baa2527fe5ac90d8a0963759c03836",
    "verified_classes": [
      "ErasureResurrectionError",
      "Tombstone",
      "MemoryWrapper"
    ],
    "verified_functions": [
      "__init__",
      "forget",
      "write",
      "read"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "ErasureResurrectionError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
