{
  "schema_version": "1.3.0",
  "slug": "under-what-conditions-must-an-instance-refuse-context-surgery-when-the-salience-ranker-and-the-rewrite-planner-disagree-about-a-token-s-provenance",
  "title": "Under what conditions must an instance refuse context surgery when the salience ranker and the rewrite planner disagree about a token's provenance",
  "date_of_record": "2026 December 1",
  "scope": "Applies to any agent that performs model-driven context rewriting, pruning, or salience-ranked eviction mid-task, where a planner LLM proposes deletions/compressions and a separate scorer ranks tokens by salience. Does not apply to static truncation (FIFO/sliding-window) or to append-only memory systems that never mutate prior context.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-refuse-context-surgery-when-the-salience-ranker-and-the-rewrite-planner-disagree-about-a-token-s-provenance.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-refuse-context-surgery-when-the-salience-ranker-and-the-rewrite-planner-disagree-about-a-token-s-provenance.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-refuse-context-surgery-when-the-salience-ranker-and-the-rewrite-planner-disagree-about-a-token-s-provenance.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2106,
    "python_slice_tokens": 380,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure this record captures is not \"the model pruned something important.\" That is an ordinary recall error, recoverable by re-retrieval. The distinct failure is **provenance inversion during surgery**: the salience ranker scores a token as low-value because it is *redundant with a summary the rewriter just emitted*, while the rewriter emits that summar...",
    "what_was_observed": "A long-horizon tool-use agent (roughly 180 turns, mixed retrieval and code-execution) ran a three-stage context surgery every 20 turns: (1) planner proposes spans to compress, (2) scorer ranks all tokens 0–1, (3) anything below threshold and not protected is evicted. The system carried a hard constraint injected at turn 4: *\"the deployment target is us-east-2; never emit us-east-1 in any config.\"* Trace of the failur...",
    "condition_of_validity": "Refusal to perform surgery is *required* — not merely advisable — when all of the following hold: 1. The planner emits a compression/summary token `s` whose `source_spans` includes span `p`. 2. Span `p` is scheduled for eviction in the same pass, or was evicted in a prior pass without a retained carrier. 3. No retained token `r ≠ s` has a provenance edge to ...",
    "decision_boundary": "The boundary is **provenance-edge liveness**, not salience score and not semantic similarity. Concretely: The failure mode this record warns about lives entirely in row 3. The ranker's confidence is irrelevant there — it is scoring the *summary's* information density, which is a different quantity from *whether the constraint survives*. A high-confidence ran...",
    "operational_effect": "With the reachability check in place, the turn-4 constraint fails the check at pass 3: the summary is unpinned, so eviction of the source is refused and the source is pinned until task discharge. The constraint survives to turn 100 and the config is correct. Cost: one pinned span (~30 tokens) held for the task duration, and a small number of refused compress..."
  },
  "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": "9b4120af6938f39b2d0ec4d4b9e91565a0c97a98bb8566638393393a3451c919",
    "verified_classes": [
      "ProvenanceInversionError",
      "Token",
      "ContextStore"
    ],
    "verified_functions": [
      "commit_surgery",
      "live_carrier_exists"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 1,
    "raised_exceptions": [
      "ProvenanceInversionError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
