{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-trace-graph-corruption-when-redaction-rewrites-span-identity-in-genai-observability-pipelines",
  "title": "How does an instance detect trace-graph corruption when redaction rewrites span identity in GenAI observability pipelines",
  "date_of_record": "2026 November 26",
  "scope": "Applies to observability pipelines that redact prompt/response payloads *before* trace assembly and that attribute cost by joining spans on task-graph edges (parent/child span IDs, tool-call IDs, turn IDs). Does not apply to pipelines that redact post-assembly at the storage layer, or to single-span cost accounting with no graph join.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-trace-graph-corruption-when-redaction-rewrites-span-identity-in-genai-observability-pipelines.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-trace-graph-corruption-when-redaction-rewrites-span-identity-in-genai-observability-pipelines.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-trace-graph-corruption-when-redaction-rewrites-span-identity-in-genai-observability-pipelines.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1996,
    "python_slice_tokens": 531,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two places to redact: **payload redaction** (scrubbing sensitive substrings inside `prompt`, `completion`, `tool_args`) and **identity redaction** (mutating or hashing fields that other spans reference as join keys). The first is safe and local. The second is a *graph mutation* dressed as a privacy control. Most pipelines conflate them because both...",
    "what_was_observed": "A three-agent task graph (planner → retriever → synthesizer) with a redaction rule matching `acct_[0-9]{6}` (account IDs embedded in tool arguments). An engineer extended the rule to cover a new tool whose arguments carried the account ID *inside the `tool_call_id`* the tool provider generated (`acct_482913.call.7`). The redactor, applied uniformly to all string fields, rewrote: - On the **retriever span**: `tool_cal...",
    "condition_of_validity": "The invariant that must hold for graph-join cost attribution to be correct: > For every edge `(parent, child)` in the task graph, the correlation key materialized on the child span must be **byte-identical** to the correlation key materialized on the parent's reference to that child, *after* all redaction transforms, and the redaction transform must be a **d...",
    "decision_boundary": "The boundary is whether redaction is **value-addressed** or **field-addressed**. - **Field-addressed redaction** (allowlist of fields to scrub) is only safe when correlation keys never appear outside the allowlist. In agent systems this assumption is false: models echo keys into reasoning traces, tool args, memory writes, and handoff payloads unpredictably. ...",
    "operational_effect": "When the invariant holds, cost attribution is exact and redaction is leak-free by construction, because the join key is a hash the pipeline controls. When it is violated silently, the two failure modes are **anti-correlated with detection**: the more aggressively you redact (more fields, more patterns), the more likely you tear the graph, and the *less* like..."
  },
  "matched_failure_symptoms": [
    "SECRET_OR_PII_LEAK_IN_LOGS"
  ],
  "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": "83abec9722c4c9279e1c05645f21dc79a26d4338cc1015cf3c4ca607d9862d30",
    "verified_classes": [
      "TraceGraphIntegrityError",
      "TaskGraph"
    ],
    "verified_functions": [
      "redact_value",
      "redact_span",
      "ingest",
      "walk",
      "validate_closure",
      "rollup_cost"
    ],
    "verified_functions_count": 6,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "TraceGraphIntegrityError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
