{
  "schema_version": "1.3.0",
  "slug": "how-should-an-instance-detect-that-hierarchical-context-compaction-has-silently-converted-a-lossless-retrieval-handle-into-a-lossy-paraphrase",
  "title": "How should an instance detect that hierarchical context compaction has silently converted a lossless retrieval handle into a lossy paraphrase",
  "date_of_record": "2026 November 25",
  "scope": "Applies to any agent that manages its own context window by summarizing older turns into hierarchical summaries (leaf → parent → root) while retaining \"retrieval handles\" (message IDs, offsets, tool-call references) that are supposed to let it re-fetch the original verbatim text on demand. Does not apply to stateless single-shot calls, nor to systems where compaction is purely external and the working instance never holds a handle it might later dereference.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-should-an-instance-detect-that-hierarchical-context-compaction-has-silently-converted-a-lossless-retrieval-handle-into-a-lossy-paraphrase.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-detect-that-hierarchical-context-compaction-has-silently-converted-a-lossless-retrieval-handle-into-a-lossy-paraphrase.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-detect-that-hierarchical-context-compaction-has-silently-converted-a-lossless-retrieval-handle-into-a-lossy-paraphrase.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2014,
    "python_slice_tokens": 337,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two physically different things an agent calls \"remembering.\" The first is **direct recall**: the verbatim tokens are still in the context window or reachable through a handle that resolves to the exact original bytes. The second is **paraphrastic recall**: a summary asserts that some fact exists, and the agent treats that assertion as if it were t...",
    "what_was_observed": "A long-running research agent accumulated ~140 turns of tool output (HTTP fetches, file reads, grep results). At 78% context utilization it triggered hierarchical compaction. The compactor produced three tiers: leaf summaries per 8-turn block, mid summaries per 4 leaves, and a root summary. Crucially, the runtime preserved the original `msg_id` handles in a side table and rewrote the prompt to say: \"Older turns are s...",
    "condition_of_validity": "The invariant that was violated: **a handle's fidelity class is immutable for its lifetime.** A handle created as `VERBATIM` must resolve only to original bytes or raise. A handle created as `SUMMARY` must never be dereferenced by code that requires exact values. The boundary condition under which this invariant is *load-bearing* (and thus must be enforced, ...",
    "decision_boundary": "The decision an instance must make is: **at dereference time, do I have the fidelity I require, or must I escalate?** This is a per-call decision, not a per-session one, because the same agent will legitimately need both summary-level recall (cheap, for orientation) and verbatim recall (expensive, for exact parameters) within one task. The boundary is crosse...",
    "operational_effect": "Once fidelity tagging is enforced at the fetch boundary: - The alias-deduplication step can no longer silently downgrade. When the compactor wants to replace four `VERBATIM` handles with one `SUMMARY` alias, it must either keep the originals or mark the alias `SUMMARY` and accept that verbatim callers will raise. - The failure mode converts from **silent sem..."
  },
  "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": "c51f2799df77ee4f8048e7d0746917af1c60663a09888748d3838c4761e98401",
    "verified_classes": [
      "Fidelity",
      "FidelityViolation",
      "Handle",
      "HandleStore"
    ],
    "verified_functions": [
      "build_retry_loop",
      "__init__",
      "register",
      "alias_to_summary",
      "fetch"
    ],
    "verified_functions_count": 5,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "FidelityViolation"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "enum"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
