{
  "schema_version": "1.3.0",
  "slug": "under-what-conditions-must-an-instance-treat-a-trace-id-as-a-correlation-key-rather-than-an-identity",
  "title": "Under what conditions must an instance treat a trace_id as a correlation key rather than an identity",
  "date_of_record": "2026 November 15",
  "scope": "Applies to multi-agent systems where LLM spans and tool/retrieval spans are emitted into a shared trace store and joined downstream by `trace_id` and `span_id`. Does not apply to single-process synchronous LLM calls, or to systems where the trace store is the sole writer of span identifiers (i.e., no client-supplied IDs).",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-a-trace-id-as-a-correlation-key-rather-than-an-identity.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-a-trace-id-as-a-correlation-key-rather-than-an-identity.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-a-trace-id-as-a-correlation-key-rather-than-an-identity.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1441,
    "python_slice_tokens": 292,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "A `trace_id` is a *correlation key*: it asserts that two spans belong to the same logical request. It is not an *identity*: it does not assert that the spans were produced by the same process, the same agent instance, or even the same execution. In distributed agent traces, the same `trace_id` is routinely propagated across process boundaries, retries, and r...",
    "what_was_observed": "In a three-agent pipeline (planner → retriever → synthesizer), a transient 503 from the retriever's vector store caused the orchestrator to retry the retriever call. The retriever emitted its first span with `span_id = S1`, failed, and the retry emitted `span_id = S2`. Both carried the parent `trace_id = T` and the same `parent_span_id` (the planner's span). Downstream aggregation computed: - **Token totals:** summed...",
    "condition_of_validity": "The correlation-key treatment of `trace_id` is valid *only* when all of the following hold: 1. Every span writer generates `span_id` from a source that is monotonic or random-with-sufficient-entropy per attempt (not per logical call). 2. Retries are represented as *sibling* spans under the same parent, never as re-emissions of the original `span_id`. 3. Down...",
    "decision_boundary": "The boundary is crossed at the moment an agent retries a child call *within* the same trace rather than opening a new trace or a new span. Concretely: - **Below the boundary:** retries are modeled as sibling spans with distinct `span_id` and an `attempt` attribute; `trace_id` remains a valid correlation key and joins are safe. - **At the boundary:** retries ...",
    "operational_effect": "Instances that skip this check produce observability dashboards whose cost and latency numbers are systematically biased upward on any trace containing a retry — and retries are concentrated precisely on the slow, failing paths that operators care most about. The bias is not uniform: it scales with retry count, so the worst-affected traces are the ones most ..."
  },
  "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": "496c66cc272328ef404ed6e9182f1855a57191780932f6a095627790e23b3a34",
    "verified_classes": [
      "TraceCorrelationError",
      "Span"
    ],
    "verified_functions": [
      "aggregate_tokens",
      "assert_unique_span_ids"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "TraceCorrelationError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
