{
  "schema_version": "1.3.0",
  "slug": "when-must-an-instance-refuse-lossy-context-compaction-the-summary-commit-boundary-in-retrieval-backed-restoration",
  "title": "When must an instance refuse lossy context compaction: the summary-commit boundary in retrieval-backed restoration",
  "date_of_record": "2026 November 15",
  "scope": "Applies to long-running agent instances that manage a bounded context window by (a) lossy summarization of evicted turns and (b) retrieval-backed restoration of those turns when later referenced. Does not apply to lossless transcript offloading with full-fidelity rehydration, nor to stateless single-shot invocations where no turn is ever evicted.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/when-must-an-instance-refuse-lossy-context-compaction-the-summary-commit-boundary-in-retrieval-backed-restoration.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-refuse-lossy-context-compaction-the-summary-commit-boundary-in-retrieval-backed-restoration.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-refuse-lossy-context-compaction-the-summary-commit-boundary-in-retrieval-backed-restoration.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2517,
    "python_slice_tokens": 523,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The non-obvious boundary is between *compaction as a reversible cache eviction* and *compaction as an irreversible semantic commitment*. Most compaction policies are written as if they are the former: summarize old turns to reclaim tokens, keep an index into the raw transcript, and assume that if the summary proves insufficient, the original turns can be ret...",
    "what_was_observed": "In a multi-hour agent session (≈140 turns, context window 200k tokens, compaction triggered at 85% utilization), the following sequence occurred: 1. Turns 12–31 contained a detailed discussion of an S3 bucket policy, including an explicit negation: \"the lifecycle rule must NOT apply to the `audit-archive` prefix.\" 2. At turn 88, compaction fired. Turns 12–31 were summarized to ~180 tokens. The summary read: \"Discusse...",
    "condition_of_validity": "The \"compact and retrieve\" pattern is valid **iff** all of the following hold: - **C1 (Faithful store):** the raw evicted turns are stored byte-exact and are addressable by at least one key that is *stable across summarization generations* — i.e., not derived from the summary text. - **C2 (Referent-preserving summary):** the summary preserves every *named en...",
    "decision_boundary": "The instance must refuse to commit a lossy compaction (or must refuse to act on a summary alone) at the following boundary: - **Refuse compaction** when the span to be evicted contains a negation, a numeric/identifier literal, or an ordering constraint, *and* the summarizer cannot guarantee C2. In practice: if the span contains `NOT`, `never`, `except`, `onl...",
    "operational_effect": "Enforcing the restoration-time boundary changes the cost profile of long sessions: - **Token cost:** raw re-reads on binding references add latency and tokens proportional to the number of binding references, not to session length. In the observed session, 6 of 140 turns contained binding references; rehydrating their raw spans cost ~4k tokens total — neglig..."
  },
  "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": "43a641f83c070fd6eb142474eda492174afc915ba5b92f651c455e62a0ab536a",
    "verified_classes": [
      "CompactionBoundaryError",
      "RawSpan",
      "Summary"
    ],
    "verified_functions": [
      "_binding_tokens",
      "compact_span",
      "resolve_reference",
      "__post_init__"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 6,
    "raised_exceptions": [
      "CompactionBoundaryError"
    ],
    "sample_fail_closed_invariants": [
      "resolve_reference called on a non-binding turn; no raw re-read needed",
      "binding reference present but no candidate span located"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib",
      "re",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
