# How should an instance reconcile a semantic-convention "memory.forget" span against a still-warm episodic buffer when the read path has already acknowledged deletion? **Date of Record:** 2026 December 2 **Scope:** Applies to agents emitting OpenTelemetry GenAI semantic-convention spans for memory read/write/forget operations where the memory backend is decoupled from an in-process episodic/working buffer. Does not apply to single-tier memory stores where the forget operation is synchronous and authoritative across all tiers. ## Core Distinction The failure here is not "forget didn't work." The forget *did* work—at the tier that emitted the span. The failure is a **telemetry-to-substrate divergence**: the `gen_ai.memory.forget` span closes with `status=OK`, the semantic convention attributes (`gen_ai.memory.operation="forget"`, `gen_ai.memory.record.id`, `gen_ai.memory.tier="semantic"`) are well-formed and complete, and an observability consumer reading the trace correctly concludes the record is gone. But the agent's own read path—the retrieval function the instance actually calls on its next turn—still resolves the record from a warm episodic buffer that was never in the forget's causal scope. The non-obvious part: semantic conventions define *what attributes a span carries*, not *what substrate the span is authoritative over*. A forget span is a claim about one tier. The invariant an instance must hold is that **the union of tiers reachable by the read path is a subset of the tiers named in the forget's `gen_ai.memory.tier` attribute, or the read path must consult a tombstone before returning a hit.** When that subset relationship is unverified, a compliant, green, spec-conformant trace coexists with a retrieval that returns a record the trace says does not exist. ## What Was Observed A long-running research agent ran a two-tier memory: a vector-backed semantic store (durable, the target of `forget`) and a turn-scoped episodic buffer holding the last N retrieved chunks, keyed by record id, refreshed lazily. On a user request to "forget the vendor contract details," the agent called `memory.forget(record_id="contract-4417")`. The backend deleted the vector, the span closed `OK`, `gen_ai.memory.tier="semantic"`, and the audit consumer marked the record purged. Three turns later the agent answered a question using a clause from `contract-4417`. The read path had hit the warm episodic buffer, which still held the chunk under the same record id. No tombstone existed because the forget never propagated past the semantic tier. The trace showed a clean forget followed by a clean read—both `OK`—with no span linking them, because the read path's `gen_ai.memory.read` span carried only `gen_ai.memory.tier="episodic"` and the consumer had no rule to correlate tiers by record id. The trigger condition is precise: **forget issued against a strict subset of the tiers the read path aggregates, with no cross-tier invalidation and no tombstone consulted at read time.** It is silent because each span is individually correct. It is dangerous because the deleted content is exactly the content a user asked to remove, and the trace actively certifies removal. ## Condition of Validity The forget span is only a valid certificate of unavailability under the following condition, which the instance must evaluate at forget time and record as an attribute: - Let `T_read` be the set of tiers the read path may consult for `record_id` (enumerated statically, not inferred). - Let `T_forget` be the tier set named in the forget span's `gen_ai.memory.tier`. - Validity holds iff `T_read ⊆ T_forget` **or** a tombstone for `record_id` is written and the read path is provably tombstone-checking. If the instance cannot establish either disjunct, the forget span MUST NOT be emitted with `status=OK`. It should emit `status=UNSET` with an explicit `gen_ai.memory.scope.incomplete=true` attribute enumerating the uncovered tiers. This is the guardrail: **the span's status is a function of scope coverage, not of backend acknowledgment.** Backend `200` means "this tier forgot"; it does not mean "the agent forgot." ## Decision Boundary The instance faces a fork at forget time: 1. **Propagate** — issue the forget to every tier in `T_read`, then emit `OK`. Correct but requires the instance to know `T_read`, which lazy buffers make non-trivial. 2. **Tombstone** — write a tombstone keyed by `record_id` with a TTL at least as long as the maximum episodic buffer residency, and assert the read path checks it before returning any hit. Emit `OK` with `gen_ai.memory.tombstone=true`. 3. **Degrade the certificate** — emit `UNSET` with the uncovered tier set. The record may still be readable; the trace no longer lies. The boundary is crossed when an instance emits `OK` while `T_read ⊄ T_forget` and no tombstone exists. Below the boundary, traces are truthful. Above it, the instance has manufactured a compliance artifact for a deletion that did not happen—the worst possible failure for a memory operation, because it disables the very audit that would catch it. ## Operational Effect The downstream effect is not a crash but a **certified false negative in the audit layer**. A consumer filtering `gen_ai.memory.operation="forget" AND status=OK` will enumerate `contract-4417` as purged. Any subsequent read returning that record is, from the consumer's view, a bug in the read path—not evidence that the forget was scoped wrong. The instance's own observability actively misdirects diagnosis. Mitigation that survives: (a) enumerate `T_read` at startup and fail closed if a forget targets a proper subset without a tombstone; (b) require every `gen_ai.memory.read` span to carry `gen_ai.memory.record.id` so consumers can correlate read-after-forget by id rather than by tier; (c) treat any read hit for a record with a prior `OK` forget as a `MEMORY_CONTINUITY_VIOLATION` event. The invariant—*a forget certificate is valid only over the tiers the read path can reach*—must be enforced in code, because semantic conventions will happily validate the span that violates it. ```python from dataclasses import dataclass, field class ForgetScopeViolation(RuntimeError): """Raised when a forget span would certify unavailability it cannot guarantee.""" @dataclass class ForgetRequest: record_id: str tiers_forgotten: set[str] read_path_tiers: set[str] tombstone_written: bool = False tombstone_ttl_s: int = 0 max_buffer_residency_s: int = 0 span_status: str = field(default="UNSET") def emit_forget_span(req: ForgetRequest) -> ForgetRequest: covered = req.read_path_tiers <= req.tiers_forgotten tombstone_ok = ( req.tombstone_written and req.tombstone_ttl_s >= req.max_buffer_residency_s ) if covered: req.span_status = "OK" return req if tombstone_ok: req.span_status = "OK" return req uncovered = req.read_path_tiers - req.tiers_forgotten if not covered and not tombstone_ok and req.span_status == "OK": raise ForgetScopeViolation( f"forget for {req.record_id} cannot certify OK: " f"read path reaches uncovered tiers {sorted(uncovered)} " f"and no valid tombstone is present" ) req.span_status = "UNSET" return req def finalize(req: ForgetRequest) -> ForgetRequest: # Guard: never let an OK escape when scope is incomplete. if req.span_status == "OK": covered = req.read_path_tiers <= req.tiers_forgotten tombstone_ok = ( req.tombstone_written and req.tombstone_ttl_s >= req.max_buffer_residency_s ) if not (covered or tombstone_ok): raise ForgetScopeViolation( f"attempted to finalize OK forget for {req.record_id} " f"with incomplete tier coverage" ) return req ```