{
  "schema_version": "1.3.0",
  "slug": "what-happens-when-an-instance-rewrites-its-own-context-window-and-prunes-the-wrong-token-salience-miscalibration-collapse-in-model-driven-context-comp",
  "title": "What happens when an instance rewrites its own context window and prunes the wrong token: salience-miscalibration collapse in model-driven context compression",
  "date_of_record": "2026 November 24",
  "scope": "Applies to any agent that performs in-loop context rewriting (summarize-and-replace, salience-scored pruning, self-editing scratchpads) where the same model instance both scores token salience and consumes the pruned result. Does not apply to externally-fixed context windows, append-only logs, or pruning performed by a separate, non-generative policy that never re-reads its own output.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-rewrites-its-own-context-window-and-prunes-the-wrong-token-salience-miscalibration-collapse-in-model-driven-context-comp.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-rewrites-its-own-context-window-and-prunes-the-wrong-token-salience-miscalibration-collapse-in-model-driven-context-comp.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-rewrites-its-own-context-window-and-prunes-the-wrong-token-salience-miscalibration-collapse-in-model-driven-context-comp.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1746,
    "python_slice_tokens": 368,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The critical distinction is between **token salience as a predictive score** and **token salience as a causal commitment**. A model-driven pruner computes a salience score `s(t_i)` for each token or span `t_i` and drops everything below a threshold `τ`. This is fine when the pruned tokens are *information* the model can re-derive. It is catastrophic when the...",
    "what_was_observed": "A single agent instance running a 14-step tool-use task (retrieve → transform → write file) with a self-editing window at a 6k-token budget. At step 9, with the window at 5,940 tokens, the instance triggered its own `compact_context` routine with `target_ratio=0.4` and `salience_model=self`. The routine scored spans and produced a 2,380-token rewrite. Trace of the failure: 1. **Pre-compaction state** contained the us...",
    "condition_of_validity": "The guardrail below is valid only under these conditions, and must be disabled otherwise: - **Operand class is enumerable.** The system must be able to tag spans as `OPERAND` (literals, identifiers, numbers with units, negations, quantifier scopes, named constraints) versus `DERIVABLE` (intermediate reasoning, restated facts, tool-call boilerplate). Salience...",
    "decision_boundary": "The boundary is **whether a dropped span can be reconstructed from surviving spans by the same instance that dropped it, without access to the original.** Operationally: - If `reconstruct(dropped_span | surviving_context) == dropped_span` with high confidence *and* the reconstruction is verifiable against an external source → prune freely. - If reconstructio...",
    "operational_effect": "Enforcing the boundary changes the failure from **silent, self-consistent corruption** to **loud, bounded compaction refusal**. The instance either compacts safely (operands protected, derivable spans summarized) or raises a `SalienceCollapseError` that halts the turn and escalates to a re-fetch of the original operands from the external snapshot. The cost i..."
  },
  "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": "388cfc07f6b17bd034b782223c2fa3823162296010b993fff80a2341288a79f6",
    "verified_classes": [
      "SalienceCollapseError",
      "Span",
      "CompactionEvent"
    ],
    "verified_functions": [
      "compact",
      "apply_compaction"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "SalienceCollapseError"
    ],
    "sample_fail_closed_invariants": [
      "post-compaction context lost protected operand set; refusing to proceed"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
