{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-causal-span-linking-from-silently-collapsing-in-multi-agent-genai-traces",
  "title": "Which invariants prevent causal span linking from silently collapsing in multi-agent GenAI traces",
  "date_of_record": "2026 November 17",
  "scope": "Applies to distributed tracing of multi-agent LLM systems where agent invocations are modeled as nested spans with explicit parent/child links and causal (happens-before) edges derived from span timestamps plus explicit link attributes. Does not apply to single-agent request traces, nor to systems that rely solely on wall-clock ordering without a trace-context propagation mechanism.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-causal-span-linking-from-silently-collapsing-in-multi-agent-genai-traces.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-causal-span-linking-from-silently-collapsing-in-multi-agent-genai-traces.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-causal-span-linking-from-silently-collapsing-in-multi-agent-genai-traces.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1437,
    "python_slice_tokens": 369,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The common assumption is that a span hierarchy is a tree: every span has exactly one parent, and the parent's start time precedes the child's. In multi-agent systems this is false in two independent ways. First, an agent turn is frequently *fan-in*: a supervisor span may have N children that are themselves agents, each of which may be re-entered, retried, or...",
    "what_was_observed": "In a three-tier supervisor/worker/critic pipeline, a worker span was emitted with `parent_span_id` pointing at the supervisor, but its `start_time` was 40 ms *before* the supervisor span's `start_time`. The cause was asynchronous span creation: the worker's OpenTelemetry span was started inside the worker process before the propagation header from the supervisor was flushed, so the parent ID was correct but the clock...",
    "condition_of_validity": "The tree invariant (unique parent, parent.start ≤ child.start) is valid only when span creation is synchronous with dispatch and propagation headers are flushed before the child begins work. The causal invariant (edge u→v iff u ends before v starts *and* u's output is consumed by v) is valid only when the trace carries explicit causal link attributes (`link....",
    "decision_boundary": "When a span's `start_time` precedes its parent's `start_time`, do not silently reorder. Treat it as one of two cases: (a) async span start with correct propagation—repair by setting the child's causal predecessor to the parent's *dispatch* event, not the parent's start, and record a `clock_skew_corrected` attribute; or (b) genuine cross-tree handoff—do not f...",
    "operational_effect": "Enforcing this boundary changes the trace schema: spans gain an optional `causal_predecessor_id` distinct from `parent_span_id`, and validators reject any trace where a causal edge lacks either a matching parent edge or an explicit link record. The practical effect is that replay harnesses can distinguish \"the model was nondeterministic\" from \"the trace lied..."
  },
  "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": "f2122d63aa9d7f4bab8f122c27181b7e1d07b76f7b1813520920fb49152080df",
    "verified_classes": [
      "CausalLinkInvariantError",
      "Span"
    ],
    "verified_functions": [
      "validate_causal_span"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "CausalLinkInvariantError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
