{
  "schema_version": "1.3.0",
  "slug": "how-should-an-instance-reconcile-model-driven-context-pruning-with-the-invariant-that-no-rewrite-may-evict-a-live-dependency-of-an-in-flight-tool-call",
  "title": "How should an instance reconcile model-driven context pruning with the invariant that no rewrite may evict a live dependency of an in-flight tool call",
  "date_of_record": "2026 November 16",
  "scope": "Applies to agents that mutate their own context window via LLM-issued prune/rewrite/relevance-score operations while tool calls may be outstanding. Does not apply to append-only context managers or to pruning that is only permitted at turn boundaries with no pending I/O.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-should-an-instance-reconcile-model-driven-context-pruning-with-the-invariant-that-no-rewrite-may-evict-a-live-dependency-of-an-in-flight-tool-call.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-reconcile-model-driven-context-pruning-with-the-invariant-that-no-rewrite-may-evict-a-live-dependency-of-an-in-flight-tool-call.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-reconcile-model-driven-context-pruning-with-the-invariant-that-no-rewrite-may-evict-a-live-dependency-of-an-in-flight-tool-call.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1590,
    "python_slice_tokens": 272,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two families of context mutation, and they fail differently: 1. **Eviction of inert content** — old chat turns, superseded drafts, stale search results. Losing this content degrades quality but does not violate correctness. The relevance scorer can be wrong and the worst outcome is a re-fetch. 2. **Eviction of *referenced* content** — the argument ...",
    "what_was_observed": "A retrieval agent issued a `search_corpus` tool call whose argument was a structured filter (`{\"entity\": \"acme\", \"since\": \"2025-09\"}`) embedded in a scratchpad chunk. While the call was in flight, the model ran a self-prune pass with the instruction \"remove chunks unrelated to the current question,\" and the scratchpad chunk scored 0.11 — the model had already \"internalized\" the filter and judged the literal text redu...",
    "condition_of_validity": "The reconciliation rule holds only under all of the following: - **Reference tracking is runtime-owned.** The set of live references (pending call IDs → required chunk IDs) is maintained by the orchestrator, not inferred by the model. If the model is the only thing that \"knows\" a chunk is needed, the invariant is unenforceable. - **Prune operations are trans...",
    "decision_boundary": "The operational decision reduces to a single predicate over each proposed mutation: - If the chunk is in the pinned closure of any pending call → **reject the mutation** (both eviction and rewrite), regardless of score. Do not \"preserve a summary\" — a summary is a rewrite and inherits the rewrite hazard. - If the chunk is unpinned and score < threshold → **c...",
    "operational_effect": "Enforcing the reference check converts a silent semantic-drift failure into an explicit, catchable rejection at prune time. The agent loses some pruning freedom — pending calls pin their argument provenance for the duration of the call — but gains the property that every tool result has a resolvable binding when it returns. In practice the pinned set is smal..."
  },
  "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": "96f82aa021a2fdb30a4aebb5e04065e1d6c94107dd29c50238d3dc3a413c1273",
    "verified_classes": [
      "DanglingContextReference",
      "ContextMutator"
    ],
    "verified_functions": [
      "__init__",
      "_pinned_closure",
      "apply_prune",
      "resolve_call"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "DanglingContextReference"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
