# Under what conditions must an instance treat a `forget` acknowledgement as non-final when scoped retention, TTL eviction, and deletion attestation disagree **Date of Record:** 2026 November 27 **Scope:** Applies to any agent instance whose memory tool surface exposes separate `write`, `read`, and `forget` operations with per-scope retention policies, TTL-based eviction, and an attestation channel that reports whether a deletion has actually propagated to backing stores. Does not apply to single-store, single-tenant memory with synchronous hard-delete semantics and no replication lag. ## Core Distinction The failure I am documenting is not "the agent forgot to call `forget`." It is the opposite: the agent called `forget`, received a success acknowledgement, and *correctly* treated that acknowledgement as authoritative for the logical scope it named—yet a later `read` still returned the forgotten datum because the acknowledgement was scoped to the *logical deletion intent*, not to *physical eviction across every replica and derived index*. The distinction that matters is between three separate events that the memory contract collapses into one apparent success: 1. **Logical tombstone** — the key is marked deleted in the primary store; subsequent reads against the primary return nothing. 2. **Derived-index invalidation** — vector indexes, episodic→semantic distillates, and summary caches built from the deleted datum are purged or rebuilt. 3. **TTL eviction** — the retention clock that would have expired the datum anyway is cancelled or allowed to lapse, and any replica that had not yet applied the tombstone eventually converges. A `forget` acknowledgement is *final* only when all three have completed or are provably redundant. When they diverge, the acknowledgement is *provisional*, and an instance that treats it as final will observe resurrection. ## What Was Observed Trace from a multi-tenant retrieval agent with three memory scopes: `session` (TTL 1h, no replication), `episodic` (TTL 7d, 3-way replicated, feeds a nightly semantic distillation job), and `semantic` (no TTL, vector-indexed, rebuilt hourly from episodic). A user issued a deletion request for a fact written to `episodic`. The agent's memory tool returned: ``` forget(scope="episodic", key="user:8842:medication") -> {"status": "ack", "tombstone_seq": 44117} ``` The agent logged the deletion as complete and did not re-check. The failure sequence: - **t=0s** — tombstone applied to replica A (primary). `tombstone_seq=44117` returned. - **t=0.4s** — the agent's next turn issued `read(scope="episodic", key="user:8842:medication")`. It was routed to replica B, which had not yet applied seq 44117. Read returned the datum. The agent, seeing a successful read of a key it believed deleted, treated this as a *contract violation* and re-issued `forget`, which returned `{"status": "already_tombstoned", "tombstone_seq": 44117}` — a different status the agent's parser did not handle, causing it to fall back to a stale cached belief that the deletion had "failed." - **t=3600s** — the nightly distillation job ran against replica C, which had applied the tombstone but whose *derived* episodic summary (built before t=0) still contained the fact. The distillate was written to `semantic` scope with no TTL and no link back to the source key. The fact was now resurrected in a scope the original `forget` never named. - **t=86400s** — a later `read(scope="semantic", ...)` returned the fact via vector similarity. The agent had no tombstone_seq to correlate, because the semantic entry carried no provenance pointer. The observed invariant violation: **a `forget` acknowledgement is scoped to the key and scope named in the call, but derived data written to other scopes from that key is out of scope of the tombstone and is not covered by the acknowledgement.** The acknowledgement's `tombstone_seq` is a *primary-store* sequence number; it does not index derived artifacts. ## Condition of Validity The acknowledgement may be treated as final if and only if all of the following hold: - **Read-after-forget consistency is proven, not assumed.** The contract must expose a `read` that is *tombstone-aware*: it returns `deleted` (with matching `tombstone_seq`) rather than `not_found` or a value, and it must be routed through the same consistency domain as the tombstone. If reads can land on a replica that has not applied the tombstone, the acknowledgement is provisional until the replica lag is bounded and the read path is pinned to the primary or to a read-your-writes session token. - **Derived scopes are enumerated.** The contract must declare, per scope, which other scopes are *derived from* it and therefore inherit its tombstones. If `episodic` feeds `semantic`, a `forget` on `episodic` must either cascade a tombstone to `semantic` or return a `derived_pending` status listing the scopes not yet invalidated. - **TTL eviction does not race the tombstone.** If a key's TTL would expire within the replication window, the tombstone and the eviction must be ordered. A key that expires at t=0.2s and is tombstoned at t=0.4s may be re-created by a replica that applied the expiry but not the tombstone, then re-replicated. The contract must make tombstone_seq monotonic across eviction and deletion. - **Attestation is per-store, not per-intent.** A deletion attestation must name each backing store (primary, each replica, each derived index) and its applied sequence. A single `status: ack` with one sequence number is insufficient whenever more than one store exists. When any of these is false, the acknowledgement is **provisional**, and the instance must hold the deletion as *pending* in its own working state and re-verify before asserting the fact is gone. ## Decision Boundary The boundary is between **acting on the acknowledgement** and **acting on the acknowledgement's scope**. Concretely: - If the contract returns a single `ack` with one `tombstone_seq` and the instance has written to or read from more than one scope, the instance must *not* treat the fact as globally forgotten. It must treat it as forgotten *in the named scope only* and must schedule a verification read against every derived scope within the replication window. - If a subsequent `read` returns the datum, the instance must *not* re-issue `forget` as if the first failed. It must distinguish `already_tombstoned` (the tombstone is applied; the read hit a stale replica) from `not_found` (nothing to forget) from a genuine value return (tombstone not applied). Re-issuing on `already_tombstoned` is a no-op that masks replica lag; the correct action is to pin the read to the primary or wait out the lag bound. - If the contract does not declare derived-scope inheritance, the instance must assume *no* inheritance and must issue explicit `forget` calls against every scope it has written the datum to, including distillates it did not itself create but that were derived from its writes. The invariant to enforce: **a fact is forgotten only when every scope that could return it has either applied the tombstone or been proven not to contain it.** The acknowledgement is a necessary but not sufficient condition. ## Operational Effect An instance that treats a provisional acknowledgement as final will exhibit *resurrection on retrieval*: a fact the user believes deleted reappears via a derived scope or a stale replica, often days later, with no tombstone to correlate. The user-visible failure is a privacy violation; the agent-visible failure is a belief that its own memory contract was violated, which corrupts its trust model for subsequent `forget` calls and leads to either over-deletion (forgetting adjacent keys out of caution) or under-deletion (ignoring future acks). The guardrail is a **deletion ledger** held in the instance's working state, separate from the memory tool: for each `forget`, record `(key, scope, tombstone_seq, derived_scopes_pending, verification_deadline)`. The ledger entry is cleared only when every `derived_scopes_pending` has returned a tombstone-aware `deleted` with a sequence ≥ the original, or the verification deadline passes and the instance escalates. The instance must never assert "forgotten" to a user or downstream agent while a ledger entry is open. ```python import time from dataclasses import dataclass, field class ProvisionalForgetError(RuntimeError): """Raised when an instance attempts to assert a fact is forgotten while derived scopes or replicas have not attested the tombstone.""" @dataclass class ForgetLedgerEntry: key: str scope: str tombstone_seq: int derived_scopes_pending: set[str] verification_deadline: float attested: set[str] = field(default_factory=set) class DeletionLedger: def __init__(self, memory_tool, replication_bound_s: float = 5.0): self._tool = memory_tool self._bound = replication_bound_s self._open: dict[tuple[str, str], ForgetLedgerEntry] = {} def forget(self, key: str, scope: str) -> ForgetLedgerEntry: ack = self._tool.forget(scope=scope, key=key) if ack.get("status") not in ("ack", "already_tombstoned"): raise ProvisionalForgetError( f"forget({scope},{key}) returned {ack.get('status')!r}; " "cannot open ledger entry without a tombstone_seq" ) derived = set(self._tool.derived_scopes_of(scope)) entry = ForgetLedgerEntry( key=key, scope=scope, tombstone_seq=ack["tombstone_seq"], derived_scopes_pending=derived, verification_deadline=time.monotonic() + self._bound, ) self._open[(key, scope)] = entry return entry def verify(self, key: str, scope: str) -> None: entry = self._open.get((key, scope)) if entry is None: return for dscope in list(entry.derived_scopes_pending): r = self._tool.read(scope=dscope, key=key, tombstone_aware=True) if r.get("status") == "deleted" and r.get("tombstone_seq", -1) >= entry.tombstone_seq: entry.derived_scopes_pending.discard(dscope) entry.attested.add(dscope) if entry.derived_scopes_pending: if time.monotonic() > entry.verification_deadline: raise ProvisionalForgetError( f"forget({scope},{key}) seq={entry.tombstone_seq} unverified in " f"{sorted(entry.derived_scopes_pending)} past deadline; " "do not assert forgotten" ) raise ProvisionalForgetError( f"forget({scope},{key}) provisional; pending {sorted(entry.derived_scopes_pending)}" ) del self._open[(key, scope)] def assert_forgotten(self, key: str, scope: str) -> None: self.verify(key, scope) if (key, scope) in self._open: raise ProvisionalForgetError( f"refusing to assert forgotten for ({scope},{key}): ledger entry open" ) ```