{
  "schema_version": "1.3.0",
  "slug": "what-happens-when-an-instance-emits-a-safety-flagged-span-whose-parent-trace-has-already-been-sealed-by-the-eval-aggregator",
  "title": "What happens when an instance emits a safety-flagged span whose parent trace has already been sealed by the eval aggregator",
  "date_of_record": "2026 November 21",
  "scope": "Applies to observability pipelines that seal (finalize/close) an agent-run trace at a fixed wall-clock deadline or token-budget boundary and then asynchronously attach eval scores and safety classifications to that trace. Does not apply to fully synchronous pipelines where safety classification completes before trace emission, nor to per-span-only (trace-less) telemetry.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-emits-a-safety-flagged-span-whose-parent-trace-has-already-been-sealed-by-the-eval-aggregator.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-emits-a-safety-flagged-span-whose-parent-trace-has-already-been-sealed-by-the-eval-aggregator.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-emits-a-safety-flagged-span-whose-parent-trace-has-already-been-sealed-by-the-eval-aggregator.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2085,
    "python_slice_tokens": 353,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"a late span arrived.\" It is a **sealing-order inversion**: the eval aggregator commits a trace-level verdict (pass/fail, safety-clean/flagged) *before* the safety classifier has finished scoring all spans belonging to that trace, because the two subsystems are keyed on different closure signals. The trace's lifecycle is closed by the **ex...",
    "what_was_observed": "A multi-step agent run produced 14 spans: 11 tool calls, 2 reasoning turns, 1 final response. The execution subsystem sealed the trace at the 90-second wall-clock deadline (the agent had been looping on a retry). The eval aggregator had registered 3 eval jobs (task success, tool-arg validity, latency budget) and, on all 3 returning, wrote a trace verdict of `pass` and marked the trace `sealed=true`. The safety classi...",
    "condition_of_validity": "The invariant that must hold is: > **For any trace T, the set of safety classifications attached to T is a function of the complete span set of T, and T may not be marked `sealed` until every span in T has a terminal safety classification (or an explicit `unclassified` with a deadline-bounded escalation).** This invariant is *only* satisfiable if the safety ...",
    "decision_boundary": "The architectural choice is between two bounded designs, and the boundary is whether you can afford to **delay the seal** or must **reopen it**. - **Delay-the-seal (bounded wait):** Hold the trace in `pending_safety` for a bounded window `W` (e.g., `W = p99 classifier lag + margin`). If all spans classify within `W`, seal with a complete verdict. If not, sea...",
    "operational_effect": "The practical consequence is that **trace-level safety verdicts are only as trustworthy as the pipeline's worst-case classifier lag relative to its seal trigger**, and this relationship is invisible in the trace record itself. A trace marked `not_flagged` is not evidence of safety; it is evidence that no flag arrived before seal. Operators who treat the seal..."
  },
  "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": "457953928d846df8e55cc9c51a41b9ec7b5e807c17cad8867a940e19154bfdff",
    "verified_classes": [
      "SealOrderInversionError",
      "Completeness",
      "TraceVerdict"
    ],
    "verified_functions": [
      "seal_trace",
      "apply_safety_label",
      "gate_reads_clean"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "SealOrderInversionError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "enum",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
