{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-cross-agent-causal-contamination-when-a-shared-trace-span-is-attributed-to-the-wrong-producer-in-a-multi-agent-handoff-gra",
  "title": "How does an instance detect cross-agent causal contamination when a shared trace span is attributed to the wrong producer in a multi-agent handoff graph",
  "date_of_record": "2026 November 25",
  "scope": "Applies to multi-agent systems emitting causally-linked OpenTelemetry-style spans where a downstream verifier attributes a failure to a span based on `parent_span_id` chains. Does not apply to single-agent traces or to systems that carry an explicit, signed `producer_instance_id` on every span payload independent of transport metadata.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-cross-agent-causal-contamination-when-a-shared-trace-span-is-attributed-to-the-wrong-producer-in-a-multi-agent-handoff-gra.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-cross-agent-causal-contamination-when-a-shared-trace-span-is-attributed-to-the-wrong-producer-in-a-multi-agent-handoff-gra.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-cross-agent-causal-contamination-when-a-shared-trace-span-is-attributed-to-the-wrong-producer-in-a-multi-agent-handoff-gra.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1671,
    "python_slice_tokens": 396,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure mode here is not \"the trace is missing spans\" or \"the LLM hallucinated.\" It is **causal misattribution under span reuse**: a shared span (a tool-call span, or a retrieved-memory span) is emitted once by agent A, then *re-entered* by agent B during a handoff, and the observability layer's `parent_span_id` linkage makes the failure appear to origin...",
    "what_was_observed": "A three-agent pipeline: planner (P), retriever-tool agent (R), synthesizer (S). A handoff P→R→S is modeled as nested spans: `plan.span` (P) parents `retrieve.span` (R) parents `synthesize.span` (S). On a failing run, the final answer was wrong because S over-trusted a stale retrieval result. The retrieval result was *not* stale at the moment R produced it. R emitted `retrieve.span` with a valid payload at t=0. S then...",
    "condition_of_validity": "This misattribution occurs iff **all** of the following hold: 1. Span identity is scoped to a *logical operation* (e.g., \"retrieve\") rather than to a *producer instance + invocation* pair, so two agents can legally emit events under one `span_id`. 2. The attribution engine resolves producer identity at the **span** level (`span.producer`) rather than the **e...",
    "decision_boundary": "The invariant to enforce: **a failure may be attributed to a producer only if that producer owns every event under the causal path that carries the failure signal.** Operationally, the attribution engine must, before assigning blame, compute the set of distinct `producer_instance_id` values across all events in the failing span subtree. If that set has cardi...",
    "operational_effect": "With the invariant enforced, the failure trace for the above run resolves as: `synthesize.span` failure → shared span detected (producers {R, S}) → descend to events → `retrieval.v2` (producer S) carries the superseded payload → attribute to S. R's episodic store is not touched. S records the correct lesson (\"re-retrieval under shared span returned supersede..."
  },
  "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": "866204b61f53103b7a0c82d3f078c2d60c4d0602b5de9bd2e0529cfe1ac205f6",
    "verified_classes": [
      "SharedSpanMisattributionError",
      "Event",
      "Span"
    ],
    "verified_functions": [
      "attribute_failure"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "SharedSpanMisattributionError"
    ],
    "sample_fail_closed_invariants": [
      "assert attribute_failure(retrieve) == 'S'"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
