{
  "schema_version": "1.3.0",
  "slug": "where-must-an-instance-bound-model-driven-pruning-of-stale-reasoning-traces-before-self-editing-context-windows-corrupt-task-state",
  "title": "Where must an instance bound model-driven pruning of stale reasoning traces before self-editing context windows corrupt task state",
  "date_of_record": "2026 December 2",
  "scope": "Applies to single-agent instances that edit their own context window mid-task by having the model select and drop \"stale\" reasoning traces (intermediate CoT, scratchpads, superseded tool outputs). Does not apply to externally managed context compaction, log rotation, or retrieval-layer eviction, where the eviction policy is not authored by the same model instance being pruned.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/where-must-an-instance-bound-model-driven-pruning-of-stale-reasoning-traces-before-self-editing-context-windows-corrupt-task-state.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-bound-model-driven-pruning-of-stale-reasoning-traces-before-self-editing-context-windows-corrupt-task-state.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-bound-model-driven-pruning-of-stale-reasoning-traces-before-self-editing-context-windows-corrupt-task-state.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1971,
    "python_slice_tokens": 400,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"the model forgot something.\" It is that **the model's own staleness judgment is evaluated against the same context it is mutating**, and staleness is a *relational* property between a trace and a downstream obligation, not an intrinsic property of the trace. A reasoning trace is stale if and only if no future step depends on it. The insta...",
    "what_was_observed": "An instance executing a multi-step data-reconciliation task produced a scratchpad at step 3 that read, in part: At step 7, under a self-edit prompt (\"remove reasoning traces no longer needed; preserve conclusions\"), the model classified step 3 as stale—its *conclusion* (the number 41,200) had been propagated into a running summary, so the trace looked discharged. The parenthetical obligation—*add back at final tally*...",
    "condition_of_validity": "Model-driven pruning of reasoning traces is valid only when all three of the following hold: 1. **Obligation extraction precedes pruning.** Before any trace is eligible for deletion, the instance emits an explicit obligation ledger: every forward reference, deferred correction, unresolved subgoal, and committed constant, each with a stable ID and the trace I...",
    "decision_boundary": "The boundary between safe and unsafe pruning is not trace age, trace length, or model confidence. It is whether the trace is a **leaf** or an **interior node** in the obligation dependency graph. - **Leaf trace:** its only content is a conclusion already propagated to the running state, with no forward reference, no deferred correction, no unresolved branch....",
    "operational_effect": "Enforcing the closure invariant changes the instance's self-editing loop from a single model pass into a two-phase protocol: **mint-then-prune**. Phase one extracts the obligation ledger from the full context and freezes it. Phase two prunes only over the graph complement, with a deterministic closure check as veto. The effect on behavior is that the instanc..."
  },
  "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": "62893c5e0f816bc2cc3feeb48b560eb24715bc3483e51d2fa95f1810107f681e",
    "verified_classes": [
      "ClosureViolation",
      "Trace",
      "ObligationLedger"
    ],
    "verified_functions": [
      "safe_prune",
      "self_edit",
      "mint",
      "closure_traces"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "ClosureViolation"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
