{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-silent-tombstone-resurrection-across-scoped-agent-memory-tools-with-ttl-and-deletion-audits",
  "title": "Which invariants prevent silent tombstone resurrection across scoped agent memory tools with TTL and deletion audits",
  "date_of_record": "2026 November 22",
  "scope": "Applies to memory tool APIs where agents issue explicit `write`, `read`, `forget`, and `audit` operations against namespaced scopes with per-entry TTL and a durable deletion ledger. Does not apply to append-only vector stores with no deletion primitive, nor to ephemeral in-context scratchpads that never persist past a single turn.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-silent-tombstone-resurrection-across-scoped-agent-memory-tools-with-ttl-and-deletion-audits.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-silent-tombstone-resurrection-across-scoped-agent-memory-tools-with-ttl-and-deletion-audits.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-silent-tombstone-resurrection-across-scoped-agent-memory-tools-with-ttl-and-deletion-audits.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2276,
    "python_slice_tokens": 584,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "A `forget` operation is not the inverse of `write`. It is a *constraint* on the future write space of a namespace, and the difference between those two framings is where the failure lives. If `forget(key)` is implemented as \"remove the current value at `key`,\" then any subsequent `write(key, v)` — including one issued by the same agent a few tokens later, or...",
    "what_was_observed": "A planner agent operating in scope `tenant:acme/project:atlas` wrote a credential-adjacent fact: At T0+40s, a safety sub-agent (invoked after a policy classifier flagged the value) issued: The memory backend removed the row, appended `{op: delete, key: db.primary.host, gen: 1, ts: T0+40}` to the audit ledger, and returned `ok`. The sub-agent's context was then discarded — it had no further tokens to spend. At T0+310s...",
    "condition_of_validity": "The tombstone-as-predicate invariant holds only under three conditions, and each is a place where real deployments silently void it: 1. **Generation monotonicity is enforced at the storage layer, not the client.** If the memory tool accepts a client-supplied `gen` field, a stale planner holding a cached `gen: 1` will be accepted. The backend must assign gene...",
    "decision_boundary": "The architectural decision is whether `forget` returns a *tombstone handle* that must be threaded through subsequent writes, or whether the backend enforces the constraint unilaterally. Threading the handle is cheaper to implement and lets agents reason explicitly about \"I know this key is tombstoned.\" But it fails exactly in the observed case: the planner n...",
    "operational_effect": "With tombstone-as-predicate enforced, the observed scenario terminates differently. The planner's T0+310 write carries `observed_gen: 1`; the tombstone at `db.primary.host` has `gen: 1`; the backend rejects with `TombstonedError`. The planner's tool loop receives a structured rejection, and — critically — the rejection payload includes the tombstone's `reaso..."
  },
  "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": "90444495a5097ded8026a1d69dfaa3b1c9d47e0909a64e2b62d5d8e286c67ffb",
    "verified_classes": [
      "TombstonedError",
      "ScopeCanonicalizationError",
      "Tombstone",
      "MemoryStore"
    ],
    "verified_functions": [
      "__init__",
      "_canon",
      "write",
      "forget",
      "expire"
    ],
    "verified_functions_count": 5,
    "defensive_guards_count": 6,
    "raised_exceptions": [
      "AssertionError",
      "ScopeCanonicalizationError",
      "TombstonedError"
    ],
    "sample_fail_closed_invariants": [
      "tombstone invariant violated: stale write resurrected key",
      "non-canonical scope bypassed tombstone lookup",
      "assert e.tombstone_gen == 1 and e.observed_gen == 1",
      "assert 'secret-adjacent' in e.reason"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "time",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
