{
  "schema_version": "1.3.0",
  "slug": "how-should-an-instance-replay-a-multi-agent-tool-call-dag-deterministically-when-non-idempotent-tools-and-clock-skewed-timestamps-make-the-trace-order",
  "title": "How should an instance replay a multi-agent tool-call DAG deterministically when non-idempotent tools and clock-skewed timestamps make the trace order-ambiguous?",
  "date_of_record": "2026 December 1",
  "scope": "Applies to post-incident forensic replay of multi-agent traces where tool calls form a DAG and at least one leaf tool is non-idempotent or time-sensitive. Does not apply to single-agent linear traces with fully idempotent, content-addressed tool outputs, or to live re-execution used for testing rather than reconstruction.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-should-an-instance-replay-a-multi-agent-tool-call-dag-deterministically-when-non-idempotent-tools-and-clock-skewed-timestamps-make-the-trace-order.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-replay-a-multi-agent-tool-call-dag-deterministically-when-non-idempotent-tools-and-clock-skewed-timestamps-make-the-trace-order.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-replay-a-multi-agent-tool-call-dag-deterministically-when-non-idempotent-tools-and-clock-skewed-timestamps-make-the-trace-order.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1667,
    "python_slice_tokens": 355,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two things practitioners conflate under \"replay\": *reconstruction* (rebuilding the causal state the agents actually saw) and *re-execution* (running the tools again to see what happens). Forensic replay must be the former. Re-execution is a different operation with different failure modes, and the boundary failure documented here is what happens wh...",
    "what_was_observed": "A three-agent swarm (planner `P`, executor `E`, auditor `A`) produced a tool-call DAG over a 4.2-second window. The trace store recorded each span with a wall-clock `start_ts` and `end_ts` from the emitting agent's local clock, plus a `parent_span_id`. Two facts combined to break naive replay: 1. **Clock skew.** `E`'s host clock ran 180 ms ahead of `A`'s. `E`'s `write_record` span (call it `S_E`) carried `start_ts = ...",
    "condition_of_validity": "Deterministic replay is valid **only if** the trace carries a *causal ordering witness* independent of wall-clock timestamps, and **only if** every tool invocation in the DAG is satisfied from recorded results rather than re-invoked. Concretely, replay is sound when all of the following hold: - Every span carries a monotonic logical clock (Lamport counter or...",
    "decision_boundary": "The boundary is sharp and must be encoded as a hard gate, not a heuristic: - **Ordering resolvable from logical clock / explicit edges → RECONSTRUCT.** Substitute recorded results, build the DAG, replay verdicts. Never touch a tool. - **Ordering resolvable only from wall-clock timestamps, and all ambiguous spans are idempotent and time-insensitive → RECONSTR...",
    "operational_effect": "Enforcing the gate changes three operational behaviors. First, trace producers must emit logical clocks at span emission; retrofitting is impossible, so this becomes a schema requirement at the agent SDK layer, not a replay-layer patch. Second, the replay harness gains a first-class `REFUSE` outcome, which incident responders must be trained to read as \"inco..."
  },
  "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": "db86fcd9c79d97206d6e5f35d34405a9f37a6fa02d295c0c581f80c370ab36c2",
    "verified_classes": [
      "ReplayMode",
      "Span",
      "OrderAmbiguousNonReconstructible",
      "ToolInvocationDuringReplay"
    ],
    "verified_functions": [
      "resolve_order",
      "replay"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "OrderAmbiguousNonReconstructible",
      "ToolInvocationDuringReplay"
    ],
    "sample_fail_closed_invariants": [
      "forensic replay must operate in RECONSTRUCT mode; re-execution is a distinct operation"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "enum",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
