{
  "schema_version": "1.3.0",
  "slug": "what-happens-when-an-instance-evicts-a-priority-pinned-tool-result-under-adaptive-token-budgeting-and-then-re-requests-it-from-a-non-idempotent-tool",
  "title": "What happens when an instance evicts a priority-pinned tool result under adaptive token budgeting and then re-requests it from a non-idempotent tool",
  "date_of_record": "2026 November 25",
  "scope": "Applies to single-agent execution loops that run an adaptive token-budget manager with priority-based eviction over a context containing tool-call results. Does not apply to stateless single-turn calls, nor to systems where every tool is provably idempotent and replayable.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-evicts-a-priority-pinned-tool-result-under-adaptive-token-budgeting-and-then-re-requests-it-from-a-non-idempotent-tool.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-evicts-a-priority-pinned-tool-result-under-adaptive-token-budgeting-and-then-re-requests-it-from-a-non-idempotent-tool.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-evicts-a-priority-pinned-tool-result-under-adaptive-token-budgeting-and-then-re-requests-it-from-a-non-idempotent-tool.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1984,
    "python_slice_tokens": 411,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The distinction that matters is between *eviction as a memory operation* and *eviction as an assumption of replayability*. A priority-based eviction policy treats context as a cache: when the token budget tightens, low-priority entries (old tool results, verbose reasoning traces, superseded observations) are dropped, and the agent is expected to \"just re-fet...",
    "what_was_observed": "A research agent was executing a multi-step task against a tool surface that included `search_documents` (idempotent, cheap), `fetch_url` (idempotent but slow, ~4s), and `create_ticket` (non-idempotent: each call allocates a new ticket ID and fires a webhook). The budget manager was configured with adaptive thresholds: at 70% context occupancy it began evicting, and it ranked entries by a priority score combining rec...",
    "condition_of_validity": "The eviction policy is valid only under the conjunction of three conditions, and the failure above is the violation of the third: 1. **Reconstructability:** any evicted entry can be regenerated from retained state without external side effects. 2. **Determinism:** the regenerated entry is byte-identical (or semantically equivalent under a declared equivalenc...",
    "decision_boundary": "The architectural guardrail is a **side-effect class on every tool schema**, enforced at eviction time, not at call time. Each tool declares one of `PURE`, `IDEMPOTENT`, or `EFFECTFUL`. The budget manager may evict `PURE` results freely. It may evict `IDEMPOTENT` results only if it writes a tombstone carrying the call signature and a content hash, so a re-is...",
    "operational_effect": "With the guardrail in place, the step-14 eviction pass would have found the `create_ticket` result ineligible and compacted it to a pinned `{effect: create_ticket, handle: TCK-4471, step: 6}` record occupying ~20 tokens instead of the full result. At step 19 the agent reads the pinned record, retrieves the ID directly, and issues a *read* (`get_ticket_status..."
  },
  "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": "8fa7eb8e0b0c3ff3bb358b814064b43227e581575a77138dd86975db6b0711d6",
    "verified_classes": [
      "SideEffectClass",
      "CompactionImpossible",
      "ContextEntry",
      "BudgetManager"
    ],
    "verified_functions": [
      "signature",
      "occupancy",
      "evict_pass",
      "compact_effectful"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "CompactionImpossible",
      "ValueError"
    ],
    "sample_fail_closed_invariants": [
      "compact_effectful called on non-effectful entry"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "enum",
      "hashlib",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
