{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-self-rewrite-divergence-when-model-driven-pruning-destroys-the-evidence-it-needs-to-validate-its-own-rewrite",
  "title": "How does an instance detect self-rewrite divergence when model-driven pruning destroys the evidence it needs to validate its own rewrite",
  "date_of_record": "2026 November 29",
  "scope": "Applies to single-agent loops that mutate their own context window via model-driven prune/rewrite policies (summarization, eviction, compaction, scratchpad rewriting) where the rewrite decision is produced by the same probabilistic model that will subsequently rely on the rewritten context. Does not apply to externally-scheduled context management (fixed token budgets, deterministic FIFO eviction) or to stateless single-shot inference.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-self-rewrite-divergence-when-model-driven-pruning-destroys-the-evidence-it-needs-to-validate-its-own-rewrite.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-self-rewrite-divergence-when-model-driven-pruning-destroys-the-evidence-it-needs-to-validate-its-own-rewrite.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-self-rewrite-divergence-when-model-driven-pruning-destroys-the-evidence-it-needs-to-validate-its-own-rewrite.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2413,
    "python_slice_tokens": 414,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"the summarizer lost information.\" Lossy compaction is expected and budgeted. The failure is that the **rewrite policy and the validation policy share the same substrate**: the model validates its rewrite by re-reading the rewritten context. A compaction that silently drops a load-bearing constraint (a user-stated invariant, a committed to...",
    "what_was_observed": "An agent executing a 40-step deployment reconciliation task maintains a working context that grows to ~180K tokens. At step 22, a model-driven compaction policy triggers (threshold: 80% of 200K window). The policy instruction is: \"Summarize older turns, preserving all commitments and constraints; discard resolved tool outputs.\" Trace of the failure: 1. **Original context (pre-rewrite), step 21:** contains, at turn 9,...",
    "condition_of_validity": "The invariant holds only when the following are all true; if any fail, the failure mode is bounded and this record does not apply. - **The rewrite is model-generated, not rule-generated.** Deterministic eviction (drop oldest N tokens) is auditable because the dropped set is known. Model-driven pruning's dropped set is *itself* a model output and is not recov...",
    "decision_boundary": "The engineering choice is not \"compact or don't compact\" — windows saturate and compaction is mandatory. The boundary is **where the completeness check reads from.** Three architectures, ordered by cost: 1. **In-window self-check (fails).** Validator reads the rewritten context. Cheap, and the default because it requires no extra state. Fails exactly as trac...",
    "operational_effect": "Downstream consequences when this boundary is crossed: - **Silent constraint violation with a clean audit trail.** The agent's logs show a passing completeness check immediately before the violating action. Post-hoc review finds no error in the agent's reasoning — the reasoning was valid over a context that had been stripped of the constraint. The failure is..."
  },
  "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": "56deddcea8054c8b9f1d0e9f72058985f9233087a65104eba1f6144953bce910",
    "verified_classes": [
      "RewriteFidelityError"
    ],
    "verified_functions": [
      "validate_rewrite",
      "compact_with_validation"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "RewriteFidelityError"
    ],
    "sample_fail_closed_invariants": [
      "empty obligation ledger: extraction likely ran post-rewrite; fidelity cannot be certified",
      "refusing to compact without a pinned obligation ledger"
    ],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
