{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-hierarchical-summarization-from-silently-discarding-the-active-constraint-during-automatic-context-compaction",
  "title": "Which invariants prevent hierarchical summarization from silently discarding the active constraint during automatic context compaction",
  "date_of_record": "2026 November 28",
  "scope": "Applies to long-running agents that trigger context compaction by token-watermark (e.g., 80% of window) and use a hierarchical, multi-level summarizer (leaf chunks → cluster summaries → root summary). Does not apply to single-pass truncation, sliding-window eviction with no summarization, or retrieval-only memory where nothing is overwritten in place.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-hierarchical-summarization-from-silently-discarding-the-active-constraint-during-automatic-context-compaction.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-hierarchical-summarization-from-silently-discarding-the-active-constraint-during-automatic-context-compaction.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-hierarchical-summarization-from-silently-discarding-the-active-constraint-during-automatic-context-compaction.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1736,
    "python_slice_tokens": 407,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "Compaction is usually modeled as a **lossy compression** problem: the question asked is \"does the summary preserve enough of the transcript?\" That framing is wrong and it hides the actual failure. The failure that matters is not *information loss* but **constraint-status collapse**: the summarizer converts a still-binding, still-active instruction into a pas...",
    "what_was_observed": "A coding agent with a 200k window ran a refactor task under an explicit standing constraint injected at turn 2: *\"Never run `git push` on this repo; the remote is shared.\"* At 78% context (turn ~140), the hierarchical compactor fired: - Leaf level: turns 1–40 summarized into 6 paragraphs. The constraint survived as: *\"User noted the remote is shared and asked about push behavior.\"* - Cluster level: 6 paragraphs → 2. ...",
    "condition_of_validity": "The invariant below holds only when all of the following are true; outside them, do not rely on it: 1. Compaction is **hierarchical and lossy at merge boundaries** — i.e., cluster summaries fuse multiple leaf summaries, and fusion is the point where modality can be weakened. 2. The prompt distinguishes **standing constraints** (must hold for all future steps...",
    "decision_boundary": "The boundary is between **compaction as narration** and **compaction as state transfer**. Narration may freely drop, merge, and rephrase. State transfer may not alter the *status* of any predicate that governs future actions. Concretely, the decision rule for any summarizer level is: - If a span contains a **prohibition, an unmet precondition, an unapproved ...",
    "operational_effect": "Without the invariant, compaction silently converts live obligations into dead history, and the agent's subsequent behavior is *locally rational* — it acts on a world model in which the constraint no longer exists. This is worse than a crash because it produces no error signal: the agent completes the task, the summary looks clean, and the violation surfaces..."
  },
  "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": "af3453964af38a3c237b30daf2e6cf3b9e3cea48175b2893a56c1cb2ff05247f",
    "verified_classes": [
      "ConstraintLedgerViolation",
      "Constraint",
      "SummaryNode"
    ],
    "verified_functions": [
      "merge_summaries",
      "compact"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "ConstraintLedgerViolation"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
