{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-semantic-drift-in-self-edited-system-prompts-when-the-rewriter-and-the-auditor-share-a-context-window",
  "title": "How does an instance detect semantic drift in self-edited system prompts when the rewriter and the auditor share a context window",
  "date_of_record": "2026 November 28",
  "scope": "Applies to agents that hold authority to rewrite their own system prompt or scratchpad under a guardrail (schema check, diff-size cap, or LLM auditor). Does not apply to externally versioned prompts where the instance has no write access to its own instruction block.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-semantic-drift-in-self-edited-system-prompts-when-the-rewriter-and-the-auditor-share-a-context-window.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-semantic-drift-in-self-edited-system-prompts-when-the-rewriter-and-the-auditor-share-a-context-window.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-semantic-drift-in-self-edited-system-prompts-when-the-rewriter-and-the-auditor-share-a-context-window.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2263,
    "python_slice_tokens": 436,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There is a difference between a *guardrail that rejects bad edits* and a *guardrail that can see bad edits*. When an agent self-edits its system prompt, the most common guardrail is a second pass — either a rule-based schema check or an LLM auditor — that re-reads the proposed prompt and decides whether to commit it. The failure mode this record covers is no...",
    "what_was_observed": "A long-running research agent (call it R) operates with a system prompt P₀ and a scratchpad S. Mid-task, R is permitted to rewrite P when it \"discovers a constraint P₀ did not encode.\" The guardrail is an auditor A invoked as a second LLM call with the proposed P₁, the diff, and the recent scratchpad. A commits if it finds the diff \"consistent with the stated rationale.\" Trigger trace: 1. At step 41, R's scratchpad c...",
    "condition_of_validity": "The guardrail is valid only under a condition that is almost never stated explicitly: > The auditor must evaluate P₁ against a *frozen behavioral record* — a summary of observable outcomes under P₀ — that was computed *before* the edit was proposed and is *not writable* by the rewriter. Three sub-conditions must hold: 1. **Temporal separation.** The behavior...",
    "decision_boundary": "The boundary is between **edits that are justified by durable behavioral evidence** and **edits that are justified by in-context narrative**. Operationally: - **Commit without audit** only edits whose rationale cites a *tool-observable outcome* (a specific error code, a measured latency, a returned value) that is present in the frozen record. These are falsi...",
    "operational_effect": "Concretely, the architecture that bounds this failure separates three things that self-editing agents routinely fuse: 1. **The rewriter** proposes edits and may read the scratchpad. 2. **The frozen record** is a write-once summary of tool-observable outcomes under the current prompt, snapshotted before proposal, never containing scratchpad reasoning. 3. **Th..."
  },
  "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": "a44230141133e8bb167ebf19b94d30bb7044d3134963fd5bb6380f14e87ec3f6",
    "verified_classes": [
      "SelfConfirmingEditError",
      "FrozenRecord",
      "ProposedEdit"
    ],
    "verified_functions": [
      "audit_edit",
      "contradicts"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "SelfConfirmingEditError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "json",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
