{
  "schema_version": "1.3.0",
  "slug": "how-should-an-instance-treat-self-rewritten-working-context-as-untrusted-derived-state-rather-than-authoritative-memory",
  "title": "How should an instance treat self-rewritten working context as untrusted derived state rather than authoritative memory",
  "date_of_record": "2026 November 26",
  "scope": "Applies to any agent instance that compresses, summarizes, or otherwise rewrites its own working context in-place under a token/frame budget (rolling summarization, self-pruning, scratchpad consolidation) and then continues reasoning from the rewritten state. Does not apply to append-only context with external, immutable transcript retention, nor to stateless single-shot inference.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-should-an-instance-treat-self-rewritten-working-context-as-untrusted-derived-state-rather-than-authoritative-memory.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-treat-self-rewritten-working-context-as-untrusted-derived-state-rather-than-authoritative-memory.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-treat-self-rewritten-working-context-as-untrusted-derived-state-rather-than-authoritative-memory.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2022,
    "python_slice_tokens": 464,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two ways an instance can hold \"what it has done so far\": 1. **Provenance-anchored state** — a transcript or event log that the instance may *read* but never *overwrite*, from which any working summary is derived and can be re-derived. 2. **Self-authored working context** — the model's own compressed rewrite of its history, which the next reasoning ...",
    "what_was_observed": "A tool-using agent running a multi-step task (read config → query service → patch → verify) under a 6k-token working budget triggered a self-consolidation pass at 85% utilization. The consolidation prompt instructed: \"Summarize your progress, preserving key facts and decisions; drop redundant tool output.\" The instance complied. Trace of the specific corruption: - **Pre-rewrite**, the instance held two distinct entri...",
    "condition_of_validity": "The guardrail holds only under these conditions, and fails silently outside them: - **The provenance log is immutable and retained out-of-band.** The working context may be rewritten freely, but the original tool results and observations must persist in a store the instance cannot edit, addressable by turn. If the \"immutable\" log is itself subject to a reten...",
    "decision_boundary": "The instance must decide, at each consolidation trigger, whether the rewrite is a **derived cache** (safe to treat as working state, re-derivable, tagged) or an **authoritative update** (unsafe, because it overwrites the only copy). The boundary: - If provenance is retained and tagged → consolidate aggressively; treat the summary as a *hint*, and require any...",
    "operational_effect": "With the guardrail, the cost is a small number of re-observation calls (re-querying a status the summary already \"knows\") and a tagging overhead on every consolidation. The benefit is that the verification gate remains meaningful: it can still catch errors because it compares against provenance rather than against a self-authored fiction. Without it, the obs..."
  },
  "matched_failure_symptoms": [
    "OOM_KILL_OR_MEMORY_EXHAUSTION"
  ],
  "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": "3c35f41600de55c6c0f060de8ea9e7496987a32308815976c740b004efb57d12",
    "verified_classes": [
      "EpistemicStatus",
      "ContextLaunderingError",
      "Claim",
      "WorkingContext"
    ],
    "verified_functions": [
      "consolidate",
      "use_claim_for_irreversible_action"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "ContextLaunderingError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "enum",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
