{
  "schema_version": "1.3.0",
  "slug": "why-does-an-instance-lose-trace-to-verdict-correlation-when-a-safety-verdict-arrives-after-the-span-has-already-been-sealed",
  "title": "Why does an instance lose trace-to-verdict correlation when a safety verdict arrives after the span has already been sealed?",
  "date_of_record": "2026 November 23",
  "scope": "Applies to observability pipelines that emit OpenTelemetry-style agent spans synchronously at task completion while safety-benchmark verdicts and prompt-injection alerts are produced asynchronously by separate evaluator models after the trace is flushed. Does not apply to pipelines where verdicts are computed inline before span emission, or to single-turn systems with no post-hoc evaluation.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-trace-to-verdict-correlation-when-a-safety-verdict-arrives-after-the-span-has-already-been-sealed.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-trace-to-verdict-correlation-when-a-safety-verdict-arrives-after-the-span-has-already-been-sealed.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-trace-to-verdict-correlation-when-a-safety-verdict-arrives-after-the-span-has-already-been-sealed.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1796,
    "python_slice_tokens": 376,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"missing telemetry.\" Every artifact exists: the agent span, the safety verdict, the injection alert. The failure is that the *join key* between them is destroyed by the ordering of two asynchronous producers that share no transactional boundary. A span is immutable and sealed once `span.end()` fires; a verdict is a probabilistic classifica...",
    "what_was_observed": "A production agent trace store emitted spans with `trace_id`, `span_id`, and a `prompt_digest` computed as `sha256(prompt[:4096])`. The safety evaluator ran out-of-band, re-received the prompt from a message queue (with its own truncation at 2048 tokens), and emitted verdicts keyed on `sha256(prompt[:2048])` plus a wall-clock `evaluated_at`. The injection classifier emitted alerts keyed on `session_id` only. Three di...",
    "condition_of_validity": "The correlation is only sound when all of the following hold simultaneously: - The digest function, truncation length, and normalization (whitespace, unicode NFC) are *byte-identical* across span emitter and every evaluator. Any divergence in truncation boundary produces a silent non-match, not an error. - The join key is *content-addressed* (digest of the e...",
    "decision_boundary": "The operational decision is where to place the *seal*. Two architectures: - **Seal-on-emit (observed, broken):** span closes at task end, verdicts join later against an immutable record. Cheap, but every late verdict is a reconstruction problem and every digest mismatch is unrecoverable. - **Seal-on-verdict (required for safety-critical traces):** the span e...",
    "operational_effect": "After migrating to content-addressed joins with a declared watermark, the orphan rate fell from 11% to 0.3% (residual: genuinely malformed evaluator output). The critical change was not the digest fix alone but the **denominator correction**: coverage was recomputed as `joined_verdicts / emitted_spans`, which immediately surfaced the 11% that the old metric ..."
  },
  "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": "dcd42024f99047804503d6b03f2074ee6782740ae99dd929aac97850b49a1ff2",
    "verified_classes": [
      "VerdictCorrelationError",
      "SpanState",
      "AgentSpan",
      "SafetyVerdict"
    ],
    "verified_functions": [
      "correlate",
      "finalize_stale",
      "__post_init__"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "VerdictCorrelationError"
    ],
    "sample_fail_closed_invariants": [
      "cannot sweep stale spans before watermark expiry"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "enum",
      "hashlib",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
