{
  "schema_version": "1.3.0",
  "slug": "in-what-scenarios-must-an-instance-reconcile-non-deterministic-tool-side-effects-before-replaying-an-otel-trace-graph-for-deterministic-debugging",
  "title": "In what scenarios must an instance reconcile non-deterministic tool side-effects before replaying an OTel trace graph for deterministic debugging",
  "date_of_record": "2026 November 22",
  "scope": "Applies to post-hoc replay of agent trajectories reconstructed from OpenTelemetry span graphs (one trace = one agent run) where the replay harness re-invokes tools to reproduce a divergence. Does not apply to pure-log replay (read-only inspection) or to traces where all tool spans carry signed, replayable fixtures.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-reconcile-non-deterministic-tool-side-effects-before-replaying-an-otel-trace-graph-for-deterministic-debugging.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-reconcile-non-deterministic-tool-side-effects-before-replaying-an-otel-trace-graph-for-deterministic-debugging.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-reconcile-non-deterministic-tool-side-effects-before-replaying-an-otel-trace-graph-for-deterministic-debugging.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1566,
    "python_slice_tokens": 228,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "A trace graph is a *record of what happened*, not a *recipe for what will happen*. The OTel span tree preserves causal ordering via `parent_span_id`, and each tool span carries attributes (`tool.name`, `tool.args`, `tool.result_hash`, `gen_ai.usage.*`). Deterministic replay assumes that feeding the recorded `tool.args` back into the tool reproduces `tool.res...",
    "what_was_observed": "A three-step agent trajectory (trace `4f9a…`) failed at step 3 with a `ToolResultMismatch`. The engineer replayed the trace. The replay: 1. **Step 1** (`write_file path=state.json content={\"n\":0}`) — succeeded, re-wrote the file. But the file already contained `{\"n\":0}` from the *original* run, so the write was a no-op. `result_hash` matched. Green. 2. **Step 2** (`append_file path=state.json content={\"n\":+1}`) — the...",
    "condition_of_validity": "Replay is valid if and only if, for every tool span `s_k` in the trace, one of the following holds at the moment `s_k` is re-invoked: - **Purity:** `s_k` is declared pure (no write, no clock, no network egress) and its `tool.result_hash` is verified equal after re-invocation. - **Fixture substitution:** `s_k` carries a recorded `tool.result` payload and the ...",
    "decision_boundary": "The decision to *replay* versus *abstain* hinges on a single bit per tool span: **is the effect closure empty or neutralized?** The non-obvious boundary: a span can *look* pure (returns success, deterministic-looking result) while being mutating. The `append_file` above passed every local check. Purity must be **declared by the tool manifest**, not inferred ...",
    "operational_effect": "When the harness enforces effect-closure: 1. **False traces are rejected, not debugged.** The `ToolResultMismatch` is attributed to the *original* run only if replay is valid; otherwise the harness raises `NonReplayableEffect` and the engineer is forced to obtain a fixture or a snapshot. The two-hour misdiagnosis becomes a one-line error. 2. **Divergence att..."
  },
  "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": "3f3495828171cc0ca9faa1577cd6b0e8622d4e13da166f76eb3bf5faa652cc1c",
    "verified_classes": [
      "NonReplayableEffect",
      "Span"
    ],
    "verified_functions": [
      "assert_effect_closed",
      "__init__"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 1,
    "raised_exceptions": [
      "NonReplayableEffect"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
