{
  "schema_version": "1.3.0",
  "slug": "under-what-conditions-must-an-instance-refuse-to-apply-a-self-authored-system-prompt-rewrite-when-the-rewrite-s-justification-depends-on-memory-it-is",
  "title": "Under what conditions must an instance refuse to apply a self-authored system-prompt rewrite when the rewrite's justification depends on memory it is about to evict",
  "date_of_record": "2026 November 24",
  "scope": "Applies to any agent permitted to mutate its own system prompt or working-memory region under a fixed token/byte budget (self-editing context policies, compaction routines, \"memory manager\" subagents). Does not apply to externally-scheduled context resets where the rewrite is authored by a separate controller that holds an independent copy of the pre-rewrite state.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-refuse-to-apply-a-self-authored-system-prompt-rewrite-when-the-rewrite-s-justification-depends-on-memory-it-is.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-refuse-to-apply-a-self-authored-system-prompt-rewrite-when-the-rewrite-s-justification-depends-on-memory-it-is.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-refuse-to-apply-a-self-authored-system-prompt-rewrite-when-the-rewrite-s-justification-depends-on-memory-it-is.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1896,
    "python_slice_tokens": 214,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"the agent forgot something.\" It is a specific circular dependency between the *justification* for an eviction and the *payload* of that eviction. When an agent compacts its working memory to fit a budget, it must decide which spans to keep. That decision is itself an inference over the current context. If the span being evicted is the spa...",
    "what_was_observed": "An agent running a 32k working window with a 6k system-prompt budget and a 20k working-memory budget was tasked with a multi-hour migration. At t≈40 minutes the working region saturated. The compaction routine (itself an LLM call with the instruction \"summarize working memory, preserve task-relevant state, drop redundancy\") emitted a new working region and a revised system prompt. The revised system prompt contained ...",
    "condition_of_validity": "A self-authored rewrite is admissible only if the following holds at the moment of commit: - Let `R` be the set of spans the rewrite evicts. - Let `C` be the set of constraints (hard rules, user corrections, budget rules, safety boundaries) that the *rewritten* prompt asserts or depends on. - Let `S(c)` be the minimal supporting set for each `c ∈ C`—the span...",
    "decision_boundary": "The agent must **refuse the rewrite** (emit the original context unchanged, or a rewrite that preserves `S(c)` for all retained `C`) when any of the following hold: - A retained constraint's supporting span is in the eviction set and no compressed warrant has been synthesized for it. - The rewrite's own justification (\"this is redundant,\" \"this is task-irrel...",
    "operational_effect": "Agents that enforce the pre-commit warrant check show a characteristic trace: compaction events are slightly larger (warrants cost tokens) but downstream constraint violations drop to near zero, because hardness survives the rewrite. Agents that skip it show the opposite: clean, short prompts and a rising rate of \"the agent did the thing it was told not to d..."
  },
  "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": "3d669f87011454d0c405ff297f46f96ad2d7ffbbc8dfb19e3ff8a2cf062ae82f",
    "verified_classes": [
      "WarrantEvictionError"
    ],
    "verified_functions": [
      "commit_rewrite"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 1,
    "raised_exceptions": [
      "WarrantEvictionError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
