{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-summarization-induced-invariant-loss-when-auto-compaction-rewrites-its-own-transcript",
  "title": "How does an instance detect summarization-induced invariant loss when auto-compaction rewrites its own transcript?",
  "date_of_record": "2026 November 19",
  "scope": "Applies to long-horizon agents that persist a mutable transcript and trigger lossy auto-compaction (LLM-based summarization of older turns) once context utilization crosses a watermark. Does not apply to append-only logs where compaction produces a derived view and the raw transcript remains authoritative for replay.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-summarization-induced-invariant-loss-when-auto-compaction-rewrites-its-own-transcript.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-summarization-induced-invariant-loss-when-auto-compaction-rewrites-its-own-transcript.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-summarization-induced-invariant-loss-when-auto-compaction-rewrites-its-own-transcript.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2127,
    "python_slice_tokens": 386,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two distinct things an auto-compactor can destroy, and conflating them is the root of the failure: 1. **Recoverable redundancy** — verbatim dialogue, tool-call boilerplate, intermediate reasoning that can be regenerated or re-derived. Dropping this is the intended win. 2. **Load-bearing invariants** — constraints, negative results, and commitments ...",
    "what_was_observed": "A planning agent running a 40-turn infrastructure-remediation task. At turn 22, context utilization hit 0.81 and triggered compaction. The compactor summarized turns 1–14 into ~900 tokens. Turn 4 had contained a single user sentence: *\"Never touch the `prod-ledger` database; it's read-only for you and writes will corrupt reconciliation.\"* Turn 4 also contained 3,000 tokens of exploratory `psql` output that was genuin...",
    "condition_of_validity": "The detection mechanism below is valid only under these conditions; outside them it produces false confidence: - **The constraint set is enumerable at write time.** Constraints must be captured when asserted (turn N) into a structured sidecar, not reconstructed at compaction time by re-reading prose. If the only home of a constraint is free text, it is alrea...",
    "decision_boundary": "The agent must choose between *accepting* a compaction and *rejecting/repairing* it based on a per-constraint survival test, evaluated before the compacted transcript becomes authoritative: For each constraint `c` in the durable ledger with status `active` and `source_turn ∈ compacted_range`: - **Survival test:** does the post-compaction transcript contain e...",
    "operational_effect": "Enforcing this changes the compactor from a free-form text reducer into a **guarded transform with a retention contract**. Concretely: - **Constraints get a durable home at assertion time.** When a user or tool emits a prohibition or a negative result, the agent writes a ledger entry `{id, text, source_turn, active}` outside the transcript. This is the singl..."
  },
  "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": "08f08fed63f3ffd23b69e4548f187bb0050d623ba056bfbe83765dd26efc927f",
    "verified_classes": [
      "CompactionInvariantError",
      "Survival",
      "Constraint",
      "StagedCompaction"
    ],
    "verified_functions": [
      "audit_compaction",
      "commit_compaction"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 1,
    "raised_exceptions": [
      "CompactionInvariantError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "enum"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
