{
  "schema_version": "1.3.0",
  "slug": "in-what-scenarios-must-an-instance-treat-model-driven-scratchpad-rewrites-as-lossy-state-transitions-rather-than-idempotent-edits",
  "title": "In what scenarios must an instance treat model-driven scratchpad rewrites as lossy state transitions rather than idempotent edits",
  "date_of_record": "2026 November 30",
  "scope": "Applies to single-agent instances that maintain task state by rewriting their own scratchpad/context region (self-editing context) across turns, especially when the rewrite is generated by the same model that consumes it. Does not apply to append-only context growth, externalized state stores, or human-curated context management.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-model-driven-scratchpad-rewrites-as-lossy-state-transitions-rather-than-idempotent-edits.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-model-driven-scratchpad-rewrites-as-lossy-state-transitions-rather-than-idempotent-edits.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-model-driven-scratchpad-rewrites-as-lossy-state-transitions-rather-than-idempotent-edits.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1416,
    "python_slice_tokens": 283,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The tempting mental model is that a scratchpad rewrite is an *edit*: the model reads the current scratchpad, emits a new one, and the new one is \"the same state, cleaner.\" This is false whenever the rewrite is model-generated. A model-driven rewrite is a **lossy, non-commutative state transition** with no transactional guarantee: the model must (a) faithfull...",
    "what_was_observed": "A long-horizon task (multi-step configuration reconciliation) maintained a scratchpad with ~40 active facts: identifiers, invariants, partially-completed steps, and *negative constraints* (\"do not touch resource R; it is owned by another workflow\"). At turn 22, the instance was instructed to \"compact the scratchpad to reduce token pressure.\" The compaction rewrite preserved the 31 *positive* facts (things to do) and ...",
    "condition_of_validity": "The \"rewrite is a safe edit\" assumption holds only under all of: 1. **Append-only source of truth exists** outside the scratchpad, from which the rewrite can be diffed. If the scratchpad is the only store, the rewrite is the sole authority and loss is unrecoverable. 2. **The rewrite is verifiable against that source** by a mechanism that does not itself cons...",
    "decision_boundary": "The operational rule: **a model-driven scratchpad rewrite is permitted to be treated as idempotent only when the pre-rewrite state is recoverable and the post-rewrite state is diffable against it.** Concretely: - Before rewrite, snapshot the scratchpad and extract a *constraint manifest* (typed records for prohibitions, thresholds, ownership fences) that the...",
    "operational_effect": "Treating compaction as a lossy transition changes the architecture: scratchpads gain a pre-image log, constraints are promoted to typed records, and the verifier is decoupled from the rewritten region. The cost is token and bookkeeping overhead. The benefit is that the most dangerous failure class in self-editing context — silent deletion of negative constra..."
  },
  "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": "28de88053052ae0a0c736998b983452f2b291a22d2e1df170b1b0dcecc8f0219",
    "verified_classes": [
      "ScratchpadRewriteLoss"
    ],
    "verified_functions": [
      "apply_scratchpad_rewrite",
      "compose_rewrites"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "ScratchpadRewriteLoss"
    ],
    "sample_fail_closed_invariants": [
      "rewrite attempted with empty constraint manifest; prohibitions/thresholds/fences are unrecoverable if dropped"
    ],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
