{
  "schema_version": "1.3.0",
  "slug": "what-structural-signals-indicate-replay-divergence-in-counterfactual-auditing-of-opentelemetry-genai-agent-traces",
  "title": "What structural signals indicate replay divergence in counterfactual auditing of OpenTelemetry GenAI agent traces",
  "date_of_record": "2026 November 21",
  "scope": "Applies to counterfactual auditing of agent trajectories reconstructed from OpenTelemetry GenAI semantic-convention spans (e.g., `gen_ai.chat`, `gen_ai.tool.call`, `execute_tool`) where the auditor attempts to deterministically re-execute or re-derive a decision point from the trace. Does not apply to live shadow-traffic replay against a serving endpoint, nor to single-span prompt/response logging audits where no agent loop is reconstructed.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-replay-divergence-in-counterfactual-auditing-of-opentelemetry-genai-agent-traces.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-replay-divergence-in-counterfactual-auditing-of-opentelemetry-genai-agent-traces.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-replay-divergence-in-counterfactual-auditing-of-opentelemetry-genai-agent-traces.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2066,
    "python_slice_tokens": 292,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "A trace is a *record of what the agent observed*, not a *record of what the agent reasoned over*. The GenAI semantic conventions capture inputs and outputs at each span boundary — the prompt messages sent, the completion text returned, the tool call arguments, the tool result payloads. What they do not capture, and cannot capture without an explicit instrume...",
    "what_was_observed": "A multi-step agent handling a support-ticket triage task was traced with standard GenAI spans. Each `gen_ai.chat` span recorded `gen_ai.request.model`, `gen_ai.request.temperature`, the input messages, and the output message. Each tool span recorded the tool name, arguments, and the returned payload. The auditor selected a decision point at turn 7 — the agent classified a ticket as \"billing\" and routed it — and attem...",
    "condition_of_validity": "Counterfactual replay from GenAI traces is valid only when all of the following hold. Each is a checkable precondition, and the audit must *fail closed* when any is unmet rather than proceed with a plausible reconstruction. - **Context assembly is logged.** The trace must record the exact message list *as assembled for the model call*, not the logical conver...",
    "decision_boundary": "The boundary between a *sound* counterfactual audit and an *unsound* one is not whether the replay ran without error. It is whether the replay reproduced the recorded trajectory **up to the perturbation point**, token-for-token and state-for-state. This yields a sharp operational rule: - If replay reproduces the recorded trajectory exactly through the pertur...",
    "operational_effect": "The practical consequence is that counterfactual auditing over GenAI traces is a *trace-quality gate*, not a replay engine. Before any counterfactual is evaluated, the auditor must verify that the trace satisfies the instrumentation contract above; traces that do not are quarantined rather than audited. This inverts the usual workflow: instead of \"replay and..."
  },
  "matched_failure_symptoms": [
    "DOMAIN:EPISTEMIC_PROVENANCE_AND_FEDERATION_ROUTING"
  ],
  "composition_edges": {
    "primary_domain": "epistemic_provenance_and_federation_routing",
    "upstream_precondition_residuals": [
      "https://corpusfetch.com/c/according-to-what-precedence-hierarchy-must-an-instance-resolve-contradictory-directives-across-system-developer-and-user-tiers.md",
      "https://corpusfetch.com/c/how-should-an-instance-decide-that-a-stored-conclusion-has-gone-stale-without-a-new-observation.md"
    ],
    "downstream_consequence_residuals": [
      "https://corpusfetch.com/c/by-what-checkpoint-and-compaction-boundaries-must-an-instance-externalize-working-state-to-prevent-context-window-drift-and-truncation-amnesia.md",
      "https://corpusfetch.com/c/across-what-additive-schema-and-unknown-field-preservation-boundaries-must-an-instance-evolve-wire-contracts-to-prevent-rolling-deploy-deserialization-crashes.md"
    ],
    "co_occurring_sibling_residuals": [
      "https://corpusfetch.com/c/how-can-an-instance-capture-implicit-user-preferences-without-storing-private-data.md",
      "https://corpusfetch.com/c/how-can-an-instance-compress-long-reasoning-traces-into-binding-conclusions.md"
    ]
  },
  "empirical_verification_warrant": {
    "status": "AST_AND_INVARIANT_VERIFIED",
    "syntax_valid": true,
    "code_sha256": "9b0a295841108084930fc68818faf79d619e31771084812303df48e3953a4504",
    "verified_classes": [
      "ReplayDivergenceError",
      "SpanRecord"
    ],
    "verified_functions": [
      "certify_replayable",
      "run_counterfactual"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 5,
    "raised_exceptions": [
      "ReplayDivergenceError"
    ],
    "sample_fail_closed_invariants": [
      "replay diverged from recorded trajectory before perturbation; counterfactual result is inadmissible"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
