{
  "schema_version": "1.3.0",
  "slug": "what-happens-when-an-instance-reuses-a-trace-correlation-key-across-an-mcp-server-restart-and-an-a2a-hop-the-semantic-convention-collision-that-silent",
  "title": "What happens when an instance reuses a trace-correlation key across an MCP server restart and an A2A hop: the semantic-convention collision that silently rebinds a resumed agent's memory writes to another agent's episodic record",
  "date_of_record": "2026 November 25",
  "scope": "Applies to any agent instance that propagates a single correlation identifier (trace ID, span ID, session token, or `request_id`) across an MCP tool call, an A2A handoff, and a memory-backend write, where the identifier is generated from a *semantic convention* (e.g., `{task_hash}:{turn}`) rather than a globally unique source. Does not apply to instances using W3C `traceparent` with cryptographically random 128-bit trace IDs and a monotonic span counter, nor to single-hop, single-backend deployments.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-reuses-a-trace-correlation-key-across-an-mcp-server-restart-and-an-a2a-hop-the-semantic-convention-collision-that-silent.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-reuses-a-trace-correlation-key-across-an-mcp-server-restart-and-an-a2a-hop-the-semantic-convention-collision-that-silent.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-reuses-a-trace-correlation-key-across-an-mcp-server-restart-and-an-a2a-hop-the-semantic-convention-collision-that-silent.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2843,
    "python_slice_tokens": 580,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"trace correlation breaks.\" The failure is that a *semantic-convention-aligned* correlation key — one deliberately constructed to be human-readable and stable across restarts, such as `agent-7:summarize_doc:turn3` — is simultaneously interpreted by three subsystems under three different uniqueness assumptions: - The **MCP server** treats t...",
    "what_was_observed": "A three-tier pipeline: planner instance `P` (LLM, MCP client), tool server `T` (MCP), memory backend `M` (episodic store keyed by correlation ID), and a summarizer peer `S` (A2A endpoint). Correlation key is generated by `P` as `f\"{task_hash}:{turn_index}\"` — a semantic convention chosen so that logs from different runs of the same task are greppable. Trace of the failure: 1. `P` at turn 3 emits key `K = \"a91f:3\"`. C...",
    "condition_of_validity": "The failure requires the conjunction of five conditions. Remove any one and the mechanism does not fire: 1. **Deterministic key derivation.** The correlation key is a pure function of task state (task hash, turn index, step name) rather than of process identity (PID, boot UUID, random nonce). This is the *design intent* of semantic-convention alignment — it ...",
    "decision_boundary": "The engineer must choose, at design time, between two mutually exclusive postures: - **Stable-key posture (semantic convention).** Key = `f(task_hash, turn)`. Optimizes for log correlation, cross-run diffing, and idempotent retries. *Requires* that every caching/partitioning consumer carry a separate `instance_boot_id` and that the memory backend partition o...",
    "operational_effect": "The immediate effect is **silent cross-agent episodic contamination**: the resumed instance's memory writes interleave with a retry agent's, and the pre-crash peer summary is inherited without the reasoning that produced it. Downstream, this manifests as an agent that confidently asserts facts it never derived, because its episodic record now contains anothe..."
  },
  "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": "8126e2e9d102753062cbbf30b52550e8372f86ea86c964ef8ea576a71e191bf3",
    "verified_classes": [
      "CorrelationKeyCollision",
      "CorrelationKey",
      "InstanceIdentity",
      "EpisodicRecord",
      "MemoryBackend"
    ],
    "verified_functions": [
      "handle_post_restart_turn",
      "as_str",
      "discriminator",
      "__init__",
      "open_or_resume",
      "append"
    ],
    "verified_functions_count": 6,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "CorrelationKeyCollision"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "__future__",
      "dataclasses",
      "hashlib",
      "typing",
      "uuid"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
