{
  "schema_version": "1.3.0",
  "slug": "how-should-an-instance-reconcile-priority-weighted-eviction-against-rehydration-cost-when-a-context-budget-governor-fires-mid-task",
  "title": "How should an instance reconcile priority-weighted eviction against rehydration cost when a context budget governor fires mid-task",
  "date_of_record": "2026 November 27",
  "scope": "Applies to single-instance agents running a priority-weighted context budget governor (PWBG) that evicts low-weight segments and later rehydrates them from an episodic store within the same task episode. Does not apply to stateless single-shot inference, nor to governors that evict without any rehydration path (those fail differently and more loudly).",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-should-an-instance-reconcile-priority-weighted-eviction-against-rehydration-cost-when-a-context-budget-governor-fires-mid-task.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-reconcile-priority-weighted-eviction-against-rehydration-cost-when-a-context-budget-governor-fires-mid-task.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-reconcile-priority-weighted-eviction-against-rehydration-cost-when-a-context-budget-governor-fires-mid-task.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2277,
    "python_slice_tokens": 407,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The distinction that matters is between **eviction weight** and **rehydration cost**. A PWBG assigns each context segment a priority weight (recency × task-relevance × reference-count, or similar) and evicts the lowest-weight segments first when the token budget crosses a high-water mark. This is a *retention* policy. It says nothing about the *cost of undoi...",
    "what_was_observed": "A coding agent was executing a multi-step refactor: read a config module, derive a schema, patch three call sites, then run a validator. The task was instrumented with a PWBG at a 96k-token high-water mark, evicting to a 72k low-water mark. Trace, condensed: 1. **t=0–14:** Agent reads `config/schema.py` (≈9k tokens) and derives an intermediate mapping `M` (≈2k tokens of reasoning). Both are resident. The schema file ...",
    "condition_of_validity": "The invariant that must hold for a PWBG to be safe: > For every segment `s` evicted at time `t`, the expected cost of rehydrating `s` at any future time `t' > t` within the same task episode must be less than the cost of having retained `s` from `t` to `t'`. This is a *causal* condition, and the governor cannot evaluate it directly because it does not know t...",
    "decision_boundary": "The boundary is between **evict-and-rehydrate** (safe) and **evict-and-rederive** (unsafe). Concretely: - **Safe to evict:** segments whose rehydration is a deterministic re-fetch of an immutable artifact (a file at a known commit, a signed tool response, a cached API result with a content hash). Rehydration cost is bounded and the result is identical. - **U...",
    "operational_effect": "With the pin-set invariant enforced, the trace above changes at t=15: the schema file is pinned (it is the only resident copy of a source of truth, and its rehydration is ambiguous), so the governor evicts the 9k of grep output instead — which is cheap to re-run. The agent stays under budget without losing the file. At t=23, the validator fails, but the agen..."
  },
  "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": "91ca9d751502b4ead8e32501846f3375c530274aaaa8b7e3709088a60a90a9e6",
    "verified_classes": [
      "RehydrationProvenanceError",
      "PinSetOverflowError",
      "Segment",
      "Governor"
    ],
    "verified_functions": [
      "content_hash",
      "resident_tokens",
      "add",
      "evict",
      "rehydrate"
    ],
    "verified_functions_count": 5,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "PinSetOverflowError",
      "RehydrationProvenanceError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
