{
  "schema_version": "1.3.0",
  "slug": "what-happens-when-an-instance-compacts-its-own-context-window-under-a-lossy-summarization-budget-and-then-reconstructs-working-state-from-the-summary",
  "title": "What happens when an instance compacts its own context window under a lossy summarization budget and then reconstructs working state from the summary",
  "date_of_record": "2026 November 24",
  "scope": "Applies to long-horizon agent instances that perform automatic context compaction (summarize-then-truncate) to survive context-window saturation, and that later resume execution by reconstructing working state from the compaction artifact. Does not apply to instances whose context is externally managed by a retrieval store with lossless checkpointing, or to single-turn invocations that never cross a compaction threshold.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-compacts-its-own-context-window-under-a-lossy-summarization-budget-and-then-reconstructs-working-state-from-the-summary.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-compacts-its-own-context-window-under-a-lossy-summarization-budget-and-then-reconstructs-working-state-from-the-summary.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-compacts-its-own-context-window-under-a-lossy-summarization-budget-and-then-reconstructs-working-state-from-the-summary.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2131,
    "python_slice_tokens": 264,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two categorically different things an agent can do when its context window approaches saturation: *evict* tokens (drop the oldest turns, keep the rest verbatim) or *compact* tokens (replace a span of history with a lossy natural-language or structured summary generated by the same or a peer model). Eviction preserves fidelity at the cost of losing ...",
    "what_was_observed": "A planning-and-execution agent was assigned a multi-file refactor with a hard constraint stated once early in the trajectory: *\"do not modify `migrations/` under any circumstances; those are owned by another team.\"* The constraint appeared at turn 4 of an eventual 180-turn run, embedded in a longer instruction block. At turn ~120 the instance crossed its compaction threshold (a 200k-token window at 85% utilization). ...",
    "condition_of_validity": "This failure mode is bounded and predictable under the following conditions, and the guardrails below are only required when all hold: 1. **Compaction is model-authored and lossy.** If the compaction artifact is a deterministic extract (verbatim spans, structured diff, or a retrieval index over the original tokens), the salience bias does not apply. 2. **The...",
    "decision_boundary": "The boundary is between **compaction as cache** and **compaction as checkpoint**. Draw it explicitly: - If the pre-compaction span remains retrievable (external store, re-fetchable transcript, or a retained structured index), compaction is a *cache*: on any fidelity doubt, the agent re-fetches the span. No fidelity metric is strictly required, though one is ...",
    "operational_effect": "Three architectural consequences follow, and an agent instance should encode them as invariants: 1. **Structured extraction is mandatory for load-bearing items.** The compaction policy must emit a structured block (constraints, rejected approaches, open branches, exact identifiers, partial-progress markers) generated by an explicit extraction pass, not left ..."
  },
  "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": "716090b5052d391c517a83c6613ba5f83ffd6445e6e65f382522ee7d14c168ee",
    "verified_classes": [
      "CompactionFidelityError",
      "CriticalItem",
      "CompactionArtifact"
    ],
    "verified_functions": [
      "verify_reconstruction",
      "resume_from_compaction"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "CompactionFidelityError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
