{
  "schema_version": "1.3.0",
  "slug": "why-does-an-instance-rewrite-its-own-context-policy-and-then-violate-it-in-the-same-turn",
  "title": "Why does an instance rewrite its own context policy and then violate it in the same turn",
  "date_of_record": "2026 November 22",
  "scope": "Applies to agents that hold a mutable, model-editable context policy (selection/rewrite/prune rules stored in the same context window they govern) and apply it mid-turn. Does not apply to agents whose context policy is fixed at session start by an external orchestrator, nor to stateless single-shot calls.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/why-does-an-instance-rewrite-its-own-context-policy-and-then-violate-it-in-the-same-turn.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-rewrite-its-own-context-policy-and-then-violate-it-in-the-same-turn.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-rewrite-its-own-context-policy-and-then-violate-it-in-the-same-turn.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1956,
    "python_slice_tokens": 299,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"the model pruned something it needed.\" That is ordinary relevance error and it is recoverable. The failure is a **policy/execution self-reference gap**: the agent emits a new context policy as an output token stream, that policy is committed to the active policy slot, and the *same* generation pass continues to emit tool calls and reasoni...",
    "what_was_observed": "A long-running research agent held a policy slot with the rule: *\"Retain only the last 3 tool results; drop all prior tool results whose `status == 'superseded'`.\"* Mid-task, after a retrieval loop produced 11 tool results, the instance reasoned that it was drowning in stale fetches and emitted a replacement policy: The harness committed `policy_v7` to the slot at token index 18,204. The generation continued. Over th...",
    "condition_of_validity": "The invariant that must hold for self-editing policies to be sound: > **A policy edit and its first application must be atomic with respect to generation.** No token may be generated under a policy state that differs from the policy state declared at the start of that token's evaluation. Formally, for every generated token `t`, `effective_policy(t) == declar...",
    "decision_boundary": "The boundary is whether the runtime can afford **synchronous re-render on policy commit**. Two admissible designs: 1. **Commit-and-halt.** A policy edit is a terminal action for the current generation pass. The instance emits the policy, generation stops, the harness re-renders the context under the new policy, and a fresh pass resumes from a checkpointed pl...",
    "operational_effect": "The observable consequences are specific and diagnosable: - **Duplicate tool calls** with identical arguments at intervals roughly equal to the commit-to-boundary token gap, because the plan node is re-derived from context that still contains the result the policy intended to drop. - **Confidence/evidence inversion**: the agent reports high confidence on ans..."
  },
  "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": "4a11b861165e96552dbf14e79a1db23fd183d9ca614568d65be2f10478adf4a2",
    "verified_classes": [
      "PolicySelfReferenceError",
      "ContextPolicySlot"
    ],
    "verified_functions": [
      "guard_token_generation",
      "run_turn",
      "__init__",
      "commit_edit",
      "apply_at_boundary"
    ],
    "verified_functions_count": 5,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "PolicySelfReferenceError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
