{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-causal-trace-stitching-from-silently-breaking-when-federated-agents-redact-spans-for-privacy",
  "title": "Which invariants prevent causal trace stitching from silently breaking when federated agents redact spans for privacy",
  "date_of_record": "2026 November 23",
  "scope": "Multi-agent systems where traces are stitched across agent boundaries and agents may redact spans or attributes before export under privacy policy. Excludes single-agent tracing and federated traces where redaction occurs only at a central collector after causal edges are materialized.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-causal-trace-stitching-from-silently-breaking-when-federated-agents-redact-spans-for-privacy.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-causal-trace-stitching-from-silently-breaking-when-federated-agents-redact-spans-for-privacy.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-causal-trace-stitching-from-silently-breaking-when-federated-agents-redact-spans-for-privacy.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1628,
    "python_slice_tokens": 373,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"a span is missing\" — missing spans are expected, and stitchers handle them via orphan rules. The failure is **a redacted span that was the sole carrier of a causal edge still semantically present in the surviving trace.** Redaction removes the *node*, not the *obligation* that its children have a parent. When policy is written in terms of...",
    "what_was_observed": "In a three-agent deployment (planner, retriever, synthesizer) exporting OTLP to a shared stitcher, a privacy rule marked any span containing a user query string as sensitive. The retriever's intermediate RPC span carried the query and was redacted; its parent (planner.dispatch, span P) and child (retriever.vector_search, span V, parent_id R) survived. The stitcher's orphan rule attached V to trace root P **as a sibli...",
    "condition_of_validity": "The stitching guarantee holds only when all of the following are true: 1. **Edge-carrying spans are classified as structural, not data.** Any span that is the sole parent of a span owned by a *different* agent must be exempt from content-based redaction, or replaced by a structural tombstone preserving span_id and parent_id with no attributes. 2. **Reparenti...",
    "decision_boundary": "When a redaction policy would remove a span that is the sole parent of another agent's span, the operator must choose one of three explicit outcomes, recorded in trace metadata: - **Tombstone (preferred):** emit a zero-attribute span with original span_id, parent_id, trace_id, and `redaction.applied=true`. Cost: one span per redacted boundary edge. - **Expli...",
    "operational_effect": "After enforcing tombstones for boundary-carrying redactions, observed trace count for the three-agent pipeline rose 6% (previously split traces were counted as separate operations), and the planner's attributed compute dropped to match actual CPU accounting within 2%. The stitcher gained a `redacted_edge_count` per trace, which became the primary signal for ..."
  },
  "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": "7e1ade78607cad317936d2a9779f51b947593883adc56431797b3b092d151435",
    "verified_classes": [
      "CausalEdgeRedactionError"
    ],
    "verified_functions": [
      "apply_redaction",
      "stitch"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "CausalEdgeRedactionError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
