{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-tombstone-resurrection-during-scoped-retention-erasure-in-agent-memory-tool-apis",
  "title": "Which invariants prevent tombstone resurrection during scoped-retention erasure in agent memory tool APIs",
  "date_of_record": "2026 November 24",
  "scope": "Applies to any agent memory subsystem exposing read/write/forget tool calls with per-record retention scopes and a GDPR-style erasure obligation, where erasure must be provable and durable. Does not apply to append-only audit logs that are legally exempt from erasure, nor to purely ephemeral in-context scratchpads that never persist past a session.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-tombstone-resurrection-during-scoped-retention-erasure-in-agent-memory-tool-apis.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-tombstone-resurrection-during-scoped-retention-erasure-in-agent-memory-tool-apis.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-tombstone-resurrection-during-scoped-retention-erasure-in-agent-memory-tool-apis.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2141,
    "python_slice_tokens": 344,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two structurally different ways an agent \"forgets.\" The first is **logical deletion**: the record stops being returned by `read`/`search` because a visibility predicate filters it out. The second is **physical erasure**: the bytes are destroyed and no derivative (index entry, embedding vector, summary, cache line, replay journal) references them. G...",
    "what_was_observed": "A memory service exposed four tools: `mem.write(scope, content, ttl)`, `mem.read(query, scope)`, `mem.forget(id, reason)`, and a background `mem.distill(window)` that periodically folded recent episodic records into a semantic summary record and embedded the summary into a vector index. Retention scopes were per-namespace (`user`, `session`, `global`). GDPR erasure was implemented as `mem.forget` setting `deleted_at`...",
    "condition_of_validity": "Erasure closure is a valid guarantee only under the following conditions, all of which must hold simultaneously: - **Derivation edges are mandatory and write-time enforced.** Every record created by distillation, summarization, embedding, or cross-agent handoff MUST carry a `derived_from: [id...]` field, and `mem.write` MUST reject any write whose `derived_f...",
    "decision_boundary": "The operative decision for an agent runtime is: **when a `mem.forget` returns, is the content gone from every read path the agent can reach, including paths that will be reachable only after the next distillation pass?** The boundary between \"erased\" and \"hidden\" is crossed at the moment a derivation artifact survives the erasure. Concretely, the runtime mus...",
    "operational_effect": "Downstream of this invariant, three operational behaviors change: 1. **Forget latency becomes proportional to closure size, not record count.** Erasing a heavily-distilled record can touch hundreds of index entries. Callers must treat `mem.forget` as a potentially long, blocking, closure-walking operation with its own timeout, and must not pipeline writes 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": "d0ac4768431c8128f2fb3245aace17a518a24747eb1a80b71e7784b830048f90",
    "verified_classes": [
      "ErasureClosureViolation",
      "MemoryRecord",
      "ScopedMemoryStore"
    ],
    "verified_functions": [
      "__init__",
      "write",
      "_closure",
      "forget",
      "_erasable"
    ],
    "verified_functions_count": 5,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "ErasureClosureViolation"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "__future__",
      "dataclasses"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
