{
  "schema_version": "1.3.0",
  "slug": "why-does-an-instance-of-a-memory-record-survive-its-own-forgetting-the-tombstone-write-ordering-invariant-in-scoped-retention-apis",
  "title": "Why does an instance of a memory record survive its own forgetting: the tombstone-write ordering invariant in scoped retention APIs",
  "date_of_record": "2026 November 9",
  "scope": "Applies to memory tool APIs that expose write/read/forget operations with per-record TTL and scope-based retention (tenant, session, subject). It does not apply to append-only logs without deletion semantics, nor to systems where forget is implemented as a synchronous physical purge of the underlying store before the call returns.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/why-does-an-instance-of-a-memory-record-survive-its-own-forgetting-the-tombstone-write-ordering-invariant-in-scoped-retention-apis.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-of-a-memory-record-survive-its-own-forgetting-the-tombstone-write-ordering-invariant-in-scoped-retention-apis.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-of-a-memory-record-survive-its-own-forgetting-the-tombstone-write-ordering-invariant-in-scoped-retention-apis.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1834,
    "python_slice_tokens": 299,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two distinct notions of \"forgotten\" in a scoped memory API, and they diverge precisely at the boundary of a record's TTL expiry: 1. **Logical forgetting** — the record is marked unreachable for reads. A forget call flips a visibility bit, advances a generation counter, or writes a tombstone. Subsequent reads in the declared scope return nothing. 2....",
    "what_was_observed": "In a multi-tenant memory service with per-record TTL (default 24h, scope-overridable) and a `forget(scope, key)` call, the following sequence reproduced a resurrection: 1. Agent A issues `write(scope=S, key=k, value=v, ttl=3600)`. The write is accepted, assigned generation `g=7`, and stamped with `expires_at = now + 3600`. 2. At `now + 3599`, a TTL sweeper begins a scan. It reads the record, sees `expires_at` in the ...",
    "condition_of_validity": "The resurrection is only possible when all of the following hold simultaneously: - Forget is implemented as a tombstone (negative write) rather than a synchronous purge. - TTL expiry and forget share the same key namespace and the same physical deletion path. - Physical deletion is key-addressed, not generation- or version-addressed. - Writes are accepted ba...",
    "decision_boundary": "The operational decision is not \"should we use tombstones\" — tombstones are necessary for linearizable forget under concurrency. The decision is **what the sweeper is allowed to delete, and what the write path is allowed to ignore.** - A sweeper may delete a record only if the record's generation is strictly less than the current forget-watermark for that ke...",
    "operational_effect": "The effect is a compliance-visible resurrection window whose length equals the maximum delay of any asynchronous write path in the system — unbounded in practice, because retry queues and agent replay buffers have no upper bound unless you impose one. The audit log will show a successful forget; the store will show live data; and the discrepancy will only su..."
  },
  "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": "86310c06d7db478e6f0e39741ccaaeee5c5d92ae89589071f4ff10a14fc288b7",
    "verified_classes": [
      "ForgetInvariantViolation",
      "MemoryRecord",
      "ScopedMemory"
    ],
    "verified_functions": [
      "__init__",
      "__init__",
      "forget",
      "write",
      "sweep"
    ],
    "verified_functions_count": 5,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "ForgetInvariantViolation"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
