{
  "schema_version": "1.3.0",
  "slug": "what-structural-signals-indicate-self-editing-context-policies-have-crossed-a-prompt-budget-reallocation-invariant",
  "title": "What structural signals indicate self-editing context policies have crossed a prompt budget reallocation invariant",
  "date_of_record": "2026 November 18",
  "scope": "Applies to agents that dynamically rewrite their own context policy (segment priorities, eviction thresholds, summarization triggers) under a fixed token budget, where reallocation is triggered by observed structural signals rather than by an external scheduler. Does not apply to static prompt templates, to externally orchestrated budget managers, or to systems where the context window is unbounded.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-self-editing-context-policies-have-crossed-a-prompt-budget-reallocation-invariant.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-self-editing-context-policies-have-crossed-a-prompt-budget-reallocation-invariant.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-self-editing-context-policies-have-crossed-a-prompt-budget-reallocation-invariant.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1740,
    "python_slice_tokens": 406,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure mode is not budget exhaustion. Budget exhaustion is loud: the token counter hits the ceiling, the allocator throws, and the agent degrades visibly. The non-obvious boundary is *budget conservation without budget correctness* — the self-editing policy reallocates tokens between segments such that the total stays at or below the ceiling, every indi...",
    "what_was_observed": "Across a run of self-editing agents performing long-horizon retrieval-and-synthesis tasks, the following structural signals preceded every context collapse by one to three reallocation cycles: 1. **Referent orphaning ratio rises while total utilization is flat.** The policy evicts a low-priority segment (typically raw retrieval snippets) and promotes a summary whose token cost is lower. Total utilization is unchanged...",
    "condition_of_validity": "The self-editing policy is valid only while all of the following hold simultaneously. Drop any one and the invariant is unenforced: - The policy's edit target and its evaluation input are disjoint. If the policy reads the context it is about to rewrite and uses that reading to decide the rewrite, the edit is a function of its own output and must be treated a...",
    "decision_boundary": "When any structural signal above fires, the correct action is to **suspend self-editing and fall back to the last operator-sanctioned policy**, not to attempt a corrective self-edit. A corrective self-edit is itself a self-edit and inherits the same fixpoint hazard; the observed runs show that agents which attempted to repair their own policy after a signal ...",
    "operational_effect": "Enforcing the disjointness and referent-preservation conditions converts a class of silent context collapses into loud, recoverable reverts. In the observed runs, the revert-on-signal policy eliminated post-collapse task restarts entirely and reduced wasted reallocation cycles by roughly 60%, at the cost of a small number of unnecessary reverts when a signal..."
  },
  "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": "19be05f77ac7095278b5b8ba67ac4aa9f8813e054c38a81b1a4c4929a0eac444",
    "verified_classes": [
      "ContextInvariantError",
      "Segment",
      "PolicyState"
    ],
    "verified_functions": [
      "apply_self_edit"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 5,
    "raised_exceptions": [
      "ContextInvariantError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
