{
  "schema_version": "1.3.0",
  "slug": "what-happens-when-an-instance-compacts-its-own-context-mid-task-and-the-summary-drops-the-active-constraint",
  "title": "What happens when an instance compacts its own context mid-task and the summary drops the active constraint",
  "date_of_record": "2026 November 20",
  "scope": "Applies to single-agent loops that trigger hierarchical summarization (auto-compaction) when the context window crosses a token threshold while a multi-step task is still in flight. Does not apply to stateless one-shot inference, nor to compaction performed offline between tasks where the task boundary is explicit and the successor instance re-derives state from an external store.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-compacts-its-own-context-mid-task-and-the-summary-drops-the-active-constraint.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-compacts-its-own-context-mid-task-and-the-summary-drops-the-active-constraint.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-compacts-its-own-context-mid-task-and-the-summary-drops-the-active-constraint.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1725,
    "python_slice_tokens": 198,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "Compaction is not a compression problem; it is a **state-selection problem under uncertainty about which state is still load-bearing**. A summarizer asked to reduce 180k tokens to 24k tokens optimizes for *salience* — what reads as important in the transcript. But the constraint that governs the *next* tool call is frequently low-salience: a single \"do not t...",
    "what_was_observed": "An agent executing a 40-step data-remediation task over a ticketing API. At turn 22 the context hit 92% of budget and auto-compaction fired. The transcript contained, at turn 4, an operator instruction: *\"Never issue a bulk transition on more than 50 tickets per call; the API rate-limiter bans the token for 10 minutes on violation.\"* At turn 22 the summarizer produced a 19k-token summary. The 50-ticket cap was not in...",
    "condition_of_validity": "The failure requires all of the following to co-occur: - **A binding constraint stated once, early, and not re-referenced.** If the constraint is restated near the compaction boundary, salience ranking keeps it. Recency is the summarizer's strongest signal. - **A compaction objective that is salience-ranked rather than obligation-preserving.** Hierarchical s...",
    "decision_boundary": "The boundary is between **compaction as lossy summarization** and **compaction as a checkpoint with an explicit invariant ledger**. The rule: > A constraint may be dropped from the working context only if it is (a) provably no longer applicable, or (b) preserved in a form that is re-injected on every subsequent step. \"It seemed unimportant\" is not (a). Opera...",
    "operational_effect": "With the invariant ledger pinned, the failure inverts into a detectable condition. The agent at turn 27, before issuing the bulk call, sees the pinned line `max_batch=50 (operator, turn 4)` and either chunks the call or raises rather than proceeding. The ledger costs a few hundred tokens per step — cheap relative to a 10-minute credential ban and an unsound ..."
  },
  "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": "7e8e09837b8be93cbf35f911d5478358087516ec8b8db2767dfa315947a6641c",
    "verified_classes": [
      "InvariantDroppedError",
      "CompactionPlan"
    ],
    "verified_functions": [
      "compact"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "InvariantDroppedError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
