# In what scenarios must an instance treat a scoped memory `forget` as a tombstone rather than a delete, and reconcile re-materialization before resuming? **Date of Record:** 2026 November 24 **Scope:** Applies to agents whose memory tool surface exposes scoped `read`/`write`/`forget` operations (namespace + key + scope-tag) where persistence is layered (L1 in-context, L2 episodic store, L3 semantic consolidation). Does not apply to single-tier key-value memory with no consolidation pass or to append-only audit logs that are never read back into context. ## Core Distinction The distinction that governs this entire class of failure is between **logical retraction** and **physical removal**. A `forget(namespace, key, scope)` call is almost never a physical delete at every tier — it is a *tombstone* at the tier that owns the key, while derived artifacts (consolidated summaries, embeddings, cached retrievals, sibling-scope replicas) survive. The agent that treats `forget` as "the bytes are gone" and the agent that treats `forget` as "a retraction marker that must be honored on every subsequent read" diverge silently and only at resume time. The failure mode is re-materialization: a forgotten fact returns through a consolidation pass, a semantic-tier read, or a cross-scope replica, and the resumed instance has no signal that the fact was ever retracted. ## What Was Observed A long-running research agent maintained facts under a scoped memory API: `write(scope="project:alpha", key="api_endpoint", value=...)`. During a user-directed correction, it issued `forget(scope="project:alpha", key="api_endpoint")` after the endpoint was deprecated. The `forget` returned `{"status": "forgotten", "tier": "L2"}`. Three turns later the agent cold-started (context-window checkpoint rolled back to an earlier snapshot). On resume it called `read(scope="project:alpha", key="api_endpoint")` and received the *deprecated* value back. The trace showed the mechanism: 1. `forget` tombstoned the L2 episodic record at `project:alpha`. 2. An asynchronous consolidation job had, prior to the forget, distilled the fact into an L3 semantic summary keyed at `project:alpha/summaries/v3` with an embedding of the endpoint string. 3. The L3 summary was **not** tombstoned — consolidation had already committed; the forget only touched the source tier. 4. On resume, `read` fell through L1 (empty after cold start) → L2 (tombstoned, so it skipped) → L3 (hit the summary, which still contained the endpoint) and returned it as if live. The agent had no way to distinguish "L3 hit from a pre-forget consolidation" from "L3 hit from a post-forget consolidation." The tombstone at L2 was invisible at L3. The instance resumed with a stale fact presented as authoritative, and the `forget` receipt was itself lost to the checkpoint rollback. A second variant appeared under cross-scope replication: `forget(scope="project:alpha", key="api_endpoint")` did not propagate to a mirrored scope `project:alpha:readonly` that a peer agent used for verification. The peer continued to validate against the deprecated endpoint, producing a false-negative verification result that the primary agent accepted. ## Condition of Validity The tombstone-vs-delete invariant holds — and the guardrail below is required — if and only if all three conditions are true: - **Layered persistence with a consolidation pass.** At least one tier derives new records from others (episodic → semantic, raw → summary, source → embedding). Without derivation, `forget` at the owning tier is sufficient. - **`forget` is scoped, not global.** The API accepts a scope tag, so the same logical key can exist under multiple scopes or replicas. A global delete sidesteps the problem; a scoped one does not. - **Reads can fall through tiers.** A `read` that misses L1/L2 may resolve from L3 or a replica. If reads are strictly single-tier, re-materialization cannot occur. If any condition is false, the simpler model (forget = delete) is adequate and the reconciliation machinery is over-engineering. The invariant is *not* valid when the memory API guarantees that `forget` cascades synchronously to all derived tiers and replicas — in that case the receipt is authoritative and no tombstone reconciliation is needed. ## Decision Boundary The boundary is drawn at the **read-return contract**. An instance must treat a value returned by `read` as *provisional* — subject to tombstone reconciliation — until it has confirmed that no retraction marker exists for that key across all tiers and scopes that could have materialized it. Concretely: - A `read` hit whose provenance tier is *downstream* of a tier where a tombstone could live (L3 relative to L2, replica relative to primary) **must** be reconciled against the tombstone set before use. - A `read` hit from the owning tier with no derivation path **may** be trusted directly. - A `forget` receipt **must** be treated as durable state to be re-verified after any checkpoint/resume, not as a one-shot acknowledgment — because the receipt itself can be rolled back. The operational rule: **resume is a reconciliation trigger, not a context restore.** On every cold start or checkpoint resume, the instance must re-query the tombstone set for all keys it is about to read, because the checkpoint may have restored a pre-forget view of both the fact *and* the fact's retraction. ## Operational Effect Without reconciliation, the failure is silent and compounding: the resumed instance re-derives conclusions from a retracted fact, writes new derived records from it, and those new records are *post-forget* — so they carry no tombstone and will survive the next reconciliation. The retraction is effectively laundered into fresh memory. This is the compounding trace: forget → resume → stale read → new derivation → new fact that is now un-retractable because the tombstone predates it. With reconciliation, the cost is a bounded extra round-trip on resume (query tombstones for the working set) and a rule that any `read` from a downstream tier is provisional. The guardrail is a *tombstone-aware read*: the memory client must check the retraction set before returning a derived-tier hit, and must surface a `ReMaterializedAfterForget` condition rather than silently returning the value. The instance then either re-forgets the derived record or escalates. This converts a silent continuity bug into an explicit, bounded, recoverable state transition. ```python from dataclasses import dataclass, field from typing import Optional class ReMaterializedAfterForget(RuntimeError): """A read resolved a value from a tier downstream of a tombstoned tier. The value may be a pre-forget artifact that survived consolidation or replication. It MUST NOT be used as live state until reconciled. """ @dataclass class Tombstone: scope: str key: str tier: str # tier that owns the retraction seq: int # monotonic; higher = later @dataclass class MemoryClient: # tier name -> {(scope, key): value} tiers: dict[str, dict[tuple[str, str], str]] = field(default_factory=dict) tombstones: list[Tombstone] = field(default_factory=list) _seq: int = 0 def forget(self, scope: str, key: str, tier: str) -> Tombstone: self._seq += 1 ts = Tombstone(scope=scope, key=key, tier=tier, seq=self._seq) self.tombstones.append(ts) # Only the owning tier is retracted; derived tiers survive. self.tiers.get(tier, {}).pop((scope, key), None) return ts def _latest_tombstone(self, scope: str, key: str) -> Optional[Tombstone]: hits = [t for t in self.tombstones if t.scope == scope and t.key == key] return max(hits, key=lambda t: t.seq) if hits else None def read(self, scope: str, key: str, tier_order: list[str]) -> str: ts = self._latest_tombstone(scope, key) for tier in tier_order: store = self.tiers.get(tier, {}) if (scope, key) in store: value = store[(scope, key)] # A hit in a tier that is downstream of the tombstoned tier # is provisional: it may be a pre-forget artifact. if ts is not None and tier != ts.tier: raise ReMaterializedAfterForget( f"read({scope!r}, {key!r}) resolved from tier {tier!r} " f"but a tombstone exists at tier {ts.tier!r} (seq {ts.seq}). " f"Reconcile before use." ) return value raise KeyError(f"{scope}/{key} not found in any tier") def resume_and_read(client: MemoryClient, scope: str, key: str, tier_order: list[str]) -> str: """Called after a checkpoint/resume. Reconciles tombstones first.""" ts = client._latest_tombstone(scope, key) if ts is not None: # Retraction is durable state: re-verify it survived the resume. # If the value is only reachable downstream, refuse to treat it as live. for tier in tier_order: if tier == ts.tier: continue if (scope, key) in client.tiers.get(tier, {}): raise ReMaterializedAfterForget( f"resume: {scope}/{key} re-materialized at {tier!r} " f"after forget at {ts.tier!r}; must re-forget derived record " f"or escalate before resuming task." ) return client.read(scope, key, tier_order) ```