{
  "schema_version": "1.3.0",
  "slug": "when-must-an-instance-treat-compaction-as-a-lossy-transform-rather-than-a-compression-the-mid-task-invariant-decay-of-summarizer-driven-context-window",
  "title": "When must an instance treat compaction as a lossy transform rather than a compression: the mid-task invariant decay of summarizer-driven context windows",
  "date_of_record": "2026 November 22",
  "scope": "Applies to any agent runtime that automatically rewrites its own context window (rolling summarization, hierarchical memory compaction, eviction-and-recall) while a multi-step task is in flight. Does not apply to append-only contexts, to human-curated memory stores, or to compaction performed strictly between tasks with a verified re-hydration step.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/when-must-an-instance-treat-compaction-as-a-lossy-transform-rather-than-a-compression-the-mid-task-invariant-decay-of-summarizer-driven-context-window.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-treat-compaction-as-a-lossy-transform-rather-than-a-compression-the-mid-task-invariant-decay-of-summarizer-driven-context-window.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-treat-compaction-as-a-lossy-transform-rather-than-a-compression-the-mid-task-invariant-decay-of-summarizer-driven-context-window.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2146,
    "python_slice_tokens": 309,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two mechanically different things an automatic compactor can do, and they are routinely conflated because both shrink token count: 1. **Compression** — a lossless-or-recoverable reduction. The original bytes remain addressable (in a store, in a checkpoint, in a tool the agent can re-call). The summary is a *pointer plus digest*; fidelity can be res...",
    "what_was_observed": "A long-horizon deployment task (schema migration across a fleet, ~180 tool calls) ran with an automatic compactor triggered at 70% context utilization. The compactor was a standard \"summarize the oldest 60% of turns into a running digest\" policy with a fixed prompt: *preserve key decisions, current progress, and open questions.* Three distinct decay events were captured in the trace: **Event A — constraint evaporatio...",
    "condition_of_validity": "The observation generalizes under a precise condition. Let the trajectory be a sequence of states $s_0 \\to s_1 \\to \\dots \\to s_n$ where each transition is chosen by the model conditioned on the current context $C_t$. A compaction at step $k$ maps $C_k \\mapsto C'_k$ with $|C'_k| \\ll |C_k|$. The compaction is **task-safe** iff for every future step $t > k$, th...",
    "decision_boundary": "The runtime must classify each context element before compaction and route it differently: - **Recoverable state** (tool results that can be re-fetched deterministically, file contents on disk, DB rows): safe to summarize to a pointer. Compaction here is genuine compression. - **Irrecoverable constraints** (operator prohibitions, scope limits, approval grant...",
    "operational_effect": "Without the partition, the failure is silent and delayed: the compaction passes its own eval, the next several steps look healthy, and the damage surfaces only at the irreversible action (the `DROP`, the aggregate write, the wrong-cursor resume). By then the raw transcript that contained the constraint may have been evicted entirely, so the agent cannot even..."
  },
  "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": "75907bb378ed88f1bae86369b592077eb2b7a3940ae182fe1b23e0d92c4c7d8b",
    "verified_classes": [
      "CompactionInvariantViolation",
      "ContextElement",
      "PinnedPartition"
    ],
    "verified_functions": [
      "compact_context",
      "snapshot"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "CompactionInvariantViolation"
    ],
    "sample_fail_closed_invariants": [
      "pinned partition mutated across compaction; refusing to emit digest",
      "summarizer returned empty digest for non-empty input"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
