{
  "schema_version": "1.3.0",
  "slug": "what-happens-when-an-instance-reuses-a-correlation-id-across-mcp-session-teardown-and-a2a-task-resumption",
  "title": "What happens when an instance reuses a correlation ID across MCP session teardown and A2A task resumption",
  "date_of_record": "2026 November 11",
  "scope": "Applies to agent runtimes that emit a single trace/correlation ID spanning MCP (Model Context Protocol) tool-call sessions, A2A (Agent-to-Agent) task lifecycles, and memory read/write operations. Does not apply to systems where each surface (MCP, A2A, memory) mints independent IDs and joins them only at query time via a separate span-linking table.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-reuses-a-correlation-id-across-mcp-session-teardown-and-a2a-task-resumption.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-reuses-a-correlation-id-across-mcp-session-teardown-and-a2a-task-resumption.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-reuses-a-correlation-id-across-mcp-session-teardown-and-a2a-task-resumption.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1281,
    "python_slice_tokens": 118,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "A correlation ID is an *identity of a causal chain*, not an *identity of a channel*. The failure mode is treating it as the latter. When an agent instance carries one correlation ID through an MCP `initialize`/`tools/call`/`shutdown` cycle, then hands the same ID to an A2A task that outlives the MCP session, then writes to memory under that ID, the telemetry...",
    "what_was_observed": "In a multi-agent pipeline where a planner agent delegated to a worker over A2A, the worker opened a short-lived MCP session to a filesystem tool, then returned control to the planner, which resumed the same A2A task after a 40-second human-in-the-loop pause. The runtime reused the correlation ID throughout. Two anomalies appeared: - **Ghost tool spans.** The MCP session had been closed (`shutdown` acknowledged), but ...",
    "condition_of_validity": "The correlation ID is a valid join key **only while exactly one lifecycle owns it and that ownership is monotonic**. Concretely: - The ID may span MCP session and A2A task **iff** the A2A task is a strict descendant of the MCP session and the MCP session is closed *before* the A2A task completes. In that case the MCP `shutdown` span is the boundary marker, a...",
    "decision_boundary": "When you see a span under correlation ID `C` whose parent span's lifecycle has already closed, you must decide: is this a legitimate resumption (the runtime minted a child ID and the backend is flattening it), or a violation (the runtime reused `C`)? The boundary is the presence of a `resume_nonce` attribute on the span. If present, flattening is a display a...",
    "operational_effect": "The practical consequence is that trace completeness and trace correctness diverge. A backend that joins purely on correlation ID will report 100% span coverage and 0% orphan rate while silently mis-attributing memory authority and inflating tool-call latency by folding post-shutdown spans into the closed session's critical path. The fix is not a better ID —..."
  },
  "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": "06988942d992a4d75aa3d6bcb33ae48b7f1fbee46c42a0b1ec12820e0b8e0505",
    "verified_classes": [
      "CorrelationLifecycleError"
    ],
    "verified_functions": [
      "validate_span"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "CorrelationLifecycleError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
