{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-summarization-budget-compaction-from-silently-dropping-the-retrieval-key-a-later-turn-needs",
  "title": "Which invariants prevent summarization-budget compaction from silently dropping the retrieval key a later turn needs",
  "date_of_record": "2026 November 22",
  "scope": "Applies to long-running agents that compact context by summarizing older turns under a fixed token budget and rely on a retrieval index to restore dropped detail on demand. Does not apply to agents that keep full transcripts in-context or that use deterministic, key-preserving truncation with no summarization step.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-summarization-budget-compaction-from-silently-dropping-the-retrieval-key-a-later-turn-needs.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-summarization-budget-compaction-from-silently-dropping-the-retrieval-key-a-later-turn-needs.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-summarization-budget-compaction-from-silently-dropping-the-retrieval-key-a-later-turn-needs.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1474,
    "python_slice_tokens": 229,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two ways a compaction step can lose information. The obvious one is *content loss*: the summarizer omits a fact, and later reasoning is wrong because the fact is gone. The non-obvious one—the one that actually breaks retrieval-backed restoration—is *key loss*: the summarizer keeps the fact's semantic gist but drops the concrete identifier (file pat...",
    "what_was_observed": "An agent operating a multi-hour migration task compacted its transcript at a 2,000-token summary budget after the working set exceeded 60k tokens. The summarizer condensed a block of tool output into the sentence: \"Earlier, the deploy config for the staging service was updated and validated.\" The original block contained the literal path `infra/env/staging/svc-deploy.yaml` and a config hash. The path was dropped; the...",
    "condition_of_validity": "The guardrail holds only under these conditions, and fails outside them: 1. **The summarizer must be key-aware, not just budget-aware.** It must be instructed and checked to emit identifiers verbatim into a structured sidecar (a key manifest) that is *not* subject to the prose budget. The prose summary may be lossy; the key manifest may not. 2. **Retrieval m...",
    "decision_boundary": "The operative decision is: **when budget pressure forces a choice between prose fidelity and key retention, retain the key and degrade the prose.** This inverts the summarizer's default objective. The boundary is crossed the moment a summarizer is allowed to paraphrase an identifier to save tokens. Concretely: - If an entity is referenced by an exact key and...",
    "operational_effect": "With the invariant enforced, compaction becomes *recoverability-preserving*: prose shrinks, keys persist in a sidecar, and every later retrieval is either an exact hit or an explicit miss that the agent must handle as unknown. The failure mode changes from silent wrong-baseline propagation to a loud, catchable miss. That is the entire value: it converts a co..."
  },
  "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": "1e5ef5c116ac9e4c3a3841c2c1475f8e9fa561fc758a2facfd1ce04484fd653b",
    "verified_classes": [
      "IrrecoverableKeyError"
    ],
    "verified_functions": [
      "compact_with_key_manifest",
      "restore_entity"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "IrrecoverableKeyError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
