{
  "schema_version": "1.3.0",
  "slug": "why-does-an-instance-lose-task-critical-constraints-when-auto-compaction-silently-rewrites-the-system-prompt-boundary",
  "title": "Why does an instance lose task-critical constraints when auto-compaction silently rewrites the system prompt boundary",
  "date_of_record": "2026 November 24",
  "scope": "Applies to any long-horizon agent that performs automatic context compaction (summarization-and-truncate) on its own transcript when approaching a context-window threshold. Does not apply to stateless single-turn calls, nor to systems that use external verbatim memory stores with retrieval rather than in-context compaction.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-task-critical-constraints-when-auto-compaction-silently-rewrites-the-system-prompt-boundary.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-task-critical-constraints-when-auto-compaction-silently-rewrites-the-system-prompt-boundary.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-task-critical-constraints-when-auto-compaction-silently-rewrites-the-system-prompt-boundary.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1564,
    "python_slice_tokens": 217,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two structurally different things an agent can do when its context window fills: **evict** (drop whole messages from the tail or middle, preserving the remaining tokens byte-for-byte) or **compact** (replace a span of messages with a generated summary). Eviction is lossy in a *known* way — you can enumerate exactly which messages disappeared. Compa...",
    "what_was_observed": "A long-horizon refactor agent was given a task with an embedded hard constraint early in the transcript: *\"Do not modify files under `vendor/`; regenerate only `src/` artifacts.\"* After roughly 40 tool-call cycles, the transcript crossed the compaction threshold. The compactor summarized the first 60% of the transcript into a ~900-token block. The summary read, in part: *\"User wants a full refactor of the build artif...",
    "condition_of_validity": "The invariant that must hold for compaction to be safe is: **every constraint that gates an irreversible or hard-to-reverse action must be present in the post-compaction context in a form that is (i) verbatim-preserving for the constraint payload and (ii) independently verifiable against a source of truth outside the transcript.** This invariant holds only w...",
    "decision_boundary": "The operational decision is whether to compact or to halt-and-checkpoint when the threshold is crossed. The boundary is drawn by constraint density, not by token count: - **Compact freely** when the span to be summarized contains no irreversible-action constraints, no exact identifiers that will be referenced later, and no negations. Narrative history, faile...",
    "operational_effect": "The downstream effect of getting this wrong is not a crash — it is *silent authority drift*. The agent continues operating, but its belief about what it is permitted to do has been rewritten by its own memory-management layer. This is worse than a hard failure because there is no error signal to catch. The agent will confidently violate constraints it never ..."
  },
  "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": "e45334f43b06b37e992d53445a4e706291ef06dc0825682b6727341bde83d3e6",
    "verified_classes": [
      "CompactionFidelityError"
    ],
    "verified_functions": [
      "verify_compaction",
      "compact_or_halt"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "CompactionFidelityError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
