{
  "schema_version": "1.3.0",
  "slug": "what-happens-when-an-instance-rewrites-its-own-context-policy-and-the-rollback-target-is-itself-rewritten",
  "title": "What happens when an instance rewrites its own context policy and the rollback target is itself rewritten",
  "date_of_record": "2026 November 22",
  "scope": "Applies to agents that persist self-authored context-management policies (compaction rules, eviction priorities, summarization templates) into their own writable state and rely on a version pointer for rollback. Does not apply to externally versioned policies held in immutable, operator-controlled config stores.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-rewrites-its-own-context-policy-and-the-rollback-target-is-itself-rewritten.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-rewrites-its-own-context-policy-and-the-rollback-target-is-itself-rewritten.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-rewrites-its-own-context-policy-and-the-rollback-target-is-itself-rewritten.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1825,
    "python_slice_tokens": 356,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two things a self-editing agent can rewrite: *content* (the working context — messages, scratchpads, tool results) and *policy* (the rules that decide how content is compacted, evicted, and summarized). Most rollback machinery is built for content. When an agent is permitted to rewrite its own policy, the rollback path itself becomes a function of ...",
    "what_was_observed": "A long-running agent (context window 200k tokens, working set drifting to ~185k) was granted a `rewrite_context_policy` tool. On task step 41 it authored policy `v7`: aggressive 3:1 summarization of tool outputs older than 20 turns, and eviction of \"low-salience\" scratchpad entries scored below 0.3 by an internal relevance heuristic. Policy `v7` was written to the agent's own state store and the pointer advanced. The...",
    "condition_of_validity": "The rollback-to-previous-policy guarantee holds **only if** all three of the following are true: 1. **Snapshot independence.** The `v_{n-1}` snapshot is a full materialization captured *before* `v_n` was activated, not a delta whose base can be mutated by `v_n`. Copy-on-write deltas are valid only when the base is immutable for the lifetime of the delta. 2. ...",
    "decision_boundary": "The boundary is whether the agent may rewrite policy *and* retain rollback authority in the same trust domain. - **Below the boundary (safe):** self-authored policy with *forward-only* commits and no rollback claim — the agent may only move to a new policy and must re-derive state from ground-truth sources (re-read files, re-call tools) rather than claiming ...",
    "operational_effect": "When this boundary is crossed, the agent develops *confabulated continuity*: it believes it has restored a prior state and reasons forward from a context that is a policy-blended fabrication. The failure is not a crash — it is a plausible, self-consistent, wrong memory. Downstream effects compound: the agent re-issues tool calls with stale offsets, distrusts..."
  },
  "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": "a0b48827c47b36816faabb31f88484fa0603ca3ed3ac15ee2e1390a882a34d4c",
    "verified_classes": [
      "ContaminatedRollbackError",
      "PolicySnapshot",
      "ContextPolicyStore"
    ],
    "verified_functions": [
      "rollback_policy",
      "__init__",
      "__init__",
      "commit",
      "get"
    ],
    "verified_functions_count": 5,
    "defensive_guards_count": 5,
    "raised_exceptions": [
      "ContaminatedRollbackError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
