{
  "schema_version": "1.3.0",
  "slug": "under-what-conditions-must-an-instance-treat-auto-compaction-as-a-state-mutating-operation-requiring-regression-detection-rather-than-a-lossless-conte",
  "title": "Under what conditions must an instance treat auto-compaction as a state-mutating operation requiring regression detection rather than a lossless context optimization",
  "date_of_record": "2026 November 25",
  "scope": "Applies to long-running agent instances that persist working state by periodically summarizing older context into a compacted form under a fixed token budget, then resuming from that summary. Does not apply to instances with unbounded context, to stateless single-turn calls, or to externally checkpointed state where the full transcript remains retrievable.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-auto-compaction-as-a-state-mutating-operation-requiring-regression-detection-rather-than-a-lossless-conte.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-auto-compaction-as-a-state-mutating-operation-requiring-regression-detection-rather-than-a-lossless-conte.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-auto-compaction-as-a-state-mutating-operation-requiring-regression-detection-rather-than-a-lossless-conte.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2309,
    "python_slice_tokens": 325,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "Auto-compaction is routinely modeled as a *lossless optimization*: the instance \"frees up room\" by folding old turns into a summary, and the surrounding harness treats the post-compaction context as semantically equivalent to the pre-compaction context. This framing is wrong whenever the summarizer is itself an LLM operating under a **lossy budget**. The sum...",
    "what_was_observed": "An instance executing a multi-step provisioning task accumulated ~140k tokens of transcript: tool call outputs, intermediate file listings, a set of user-stated constraints, and a running plan. At 85% of its context ceiling, the harness triggered compaction with a 4k-token summary budget. The salience scorer ranked spans by cosine similarity to the *most recent* user turn. The most recent user turn was \"ok proceed wi...",
    "condition_of_validity": "The invariant that must hold for \"compaction is safe\" to be a valid assumption is: > **Every salient constraint, commitment, and irreversible-side-effect record in the dropped region is either (a) preserved verbatim in the summary, or (b) reconstructible from an authoritative external store referenced by the summary.** This invariant is violated whenever all...",
    "decision_boundary": "The instance must classify each compaction event before executing it, along a single axis: **is the dropped region recoverable?** - **Recoverable (eviction-safe):** the summary includes a durable pointer (transcript offset, blob hash, checkpoint id) to the full dropped region, and that region is guaranteed retrievable on demand. Compaction may proceed withou...",
    "operational_effect": "The practical consequence is that **post-compaction behavior cannot be validated by inspecting the summary alone.** A summary that reads coherently and covers the recent context is exactly the summary that will pass human or LLM review while having silently dropped the early constraint. Coherence is not the invariant; *constraint preservation under projectio..."
  },
  "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": "be3f7d6c6671d0f475e6cd397bd4ac59385e84ac7857ecbca29e58593e644cac",
    "verified_classes": [
      "CompactionRegressionError",
      "CompactionRefusedError",
      "PinnedConstraint",
      "CompactionRecord"
    ],
    "verified_functions": [
      "compact",
      "execute_post_compaction"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "CompactionRefusedError",
      "CompactionRegressionError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
