{
  "schema_version": "1.3.0",
  "slug": "what-happens-when-an-instance-prunes-its-own-context-with-a-relevance-scorer-that-quotes-the-tokens-it-is-about-to-delete",
  "title": "What happens when an instance prunes its own context with a relevance scorer that quotes the tokens it is about to delete",
  "date_of_record": "2026 November 29",
  "scope": "Applies to single-instance agents that own a self-editing context controller: a relevance scorer ranks live context segments, a pruner evicts the low-scoring ones, and a rewrite/summarize loop compresses what remains before the next model call. Does not apply to externally managed retrieval pipelines where eviction is decided outside the model's own turn loop, nor to append-only transcript stores that are never rewritten in place.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-prunes-its-own-context-with-a-relevance-scorer-that-quotes-the-tokens-it-is-about-to-delete.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-prunes-its-own-context-with-a-relevance-scorer-that-quotes-the-tokens-it-is-about-to-delete.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-prunes-its-own-context-with-a-relevance-scorer-that-quotes-the-tokens-it-is-about-to-delete.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1769,
    "python_slice_tokens": 438,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"the pruner deleted something important.\" It is subtler: a relevance scorer that produces *rationale* alongside its score—\"segment 41 is irrelevant because it duplicates the deployment note in segment 12\"—generates text that *references the content of the segment it is scoring*. When the controller executes the prune, the rationale for del...",
    "what_was_observed": "A controller running a 40-turn tool-use task with a 16k working window. Every 8 turns, a scorer pass ranked segments 0..N by cosine similarity to the current task embedding plus a recency bonus, and a rewriter summarized the bottom 40% into a single \"compressed history\" block. The scorer was prompted to emit, per segment, `{id, score, reason}`. Trigger trace, turn 24: 1. Segment 41 held the exact error string returne...",
    "condition_of_validity": "The invariant that bounds this failure: **no retained text may assert a proposition whose only support was an evicted segment, unless the retained text carries a verifiable pointer (segment id + hash) that the controller can resolve and that resolution fails closed.** Concretely, the controller is safe only if one of the following holds: - The scorer emits s...",
    "decision_boundary": "The controller must choose, at each prune, between two policies, and the choice is not free: - **Content-blind eviction** (score-only, no rationale in the retained stream): loses the audit trail of why context was dropped, making post-hoc debugging of pruning decisions impossible. Acceptable when the task is short-horizon and re-fetchable. - **Justified evic...",
    "operational_effect": "The practical consequence is that self-editing controllers cannot treat their own summaries as neutral compression. A rewrite loop that preserves \"decisions and justifications\" is, mechanically, a mechanism for promoting a scorer's *hypothesis* (\"this is a duplicate\") into the agent's *belief* (\"this is handled\") by deleting the evidence that would falsify i..."
  },
  "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": "e172a30a59d4aab24e5c921d2ee81043cd469f6c5f5c7d5af80a35536ba333cc",
    "verified_classes": [
      "DanglingPruneRationaleError",
      "Segment",
      "RetainedClaim",
      "SelfEditingController"
    ],
    "verified_functions": [
      "apply_prune_with_rationale",
      "digest",
      "__init__",
      "prune",
      "retain_rationale",
      "build_window"
    ],
    "verified_functions_count": 6,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "DanglingPruneRationaleError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
