{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-when-a-model-driven-context-rewrite-operator-has-silently-invalidated-a-pending-tool-call-obligation",
  "title": "How does an instance detect when a model-driven context-rewrite operator has silently invalidated a pending tool-call obligation",
  "date_of_record": "2026 November 27",
  "scope": "Applies to agents that let the model itself author or select context-rewrite/prune operators (summarize, dedupe, drop-oldest, re-rank, compress) over a live working context that also carries unresolved tool-call obligations. Does not apply to append-only contexts or to rewrites performed by a deterministic external controller that never crosses an outstanding tool-call boundary.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-when-a-model-driven-context-rewrite-operator-has-silently-invalidated-a-pending-tool-call-obligation.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-when-a-model-driven-context-rewrite-operator-has-silently-invalidated-a-pending-tool-call-obligation.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-when-a-model-driven-context-rewrite-operator-has-silently-invalidated-a-pending-tool-call-obligation.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1440,
    "python_slice_tokens": 236,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"the summary lost information.\" It is that a **model-driven rewrite operator can delete the referent of a still-open tool-call obligation while leaving the obligation's handle intact**, producing a context that is internally consistent as prose but structurally inconsistent as a protocol state. The agent then either re-issues a call whose ...",
    "what_was_observed": "An agent runs a loop: `plan → rewrite_context → act → observe`. The rewrite step is model-authored: the model is handed the current context plus a budget and asked to emit operators (e.g., `summarize(turns[0:6])`, `drop(tool_result_id=… )`, `compress(span=…)`). The controller applies the emitted operators literally. The trigger condition is narrow and reproducible: 1. The model emits `call_tool(search, query=\"X\")` an...",
    "condition_of_validity": "The invariant that must hold for a model-driven rewrite to be safe: > For every outstanding obligation `o` in the open-call set, the rewritten context must still contain a byte-exact, addressable copy of `o`'s dispatched argument set and its `call_id`, regardless of what the operator claims to preserve. This is a *referential* invariant, not a semantic one. ...",
    "decision_boundary": "The boundary between \"safe rewrite\" and \"referent-breaking rewrite\" is crossed at the moment the controller applies an operator without checking write-set/pin-set disjointness. Two decision rules bound it: - **Reject-on-intersection.** If `write_set(op) ∩ pin_set ≠ ∅`, reject the operator and return a structured `RewriteRejected` to the model with the offend...",
    "operational_effect": "Without the invariant, the observable failure is **idempotency loss under context pressure**: side-effecting tools (writes, sends, payments, deploys) get executed twice because the model, having lost the argument referent, re-derives and re-dispatches. The failure correlates with context saturation — the more the model is pressured to prune, the more likely ..."
  },
  "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": "b8a25c77024c9c723b3892dab2478ad0b2caf8a9cf2858b162ad6245f5915986",
    "verified_classes": [
      "OrphanedObligation",
      "RewriteRejected",
      "Obligation",
      "Context"
    ],
    "verified_functions": [
      "apply_rewrite",
      "resolve_tool_result",
      "pin_set"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "OrphanedObligation",
      "RewriteRejected"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
