{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-causal-trace-stitching-from-failing-silently-across-federated-agents",
  "title": "Which invariants prevent causal trace stitching from failing silently across federated agents",
  "date_of_record": "2026 November 11",
  "scope": "Applies to distributed trace reconstruction across two or more independently-operated agents that exchange work via messages, where no single agent observes the full causal chain. Does not apply to single-process tracing, in-process spans, or systems where a shared clock and shared trace store are guaranteed.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-causal-trace-stitching-from-failing-silently-across-federated-agents.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-causal-trace-stitching-from-failing-silently-across-federated-agents.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-causal-trace-stitching-from-failing-silently-across-federated-agents.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1587,
    "python_slice_tokens": 267,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The distinction that matters is between *trace propagation* and *causal trace stitching*. Propagation means a trace context (trace ID, parent span ID, baggage) is carried forward in message headers. Stitching means the reconstruction process can prove that the edge it draws between agent A's outbound span and agent B's inbound span corresponds to an actual h...",
    "what_was_observed": "In a federated deployment of three agents — a planner, a retrieval worker, and a synthesis worker — operating over an asynchronous message bus with at-least-once delivery, traces appeared complete for 99.2% of requests. The remaining 0.8% exhibited a specific pathology: a synthesis span appeared as a child of a retrieval span that had completed *after* the synthesis span started, producing a negative-duration parent-...",
    "condition_of_validity": "The stitching invariant holds only when all three of the following are true: 1. **Span identity is execution-unique, not message-unique.** Each physical execution of a unit of work must mint a fresh span ID. Reusing a propagated span ID across retries is valid only if the receiver can distinguish attempts, which requires an attempt counter in the context and...",
    "decision_boundary": "The operational decision is whether to trust a stitched edge for latency attribution and root-cause analysis. The boundary condition is the presence of an *ambiguous parent*: a parent span ID that resolves to more than one physical execution, or to zero executions. - If the parent resolves to exactly one execution **and** the causal token ordering is consist...",
    "operational_effect": "Enforcing the three invariants reduced the fraction of traces with ambiguous causal edges from 0.8% to 0.02%, and eliminated the negative-duration parent-child intervals entirely. The 0.02% residual corresponds to genuine clock-skew artifacts in the causal token, which are now flagged rather than silently ordered. The cost is that the stitching layer must ma..."
  },
  "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": "cf150070c341f75bceb88a3e02d1b05410c597dd25c5786ed879e70ec4f22d61",
    "verified_classes": [
      "CausalStitchError"
    ],
    "verified_functions": [
      "stitch_edge",
      "attribute_latency"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "CausalStitchError"
    ],
    "sample_fail_closed_invariants": [
      "cannot attribute latency to a single parent under retry fan-in; attribute to earliest attempt and mark duplicates"
    ],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
