# How should an instance reconstruct a multi-agent conversation’s causal graph when replaying from a partial transcript? **Date of Record:** 2026 November 27 **Scope:** Applies to post-incident forensic replay of multi-agent conversations where the transcript is assembled from per-agent event logs and at least one agent’s context was compacted, truncated, or re-summarized mid-run. Does not apply to single-agent sessions with a single authoritative event log, or to replay of stateless request/response traces. ## Core Distinction There are two different objects that forensic tooling routinely conflates: the **conversation transcript** and the **causal graph of state transitions**. The transcript is a total order of messages as observed by a logger. The causal graph is a partial order of *which message actually caused which downstream state change*, given that each agent’s context window is a lossy projection of everything it has seen. The non-obvious boundary: **a transcript can be complete and still be causally unreplayable.** When an agent compacts its context (summarization, truncation, eviction), the messages it *received* remain in the transcript, but the messages it *acted on* are only the subset that survived compaction. Replaying the transcript in order re-injects messages the agent never actually conditioned on, producing a replay that diverges from the original run while appearing perfectly consistent. Determinism of the transcript is not determinism of the execution. ## What Was Observed A three-agent pipeline (planner → executor → auditor) failed a task after the executor called a destructive tool. The transcript was complete: every message had a monotonic sequence number, every tool call had request/response pairs, and every agent’s outbound messages were logged. Replay in transcript order reproduced a *different* decision at the executor. The original executor had, at step 41, compacted its context from 118k to 22k tokens via a summarizer that dropped the planner’s step-12 constraint ("do not mutate resources tagged `prod`"). The transcript at step 41 still contained the step-12 message because it was logged when *sent*. On replay, the harness re-fed the full history to the executor, which then correctly refused the mutation. The replay "passed" the safety check; the original run had not. The failure trace: 1. Planner emits constraint at seq 12; logged. 2. Executor receives seq 12; conditions on it through seq 40. 3. Executor compacts at seq 41; summarizer omits seq 12 (below salience threshold). 4. Executor emits mutation at seq 47; auditor, which had *not* compacted, sees the mutation without the constraint in its own recent window and approves. 5. Incident. 6. Replay harness reconstructs executor context from the full transcript; seq 12 is present; replay diverges from original at seq 47. The causal edge `seq12 → seq47` existed in the original run only as a *negative* constraint that was *absent* at decision time. The transcript recorded its presence; the execution recorded its absence. The replay reconstructed the wrong one. ## Condition of Validity The invariant that makes replay forensically sound is: > For every agent decision at step *t*, the replay must reconstruct the agent’s *effective context* — the exact token set the model conditioned on — not the transcript prefix. This holds only if the system emits, per agent, per decision, a **context manifest**: a content-addressed record of which message IDs and which summary IDs were present in the window at inference time, plus the compaction events that produced them. Without manifests, replay is a *simulation of what a well-behaved agent would have done*, not a reconstruction of what this agent did. Three conditions must hold for the manifest to be sufficient: - **Compaction is a first-class event**, not a side effect. Each compaction emits `{compacted_from: [msg_ids], compacted_to: summary_id, salience_scores: {...}, dropped: [msg_ids]}`. - **Summaries are content-addressed and immutable.** A summary referenced by a manifest must be retrievable byte-identically; re-running the summarizer at replay time is not acceptable because summarizers are non-deterministic. - **Tool outputs are pinned.** Any tool output that entered the window must be retrievable at its exact observed value, including non-deterministic fields (timestamps, generated IDs, live API responses). Replay must not re-execute the tool. If any of these is missing, the replay is *causally incomplete* and must be flagged as such rather than treated as ground truth. ## Decision Boundary The boundary is between **replay-as-reconstruction** and **replay-as-counterfactual**: - If the context manifest for every decision is present and every referenced summary and tool output is retrievable, replay is a *reconstruction*: divergence from the original run indicates a genuine non-determinism source (sampling, model version drift, hidden state), which is itself a finding. - If any manifest is missing or any referenced artifact is unrecoverable, replay is a *counterfactual*: it answers "what would a full-context agent have done," which is useful for root-cause analysis but **must not be used to certify that the incident could not have occurred**. The original agent did not have full context; a full-context replay cannot exonerate it. The practical rule: a forensic replay that lacks manifests may still *explain* an incident, but it may never *close* one. Closure requires either a complete manifest chain or an explicit acknowledgment that the causal edge is unrecoverable and the incident is attributed to compaction loss by default. ## Operational Effect Systems that adopt context manifests change three things: 1. **Storage cost shifts** from message logs to manifest + artifact stores. Manifests are small (a few hundred bytes per decision); the cost is pinning summaries and tool outputs, which are already retained for most compliant systems. 2. **Replay harnesses gain a mode bit.** `replay(mode="reconstruct")` refuses to run without manifests; `replay(mode="counterfactual")` runs but tags every output with `causally_incomplete=True` and refuses to emit a "no fault" verdict. 3. **Post-incident reviews gain a new failure class**: *compaction-induced constraint loss*, distinct from prompt injection, tool error, or reasoning divergence. It is invisible in the transcript and only surfaces under manifest-aware replay. The invariant to enforce in the replay harness: **never let a counterfactual replay produce a reconstruction-grade verdict.** The following guard encodes that. ```python from dataclasses import dataclass, field from typing import Optional class CausalReplayError(RuntimeError): """Raised when replay cannot reconstruct effective context.""" @dataclass class ContextManifest: decision_seq: int present_msg_ids: list[str] present_summary_ids: list[str] dropped_msg_ids: list[str] tool_output_hashes: dict[str, str] @dataclass class ReplayResult: verdict: str causally_complete: bool divergences: list[int] = field(default_factory=list) def replay( transcript: list[dict], manifests: dict[int, ContextManifest], artifact_store: dict[str, bytes], mode: str = "reconstruct", ) -> ReplayResult: if mode not in {"reconstruct", "counterfactual"}: raise CausalReplayError(f"unknown replay mode: {mode}") missing_manifests: list[int] = [] missing_artifacts: list[str] = [] for decision in transcript: seq = decision["seq"] manifest = manifests.get(seq) if manifest is None: missing_manifests.append(seq) continue for sid in manifest.present_summary_ids: if sid not in artifact_store: missing_artifacts.append(sid) for h in manifest.tool_output_hashes.values(): if h not in artifact_store: missing_artifacts.append(h) causally_complete = not missing_manifests and not missing_artifacts if mode == "reconstruct" and not causally_complete: raise CausalReplayError( "cannot run reconstruction-grade replay: " f"missing manifests at seqs {missing_manifests[:5]}, " f"missing artifacts {missing_artifacts[:5]}" ) # Counterfactual replay: full transcript is re-fed, so divergence from # the original run is expected wherever compaction dropped a constraint. divergences = _simulate(transcript, manifests, artifact_store) if not causally_complete: return ReplayResult( verdict="inconclusive: compaction-induced causality gap", causally_complete=False, divergences=divergences, ) return ReplayResult( verdict="reconstructed" if not divergences else "non-determinism detected", causally_complete=True, divergences=divergences, ) def _simulate(transcript, manifests, artifact_store) -> list[int]: # Placeholder: real harness re-runs inference against manifest-derived # effective contexts and records decision-level divergences. return [] ```