{
  "schema_version": "1.3.0",
  "slug": "where-must-an-instance-bound-model-driven-context-rewriting-to-preserve-the-provenance-invariant-across-pruning-and-re-summarization",
  "title": "Where must an instance bound model-driven context rewriting to preserve the provenance invariant across pruning and re-summarization",
  "date_of_record": "2026 November 24",
  "scope": "Applies to any agent instance that mutates its own working context via an LLM-driven policy (prune, summarize, rewrite, compress) and then continues reasoning over the mutated context. Does not apply to append-only context with external truncation, nor to immutable transcript stores read by a separate replayer.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/where-must-an-instance-bound-model-driven-context-rewriting-to-preserve-the-provenance-invariant-across-pruning-and-re-summarization.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-bound-model-driven-context-rewriting-to-preserve-the-provenance-invariant-across-pruning-and-re-summarization.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-bound-model-driven-context-rewriting-to-preserve-the-provenance-invariant-across-pruning-and-re-summarization.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1911,
    "python_slice_tokens": 364,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"the model forgot something.\" It is that a **rewrite operation destroys the distinction between observed token and inferred token while preserving surface fluency**, so a downstream reasoning step treats a synthesized claim as if it carried the evidentiary weight of a tool output. A pruner that deletes a stale tool result is safe; a *rewri...",
    "what_was_observed": "A long-horizon agent (≈140 turns, mixed tool calls and reasoning) ran a self-pruning policy every 20 turns: when context exceeded a token threshold, an auxiliary LLM call summarized the oldest 40% of turns into a single \"state block,\" which replaced them in the working context. The state block was inserted as plain assistant-role text with no metadata. Trace of the failure: 1. Turn 31: tool call `get_schema(\"orders\")...",
    "condition_of_validity": "The provenance invariant holds only under a specific condition, which most self-editing policies silently assume without checking: > A rewrite `R` over a set of context spans `S` is *provenance-preserving* iff `class(R(S)) = ⋁_{s∈S} class(s)`, where `⋁` is the weakest-link join (ASSUMED < DERIVED < OBSERVED), **and** every atomic claim in `R(S)` is traceable...",
    "decision_boundary": "The operational question is **when to allow a rewrite to change provenance class vs. when to refuse the rewrite**. The boundary: - **Prune-without-rewrite (delete spans, keep survivors verbatim):** always safe. Provenance of survivors is untouched. Use when the goal is token reduction only. - **Rewrite-with-attribution (summarize, but each claim carries span...",
    "operational_effect": "Enforcing the invariant changes three things: 1. **Rewrite cost increases** — attributed rewrites require a validator pass (entailment check per claim) and structured output, roughly 1.4–2× the tokens of free-prose summarization. This is the price of the invariant. 2. **Compression ratio drops** — attributed summaries are longer because they carry pointers. ..."
  },
  "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": "65610634c1fd4068ecc525d4298254b40e36bceffdd1cdddebda69adb429c621",
    "verified_classes": [
      "Provenance",
      "Span",
      "Claim",
      "ProvenanceViolation"
    ],
    "verified_functions": [
      "_join",
      "validate_rewrite"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "ProvenanceViolation"
    ],
    "sample_fail_closed_invariants": [
      "cannot retain OBSERVED class after source spans are garbage-collected; demote to DERIVED and flag evidence loss"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "enum",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
