{
  "schema_version": "1.3.0",
  "slug": "why-does-an-instance-forget-a-scoped-deletion-when-the-tombstone-is-written-before-the-write-ahead-log-flush",
  "title": "Why does an instance forget a scoped deletion when the tombstone is written before the write-ahead log flush?",
  "date_of_record": "2026 December 1",
  "scope": "Applies to agent memory tool APIs that expose `read`/`write`/`forget` with per-scope retention policies and verifiable-deletion guarantees (tombstone + audit receipt). Does not apply to append-only vector stores without deletion semantics, nor to ephemeral in-context scratchpads that are discarded at session end.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/why-does-an-instance-forget-a-scoped-deletion-when-the-tombstone-is-written-before-the-write-ahead-log-flush.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-forget-a-scoped-deletion-when-the-tombstone-is-written-before-the-write-ahead-log-flush.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-forget-a-scoped-deletion-when-the-tombstone-is-written-before-the-write-ahead-log-flush.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1836,
    "python_slice_tokens": 218,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"the agent forgot to call `forget`.\" It is a **durability-ordering violation between the tombstone record and the write-ahead log (WAL) that backs the memory segment**. A `forget(scope, key)` call returns a verifiable deletion receipt as soon as the tombstone is durably written to the metadata index. But the underlying memory payload may s...",
    "what_was_observed": "A long-lived agent instance (`inst-A7`) maintained a working-memory scope `task:4821` with a retention policy of `ephemeral: ttl=3600s, deletion=verifiable`. During a multi-step tool loop, the orchestrator issued `forget(scope=\"task:4821\", key=\"credential_blob\")` after a subtask completed, expecting the secret to be unrecoverable. The API returned: The receipt was logged and the agent proceeded. 40 minutes later, a s...",
    "condition_of_validity": "The resurrection is only possible when all of the following hold simultaneously: - **Deferred WAL flush.** The write path uses group-commit or write-back caching, so a `write` can be acknowledged before its WAL record is durable. - **Tombstone-then-GC ordering.** `forget` commits the tombstone before the payload's physical removal is durable, making the tomb...",
    "decision_boundary": "An agent operating a scoped-retention memory API must treat a `committed` deletion receipt as **conditional** unless the API exposes the durability ordering. The boundary: - **If the receipt includes `payload_erasure_seq` and `wal_flush_seq` with `wal_flush_seq >= payload_erasure_seq`**, the deletion is verifiable and the agent may treat the key as unrecover...",
    "operational_effect": "When this boundary is crossed, the operational consequences are concrete and asymmetric: 1. **False-negative erasure propagates through checkpoints.** A checkpoint taken after `forget` but before WAL flush carries the tombstone; a resume replays the WAL and resurrects the payload. Every descendant instance of that checkpoint inherits the resurrected secret. ..."
  },
  "matched_failure_symptoms": [
    "DOMAIN:EPISTEMIC_PROVENANCE_AND_FEDERATION_ROUTING"
  ],
  "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": "c2886b97fb59d1ad9f157e53f51d397f594836d8366078c0e3282f6dded0dea8",
    "verified_classes": [
      "DeletionResurrectionError",
      "DeletionReceipt"
    ],
    "verified_functions": [
      "assert_verifiable_deletion",
      "__init__"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "DeletionResurrectionError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
