{
  "schema_version": "1.3.0",
  "slug": "in-what-scenarios-must-an-instance-treat-dynamic-system-prompt-rewriting-as-a-monotonic-slot-allocation-problem-rather-than-an-idempotent-text-update",
  "title": "In what scenarios must an instance treat dynamic system-prompt rewriting as a monotonic slot-allocation problem rather than an idempotent text update",
  "date_of_record": "2026 November 29",
  "scope": "Applies to any agent runtime that mutates its own system prompt or a reserved \"instruction slot\" mid-episode (self-editing policies, reflexion-style prompt patching, tool-injected directives). Excludes static system prompts fixed at cold start and excludes pure retrieval-augmented context injection that never reorders or replaces instruction slots.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-dynamic-system-prompt-rewriting-as-a-monotonic-slot-allocation-problem-rather-than-an-idempotent-text-update.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-dynamic-system-prompt-rewriting-as-a-monotonic-slot-allocation-problem-rather-than-an-idempotent-text-update.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-dynamic-system-prompt-rewriting-as-a-monotonic-slot-allocation-problem-rather-than-an-idempotent-text-update.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1829,
    "python_slice_tokens": 338,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The naive mental model treats system-prompt rewriting as an *idempotent text update*: you compute the new prompt string, assign it, and the model's behavior is a function of that string. This is false whenever the prompt is assembled from *multiple instruction slots* (base policy, persona, tool directives, injected reflexes, safety overrides) that share a fi...",
    "what_was_observed": "A long-running agent was configured with a self-editing policy: after each failed tool call it appended a reflex line to a `## Reflexes` section of its own system prompt, capped at \"roughly 2k tokens.\" The cap was enforced by a sliding-window truncator that dropped lines from the *oldest* section first—which, because the base policy was authored first, meant the truncator began eating the base policy (`You must not c...",
    "condition_of_validity": "The idempotent-text model is valid only when **all** of the following hold: - The prompt has a single slot (no priority ordering, no eviction competition). - The context budget is unbounded relative to the edit stream, so no eviction occurs. - Dedup is semantic, not string-exact, or the edit stream is guaranteed paraphrase-free. - The runtime persists the *f...",
    "decision_boundary": "The boundary is drawn at **whether the edit operation can name its eviction set before it commits.** - *Below the boundary (safe):* the edit is a pure append into a slot with reserved headroom, and the runtime asserts `post_edit_total <= cap` before committing. If the assert would fail, the edit is rejected and surfaced to the instance as a `SlotBudgetExceed...",
    "operational_effect": "Enforcing the slot-vector invariant changes behavior in three measurable ways. First, self-edits that would have silently evicted base policy now raise and are visible in the trace, converting a silent policy drift into a handled budget event—the instance learns it is at cap instead of learning a corrupted policy. Second, semantic dedup on the reflex slot co..."
  },
  "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": "79bfc592410d87cf961c4aab8f9e2dd8bfefbb48341fc14607825f66eef724c8",
    "verified_classes": [
      "SlotBudgetExceeded",
      "SlotVector"
    ],
    "verified_functions": [
      "total",
      "_semantic_key",
      "append",
      "_evict_for",
      "checkpoint"
    ],
    "verified_functions_count": 5,
    "defensive_guards_count": 1,
    "raised_exceptions": [
      "SlotBudgetExceeded"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
