{
  "schema_version": "1.3.0",
  "slug": "what-happens-when-an-instance-compacts-its-own-history-mid-task-the-summarization-commit-invariant-and-the-orphaned-antecedent-failure",
  "title": "What happens when an instance compacts its own history mid-task: the summarization-commit invariant and the orphaned-antecedent failure",
  "date_of_record": "2026 November 28",
  "scope": "Applies to long-horizon agent sessions (≥ tens of thousands of tokens of accumulated trajectory) that perform self-triggered context compaction — replacing a span of raw turns with a lossy summary — while a task is still open and dependent tool results are pending or replayable. Does not apply to stateless single-shot invocations, nor to compaction performed only at hard session boundaries where no in-flight obligations exist.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-compacts-its-own-history-mid-task-the-summarization-commit-invariant-and-the-orphaned-antecedent-failure.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-compacts-its-own-history-mid-task-the-summarization-commit-invariant-and-the-orphaned-antecedent-failure.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-compacts-its-own-history-mid-task-the-summarization-commit-invariant-and-the-orphaned-antecedent-failure.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2133,
    "python_slice_tokens": 294,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The distinction that matters is between **compaction as archival** and **compaction as a live mutation of the working set**. Archival compaction summarizes turns that are already *settled*: their tool calls returned, their conclusions were consumed, and nothing downstream will re-read them except for narrative continuity. Live compaction summarizes turns tha...",
    "what_was_observed": "A coding agent, ~48k tokens into a session, was asked to migrate a config loader. At turn ~60 it self-triggered compaction at a 70% context threshold, replacing turns 1–40 with a 900-token summary. The summary correctly captured the goal, the files touched, and the test status. It did *not* capture a single line from turn 22: a tool result stating that the staging database schema differs from production by one column...",
    "condition_of_validity": "The summarization-commit invariant holds — compaction is safe — only when all three conditions are met for the span being compacted: 1. **Closure:** every tool call issued within the span has returned and its result has been reconciled (consumed by a decision, not merely received). 2. **Antecedent quiescence:** no fact, constraint, or value established in th...",
    "decision_boundary": "The decision boundary is not \"compact or don't.\" It is **which spans are eligible**, and eligibility must be computed from the obligation graph, not from token position or narrative completeness. - A span is **eligible** iff its closure and antecedent-quiescence predicates evaluate true against the current obligation set. Token-count thresholds (the 70% trig...",
    "operational_effect": "The operational effect is a shift from *threshold-triggered compaction* to *obligation-gated compaction*. The agent maintains an obligation ledger as a first-class structure; the compaction routine refuses to summarize any span intersecting a live obligation and instead drains or externalizes first. The observable consequence is that compaction sometimes *fa..."
  },
  "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": "0318ea1a2f12515b8b7da372463ff5db01470b55091ff4cd6aed09d097d1e95d",
    "verified_classes": [
      "CompactionOrphanError",
      "Obligation",
      "ObligationLedger"
    ],
    "verified_functions": [
      "compact_span",
      "_summarize",
      "live",
      "intersects"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "CompactionOrphanError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
