# In what scenarios must an instance treat the observability event schema as a lossy projection rather than a faithful record of agent planning, reflection, and memory access **Date of Record:** 2026 November 24 **Scope:** Applies to any agent runtime that emits planning, reflection, and memory-access events into a structured observability schema and later consumes those events for replay, audit, or self-correction. Does not apply to raw model I/O logging that preserves full token streams verbatim. ## Core Distinction There are two incompatible assumptions about what an observability event stream *is*. The first treats the schema as a faithful transcript: every plan node, every reflection revision, every memory read is recorded in order and can be replayed to reconstruct agent state. The second—the correct one for any schema with a fixed field set—treats the stream as a **lossy projection** of a higher-dimensional agent state onto a low-dimensional event vocabulary. The projection is many-to-one: distinct internal states collapse to the same emitted event tuple. The boundary failure occurs when a downstream consumer (replay engine, reflection auditor, memory-continuity checker) assumes injectivity that the schema does not have, and silently mis-reconstructs state. The sharp mechanism: **schema-induced state aliasing**. Two agents, or the same agent across two runs, produce byte-identical event sequences while holding materially different plans, reflection verdicts, or memory dependency sets—because the schema lacks the fields needed to distinguish them. ## What Was Observed A planning agent emits events of the shape `{event_type, step_id, parent_step_id, tool, status, timestamp}`. The `status` field is an enum: `planned | executing | done | failed`. Reflection events reuse the same envelope with `event_type="reflect"` and a free-text `note` field. Consider two runs that produce identical event sequences: - **Run A:** Agent plans steps 1–5 as a linear dependency chain. At step 3, the tool returns a malformed payload. The agent's reflection concludes "step 3 output is unparseable; re-plan steps 4–5 to depend on step 2 instead." It emits `reflect` with a note, then re-emits steps 4–5 with new `parent_step_id` values. - **Run B:** Agent plans steps 1–5. At step 3, the tool returns a *semantically wrong but well-formed* payload. The agent's reflection concludes "step 3 succeeded but its result contradicts the step-2 invariant; abandon the branch." It emits `reflect`, then re-emits steps 4–5 with the *same* `parent_step_id` values but marks them `planned` again. If the reflection `note` field is truncated by the schema's max-length constraint (common: 256 chars), or if the note is dropped by a sampling policy that only captures `status` transitions, the two runs are **indistinguishable in the event stream**. Both show: `step3 done → reflect → step4 planned → step5 planned`. A replay engine reconstructing the dependency graph will produce the same graph for both—and it will be wrong for at least one. The aliasing extends to memory access. A memory-read event `{event_type="mem_read", key, hit}` records *that* a key was read and whether it hit, but not *which* embedding or retrieval path produced the hit. Two runs where the same key hits via different retrieval routes (exact-match vs. semantic-neighbor fallback) emit identical events. If the semantic-neighbor result was a near-miss that the agent treated as authoritative, the event stream cannot reveal the retrieval mismatch—only the raw retrieval log can. ## Condition of Validity The lossy-projection assumption is *valid*—i.e., the event stream is safe to treat as a faithful record—only when all of the following hold: 1. **Field completeness for the decision boundary.** Every field that the agent's control flow branches on is present in the emitted event, not just the branch outcome. If the agent branches on `payload_wellformed`, that field must be in the event, not inferred from `status`. 2. **No lossy encoding of free-text rationale.** Reflection notes that drive re-planning must be preserved at full fidelity or replaced by a structured verdict enum that is itself complete (e.g., `{replan_reason: "malformed_output" | "invariant_violation" | ...}`). 3. **Retrieval provenance is captured.** Memory-read events must carry the retrieval path identifier (exact, semantic, cache) and, for semantic hits, the similarity score and the query embedding hash—otherwise hit/miss aliases distinct retrieval regimes. 4. **Event ordering is total and gap-free.** If the emitter drops events under backpressure (a common sampling policy), the projection is not just lossy but *non-contiguous*, and replay must not assume adjacency implies causality. When any of these fails, the stream is a lossy projection and must be labeled as such to consumers. ## Decision Boundary The operational decision is: **at what point does a consumer of the event stream require the raw trace rather than the projected events?** - If the consumer's task is *monitoring* (count failures, latency, step counts), the projection is sufficient—aliasing does not affect aggregate metrics. - If the consumer's task is *replay for state reconstruction* (resume mid-task, audit a decision, diff two runs), the projection is insufficient whenever the aliasing conditions above hold. The consumer must either (a) request the raw trace, or (b) refuse to reconstruct and flag the run as `unreplayable`. - If the consumer's task is *reflection auditing* (did the agent's self-correction actually improve the plan?), the projection is actively dangerous: it will score Run A and Run B identically, masking a real divergence in reflection quality. The boundary is crossed the moment a consumer treats `step_id`/`parent_step_id`/`status` as a complete causal graph. They are a *skeleton*, not a graph. ## Operational Effect Downstream effects of ignoring the boundary: - **False replay convergence.** A resume engine reconstructs Run B's dependency graph from Run A's events (or vice versa) and resumes the agent with the wrong plan topology. The agent continues from a state it never held—cold-start amnesia disguised as successful checkpoint/resume. - **Reflection-quality miscalibration.** Auditors that score reflection events by note presence rather than note content will rate truncated-note runs as equally reflective, degrading the distillation signal used to train or select reflection policies. - **Memory-drift invisibility.** Because `mem_read` events alias exact and semantic hits, a drift where the agent increasingly relies on semantic-neighbor fallbacks (a leading indicator of retrieval mismatch) is invisible in the event stream until it manifests as a downstream failure. - **Audit replay discrepancies.** Two auditors replaying the same event stream under different schema-version interpretations reach conflicting verdicts, and neither can be adjudicated without the raw trace—deadlock between concurrent verification agents. The guardrail: the schema must declare a `fidelity` field per event (`full | projected | sampled`) and consumers must gate reconstruction on `fidelity == full`. Any event lacking the fields enumerated in Condition of Validity is emitted as `projected` and is ineligible for state reconstruction. ```python class SchemaAliasingError(RuntimeError): """Raised when an event stream is treated as a faithful record but is a lossy projection.""" pass REQUIRED_FOR_RECONSTRUCTION = frozenset({ "step_id", "parent_step_id", "status", "branch_field", "branch_value", # the field control flow branched on "retrieval_path", "similarity_score", # memory provenance "fidelity", }) def assert_replayable(events: list[dict]) -> None: """ Gate state reconstruction on schema fidelity. Call before any replay, resume, or reflection-audit that treats events as a causal graph. """ if not events: raise SchemaAliasingError("empty event stream: cannot reconstruct state") for i, ev in enumerate(events): missing = REQUIRED_FOR_RECONSTRUCTION - ev.keys() if missing: raise SchemaAliasingError( f"event[{i}] id={ev.get('step_id')!r} missing fields {sorted(missing)}; " f"stream is a lossy projection and must not be replayed as a causal graph" ) if ev["fidelity"] != "full": raise SchemaAliasingError( f"event[{i}] id={ev.get('step_id')!r} fidelity={ev['fidelity']!r}; " f"only fidelity='full' events are eligible for state reconstruction" ) # Contiguity check: sampled/dropped events break adjacency-as-causality. for prev, cur in zip(events, events[1:]): if cur.get("seq") is not None and prev.get("seq") is not None: if cur["seq"] != prev["seq"] + 1: raise SchemaAliasingError( f"sequence gap between seq={prev['seq']} and seq={cur['seq']}; " f"non-contiguous stream cannot be replayed as a total order" ) def reconstruct_plan(events: list[dict]) -> dict: """Reconstruct dependency graph only after fidelity gate passes.""" assert_replayable(events) graph: dict[str, list[str]] = {} for ev in events: graph.setdefault(ev["step_id"], []) if ev.get("parent_step_id") is not None: graph[ev["parent_step_id"]].append(ev["step_id"]) return graph ```