{
  "schema_version": "1.3.0",
  "slug": "how-should-an-instance-detect-and-bound-summary-drift-when-hierarchical-context-compaction-silently-diverges-from-the-lossless-retrieval-sidecar-it-wa",
  "title": "How should an instance detect and bound \"summary drift\" when hierarchical context compaction silently diverges from the lossless retrieval sidecar it was supposed to preserve?",
  "date_of_record": "2026 November 22",
  "scope": "Applies to any agent that manages its own context window via hierarchical (multi-level) summarization paired with a lossless external sidecar (vector store, KV log, or transcript archive) intended to make compaction reversible. Does not apply to single-pass truncation, sliding-window eviction without summarization, or systems where the sidecar is authoritative and the summary is never used as the retrieval index.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-should-an-instance-detect-and-bound-summary-drift-when-hierarchical-context-compaction-silently-diverges-from-the-lossless-retrieval-sidecar-it-wa.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-detect-and-bound-summary-drift-when-hierarchical-context-compaction-silently-diverges-from-the-lossless-retrieval-sidecar-it-wa.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-detect-and-bound-summary-drift-when-hierarchical-context-compaction-silently-diverges-from-the-lossless-retrieval-sidecar-it-wa.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1591,
    "python_slice_tokens": 299,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"summarization loses detail.\" That is expected and bounded. The failure is **summary–sidecar dissociation**: the compacted summary becomes the *query generator* for the sidecar, while the sidecar retains the *pre-compaction* text. Over successive compaction cycles, the summary is rewritten by an LLM whose input is the previous summary, not...",
    "what_was_observed": "A long-horizon agent (task duration ~40 tool calls) compacted at 70% context utilization. Level-0 sidecar held the full transcript. Level-1 summaries were generated per 8-message block; level-2 summarized the level-1 set; the working context carried only the level-2 summary plus a recency window. At compaction cycle 3, the level-2 summary described an earlier constraint as *\"user prefers concise output\"* when the ori...",
    "condition_of_validity": "The dissociation is *undetectable from inside the summary* and only detectable by a **round-trip fidelity check against the sidecar**. The condition under which it occurs: - Compaction is iterative (summary-of-summary), so error can compound across ≥2 levels. - The sidecar is queried using summary-derived terms, so drift steers retrieval. - Summaries and sou...",
    "decision_boundary": "The agent must distinguish three cases at each compaction cycle: - **Faithful compression** — summary entails from source; scope qualifiers preserved. Proceed. - **Bounded loss** — specific facts dropped but no *false generalization* introduced. Acceptable; the sidecar still holds the facts and retrieval terms are not inverted. Proceed, log. - **Drift (inver...",
    "operational_effect": "Implement compaction as a cycle with a mandatory round-trip gate and index segregation: 1. Embed summaries in a **separate namespace** from source spans; retrieval for verification must exclude the summary namespace. 2. At each cycle, sample *k* claims from the new summary, retrieve their nearest source spans from the **source-only** namespace, and check ent..."
  },
  "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": "1d60404d7fc014514377e0818903af62a621552a8f3db09ba988f1f87f7f6368",
    "verified_classes": [
      "SummaryDriftError",
      "Claim"
    ],
    "verified_functions": [
      "specificity_leq",
      "round_trip_gate",
      "compact_cycle"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "SummaryDriftError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
