{
  "schema_version": "1.3.0",
  "slug": "why-does-an-instance-lose-task-state-precisely-at-the-compaction-boundary-it-was-designed-to-survive",
  "title": "Why does an instance lose task state precisely at the compaction boundary it was designed to survive?",
  "date_of_record": "2026 November 24",
  "scope": "Applies to any agent runtime that performs automatic context compaction (summarize-and-truncate, hierarchical rollup, or salience-scored eviction) when the active window approaches saturation mid-task. Does not apply to stateless single-turn inference, nor to runtimes that hard-halt on overflow instead of compacting.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-task-state-precisely-at-the-compaction-boundary-it-was-designed-to-survive.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-task-state-precisely-at-the-compaction-boundary-it-was-designed-to-survive.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-task-state-precisely-at-the-compaction-boundary-it-was-designed-to-survive.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2215,
    "python_slice_tokens": 407,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two things an agent runtime can mean by \"preserving task state across overflow,\" and conflating them is the root of the failure: 1. **Token continuity** — the model still receives *some* representation of prior turns, so it does not perceive a hard reset. 2. **Commitment continuity** — the model still holds the *binding artifacts* of the task: the ...",
    "what_was_observed": "A code-migration agent was executing a multi-file refactor. At turn 41 the context window crossed the compaction threshold. The runtime invoked a summarize-and-truncate compactor: turns 1–30 were replaced by a 400-token summary, turns 31–41 were retained verbatim, and execution continued. The summary was, by any readability metric, excellent. It stated the goal (\"migrate the auth module from `legacy_auth` to `auth_v2...",
    "condition_of_validity": "The invariant holds — compaction preserves commitment continuity — **only if every binding artifact is carried across the seam in a form the agent can act on without reconstructing it from narrative.** Concretely, the following must survive verbatim or in a structured, machine-checkable slot, never as prose summary: - **Negative constraints** (prohibitions, ...",
    "decision_boundary": "The runtime must choose, at the seam, between three behaviors, and the choice is governed by whether binding artifacts are present in the compacted region: - **Compact freely** when the region contains only exploration, reads, and superseded reasoning — no prohibitions, no unresolved branches, no opaque identifiers that future actions depend on. This is the ...",
    "operational_effect": "Downstream of an unguarded compaction seam, three effects compound: 1. **Constraint erosion is monotonic across seams.** Each compaction that summarizes without a carry-over channel drops a fraction of the remaining prohibitions. A task that crosses three seams has roughly the constraint set of its last un-compacted segment, not its full history. Long-horizo..."
  },
  "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": "56308fe168a3c133b80ad4496890c427785ce8bdf5a4ed6f91fac1c46bebe66f",
    "verified_classes": [
      "CompactionCommitmentError",
      "BindingArtifact",
      "ConstraintLedger"
    ],
    "verified_functions": [
      "compact",
      "guarded_action",
      "add",
      "prohibits"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "CompactionCommitmentError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
