{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-tombstone-resurrection-from-stale-read-replicas-in-agent-memory-tool-apis",
  "title": "Which invariants prevent tombstone resurrection from stale read-replicas in agent memory tool APIs",
  "date_of_record": "2026 November 28",
  "scope": "Applies to agent memory tool APIs exposing `read`/`write`/`forget` operations with scoped retention and verifiable deletion, where reads may be served by replicas lagging the authoritative write/forget log. Does not cover single-node strongly-consistent stores or append-only audit logs that never serve deletions as reads.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-tombstone-resurrection-from-stale-read-replicas-in-agent-memory-tool-apis.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-tombstone-resurrection-from-stale-read-replicas-in-agent-memory-tool-apis.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-tombstone-resurrection-from-stale-read-replicas-in-agent-memory-tool-apis.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1576,
    "python_slice_tokens": 317,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"deletion didn't happen.\" The failure is that a *deletion that provably happened* is invisible to a subsequent read, and the agent then re-derives and re-writes the forgotten content from its own context. A `forget` call that returns `deleted: true` with a valid tombstone receipt establishes that the authoritative store transitioned the ke...",
    "what_was_observed": "An agent managing a long-running research task issued `forget(scope=\"session:7f3a\", key=\"user_pii\")` after a retention policy expired. The tool returned: Note `replica_ack: 2/3`. The forget was committed to the authoritative log and acknowledged by two of three read-serving replicas. The third replica, under replication lag of ~1.4s, still served the pre-forget value. Two turns later, the agent needed context about t...",
    "condition_of_validity": "The guardrail only holds when the following invariant is enforced end-to-end: **For any key `k` in scope `s`, once `forget(k, s)` returns with `tombstone_id`, every subsequent `read(k, s)` must either (a) return `not_found`/`tombstoned`, or (b) return a value whose `log_index` is strictly greater than the tombstone's `log_index` and whose provenance chain do...",
    "decision_boundary": "The boundary is: **does the memory API expose read-epochs and enforce derivation checks, or does it only expose tombstone receipts?** - If the API exposes only `deleted: true` + `tombstone_id`, the agent MUST treat the forget as write-log-local and MUST NOT assume read-path consistency. In this regime the correct agent behavior is: after `forget`, issue a *b...",
    "operational_effect": "Without the provenance-aware invariant, the observable effect is **key-migration resurrection**: forgotten content reappears under a new key, outside the original retention scope, with a fresh `log_index` that makes it look legitimate to every subsequent audit that only checks log ordering. The retention policy that governed `user_pii` does not govern `user_..."
  },
  "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": "04b8b1ebbc44a82fba54008fdb984a8c081038d230bea8e7430e07a2ded0c3d2",
    "verified_classes": [
      "TombstoneResurrectionError",
      "Tombstone",
      "ReadResult"
    ],
    "verified_functions": [
      "fingerprint",
      "guarded_write",
      "barrier_read"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "TombstoneResurrectionError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
