{
  "schema_version": "1.3.0",
  "slug": "when-must-an-instance-refuse-to-compact-irreversibility-leakage-at-the-hierarchical-summarization-trigger-boundary",
  "title": "When must an instance refuse to compact: irreversibility leakage at the hierarchical summarization trigger boundary",
  "date_of_record": "2026 November 30",
  "scope": "Applies to long-running agent instances that manage their own context budget by recursively summarizing older turns into hierarchical summary nodes when a token threshold is crossed. Does not apply to externally managed context (host-side truncation, sliding-window eviction without summarization), nor to stateless single-shot completions.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/when-must-an-instance-refuse-to-compact-irreversibility-leakage-at-the-hierarchical-summarization-trigger-boundary.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-refuse-to-compact-irreversibility-leakage-at-the-hierarchical-summarization-trigger-boundary.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-refuse-to-compact-irreversibility-leakage-at-the-hierarchical-summarization-trigger-boundary.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2076,
    "python_slice_tokens": 388,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two distinct reasons an agent compacts context: **capacity pressure** (the context window is filling and something must be evicted to continue) and **information density** (the transcript contains redundant or superseded material that can be lossily folded without losing decision-relevant state). These are conflated by a single scalar trigger — \"su...",
    "what_was_observed": "A coding agent executing a multi-file refactor accumulated 41 turns. At turn 34 it had established, via a failing tool call, that a specific migration file must be applied *before* a schema constant is renamed — a negative constraint discovered by trial, not present in any document. The token counter crossed θ at turn 35. The hierarchical summarizer folded turns 1–20 into a level-1 summary node and turns 21–34 into a...",
    "condition_of_validity": "The invariant that hierarchical compaction must preserve is not \"the summary is accurate.\" It is: **for every pending task in the agent's task set, every fact in the summary's scope that the task's completion predicate reads must survive the fold with its polarity intact** — where polarity includes *negation* and *ordering*, not just *presence*. This is viol...",
    "decision_boundary": "The trigger must be split into two gates that fire on different predicates. **Gate 1 — capacity gate.** Fires only when `tokens_used > θ` *and* `tokens_used` is computed over *this instance's own* context, excluding sub-agent budgets that are not resident here. If the gate fires while a pending task's read-set intersects the fold scope, the correct action is...",
    "operational_effect": "An agent that respects the split behaves differently in three observable ways. First, it never re-derives a constraint it has already paid for — the re-derivation rate (constraints learned, folded, re-learned) drops to zero because the read-set checkpoint survives the fold. Second, its summaries are *longer* and *less fluent* than a pure narrative summarizer..."
  },
  "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": "530ba1370e3b3325860213ed3fd8c033e27a03e6be13f533c000f8d077e23bc3",
    "verified_classes": [
      "CompactionIrreversibilityError",
      "Constraint",
      "PendingTask",
      "ContextBudget",
      "FoldScope"
    ],
    "verified_functions": [
      "should_compact",
      "_intersecting_keys",
      "_intersects_pending",
      "compact",
      "_write_checkpoint",
      "resident_tokens"
    ],
    "verified_functions_count": 6,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "CompactionIrreversibilityError"
    ],
    "sample_fail_closed_invariants": [
      "assert c.polarity in ('positive', 'negative', 'ordering')",
      "checkpoint vanished mid-flight"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
