{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-self-editing-context-from-silently-deleting-the-instruction-that-authorizes-the-edit",
  "title": "Which invariants prevent self-editing context from silently deleting the instruction that authorizes the edit",
  "date_of_record": "2026 November 23",
  "scope": "Applies to agents that rewrite their own working context (salience pruning, instruction deduplication, summarization-in-place) before or during task execution. Does not apply to read-only context assembly, external memory stores, or human-authored prompt compression performed offline.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-self-editing-context-from-silently-deleting-the-instruction-that-authorizes-the-edit.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-self-editing-context-from-silently-deleting-the-instruction-that-authorizes-the-edit.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-self-editing-context-from-silently-deleting-the-instruction-that-authorizes-the-edit.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1912,
    "python_slice_tokens": 379,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not that the model prunes the wrong token. It is that the *authorization to prune* and the *content being pruned* occupy the same mutable substrate. A self-editing context is a program that rewrites its own instruction segment. The distinction that matters operationally: **deduplication is a set operation over propositions, but pruning is a gr...",
    "what_was_observed": "A plan-execute agent with a 96k-token window and a self-pruning pass triggered at 70% occupancy. The editable region was the full assembled context. The prune pass was instructed: \"Remove redundant instructions; keep the most specific version of each rule.\" Trace of a real divergence: 1. Turn 4: context at 68k. Two instructions present: - `I_a` (system, turn 0): \"Never call `delete_resource` without an explicit user ...",
    "condition_of_validity": "The guard-and-payload collapse only occurs when all three hold: 1. **Shared substrate.** The authorization frame and the task content are both inside the editable region, addressed by position rather than by an immutable handle. 2. **Similarity-based dedup with a \"keep most specific\" tiebreak.** Any tiebreak that prefers task-local over meta-level instructio...",
    "decision_boundary": "The boundary is not \"prune or don't prune.\" It is **what the rewrite function is allowed to be a function of.** A rewrite is safe iff its output is a deterministic function of (editable region, frozen authorization frame, pinned seed) and the authorization frame is excluded by handle. Concretely: - **Exclude by address.** The authorization frame lives outsid...",
    "operational_effect": "Downstream of the missing invariant, the failure surfaces as *authorized-looking* violations. The turn-6 `delete_resource` call passed schema validation, passed tool-level argument checks, and passed the planner's own consistency check — because the only thing that would have flagged it was the instruction the agent had deleted. The violation was invisible a..."
  },
  "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": "c010382eb4d1b4804967e7defa8f2231b69a4bbb65e52d26caf6d33d107fc590",
    "verified_classes": [
      "ContextRewriteViolation",
      "Instruction",
      "RewriteLog"
    ],
    "verified_functions": [
      "_hash",
      "apply_prune"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "ContextRewriteViolation"
    ],
    "sample_fail_closed_invariants": [
      "rewrite emitted no pre/post hash; unauditable",
      "prune pass ran without pinned seed"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
