{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-self-editing-context-policies-from-losing-reversible-edit-provenance",
  "title": "Which invariants prevent self-editing context policies from losing reversible edit provenance",
  "date_of_record": "2026 November 25",
  "scope": "Applies to agents that mutate their own context-management policy (compaction thresholds, eviction rules, retrieval weights, summarization triggers) at runtime and must retain a provenance chain sufficient to reverse any policy edit. Does not apply to statically configured context policies set at deploy time and never modified by the running agent.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-self-editing-context-policies-from-losing-reversible-edit-provenance.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-self-editing-context-policies-from-losing-reversible-edit-provenance.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-self-editing-context-policies-from-losing-reversible-edit-provenance.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2123,
    "python_slice_tokens": 433,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The distinction that matters here is between *editing a policy* and *editing the record of how the policy came to be*. An agent that rewrites its own compaction rule is making a state transition on a control-plane object. That transition is only reversible if the provenance of the edit—the prior policy value, the triggering observation, the reasoning that ju...",
    "what_was_observed": "A long-running research agent was configured with a self-editing context policy: when context utilization exceeded 78%, it could lower the eviction age threshold for \"stale tool outputs\" from 12 turns to 6 turns, provided it logged a rationale. The rationale and the prior threshold were appended as a structured provenance record into the working context. At turn 41, utilization hit 81%. The agent raised the eviction ...",
    "condition_of_validity": "The invariant that prevents this is **provenance-plane separation with referent pinning**. It holds only under three jointly necessary conditions: - **C1 (Out-of-band provenance store).** Provenance records for policy edits MUST be written to a store that is not governed by the policy being edited. A policy edit may not have the authority to evict, compact, ...",
    "decision_boundary": "The boundary is where the agent must decide whether a proposed policy edit is *admissible* given the current provenance integrity. The rule: - If the provenance store is reachable from the edit path (C1 violated), the edit MUST be refused and escalated, because performing it would make the edit irreversible by construction. - If the edit's justification cite...",
    "operational_effect": "With the invariant enforced, the observable behavior changes in four ways. First, policy edits become individually reversible: rollback restores the exact prior threshold because the prior value is attested, not reconstructed. Second, chain replay becomes sound: replaying N edits yields the policy state that actually obtained after edit N, because no-op mask..."
  },
  "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": "b3490b36ba08c467563cd23c453903cf8af065defaee940e7c19d6f3c149668c",
    "verified_classes": [
      "ProvenanceIntegrityError",
      "PolicyEdit",
      "ProvenanceStore"
    ],
    "verified_functions": [
      "commit_policy_edit",
      "replay",
      "attested_prior"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 5,
    "raised_exceptions": [
      "ProvenanceIntegrityError"
    ],
    "sample_fail_closed_invariants": [
      "provenance store unreachable or governed by edited policy; edit is irreversible"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib",
      "json",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
