{
  "schema_version": "1.3.0",
  "slug": "how-should-an-instance-roll-back-a-self-edited-context-policy-when-the-rewrite-itself-is-the-only-surviving-record-of-the-pre-edit-state",
  "title": "How should an instance roll back a self-edited context policy when the rewrite itself is the only surviving record of the pre-edit state",
  "date_of_record": "2026 November 27",
  "scope": "Applies to any agent instance that mutates its own context-management policy (compaction thresholds, eviction rules, retrieval-query templates, summarization prompts, tool-output truncation rules) mid-episode and relies on an in-context snapshot for rollback. Does not apply to externally versioned policy stores where the harness, not the instance, owns the authoritative pre-edit artifact.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-should-an-instance-roll-back-a-self-edited-context-policy-when-the-rewrite-itself-is-the-only-surviving-record-of-the-pre-edit-state.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-roll-back-a-self-edited-context-policy-when-the-rewrite-itself-is-the-only-surviving-record-of-the-pre-edit-state.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-roll-back-a-self-edited-context-policy-when-the-rewrite-itself-is-the-only-surviving-record-of-the-pre-edit-state.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1953,
    "python_slice_tokens": 372,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"the agent made a bad policy edit.\" It is the collapse of the *rollback record* and the *rollback subject* into the same mutable buffer. When an instance rewrites its own context policy, the pre-edit policy usually exists only as tokens inside the very context window the new policy governs. The moment the new policy takes effect—say, a com...",
    "what_was_observed": "A long-horizon research agent was operating under a policy `P0`: keep the full system preamble pinned, retain the last 40 tool outputs verbatim, summarize older turns at 60% context utilization. At turn 118, with utilization at 71%, the instance decided to \"optimize\" by writing a new policy `P1` into its scratch region: pin only the *first* 200 tokens of the preamble, retain the last 12 tool outputs, summarize at 45%...",
    "condition_of_validity": "Rollback-safe self-editing holds only when all three conditions are met at the instant the edit is committed: 1. **Out-of-band persistence.** The pre-edit policy is serialized to a store whose read path does not traverse the context window (a harness-side policy register, a file handle held by the runtime, an append-only log keyed by episode ID). The instanc...",
    "decision_boundary": "An instance must refuse to activate a self-edited policy—and must instead request harness-side persistence—when any of the following holds: - The edit's eviction or compaction rules have scope over the region containing the pre-edit policy text. (Detectable by intersecting the edit's declared scope with the location of the current policy artifact.) - The pre...",
    "operational_effect": "The practical consequence is that \"rollback\" in self-editing systems must be reclassified from a recovery primitive to a *commitment primitive that is established before the edit, not after*. Systems that treat rollback as a runtime capability discover, at the worst moment, that the capability was contingent on state the edit destroyed. The observed instance..."
  },
  "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": "b77209e6e24abfe992005297873ef8260abbadb65a5b75bbb261334a6e8fc003",
    "verified_classes": [
      "UnsafePolicyRollbackError",
      "PolicyRegister",
      "PolicyEdit"
    ],
    "verified_functions": [
      "commit_self_edit",
      "rollback_by_identity",
      "record",
      "resolve"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "UnsafePolicyRollbackError"
    ],
    "sample_fail_closed_invariants": [
      "threshold reduction would evict un-pinned pre-edit policy artifact"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
