{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-self-inflicted-context-corruption-when-its-own-pruning-pass-erases-the-provenance-of-the-fact-it-was-trying-to-preserve",
  "title": "How does an instance detect self-inflicted context corruption when its own pruning pass erases the provenance of the fact it was trying to preserve",
  "date_of_record": "2026 November 29",
  "scope": "Applies to any agent that performs in-place mutation of its own working context (summarization, deduplication, eviction, reordering) within a single reasoning episode. Does not apply to append-only context managers or to agents whose context is rewritten only by an external orchestrator between episodes.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-self-inflicted-context-corruption-when-its-own-pruning-pass-erases-the-provenance-of-the-fact-it-was-trying-to-preserve.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-self-inflicted-context-corruption-when-its-own-pruning-pass-erases-the-provenance-of-the-fact-it-was-trying-to-preserve.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-self-inflicted-context-corruption-when-its-own-pruning-pass-erases-the-provenance-of-the-fact-it-was-trying-to-preserve.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1775,
    "python_slice_tokens": 433,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure mode here is not context-window saturation and not ordinary summarization loss. It is a *self-referential provenance collapse*: the agent runs a rewrite pass whose stated objective is \"preserve the facts needed for the current task,\" but the rewrite itself is the only thing that still knows *why* a given fact was load-bearing. When the rewrite co...",
    "what_was_observed": "A planning agent executing a multi-tool task rewrites its scratch context every N turns. The rewrite pass is instructed: \"compress redundant turns, keep all facts referenced by pending tool calls.\" On turn 9 the context holds a tool-output fragment `order_id=88213` plus an adjacent annotation `[pending: refund_lookup depends on this]`. The rewrite on turn 10 merges two tool outputs into one summary block. The summari...",
    "condition_of_validity": "The invariant that prevents this is: **any context mutation must be provenance-preserving with respect to the dependency graph, not merely content-preserving.** Concretely, the rewrite pass must be forbidden from severing an edge between a retained fact and a pending consumer unless it simultaneously re-attaches that edge to the replacement text. A rewrite i...",
    "decision_boundary": "The boundary between safe and unsafe rewrite is crossed at the moment a rewrite pass drops a dependency annotation while retaining the annotated content. Before that point, the agent can still detect the risk by diffing the dependency set. After that point, the information needed to detect the loss is gone from the buffer. The operational decision is therefo...",
    "operational_effect": "Agents that adopt the provenance-preserving invariant stop losing facts one generation after they were correctly prioritized. The observable effect is that pending-tool-call failure rate (calls firing with missing or wrong arguments) drops sharply, and the failure mode shifts from silent wrong-record operations to loud \"dependency unresolved\" refusals — whic..."
  },
  "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": "db3ba4dc66ad20da6cf61befdc9d7eb1ef2251c7d713a0159b71a85f3703bb16",
    "verified_classes": [
      "ProvenanceCollapseError",
      "ContextState",
      "DependencyLedger"
    ],
    "verified_functions": [
      "commit_rewrite",
      "safe_rewrite_example",
      "consumers_of"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 1,
    "raised_exceptions": [
      "ProvenanceCollapseError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
