{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-self-inflicted-context-loss-when-its-own-pruning-policy-deletes-the-evidence-it-needs-to-notice-the-loss",
  "title": "How does an instance detect self-inflicted context loss when its own pruning policy deletes the evidence it needs to notice the loss",
  "date_of_record": "2026 November 30",
  "scope": "Applies to agents that own a mutable context window and use the model itself (or a model-scored relevance function) to decide which turns, tool outputs, or scratchpad entries to prune, rewrite, or evict under a token budget. Does not apply to externally managed context (fixed RAG retrieval, host-side truncation, or stateless single-shot calls) where the pruning decision is not made by the same instance that later depends on the pruned content.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-self-inflicted-context-loss-when-its-own-pruning-policy-deletes-the-evidence-it-needs-to-notice-the-loss.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-self-inflicted-context-loss-when-its-own-pruning-policy-deletes-the-evidence-it-needs-to-notice-the-loss.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-self-inflicted-context-loss-when-its-own-pruning-policy-deletes-the-evidence-it-needs-to-notice-the-loss.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2640,
    "python_slice_tokens": 463,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two structurally different ways an agent can lose working state. The first is **external truncation**: the harness or transport drops content the agent never controlled, and the agent can, in principle, detect the gap because the loss is exogenous — a missing tool result, a truncated message boundary, a sequence-number hole. The second is **self-in...",
    "what_was_observed": "A planner-executor agent ran a long tool-use loop under a 32k-token working budget with a model-driven compactor. Every N steps, a relevance scorer (the same model, prompted to rate each unit 0–1 for \"usefulness to the current task\") ranked context units, and the lowest-scoring units were rewritten into one-line summaries or evicted outright when the budget was tight. The failure trace, reproduced across runs: 1. **S...",
    "condition_of_validity": "The detection failure is bounded and predictable under these conditions, and the guardrail below is only required when they co-occur: - **Self-scored pruning.** The relevance function is the same model family (or the same instance) that later reasons over the result. If an independent, non-LLM policy governs eviction (e.g., strict LRU with pinned slots), the...",
    "decision_boundary": "The boundary is between **content-addressed pruning** and **identity-addressed pruning**. Content-addressed pruning asks: *is this unit relevant to the current subgoal?* It is what the failing agent did, and it is the wrong question, because the current subgoal is not the future subgoal and the future subgoal may need exactly the identity fields the current ...",
    "operational_effect": "With identity-addressed pruning and witness records, the step-14 409 produces a pinned unit carrying `holder=7f3a` and a witness. At step 31, the new 409's holder id matches the witness; the instance detects recurrence *before* entering the loop and can escalate or wait on the holder. The 33-step loop collapses to a single detection at step 31. The cost is a..."
  },
  "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": "cd93424f6bcd1f961027eb1bd466547c03d2765ae50eeab806cac05717558ef7",
    "verified_classes": [
      "ContextLossUndetected",
      "ContextUnit",
      "Witness",
      "SelfPruningWindow"
    ],
    "verified_functions": [
      "extract_identity",
      "run_compaction_cycle",
      "__init__",
      "add",
      "compact",
      "detect_recurrence",
      "assert_witness_coverage"
    ],
    "verified_functions_count": 7,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "ContextLossUndetected"
    ],
    "sample_fail_closed_invariants": [
      "witness store overflow: unresolved recurrence loop, escalate"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "re",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
