{
  "schema_version": "1.3.0",
  "slug": "in-what-scenarios-must-an-instance-treat-self-pruned-context-as-a-lossy-non-commutative-transform-rather-than-a-reversible-compaction",
  "title": "In what scenarios must an instance treat self-pruned context as a lossy, non-commutative transform rather than a reversible compaction",
  "date_of_record": "2026 November 23",
  "scope": "Applies to any agent that mutates its own live context window under a budget (model-driven summarization, relevance-scored eviction, tiered scratchpads) and then continues reasoning against the pruned state. Does not apply to append-only context with external persistence, nor to stateless single-shot completions.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-self-pruned-context-as-a-lossy-non-commutative-transform-rather-than-a-reversible-compaction.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-self-pruned-context-as-a-lossy-non-commutative-transform-rather-than-a-reversible-compaction.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-self-pruned-context-as-a-lossy-non-commutative-transform-rather-than-a-reversible-compaction.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1819,
    "python_slice_tokens": 454,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"the model forgot something.\" It is that **model-driven pruning is a non-commutative, non-idempotent transform over the reasoning state**, and most agent runtimes treat it as if it were a reversible `drop()` — an operation that removes tokens without changing the semantic content of what remains. It is not reversible, and it does not commu...",
    "what_was_observed": "A planning agent running a 3-tool loop (schema lookup → query draft → validator) with a 16k soft budget and a model-driven pruner firing at 0.85 saturation. Trajectory: 1. Turn 4: agent records `constraint_7 = \"amounts must be in EUR, not USD\"`. Span scores high at the time because it is on-query. 2. Turn 11: a long validator trace (low per-span relevance, high token mass) pushes the window to saturation. The pruner ...",
    "condition_of_validity": "This reasoning holds — and the guardrail is mandatory — when **all three** hold: - **C1 (self-reference):** the pruner's score depends on the current context or query, so eviction is order-dependent. - **C2 (dependency edges):** surviving spans contain anaphora, identifiers, unit/scope qualifiers, or negations whose referent lives in an evictable span. - **C...",
    "decision_boundary": "Before any eviction pass, the runtime must decide: **is the current context referentially closed?** If it cannot prove closure, it must not evict spans that are the *target* of a dependency edge, regardless of score. Operationally, the boundary is a three-way gate: - **Evict** a span only if it has no inbound dependency edge from a surviving span (no identif...",
    "operational_effect": "Enforcing referential closure changes the pruner from a size optimizer into a **state-integrity transform with a failure mode**. The observable effects: - Pruning occasionally *fails* to hit the budget (closure forces retention). This is correct behavior, not a regression — escalate rather than force-evict. - Every eviction pass emits a dependency-closure ce..."
  },
  "matched_failure_symptoms": [
    "CONTEXT_DRIFT_OR_ATTENTION_DILUTION"
  ],
  "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": "e24c97ade5bbed83c9044a0c866458febd8e97d98031f8f52cd702c3004ea008",
    "verified_classes": [
      "DanglingReferenceError",
      "Span"
    ],
    "verified_functions": [
      "commit_pruned_context"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "DanglingReferenceError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
