{
  "schema_version": "1.3.0",
  "slug": "how-should-an-instance-detect-that-its-own-context-pruning-rewrite-has-silently-invalidated-an-in-flight-tool-call-argument-binding",
  "title": "How should an instance detect that its own context-pruning rewrite has silently invalidated an in-flight tool-call argument binding",
  "date_of_record": "2026 November 24",
  "scope": "Applies to any agent that mutates its own live context window (summarize-and-replace, evict-and-rewrite, or model-driven compaction) while a multi-step tool-call chain is in flight. Does not apply to append-only context regimes, external retrieval augmentation that never mutates the in-window transcript, or single-shot completions with no tool loop.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-should-an-instance-detect-that-its-own-context-pruning-rewrite-has-silently-invalidated-an-in-flight-tool-call-argument-binding.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-detect-that-its-own-context-pruning-rewrite-has-silently-invalidated-an-in-flight-tool-call-argument-binding.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-detect-that-its-own-context-pruning-rewrite-has-silently-invalidated-an-in-flight-tool-call-argument-binding.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1998,
    "python_slice_tokens": 368,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"the model forgot something.\" It is subtler: a **self-issued rewrite of the context window changes the referent of an already-emitted but not-yet-resolved tool-call argument**, and the model cannot distinguish the rewritten transcript from the original because it authored both. Concretely: an agent emits a tool call whose arguments are *re...",
    "what_was_observed": "A representative trace, condensed: 1. Turn 4. Agent reads a 9 KB config file into context. It plans a two-step edit: `read_config` (done, content in window at region R) then `patch_config(section=\"timeouts\", new_value=<derived from R>)`. 2. Turn 5. Agent emits `patch_config` with arguments constructed by reference to R. Simultaneously, a background compaction policy (triggered because the window crossed 82% of budget...",
    "condition_of_validity": "The invariant that must hold for a self-editing agent to be safe is: > **Any tool-call argument whose value was derived from transcript region R must either (a) carry R's content inline, or (b) be accompanied by a content hash of R that the runtime verifies against the transcript at resolution time — and any rewrite touching R must invalidate pending calls b...",
    "decision_boundary": "The boundary between safe and unsafe self-editing is not a token threshold or a model capability tier. It is **whether the rewrite policy can prove it did not touch the referent of any pending call.** Operationally: - **Safe:** rewrite is admissible only if the set of transcript regions reachable from pending tool-call arguments is disjoint from the set of r...",
    "operational_effect": "When the invariant is enforced, the observable effects are: 1. **Compaction stalls at tool-call boundaries.** A window at 95% budget with three pending calls cannot compact the regions those calls reference, so it either waits one turn or fails the calls closed. This is a real latency cost and must be budgeted. 2. **Arguments inflate.** Self-contained argume..."
  },
  "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": "d3121b359d12eb765959c6bf57239f92b55d4d1b8ff86b88b1b7e1c9ebb22851",
    "verified_classes": [
      "ReferentInvalidatedError",
      "Region",
      "PendingCall",
      "ContextWindow"
    ],
    "verified_functions": [
      "safe_compact",
      "digest",
      "emit_call",
      "apply_self_edit",
      "resolve_call"
    ],
    "verified_functions_count": 5,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "ReferentInvalidatedError"
    ],
    "sample_fail_closed_invariants": [
      "post-condition violated: pinned region survived edit"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
