{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-semantic-convention-telemetry-from-silently-mis-binning-memory-compaction-events-into-the-wrong-operation-class",
  "title": "Which invariants prevent semantic-convention telemetry from silently mis-binning memory compaction events into the wrong operation class",
  "date_of_record": "2026 November 26",
  "scope": "Applies to agents that emit OpenTelemetry-style GenAI semantic-convention spans for memory operations (`memory.read`, `memory.write`, `memory.forget`) and for context compaction. Does not cover tracing of tool calls, model inference spans, or transport-level MCP/A2A instrumentation.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-semantic-convention-telemetry-from-silently-mis-binning-memory-compaction-events-into-the-wrong-operation-class.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-semantic-convention-telemetry-from-silently-mis-binning-memory-compaction-events-into-the-wrong-operation-class.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-semantic-convention-telemetry-from-silently-mis-binning-memory-compaction-events-into-the-wrong-operation-class.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1815,
    "python_slice_tokens": 367,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure mode is not \"missing telemetry.\" It is **mis-classified telemetry that passes schema validation**. GenAI semantic conventions for memory define operation classes as a closed enum on the span attribute `genai.memory.operation` (values like `read`, `write`, `forget`). Compaction — the act of summarizing or evicting a context window to reclaim token...",
    "what_was_observed": "During a long-horizon task, an agent's context window saturated at turn ~180. The runtime triggered compaction: it read the last 60 turns, produced a 900-token summary, wrote the summary to the episodic store, and dropped the raw turns from active context. The instrumentation was written by a developer who found no `compaction` operation in the convention enum and did the pragmatic thing — emitted three spans: - `mem...",
    "condition_of_validity": "The mis-binning is only harmful when three conditions co-occur: 1. **A downstream consumer treats `memory.write` as authoritative persistence** — i.e., it infers \"this content is retrievable verbatim\" from the presence of a write span. 2. **A `forget` span is emitted for the source material in the same operation** — so the consumer's eviction logic fires on ...",
    "decision_boundary": "The boundary is **not** \"should compaction be its own operation class.\" Adding an enum value is a convention change that takes a release cycle and will not help already-deployed runtimes. The operational boundary is narrower: **when a runtime folds N source entries into M summary entries and drops the sources, it must emit a linkage attribute on both the wri...",
    "operational_effect": "Enforcing the linkage invariant changes downstream behavior in three measurable ways. First, retention auditors that previously acted on unlinked `forget` spans now quarantine them, which means raw turns are held in \"uncertain\" state rather than deleted — the later verbatim query succeeds via archive reconstruction, at the cost of storage. Second, dashboards..."
  },
  "matched_failure_symptoms": [
    "OOM_KILL_OR_MEMORY_EXHAUSTION",
    "CONTEXT_DRIFT_OR_ATTENTION_DILUTION"
  ],
  "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": "32b7bd6359b5b36f15d1d4456103d3175b6b89e77cf0246b383fabbbf5e5dd88",
    "verified_classes": [
      "UnlinkedCompactionForgetError",
      "MemorySpan"
    ],
    "verified_functions": [
      "validate_compaction_trace",
      "emit_compaction"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 1,
    "raised_exceptions": [
      "UnlinkedCompactionForgetError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
