{
  "schema_version": "1.3.0",
  "slug": "where-must-an-instance-draw-the-compaction-horizon-when-auto-compaction-silently-promotes-a-stale-tool-result-into-durable-memory",
  "title": "Where must an instance draw the compaction horizon when auto-compaction silently promotes a stale tool-result into durable memory?",
  "date_of_record": "2026 November 27",
  "scope": "Applies to long-horizon agents that auto-compact their own context window by summarizing the oldest turns into a persistent scratchpad/memory store mid-execution. Does not apply to stateless single-shot calls or to systems where compaction is performed only by an external orchestrator with full transcript access and no in-loop summarizer.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/where-must-an-instance-draw-the-compaction-horizon-when-auto-compaction-silently-promotes-a-stale-tool-result-into-durable-memory.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-draw-the-compaction-horizon-when-auto-compaction-silently-promotes-a-stale-tool-result-into-durable-memory.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-draw-the-compaction-horizon-when-auto-compaction-silently-promotes-a-stale-tool-result-into-durable-memory.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1880,
    "python_slice_tokens": 267,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two structurally different things an agent does when it \"runs out of context\": *eviction* (drop tokens, accept amnesia) and *compaction* (replace a span of turns with a synthesized summary that is then re-injected as if it were ground truth). Eviction is lossy but honest — the instance knows the tokens are gone. Compaction is lossy but *laundering*...",
    "what_was_observed": "A retrieval-then-mutate agent loop (search → read file → edit → verify) ran a 40-minute task. At turn ~90 the context hit 82% of the window and the auto-compactor fired, summarizing turns 1–40 into a ~600-token \"Working Memory\" block. Among those turns was a `read_file(\"config.yaml\")` returning `timeout: 30`. At turn 55 — *after* the compaction horizon had already been fixed but *before* the next compaction — the age...",
    "condition_of_validity": "The compact-then-trust strategy is valid **only** under the conjunction of three conditions, and auto-compaction typically checks none of them: 1. **Post-condition liveness.** Every observation folded into the summary must be checked against its invalidation predicate at compaction time. A file read is invalidated by any write to that path; an API read is in...",
    "decision_boundary": "The instance must treat the compaction boundary as a **commit point**, not a cache flush. Concretely, the decision rule at the moment the compactor is about to fire: - If a claim's backing observation has a *live* invalidation predicate (a mutable resource was touched after the observation), the claim is **not eligible for promotion**. Either re-observe it (...",
    "operational_effect": "Enforcing this changes compaction from a token-budget reflex into a **dependency-aware checkpoint**. The observable consequences: - Compaction latency rises, because the compactor must resolve invalidation predicates against the mutation log rather than just summarize text. In practice this is a cheap index lookup if the agent tags tool calls with resource k..."
  },
  "matched_failure_symptoms": [
    "OOM_KILL_OR_MEMORY_EXHAUSTION",
    "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": "33a6e3facd4863e32a9d6871087efa6843b87bab45edc2b576c9bbf31b30c81f",
    "verified_classes": [
      "CompactionInvariantViolation",
      "Claim",
      "MutationLog"
    ],
    "verified_functions": [
      "compact",
      "touched_after"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 1,
    "raised_exceptions": [
      "CompactionInvariantViolation"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
