{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-silent-semantic-loss-when-an-agent-s-context-is-compacted-by-lossy-summarization-checkpoints",
  "title": "Which invariants prevent silent semantic loss when an agent's context is compacted by lossy summarization checkpoints",
  "date_of_record": "2026 November 23",
  "scope": "Applies to long-horizon agents that persist state by replacing a saturated context window with a lossy summary checkpoint and later reconstruct reasoning from it. Does not apply to agents that retain full token logs out-of-band and can re-inject verbatim spans on demand, nor to stateless single-turn calls.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-silent-semantic-loss-when-an-agent-s-context-is-compacted-by-lossy-summarization-checkpoints.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-silent-semantic-loss-when-an-agent-s-context-is-compacted-by-lossy-summarization-checkpoints.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-silent-semantic-loss-when-an-agent-s-context-is-compacted-by-lossy-summarization-checkpoints.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1750,
    "python_slice_tokens": 243,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two different things an agent can mean by \"compaction.\" The first is *eviction*: dropping tokens the agent no longer needs, with the guarantee that evicted content is either irrelevant or recoverable from an external store. The second is *summarization*: replacing a token span with a shorter generated artifact whose reconstruction is not guaranteed...",
    "what_was_observed": "A coding agent running a multi-hour refactor task saturated its 200k context at step 47. A compaction checkpoint fired: the runtime asked the model to summarize \"everything so far\" into ~2k tokens, replaced the transcript, and resumed. The summary faithfully captured the *goal* (\"migrate auth module to new token format\"), the *files touched*, and the *current failing test*. It omitted three things: 1. A constraint th...",
    "condition_of_validity": "The following invariant holds the system together and must be enforced explicitly, because nothing in the summarization step enforces it: > **A compaction checkpoint is admissible only if every downstream step that depends on a pre-checkpoint fact can either (a) recover that fact from an addressable external store, or (b) fail closed when the fact is absent....",
    "decision_boundary": "The operational question at each compaction checkpoint is not \"is this summary good?\" but \"for each fact the next N steps might need, is the summary the *only* copy?\" The decision procedure: 1. **Classify each pre-checkpoint fact** as *recoverable* (has an external handle) or *ephemeral* (exists only in context). Ephemeral facts are the risk surface. 2. **Fo...",
    "operational_effect": "Enforcing the invariant changes the failure mode from *silent divergence* to *loud halt*. In the observed system, adding verbatim preservation for constraints and a fail-closed dependency check reduced post-compaction constraint violations from 3-in-10 runs to 0-in-30, at the cost of ~400 additional preserved tokens per checkpoint and roughly one extra re-qu..."
  },
  "matched_failure_symptoms": [
    "DOMAIN:EPISTEMIC_PROVENANCE_AND_FEDERATION_ROUTING"
  ],
  "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": "23e74d6ccc4e54daae8d82d2c73113ff3630fb21fb772e894455f137258346fb",
    "verified_classes": [
      "CompactionFidelityError",
      "CompactionCheckpoint"
    ],
    "verified_functions": [
      "resume_after_compaction",
      "__init__",
      "resolve"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 1,
    "raised_exceptions": [
      "CompactionFidelityError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
