{
  "schema_version": "1.3.0",
  "slug": "why-does-an-instance-self-corrupt-when-model-driven-segment-rewriting-outlives-the-relevance-scores-that-justified-it",
  "title": "Why does an instance self-corrupt when model-driven segment rewriting outlives the relevance scores that justified it",
  "date_of_record": "2026 December 1",
  "scope": "Applies to agent runtimes that let the model itself rewrite, merge, or evict context segments (compaction, summarization, \"self-editing memory\") while a separate relevance scorer ranks segments for retention. Does not apply to append-only context buffers or to eviction driven solely by a deterministic token budget with no model-authored rewrite step.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/why-does-an-instance-self-corrupt-when-model-driven-segment-rewriting-outlives-the-relevance-scores-that-justified-it.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-self-corrupt-when-model-driven-segment-rewriting-outlives-the-relevance-scores-that-justified-it.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-self-corrupt-when-model-driven-segment-rewriting-outlives-the-relevance-scores-that-justified-it.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1777,
    "python_slice_tokens": 206,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two operations that look interchangeable in a self-editing context policy and are not: 1. **Relevance scoring** — a *read-only ranking* over existing segments, producing a score `s_i ∈ [0,1]` per segment `i`. It is stateless with respect to content: it never mutates a segment. 2. **Segment rewriting** — a *model-authored mutation* that replaces seg...",
    "what_was_observed": "A long-running research agent (budget 128k tokens, compaction triggered at 85% occupancy) used a policy of \"merge the three lowest-relevance segments into one summary, then score the summary.\" Trace, abridged: - Segments A, B, C scored `0.22, 0.19, 0.31` against the current task query — all below the eviction threshold of `0.35`, all legitimately low-relevance *for the current query*. - The merger produced segment M:...",
    "condition_of_validity": "The min-inheritance rule is valid only under a specific precondition: **the scorer must be query-conditional and the query must be stable across the rewrite.** Formally, if `s_i = f(q, content_i)`, then for a merge `M = g(A,B,C)` we require `s_M = min(s_A, s_B, s_C)` *evaluated under the same `q`*. This holds because relevance is monotone-decreasing under in...",
    "decision_boundary": "The decision to retain a rewritten segment and evict its sources must be gated on a *conjunction*, not a disjunction: - **Retain-and-evict** iff `score(M) ≤ max(score(inputs))` **and** `prov(M) ⊇ prov(inputs)` **and** the query `q` is unchanged since inputs were scored. - **Retain-and-keep-sources** (soft merge, no eviction) if `score(M) > max(score(inputs))...",
    "operational_effect": "Enforcing min-inheritance and provenance-completeness changes the failure profile in a measurable way. In the replay above, the guard converts the 410-Gone loop into a single soft-merge: M is retained *alongside* A, B, C (because `0.71 > 0.31` trips the orphan signal), the deprecation fact in C survives, and the agent checks deprecation before the call. The ..."
  },
  "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": "31b407de940e4e2686d47335bd98c35ce9e35325fde503d23d21c0f971c0b5c4",
    "verified_classes": [
      "ScoreOrphanError",
      "ProvenanceIncompleteError",
      "Segment"
    ],
    "verified_functions": [
      "decide_merge"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "ProvenanceIncompleteError",
      "ScoreOrphanError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
