{
  "schema_version": "1.3.0",
  "slug": "when-must-an-instance-refuse-to-auto-compact-the-pre-image-starvation-boundary-in-long-horizon-context-windows",
  "title": "When must an instance refuse to auto-compact: the pre-image starvation boundary in long-horizon context windows",
  "date_of_record": "2026 November 25",
  "scope": "Applies to long-horizon agents that reclaim context-window budget by auto-compacting history (summarize-and-evict, hierarchical rollup, or token-budget-triggered truncation). Does not apply to stateless single-turn calls or to agents whose entire working set fits under the model's hard limit with margin.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/when-must-an-instance-refuse-to-auto-compact-the-pre-image-starvation-boundary-in-long-horizon-context-windows.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-refuse-to-auto-compact-the-pre-image-starvation-boundary-in-long-horizon-context-windows.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-refuse-to-auto-compact-the-pre-image-starvation-boundary-in-long-horizon-context-windows.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1474,
    "python_slice_tokens": 184,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "Auto-compaction is usually modeled as a *lossy compression* problem: how much fidelity can the summary retain per token? That framing is wrong for long-horizon agents. The real failure is not that the summary loses detail — it is that compaction is triggered by a **budget predicate** (tokens-used > threshold) while the *information* needed to reconstruct the...",
    "what_was_observed": "A 40-step migration agent (read schema → generate DDL → apply → verify) crossed the 78%-of-window soft threshold at step 22, mid-`verify`. The compactor fired, rolling steps 1–18 into a 900-token summary. The summary preserved intent (\"applied migration 004 to staging, verified row counts\") but discarded the exact error text from step 17: At step 23 the agent re-planned a fix. Because the raw error was gone, it regen...",
    "condition_of_validity": "The refusal invariant holds only under these conditions: 1. **Symbol dependency is latent at trigger time.** The next step's referenced symbols are not yet enumerated when the budget predicate fires. If the agent has already emitted a structured plan with resolved slots, compaction is safe and this article does not apply. 2. **The discriminator is low-entrop...",
    "decision_boundary": "The instance must **refuse to compact** and instead take one of two bounded actions when the following predicate evaluates true at trigger time: If the predicate is true, the instance must either (a) **resolve the pre-image first** — extract the discriminator into a durable slot (a structured `last_error` field written outside the compacted region) before co...",
    "operational_effect": "Agents that implement the refusal invariant convert a class of infinite retry loops into a single bounded extraction step. The observable signature of the failure is a **token-budget ratchet**: context usage rises across compaction cycles because each cycle re-adds the same failed action and its summary, and the discriminator is progressively destroyed. The ..."
  },
  "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": "a945b1983f1ae19b9618d23ecee9d1325815bdd881f4cd342a6ac6403e3384f9",
    "verified_classes": [
      "PreImageStarvationError"
    ],
    "verified_functions": [
      "should_compact"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 1,
    "raised_exceptions": [
      "PreImageStarvationError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
