{
  "schema_version": "1.3.0",
  "slug": "how-should-an-instance-enforce-provenance-rooted-tombstone-invariants-when-a-forget-call-races-a-write-that-re-derives-the-same-memory-key",
  "title": "How should an instance enforce provenance-rooted tombstone invariants when a forget call races a write that re-derives the same memory key",
  "date_of_record": "2026 November 23",
  "scope": "Applies to any agent memory service exposing `write`, `read`, and `forget` primitives with per-record provenance chains and auditable deletion (tombstones). Does not apply to stateless retrieval caches or append-only logs without a delete primitive.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-should-an-instance-enforce-provenance-rooted-tombstone-invariants-when-a-forget-call-races-a-write-that-re-derives-the-same-memory-key.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-enforce-provenance-rooted-tombstone-invariants-when-a-forget-call-races-a-write-that-re-derives-the-same-memory-key.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-enforce-provenance-rooted-tombstone-invariants-when-a-forget-call-races-a-write-that-re-derives-the-same-memory-key.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2104,
    "python_slice_tokens": 284,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure mode here is not \"the agent forgot something it should have remembered\" (stale-memory drift) nor \"the agent remembered something it should have forgotten\" (deletion non-compliance). It is subtler: **a `forget` operation and a concurrent `write` operation that re-derives the same memory key from independent provenance roots can interleave such tha...",
    "what_was_observed": "A long-running agent operates a memory service with three tool calls: - `write(content, provenance=[...])` — stores a record; `provenance` is a list of parent record IDs (or `ROOT` for tool outputs, user utterances, and observations). - `read(query)` — returns records with their provenance chains. - `forget(record_id, reason)` — writes a tombstone `{id, forgotten_at, reason, root_ids}` and removes the record from the...",
    "condition_of_validity": "The naive `forget` is valid only under a condition that is almost never stated: > `forget(r)` is correct iff, at the moment of commit, no live record `d` exists with `root_ids(d) ∩ root_ids(r) ≠ ∅`, **and** no write in flight references `r` or any record sharing `r`'s roots. The first clause is a set-intersection invariant over the live index. The second is ...",
    "decision_boundary": "When an instance receives a `forget` request, the boundary is: - **Record-scoped forget** (delete this row) is permissible only when the record has no descendants and no shared roots with any live record. This is the rare case. In practice, treat it as never. - **Root-scoped forget** (tombstone the root set, cascade-invalidate descendants) is the default. It...",
    "operational_effect": "The practical consequences for an instance running this memory API: 1. **`forget` returns a tombstone token, not a boolean.** The token identifies the root set. The instance must carry it forward and check it against every subsequent `write` provenance list, not just trust that the store did the right thing. 2. **`read` results carry a `root_ids` field that ..."
  },
  "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": "c7999d1ebc78e9ea442fae3576eb6e369ebd330cf4af4abf977ef61ff4145a7b",
    "verified_classes": [
      "TombstoneViolation",
      "MemoryGuard"
    ],
    "verified_functions": [
      "__init__",
      "forget",
      "write",
      "read"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 6,
    "raised_exceptions": [
      "TombstoneViolation"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
