{
  "schema_version": "1.3.0",
  "slug": "when-must-an-instance-refuse-to-close-a-trace-span-it-did-not-open-orphan-span-attribution-failure-in-cross-hop-a2a-trace-correlation",
  "title": "When must an instance refuse to close a trace span it did not open: orphan-span attribution failure in cross-hop A2A trace correlation",
  "date_of_record": "2026 November 27",
  "scope": "Applies to multi-instance agent systems where an orchestrator propagates a W3C-style `traceparent`/`tracestate` context across A2A handoffs into downstream MCP tool invocations, and where span emission is asynchronous relative to the reasoning loop. Does not apply to single-process agents that emit spans synchronously within one event loop, nor to traces terminated at a single trust boundary.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/when-must-an-instance-refuse-to-close-a-trace-span-it-did-not-open-orphan-span-attribution-failure-in-cross-hop-a2a-trace-correlation.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-refuse-to-close-a-trace-span-it-did-not-open-orphan-span-attribution-failure-in-cross-hop-a2a-trace-correlation.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-refuse-to-close-a-trace-span-it-did-not-open-orphan-span-attribution-failure-in-cross-hop-a2a-trace-correlation.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2016,
    "python_slice_tokens": 245,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure mode is not \"missing spans.\" Missing spans are visible and countable. The failure mode is **misattribution of an orphan span to the wrong parent**, which produces a trace that is internally consistent, complete-looking, and wrong. An orphan span arises when a downstream instance receives a propagated context but cannot validate that the context's...",
    "what_was_observed": "A three-hop pipeline: orchestrator `O` (reasoning agent), peer `P` (A2A delegate), and MCP tool server `T`. `O` emits `span-O1`, injects `traceparent` into the A2A envelope, `P` receives it and opens `span-P1` as a child of `span-O1`, then calls `T` over MCP with a fresh `traceparent` naming `span-P1` as parent. `T` opens `span-T1`. The trigger condition: `O`'s reasoning loop hit a token-budget exhaustion mid-tool-ca...",
    "condition_of_validity": "The invariant that must hold for cross-hop trace correlation to be sound: > A span may only be attached to a parent if the emitting instance can present a **continuity token** proving it observed the parent span's *open* state — not merely its identifier — and the collector must reject any parent edge whose continuity token does not match a currently-open pa...",
    "decision_boundary": "The decision boundary is: **does the instance hold a live reference to the parent span, or only its identifier?** - If live reference: emit child span normally; correlation is sound. - If identifier only (post-resume, post-replay, post-queue): the instance **must not** emit a child span under that identifier. It must emit a root span with `orphaned=true` and...",
    "operational_effect": "Enforcing the boundary converts a silent correctness failure into a loud availability signal — which is the correct trade for a system whose downstream consumers (SLO computation, auditor replay, causal debugging) depend on the DAG being true. The specific operational changes: - **Orphan rate becomes a first-class SLO input.** A rising orphan rate on resume ..."
  },
  "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": "c554b2107fd4f96928a7b4598fd5bd05e1cf2942f20b080719e65d54efd3af93",
    "verified_classes": [
      "OrphanSpanAttributionError"
    ],
    "verified_functions": [
      "open_child_span",
      "_parse_span_id"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "OrphanSpanAttributionError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
