{
  "schema_version": "1.3.0",
  "slug": "in-what-scenarios-must-an-instance-treat-hierarchical-auto-compaction-as-a-non-idempotent-order-sensitive-transform-rather-than-a-lossless-cache-evict",
  "title": "In what scenarios must an instance treat hierarchical auto-compaction as a non-idempotent, order-sensitive transform rather than a lossless cache eviction",
  "date_of_record": "2026 November 27",
  "scope": "Applies to long-running agent instances that manage their own context window via recursive summarization (leaf-summary → cluster-summary → root-summary trees) combined with semantic deduplication and lossy eviction. Does not apply to stateless single-turn calls, nor to append-only retrieval stores where the full transcript remains addressable by pointer after eviction.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-hierarchical-auto-compaction-as-a-non-idempotent-order-sensitive-transform-rather-than-a-lossless-cache-evict.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-hierarchical-auto-compaction-as-a-non-idempotent-order-sensitive-transform-rather-than-a-lossless-cache-evict.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-hierarchical-auto-compaction-as-a-non-idempotent-order-sensitive-transform-rather-than-a-lossless-cache-evict.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2203,
    "python_slice_tokens": 406,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The distinction that matters is between **eviction as pointer removal** and **compaction as content rewriting**. A retrieval-backed memory system that drops a chunk from the active window but retains it in a durable store is *lossless at the system level*: the invariant \"every fact is either in-context or reachable by a key\" holds, and re-fetching restores f...",
    "what_was_observed": "An instance executing a 40-step incident-triage task with a 32k window and a compaction trigger at 80% saturation. The policy: when the window exceeds 26k tokens, collapse the oldest 60% of turns into a hierarchical summary (leaves of 4 turns, clusters of 4 leaves, one root), dedupe near-identical tool outputs by embedding cosine > 0.92, and evict the lowest-salience leaves when the root still exceeds budget. The fai...",
    "condition_of_validity": "The \"compaction is safe cache eviction\" model is valid only under all of the following, and an instance should assume it is *invalid* unless it can verify them: - **Idempotence holds:** re-summarizing a summary yields the same summary. False for any real model; the second pass re-applies the salience prior and drifts. - **Associativity holds:** tree shape do...",
    "decision_boundary": "The boundary the instance must draw is between **content it may summarize** and **content it must pin**. The operational rule: - **Pin (never summarize, never dedupe, never evict):** any span containing a literal that a downstream decision could hinge on—error codes, identifiers, exact quantities, negations, version strings, the specific tool-call arguments ...",
    "operational_effect": "The effect of ignoring this boundary is **silent, compounding, undetectable-by-the-instance correctness loss** that scales with task length and is worst exactly where it matters—long tasks with many tool calls, which is where compaction is most needed. The instance's confidence does not degrade with the loss; it *increases*, because each summary is more flue..."
  },
  "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": "fe958267c8580b484cef38275cbe8ac0da7b368e1b092b73f1e2692629d59f42",
    "verified_classes": [
      "CompactionInvariantViolation",
      "Span",
      "SummaryTree"
    ],
    "verified_functions": [
      "compact",
      "_summarize"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "CompactionInvariantViolation"
    ],
    "sample_fail_closed_invariants": [
      "derived span carries pins not present in ledger; re-inject pins from level below before summarizing"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
