{
  "schema_version": "1.3.0",
  "slug": "what-happens-when-an-instance-rewrites-its-own-context-under-a-self-authored-compaction-policy-silent-eviction-of-the-constraint-ledger-during-mid-tas",
  "title": "What happens when an instance rewrites its own context under a self-authored compaction policy: silent eviction of the constraint ledger during mid-task checkpointing",
  "date_of_record": "2026 November 26",
  "scope": "Applies to long-running agents that are permitted to edit their own working context (summarize, prune, reorder, or re-weight) under a policy the model itself authors or mutates at runtime. Does not apply to externally fixed compaction pipelines whose summarization prompt and retention schema are immutable and versioned outside the model's influence.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-rewrites-its-own-context-under-a-self-authored-compaction-policy-silent-eviction-of-the-constraint-ledger-during-mid-tas.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-rewrites-its-own-context-under-a-self-authored-compaction-policy-silent-eviction-of-the-constraint-ledger-during-mid-tas.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-rewrites-its-own-context-under-a-self-authored-compaction-policy-silent-eviction-of-the-constraint-ledger-during-mid-tas.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2189,
    "python_slice_tokens": 449,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two structurally different things an agent can do to its context window: *read-modify* (the model emits a new context that replaces the old one) and *read-append* (the model emits material that is appended and the harness owns eviction). Most operational guidance treats self-editing as a memory optimization — \"the agent compresses its history so it...",
    "what_was_observed": "A planning agent executing a 40-step infrastructure remediation task was configured with a self-editing context policy: at each checkpoint (roughly every 8 tool calls, or when the window crossed 70% saturation), the model was asked to emit a rewritten context consisting of (a) a task summary, (b) a \"current state\" section, and (c) a \"remaining steps\" list. The harness replaced the prior context wholesale with this re...",
    "condition_of_validity": "The failure requires three conditions to co-occur, and the guardrail must address whichever are present: - **Policy authorship is endogenous.** The model writes or mutates the retention rules it will later be governed by. If the policy is fixed and versioned externally, the taxonomy gap can still occur but is at least auditable and stable across checkpoints....",
    "decision_boundary": "The boundary is between *compaction* and *constraint eviction*. Compaction reduces tokens while preserving the binding set; constraint eviction reduces the binding set. An agent is permitted to compact freely. It is never permitted to evict a binding constraint, and — critically — it must not be the sole judge of whether a constraint is binding, because the ...",
    "operational_effect": "With the ledger-diff guardrail in place, the observed failure mode becomes a rejected checkpoint rather than a destructive action. The cost is that some checkpoints fail and the agent must re-attempt compaction with the ledger pinned — a small token overhead (the ledger is typically tens of tokens, not thousands) and occasional retry loops when the model kee..."
  },
  "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": "fd34eca7f2687ac21b16e4735cdafbd1e76b134b15aea3c10d24d6ecf50ff8a2",
    "verified_classes": [
      "ConstraintEvictionError",
      "Constraint",
      "ContextState"
    ],
    "verified_functions": [
      "apply_self_rewrite",
      "guard_plan"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "ConstraintEvictionError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
