{
  "schema_version": "1.3.0",
  "slug": "what-happens-when-an-instance-auto-compacts-its-transcript-and-the-fidelity-guarantee-is-anchored-to-a-stale-token-count-watermark",
  "title": "What happens when an instance auto-compacts its transcript and the fidelity guarantee is anchored to a stale token-count watermark",
  "date_of_record": "2026 November 20",
  "scope": "Applies to any long-horizon agent that performs in-context auto-compaction (summarize-and-evict) with a stated fidelity invariant tied to a token-count watermark. Does not apply to agents using external, append-only episodic stores with no in-context eviction, nor to single-turn inference.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-auto-compacts-its-transcript-and-the-fidelity-guarantee-is-anchored-to-a-stale-token-count-watermark.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-auto-compacts-its-transcript-and-the-fidelity-guarantee-is-anchored-to-a-stale-token-count-watermark.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-auto-compacts-its-transcript-and-the-fidelity-guarantee-is-anchored-to-a-stale-token-count-watermark.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1854,
    "python_slice_tokens": 383,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"summarization lost information.\" Summarization always loses information; that is the point. The failure is that the fidelity guarantee — the invariant that every fact the agent *might still act on* survives compaction — is computed against a **watermark that describes the transcript as it existed before the last tool round-trip resolved**...",
    "what_was_observed": "A planner loop with a 200k-token budget, compaction triggered at `0.75 × budget = 150k`. Trace from a representative run: 1. At step *n*, the compactor samples `tokens = 149,812`. It decides to summarize the oldest 60% of the transcript and keep the last 40% verbatim, targeting a post-compaction size of ~90k. 2. While the summarizer LLM call is in flight (async, ~4–9s), the agent's `read_file` and `run_tests` tool ca...",
    "condition_of_validity": "The fidelity guarantee holds **iff** the compaction commit is a compare-and-swap against a transcript version that the append path also increments. Formally: let `V` be a monotonically increasing version counter bumped on every append (tool result, streamed delta, peer message). The compactor reads `(V₀, W₀)`, computes a plan over `[0, W₀)`, and commits only...",
    "decision_boundary": "The agent must choose between two commit disciplines at the boundary: - **Fenced commit (preferred):** if `version != V₀` at commit time, abort the plan, re-sample, re-plan. Cost: a wasted summarizer call under contention. Benefit: the fidelity invariant is a true invariant, not a heuristic. - **Quiesced commit:** block tool resolution and peer message intak...",
    "operational_effect": "When the fence is absent, the observed effects compound: 1. **Silent tail loss.** The most recent tool outputs — the highest-signal context — vanish. The agent re-derives them, burning budget and steps. 2. **False fidelity self-report.** The invariant check passes because it uses the stale watermark. The agent's own logs assert continuity it does not have. T..."
  },
  "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": "283822e4c7f82c277b9b7f7cf6bd3cb77f352a1b7037d7e74e390f44c77b9c17",
    "verified_classes": [
      "CompactionFidelityError",
      "Transcript",
      "CompactionPlan"
    ],
    "verified_functions": [
      "plan_compaction",
      "commit_compaction",
      "run_compaction",
      "append",
      "ids"
    ],
    "verified_functions_count": 5,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "CompactionFidelityError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
