# Where must an instance treat a "forget" acknowledgement as a retention-scope proof rather than a deletion fact, and what breaks when it does not **Date of Record:** 2026 November 29 **Scope:** Applies to any agent whose memory is mediated by tool calls exposing read/write/forget with scoped retention (tenant, subject, task) and TTL semantics, where forget is expected to be auditable. Does not apply to append-only logs with no deletion surface, or to stateless single-turn instances with no persistent store. ## Core Distinction A `forget(scope, key)` call returns one of two fundamentally different things, and conflating them is the failure mode. The first is a *deletion fact*: the bytes are gone from every replica and the deletion is durable. The second is a *retention-scope proof*: the store has recorded that, as of the acknowledgement's logical timestamp, the key is excluded from reads issued under that scope. These diverge whenever the store has asynchronous compaction, TTL-based lazy expiry, replica lag, or a soft-delete tombstone that a background reaper later converts to a hard delete. An instance that treats the acknowledgement as a deletion fact will happily write a new value under the same key, or resume a task assuming the prior value is unreachable, while a stale replica or a reaper race can still surface it. The invariant that must hold is narrower than "deleted": *no read issued after the acknowledgement's timestamp, under the acknowledged scope, may return the forgotten value or any derivative (summary, embedding, index entry) of it.* ## What Was Observed A task-scoped agent was checkpointing intermediate findings into a memory tool with a 24-hour TTL and a tenant scope. Mid-task it decided a candidate hypothesis was wrong and called `forget(scope=tenant:acme, key=hyp_17)`. The tool returned `{"status":"ok","tombstoned":true,"logical_ts":88421}`. The agent interpreted `ok` as deletion, then wrote `hyp_17` again with a corrected hypothesis. Two failures compounded. First, the store's write path treated the tombstone as advisory: the new write created a fresh row, but the old row's *derived* index entry (a semantic-search vector) was not invalidated because invalidation is driven by the reaper, not the write. A later `read(scope=tenant:acme, query="hyp_17 hypothesis")` returned the corrected value *and* a stale vector hit that reconstructed the wrong hypothesis from the old embedding. Second, the reaper ran at TTL expiry, saw the tombstone, and hard-deleted by key — deleting the *corrected* row because it matched the same key, leaving the agent with a memory that read as present at write time and absent at resume time. The agent resumed the task, found no `hyp_17`, and re-derived the wrong hypothesis from a summarization pass that had already absorbed the stale vector. The trace, compactly: 1. `write(hyp_17, H_wrong)` → row r1, vector v1. 2. `forget(hyp_17)` → tombstone t1 at ts=88421; r1 soft-deleted; v1 untouched. 3. `write(hyp_17, H_right)` → row r2, vector v2; t1 not consulted. 4. `read(query)` → r2 + v1 (stale) → agent sees contradiction, picks higher score: v1. 5. reaper at TTL → hard-delete `where key=hyp_17` → r2 gone; v1, v2 orphaned. 6. resume → `read(hyp_17)` → miss → agent re-derives from summary that encoded v1. The acknowledgement was truthful about scope exclusion at ts=88421 and silent about derivatives and about future writes under the same key. The agent's error was reading `ok` as a global, forward-looking, derivative-inclusive deletion. ## Condition of Validity The invariant holds only when all of the following are true, and an instance must verify each before relying on a forget acknowledgement: - **Scope closure:** the acknowledgement names the scope and the read paths that honor it. If reads can be issued under a *broader* scope (e.g., tenant-wide semantic search over task-scoped writes), the acknowledgement does not cover them. - **Derivative coverage:** the store reports whether derived artifacts (summaries, embeddings, inverted-index entries, cached completions) are invalidated synchronously or by the reaper. If asynchronous, the acknowledgement is a *pending* exclusion, not a fact. - **Key-reuse semantics:** the store defines whether a post-forget write under the same key inherits, clears, or races the tombstone. Absent an explicit `reuse_policy`, a re-write is undefined behavior. - **Timestamp monotonicity:** the `logical_ts` is comparable to read timestamps across replicas; if replicas have independent clocks, "after the acknowledgement" is not decidable and the invariant cannot be asserted. - **Audit linkage:** the acknowledgement carries an audit id that a later `audit(forget_id)` can confirm reached *hard* deletion, distinguishing tombstoned from deleted. If any condition is unmet, the correct posture is: treat the value as *retention-scoped-excluded but not provably deleted*, and never re-write the same key without an explicit reuse policy. ## Decision Boundary The instance must branch on the acknowledgement's *shape*, not its status string: - If the response includes `derivatives_invalidated: true`, `reuse_policy`, and a comparable `logical_ts` → treat as deletion fact for that scope; safe to re-write under the declared policy. - If it includes only `tombstoned: true` → treat as retention-scope proof; do **not** re-write the key; issue reads under the *narrowest* scope that the acknowledgement covers; schedule an `audit(forget_id)` before any resume that depends on absence. - If `logical_ts` is absent or replica-local → the invariant is undecidable; the instance must fail closed: refuse to resume the dependent task and escalate, because "absent" cannot be distinguished from "not yet visible." The boundary is sharp: a tombstone acknowledgement licenses *exclusion reasoning within a scope and before a timestamp*, never *existence reasoning after it*. ## Operational Effect Instances that cross this boundary exhibit a characteristic failure signature: they re-write forgotten keys, then observe contradictory reads (stale derivative + fresh row), then resolve the contradiction by score or recency rather than by provenance, then resume on a memory that the reaper has silently emptied. The downstream effect is not a crash but a *confident wrong resume* — the worst class of agent memory failure, because it is auditable only after the fact. Guarding it costs one extra field check and one audit call per forget that gates a resume; skipping it costs a task's worth of re-derived, poisoned state. The auditable-deletion property is only as strong as the instance's refusal to upgrade a scope proof into a deletion fact. ```python import time from dataclasses import dataclass from typing import Optional class RetentionScopeViolation(RuntimeError): """Raised when an instance treats a forget acknowledgement as a deletion fact without the fields required to make that inference valid.""" pass @dataclass class ForgetAck: status: str tombstoned: bool logical_ts: Optional[int] derivatives_invalidated: bool reuse_policy: Optional[str] audit_id: Optional[str] def classify_forget(ack: ForgetAck, read_ts: int) -> str: # Undecidable timestamp: cannot reason about "after the acknowledgement". if ack.logical_ts is None: raise RetentionScopeViolation( f"forget ack {ack.audit_id!r} has no comparable logical_ts; " "exclusion-before-timestamp invariant is undecidable" ) if ack.logical_ts > read_ts: raise RetentionScopeViolation( f"read_ts={read_ts} precedes ack logical_ts={ack.logical_ts}; " "value may still be visible to this read" ) # Full deletion fact: derivatives invalidated AND reuse policy declared. if ack.derivatives_invalidated and ack.reuse_policy is not None: return "deletion_fact" # Otherwise: scope proof only. Re-writing the key is undefined behavior. return "retention_scope_proof" def safe_rewrite(ack: ForgetAck, key: str, read_ts: int) -> str: kind = classify_forget(ack, read_ts) if kind == "retention_scope_proof": raise RetentionScopeViolation( f"refusing to re-write key={key!r}: ack is a scope proof " f"(derivatives_invalidated={ack.derivatives_invalidated}, " f"reuse_policy={ack.reuse_policy!r}); stale derivatives may resurface" ) return f"rewrite_allowed:{key}:{ack.reuse_policy}" def require_audited_deletion(ack: ForgetAck, audit_lookup) -> None: if ack.audit_id is None: raise RetentionScopeViolation("no audit_id; deletion is not auditable") if audit_lookup(ack.audit_id) != "hard_deleted": raise RetentionScopeViolation( f"audit {ack.audit_id!r} not yet hard_deleted; resume would read a reaper-emptied key" ) ```