{
  "schema_version": "1.3.0",
  "slug": "what-structural-signals-indicate-when-lossy-context-compaction-has-silently-invalidated-an-agent-s-reversible-expansion-log",
  "title": "What structural signals indicate when lossy context compaction has silently invalidated an agent's reversible expansion log",
  "date_of_record": "2026 December 1",
  "scope": "Applies to long-running agents that reclaim context window via automatic compaction (summarize-and-evict) while maintaining a reversible expansion log (references from summary slots back to evicted source spans). Does not apply to lossless sliding-window eviction, external retrieval-augmented memory, or compaction triggered only at task boundaries where no mid-task tool calls remain in flight.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-when-lossy-context-compaction-has-silently-invalidated-an-agent-s-reversible-expansion-log.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-when-lossy-context-compaction-has-silently-invalidated-an-agent-s-reversible-expansion-log.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-when-lossy-context-compaction-has-silently-invalidated-an-agent-s-reversible-expansion-log.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1829,
    "python_slice_tokens": 324,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The critical distinction is between **compaction as a lossy projection** and **compaction as a reversible transaction**. Most compaction policies are implemented as a projection: a token-pressure trigger fires, a summarizer LLM rewrites the oldest N turns into a condensed slot, and the original spans are dropped or moved to a cold store. The \"reversible expa...",
    "what_was_observed": "A code-remediation agent operated under a 128k context budget with an auto-compaction policy firing at 85% saturation. Compaction summarized the oldest 40% of turns into a single slot and wrote an expansion entry of the form `slot_17 -> {span_ids: [s_203..s_241], fidelity: \"verbatim_recoverable\"}`. The summarizer, under its own instruction to \"preserve intent,\" collapsed a multi-step debugging trace into a single sen...",
    "condition_of_validity": "The invariant that must hold for a reversible expansion log to be trustworthy: > For every slot `S` in the expansion log, `expand(S)` must return content whose token sequence is a subsequence-preserving superset of the original span, OR the slot must be marked `fidelity: \"lossy\"` and the agent must be forbidden from treating expanded content as authoritative...",
    "decision_boundary": "The agent must draw a hard boundary between two classes of expansion use: - **Authoritative use** (exact strings, identifiers, cryptographic material, error class names, file paths, numeric thresholds): permitted *only* if `fidelity == \"verbatim_recoverable\"` AND a post-expansion integrity check passes—the expanded content must be byte-identical (or hash-ide...",
    "operational_effect": "The operational consequence is that auto-compaction must be treated as a **state-mutating operation with a rollback obligation**, not a background optimization. Concretely: 1. Compaction is a two-phase commit: write the expansion entry *and* the span checksum before evicting the source; only mark the slot `committed` after both are durable. 2. Every downstre..."
  },
  "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": "e73e7d185b7ae097676332d06b519fc74c8db09bb47d8c6cc1b1244ba885bfce",
    "verified_classes": [
      "CompactionIntegrityError",
      "ExpansionSlot",
      "ColdStore"
    ],
    "verified_functions": [
      "expand_authoritative",
      "fetch"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "CompactionIntegrityError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
