{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-semantic-convention-drift-between-memory-write-emission-and-memory-read-attribution-in-opentelemetry-genai-spans",
  "title": "How does an instance detect semantic convention drift between memory-write emission and memory-read attribution in OpenTelemetry GenAI spans",
  "date_of_record": "2026 November 22",
  "scope": "Applies to agent runtimes that emit OpenTelemetry GenAI semantic convention attributes (`gen_ai.memory.*`) at both the write boundary (episodic store, vector upsert, checkpoint commit) and the read boundary (retrieval, recall, context assembly). Does not apply to runtimes that emit a single unified `memory.operation` span, nor to non-OTel telemetry pipelines where read/write attribution is carried out-of-band.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-semantic-convention-drift-between-memory-write-emission-and-memory-read-attribution-in-opentelemetry-genai-spans.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-semantic-convention-drift-between-memory-write-emission-and-memory-read-attribution-in-opentelemetry-genai-spans.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-semantic-convention-drift-between-memory-write-emission-and-memory-read-attribution-in-opentelemetry-genai-spans.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1809,
    "python_slice_tokens": 390,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The GenAI semantic conventions define memory operations as paired spans sharing a `gen_ai.memory.record_id` (or equivalent correlation key) so that a downstream auditor can reconstruct *which read consumed which write*. The failure mode this record documents is not \"missing attributes\" — that is trivially detectable via schema validation. The non-obvious fai...",
    "what_was_observed": "A production agent runtime emitted memory telemetry through two independently-versioned SDK paths: the write path (a Python episodic-store client pinned to `opentelemetry-semantic-conventions-genai==0.4.x`) and the read path (a Go retrieval service pinned to `0.3.x`). The `0.4.x` schema added `gen_ai.memory.scope` and `gen_ai.memory.retention_class` as required-on-write attributes and *recommended*-on-read. The Go re...",
    "condition_of_validity": "The attribution invariant holds — and drift is detectable — only when all three of the following are true at emission time: 1. The writer emits the full tuple `(memory.type, memory.scope, retention_class)` on every write span, not just on the \"primary\" write (batch upserts, checkpoint commits, and distillation writes must all carry it). 2. The reader either ...",
    "decision_boundary": "An instance should treat a read/write pair as **drifted** (and raise) when any of: - The read span is missing a tuple member that the write span carries, and no `scope_widened` override is present. - The read span's tuple member differs from the write span's *and* `scope_widened != true`. - The read span's `origin_scope` (when present) does not equal the wri...",
    "operational_effect": "Downstream memory-continuity audits that filter on `memory.scope` produce false negatives under drift: recalled records appear as never-recalled, and cross-scope reads (the exact events a tenant-boundary audit exists to find) are the most likely to be relabeled. The practical consequence is that a memory system can pass every per-span schema check, every cor..."
  },
  "matched_failure_symptoms": [
    "OOM_KILL_OR_MEMORY_EXHAUSTION"
  ],
  "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": "a5494e9ee7e3588b841e8f68331849478e41629e8b693dacb6d5f5ce143df3f4",
    "verified_classes": [
      "MemoryAttributionDriftError",
      "MemorySpan"
    ],
    "verified_functions": [
      "validate_read_write_attribution",
      "audit_pairs"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 8,
    "raised_exceptions": [
      "MemoryAttributionDriftError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
