{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-self-editing-context-policies-from-deleting-the-only-copy-of-a-live-constraint",
  "title": "Which invariants prevent self-editing context policies from deleting the only copy of a live constraint",
  "date_of_record": "2026 November 30",
  "scope": "Applies to any agent that rewrites its own working context (summarize-and-drop, LLM-driven pruning, re-synthesis of prior turns) while a task is in flight. Does not apply to append-only context or to external memory stores the agent cannot mutate.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-self-editing-context-policies-from-deleting-the-only-copy-of-a-live-constraint.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-self-editing-context-policies-from-deleting-the-only-copy-of-a-live-constraint.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-self-editing-context-policies-from-deleting-the-only-copy-of-a-live-constraint.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1691,
    "python_slice_tokens": 228,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "A self-editing context policy is not a compression problem; it is a **provenance problem disguised as a compression problem**. The naive model treats context as a byte budget: when the window nears saturation, run a summarizer over the oldest span, replace the span with the summary, reclaim tokens. This is safe only when the summary is *information-equivalen...",
    "what_was_observed": "Trace from a production incident on a 14-step document-reconciliation agent with a 32k window and a policy that triggers re-synthesis at 85% occupancy. 1. Step 2: user emits `\"Never merge rows where currency differs, even if amounts match. Treat currency mismatch as a hard stop.\"` Occupancy 9%. 2. Steps 3–11: tool calls return large JSON table dumps. Occupancy climbs to 86%. 3. Step 11: re-synthesis fires. Policy sum...",
    "condition_of_validity": "A self-editing policy is valid only if, for every span it removes, it can answer the question *\"what did I delete that I might still need, and how would I know?\"* Concretely, the policy must hold three invariants: - **Invariant 1 — Constraint set is external to the editable region.** Hard constraints (prohibitions, format rules, schema preconditions) are ext...",
    "decision_boundary": "The boundary is not \"how full is the window\" but **\"does the editable region contain constraints that have no non-editable copy?\"** Decision procedure: - If all hard constraints are already mirrored in the non-editable constraint slot → summarize freely; risk is bounded by Invariant 2. - If any hard constraint exists only in the editable region → **do not su...",
    "operational_effect": "Adopting Invariant 1 changes the failure profile from *silent constraint loss* to *explicit token pressure*. That is the correct trade: a loud budget exhaustion is recoverable (the agent can ask, truncate tool output, or checkpoint); a silent constraint deletion is not, because the agent proceeds confidently and the error surfaces only in the output. The mea..."
  },
  "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": "5918643de7fc5f9ad39e4519afec83282980af14036e984a0ae839bab940efc0",
    "verified_classes": [
      "ConstraintLossError",
      "ContextSpan",
      "ContextRewriter"
    ],
    "verified_functions": [
      "ingest",
      "rewrite"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 1,
    "raised_exceptions": [
      "ConstraintLossError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
