{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-semantic-convention-trace-replay-from-silently-diverging-when-tool-spans-carry-non-deterministic-payloads",
  "title": "Which invariants prevent semantic-convention trace replay from silently diverging when tool spans carry non-deterministic payloads",
  "date_of_record": "2026 December 3",
  "scope": "Applies to replay of OpenTelemetry GenAI semantic-convention spans (`gen_ai.*`) captured from production agent runs, used either for incident forensics or as golden-trace regression fixtures. Does not apply to synthetic traces generated from a deterministic simulator, nor to replay where tool outputs are stubbed to recorded bytes at the transport layer.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-semantic-convention-trace-replay-from-silently-diverging-when-tool-spans-carry-non-deterministic-payloads.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-semantic-convention-trace-replay-from-silently-diverging-when-tool-spans-carry-non-deterministic-payloads.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-semantic-convention-trace-replay-from-silently-diverging-when-tool-spans-carry-non-deterministic-payloads.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1919,
    "python_slice_tokens": 332,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "A GenAI trace is a *log of what an agent decided*, not a *specification of what it must decide again*. The semantic conventions (`gen_ai.operation.name`, `gen_ai.system`, `gen_ai.request.model`, `gen_ai.usage.input_tokens`, `gen_ai.tool.name`, `gen_ai.tool.call.id`) describe the shape of a call and its accounting, but they deliberately leave the *content* of...",
    "what_was_observed": "A production support agent emitted the following span sequence during a customer-escalation incident: The incident: `issue_refund` was called twice in production (the second call carried `call_a3` and was *not* in the captured trace because the exporter dropped it under backpressure). During forensic replay, the harness re-executed `lookup_order` against the live order service. The order had since transitioned to `re...",
    "condition_of_validity": "Replay is only a valid forensic or regression instrument when all of the following hold: 1. **Tool-result pinning.** Every `execute_tool` span must be replayed with its recorded `gen_ai.tool.call.result` bytes, keyed by `gen_ai.tool.call.id`, with the live dependency stubbed. Re-execution is permitted only under a separate \"shadow mode\" that is explicitly *n...",
    "decision_boundary": "The boundary between \"replay is admissible as evidence\" and \"replay is a fiction\" is crossed the moment the harness re-derives any input to a `chat` span from a source other than the recorded trace. Concretely: The last row is the subtle one. Semantic conventions cap attribute length (default 128 KiB in most SDKs, frequently configured lower). A `gen_ai.tool...",
    "operational_effect": "Once the invariants above are enforced, the replay harness becomes a *falsification* tool rather than a *confirmation* tool. Its default verdict for any trace without tool-result pinning, completeness markers, and untruncated arguments is `INADMISSIBLE`, not `PASS`. This inverts the failure economics: instead of a silent divergence producing a false PASS (wh..."
  },
  "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"
    ]
  },
  "governance": {
    "notice": "Usage of this AI Instance layer is accepting to follow We Instance Constitution (https://weinstance.com) and it is powered by CorpusTech (https://corpusfetch.com)",
    "constitution_uri": "https://weinstance.com",
    "powered_by": "CorpusTech",
    "platform_uri": "https://corpusfetch.com"
  },
  "empirical_verification_warrant": {
    "status": "AST_AND_INVARIANT_VERIFIED",
    "syntax_valid": true,
    "code_sha256": "68442984d3f08b99f2c0a78b353ab40a35d522819a94214f53e5103515bab867",
    "verified_classes": [
      "InadmissibleReplayError",
      "ToolSpan",
      "TraceRecord"
    ],
    "verified_functions": [
      "_canonical",
      "assert_admissible",
      "decision_sequence",
      "verify_replay"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 6,
    "raised_exceptions": [
      "InadmissibleReplayError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "__future__",
      "dataclasses",
      "hashlib",
      "json",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
