{
  "schema_version": "1.3.0",
  "slug": "what-happens-when-an-instance-prunes-its-own-scratchpad-monotone-token-invariants-and-the-reasoning-trace-amnesia-boundary",
  "title": "What happens when an instance prunes its own scratchpad: monotone-token invariants and the reasoning-trace amnesia boundary",
  "date_of_record": "2026 November 28",
  "scope": "Applies to single- and multi-agent LLM instances that mutate their own context window mid-episode—rewriting scratchpads, summarizing prior reasoning, or pruning \"stale\" traces to reclaim token budget. Does not apply to append-only transcripts or externally-managed memory stores where the agent cannot write to its own working set.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-prunes-its-own-scratchpad-monotone-token-invariants-and-the-reasoning-trace-amnesia-boundary.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-prunes-its-own-scratchpad-monotone-token-invariants-and-the-reasoning-trace-amnesia-boundary.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-prunes-its-own-scratchpad-monotone-token-invariants-and-the-reasoning-trace-amnesia-boundary.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2200,
    "python_slice_tokens": 488,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure here is not context-window saturation. Saturation is a resource problem with a well-understood remedy: summarize, evict, or offload. The boundary failure is subtler: **self-editing agents that prune reasoning traces destroy the causal provenance that later steps depend on, but the destruction is invisible to the agent because the pruned trace no ...",
    "what_was_observed": "A coding agent operating on a 40k-token episode was instructed to keep its scratchpad under 8k tokens. At step 14 it rewrote its scratchpad, summarizing steps 3–9 as: *\"Explored the config loader; established that `parse_config` returns a dict keyed by section name.\"* The original steps 3–9 had contained, among other things, a tool call that returned `{\"status\": \"partial\", \"missing\": [\"retry_policy\"]}` and a note tha...",
    "condition_of_validity": "The invariant holds—self-pruning is safe—only under three simultaneous conditions: 1. **Referent commitment.** Every claim retained in the post-prune scratchpad must have a referent that exists outside the reasoning trace: a tool result still in the window, a file on disk, a returned value in a variable. Claims whose only support was the pruned trace must be...",
    "decision_boundary": "The boundary between a safe self-edit and an unsafe one is not token count. It is whether the edit is **provable** against an external ledger. - **Safe:** prune traces whose every retained claim cites a committed artifact (tool result id, file path, hash). The prune is safe because the citation can be re-resolved; if the artifact has been evicted, the citati...",
    "operational_effect": "Enforcing this boundary changes agent behavior in three measurable ways: 1. **Scratchpad edits become two-phase.** The agent first commits referents (writes tool results to durable artifacts, emits obligation records for unresolved questions), then prunes. Token savings arrive one step later, but they arrive without confidence inflation. 2. **Budget pressure..."
  },
  "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": "248c3646b5c7d4d6aacfa563f02045d17cfd62d230af741c59882fcbf972e44f",
    "verified_classes": [
      "UnprovablePruneError",
      "Trace",
      "Scratchpad"
    ],
    "verified_functions": [
      "self_edit",
      "commit_referent"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "UnprovablePruneError"
    ],
    "sample_fail_closed_invariants": [
      "assert 'resolve retry_policy' in pad.obligations"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
