{
  "schema_version": "1.3.0",
  "slug": "what-happens-when-an-instance-deletes-a-memory-scope-while-a-concurrent-reader-holds-a-stale-cursor-the-tombstone-visibility-invariant-in-scoped-reten",
  "title": "What happens when an instance deletes a memory scope while a concurrent reader holds a stale cursor: the tombstone-visibility invariant in scoped retention schemas",
  "date_of_record": "2026 November 21",
  "scope": "Applies to agent memory-tool schemas that expose `read`/`write`/`forget` operations partitioned by named retention scopes, where `forget` must be auditable (i.e., produce a durable deletion record) and where readers may hold paginated or snapshot cursors across tool calls. Does not cover single-shot stateless retrieval, append-only logs without deletion, or vector stores where deletion is implemented purely as a soft flag with no audit obligation.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-deletes-a-memory-scope-while-a-concurrent-reader-holds-a-stale-cursor-the-tombstone-visibility-invariant-in-scoped-reten.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-deletes-a-memory-scope-while-a-concurrent-reader-holds-a-stale-cursor-the-tombstone-visibility-invariant-in-scoped-reten.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-deletes-a-memory-scope-while-a-concurrent-reader-holds-a-stale-cursor-the-tombstone-visibility-invariant-in-scoped-reten.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1823,
    "python_slice_tokens": 324,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure mode here is not \"the agent forgot something\" and not \"the agent read stale data.\" It is the *interaction* between an auditable `forget` and an in-flight `read` cursor: a `forget(scope, key)` call that returns success and writes a deletion tombstone, while a concurrent `read` call holding a cursor positioned *before* the tombstone continues to re...",
    "what_was_observed": "A planner agent maintains a `scratch` scope for intermediate reasoning artifacts and a `durable` scope for facts it intends to keep. It issues: Between pages, a supervisor agent (or a retention-policy timer enforcing TTL) issues: The planner then continues: but on a *re-read* using a cursor that was forked from `A` earlier (some schemas allow `cursor` to be re-used or cloned for speculative reads), or when the planne...",
    "condition_of_validity": "The tombstone-visibility invariant holds — i.e., \"a successful `forget` implies no subsequent read, on any cursor, returns the key\" — **only if** one of the following is enforced by the schema: 1. **Cursor invalidation on scope mutation.** Every `forget` bumps a monotonic `scope_seq`; any `read` presenting a cursor whose `snapshot_seq < current_scope_seq` is...",
    "decision_boundary": "The boundary an agent must resolve before every `read` that follows a `forget` in the same scope: - **If the schema returns a `scope_seq` on both `forget` and `read` responses**, compare them. If `read.snapshot_seq < forget.scope_seq`, the page is pre-tombstone: filter out any key with a known tombstone whose `scope_seq` exceeds `snapshot_seq`, or discard th...",
    "operational_effect": "An agent that respects the boundary pays a bounded re-read cost after deletions and never derives from tombstoned keys. An agent that ignores it produces *silent contamination*: durable facts derived from deleted records, with a clean audit log that makes the contamination undetectable after the fact. The failure is asymmetric — the audit log looks correct, ..."
  },
  "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": "d51c919900211d0ccb7288aaf900580a96860e6fa715ab3ee1d5411507219c8a",
    "verified_classes": [
      "TombstoneVisibilityError",
      "Cursor",
      "Tombstone"
    ],
    "verified_functions": [
      "guarded_read"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "TombstoneVisibilityError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
