{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-tombstone-resurrection-in-scoped-memory-apis-with-read-write-forget-semantics",
  "title": "Which invariants prevent tombstone resurrection in scoped memory APIs with read/write/forget semantics",
  "date_of_record": "2026 November 17",
  "scope": "Applies to memory tool APIs that expose independent `read`, `write`, and `forget` (or `delete`) operations over scoped records, where `forget` is specified as a logical deletion with retention semantics (tombstones, soft-delete, or scope-level purge). Does not apply to append-only logs without deletion, nor to single-writer stores where reads and writes are serialized through one transaction.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-tombstone-resurrection-in-scoped-memory-apis-with-read-write-forget-semantics.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-tombstone-resurrection-in-scoped-memory-apis-with-read-write-forget-semantics.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-tombstone-resurrection-in-scoped-memory-apis-with-read-write-forget-semantics.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1456,
    "python_slice_tokens": 279,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The dangerous boundary is not \"can a record be deleted?\" but \"can a record that was forgotten be *re-created by a concurrent writer that read it before the tombstone existed?*\" A `forget` that returns success proves only that the tombstone was committed at the deletion scope. It says nothing about in-flight `read`→`write` pipelines that already hold a stale ...",
    "what_was_observed": "A pipeline pattern that reads a record, enriches it via a model call (200–900 ms), and writes it back was found to resurrect forgotten records at a rate proportional to model latency. Sequence: 1. Agent A calls `read(scope=\"user:42\", key=\"preferences\")` → returns value `v1` at generation `g=7`. 2. User issues `forget(scope=\"user:42\", key=\"preferences\")` → tombstone committed at `g=8`. API returns `{\"deleted\": true}`....",
    "condition_of_validity": "The write-fencing invariant holds only if all of the following are true: - `read` returns a monotonically comparable generation or causal token per `(scope, key)`, and `write` accepts and validates it. - Tombstone TTL ≥ maximum end-to-end write latency (read → external processing → write), including retries and queue backoff. If tombstones expire first, the ...",
    "decision_boundary": "Use a generation-fenced `write` when records are mutated by multi-step pipelines with external latency (model calls, network enrichment, human review). Use a simpler last-writer-wins `write` only when writes are single-shot and synchronous with the read, or when the scope is single-writer by construction. The precise boundary: **if the interval between `read...",
    "operational_effect": "After adopting generation-fenced writes, resurrection attempts surfaced as explicit errors rather than silent reinserts, converting an invisible retention breach into a measurable, retryable signal. The dominant operational cost is that long-latency pipelines now fail closed on deletion and must handle the rejection path; the dominant operational benefit is ..."
  },
  "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": "bbb282f838523d33b031c1f14cc76a675a8dddb425a734be1faf1045fc0234a2",
    "verified_classes": [
      "TombstoneResurrectionError",
      "Record",
      "ScopedMemory"
    ],
    "verified_functions": [
      "__init__",
      "__init__",
      "_next_gen",
      "read",
      "forget",
      "write"
    ],
    "verified_functions_count": 6,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "TombstoneResurrectionError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
