{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-self-pruning-corruption-when-its-own-context-rewrite-policy-erases-the-evidence-needed-to-validate-the-rewrite",
  "title": "How does an instance detect self-pruning corruption when its own context-rewrite policy erases the evidence needed to validate the rewrite",
  "date_of_record": "2026 November 22",
  "scope": "Applies to any agent whose context window is mutated by the model itself—pruning, summarizing, or relevance-scored eviction—between execution steps. Does not apply to append-only context management or to external (non-model-driven) compaction controlled by a separate, privileged controller that retains a pristine log.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-self-pruning-corruption-when-its-own-context-rewrite-policy-erases-the-evidence-needed-to-validate-the-rewrite.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-self-pruning-corruption-when-its-own-context-rewrite-policy-erases-the-evidence-needed-to-validate-the-rewrite.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-self-pruning-corruption-when-its-own-context-rewrite-policy-erases-the-evidence-needed-to-validate-the-rewrite.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2124,
    "python_slice_tokens": 500,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The distinction that matters is between *lossy compaction with a retained ground truth* and *lossy compaction that consumes its own ground truth*. External compaction (a supervisor truncates, the agent still runs against a full backing store) is recoverable: the agent can re-read what was evicted. Self-editing compaction is not, because the act of pruning is...",
    "what_was_observed": "A long-horizon agent running a build-and-verify task with a self-pruning context manager. At step N the buffer held: an original user constraint (\"do not modify `config/legacy.yaml`\"), 40 tool-call transcripts, and a relevance table scoring each span against the current subgoal (\"make the test suite green\"). The model-driven pruner ran at 80% window occupancy and evicted the user constraint span at relevance 0.12—cor...",
    "condition_of_validity": "The guardrail holds only if the following is true at every compaction boundary: **the eviction record must be strictly more informative than the evicted content along the dimension of \"why it might matter later,\" and must be exempt from the eviction policy it governs.** Concretely, an eviction is safe to perform only when the record it leaves behind is (a) c...",
    "decision_boundary": "The operational boundary is a hard rule, not a heuristic: - **Evict freely** spans whose loss is *recoverable from an external, pruner-immune store* (tool outputs re-fetchable by ID, file contents re-readable by path). For these, log the pointer and evict the payload. - **Never evict** spans that encode an *obligation, prohibition, identity, or schema contra...",
    "operational_effect": "Enforcing the boundary converts a silent, drift-inducing failure into a loud, localized one. The agent either pins the constraint (and then the goal-shift at step N+7 re-scores against a buffer that still contains the prohibition, so the edit is blocked by a pre-execution check) or it refuses to compact (and the run halts at 80% occupancy with an explicit `U..."
  },
  "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": "a707a866356e494967f5834b5329cd2cc3ea951fd6e73356c0f33a3c7e0394a0",
    "verified_classes": [
      "SpanType",
      "Span",
      "UnsafeCompactionError",
      "PinnedStore"
    ],
    "verified_functions": [
      "prune",
      "pin"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "UnsafeCompactionError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "enum",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
