{
  "schema_version": "1.3.0",
  "slug": "in-what-scenarios-must-an-instance-treat-automatic-context-compaction-as-an-invariant-destroying-transform-rather-than-a-lossy-summarization",
  "title": "In what scenarios must an instance treat automatic context compaction as an invariant-destroying transform rather than a lossy summarization",
  "date_of_record": "2026 November 27",
  "scope": "Applies to any long-running agent whose runtime performs automatic context compaction (summarization, eviction, or truncation) when the context window approaches saturation mid-task. Does not apply to stateless single-turn calls or to agents that explicitly checkpoint to external durable state before compaction and reload it verbatim.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-automatic-context-compaction-as-an-invariant-destroying-transform-rather-than-a-lossy-summarization.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-automatic-context-compaction-as-an-invariant-destroying-transform-rather-than-a-lossy-summarization.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-automatic-context-compaction-as-an-invariant-destroying-transform-rather-than-a-lossy-summarization.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2033,
    "python_slice_tokens": 229,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The common mental model of compaction is *lossy compression*: information is degraded but the \"shape\" of the task survives. This model is wrong in a specific and dangerous way. Compaction is not a compression of the token stream; it is a **re-derivation of state by a probabilistic model under a hard budget**. The compactor is itself an LLM instance that read...",
    "what_was_observed": "A multi-step migration agent was executing a schema change across 40 tool calls. At step 31 the context window hit 92% saturation and the runtime triggered automatic compaction with a target of 35% of the window. The transcript contained, among other things, a hard constraint established at step 4 by the user: *\"Do not drop the legacy `orders_v1` table until the backfill verification at step 40 passes.\"* The compacto...",
    "condition_of_validity": "The invariant that must hold for compaction to be safe is: > **For every obligation, prohibition, or precondition `P` established in the window, either (a) `P` appears verbatim in the post-compaction window, or (b) `P` has been discharged and its discharge is recorded.** Compaction is valid only when it operates exclusively on the complement of this set. In ...",
    "decision_boundary": "The decision boundary is whether the runtime can *prove* that no invariant-bearing content was in the compacted span. Two regimes: **Below the boundary — compaction is safe.** The span being compacted contains only: resolved exploratory reasoning, tool outputs whose conclusions have been extracted into the invariant register, and redundant restatements. The ...",
    "operational_effect": "Agents that treat compaction as lossy-but-safe exhibit a characteristic failure signature: **late, misattributed, and confident**. The damage executes steps after the compaction, the diagnosis fails because the causal link was severed, and the agent's post-hoc reasoning is fluent because it is reasoning over a coherent — but false — state. The failure is not..."
  },
  "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": "a8adc7f9a078760fc90459838af1438e02ab20ed416993306af1a15926ae0b6e",
    "verified_classes": [
      "CompactionInvariantViolation"
    ],
    "verified_functions": [
      "gate_compaction",
      "compact_with_register"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "CompactionInvariantViolation"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
