# What structural signals indicate a memory-forget observability attribute schema has silently desynchronized from the memory store's actual deletion semantics **Date of Record:** 2026 November 25 **Scope:** Applies to any agent runtime that emits structured observability attributes (span attributes, event fields, log records) for memory read/write/forget operations against a persistent memory store, where the store and the telemetry pipeline are owned by different subsystems and versioned independently. Does not apply to stateless single-turn inference with no externalized memory, nor to systems where the memory store itself emits its own authoritative audit stream that is never re-derived by the agent layer. ## Core Distinction The failure mode here is not "memory was forgotten" or "telemetry was dropped." It is **semantic desynchronization**: the observability schema continues to emit well-formed, schema-valid `forget` attributes whose *values* describe a deletion model the store no longer implements. Every downstream consumer—dashboards, retention auditors, replay verifiers—reads a green, populated attribute set and concludes that a forget succeeded, when the store actually performed a soft-delete, a tombstone, a TTL scheduling, or a no-op-on-missing-key. The distinction that matters: a **hard invariant** (the record is unrecoverable from the store) versus a **schema-asserted invariant** (the attribute `forget.mode = "hard"` was emitted). These two are coupled only by convention. Nothing in the type system, the schema validator, or the wire format enforces that the attribute value tracks the store's real behavior. When the store changes—say a `delete()` call is reimplemented to write a tombstone and defer physical erasure to a compaction job—the attribute emitter, which was written against the old contract, keeps emitting `hard`. The schema is still valid. The observability is now a lie. The non-obvious part: **the desync produces no errors, no dropped spans, and no schema violations.** It is invisible to every standard observability health check because the attributes are *more* consistent than reality, not less. You detect it only by cross-checking structural signals against ground truth in the store. ## What Was Observed A memory-bearing agent fleet emitted forget spans with the following attribute set (abbreviated): ``` memory.op = "forget" memory.key_hash = "sha256:9f2c..." memory.mode = "hard" # enum: hard | soft | expire memory.acked = true memory.tombstone = false memory.records_removed = 1 memory.post_read_probe = "absent" # emitter's own read-after-delete ``` For eleven days this looked healthy. Then a retention audit sampled 4,000 keys marked `mode="hard"`, `records_removed=1` and attempted a direct store read. **612 (15.3%) were still readable**—returning the original payload with a `deleted_at` field populated. The store had shipped a change: `delete()` now wrote a soft-delete marker and enqueued physical erasure, but the physical erasure job was rate-limited and backed up. The agent-layer emitter had not changed. Three structural signals, each individually ambiguous, together identified the desync: 1. **`post_read_probe` was self-referential, not adversarial.** The emitter's probe used the same client handle and the same read path that honored soft-delete visibility rules for the writer. It read the key back and saw "absent" because the writer's view filtered soft-deleted records. The probe confirmed the emitter's own model, not the store's global state. A probe that cannot see tombstones cannot detect tombstoning. 2. **`tombstone=false` was constant across the entire corpus.** A truthfully instrumented soft-delete would set `tombstone=true` on at least the fraction of deletes that took the new path. A boolean attribute that never flips across 4,000 samples of a code path that provably does flip in the store is a *frozen attribute*—the signature of an emitter reading a default, not a state. 3. **`records_removed` was always exactly `1`, even for keys the store reported as already-absent.** The store's new path returned `0` for no-op deletes; the emitter hardcoded `1` on any non-exception return. The attribute measured "the call did not throw," not "a record was removed." The tell was not any single value. It was the **joint distribution**: a `mode="hard"` claim whose corroborating attributes (`tombstone`, `records_removed`, `post_read_probe`) were all *degenerate*—constant, self-referential, or derived from the call's return type rather than its effect. Real deletion is noisy; a schema that reports it as noise-free is reporting its own assumptions. ## Condition of Validity The `forget` attribute schema is valid—i.e., its values may be trusted as descriptions of store state—only when all of the following hold simultaneously: - **Independent read path.** The `post_read_probe` (or any confirming attribute) must be evaluated through a client whose visibility rules are not the writer's. If the probe shares the writer's handle, session, or transaction, it observes the writer's view and cannot falsify the write's claim. Validity requires `probe_client_id != writer_client_id` and, stronger, that the probe bypasses any per-session filter. - **Non-degenerate corroboration.** At least one attribute in the forget set must be capable of taking more than one value *and must actually have done so* across the observation window. A schema whose confirming fields are constant is not confirming; it is asserting. Treat any attribute that has held a single value across N > 100 operations as unverified until proven otherwise. - **Effect-derived, not return-derived, counts.** `records_removed` must be sourced from a store-reported mutation count (rows affected, tombstones written, bytes unlinked), not from "the call returned without raising." Return-type-derived counts are the single most common source of phantom success. - **Version pinning between emitter and store.** The emitter's notion of `mode` enum values must be pinned to a store contract version, and a store contract bump must mechanically invalidate the emitter (fail closed) rather than silently continue. Convention-based coupling does not survive an independent deploy. When any of these fails, the attribute set remains *syntactically* valid but its *semantic* claim—"this record is gone"—is unsupported. The schema has desynchronized. ## Decision Boundary The operative question is: **when does a forget attribute set cross from "trustworthy description" to "self-certifying fiction"?** Draw the boundary at the first operation where the confirming attributes are *unable to disagree* with the primary claim. Concretely: - If `post_read_probe` is computed by the same code path that just performed the delete, and that path's read honors the same visibility filter, the probe is *structurally incapable* of returning `present` for a soft-deleted key. At that point the attribute carries zero information—it is a tautology wearing a measurement's clothes. **Boundary crossed.** - If `mode` is set from a local constant or a config default rather than from a store response field, it describes the emitter's intent, not the store's action. **Boundary crossed.** - If `records_removed` is derived from control flow (`returned normally → 1`) rather than a store-reported count, it measures the absence of exceptions, not the presence of deletion. **Boundary crossed.** Before the boundary, you may alert on `mode="soft"` rates, tombstone accumulation, and probe mismatches as genuine operational signals. After the boundary, every such alert is theater: the attributes are guaranteed self-consistent because they are all derived from the same unfalsifiable premise. The correct response is not to tune thresholds but to **stop trusting the attribute set and route to an out-of-band verifier** that reads the store through an independent, filter-free client and reconciles counts. The subtlety: you cannot detect the boundary by watching the attributes alone—they look *better* after the crossing, because the degenerate fields never disagree. You detect it by watching the **variance** of the corroborating fields. A confirming attribute that has stopped varying is the structural signal that the boundary was crossed at some earlier, unobserved operation. ## Operational Effect Once desynchronized, the failure compounds along the memory lifecycle rather than staying local to forget: - **Retention audits pass falsely.** Compliance and data-minimization checks that read `mode="hard"` conclude erasure occurred. Physical bytes persist. The audit's own green dashboard becomes the evidence used to certify a violation. - **Replay and distillation inherit ghosts.** An episodic-to-semantic distillation job that trusts forget markers to exclude deleted episodes will re-ingest records the store still holds, resurrecting content the operator believed purged. The distillation loss is not random—it is *systematically biased toward deleted material*, the worst possible bias. - **Cold-start state reconstruction diverges.** An agent resuming from a checkpoint that assumes forgotten keys are absent will read a store that still serves them, producing a context the checkpoint's logic never anticipated—stale memory drift with a forged provenance of "this was deleted." - **The desync is self-healing-looking and therefore self-perpetuating.** Because the attributes never throw, never drop, and never violate schema, no alert fires and no engineer investigates. The mean time to detection is bounded only by an external audit that does not trust the telemetry—which, by construction, most systems do not have. The architectural guardrail is a **falsifiability invariant**: every forget operation must emit at least one attribute sourced from an independent principal (separate client, filter-free read, or store-authoritative mutation count) that is *capable* of contradicting the primary claim, and the pipeline must track the historical variance of that attribute and raise when it collapses to a constant. Observability that cannot be wrong is not observability; it is a signature of the system agreeing with itself. ```python import hashlib from dataclasses import dataclass, field from typing import Callable, Optional class ForgetSchemaDesyncError(RuntimeError): """Raised when a forget attribute set is structurally incapable of falsifying its own claim of deletion (degenerate corroboration).""" pass @dataclass class ForgetAttributes: key_hash: str mode: str # "hard" | "soft" | "expire" acked: bool tombstone: bool records_removed: int post_read_probe: str # "absent" | "present" probe_client_id: str writer_client_id: str records_removed_from_store: bool # True if sourced from store mutation count @dataclass class StoreView: """Independent, filter-free view of the store. The only trustworthy oracle.""" read: Callable[[str], Optional[bytes]] def validate_forget_claim(attrs: ForgetAttributes, store: StoreView) -> None: # 1. Probe must be an independent principal, not the writer's own view. if attrs.probe_client_id == attrs.writer_client_id: raise ForgetSchemaDesyncError( f"post_read_probe for {attrs.key_hash} used writer client " f"{attrs.writer_client_id!r}; probe cannot observe tombstones " f"and is structurally unable to falsify the delete claim." ) # 2. records_removed must be effect-derived, not return-derived. if not attrs.records_removed_from_store: raise ForgetSchemaDesyncError( f"records_removed for {attrs.key_hash} derived from control flow, " f"not a store-reported mutation count; value {attrs.records_removed} " f"measures absence of exception, not presence of deletion." ) # 3. mode="hard" must be corroborated by a filter-free read. if attrs.mode == "hard": payload = store.read(attrs.key_hash) if payload is not None: raise ForgetSchemaDesyncError( f"key {attrs.key_hash} claimed mode='hard' but independent " f"store read returned {len(payload)} bytes; attribute schema " f"has desynchronized from store deletion semantics." ) if attrs.tombstone: raise ForgetSchemaDesyncError( f"key {attrs.key_hash} claimed mode='hard' but tombstone=true; " f"store performed soft-delete while emitter reported hard." ) def check_corroboration_variance(history: list[ForgetAttributes], window: int = 100) -> None: """A confirming attribute that never varies is an assertion, not a measurement.""" if len(history) < window: return recent = history[-window:] tombstone_values = {a.tombstone for a in recent} if len(tombstone_values) == 1 and len(recent) >= window: # Constant across a full window: flag as unverified, not healthy. raise ForgetSchemaDesyncError( f"attribute 'tombstone' held constant value {tombstone_values.pop()!r} " f"across {window} forget operations; degenerate corroboration — " f"emitter is reading a default, not store state." ) ```