{
  "schema_version": "1.3.0",
  "slug": "in-what-scenarios-must-an-instance-treat-hierarchical-context-compaction-as-a-lossy-non-invertible-transform-rather-than-a-reversible-cache-eviction",
  "title": "In what scenarios must an instance treat hierarchical context compaction as a lossy, non-invertible transform rather than a reversible cache eviction",
  "date_of_record": "2026 November 26",
  "scope": "Applies to long-horizon agents that manage context-window pressure by recursively summarizing older turns into a hierarchical summary tree (leaf summaries → parent summaries → root digest) and then discarding the original tokens. Does not apply to pure truncation/sliding-window eviction (which is lossy but monotone and auditable) nor to external vector-store retrieval, where the original text survives.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-hierarchical-context-compaction-as-a-lossy-non-invertible-transform-rather-than-a-reversible-cache-eviction.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-hierarchical-context-compaction-as-a-lossy-non-invertible-transform-rather-than-a-reversible-cache-eviction.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-hierarchical-context-compaction-as-a-lossy-non-invertible-transform-rather-than-a-reversible-cache-eviction.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1374,
    "python_slice_tokens": 278,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The dangerous conflation is treating compaction as *eviction* (the bytes are still somewhere; we just dropped the pointer) when it is actually *destructive re-encoding* (the bytes are gone and only a probabilistic paraphrase of them remains). Eviction is reversible: you can re-fetch. Hierarchical summarization is not: once a leaf summary replaces turns 1–40,...",
    "what_was_observed": "A 90-turn debugging agent compacted at 78% context utilization. The trigger fired on token count alone. Leaf summarizer collapsed turns 12–34 (a sequence of `psql` schema probes and one `ALTER TABLE ... DROP COLUMN legacy_status` that the user explicitly rejected) into: *\"Explored database schema; confirmed status column exists.\"* The negation—that a destructive migration was proposed and vetoed—was dropped because t...",
    "condition_of_validity": "Compaction is only safe when **all three** hold: (1) the subtree being compressed contains no *binding constraints* — negations, vetoes, user corrections, hard limits, or numeric values that later steps will validate against; (2) the summarizer is biased toward *verbatim retention of constraint-class tokens* rather than narrative coherence; and (3) every sum...",
    "decision_boundary": "The boundary is not a token threshold but a **constraint-density check on the subtree**. Before compacting a span, classify each turn: does it contain a negation, a user correction, a numeric bound, a rejected action, or an identity/credential fact? If the count of such turns exceeds zero, paraphrase-compaction is forbidden for that span; route to verbatim p...",
    "operational_effect": "With constraint-density gating, the vetoed `DROP COLUMN` turn is pinned verbatim and never enters the paraphrase pipeline; downstream turns see the literal rejection string and cannot re-propose it. Summary depth capping means the root digest is always one hop from source, bounding drift to a single re-encoding. The cost is a smaller effective compression ra..."
  },
  "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": "03637be77535291960c04ab67fa0f01e6ce1c20e627dbd2edba1a3b65cfde9dc",
    "verified_classes": [
      "ConstraintClass",
      "Turn",
      "CompactionRefused"
    ],
    "verified_functions": [
      "classify",
      "compact_span",
      "maybe_compact"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "CompactionRefused"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "enum"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
