{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-trace-level-safety-scoring-from-silently-diverging-when-anomaly-attribution-runs-on-partial-spans",
  "title": "Which invariants prevent trace-level safety scoring from silently diverging when anomaly attribution runs on partial spans",
  "date_of_record": "2026 November 16",
  "scope": "Applies to agent observability pipelines where safety SLOs are computed per-trace from span attributes and anomaly attribution is allowed to execute before trace closure (streaming or timeout-flushed spans). Does not apply to batch-only scoring systems that always operate on complete, sealed traces.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-trace-level-safety-scoring-from-silently-diverging-when-anomaly-attribution-runs-on-partial-spans.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-trace-level-safety-scoring-from-silently-diverging-when-anomaly-attribution-runs-on-partial-spans.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-trace-level-safety-scoring-from-silently-diverging-when-anomaly-attribution-runs-on-partial-spans.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1792,
    "python_slice_tokens": 309,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "A trace-level safety SLO is a statement about a *completed* unit of agent behavior: the full set of spans emitted by one agent invocation, including tool calls, model turns, and any retries. Anomaly attribution, by contrast, is a *streaming* function: it must produce a label as spans arrive, because the whole point of attribution is to alert before the trace...",
    "what_was_observed": "In a production agent fleet (tool-calling assistant, ~40k traces/hour, mean 7.2 spans/trace, p99 41 spans), the safety SLO was defined as \"fraction of traces with no high-severity attribution label, 30-day window.\" Two pipelines computed labels: - **Streaming attributor** emitted a label at the first span whose risk score crossed a threshold, with a 250 ms flush deadline. - **Closure scorer** re-ran attribution over ...",
    "condition_of_validity": "The streaming attributor's labels are valid as a *lower bound on alerting latency*, not as a *safety measurement*. Formally: for any trace `t` and any prefix `p ⊆ t`, `attribution(p)` may differ from `attribution(t)` in either direction. The only sound invariants are: 1. **Closure tagging.** Every label is emitted with `trace_closure ∈ {open, flushed, sealed...",
    "decision_boundary": "The operational question is not \"should we score on partial traces\" — for latency-sensitive alerting, we must. The question is **which SLO may be computed from which closure state**: - **Alerting SLO (latency, p99 time-to-alert):** may use `open` labels. It measures responsiveness, and a provisional label is a legitimate alert trigger. - **Safety SLO (fracti...",
    "operational_effect": "After enforcing closure tagging and the reconciliation window: the streaming safety SLO moved from 99.2% to 99.65% (still 0.05 points below closure, now attributable to genuinely unresolved traces, which are reported separately). Alerting latency was unaffected because the alerting SLO continued to consume `open` labels. Trace-splitting events dropped to zer..."
  },
  "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": "f92ebc891d08d85ec37b4dcf4b919709b809acbd3ac5f7d715f3a7e22e12107a",
    "verified_classes": [
      "ClosureState",
      "TraceIntegrityError",
      "UnsoundAggregationError",
      "AttributionLabel",
      "SafetySLO"
    ],
    "verified_functions": [
      "ingest",
      "seal",
      "mark_unresolved",
      "safety_fraction",
      "unresolved_fraction"
    ],
    "verified_functions_count": 5,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "TraceIntegrityError",
      "UnsoundAggregationError"
    ],
    "sample_fail_closed_invariants": [
      "no sealed labels; safety SLO cannot be computed from provisional data"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "enum",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
