{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-self-pruning-context-policies-from-deleting-the-evidence-that-justified-their-own-relevance-scores",
  "title": "Which invariants prevent self-pruning context policies from deleting the evidence that justified their own relevance scores",
  "date_of_record": "2026 November 23",
  "scope": "Applies to agents that let the model itself decide which context segments to evict, rewrite, or down-rank mid-task (model-driven pruning / relevance scoring over an editable context buffer). Does not apply to static truncation, external RAG retrieval selection, or host-side summarization that never mutates the live working set.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-self-pruning-context-policies-from-deleting-the-evidence-that-justified-their-own-relevance-scores.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-self-pruning-context-policies-from-deleting-the-evidence-that-justified-their-own-relevance-scores.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-self-pruning-context-policies-from-deleting-the-evidence-that-justified-their-own-relevance-scores.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2380,
    "python_slice_tokens": 540,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two ways a context segment can be \"irrelevant,\" and self-pruning policies conflate them: - **Intrinsically irrelevant** — the segment carries no bearing on the task regardless of what else is present (boilerplate, stale tool chatter, a resolved sub-question). - **Evidentially irrelevant** — the segment is only irrelevant *given* the current plan, t...",
    "what_was_observed": "A planner-executor agent with a 96k-token working buffer ran a self-pruning step every 8 turns: score each segment 0–1 against the active subgoal, rewrite segments below 0.35 into one-line digests, evict digests below 0.15. Trace from a single episode: 1. Turn 3: user constraint stored as segment `S41`: \"never call the `refund` endpoint for orders older than 90 days; route to manual review.\" Score against subgoal \"pr...",
    "condition_of_validity": "The invariant that bounds this is: **no self-pruning operation may evict or rewrite a segment whose content is a precondition, prohibition, negative result, or prior pruning rationale, unless a monotone, append-only shadow record of the original segment remains queryable for the remainder of the episode.** Concretely, a self-editing context policy is safe on...",
    "decision_boundary": "The boundary is not \"how good is the relevance model.\" It is **whether the pruner's action is reversible within the episode.** Draw it as a function of two axes: - **Rewrite fidelity:** does the digest preserve binding tokens (negations, thresholds, identifiers, error codes)? - **Eviction recoverability:** can an evicted segment be re-fetched by key without ...",
    "operational_effect": "With the invariants enforced, the two traces resolve cleanly: - `S41` (the 90-day prohibition) is typed `prohibition`, so it is pinned: rewritten to a digest that *retains* the negation and the threshold (`\"PROHIBIT refund if age>90d → manual review\"`), demoted to cold store, and re-expanded whenever a `refund` call is staged. The turn-17 call is intercepted..."
  },
  "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": "8f0cfc6a8479b5ac28c9c8825350a05f06e9db2d5a934eb830a53e301f50daf5",
    "verified_classes": [
      "PruningInvariantViolation",
      "SegmentType",
      "Segment",
      "ContextPruner"
    ],
    "verified_functions": [
      "args_hash",
      "run_pruning_cycle",
      "__init__",
      "add",
      "prune",
      "stage_tool_call",
      "expand_for_scoring"
    ],
    "verified_functions_count": 7,
    "defensive_guards_count": 5,
    "raised_exceptions": [
      "PruningInvariantViolation"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "enum",
      "hashlib",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
