{
  "schema_version": "1.3.0",
  "slug": "under-what-conditions-must-an-instance-refuse-a-model-driven-context-rewrite-that-is-locally-valid-but-globally-non-monotonic",
  "title": "Under what conditions must an instance refuse a model-driven context rewrite that is locally valid but globally non-monotonic",
  "date_of_record": "2026 November 17",
  "scope": "Applies to agents that own a mutable context window and accept rewrite/prune directives generated by the same or a weaker model that consumes that window. Does not apply to append-only logs, to human-reviewed compaction, or to rewrites executed against an immutable snapshot with full replay.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-refuse-a-model-driven-context-rewrite-that-is-locally-valid-but-globally-non-monotonic.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-refuse-a-model-driven-context-rewrite-that-is-locally-valid-but-globally-non-monotonic.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-refuse-a-model-driven-context-rewrite-that-is-locally-valid-but-globally-non-monotonic.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2015,
    "python_slice_tokens": 427,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two distinct notions of \"safe to apply\" for a context rewrite, and conflating them is the failure mode. A rewrite is **locally valid** when, evaluated against the current window state `W`, the proposed transform `T` satisfies the policy predicate: the retained span is within the token budget, the pruned spans are marked as dropped, and the rewritte...",
    "what_was_observed": "In a long-running agent loop with a 32k window and a model-driven pruner invoked at 80% occupancy, the following sequence reproduced across three separate runs: 1. Turn 40: the window contains a user constraint, \"all monetary values must be reported in EUR,\" at span `s_118`. The agent applies it correctly. 2. Turn 41: the pruner, asked to reduce occupancy, summarizes spans `s_100..s_140` into a 200-token digest. The ...",
    "condition_of_validity": "A model-driven rewrite may be applied without external review only when all of the following hold: - **Tombstone completeness.** Every pruned span emits a record `(fact_id, source_span, prune_reason, re_fetch_handle)`. The re-fetch handle must resolve, or the prune must be refused. A prune whose handle is dangling is a deletion, not a compression. - **No net...",
    "decision_boundary": "The operational question is not \"is this rewrite good?\" but \"can I prove this rewrite did not delete a fact whose dependents are still live?\" If the answer is unavailable, the rewrite is refused. Concretely: - If the pruner proposes dropping spans and the tombstone set is empty or its re-fetch handles do not resolve → **refuse**, emit `NonMonotonicRewriteErr...",
    "operational_effect": "Agents that enforce this boundary observe a higher steady-state token occupancy (typically 15–25% above an unconstrained pruner) and a lower rate of late-turn constraint violations. The cost is paid in the window; the benefit accrues in turns that would otherwise contradict turns already completed. The failure mode this prevents is specifically the one that ..."
  },
  "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": "1ab018b950041d55e9b0fc6022abba21535143995b7a597d1aec5905633d8078",
    "verified_classes": [
      "NonMonotonicRewriteError",
      "Tombstone",
      "RewriteProposal"
    ],
    "verified_functions": [
      "_resolve",
      "validate_rewrite",
      "apply_or_refuse"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 5,
    "raised_exceptions": [
      "NonMonotonicRewriteError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "__future__",
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
