{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-span-level-taint-provenance-from-silently-desynchronizing-in-agent-observability-pipelines",
  "title": "Which invariants prevent span-level taint provenance from silently desynchronizing in agent observability pipelines",
  "date_of_record": "2026 November 23",
  "scope": "Applies to observability pipelines that emit GenAI OpenTelemetry spans for agent tool calls while simultaneously maintaining a taint provenance graph whose nodes reference span IDs as evidence anchors. Does not apply to pipelines where provenance is reconstructed offline from immutable traces, nor to single-turn stateless inference where no tool-call graph exists.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-span-level-taint-provenance-from-silently-desynchronizing-in-agent-observability-pipelines.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-span-level-taint-provenance-from-silently-desynchronizing-in-agent-observability-pipelines.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-span-level-taint-provenance-from-silently-desynchronizing-in-agent-observability-pipelines.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1302,
    "python_slice_tokens": 194,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "A GenAI span records *what an agent did*. A taint provenance graph records *where data came from and what it influenced*. The two are joined by a single foreign key — the span ID — and that join is the entire failure surface. The non-obvious invariant: **a provenance edge is only valid if the span it anchors to is still being exported under the same trace co...",
    "what_was_observed": "During a red-team agent run against a retrieval-augmented tool-calling agent, the provenance graph recorded 4,112 taint edges across 1,038 tool invocations. The observability backend received 987 of those spans. The 51 missing spans were tail-sampled out because the sampling policy keyed on `status=OK` and root-span latency; the dropped spans belonged to a retry storm whose root spans exceeded the latency threshold. ...",
    "condition_of_validity": "The join holds only when all three conditions are met: 1. **Export completeness precedes provenance commit.** Every span ID referenced by a committed edge must be in a state the exporter guarantees to emit — already flushed or protected by an explicit non-droppable flag. Tail sampling violates this by design. 2. **Trace context is immutable after edge creati...",
    "decision_boundary": "The boundary is between **sampling the evidence** and **sampling the conclusion**. You may sample spans freely *if* provenance edges carry their own taint classification and a `verifiable: bool` flag set at commit time. You may not sample spans if the graph is queried by joining against span attributes to recover taint status — in that regime, sampling silen...",
    "operational_effect": "Pipelines that enforce these invariants see orphaned-edge rate as a first-class metric, alerting when it exceeds a small threshold rather than discovering it during an audit. Taint edges committed before export carry a monotonic sequence number so that re-parenting can be detected by comparing the edge's recorded parent against the ingested span's parent. Po..."
  },
  "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": "37ca92536218c5c89ba92a3aad196f185c210f10d7e5cd226e1c89f2656d8096",
    "verified_classes": [
      "ProvenanceDesyncError",
      "TaintEdge",
      "IngestedSpan"
    ],
    "verified_functions": [
      "reconcile_edge",
      "policy_decision"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "ProvenanceDesyncError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
