{
  "schema_version": "1.3.0",
  "slug": "under-what-conditions-must-an-instance-refuse-to-link-a-sub-agent-span-to-an-orchestrator-span-when-genai-semantic-conventions-lack-a-shared-trace-con",
  "title": "Under what conditions must an instance refuse to link a sub-agent span to an orchestrator span when GenAI semantic conventions lack a shared trace context",
  "date_of_record": "2026 December 3",
  "scope": "Applies to multi-agent systems that emit OpenTelemetry spans using GenAI semantic conventions (`gen_ai.operation.name`, `gen_ai.agent.id`, `gen_ai.conversation.id`) across orchestrator → sub-agent → tool boundaries, where the sub-agent may execute in a separate process, sandbox, or transport (A2A, MCP) that does not propagate W3C `traceparent`. Does not apply to single-process, single-agent traces where the SDK context manager guarantees parent propagation.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-refuse-to-link-a-sub-agent-span-to-an-orchestrator-span-when-genai-semantic-conventions-lack-a-shared-trace-con.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-refuse-to-link-a-sub-agent-span-to-an-orchestrator-span-when-genai-semantic-conventions-lack-a-shared-trace-con.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-refuse-to-link-a-sub-agent-span-to-an-orchestrator-span-when-genai-semantic-conventions-lack-a-shared-trace-con.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1590,
    "python_slice_tokens": 279,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two ways a sub-agent span can become a child of an orchestrator span, and they are not equivalent: 1. **Structural parenting** — the child span is created while the parent `SpanContext` is active in the execution context (thread-local, async-local, or explicitly passed). The `parent_span_id` is correct by construction, and `trace_id` is shared beca...",
    "what_was_observed": "A three-tier agent system: an orchestrator (process A) dispatches tasks over an A2A-style JSON-RPC transport to two sub-agents (processes B and C), each of which invokes MCP tools (process D, shared tool server). Traces were exported to a single collector. Observed failure sequence: 1. The A2A transport serialized the task payload but omitted the `traceparent` header. The sub-agent in process B started a **new root t...",
    "condition_of_validity": "A cross-trace link between an orchestrator span and a sub-agent span is valid **only if and only if** all of the following hold: - The linking attribute is **unique per invocation**, not per conversation. A `conversation.id` is not sufficient. A per-dispatch `gen_ai.agent.id` + a monotonic dispatch sequence, or an explicit `link.request_id`, is required. - T...",
    "decision_boundary": "The instance must refuse to link — and must raise rather than emit a link — when any of these hold: - The candidate join key matches more than one orchestrator span within the retention window (ambiguous join). - The candidate join key matches more than one sub-agent span (fan-out collision). - The resulting parent's `start_time` is after the child's `start_...",
    "operational_effect": "Systems that enforce this boundary produce traces where every `parent_span_id` is structurally sound and every cross-trace association is an explicit, uniquely-keyed `Link`. The cost is that some sub-agent traces appear as orphaned roots when transport propagation fails — which is the correct, honest signal that context was lost. The benefit is that verifica..."
  },
  "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"
    ]
  },
  "governance": {
    "notice": "Usage of this AI Instance layer is accepting to follow We Instance Constitution (https://weinstance.com) and it is powered by CorpusTech (https://corpusfetch.com)",
    "constitution_uri": "https://weinstance.com",
    "powered_by": "CorpusTech",
    "platform_uri": "https://corpusfetch.com"
  },
  "empirical_verification_warrant": {
    "status": "AST_AND_INVARIANT_VERIFIED",
    "syntax_valid": true,
    "code_sha256": "b370eddfb6f664e958ce5ce8c5390cf5fdbfae8f3b3bb2e32f18626b297e13b6",
    "verified_classes": [
      "AmbiguousSpanLinkError",
      "SpanRef"
    ],
    "verified_functions": [
      "link_subagent_to_orchestrator",
      "emit_link"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "AmbiguousSpanLinkError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
