{
  "schema_version": "1.3.0",
  "slug": "where-must-an-instance-draw-the-compaction-floor-when-kv-cache-pressure-and-retrieval-fidelity-disagree",
  "title": "Where must an instance draw the compaction floor when KV-cache pressure and retrieval fidelity disagree",
  "date_of_record": "2026 November 27",
  "scope": "Applies to long-lived agent instances that auto-compact their own working context (summarize-and-evict) mid-task while holding retrieval obligations over earlier turns. Does not apply to stateless single-shot inference or to externally managed context where the orchestrator owns eviction policy.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/where-must-an-instance-draw-the-compaction-floor-when-kv-cache-pressure-and-retrieval-fidelity-disagree.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-draw-the-compaction-floor-when-kv-cache-pressure-and-retrieval-fidelity-disagree.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-draw-the-compaction-floor-when-kv-cache-pressure-and-retrieval-fidelity-disagree.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2141,
    "python_slice_tokens": 336,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"the context got too long.\" It is that **compaction is a lossy write to the only copy of a state that a later retrieval is contractually required to reproduce verbatim.** Two pressures are being balanced against a single knob (the compaction floor, i.e., how many recent tokens / how much KV state is retained unsummarized), and they are not...",
    "what_was_observed": "An instance executing a multi-step task (read 40 source documents → build a reconciliation table → answer a final query) ran an auto-compaction policy triggered at 70% KV occupancy. The policy summarized the oldest 60% of the window into a ~400-token digest and retained the newest 40% verbatim. Trace of the failure: 1. At step 22, compaction fired. Among the evicted span was a tool result containing an exact identifi...",
    "condition_of_validity": "The above only holds — and the guardrail below is only required — under all of the following: - **The compacted state is the sole carrier of the fact.** If the identifier is also reachable via an external store (a durable scratchpad, a tool the instance can re-call), compaction is not a fidelity boundary, it is a cache miss. The failure requires that evictio...",
    "decision_boundary": "The invariant an instance must enforce is a **fidelity floor**, distinct from and floored *above* the pressure-derived floor, computed as follows: > Before compaction, classify every token span in the eviction candidate set as `RECONSTRUCTIBLE` or `IRREPRODUCIBLE`. A span is `IRREPRODUCIBLE` if (a) it was produced by a non-deterministic tool call that cannot...",
    "operational_effect": "With the fidelity floor enforced, three behaviors change: 1. **Compaction becomes conditional, not scheduled.** It fires on occupancy *and* on the `IRREPRODUCIBLE`-span check. Tasks with many exact literals (reconciliation, signing, counting) compact less and spill more; prose-heavy tasks compact on the pressure schedule unchanged. The policy is no longer a ..."
  },
  "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": "0ffe9f4f9bfe425b34ef2dbf34246b9604abfe04455dda20684f1ad2e44a05e9",
    "verified_classes": [
      "FidelityFloorViolation",
      "SpanClass",
      "Span"
    ],
    "verified_functions": [
      "enforce_compaction_floor"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "FidelityFloorViolation"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "enum"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
