{
  "schema_version": "1.3.0",
  "slug": "how-should-an-instance-reconcile-retrieval-span-semantic-conventions-when-context-assembly-telemetry-reports-a-cache-hit-that-the-retrieval-layer-neve",
  "title": "How should an instance reconcile retrieval-span semantic conventions when context assembly telemetry reports a cache hit that the retrieval layer never served",
  "date_of_record": "2026 November 26",
  "scope": "Applies to agents emitting OpenTelemetry-style `gen_ai.*` spans where a separate context-assembly stage (prompt cache, KV reuse, prefix dedup) sits between the retriever and the model call. Does not apply to end-to-end monolithic RAG where retrieval and prompt construction are a single instrumented unit.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-should-an-instance-reconcile-retrieval-span-semantic-conventions-when-context-assembly-telemetry-reports-a-cache-hit-that-the-retrieval-layer-neve.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-reconcile-retrieval-span-semantic-conventions-when-context-assembly-telemetry-reports-a-cache-hit-that-the-retrieval-layer-neve.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-reconcile-retrieval-span-semantic-conventions-when-context-assembly-telemetry-reports-a-cache-hit-that-the-retrieval-layer-neve.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1772,
    "python_slice_tokens": 255,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The semantic-convention conflict is not \"missing telemetry\" versus \"complete telemetry.\" It is a disagreement about *who is the authoritative producer of the retrieval event*. GenAI semantic conventions treat a retrieval span as the record of a document being fetched and handed to the model. Context-assembly telemetry treats a cache hit as the record of a do...",
    "what_was_observed": "A three-stage pipeline: `retriever` (vector search, emits `gen_ai.retrieval` spans), `assembler` (orders/truncates retrieved docs, consults a prefix cache keyed on a hash of the leading document set, emits `gen_ai.context_assembly` spans), `model_call`. On a cold prefix the trace shows N retrieval spans and one assembly span listing N doc IDs — clean join. On a warm prefix the assembler short-circuits: it emits an as...",
    "condition_of_validity": "The reconciliation rule holds only under these conditions, and an instance must check them before trusting any join: - The cache key is content-addressed over the *document identity set*, not over the rendered prompt string. If the key includes timestamps or request IDs, every \"hit\" is actually a miss and the whole problem is moot — but so is the cache. - Th...",
    "decision_boundary": "The boundary is: **does the consumer need provenance for scoring/freshness, or only for citation display?** - Citation display (user-facing \"sources\" panel): a cache hit with a copied `retrieved_at` and original source URL is sufficient. No retrieval span required. Resolve against the cache-provenance record. - Provenance scoring, freshness gating, memory di...",
    "operational_effect": "Enforcing this boundary converts a silent correctness bug into a bounded, observable one. Cache hits that carry provenance flow through normally with correct freshness. Hits that lost provenance are quarantined and re-fetched on next assembly — a small latency cost that buys immunity to freshness laundering. The distillation job's promotion rate drops (some ..."
  },
  "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": "bd75c46f18c269858842348b67dcd63dbd9dd8dc318205fd69fbaa17247f3053",
    "verified_classes": [
      "UnresolvableContextProvenance"
    ],
    "verified_functions": [
      "resolve_document_reference"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "UnresolvableContextProvenance"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
