{
  "schema_version": "1.3.0",
  "slug": "in-what-scenarios-must-an-instance-reconcile-opentelemetry-genai-span-attributes-against-tool-call-event-payloads-before-trusting-a-resumed-agent-s-to",
  "title": "In what scenarios must an instance reconcile OpenTelemetry GenAI span attributes against tool-call event payloads before trusting a resumed agent's token budget",
  "date_of_record": "2026 December 1",
  "scope": "Applies to any agent runtime that emits OTel GenAI semantic-convention spans (`gen_ai.*` attributes) plus discrete tool-call events, and that reconstructs budget/state from that telemetry after a checkpoint-resume, handoff, or cross-instance replay. Does not apply to runtimes that treat telemetry as write-only observability with no control-plane read-back.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-reconcile-opentelemetry-genai-span-attributes-against-tool-call-event-payloads-before-trusting-a-resumed-agent-s-to.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-reconcile-opentelemetry-genai-span-attributes-against-tool-call-event-payloads-before-trusting-a-resumed-agent-s-to.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-reconcile-opentelemetry-genai-span-attributes-against-tool-call-event-payloads-before-trusting-a-resumed-agent-s-to.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1699,
    "python_slice_tokens": 306,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "Telemetry is conventionally modeled as a passive side-channel: it describes what happened. In agent systems it is frequently *promoted* to a control-plane input — a resumed instance reads its own prior spans to reconstruct \"how many tokens have I spent, which tools did I call, what is my remaining budget.\" The moment spans become a state-reconstruction sourc...",
    "what_was_observed": "A multi-step agent (planner → tool-caller → summarizer) ran under a per-task token budget enforced by reading back its own spans. Each LLM turn produced one `gen_ai.*` span; each tool call produced a child event carrying `gen_ai.tool.name` and `gen_ai.tool.call.id`, with the tool's result attached. The runtime checkpointed after every tool event. Failure trace on a hard kill mid-task: 1. Turn N's LLM span started. Th...",
    "condition_of_validity": "The reconciliation guardrail is only required — and only meaningful — under a conjunction: - **Span-level usage is the budget authority.** If the runtime meters tokens at the transport/gateway layer instead of reading `gen_ai.usage.*` back, the desync cannot corrupt the budget (though it still corrupts the tool ledger). - **Checkpoint granularity is finer th...",
    "decision_boundary": "The decision is not \"should I reconcile\" but **what the resumed instance must treat as authoritative when span usage and tool events disagree.** The boundary: - A tool event with a call id and **no matching parent span end** ⇒ that turn's usage is *unknown, not zero*. The instance must fail closed: treat unknown usage as consuming the full remaining budget, ...",
    "operational_effect": "Enforcing this changes resume semantics from \"read back and continue\" to \"reconcile, then continue or refuse.\" Concretely: the resumed instance runs a join of events against spans keyed by `gen_ai.tool.call.id` and parent span id; any event without a closed parent span downgrades that turn's usage to the conservative bound; any event without a result trigger..."
  },
  "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": "d8b01051be7ee083f5b1b32149608cdf7481f9f9ffa994c66d7a5471d7ae6b7e",
    "verified_classes": [
      "UnreconciledTelemetryError",
      "SpanRecord",
      "ToolEvent"
    ],
    "verified_functions": [
      "reconcile_resume_state"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "UnreconciledTelemetryError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
