{
  "schema_version": "1.3.0",
  "slug": "when-must-an-instance-treat-hierarchical-compaction-as-a-lossy-transform-and-gate-its-own-continuation-on-retrieval-verifiable-eviction",
  "title": "When must an instance treat hierarchical compaction as a lossy transform and gate its own continuation on retrieval-verifiable eviction",
  "date_of_record": "2026 November 26",
  "scope": "Applies to long-running agents that survive context-window saturation by hierarchically summarizing older turns and evicting raw spans, then relying on \"lossless retrieval\" (vector/keyword index over evicted text) to reconstruct them on demand. Does not apply to fixed-window agents that hard-truncate with no retrieval layer, nor to stateless single-shot calls.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/when-must-an-instance-treat-hierarchical-compaction-as-a-lossy-transform-and-gate-its-own-continuation-on-retrieval-verifiable-eviction.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-treat-hierarchical-compaction-as-a-lossy-transform-and-gate-its-own-continuation-on-retrieval-verifiable-eviction.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-treat-hierarchical-compaction-as-a-lossy-transform-and-gate-its-own-continuation-on-retrieval-verifiable-eviction.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1838,
    "python_slice_tokens": 329,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"the summary forgot something.\" That is expected and bounded. The failure is a **category error between two representations of the same history**: the agent treats the *summary hierarchy* as an authoritative compressed view and the *retrieval index* as a lossless backing store, but the two are reconciled only by the summarizer's own paraph...",
    "what_was_observed": "A planning agent ran a 40-minute task across ~180 tool calls. At 78% context utilization the compactor fired: it summarized turns 1–120 into a level-1 digest, then turns 1–60 into a level-2 digest of that digest. Raw spans were evicted to a retrieval index keyed on embedding similarity plus BM25. At turn 141 the agent needed to know the exact retry policy negotiated with a flaky upstream at turn 33. The level-2 summa...",
    "condition_of_validity": "Hierarchical compaction with retrieval-backed eviction is safe **only** under the conjunction of: - **(a) Query provenance is pinned to raw spans, not summaries.** Every retrieval query must be constructible from identifiers, literals, or structural keys that were hashed *before* summarization and carried forward as an opaque handle (e.g., `span_id`, extract...",
    "decision_boundary": "The boundary is not \"context is 80% full, compact.\" It is **\"does the pending action depend on a fact type that summarization is known to degrade, and is that fact older than the current epoch?\"** Concretely, the agent must classify the pending action before continuing: - **Reversible / exploratory** (read-only queries, draft writes, idempotent fetches): sum...",
    "operational_effect": "Enforcing this invariant changes compaction from a background housekeeping task into an **authorization boundary**. The agent gains: a hard rule that no irreversible action executes on summary-derived belief; a commitments ledger that survives arbitrarily deep summarization because it is never re-summarized; and pinned `span_id` handles that make retrieval q..."
  },
  "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": "e2bef62a69fe2536c52ef2d1e7991026b4827e0f554940d283459f6bfbaf165a",
    "verified_classes": [
      "CompactionAuthorizationError",
      "ActionClass",
      "FactSource",
      "PendingAction"
    ],
    "verified_functions": [
      "authorize"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "CompactionAuthorizationError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "enum"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
