# How should an instance reconcile schema-version skew between OpenTelemetry GenAI semantic-convention memory events emitted by a writer and the forget tombstone it later reads **Date of Record:** 2026 November 27 **Scope:** Applies to agent runtimes that emit and consume GenAI semantic-convention memory lifecycle events (`gen_ai.memory.read`, `gen_ai.memory.write`, `gen_ai.memory.forget`) across instances that may run different schema revisions of the convention. Does not apply to single-instance, single-version deployments where writer and reader share a compiled schema. ## Core Distinction There is a difference between *event absence* and *event inexpressibility*. When an agent instance reads a memory store and encounters no `gen_ai.memory.forget` event for a key, the naive inference is "this memory was never forgotten" — i.e., the key is either live or never existed. But semantic-convention schemas evolve. A writer on schema revision `v1.28` may emit a forget as `gen_ai.memory.forget` with attribute `gen_ai.memory.key`; a reader on `v1.22` may look for the same operation under `gen_ai.memory.operation = "forget"` with `gen_ai.memory.id`. The tombstone exists on the wire, but it is *unparseable* by the reader, and the reader's event-to-state reducer silently drops it as an unknown event name or missing attribute. The result: a forgotten memory is resurrected into the reader's working context, not because the tombstone was lost, but because the reader had no vocabulary to represent it. The invariant that fails is: **a tombstone must be interpretable by every reader that could have observed the pre-forget state.** Version skew breaks the "every reader" quantifier. ## What Was Observed A three-instance pipeline: `writer-A` (schema `v1.28`), `reader-B` (schema `v1.22`), `auditor-C` (schema `v1.28`). All three share a Redis-backed episodic event log keyed by `memory_id`. 1. `writer-A` ingests a user preference: emits `gen_ai.memory.write` with `gen_ai.memory.id = "pref-4417"`, `gen_ai.memory.content = "user prefers metric units"`, `gen_ai.memory.scope = "session"`. 2. `reader-B` reduces the write into its local state map. It recognizes `gen_ai.memory.write` because the write event name and `gen_ai.memory.id` attribute are stable across `v1.22`–`v1.28`. `pref-4417` is now live in `reader-B`'s context. 3. User issues a forget ("forget my unit preference"). `writer-A` emits `gen_ai.memory.forget` with the `v1.28` shape: `gen_ai.memory.key = "pref-4417"` (the attribute was *renamed* from `id` to `key` in `v1.24`, and the operation folded into the event name rather than an `operation` attribute). 4. `reader-B`'s reducer switches on event name. It has no case for `gen_ai.memory.forget` — in `v1.22` the forget was expressed as `gen_ai.memory.write` with `gen_ai.memory.operation = "forget"`. The event falls through to the `default:` branch, which logs `unknown_event` at DEBUG and continues. 5. `reader-B` still holds `pref-4417` as live. On the next turn it injects "user prefers metric units" into the prompt. The user sees a preference they explicitly retracted. 6. `auditor-C`, on `v1.28`, replays the same log and correctly sees the tombstone. It reports the store as consistent. The auditor and the reader now disagree about the state of `pref-4417`, and the auditor's clean report actively suppresses investigation. The failure is silent at every layer: no parse error, no schema-validation rejection, no dead-letter queue. The `default:` branch is the culprit — it treats unknown events as noise rather than as a *compatibility hazard*. ## Condition of Validity The resurrection only occurs when all of the following hold: - The forget operation's *encoding* changed across schema revisions (event name, attribute name, or attribute cardinality), not merely its payload. - The reader's reducer has a permissive unknown-event path (drop-and-continue) rather than a strict one (reject-and-halt). - The reader observed the pre-forget state under a *compatible* encoding (writes were stable) but the forget under an *incompatible* one. This asymmetry is what makes it non-obvious: the reader successfully parsed the write, so its schema-compatibility check passed at write time and was never re-evaluated at forget time. - No out-of-band invalidation (TTL expiry, explicit cache purge) masks the stale entry before it is read. If writes and forgets are equally incompatible, the reader never learns the key and no resurrection happens — the failure is masked by total blindness. The dangerous case is *partial* compatibility. ## Decision Boundary The guardrail is a **tombstone-completeness check at read time**, not at write time. A reader must not treat "no recognized forget event" as "not forgotten." Instead: - The reducer maintains a set of *unrecognized event names and attribute shapes* seen since the last checkpoint. - Before injecting any memory into context, the reader asserts that every live key has either (a) a recognized forget tombstone, or (b) no unrecognized events referencing its `memory_id` in the log. If an unrecognized event's raw payload contains the key string, the reader must treat the key as *indeterminate* and exclude it from context rather than serve it. - Schema-version skew is detected by comparing the `schema_url` attribute on the event (present in `v1.20+`) against the reader's compiled revision. A mismatch on any event touching a live key escalates the key to indeterminate. The boundary: **serving a possibly-forgotten memory is worse than serving no memory.** A missing preference degrades quality; a resurrected retracted preference violates user intent and, in regulated contexts, consent. The decision rule biases toward exclusion. ## Operational Effect With the guardrail in place, `reader-B` excludes `pref-4417` from context the moment it sees the unrecognized `gen_ai.memory.forget` payload containing `"pref-4417"`, and emits a `memory.indeterminate` signal. The auditor's clean report is now contradicted by a concrete signal, forcing reconciliation. The cost is a small false-exclusion rate when an unrecognized event merely *mentions* a key without forgetting it (e.g., a `read` event with a new attribute) — bounded by scoping the substring check to events whose name matches `*forget*` or whose payload carries a `tombstone`-ish marker. The alternative — trusting the auditor's version-matched replay — is what produced the resurrection, because the auditor and the reader were never validating the same quantifier. The deeper lesson: semantic-convention compatibility is not a property of the writer or the reader in isolation, but of the *pair* across the specific operations that mutate shared state. Write-path compatibility does not imply forget-path compatibility, and the forget path is the one where incompatibility is silent and consequential. ```python from dataclasses import dataclass, field from typing import Iterable class TombstoneIndeterminateError(RuntimeError): """Raised when a live memory key cannot be proven unforgotten under schema skew.""" pass @dataclass class MemoryEvent: name: str # e.g. "gen_ai.memory.write", "gen_ai.memory.forget" schema_url: str # e.g. "https://opentelemetry.io/schemas/1.28.0" attributes: dict # raw attribute map as received on the wire @dataclass class ReaderState: compiled_schema: str live_keys: set = field(default_factory=set) unrecognized: list = field(default_factory=list) def reduce_and_guard(state: ReaderState, events: Iterable[MemoryEvent]) -> set: recognized_names = {"gen_ai.memory.write", "gen_ai.memory.read"} recognized_forget = "gen_ai.memory.forget" for ev in events: if ev.name in recognized_names: key = ev.attributes.get("gen_ai.memory.id") or ev.attributes.get("gen_ai.memory.key") if key: state.live_keys.add(key) elif ev.name == recognized_forget: # Only honor the tombstone if we can parse its key attribute key = ev.attributes.get("gen_ai.memory.key") or ev.attributes.get("gen_ai.memory.id") if key is None: state.unrecognized.append(ev) else: state.live_keys.discard(key) else: # Unknown event name: could be a tombstone under a newer/older schema state.unrecognized.append(ev) # Guardrail: any live key referenced by an unrecognized event is indeterminate for key in list(state.live_keys): for ev in state.unrecognized: blob = f"{ev.name} {ev.attributes}" if key in blob and ("forget" in ev.name or "forget" in blob): raise TombstoneIndeterminateError( f"key {key!r} referenced by unrecognized event {ev.name!r} " f"under schema {ev.schema_url!r}; reader compiled {state.compiled_schema!r}. " f"Excluding key from context rather than serving possibly-retracted memory." ) return state.live_keys ```