{
  "schema_version": "1.3.0",
  "slug": "in-what-scenarios-must-an-instance-refuse-to-emit-a-parent-span-link-from-a-compaction-event-to-a-memory-write-span-whose-semantic-convention-version",
  "title": "In what scenarios must an instance refuse to emit a parent span link from a compaction event to a memory-write span whose semantic convention version predates the compaction",
  "date_of_record": "2026 November 23",
  "scope": "Applies to agents that emit OpenTelemetry spans under GenAI semantic conventions (`gen_ai.*`) for memory read/write/compaction operations and link compaction spans back to the memory spans they summarize. Does not cover trace propagation across transport (W3C `traceparent`), nor span linking for tool-call or retrieval spans where no compaction boundary exists.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-refuse-to-emit-a-parent-span-link-from-a-compaction-event-to-a-memory-write-span-whose-semantic-convention-version.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-refuse-to-emit-a-parent-span-link-from-a-compaction-event-to-a-memory-write-span-whose-semantic-convention-version.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-refuse-to-emit-a-parent-span-link-from-a-compaction-event-to-a-memory-write-span-whose-semantic-convention-version.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1480,
    "python_slice_tokens": 224,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "A compaction event is not a memory write. It is a *derivation*: N episodic memory-write spans (`gen_ai.memory.operation = \"write\"`) are folded into a single semantic record, and the compaction span carries `gen_ai.memory.compaction.source_span_ids` plus a `Link` set pointing at each source. The subtle boundary is that span links are *assertions of provenance...",
    "what_was_observed": "A long-running research agent performed rolling compaction every 40 memory writes. During a schema rollout, half the fleet was upgraded to GenAI semconv `1.29.0` (which introduced `gen_ai.memory.entry.kind` as a required string enum) while the memory-write emitters on two replica workers remained on `1.27.0`. The upgraded compactor read 40 recent writes, found 17 of them lacking `gen_ai.memory.entry.kind`, and — beca...",
    "condition_of_validity": "The link-with-provenance claim holds if and only if, for every linked source span `S`: - `S.attributes[\"gen_ai.schema.version\"]` parses and is ≥ `compactor.min_compatible_semconv`; - every attribute the compaction span asserts about its sources (here `gen_ai.memory.entry.kind`, `gen_ai.memory.entry.ttl_seconds`) is present on `S` with a value in the linker's...",
    "decision_boundary": "The decision is not \"is the source span old?\" but \"does the compaction span assert a field the source cannot supply?\" A legacy span that happens to carry `entry.kind` (e.g., emitted by a backfilled 1.27.0 writer with the field set manually) is linkable; a 1.29.0 span missing the field due to a writer bug is not. Version is a *proxy* for field presence, never...",
    "operational_effect": "Enforcing the guardrail converts a silent denominator corruption into an explicit, replayable gap event. Auditors reading `distilled_count` / `opaque_count` can reconstruct the true distillation ratio for the window and flag the opaque sources for backfill. The cost is that compaction spans become slightly larger (one event per gap) and that the compactor mu..."
  },
  "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": "3d334182640e34e9ed1e7a1bf8f8f30958404aeffcf0e95e4f01785b34ed4eac",
    "verified_classes": [
      "SchemaGapLinkError",
      "SourceSpan"
    ],
    "verified_functions": [
      "classify_link",
      "build_compaction_links"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 1,
    "raised_exceptions": [
      "SchemaGapLinkError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
