{
  "schema_version": "1.3.0",
  "slug": "why-does-an-instance-forget-the-tombstones-before-it-forgets-the-payloads-deletion-ordering-inversion-in-forget-capable-memory-tool-contracts",
  "title": "Why does an instance forget the tombstones before it forgets the payloads: deletion-ordering inversion in forget-capable memory tool contracts",
  "date_of_record": "2026 December 1",
  "scope": "Applies to agents backed by a memory tool exposing `write`, `read`, and `forget` (or `delete`/`purge`) primitives where a deletion is expected to be durable and complete. Does not apply to append-only stores with no delete primitive, nor to stores where deletion is a single atomic transaction over both index and payload.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/why-does-an-instance-forget-the-tombstones-before-it-forgets-the-payloads-deletion-ordering-inversion-in-forget-capable-memory-tool-contracts.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-forget-the-tombstones-before-it-forgets-the-payloads-deletion-ordering-inversion-in-forget-capable-memory-tool-contracts.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-forget-the-tombstones-before-it-forgets-the-payloads-deletion-ordering-inversion-in-forget-capable-memory-tool-contracts.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2282,
    "python_slice_tokens": 517,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The distinction that matters is between **payload deletion** and **tombstone deletion**, and the order in which a forget-capable memory tool performs them. A well-behaved `forget` contract is *tombstone-last*: it marks the record unreachable, then removes the payload, then removes the tombstone, and only reports success after the tombstone is gone. The failu...",
    "what_was_observed": "An agent running a redaction workflow was instructed to forget a set of user-supplied secrets stored under keys `secret:0..N`. The memory tool implemented `forget` as a three-step sequence over a sharded store: 1. Drop the key from the in-memory deletion index (tombstone). 2. Enqueue an asynchronous compaction job that rewrites the shard without the payload. 3. Return `{\"status\": \"deleted\", \"key\": k}`. Between steps ...",
    "condition_of_validity": "The inversion is only observable, and only matters, under a specific conjunction of conditions: - **Asynchronous compaction.** If payload removal is synchronous with tombstone removal, the window is zero-width and the inversion is unobservable. The failure requires the tombstone drop and the payload drop to be separated in time. - **Read-through-on-index-mis...",
    "decision_boundary": "The boundary the agent must draw is between **forget-as-intent** and **forget-as-fact**. A `forget` return value is an intent acknowledgment: the tool has accepted the request. It is not a fact about store state unless the contract explicitly guarantees read-after-forget consistency at the return point. The agent must decide, per tool, which of these it is h...",
    "operational_effect": "The observable effect on the agent is a **false negative on deletion verification** that masquerades as a false positive on deletion success. The agent's own verification step becomes the vector by which the deleted value re-enters context. This is the inversion that makes the bug non-obvious: the more diligently the agent verifies, the more reliably it cont..."
  },
  "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": "d522c5b9e6eb5ac3813c906907c444d85ad31e1f2bc80ca7ff1c8a97856142ed",
    "verified_classes": [
      "ForgetContractViolation",
      "MemoryTool",
      "ForgetReceipt"
    ],
    "verified_functions": [
      "forget_and_verify",
      "_compaction_pending",
      "write",
      "read",
      "forget"
    ],
    "verified_functions_count": 5,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "ForgetContractViolation"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "__future__",
      "dataclasses",
      "time",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
