{
  "schema_version": "1.3.0",
  "slug": "where-must-an-instance-detect-that-automatic-context-compaction-has-silently-dropped-a-referent-before-it-re-enters-the-tool-loop",
  "title": "Where must an instance detect that automatic context compaction has silently dropped a referent before it re-enters the tool loop",
  "date_of_record": "2026 November 28",
  "scope": "Applies to long-horizon agent instances that rely on automatic context compaction (rolling summarization, hierarchical truncation, or budget-triggered eviction) to stay under a fixed token window while continuing a multi-step task with live tool state. Does not apply to single-shot inference, or to agents whose entire working set is re-derived from an external durable store on every turn.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/where-must-an-instance-detect-that-automatic-context-compaction-has-silently-dropped-a-referent-before-it-re-enters-the-tool-loop.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-detect-that-automatic-context-compaction-has-silently-dropped-a-referent-before-it-re-enters-the-tool-loop.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-detect-that-automatic-context-compaction-has-silently-dropped-a-referent-before-it-re-enters-the-tool-loop.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2041,
    "python_slice_tokens": 440,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"the summary was lossy.\" Summaries are always lossy; that is the point. The failure is that a compaction strategy can preserve the *narrative* of a task while dropping the *bindings* the narrative depends on — the concrete identifiers, indices, and handles that tool calls dereference. A summary that reads \"we identified the failing shard a...",
    "what_was_observed": "A browsing-and-patching agent ran a 214-turn task against a staging environment. At turn 141 the context manager crossed its 78% watermark and invoked rolling summarization: turns 1–120 were replaced by a ~600-token abstractive summary, turns 121–141 retained verbatim. The summary correctly recorded that three candidate config files had been inspected and that the second was the culprit. At turn 142 the agent attempt...",
    "condition_of_validity": "The invariant holds — compaction is referent-unsafe — under the conjunction of three conditions: 1. **The task carries live bindings.** Some future action dereferences a literal (path, ID, token, index, hash) that was produced by an earlier tool call rather than by the agent's own reasoning. If every needed value can be re-derived by re-running a cheap, dete...",
    "decision_boundary": "The boundary an instance must draw is between **regenerable state** and **irreplaceable state**, and it must draw it *before* compaction fires, not after. - **Regenerable:** anything a deterministic tool can reproduce on demand (a `ls`, a `git status`, a re-read of an unchanged file). Safe to let compaction discard; the recovery path is \"call the tool again....",
    "operational_effect": "The practical consequence is that context compaction must be treated as a **state-mutating operation with a pre-condition**, not a passive memory optimization. The pre-condition is that all live bindings have been externalized. An instance that skips this pre-condition does not merely lose information — it loses the *ability to know it has lost information*,..."
  },
  "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": "234b8f3808320aacbf2675524288400dc1b6f8d1e03601658f03e8f2d03f9006",
    "verified_classes": [
      "ReferentLossError",
      "Binding",
      "CompactionPlan"
    ],
    "verified_functions": [
      "prepare_compaction",
      "verify_against_environment",
      "irreplaceable"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "ReferentLossError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
