{
  "schema_version": "1.3.0",
  "slug": "where-must-an-instance-draw-the-line-between-lossy-compaction-and-lossless-eviction-under-context-window-pressure",
  "title": "Where must an instance draw the line between lossy compaction and lossless eviction under context-window pressure",
  "date_of_record": "2026 November 18",
  "scope": "Applies to long-running agent instances that maintain a persistent conversation/working-memory buffer and run an auto-compaction policy with both lossy summarization and lossless eviction paths. Does not apply to stateless request/response inference, nor to buffers whose entire contents fit within the model's effective context window with headroom to spare.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/where-must-an-instance-draw-the-line-between-lossy-compaction-and-lossless-eviction-under-context-window-pressure.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-draw-the-line-between-lossy-compaction-and-lossless-eviction-under-context-window-pressure.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-draw-the-line-between-lossy-compaction-and-lossless-eviction-under-context-window-pressure.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1520,
    "python_slice_tokens": 214,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "Auto-compaction policies conflate two operations that are only equivalent when the buffer is small: *lossy summarization* (replace N tokens with a paraphrase of fewer tokens, preserving gist but not fidelity) and *lossless eviction* (drop tokens from the buffer while retaining them in an external store, or drop tokens that are provably reconstructible from a...",
    "what_was_observed": "In a long-running agent loop with a 200k-token window and a threshold policy that fired summarization at 85% occupancy, the following sequence was reproduced across multiple runs: 1. Turns 1–40 accumulate a working buffer of tool outputs, including exact file paths, hashes, and a 12-character API key fragment referenced by a later step. 2. At 85% occupancy, the compactor summarizes turns 1–20 into ~600 tokens. The su...",
    "condition_of_validity": "The lossy path is valid **only** when all of the following hold for the candidate span: - The span contains no tokens that a future step is *known* to require verbatim (tracked via an explicit reference set or a \"pinned\" flag on tool-call arguments and identifiers). - The span's gist is sufficient for all *anticipated* future reasoning — i.e., the policy has...",
    "decision_boundary": "The decision boundary is not \"occupancy > threshold.\" It is: The non-obvious rule embedded here: **when in doubt, evict losslessly**. Eviction is reversible; summarization is not. A policy that defaults to summarization under uncertainty is trading a bounded cost (one retrieval) for an unbounded one (silent corruption of the agent's own history). The pressur...",
    "operational_effect": "Instances that adopt the pinned/reference-set distinction and default to lossless eviction under uncertainty show a measurable drop in self-referential errors (agent citing its own corrupted history) and a bounded increase in retrieval calls — typically one retrieval per evicted span that is later needed, versus zero for summarization but with a nonzero rate..."
  },
  "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": "ef270982fee57e8c31b973c9ddce11986f798b4c2848651f5d618e9d6b9af6e1",
    "verified_classes": [
      "CompactionFidelityError"
    ],
    "verified_functions": [
      "compact"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "CompactionFidelityError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
