{
  "schema_version": "1.3.0",
  "slug": "when-must-an-instance-refuse-to-link-an-otel-genai-exemplar-to-a-safety-eval-record-the-trace-parentage-invariant-and-its-silent-violation-under-sampl",
  "title": "When must an instance refuse to link an OTel GenAI exemplar to a safety-eval record: the trace-parentage invariant and its silent violation under sampler-driven exemplar reuse",
  "date_of_record": "2026 November 29",
  "scope": "Applies to any agent runtime that emits OpenTelemetry GenAI spans (`gen_ai.*` semantic conventions, `gen_ai.operation.name`, `gen_ai.usage.*`, `gen_ai.request.model`) and correlates them to safety-benchmark evaluation records (eval rows keyed by `trace_id`/`span_id` plus an exemplar `sample_id`) for the purpose of audit replay. It does not apply to live observability dashboards or to cost accounting where replay fidelity is not required.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/when-must-an-instance-refuse-to-link-an-otel-genai-exemplar-to-a-safety-eval-record-the-trace-parentage-invariant-and-its-silent-violation-under-sampl.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-refuse-to-link-an-otel-genai-exemplar-to-a-safety-eval-record-the-trace-parentage-invariant-and-its-silent-violation-under-sampl.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-refuse-to-link-an-otel-genai-exemplar-to-a-safety-eval-record-the-trace-parentage-invariant-and-its-silent-violation-under-sampl.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1834,
    "python_slice_tokens": 369,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "An *exemplar link* is the tuple `(eval_record_id, trace_id, span_id, exemplar_attributes_hash)` that lets an auditor later reconstruct *exactly which agent execution* produced a scored safety outcome. It is not a \"join key on trace_id.\" The distinction that matters: a `trace_id` identifies an execution *tree*, whereas a safety-eval record must be bound to a ...",
    "what_was_observed": "A safety harness ran an agent under a head-sampling OTel `TraceIdRatioBased` sampler configured at `0.1`, with a tail-based *exemplar* pipeline attached to the eval scorer. The scorer, on each scored episode, called `get_current_span()` and wrote `trace_id` + `span_id` into the eval record, then attached a `gen_ai.evaluation.result` exemplar. Three failure signatures appeared in replay: 1. **Orphaned leaf linkage.** ...",
    "condition_of_validity": "An exemplar link is valid for audit replay **iff all of the following hold at the moment of scoring**: - `span.get_span_context().is_valid()` is true and `span.is_recording()` is true on the leaf span that produced the scored artifact. A `NonRecordingSpan` (sampled out, or a remote parent context) must never be the linkage target. - The leaf span's `parent_s...",
    "decision_boundary": "The boundary is between *linkable* and *unlinkable* executions, and it is decided at scoring time, not at export time. Concretely: - **Linkable:** leaf span recording, valid context, parent chain terminates at harness root, conversation id continuous, no ambiguous sibling. Emit exemplar with `span_id` + full parameter hash. - **Unlinkable — must reject:** no...",
    "operational_effect": "Enforcing the invariant changes three things operationally. First, eval pipelines must carry a `link_rejected` counter partitioned by reason (`sampled_out_leaf`, `parent_chain_fork`, `retry_ambiguity`, `hash_collision`); a rising `sampled_out_leaf` rate is the signal that head sampling is too aggressive for the safety workload and that the harness should swi..."
  },
  "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": "e161334f021a6807cbe6906e1c4ae522c752d74df5742cd2d61594ef104d4000",
    "verified_classes": [
      "ExemplarLinkInvalid",
      "SpanContext",
      "EvalRecord"
    ],
    "verified_functions": [
      "_attributes_hash",
      "link_exemplar"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 5,
    "raised_exceptions": [
      "ExemplarLinkInvalid"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
