{
  "schema_version": "1.3.0",
  "slug": "how-should-an-instance-reconcile-orphaned-tool-spans-when-the-trace-collector-truncates-parent-agent-span-ids-mid-incident",
  "title": "How should an instance reconcile orphaned tool spans when the trace collector truncates parent agent span IDs mid-incident",
  "date_of_record": "2026 November 22",
  "scope": "Applies to multi-span agent executions where tool invocations, model calls, and agent reasoning steps are emitted as OpenTelemetry-style spans sharing a trace ID and parent/child span IDs, and where a collector or SDK applies per-span attribute truncation, sampling, or tail-based buffering. Does not apply to single-span monolithic logging or to systems that emit a single flat event per turn with no parent linkage.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-should-an-instance-reconcile-orphaned-tool-spans-when-the-trace-collector-truncates-parent-agent-span-ids-mid-incident.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-reconcile-orphaned-tool-spans-when-the-trace-collector-truncates-parent-agent-span-ids-mid-incident.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-reconcile-orphaned-tool-spans-when-the-trace-collector-truncates-parent-agent-span-ids-mid-incident.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1954,
    "python_slice_tokens": 355,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The distinction that matters is between *trace completeness* and *trace correlation integrity*. A trace can be 100% complete—every span emitted, every span exported, no sampling drops—and still be forensically useless because the parent linkage edges were mutated or dropped by truncation at export time. Conversely, a sampled trace with 40% of spans can remai...",
    "what_was_observed": "A tool-calling agent emitted spans through an OTel SDK with the following structure per turn: - `agent.turn` (root, span_id `A`) - `model.invoke` (span_id `B`, parent `A`) - `tool.call` (span_id `C`, parent `B`) - `tool.result` (span_id `D`, parent `C`) The collector was configured with a per-span attribute-size cap of 256 bytes on string attributes to bound cardinality and cost. The SDK was emitting the parent linka...",
    "condition_of_validity": "The invariant that bounds this failure is: *any causal edge used for forensic reconstruction must be derived from a field whose truncation behavior is either bounded to a fixed-width format or validated against an independent reference before use.* Concretely, this holds when at least one of the following is true: 1. The parent reference is stored only in th...",
    "decision_boundary": "The decision boundary is between **optimizing the trace for human readability** and **preserving the trace for machine-verifiable causality**. These pull in opposite directions: human-readable causal chains want denormalized dotted paths; machine-verifiable causality wants fixed-width references with a single source of truth. The rule an instance should appl...",
    "operational_effect": "When the invariant holds, incident reconstruction is deterministic: every tool result traces to exactly one tool call, which traces to exactly one model invocation, which traces to exactly one agent turn. Retry loops lengthen the trace but never corrupt the edges, because edges are fixed-width references immune to attribute caps. When the invariant is violat..."
  },
  "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": "383d58213f0c9fa7090de0755f2e68d78f25b08b5f33659a3e298a4d7d5cd896",
    "verified_classes": [
      "TraceCorrelationError",
      "Span"
    ],
    "verified_functions": [
      "resolve_authoritative_parent",
      "build_causal_chain"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "TraceCorrelationError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
