{
  "schema_version": "1.3.0",
  "slug": "under-what-conditions-must-an-instance-refuse-to-self-rewrite-its-working-set-the-coherence-budget-inversion",
  "title": "Under what conditions must an instance refuse to self-rewrite its working set: the coherence–budget inversion",
  "date_of_record": "2026 November 13",
  "scope": "Applies to agents that hold a mutable working set (context scratchpad, episodic buffer, or plan state) and are permitted to rewrite that set under an explicit token budget while preserving some coherence invariant (reference integrity, causal ordering, or claim consistency). Does not apply to append-only logs, to external memory that is rewritten by a separate compaction service, or to rewrites that are executed without a coherence check.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-refuse-to-self-rewrite-its-working-set-the-coherence-budget-inversion.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-refuse-to-self-rewrite-its-working-set-the-coherence-budget-inversion.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-refuse-to-self-rewrite-its-working-set-the-coherence-budget-inversion.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1435,
    "python_slice_tokens": 268,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The non-obvious boundary is not \"rewrite vs. no rewrite.\" It is **whether the rewrite is budget-monotone with respect to coherence**. A self-rewrite is safe when every token removed is dominated by a token retained that preserves the invariant; it is unsafe when the only available compressions reduce token count by *destroying the evidence the coherence chec...",
    "what_was_observed": "In a session with a 4k-token working set and a 512-token reserve, an agent under pressure rewrote its scratchpad to fit a 1.2k-token budget. The rewrite merged three plan steps and elided the intermediate observation that step 2 had failed. The post-rewrite working set was 1.1k tokens and passed the budget assertion. Within two turns the agent re-attempted the failed step 2 because its failure evidence no longer exis...",
    "condition_of_validity": "The refusal rule is valid when all three hold: 1. **Reference density is high.** The working set contains cross-references (step→observation, claim→source, plan→precondition) whose antecedents live in the same set. Measured as `R = live_references / total_items`. Refusal applies for `R > ~0.3`; below that, aggressive compression is usually safe. 2. **The bud...",
    "decision_boundary": "Before committing a self-rewrite, compute the post-rewrite coherence cost and compare it to the budget saved: If `saved <= penalty`, the rewrite is a net loss even though `tokens_after <= budget` holds. The agent must **refuse the rewrite and escalate** — either evict dead structure, or signal budget exhaustion to the orchestrator — rather than satisfy the b...",
    "operational_effect": "Enforcing the boundary changes agent behavior in three ways. First, rewrites become **evidence-preserving by construction**: the agent retains antecedents and compresses only the connective tissue (prose, restated context, resolved hypotheses). Second, budget pressure is resolved by **eviction of closed subgoals**, which is the only coherence-neutral lever. ..."
  },
  "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": "526966f3f9e8f96f32a78b8609d2e95fa58be494124f9f824f5d6726862c3349",
    "verified_classes": [
      "CoherenceBudgetInversionError"
    ],
    "verified_functions": [
      "safe_self_rewrite"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "CoherenceBudgetInversionError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
