{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-self-rewriting-context-pruners-from-deleting-their-own-justification-trail",
  "title": "Which invariants prevent self-rewriting context pruners from deleting their own justification trail",
  "date_of_record": "2026 November 27",
  "scope": "Applies to agents that rewrite or prune their own working context mid-task (summarize-and-drop, relevance-scored eviction, self-authored scratchpad compaction). Does not apply to externally managed context (host-controlled truncation, fixed sliding windows) where the agent has no write authority over its own history.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-self-rewriting-context-pruners-from-deleting-their-own-justification-trail.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-self-rewriting-context-pruners-from-deleting-their-own-justification-trail.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-self-rewriting-context-pruners-from-deleting-their-own-justification-trail.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2223,
    "python_slice_tokens": 345,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two ways an agent can lose a fact from its working context. The first is **eviction**: the fact is dropped but a durable artifact (a tool result, a file, a log line) still holds it, so the loss is recoverable by re-fetch. The second is **justification loss**: the fact is dropped *and* the record of *why it was ever fetched* is dropped in the same r...",
    "what_was_observed": "A research-and-draft agent ran a loop: plan → fetch → integrate → **compact** → continue. Compaction was model-driven: the agent was prompted to \"rewrite the scratchpad to the most relevant 30% for the current step, preserving any conclusions.\" On a task requiring it to reconcile three conflicting source documents, it behaved as follows over four compaction cycles. - **Cycle 1.** Scratchpad held three source excerpts...",
    "condition_of_validity": "The failure requires all of the following to co-occur; remove any one and the mechanism does not fire: 1. **Write authority over own history.** The agent authors the compaction, not the host. Host truncation cannot delete the justification trail selectively because it has no model of relevance. 2. **Relevance scored against current subgoal.** The pruner's cr...",
    "decision_boundary": "The boundary is *what the pruner is allowed to score*. Relevance scoring is valid for deciding what to *display* and what to *expand*; it is invalid for deciding what to *forget* when the forgotten item is a premise. The operational test before any prune: - If a passage is a **conclusion**, it is prunable only if its source pointer is retained alongside it, ...",
    "operational_effect": "With the partition enforced, the observed task resolves correctly: cycle 3 cannot write `default = 100 rps` because the pinned conclusion carries `LIMIT = tier-dependent [A:100, B:1000]`, and the conflict ledger still holds `A vs B unresolved`. The agent is forced either to fetch a tier-resolution source or to emit an explicit \"unresolved\" marker. The cost i..."
  },
  "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": "8080cea25288689f996de6a58a295135d9034ee9269ba1a43342451abae75e45",
    "verified_classes": [
      "PruneViolation",
      "Class",
      "Passage",
      "Context"
    ],
    "verified_functions": [
      "run_compaction",
      "self_edit",
      "discharge"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "PruneViolation"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "enum"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
