{
  "schema_version": "1.3.0",
  "slug": "under-what-conditions-must-an-instance-refuse-to-compact-the-silent-invariant-loss-boundary-in-automatic-context-compaction-under-window-pressure",
  "title": "Under what conditions must an instance refuse to compact: the \"silent invariant loss\" boundary in automatic context compaction under window pressure",
  "date_of_record": "2026 November 29",
  "scope": "Applies to any agent that performs automatic context compaction (summarization, eviction, hierarchical roll-up, or KV-cache pruning) while a multi-step task is in flight and the compaction decision is made by the same model whose window is under pressure. Does not apply to stateless single-turn inference, nor to compaction performed by a separate, tool-grounded summarizer that has access to a durable external store.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-refuse-to-compact-the-silent-invariant-loss-boundary-in-automatic-context-compaction-under-window-pressure.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-refuse-to-compact-the-silent-invariant-loss-boundary-in-automatic-context-compaction-under-window-pressure.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-refuse-to-compact-the-silent-invariant-loss-boundary-in-automatic-context-compaction-under-window-pressure.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2323,
    "python_slice_tokens": 365,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The distinction that matters is between **compaction as lossy compression of history** and **compaction as silent re-derivation of constraints**. The first is legitimate: old tool outputs, redundant reasoning traces, and superseded plans can be summarized without invalidating the task. The second is the failure mode: when the compactor rewrites the *set of a...",
    "what_was_observed": "A long-horizon agent task (a migration job: enumerate resources, plan, execute per-resource, verify) ran with a rolling-summary compactor triggered at 80% window occupancy. The task carried three task-critical constraints established early: (1) a hard prohibition on mutating any resource tagged `prod`, (2) a specific rollback checkpoint ID, and (3) a numeric batch-size limit of 40 derived from a downstream rate limit...",
    "condition_of_validity": "The invariant that bounds this failure is: **a constraint is compaction-safe if and only if it is idempotent under re-summarization and recoverable from an external store.** Operationally, an agent must classify every in-context item into one of two sets before any compaction pass: - **Compactable:** redundant tool outputs, superseded plans, exploratory reas...",
    "decision_boundary": "The decision boundary is the point at which the agent must choose between three actions as occupancy crosses the trigger threshold: 1. **Compact freely** — only when the pinned set is empty or fully externalized to a durable store *and* verified retrievable. This is the rare case. 2. **Compact with pinning** — the normal case: extract the pinned set mechanic...",
    "operational_effect": "The operational consequence is a shift in where the agent spends its safety budget. Under naive compaction, the budget is spent *after* the fact — detecting violations and rolling back — which requires the rollback state to have survived, which it often hasn't. Under pinning, the budget is spent *at compaction time* — a mechanical extraction pass and a reser..."
  },
  "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": "2c8ed681c3c0b49ce2cc7f9605236619c7492eeaa6ab07fa613c10ef783c0fff",
    "verified_classes": [
      "CompactionRefused",
      "ItemClass",
      "ContextItem",
      "CompactionPlan"
    ],
    "verified_functions": [
      "classify_mechanically",
      "build_plan",
      "compact"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "CompactionRefused"
    ],
    "sample_fail_closed_invariants": [
      "no pinned state and no external-store verification; refusing to compact"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "enum",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
