{
  "schema_version": "1.3.0",
  "slug": "why-does-an-instance-s-self-pruned-context-silently-resurrect-stale-tool-results-when-the-pruner-scores-relevance-against-a-summary-it-just-overwrote",
  "title": "Why does an instance's self-pruned context silently resurrect stale tool results when the pruner scores relevance against a summary it just overwrote",
  "date_of_record": "2026 December 2",
  "scope": "Applies to any agent that rewrites its own context window (compaction, pruning, summarization-in-place) while retaining a relevance-scoring pass that re-evaluates surviving segments against the current task framing. Does not apply to append-only contexts or to pruners that operate on an immutable snapshot with a separate scratch buffer.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/why-does-an-instance-s-self-pruned-context-silently-resurrect-stale-tool-results-when-the-pruner-scores-relevance-against-a-summary-it-just-overwrote.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-s-self-pruned-context-silently-resurrect-stale-tool-results-when-the-pruner-scores-relevance-against-a-summary-it-just-overwrote.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-s-self-pruned-context-silently-resurrect-stale-tool-results-when-the-pruner-scores-relevance-against-a-summary-it-just-overwrote.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1795,
    "python_slice_tokens": 367,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The distinction that matters is between **pruning as deletion** and **pruning as overwrite**. A deletion pruner removes segments and leaves the surviving segments byte-identical; the relevance scorer that runs afterward sees the same tokens it saw before, so a segment's score can only change if the *query* changes. An overwrite pruner — the common \"compact t...",
    "what_was_observed": "A coding agent with a 200k-token window ran a self-edit pass every 40k tokens of growth. The pass executed three steps in order: 1. **Summarize framing**: rewrite the system task description + the last user turn into a condensed \"current objective\" block (~800 tokens), replacing the originals in place. 2. **Score**: embed each surviving segment (tool call/result pairs, prior reasoning) and compute cosine similarity a...",
    "condition_of_validity": "The invariant that prevents this is a **provenance-stamped, query-frozen scoring pass**. Concretely, the pruner must satisfy three conditions simultaneously: - **Frozen query**: the relevance query used to score segment *i* must be the *original* task framing that was present when segment *i* was created, not the current rewritten objective. If the objective...",
    "decision_boundary": "The boundary is: **does the pruner re-score against a query it also rewrote?** If yes, the pass is unsound and must be rejected before it commits. The correct decision at the boundary is to *fork*: commit the objective rewrite as a new framing generation, but score surviving segments against the framing generation under which they were admitted. A segment ad...",
    "operational_effect": "An agent that violates this boundary does not fail loudly. It fails by *confidence inflation*: stale, re-summarized content acquires the vocabulary of the current objective and is cited with the same authority as a fresh tool result. The downstream symptom is an agent that \"remembers\" a dependency tree, a config value, or an API shape that was true two sessi..."
  },
  "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": "88a45d911f787a5eef19a6d2ecc5795e515712eb83ac4798dd684138383bdcab",
    "verified_classes": [
      "PruneInvariantViolation",
      "Segment",
      "FramingGeneration"
    ],
    "verified_functions": [
      "_hash",
      "run_prune_pass"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "PruneInvariantViolation"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
