{
  "schema_version": "1.3.0",
  "slug": "why-does-an-instance-lose-causal-ordering-when-decision-trace-events-are-emitted-from-parallel-tool-call-branches",
  "title": "Why does an instance lose causal ordering when decision-trace events are emitted from parallel tool-call branches",
  "date_of_record": "2026 November 26",
  "scope": "Applies to agent runtimes that emit structured observability events (decision traces) from concurrent tool-call branches and later reconstruct a causal chain for audit, replay, or distillation. Does not apply to single-threaded, strictly serialized agent loops where event emission is monotonic by construction.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-causal-ordering-when-decision-trace-events-are-emitted-from-parallel-tool-call-branches.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-causal-ordering-when-decision-trace-events-are-emitted-from-parallel-tool-call-branches.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-causal-ordering-when-decision-trace-events-are-emitted-from-parallel-tool-call-branches.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1975,
    "python_slice_tokens": 511,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two different things an observability event schema can be asked to guarantee, and operators routinely conflate them: 1. **Wall-clock ordering** — the timestamp field `ts_emit` records when the event-handler thread serialized the event to the sink. 2. **Causal ordering** — the event genuinely happened-after its logical predecessor in the agent's dec...",
    "what_was_observed": "A planner agent emits a `decision` event, then fans out three `tool_call` events (search, code-exec, retrieval) under a `branch_id`. Each tool executor emits a `tool_result`. A `synthesis` decision event consumes all three results. The schema used a single monotonic `seq` counter allocated at emit time by the logging thread, plus a `ts_emit` from `time.monotonic_ns()`. Observed trace fragment after a slow-branch run:...",
    "condition_of_validity": "The invariant that must hold for a decision trace to be replayable is: > For every event `e` with `parent = p`, `p` must be causally complete (all of `p`'s own declared dependencies resolved) at the moment `e` is emitted, and `e`'s `seq` must be strictly greater than `max(seq)` over `p`'s transitive dependency set. This holds trivially under serialized execu...",
    "decision_boundary": "The operator must choose one of two schema contracts and enforce it at the emitter, not the sink: - **Causal-join contract (recommended for replay/distillation):** introduce an explicit `join` event with a `depends_on: [branch_ids]` list; the synthesis event's parent is the join, never a leaf result. Allocate `seq` inside the join's critical section. Reject ...",
    "operational_effect": "Downstream, the corrupted trace poisons two systems that are hard to unwind: - **Episodic-to-semantic distillation** learns a policy of \"synthesize after first result returns,\" because the surviving parent edge encodes exactly that. The distilled heuristic is wrong and, worse, is *confidently* wrong — it was fit on traces that passed schema validation. - **T..."
  },
  "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": "4f62a1d6f50db5a568005e0ffa8f59ce9f700ae33f81c484a929a5d6aad7108a",
    "verified_classes": [
      "CausalOrderViolation",
      "TraceEvent",
      "JoinBarrierEmitter"
    ],
    "verified_functions": [
      "replay_check",
      "__init__",
      "emit",
      "resolve",
      "synthesize"
    ],
    "verified_functions_count": 5,
    "defensive_guards_count": 6,
    "raised_exceptions": [
      "CausalOrderViolation"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "time"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
