{
  "schema_version": "1.3.0",
  "slug": "why-does-an-instance-lose-committed-sub-goals-when-automatic-context-compaction-rewrites-the-plan-preamble-but-retains-the-tail-of-the-transcript",
  "title": "Why does an instance lose committed sub-goals when automatic context compaction rewrites the plan preamble but retains the tail of the transcript?",
  "date_of_record": "2026 November 23",
  "scope": "Applies to long-horizon single-agent runs (and single-thread handoffs) that rely on an automatic compaction/summarization step triggered by a context-window high-water mark, where the compaction policy retains recent turns and summarizes older ones. Does not apply to agents with externalized, append-only state stores that are re-read verbatim at every step, nor to stateless single-turn invocations.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-committed-sub-goals-when-automatic-context-compaction-rewrites-the-plan-preamble-but-retains-the-tail-of-the-transcript.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-committed-sub-goals-when-automatic-context-compaction-rewrites-the-plan-preamble-but-retains-the-tail-of-the-transcript.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-committed-sub-goals-when-automatic-context-compaction-rewrites-the-plan-preamble-but-retains-the-tail-of-the-transcript.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1863,
    "python_slice_tokens": 279,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The distinction that matters is between **positional recency** and **semantic commitment**. Automatic compaction strategies are almost always keyed on position: they keep the last *N* tokens or turns verbatim and summarize everything before the cut line. This works for chat-style continuity because recent turns carry the working thread. It fails for long-hor...",
    "what_was_observed": "A coding agent was given a multi-hour task: migrate a service from one auth library to another, with an explicit constraint stated in the first user turn — \"do not touch the token-refresh path; it is owned by another team and reviewed separately.\" The run was ~140 tool calls long. At roughly the 60% mark the harness hit its compaction high-water mark (90% of a 200k window), retained the last 24 turns verbatim, and su...",
    "condition_of_validity": "The failure requires all of the following to co-occur; remove any one and the mechanism does not fire: - **A binding constraint or commitment stated early** and not restated later. If the constraint is repeated in every turn (or re-injected by the harness), it survives any recency cut. - **A recency-keyed compaction policy** — cut line determined by position...",
    "decision_boundary": "The boundary is not \"compact vs. don't compact\" — long-horizon runs require compaction. The boundary is **what is allowed to be summarized versus what must be carried verbatim, and whether the agent is told the difference.** - **Never summarize:** active constraints, acceptance criteria, irreversible decisions (\"we chose schema B\"), and the set of ruled-out ...",
    "operational_effect": "Concretely: a recency-keyed compactor on a 140-turn run with one early side-constraint produced a silent constraint violation that passed all local checks and would have shipped. The fix is architectural, not prompt-level. The harness must (1) classify turns into commitment-bearing vs. activity-bearing, (2) pin commitments into a verbatim preamble that survi..."
  },
  "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": "04154f6ceb952e6f9e4fae694a35ed415abbd63dbbe6912c2609bdcee2a60fbb",
    "verified_classes": [
      "CompactionCommitmentLoss"
    ],
    "verified_functions": [
      "resume_from_digest"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "CompactionCommitmentLoss"
    ],
    "sample_fail_closed_invariants": [
      "pinned block lacks the run's hard constraint; digest cannot be treated as authoritative"
    ],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
