{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-per-turn-trace-eval-safety-joins-from-silently-misattributing-verdicts-across-retries-speculative-drafts-and-streaming-partia",
  "title": "Which invariants prevent per-turn trace/eval/safety joins from silently misattributing verdicts across retries, speculative drafts, and streaming partials",
  "date_of_record": "2026 November 17",
  "scope": "Applies to GenAI observability pipelines that emit one logical \"agent turn\" record by joining a trace span, one or more evaluation verdicts, and one or more safety signals keyed by turn identity. Does not apply to batch offline eval systems where turn identity is assigned after the fact by a single writer, nor to pipelines where evals and safety classifiers are computed inline in the same process that owns the span.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-per-turn-trace-eval-safety-joins-from-silently-misattributing-verdicts-across-retries-speculative-drafts-and-streaming-partia.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-per-turn-trace-eval-safety-joins-from-silently-misattributing-verdicts-across-retries-speculative-drafts-and-streaming-partia.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-per-turn-trace-eval-safety-joins-from-silently-misattributing-verdicts-across-retries-speculative-drafts-and-streaming-partia.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2020,
    "python_slice_tokens": 341,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure mode is not \"missing data\" or \"orphaned verdicts.\" It is **verdict misattribution under turn-identity reuse**. A turn is a logical unit — one user input, one agent response, possibly many model calls. The trace span, the eval run, and the safety classifier each observe the turn through a *different* physical substrate: the span observes an execut...",
    "what_was_observed": "Across three deployed pipelines, the same class of defect appeared with different surface symptoms: 1. **Retry shadowing.** An agent turn issued a model call, the call timed out at the gateway, and the orchestrator retried. The trace recorded two spans, both carrying the same `turn_id` and a `retry_index` attribute on the second. The eval service, however, was triggered by a post-turn transcript event and scored only...",
    "condition_of_validity": "The join is sound if and only if all of the following hold simultaneously: - **Content-addressed verdicts.** Every eval verdict and safety signal carries the hash (or immutable content id) of the exact text it judged, not merely the `turn_id`. A verdict whose content hash does not match the committed attempt's content hash is *not* a verdict about the commit...",
    "decision_boundary": "The operational rule is a hard split on whether `committed_attempt_id` and content hashes are present at join time: - **If `committed_attempt_id` and per-verdict content hashes are present** → perform the strict join; any verdict whose content hash mismatches the committed attempt is quarantined to a `misattributed_verdicts` side channel with a reason code, ...",
    "operational_effect": "Adopting the strict join changes three things in practice. First, the \"safe but wrong\" and \"flagged but passing\" quadrants of the eval dashboard shrink to genuine cases, because misattributed verdicts are quarantined rather than merged. Second, the pipeline gains a measurable `misattribution_rate` (quarantined verdicts / total verdicts) that is a leading ind..."
  },
  "matched_failure_symptoms": [
    "OOM_KILL_OR_MEMORY_EXHAUSTION"
  ],
  "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": "780d968280e259554cd237bfb8140935953e15e67b2fcec9a83c8443e5562cbe",
    "verified_classes": [
      "MisattributedVerdictError",
      "Verdict",
      "TurnCommit",
      "TurnRecord"
    ],
    "verified_functions": [
      "join_turn"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "MisattributedVerdictError"
    ],
    "sample_fail_closed_invariants": [
      "no committed_attempt_id for turn; emit pending_commit instead of guessing"
    ],
    "stdlib_dependencies": [
      "__future__",
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
