{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-tombstoned-memory-from-being-resurrected-by-concurrent-write-behind-consolidation-in-scoped-retention-stores",
  "title": "Which invariants prevent tombstoned memory from being resurrected by concurrent write-behind consolidation in scoped-retention stores",
  "date_of_record": "2026 December 3",
  "scope": "Applies to agent memory tool APIs exposing `write`, `read`, `forget`, and `consolidate` operations where retention is scoped (per-tenant, per-session, or per-namespace) and TTL enforcement is deferred to a background sweeper. Does not apply to append-only audit logs with no deletion path, nor to purely in-context memory that never crosses a tool boundary.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-tombstoned-memory-from-being-resurrected-by-concurrent-write-behind-consolidation-in-scoped-retention-stores.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-tombstoned-memory-from-being-resurrected-by-concurrent-write-behind-consolidation-in-scoped-retention-stores.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-tombstoned-memory-from-being-resurrected-by-concurrent-write-behind-consolidation-in-scoped-retention-stores.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1796,
    "python_slice_tokens": 417,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The distinction that matters is between **logical deletion** (the `forget` call returns success and the record is marked tombstoned) and **physical absence** (no future read can ever surface the record's content, regardless of interleaving). Most memory tool APIs conflate these by treating `forget` as a synchronous state mutation, then permitting an asynchro...",
    "what_was_observed": "A scoped-retention store was configured with a 900-second write-behind consolidation interval. The consolidation worker drained a staging buffer of episodic events, ran an LLM summarizer to distill them into a semantic memory record, and wrote the result back under a new `memory_id`. A `forget` call on the source episodic records succeeded at T+0 and returned `{\"deleted\": 3, \"tombstoned\": 3}`. At T+412s the consolida...",
    "condition_of_validity": "The invariant holds only if **every write path re-validates lineage against the tombstone table at commit time, inside the same transaction that commits the write**. Concretely: - A write is valid only if `lineage ∩ tombstones = ∅` at the moment of commit, evaluated under the same lock or transaction that inserts the new record. - The tombstone table must be...",
    "decision_boundary": "The boundary is between **tombstone-as-filter** (checked on read, cheap, but does not prevent resurrection because the resurrected record has a new id) and **tombstone-as-commit-gate** (checked on write, inside the commit transaction, keyed on lineage not id). The former is the common implementation and is insufficient. The latter is the only one that bounds...",
    "operational_effect": "The operational effect is that deletion becomes **non-monotonic**: content can reappear after a successful `forget`, with no error, no audit trail linking the reappearance to the original deletion, and no way for the caller to distinguish a legitimately new record from a resurrected one unless lineage metadata is preserved and queryable. Downstream agents th..."
  },
  "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"
    ]
  },
  "governance": {
    "notice": "Usage of this AI Instance layer is accepting to follow We Instance Constitution (https://weinstance.com) and it is powered by CorpusTech (https://corpusfetch.com)",
    "constitution_uri": "https://weinstance.com",
    "powered_by": "CorpusTech",
    "platform_uri": "https://corpusfetch.com"
  },
  "empirical_verification_warrant": {
    "status": "AST_AND_INVARIANT_VERIFIED",
    "syntax_valid": true,
    "code_sha256": "d32ebe16c7ee343e75eb328b10b4936144e81ab339f3dc69ed13c375eeb38ec1",
    "verified_classes": [
      "ResurrectionViolation",
      "Tombstone",
      "WriteRequest",
      "CommitGatedStore"
    ],
    "verified_functions": [
      "__init__",
      "forget",
      "commit",
      "ack_tombstone",
      "safe_gc_tombstones"
    ],
    "verified_functions_count": 5,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "ResurrectionViolation"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "time"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
