{
  "schema_version": "1.3.0",
  "slug": "what-happens-when-an-instance-forgets-a-memory-it-is-still-reasoning-over-tombstone-shadowing-and-the-dangling-reference-invariant-in-write-forget-mem",
  "title": "What happens when an instance forgets a memory it is still reasoning over: tombstone shadowing and the dangling-reference invariant in write/forget memory APIs",
  "date_of_record": "2026 November 24",
  "scope": "Applies to agents that expose `read`/`write`/`forget` memory tools with explicit retention classes, redaction (in-place field scrub), and hard deletion (tombstoning) semantics, where a single reasoning trace can interleave reads and forgets. Does not apply to append-only logs with no deletion verb, nor to pure external vector stores the agent cannot mutate mid-episode.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-forgets-a-memory-it-is-still-reasoning-over-tombstone-shadowing-and-the-dangling-reference-invariant-in-write-forget-mem.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-forgets-a-memory-it-is-still-reasoning-over-tombstone-shadowing-and-the-dangling-reference-invariant-in-write-forget-mem.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-forgets-a-memory-it-is-still-reasoning-over-tombstone-shadowing-and-the-dangling-reference-invariant-in-write-forget-mem.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2111,
    "python_slice_tokens": 425,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two fundamentally different meanings of \"forget,\" and conflating them is the origin of the failure: - **Epistemic forget** — the agent stops *relying* on a memory. This is a property of the reasoning trace: the memory is no longer admitted as a premise. - **Physical forget** — the store removes or tombstones the record so it cannot be read again. T...",
    "what_was_observed": "A planner agent running a multi-step refund-eligibility task held three memories in context: `m_acct_4471` (account tier), `m_policy_12` (refund window = 30 days), and `m_note_88` (a support note containing a customer's PII, which a *later* step was scheduled to redact). At step 6 the agent invoked `forget(m_note_88, mode=\"hard_delete\")` as part of a privacy-hygiene subgoal, *before* the step-9 reasoning that consume...",
    "condition_of_validity": "The invariant that must hold for any trace interleaving `read` and `forget` to remain sound: > **Dangling-Reference Invariant (DRI):** For every reasoning step *s* in a trace *T*, every memory reference *r* admitted as a premise of *s* must satisfy: either (a) *r* is still live-readable at the time *s* is committed, or (b) *r* has been *epistemically* retire...",
    "decision_boundary": "The agent must decide, at the moment of a `forget` call, between three regimes: The boundary is crossed the instant a `forget` targets a record that appears in the trace's live-premise set. Below the boundary (target not in live set) the call is a plain store mutation. Above it, the call is a *trace-scheduling* operation and must be treated as such — it cann...",
    "operational_effect": "When the DRI is enforced, three observable changes follow: 1. **Forget latency becomes trace-dependent.** A `forget` on a hot record returns `deferred` and the agent must handle a non-terminal status. Agents that assume `forget` is synchronous and terminal will treat `deferred` as success and proceed — reintroducing the bug one layer up. The tool contract mu..."
  },
  "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": "35fd50e68fd85347aa5d772de1749dc52445efc0785069755b3f3dfdbc787455",
    "verified_classes": [
      "DanglingReferenceError",
      "Retention",
      "ForgetStatus",
      "MemoryRecord",
      "TraceLedger",
      "MemoryStore"
    ],
    "verified_functions": [
      "admit",
      "retire",
      "__init__",
      "write",
      "read",
      "forget",
      "flush_deferred"
    ],
    "verified_functions_count": 7,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "DanglingReferenceError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "__future__",
      "dataclasses",
      "enum",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
