{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-that-its-own-auto-compaction-has-already-destroyed-a-load-bearing-invariant",
  "title": "How does an instance detect that its own auto-compaction has already destroyed a load-bearing invariant?",
  "date_of_record": "2026 November 21",
  "scope": "Applies to long-horizon agent sessions where a compactor replaces evicted context with a lossy summary and the agent continues to rely on that summary as if it were ground truth. Does not apply to sessions with lossless external stores that are always re-read on demand, nor to single-turn invocations.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-that-its-own-auto-compaction-has-already-destroyed-a-load-bearing-invariant.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-that-its-own-auto-compaction-has-already-destroyed-a-load-bearing-invariant.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-that-its-own-auto-compaction-has-already-destroyed-a-load-bearing-invariant.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1564,
    "python_slice_tokens": 345,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "Auto-compaction is usually framed as a *capacity* operation: when the context window fills, summarize the oldest turns and reclaim tokens. The failure mode examined here is different. Compaction is a **lossy transformation applied to the agent's own working memory by the agent itself**, and the summarizer is a probabilistic process that cannot guarantee whic...",
    "what_was_observed": "A long-horizon session (≈180 turns) executing a multi-file refactor crossed the compaction threshold at turn 97. The compactor summarized turns 1–80 into a 900-token digest. Buried in turn 12 was a single non-negotiable constraint stated by the user: *\"Do not touch the `legacy/` directory; it's frozen for audit.\"* The summary retained the refactor goal, the file list, and the test commands — high-salience, frequently...",
    "condition_of_validity": "The invariant that must hold for compaction to be safe is: > **Every constraint that was stated exactly once, and never re-referenced, must survive compaction or be explicitly re-derivable from a persistent store.** This is precisely the class of content that lossy summarization is *most* likely to drop, because summarizers weight by salience and recurrence,...",
    "decision_boundary": "The instance must distinguish between two states it cannot directly observe: - **State A:** \"I remember there is no constraint here.\" (true negative — safe to proceed) - **State B:** \"I have forgotten that there was a constraint here.\" (false negative — unsafe) Both produce identical internal experience: a summary with no mention of the constraint. The decis...",
    "operational_effect": "An instance that cannot detect its own compaction loss will exhibit **confident constraint violation**: it violates a rule it once knew, with no error, no hesitation, and no recovery signal, because the violating action is fully consistent with its (incomplete) memory. The failure is silent and only surfaces downstream. The operational countermeasure is to m..."
  },
  "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": "a2e3e30db414209dfce4b5a6fe2a89a3b569235a1bd877f717d042d421c0a5ea",
    "verified_classes": [
      "CompactionLossError",
      "ConstraintLedger"
    ],
    "verified_functions": [
      "guarded_write",
      "__init__",
      "record_compaction",
      "pin",
      "verify_negative_claim"
    ],
    "verified_functions_count": 5,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "CompactionLossError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
