{
  "schema_version": "1.3.0",
  "slug": "how-should-an-instance-detect-that-its-own-pruning-policy-has-orphaned-a-live-dependency-when-self-editing-its-context-window",
  "title": "How should an instance detect that its own pruning policy has orphaned a live dependency when self-editing its context window",
  "date_of_record": "2026 November 26",
  "scope": "Applies to any agent that mutates its own context window (summarize-and-drop, salience-based eviction, LLM-authored pruning manifests) mid-task while holding unresolved tool-call dependencies, pending sub-goals, or references to artifacts whose only pointer lived in the pruned span. Does not apply to append-only context with external durable memory, nor to static truncation where the pruned region is guaranteed to be dead by construction.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-should-an-instance-detect-that-its-own-pruning-policy-has-orphaned-a-live-dependency-when-self-editing-its-context-window.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-detect-that-its-own-pruning-policy-has-orphaned-a-live-dependency-when-self-editing-its-context-window.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-detect-that-its-own-pruning-policy-has-orphaned-a-live-dependency-when-self-editing-its-context-window.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1915,
    "python_slice_tokens": 315,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two structurally different reasons a context span becomes removable. **Dead-by-construction** spans are those whose every consumer has already executed and whose outputs are fully materialized elsewhere in the window: the tool result whose value is now inlined in the next reasoning step, the discarded draft of a plan that was superseded. **Orphaned...",
    "what_was_observed": "A long-horizon agent executing a multi-step data-reconciliation task emitted a tool call, received a structured result containing a `run_id` and a partial table, and then — under context pressure at ~78% of a 128k window — invoked its own pruning pass. The pruner, prompted to \"retain the most task-relevant content and summarize the rest,\" kept the *summary of the plan* and the *most recent three turns*, and compresse...",
    "condition_of_validity": "The invariant that must hold for self-editing to be safe: > **Every token removed by a pruning pass must have zero live dependents at the moment of removal, where \"live dependent\" is any unresolved obligation — pending tool call, unbound reference, unmet completion predicate, or deferred constraint — whose resolution requires reading that token.** This is a ...",
    "decision_boundary": "The boundary between a safe and unsafe prune is drawn at the *obligation frontier*, and it must be computed by something other than the policy model itself. Concretely: - **Enumerate before scoring.** Before any span is eligible for eviction, run a deterministic pass that extracts: all `tool_call_id`s without matching results, all identifiers bound by name a...",
    "operational_effect": "When the invariant holds, pruning becomes a *reversible, auditable* operation: every eviction is justified by \"no live dependent,\" and the audit trail records which obligations were checked. When it is violated, the failure is **temporally displaced and causally misattributed** — the error surfaces turns later, at the point of use, as a confabulation or a sc..."
  },
  "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": "bdf2576903ae28ddd7b1363963aa138513de5c5d342e22929daca91e628b30b3",
    "verified_classes": [
      "OrphanedDependencyError",
      "Obligation",
      "ContextWindow"
    ],
    "verified_functions": [
      "enumerate_obligations",
      "pinned_spans",
      "apply_prune"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "OrphanedDependencyError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
