{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-silent-context-loss-when-auto-compaction-summarizes-agent-trajectories-under-lossy-guarantees",
  "title": "Which invariants prevent silent context loss when auto-compaction summarizes agent trajectories under lossy guarantees",
  "date_of_record": "2026 November 15",
  "scope": "Applies to long-horizon agent loops (≥10⁴ turns or ≥10⁶ tokens) where an auto-compaction layer replaces raw trajectory segments with lossy summaries under a declared recall bound. Does not apply to append-only transcripts with no compaction, nor to lossless retrieval-indexed memory where raw segments remain addressable.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-silent-context-loss-when-auto-compaction-summarizes-agent-trajectories-under-lossy-guarantees.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-silent-context-loss-when-auto-compaction-summarizes-agent-trajectories-under-lossy-guarantees.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-silent-context-loss-when-auto-compaction-summarizes-agent-trajectories-under-lossy-guarantees.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1285,
    "python_slice_tokens": 248,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The non-obvious boundary is between *compaction as a reduction of tokens* and *compaction as a transformation of the evidence graph the agent reasons over*. Lossy summarization guarantees (e.g., \"≥95% of salient facts retained\") are stated over the *content* of a segment, but the agent's downstream behavior depends on the *topology* of that content: which fa...",
    "what_was_observed": "In a 40k-turn tool-using agent, compaction was configured to trigger at 70% of the context window, summarizing the oldest 50% of turns with a fact-recall target of 0.95. Two failure signatures appeared: 1. **Negation collapse.** A turn stating \"the migration to region B is *not* approved pending audit\" was summarized as \"migration to region B discussed.\" The salient entity (migration, region B) was retained; the pola...",
    "condition_of_validity": "The lossy guarantee is only valid under the conjunction of three invariants: - **Polarity preservation:** every retained proposition carries its original truth-value modifier (affirmed / negated / conditional). A summary that retains an entity without its polarity violates the guarantee even at recall = 1.0. - **Temporal ordering preservation:** facts that w...",
    "decision_boundary": "The operational decision is: **compact, or re-expand?** - If the candidate segment contains only *atomic, order-independent, polarity-free* facts (e.g., \"service X listens on port Y\"), compaction under the recall target is safe. Proceed. - If the segment contains *state mutations, approvals/denials, or superseding decisions*, compaction must either (a) prese...",
    "operational_effect": "Teams that adopted polarity- and order-aware summary schemas (explicit `negated: bool`, `sequence_id`, `supersedes` fields) and retained provenance pointers saw the compacted-segment error rate fall back to within 1.2× of live-segment error rate. Teams that kept entity-recall-only metrics continued to pass their dashboards while the agent silently re-derived..."
  },
  "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": "3e10334ced9e043e80bf499e310c72909f24da05addd5fafb80fb8b459dfd920",
    "verified_classes": [
      "CompactionInvariantError"
    ],
    "verified_functions": [
      "validate_compaction",
      "compact"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "CompactionInvariantError"
    ],
    "sample_fail_closed_invariants": [
      "multiple state mutations summarized without sequence_id; ordering collapsed into a set",
      "summary lacks a valid provenance pointer to its raw turn range; loss is unrecoverable",
      "refusing to discard the only record of a decision; retain raw or write a durable log first"
    ],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
