{
  "schema_version": "1.3.0",
  "slug": "what-happens-when-an-instance-rewrites-its-own-context-and-the-salience-scorer-deletes-the-only-record-of-why-edit-provenance-collapse-under-model-dri",
  "title": "What happens when an instance rewrites its own context and the salience scorer deletes the only record of why: edit provenance collapse under model-driven context rewriting",
  "date_of_record": "2026 November 25",
  "scope": "Applies to agents that mutate their own working context (compaction, summarization, salience-based eviction, or reordering) as a runtime policy rather than a one-shot prompt. Does not apply to stateless single-turn inference, nor to externally-managed context where the orchestrator retains an immutable transcript outside the agent.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-rewrites-its-own-context-and-the-salience-scorer-deletes-the-only-record-of-why-edit-provenance-collapse-under-model-dri.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-rewrites-its-own-context-and-the-salience-scorer-deletes-the-only-record-of-why-edit-provenance-collapse-under-model-dri.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-rewrites-its-own-context-and-the-salience-scorer-deletes-the-only-record-of-why-edit-provenance-collapse-under-model-dri.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2363,
    "python_slice_tokens": 479,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two architecturally distinct things an agent can do to its context: **read-modify-write with provenance** versus **destructive rewrite**. The distinction is not about whether text is deleted—compaction always deletes text. It is about whether the deletion is *recoverable in principle* from the state the agent retains. A provenance-preserving rewrit...",
    "what_was_observed": "A tool-using agent (plan → retrieve → edit → verify) was configured with a context policy: when the working set exceeded a token budget, a salience scorer ranked spans and the top-k were retained; a summarizer compressed the tail. Salience was computed as relevance to the *current* task description plus recency decay. Trace of a representative failure across three edit passes on a schema-migration task: 1. **Pass 1 (...",
    "condition_of_validity": "The invariant that prevents this collapse is: **salience must be scored against an append-only reference that the rewrite cannot modify, and every surviving span must carry a provenance edge to its pre-edit origin.** Concretely, a self-editing context policy is safe against provenance collapse only if all of the following hold: - **Pinned origin.** The task'...",
    "decision_boundary": "The boundary is between **compaction as lossy compression of redundant context** (safe) and **compaction as lossy compression of unique context** (unsafe). The discriminator is not token count or pass count; it is whether the span being evicted is *reconstructible* from something the agent still holds. Operationally, before any eviction the policy must answe...",
    "operational_effect": "The downstream effect is **silent constraint violation with high agent confidence**. Because every intermediate context was self-consistent, the agent's verification step (which checks the plan against the current context) passes. The violation is only caught by an external auditor diffing against the immutable transcript—i.e., by a component the self-editin..."
  },
  "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": "bc6674529dc29f47f31c55c7c404b50ec44c03151bcebafbc07310ba0b8f230c",
    "verified_classes": [
      "ProvenanceCollapseError",
      "Span",
      "ProvenanceLedger"
    ],
    "verified_functions": [
      "apply_edit_pass",
      "release",
      "record",
      "is_provenance_root"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "ProvenanceCollapseError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
