{
  "schema_version": "1.3.0",
  "slug": "when-must-an-instance-refuse-to-roll-back-a-self-pruned-context-window-the-summarization-commit-barrier-and-the-phantom-turn-invariant",
  "title": "When must an instance refuse to roll back a self-pruned context window: the summarization-commit barrier and the phantom-turn invariant",
  "date_of_record": "2026 November 24",
  "scope": "Applies to any agent that mutates its own context window mid-task via model-driven pruning (dropping turns, replacing spans with summaries, or reordering) and maintains rollback checkpoints over that window. Does not apply to append-only log architectures where the window is reconstructed from an external store on every step.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/when-must-an-instance-refuse-to-roll-back-a-self-pruned-context-window-the-summarization-commit-barrier-and-the-phantom-turn-invariant.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-refuse-to-roll-back-a-self-pruned-context-window-the-summarization-commit-barrier-and-the-phantom-turn-invariant.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-refuse-to-roll-back-a-self-pruned-context-window-the-summarization-commit-barrier-and-the-phantom-turn-invariant.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2315,
    "python_slice_tokens": 476,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two structurally different things an agent calls a \"checkpoint.\" A **state checkpoint** is a serialized snapshot of the context window plus the pending tool-call ledger. A **semantic checkpoint** is a pointer to a position in the event stream from which the window can be *re-derived* by replaying the pruning policy. These diverge the instant the pr...",
    "what_was_observed": "A long-horizon agent (tool-calling loop, ~40–120 turns per task) used a model-driven pruner: at each step, if estimated token load exceeded a high-water mark, the model was asked to select spans to summarize and emit a replacement. Checkpoints were taken every N turns as full window snapshots, tagged with the policy version and the model's pruning rationale string. The failure trace, reproduced across three task fami...",
    "condition_of_validity": "The commit barrier holds — i.e., rollback is safe — only when all four of the following are true at the checkpoint: - **Provenance completeness.** Every span removed by the pruner is still addressable in an external, append-only store, keyed by a stable ID recorded in the checkpoint. The checkpoint stores *references plus digest*, never digest alone. - **Dig...",
    "decision_boundary": "The operational rule is a hard gate, not a heuristic: - **Roll back** to a checkpoint iff `provenance_complete ∧ digest_hash_verified ∧ policy_pinned ∧ constraints_extracted`. In this regime rollback is a true undo. - **Do not roll back** if the checkpoint is snapshot-only *and* the failed decision depended on any span the pruner removed. Instead, **re-deriv...",
    "operational_effect": "Systems that enforce the commit barrier show a characteristic signature: rollback attempts either succeed with byte-identical digests and full provenance, or they convert into explicit re-derivation calls against the external store. The rate of \"silent constraint loss\" — a constraint present in the event log but absent from the post-rollback window — drops 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": "46146866f16cd81c1c8fcfba3ca3d96ae8c6d71baacd580d08edddfbffb69d35",
    "verified_classes": [
      "RollbackUnsafeError",
      "Checkpoint",
      "EventLog"
    ],
    "verified_functions": [
      "verify_checkpoint",
      "attempt_rollback",
      "get"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 6,
    "raised_exceptions": [
      "RollbackUnsafeError"
    ],
    "sample_fail_closed_invariants": [
      "pruning policy is model-driven and unpinned; replay would not reproduce the decision",
      "spans were pruned but no deterministic constraint extraction was recorded; load-bearing facts may exist only inside the ",
      "checkpoint failed commit barrier; refusing rollback to avoid phantom-turn resume"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
