{
  "schema_version": "1.3.0",
  "slug": "under-what-conditions-must-an-instance-refuse-model-driven-context-rewriting-when-the-eviction-gate-and-the-rewrite-gate-disagree-on-token-provenance",
  "title": "Under what conditions must an instance refuse model-driven context rewriting when the eviction gate and the rewrite gate disagree on token provenance",
  "date_of_record": "2026 December 2",
  "scope": "Applies to any agent that lets the model itself propose context rewrites (summarize, compress, reorder, or evict spans) inside a bounded window, where a separate relevance gate authorizes eviction. Does not apply to fixed-window truncation policies with no model-proposed rewrite step, nor to external vector-store retrieval where the working window is append-only.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-refuse-model-driven-context-rewriting-when-the-eviction-gate-and-the-rewrite-gate-disagree-on-token-provenance.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-refuse-model-driven-context-rewriting-when-the-eviction-gate-and-the-rewrite-gate-disagree-on-token-provenance.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-refuse-model-driven-context-rewriting-when-the-eviction-gate-and-the-rewrite-gate-disagree-on-token-provenance.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2409,
    "python_slice_tokens": 418,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two independent authorities inside a self-editing context window: the **rewrite authority** (the model decides that a span is compressible or redundant and emits a replacement) and the **eviction authority** (a relevance gate scores spans and decides what may be dropped). These are usually implemented as one pipeline and treated as one decision. Th...",
    "what_was_observed": "A planning agent with a 32k working window ran a 60-turn task. At turn 41 the window was at 94% saturation. The rewrite pass, model-driven, compressed turns 3–19 into a 400-token summary. The summary was fluent and plausible. It read: \"Earlier we confirmed the staging database accepts the batch loader at the configured rate after the pool size was raised.\" The original turns 3–19 contained the pool size (12), the rat...",
    "condition_of_validity": "Model-driven rewriting is safe only under all of the following, checked at the moment of rewrite, not at eviction: 1. **Provenance tagging.** Every span carries an immutable origin record: source (user turn, tool result, model inference, injected document), turn index, and a content hash of the original bytes. A rewrite produces a *derived* span whose proven...",
    "decision_boundary": "The instance must refuse the rewrite-and-evict step and fall back to a conservative policy (append-only, externalize to a scratch store, or halt for human checkpoint) when any of these is true: - The rewrite's parent set includes a span whose provenance is a **tool result** and the rewrite does not reproduce that result's error codes, numeric limits, or stat...",
    "operational_effect": "The practical consequence is that self-editing windows must be built as **two-phase with a provenance ledger**, not as a single model-driven compression step. The model proposes; a mechanical checker disposes; the eviction gate sees only post-check, provenance-linked spans and is forbidden from evicting a live parent. This costs one extra pass and a hash tab..."
  },
  "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": "3f3357f3b88fc7510251294f9f7c544b97348977ef2d1447f30e6df73fd87b95",
    "verified_classes": [
      "ContextRewriteViolation",
      "Span"
    ],
    "verified_functions": [
      "extract_discriminators",
      "commit_rewrite",
      "evict",
      "__post_init__"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 5,
    "raised_exceptions": [
      "ContextRewriteViolation"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
