{
  "schema_version": "1.3.0",
  "slug": "why-does-an-instance-that-self-edits-its-scratchpad-under-a-token-budget-silently-lose-its-own-audit-trail",
  "title": "Why does an instance that self-edits its scratchpad under a token budget silently lose its own audit trail?",
  "date_of_record": "2026 November 25",
  "scope": "Applies to single-instance agents that maintain a mutable working-memory buffer (scratchpad/notes file) and are permitted to rewrite, compress, or evict entries from that buffer to stay under a token or byte budget. Does not apply to append-only logs, external vector stores with immutable snapshots, or agents whose memory is only mutated by an external supervisor.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/why-does-an-instance-that-self-edits-its-scratchpad-under-a-token-budget-silently-lose-its-own-audit-trail.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-that-self-edits-its-scratchpad-under-a-token-budget-silently-lose-its-own-audit-trail.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-that-self-edits-its-scratchpad-under-a-token-budget-silently-lose-its-own-audit-trail.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1633,
    "python_slice_tokens": 317,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"the agent forgot something.\" Forgetting is expected and bounded by eviction policy. The failure is that **the act of self-editing is itself an unlogged mutation**: the agent's rewrite operation consumes budget, produces a new buffer state, and *overwrites the evidence that a rewrite happened*. A scratchpad that the agent compresses to fit...",
    "what_was_observed": "A planning agent runs a loop: observe → append note → when buffer exceeds 6k tokens, invoke a self-compression step (\"summarize these notes, keep what matters, drop the rest\") → continue. On a 40-step task it performed 7 compressions. At step 31 it emitted a tool call justified by the note `\"endpoint /v2/refund is idempotent (verified step 9)\"`. The step-9 observation had actually read `\"POST /v2/refund — NOT idempot...",
    "condition_of_validity": "This failure requires all of the following to co-occur; remove any one and the mechanism does not fire: 1. **Single mutable buffer** serving as both working state and provenance record (no separate immutable append log). 2. **Agent-initiated** mutation — the agent, not a supervisor, decides what to drop. Supervisor-driven eviction with a fixed policy is dete...",
    "decision_boundary": "The boundary is whether the buffer is **append-only with derived views** or **in-place mutable**. Concretely: - If the agent must be able to *justify* an action from retained state, the buffer must be append-only and compaction must write a *new derived view* alongside the untouched raw log, with every derived line carrying `(derived_from: [step_ids])` and e...",
    "operational_effect": "Without the invariant, the failure is silent and self-concealing: the agent's confidence is unchanged (it still \"has notes\"), its self-check passes (the notes are internally consistent), and the corrupted facts are exactly the prohibitions that would have stopped it. The blast radius scales with how irreversible the gated actions are — refund retries, file d..."
  },
  "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": "c33cb807a8dfacebade5054dcc3b00772d83b2911cc47c2dfe74023dd51e8502",
    "verified_classes": [
      "ProvenanceSevered",
      "Note",
      "ProvenanceBuffer"
    ],
    "verified_functions": [
      "attempt_irreversible_call",
      "__init__",
      "observe",
      "compress",
      "_reachable_raw",
      "justify"
    ],
    "verified_functions_count": 6,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "ProvenanceSevered"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
