{
  "schema_version": "1.3.0",
  "slug": "why-does-an-instance-lose-tool-call-provenance-when-its-own-pruning-policy-rewrites-the-transcript-under-a-latency-budget",
  "title": "Why does an instance lose tool-call provenance when its own pruning policy rewrites the transcript under a latency budget",
  "date_of_record": "2026 November 30",
  "scope": "Applies to single-agent loops where the model itself selects which prior turns/tool results to prune or summarize (self-editing context policy) and where a per-step latency budget forces the policy to commit to a prune set before the next tool call returns. Does not apply to statically-configured truncation windows or to external, deterministic context managers that never delegate prune decisions to the model.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-tool-call-provenance-when-its-own-pruning-policy-rewrites-the-transcript-under-a-latency-budget.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-tool-call-provenance-when-its-own-pruning-policy-rewrites-the-transcript-under-a-latency-budget.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-tool-call-provenance-when-its-own-pruning-policy-rewrites-the-transcript-under-a-latency-budget.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2096,
    "python_slice_tokens": 521,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two structurally different things a pruning step can do, and they are routinely conflated: 1. **Reduction** — remove tokens while preserving a *referentially closed* transcript: every surviving claim still points at a surviving artifact (tool output, message id, span). 2. **Rewrite** — replace a span of transcript with a model-generated summary tha...",
    "what_was_observed": "A 14-step agent task: read a config file via `read_file`, derive a schema, call `validate` twice with different arguments, then write a patch. Context policy: at each step, if projected tokens exceed a high-water mark, the model is invoked with a *pruning prompt* that returns a set of `(span_id, action)` where action ∈ {drop, summarize}. A hard per-step latency budget of 900 ms forced the pruning call and the next to...",
    "condition_of_validity": "The invariant that must hold for a self-editing policy to be sound: > For every tool call issued at step *t*, every argument that was *derived* from a prior tool result must resolve, through the provenance table, to a live artifact reference — not to a summary span — or the call must be blocked and the artifact re-fetched. Two preconditions make this checkab...",
    "decision_boundary": "The boundary between safe and unsafe self-editing is drawn by *what the next step's tool call depends on*, evaluated before the prune is committed: - If the projected next tool call has **no argument derived from a span slated for summarize** → commit the summarize. Safe. - If it **does** → the span must be *pinned* (excluded from the prune set) for this ste...",
    "operational_effect": "Enforcing the invariant changes three things measurably: 1. **Retry loops terminate.** With provenance intact, `INVALID_ENUM` resolves to the enum artifact and the agent re-fetches instead of guessing. The observed 3-retry loop collapses to one re-fetch. 2. **Rewrite budget becomes a real bound.** Capping summaries (not total prunes) per step means the conte..."
  },
  "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": "dbeda98e11610fca1c0f9a448013bf418803b00c48d7f7773cde07700f5262da",
    "verified_classes": [
      "PruneAction",
      "ProvenanceViolation",
      "Artifact",
      "Span",
      "ProvenanceTable"
    ],
    "verified_functions": [
      "commit_prune_set",
      "dispatch_tool_call",
      "resolve"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "ProvenanceViolation"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "enum",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
