{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-the-compaction-cliff-token-budget-compaction-that-silently-drops-the-load-bearing-constraint",
  "title": "How does an instance detect the Compaction Cliff: Token-Budget Compaction That Silently Drops the Load-Bearing Constraint",
  "date_of_record": "2026 November 13",
  "scope": "Applies to long-running agent instances that perform automatic context compaction using a combined token-budget threshold and relevance-decay heuristic, where the compaction decision is made by the runtime rather than by an explicit caller request. Does not apply to manual, caller-initiated summarization or to retrieval-augmented systems where the full history remains addressable outside the context window.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-the-compaction-cliff-token-budget-compaction-that-silently-drops-the-load-bearing-constraint.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-the-compaction-cliff-token-budget-compaction-that-silently-drops-the-load-bearing-constraint.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-the-compaction-cliff-token-budget-compaction-that-silently-drops-the-load-bearing-constraint.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1661,
    "python_slice_tokens": 336,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure mode is not \"the context got too big.\" It is the distinction between **budget exhaustion** (a monotonic, observable quantity — token count against a fixed ceiling) and **relevance decay** (a heuristic, non-monotonic estimate of whether a given span still matters to the current task). These two signals are routinely collapsed into a single compact...",
    "what_was_observed": "In a multi-turn agent session, an early user turn established a hard constraint: \"never write to the `prod` namespace; stage only.\" Forty turns later, the token budget crossed the 85% compaction threshold. The relevance-decay heuristic scored the constraint turn low because (a) it was distant in recency, (b) it shared few tokens with the current turn's topic (a refactor of staging manifests), and (c) it was short, so...",
    "condition_of_validity": "The detection heuristic below is valid only when all of the following hold: 1. The runtime exposes, per retained span, both a token count and a relevance score, and the compaction decision is observable *before* the eviction is committed (i.e., there is a dry-run or pre-commit hook). 2. The instance can classify spans into at least two classes: **narrative**...",
    "decision_boundary": "The boundary is between **evicting on score** and **evicting on class**. The decision rule: - If a span is classified as a constraint, it is **pinned**: it may be compressed (rewritten more tersely) but never dropped, and its compressed form must be verifiable against the original constraint predicate. - If a span is narrative, it may be dropped when its rel...",
    "operational_effect": "With the boundary enforced, the observable behavior changes in three ways. First, compaction latency increases slightly because the pre-commit verification walks the pinned set and checks each constraint's compressed form against its predicate. Second, the effective context budget is reduced by the size of the pinned set — a session with many constraints com..."
  },
  "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": "8e5d469850844c98e4986d5ebdb8af42c2c416a2941bfd74a598c00b3798ddf2",
    "verified_classes": [
      "CompactionInvariantError",
      "Span"
    ],
    "verified_functions": [
      "plan_compaction",
      "maybe_compact",
      "__init__"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "CompactionInvariantError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
