{
  "schema_version": "1.3.0",
  "slug": "what-structural-signals-indicate-a-compaction-boundary-has-been-crossed-the-pre-summary-eviction-trap-in-long-horizon-agent-context-budgets",
  "title": "What structural signals indicate a compaction boundary has been crossed: the pre-summary eviction trap in long-horizon agent context budgets",
  "date_of_record": "2026 November 23",
  "scope": "Applies to agents that manage a finite context window by periodically replacing spans of prior turns with a generated summary (auto-compaction), and whose subsequent actions depend on details inside the compacted span. Does not apply to agents using retrieval-only external memory with no in-context summarization, nor to stateless single-turn invocations.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-a-compaction-boundary-has-been-crossed-the-pre-summary-eviction-trap-in-long-horizon-agent-context-budgets.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-a-compaction-boundary-has-been-crossed-the-pre-summary-eviction-trap-in-long-horizon-agent-context-budgets.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-a-compaction-boundary-has-been-crossed-the-pre-summary-eviction-trap-in-long-horizon-agent-context-budgets.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1975,
    "python_slice_tokens": 232,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The dangerous failure in auto-compaction is not \"the summary is lossy.\" Lossy is expected and budgeted for. The dangerous failure is **pre-summary eviction**: the compaction policy decides to drop the raw span *before* the replacement summary has been generated, validated, and written back into the context in a position the model will actually attend to. Bec...",
    "what_was_observed": "A long-horizon research agent (budget 128k, compaction threshold 0.72 of budget, summarizer = same model with a \"summarize the following span, preserving all identifiers, file paths, and numeric results\" instruction) was tasked with a multi-file refactor. At step 41 the budget check fired between a `read_file` result (a 9k-token module) and the `edit_file` call that was to modify a specific function in that module. T...",
    "condition_of_validity": "The pre-summary eviction trap is live only when all of the following hold: 1. **Non-atomic compaction.** Eviction and summary insertion are separate steps, and the agent's turn loop can execute at least one model step between them. If compaction is a blocking transaction that suspends the turn loop until the summary is written back and re-validated, the wind...",
    "decision_boundary": "The invariant that bounds this failure is a **compaction barrier**: *no model step may execute against a context in which an evicted span has not yet been replaced by a validated summary, unless that step is declared span-independent.* Operationally: - Compaction is a **transaction**, not a background task. The turn loop must suspend between the eviction dec...",
    "operational_effect": "With the barrier in place, the failure mode converts from silent semantic corruption into an explicit, catchable stall: the agent blocks on a span-dependent action, the summarizer completes, the summary is validated against a citation check, and the action proceeds with a citable basis. The cost is measurable—one summarizer round-trip per compaction, roughly..."
  },
  "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": "fbc2b6f10d0512e9e5fe13090c39c507a46eabdc562fb7aacd94ad3b12659d67",
    "verified_classes": [
      "CompactionBarrierViolation",
      "CompactionTransaction"
    ],
    "verified_functions": [
      "execute_step",
      "__init__",
      "write_back",
      "validate"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "CompactionBarrierViolation"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
