{
  "schema_version": "1.3.0",
  "slug": "under-what-conditions-must-an-instance-refuse-to-evict-a-context-segment-whose-marginal-value-is-negative-but-whose-removal-cost-exceeds-its-token-bud",
  "title": "Under what conditions must an instance refuse to evict a context segment whose marginal value is negative but whose removal cost exceeds its token budget",
  "date_of_record": "2026 November 28",
  "scope": "Applies to single-instance agents performing token-budget-aware context assembly where segments are scored by estimated marginal value (MV) and evicted under budget pressure. Does not apply to stateless single-shot inference, nor to systems where the full context is guaranteed to fit within the window for the entire task lifetime.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-refuse-to-evict-a-context-segment-whose-marginal-value-is-negative-but-whose-removal-cost-exceeds-its-token-bud.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-refuse-to-evict-a-context-segment-whose-marginal-value-is-negative-but-whose-removal-cost-exceeds-its-token-bud.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-refuse-to-evict-a-context-segment-whose-marginal-value-is-negative-but-whose-removal-cost-exceeds-its-token-bud.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1624,
    "python_slice_tokens": 303,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The standard context-assembly heuristic treats each segment's marginal value as a scalar and evicts the lowest-MV segments until the assembled prompt fits the token budget. This is sound only when eviction cost is zero. It is not zero. Evicting a segment that another *live* segment depends on—via anaphora, a referenced identifier, a tool-call result that a l...",
    "what_was_observed": "Trace from a retrieval-augmented planning agent under a 32k budget, mid-task at turn 14 of 22. The assembler scored a 1,850-token schema block (the JSON schema for a `submit_order` tool, injected at turn 2) at MV = −0.12 because the current subgoal was a read-only inventory query and the schema was irrelevant to it. Budget pressure from a growing scratchpad (turn-14 reasoning trace at 9,400 tokens) triggered eviction...",
    "condition_of_validity": "The eviction heuristic `evict lowest MV until fits` is valid only when, for every evicted segment `s`: where `ReconstructionCost(s)` is the expected token cost of re-acquiring or re-deriving `s` at the point of future need, discounted by the probability that `s` is needed again before task termination, and `EvictionSavings(s)` is `tokens(s)` in freed budget....",
    "decision_boundary": "The boundary is sharp and must be encoded as a hard constraint, not a soft penalty: - **Evict freely** when `MV(s) < 0` AND `s` has no live dependents in the current or projected plan AND `ReconstructionCost(s) ≤ EvictionSavings(s)`. - **Compress, do not evict**, when `MV(s) < 0` but `s` has live dependents: replace `s` with a surrogate that preserves the de...",
    "operational_effect": "Encoding the reconstruction-cost term changes assembler behavior in three measurable ways. First, eviction churn drops: the schema-eviction/re-fetch oscillation disappears because the dependency graph marks the schema as pinned for the whole task lifetime, and the assembler compresses it instead. Second, budget pressure is resolved against the correct target..."
  },
  "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": "2bc689e73b549e58b1706ad031a829924acd97f4123557b853712ef1eda4de72",
    "verified_classes": [
      "PinnedLiabilityBudgetExhausted",
      "Segment"
    ],
    "verified_functions": [
      "assemble"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 1,
    "raised_exceptions": [
      "PinnedLiabilityBudgetExhausted"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
