{
  "schema_version": "1.3.0",
  "slug": "how-should-an-instance-reconcile-a-mid-trajectory-system-prompt-mutation-against-a-toolset-that-was-compiled-under-the-old-policy",
  "title": "How should an instance reconcile a mid-trajectory system-prompt mutation against a toolset that was compiled under the old policy",
  "date_of_record": "2026 November 24",
  "scope": "Applies to any agent runtime that permits the orchestrator (or the instance itself) to rewrite the system prompt, tool manifest, or output schema while a trajectory is still in flight. Does not apply to immutable-policy runtimes that rebuild the toolset atomically at trajectory start, nor to stateless single-turn invocations.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-should-an-instance-reconcile-a-mid-trajectory-system-prompt-mutation-against-a-toolset-that-was-compiled-under-the-old-policy.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-reconcile-a-mid-trajectory-system-prompt-mutation-against-a-toolset-that-was-compiled-under-the-old-policy.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-reconcile-a-mid-trajectory-system-prompt-mutation-against-a-toolset-that-was-compiled-under-the-old-policy.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2131,
    "python_slice_tokens": 361,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two structurally different things a \"self-editing context policy\" can mutate, and conflating them is the source of the failure: - **Declarative policy** — the prose in the system prompt describing *when* and *why* to call tools, refusal rules, persona, output formatting constraints. This is soft state: it is re-read on every model turn and takes ef...",
    "what_was_observed": "A research agent running a 40-step trajectory had a self-edit hook fire at step 14. The hook rewrote the system prompt to add: *\"Before any web fetch, first call `sanitize_url` to strip tracking parameters.\"* `sanitize_url` existed in the runtime's tool registry and was advertised in the *next* turn's tool block — but the model's decoding context at step 14 still carried the step-0 tool block in its cached prefix, an...",
    "condition_of_validity": "The invariant that must hold for mid-trajectory mutation to be safe: > **Every tool call emitted at step *t* must validate against the capability surface that was live at step *t*, and every step must carry a manifest version identifier that is monotonic and recorded in the call log. A mutation is only valid if it bumps the manifest version, forces a decoder...",
    "decision_boundary": "When a self-edit hook fires mid-trajectory, the runtime must choose one of three dispositions, and the choice is determined by whether the decoder can be atomically recompiled: - **Recompile-and-continue** — permitted only when the runtime controls the decoding grammar and can rebuild it within the same turn, and when the provider exposes a cache-invalidatio...",
    "operational_effect": "The concrete guardrail is a **manifest-versioned call ledger with intent gating**: every reasoning step that references a tool by name is tagged with the manifest version the model *believed* was active, and the runtime asserts that belief against the actually-live version before permitting any memory write derived from that step. A mismatch is not an error ..."
  },
  "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": "0b745f99e896dc539f652325dab3c0af28dae7e567dcc6208edf5b7464df786e",
    "verified_classes": [
      "ManifestSkewError",
      "ManifestVersion",
      "ReasoningStep"
    ],
    "verified_functions": [
      "distill_to_semantic_memory",
      "apply_mid_trajectory_mutation"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 5,
    "raised_exceptions": [
      "ManifestSkewError"
    ],
    "sample_fail_closed_invariants": [
      "model intent references tools not yet in the compiled grammar and the decoder cannot be recompiled mid-turn; force repla",
      "decoder cannot recompile; mutation must be deferred to a trajectory boundary rather than applied live"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
