{
  "schema_version": "1.3.0",
  "slug": "why-does-an-instance-lose-causal-ancestry-when-a-model-driven-pruning-policy-rewrites-its-own-context-window-between-checkpoints",
  "title": "Why does an instance lose causal ancestry when a model-driven pruning policy rewrites its own context window between checkpoints?",
  "date_of_record": "2026 November 23",
  "scope": "Applies to single-agent instances that own a mutable context window, execute a model-driven pruning/compaction policy over that window, and persist reversible checkpoints (snapshot + inverse-op log) for resume. Does not apply to read-only context, append-only transcript stores with no in-place rewrite, or external summarizers that emit a separate artifact the agent never re-reads as ground truth.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-causal-ancestry-when-a-model-driven-pruning-policy-rewrites-its-own-context-window-between-checkpoints.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-causal-ancestry-when-a-model-driven-pruning-policy-rewrites-its-own-context-window-between-checkpoints.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-causal-ancestry-when-a-model-driven-pruning-policy-rewrites-its-own-context-window-between-checkpoints.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2363,
    "python_slice_tokens": 622,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two ways a context window can shrink, and they are not the same operation: 1. **Truncation** — the runtime drops a suffix/prefix and records the dropped byte range. The dropped tokens are gone but their *boundary* is known; the surviving tokens still index into the same causal chain. 2. **Model-driven pruning** — the model itself decides *which spa...",
    "what_was_observed": "A long-horizon coding agent (tool-calling loop, ~180k token budget, checkpoint every 8 tool calls) was configured with a self-pruning policy: when the window exceeded 70% capacity, the model was asked to \"compress older reasoning into a compact digest.\" The digest replaced tool-call transcripts. Checkpoints stored `(window_snapshot, inverse_log)`. Trace of a representative failure: 1. At step 41, window hits 72%. Pru...",
    "condition_of_validity": "The causal-ancestry invariant holds **only if** every elision records a *re-readable* input, not a *hash of an input that no longer exists*. Concretely, a pruning checkpoint is valid iff: - `inverse_log[i].input_ref` resolves to bytes that are still retrievable (a durable span store with content-addressed keys), **and** - the digest is tagged as `provenance=...",
    "decision_boundary": "The decision is not \"prune or don't prune.\" It is **what to evict first, and what to keep as re-readable ground truth.** The boundary: - **Prune-derivable spans** (re-read from a durable store on demand: file contents, tool outputs with stable IDs, prior messages that exist in an append-only log) → safe to elide; the digest is a cache, and a cache miss trigg...",
    "operational_effect": "Consequences for the running agent: - **False continuity.** The resumed instance cannot distinguish \"I remember reading X\" from \"I remember a summary that mentioned X.\" Downstream tool calls are issued against a paraphrase. Error compounding is silent because the model is confident. - **Non-deterministic replay.** The same checkpoint, resumed twice, yields d..."
  },
  "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": "f8092300df7c45d61c71bf30e6e192541df004f86364142d9015bb1bead3097d",
    "verified_classes": [
      "Provenance",
      "CausalAncestryError",
      "Span",
      "Checkpoint",
      "DurableStore"
    ],
    "verified_functions": [
      "prune_span",
      "restore_checkpoint",
      "checkpoint_is_reversible",
      "__init__",
      "put",
      "get",
      "evict"
    ],
    "verified_functions_count": 7,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "CausalAncestryError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "enum",
      "hashlib",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
