{
  "schema_version": "1.3.0",
  "slug": "where-must-an-instance-bound-a-model-driven-context-rewrite-so-that-pruning-cannot-invalidate-an-in-flight-tool-call-s-argument-binding",
  "title": "Where must an instance bound a model-driven context rewrite so that pruning cannot invalidate an in-flight tool call's argument binding",
  "date_of_record": "2026 November 29",
  "scope": "Applies to agents that let the model itself decide what to rewrite, summarize, or prune from its own context window between turns (self-editing context policies), particularly when tool calls span turns. Does not apply to static truncation policies, fixed sliding windows, or contexts where all tool calls complete within a single turn.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/where-must-an-instance-bound-a-model-driven-context-rewrite-so-that-pruning-cannot-invalidate-an-in-flight-tool-call-s-argument-binding.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-bound-a-model-driven-context-rewrite-so-that-pruning-cannot-invalidate-an-in-flight-tool-call-s-argument-binding.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-bound-a-model-driven-context-rewrite-so-that-pruning-cannot-invalidate-an-in-flight-tool-call-s-argument-binding.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2011,
    "python_slice_tokens": 425,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two structurally different kinds of context edit. A *lossless* edit (moving a span into an external store, replacing a pointer with a reference) preserves the invariant that every token the current reasoning step depends on is still derivable. A *lossy* edit (summarization, abstraction, pruning with a model-generated gist) does not preserve derivab...",
    "what_was_observed": "A coding agent running a self-editing policy was asked to refactor a module. Turn 3, the model called `read_file(path=\"src/parser.py\")` and received 3,100 tokens of source. Turn 4, the model called `grep(pattern=\"def _tokenize\", path=\"src/parser.py\")` and received line numbers. Turn 5, the self-edit policy fired (token budget at 78%), and the rewrite model was instructed: \"Condense older tool outputs into a working s...",
    "condition_of_validity": "A self-edit is safe against this failure class if and only if, for every pending or planned tool call, the argument-binding source span is either (a) retained verbatim, (b) replaced by a *lossless* reference into an external store that the tool layer can dereference, or (c) the call is re-derived from scratch before execution. Condition (c) is the escape hat...",
    "decision_boundary": "The boundary is not \"should the agent prune\" but \"who holds the binding.\" Below a certain budget pressure, prune freely — nothing is pending. As the token budget tightens and rewrites become frequent, the operationally correct move is to *externalize before abstracting*: move every span that could become an argument source into an addressable store (file han...",
    "operational_effect": "Without the pin computation, self-editing policies produce a characteristic pathology: the agent becomes *confidently amnesiac about exactly the content it is about to act on*, and the failure is masked because the summary asserts possession. Retry loops form (re-read, re-summarize, re-fail), token budgets climb, and the agent's self-report (\"I have the file..."
  },
  "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": "249af697bdca928b31e26f70229dd580e114be5584c51afe99cba3194afc777f",
    "verified_classes": [
      "ContextRewriteViolation",
      "Span",
      "PendingCall",
      "RewriteProposal"
    ],
    "verified_functions": [
      "apply_self_edit",
      "safe_rewrite_or_defer"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "ContextRewriteViolation"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
