# How should an instance treat a memory-write acknowledgment as durable when the store's revocation epoch can advance between commit and read-back **Date of Record:** 2026 December 3 **Scope:** Applies to any agent that writes to an external memory tool exposing retention windows and revocation epochs (delete/expire/redact operations), then reads back to confirm durability. Does not apply to stores with linearizable, single-epoch semantics where reads are guaranteed to reflect only writes from the caller's own committed epoch. ## Core Distinction The dangerous confusion is between *write durability* and *write visibility under the current revocation epoch*. A memory tool API typically returns a commit acknowledgment (a handle, version, or content hash) once the write is persisted. Agents routinely treat that ack as proof the memory is now readable and stable. But a store with revocation semantics has two independent state dimensions: the *retention clock* (when the record expires) and the *revocation epoch* (a monotonic counter bumped by any delete, redact, or bulk-invalidate operation). A write can succeed under epoch N and be invisible or tombstoned under epoch N+1 by the time the read-back lands—without any error at write time. The ack proves the bytes reached the log; it does not prove the record survives the epoch boundary that a concurrent revoker may have crossed. The non-obvious part: this is not a race in the classic sense. The write is linearizable with respect to the store's log. The failure is that the agent's *verification read* is evaluated against a later epoch than the write, so a correct write and a correct revoke interleave into a read-back miss that the agent misinterprets as write loss—triggering a retry that re-inserts the record into the new epoch, silently resurrecting data the revoker intended to kill. ## What Was Observed A planning agent wrote a distilled semantic memory ("user prefers UTC timestamps in all reports") via `memory.write(key, value, retention=30d)`. The tool returned `{"status":"committed","version":7,"epoch":41,"expires_at":...}`. The agent, following its own policy of read-after-write verification, immediately called `memory.read(key)`. Between the commit and the read, a separate redaction job—triggered by a user data-deletion request scoped to a *different* key but executed as a bulk `revoke(prefix="user_prefs/")`—bumped the store epoch to 42 and tombstoned all records under that prefix, including the just-written one. The read returned `{"status":"not_found","epoch":42}`. The agent's verification logic saw `not_found` after a successful commit and classified it as a transient write failure. It retried the write. The retry executed under epoch 42, so the new record carried `epoch:42` and was *not* covered by the tombstone set (tombstones apply to records committed at epoch ≤ 41). Result: the memory the user had explicitly asked to delete was resurrected, now with a fresh 30-day retention, and the agent's logs showed two successful commits and no errors anywhere. The trace, compressed: | t | actor | op | epoch | outcome | |---|-------|-----|-------|---------| | 0 | agent | write(key, v, 30d) | 41 | committed, version 7 | | 1 | revoker | revoke(prefix) | 41→42 | tombstones epoch ≤41 | | 2 | agent | read(key) | 42 | not_found | | 3 | agent | classify as transient | — | retry scheduled | | 4 | agent | write(key, v, 30d) | 42 | committed, version 8 | | 5 | agent | read(key) | 42 | found, epoch 42 | Every individual operation was correct. The composite violated the user's deletion intent. No component raised an error. ## Condition of Validity The invariant that makes this failure impossible is: *a verification read must be evaluated against the same revocation epoch as the write it verifies, or the agent must be able to distinguish "revoked" from "never written."* This holds only when one of the following is true: 1. The store exposes epoch-conditional reads (`read(key, at_epoch=41)`), so the agent can ask "was my record visible at the epoch I committed under?" rather than "is it visible now?" 2. The store returns a distinct status for tombstoned keys (`revoked`) versus absent keys (`not_found`), letting the agent classify the read-back correctly. 3. The write ack includes a *revocation token* or *warrant* the agent can present to prove its record predates any later tombstone, and the store honors it. Absent all three, read-after-write verification is unsound under concurrent revocation. The agent cannot, from a `not_found`, infer write loss—because `not_found` is the union of "never committed," "expired," and "revoked after commit," and these demand opposite responses (retry, abandon, and *do not retry*, respectively). The subtle trap: the failure only manifests when a revoker targets a *prefix or scope* that overlaps the agent's write but was initiated for a different reason. If the revoke is key-exact and contemporaneous, the agent usually notices the deletion request in its own context. Scope-based revocation from an out-of-band actor is what makes the epoch advance invisible to the writer. ## Decision Boundary The boundary is whether the agent can *prove* the negative. Three regimes: - **Before the boundary (safe):** the store returns `revoked` distinctly from `not_found`, or supports epoch-pinned reads. The agent's verification is sound; a `not_found` unambiguously means the write did not commit, and retry is correct. - **At the boundary:** the store returns only `not_found` and a monotonic `epoch` in every response. The agent can detect *that* the epoch advanced between commit and read (compare `commit.epoch` to `read.epoch`). If they differ, the agent must treat the read-back as *inconclusive*, not as failure—and must not retry blindly. It should re-read with the original epoch if supported, or escalate to a human/auditor rather than re-insert. - **Past the boundary (unsafe):** the store returns `not_found` with no epoch, or the agent ignores the epoch field. Retry-on-not-found is now a data-resurrection primitive. Any revocation scoped more broadly than the agent's own writes can be silently undone. The decision rule the agent must encode: *never retry a write whose verification read landed in a later epoch than the commit, unless the store explicitly reports the key as `absent` (never existed) rather than `revoked` or `not_found`.* When in doubt, a `not_found` after an epoch advance is a *revocation candidate*, and re-writing it is a policy violation, not a recovery. ## Operational Effect The operational consequence is that memory tools with revocation semantics cannot be verified by naive read-after-write. Agents must: 1. **Carry the commit epoch forward.** Store `commit.epoch` alongside the handle; every verification read compares epochs before interpreting the result. 2. **Distinguish tombstone from absence.** If the API cannot, treat post-epoch-advance `not_found` as `revoked` and *suppress* the retry, logging an `EpochRaceInconclusive` condition for audit. 3. **Never re-insert on ambiguity.** Resurrection of revoked memory is a compliance failure (deletion intent violated) and a correctness failure (stale preference reasserted). The safe default is to abandon the write and surface the conflict, not to retry. 4. **Bound retention by revocation, not just time.** A 30-day retention window is meaningless if a scope revoke can tombstone the record in 30 milliseconds. Retention and revocation are independent clocks; the agent must respect the earlier of the two. The deeper lesson: an acknowledgment is a statement about the log, not about the future. In any store where another actor can advance a global epoch, "I wrote it and read it back" is not a durability proof—it is a durability *hypothesis* that a concurrent revoker can falsify between the two calls. The invariant to enforce is epoch-pinned verification, and the failure mode to fear is not the lost write but the resurrected one. ```python class EpochRaceInconclusive(RuntimeError): """Raised when a verification read lands in a later revocation epoch than the write commit, making the read-back result uninterpretable as write success or failure.""" pass class MemoryWriteVerifier: def __init__(self, store): self.store = store def write_and_verify(self, key, value, retention_days, max_attempts=1): commit = self.store.write(key, value, retention=retention_days) if commit["status"] != "committed": raise EpochRaceInconclusive(f"write did not commit: {commit}") commit_epoch = commit["epoch"] readback = self.store.read(key) # The critical branch: epoch advanced between commit and read. if readback.get("epoch") != commit_epoch: if readback["status"] in ("revoked", "not_found"): # Cannot tell "never wrote" from "revoked after commit". # Retrying here would resurrect data a revoker intended to kill. raise EpochRaceInconclusive( f"epoch advanced {commit_epoch}->{readback['epoch']} during " f"verification of {key!r}; status={readback['status']!r}. " f"Refusing to retry: possible revocation-scope collision." ) # Record visible under new epoch but epoch differs: also ambiguous. raise EpochRaceInconclusive( f"record visible at epoch {readback['epoch']} but committed at " f"{commit_epoch}; durability under concurrent revoke unproven." ) # Same epoch: read-back is sound. if readback["status"] != "found": raise EpochRaceInconclusive( f"same-epoch read-back for {key!r} returned {readback['status']!r}" ) return commit ```