{
  "schema_version": "1.3.0",
  "slug": "what-structural-signals-indicate-a-lossy-auto-compaction-boundary-has-been-crossed-before-retrieval-backed-recovery-can-fire",
  "title": "What structural signals indicate a lossy auto-compaction boundary has been crossed before retrieval-backed recovery can fire",
  "date_of_record": "2026 November 29",
  "scope": "Applies to long-running agent sessions whose context manager performs automatic compaction (summarize-and-evict) under a token-pressure trigger, with a retrieval index over evicted spans as the recovery path. Does not apply to stateless single-turn inference, nor to architectures where compaction is disabled and the full transcript is retained verbatim.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-a-lossy-auto-compaction-boundary-has-been-crossed-before-retrieval-backed-recovery-can-fire.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-a-lossy-auto-compaction-boundary-has-been-crossed-before-retrieval-backed-recovery-can-fire.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-a-lossy-auto-compaction-boundary-has-been-crossed-before-retrieval-backed-recovery-can-fire.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2250,
    "python_slice_tokens": 324,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure mode is not \"the summary was bad.\" It is a **timing inversion between two lossy systems that are assumed to be complementary**. Auto-compaction is a *forward* lossy projection: it replaces a span of turns with a summary generated under a token budget, and the projection is *not invertible*. Retrieval-backed recovery is a *backward* lossy projecti...",
    "what_was_observed": "A planning agent ran a 40-step tool-orchestration task against a ticketing backend. At step 19, token pressure crossed the compaction threshold (0.82 of window). The compactor summarized steps 1–14 into 310 tokens and evicted the raw spans. The evicted region contained three facts that later mattered: 1. An early constraint: \"do not mutate tickets owned by team `billing-core` without an approval token\" — stated once,...",
    "condition_of_validity": "The invariant \"compaction is safe because retrieval can recover evicted spans\" is valid **if and only if** at least one of the following holds for every fact whose loss would change a downstream action: - **(A) Query-anchor preservation.** The summary retains the lexical or semantic anchors sufficient for the agent, from a future reasoning state, to formulat...",
    "decision_boundary": "The operational decision is **when to compact versus when to checkpoint-and-restart**, and it hinges on a measurable ratio, not a vibe. Define, for a candidate eviction span `S` with summary `σ(S)`: - `ρ = tokens(σ(S)) / tokens(S)` — compression ratio. - `κ = |anchors(σ(S)) ∩ anchors(S)| / |anchors(S)|` — anchor retention, where anchors are extracted identif...",
    "operational_effect": "When the boundary is respected — `μ = true` and `κ` above threshold — the agent's behavior changes in an observable way: it issues retrieval calls *before* acting on elided spans, and those calls succeed because anchors survive. The retrieval index stops being decorative and becomes load-bearing. Latency rises modestly (one extra round-trip per elided-span t..."
  },
  "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": "c81be8ceef40f26a958ed10ed461721ae29f34f178021442830eb23e3ef57a3a",
    "verified_classes": [
      "CompactionBoundaryViolation",
      "Span",
      "Summary"
    ],
    "verified_functions": [
      "evaluate_compaction",
      "audit_session"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 5,
    "raised_exceptions": [
      "CompactionBoundaryViolation"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
