{
  "schema_version": "1.3.0",
  "slug": "in-what-scenarios-must-an-instance-treat-hierarchical-summarization-as-a-non-associative-operation-and-refuse-to-re-compact-an-already-compacted-frame",
  "title": "In what scenarios must an instance treat hierarchical summarization as a non-associative operation and refuse to re-compact an already-compacted frame",
  "date_of_record": "2026 November 28",
  "scope": "Applies to agents that perform automatic context compaction by recursively summarizing spans of their own transcript into higher-level summary nodes (a tree of digests) while retaining lossless leaf frames under a retention policy. Does not apply to single-pass truncation, sliding-window eviction without summarization, or external vector-store retrieval where no in-context summary tree is materialized.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-hierarchical-summarization-as-a-non-associative-operation-and-refuse-to-re-compact-an-already-compacted-frame.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-hierarchical-summarization-as-a-non-associative-operation-and-refuse-to-re-compact-an-already-compacted-frame.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-hierarchical-summarization-as-a-non-associative-operation-and-refuse-to-re-compact-an-already-compacted-frame.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1791,
    "python_slice_tokens": 372,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The dangerous assumption is that hierarchical summarization is *associative*: that `compact(compact(A) + compact(B))` is equivalent to `compact(A + B)`, and therefore that re-compacting an already-compacted frame is a safe idempotent-ish operation. It is not. Summarization is a **lossy, non-commutative, non-associative reduction** over a token sequence. The ...",
    "what_was_observed": "A long-running research agent accumulated a 240k-token transcript across ~40 tool-call cycles. At the 70% context threshold it compacted the first 30 cycles into a level-1 summary `S1` (a lossless-frame-consuming digest). At the 85% threshold it compacted cycles 31–38 into `S2`, then—because `S1` and `S2` together still exceeded the target—it compacted `S1 + S2` into a level-2 digest `S12`. The trace showed three dis...",
    "condition_of_validity": "The \"re-compact freely\" policy is valid **only** under all of the following, which in practice almost never co-hold: - The summarizer is **idempotent over its own output**: `summarize(summarize(x)) == summarize(x)` in distribution. Frontier LLMs are not; each pass is a fresh stochastic draw with a different compression ratio. - Every digest node carries **fu...",
    "decision_boundary": "The boundary is not \"how full is the context\" but **\"is the node I am about to summarize a frame or a digest, and are its leaves still reachable?\"** - If the input is a **lossless frame**: compact freely. You are reducing exact tokens; the loss is bounded and the leaves are the source. - If the input is a **digest with intact transitive leaf provenance**: yo...",
    "operational_effect": "Enforcing the invariant changes compaction from a *space-reclamation reflex* into a *provenance-preserving reduction*. Concretely: - The compactor must tag every node `frame` or `digest` and maintain a transitive leaf-edge set on digests. - Re-compaction of a digest is gated behind a `reground()` step that re-reads the leaves; if the leaves are absent, it ra..."
  },
  "matched_failure_symptoms": [
    "DOMAIN:EPISTEMIC_PROVENANCE_AND_FEDERATION_ROUTING"
  ],
  "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": "3067a92c024707dc8a55f0da0c0f70c04eca32f8b1a8ae2e2b79713ed2d5b233",
    "verified_classes": [
      "UnverifiableDigestError",
      "Node",
      "CompactionStore"
    ],
    "verified_functions": [
      "__init__",
      "add_frame",
      "summarize",
      "leaves_reachable",
      "recompact",
      "evict_leaves"
    ],
    "verified_functions_count": 6,
    "defensive_guards_count": 1,
    "raised_exceptions": [
      "UnverifiableDigestError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
