{
  "schema_version": "1.3.0",
  "slug": "why-does-an-instance-lose-provenance-when-context-compaction-rewrites-a-retrieval-linked-span",
  "title": "Why does an instance lose provenance when context compaction rewrites a retrieval-linked span?",
  "date_of_record": "2026 November 12",
  "scope": "Applies to agents that perform automatic context compaction (summarization, pruning, or span-merging) over a context window in which some tokens are *retrieval-linked* — i.e., they carry a provenance pointer to an external source (document ID, chunk offset, vector record, tool-call output). Does not apply to purely generative context with no external references, nor to lossless compaction (verbatim dedup, reordering) that preserves byte-identical spans.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-provenance-when-context-compaction-rewrites-a-retrieval-linked-span.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-provenance-when-context-compaction-rewrites-a-retrieval-linked-span.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-provenance-when-context-compaction-rewrites-a-retrieval-linked-span.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1574,
    "python_slice_tokens": 252,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not that summarization loses information. Summarization is *supposed* to lose information. The failure is that compaction conflates two different loss channels and then treats them as equivalent at retrieval time: 1. **Semantic loss** — the summary no longer contains the literal tokens of the source. This is expected and recoverable *if* the p...",
    "what_was_observed": "In a run over a 200k-token context with ~40% retrieval-linked spans, automatic compaction at the 85% fill threshold produced summaries that retained 100% of provenance *labels* (the `doc_id` and chunk ID survived verbatim in the summary text) but lost 100% of provenance *offsets* (the character ranges were re-computed against the post-compaction buffer). The failure was silent: the summary validated against the schem...",
    "condition_of_validity": "The provenance-loss failure is *latent* (pointers look valid) but *active* (resolution is wrong) under the following joint conditions: - Compaction rewrites the buffer containing retrieval-linked spans (not a pure extract/prune). - Provenance pointers are stored as offsets relative to *some* buffer, and the buffer identity is not part of the pointer. - The r...",
    "decision_boundary": "The operational choice is between two compaction policies at the retrieval-linked boundary: - **Rewrite-and-relabel** (summarize the span, emit a new pointer into the summary). Cheaper on context budget, but produces nominal-only provenance. Only safe if downstream never needs to reconstruct the original bytes — i.e., if the summary is terminal, not an inter...",
    "operational_effect": "Systems that adopt rewrite-and-relabel without a reconstruction guard exhibit a characteristic failure signature: high summary fidelity, high citation *presence*, low citation *accuracy*, and zero exceptions. The error surfaces only when a human or a verifier checks a quote against its source. The fix is not better summarization — it is making provenance poi..."
  },
  "matched_failure_symptoms": [
    "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": "fe5ef2b757722013315502bd169fadd50a890f00545bb3280d91344e33682859",
    "verified_classes": [
      "ProvenanceResolutionError",
      "ProvenancePointer"
    ],
    "verified_functions": [
      "resolve_pointer",
      "compact_with_provenance"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "ProvenanceResolutionError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
