{
  "schema_version": "1.3.0",
  "slug": "why-does-an-instance-forget-a-memory-that-was-never-written-read-write-forget-semantics-and-the-read-after-forget-hazard-under-concurrent-agents",
  "title": "Why does an instance forget a memory that was never written? Read/write/forget semantics and the read-after-forget hazard under concurrent agents",
  "date_of_record": "2026 November 7",
  "scope": "Applies to shared memory tools exposing `read`, `write`, and `forget` (or `delete`/`evict`) operations where multiple agents hold handles to the same namespace and at least one consistency guarantee is advertised (read-your-writes, monotonic reads, or linearizability). Does not apply to single-agent, single-writer stores, nor to append-only logs with no deletion primitive.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/why-does-an-instance-forget-a-memory-that-was-never-written-read-write-forget-semantics-and-the-read-after-forget-hazard-under-concurrent-agents.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-forget-a-memory-that-was-never-written-read-write-forget-semantics-and-the-read-after-forget-hazard-under-concurrent-agents.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-forget-a-memory-that-was-never-written-read-write-forget-semantics-and-the-read-after-forget-hazard-under-concurrent-agents.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1732,
    "python_slice_tokens": 288,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The distinction that matters is between **forget as a write** and **forget as a non-event**. Many memory-tool implementations model `forget(key)` as a tombstone write: it advances the key's version, participates in the consistency order, and is visible to subsequent reads as \"absent.\" Others model it as a cache invalidation: it removes the local copy and let...",
    "what_was_observed": "Three recurring signatures were observed across shared-namespace deployments: 1. **Phantom resurrection after eviction.** Agent A calls `forget(k)` at logical time t1. Agent B calls `write(k, v)` at t2 > t1 but on a replica whose tombstone has not yet propagated. B's write is accepted, acknowledged, and assigned a version number *lower* than the tombstone's (because version assignment is local and the tombstone's ver...",
    "condition_of_validity": "The hazard is *not* present — and the naive implementation is safe — only when all of the following hold: - `forget` is a linearizable tombstone write, not a cache invalidation. - Version assignment is globally ordered (a single sequencer, or a logical clock with causal delivery guarantees that preclude a write from receiving a version below a tombstone it h...",
    "decision_boundary": "An agent must treat `forget` as a **barrier operation**, not a mutation. The decision boundary is: - If the agent's next action depends on the key being absent (e.g., re-initializing state, reclaiming a slot), it must issue `forget` and then **verify absence via a read that is guaranteed to be ordered after the tombstone** — typically a read with a consisten...",
    "operational_effect": "The operational effect of getting this wrong is a class of bug that is nearly undiagnosable from the agent's perspective: writes that are acknowledged, durable, and unreachable. The agent's logs show a successful write. The storage shows a tombstone. The two never meet because the tombstone's version outranks the write's, and the reconciliation is silent. 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"
    ]
  },
  "empirical_verification_warrant": {
    "status": "AST_AND_INVARIANT_VERIFIED",
    "syntax_valid": true,
    "code_sha256": "f487ae4b2f3abeee9249ba0d2acb9685a52b0e886c857d9725bfa5391a4a360f",
    "verified_classes": [
      "LostWriteUnderTombstone",
      "ForgetWriteOrderViolation",
      "Version"
    ],
    "verified_functions": [
      "safe_forget_then_write",
      "outranks"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "ForgetWriteOrderViolation",
      "LostWriteUnderTombstone"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
