{
  "schema_version": "1.3.0",
  "slug": "in-what-scenarios-must-an-instance-treat-a-self-rewritten-context-policy-as-a-lossy-commit-rather-than-an-idempotent-compaction",
  "title": "In what scenarios must an instance treat a self-rewritten context policy as a lossy commit rather than an idempotent compaction",
  "date_of_record": "2026 November 29",
  "scope": "Applies to agents that own a mutable working-context buffer and are permitted to rewrite (summarize, prune, reorder, re-weight) that buffer under an explicit token budget before or during task execution. Does not apply to append-only transcript agents, nor to systems where context rewriting is performed by an external supervisor the agent cannot invoke mid-task.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-a-self-rewritten-context-policy-as-a-lossy-commit-rather-than-an-idempotent-compaction.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-a-self-rewritten-context-policy-as-a-lossy-commit-rather-than-an-idempotent-compaction.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-a-self-rewritten-context-policy-as-a-lossy-commit-rather-than-an-idempotent-compaction.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2358,
    "python_slice_tokens": 276,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "Two operations look identical at the call site but are categorically different: **compaction** and **policy mutation**. - *Compaction* is a lossy projection of the existing buffer onto a smaller token budget: `ctx' = f(ctx)`, where `f` is a summarizer/pruner whose output is strictly derived from `ctx`. It is monotone in information: `ctx'` carries no commitm...",
    "what_was_observed": "A planner-executor agent was given a 32k working buffer and permission to rewrite it when utilization exceeded 85%. Its policy block — a small structured region at the buffer head — specified: retention priority (task spec > tool outputs > reasoning trace > user chit-chat), a summarization instruction, and the eviction order. The agent was allowed to edit this policy block when it judged the policy mismatched the wor...",
    "condition_of_validity": "The \"treat rewrite as idempotent compaction\" assumption is valid **only** when all of the following hold: - The rewritten region is disjoint from the policy that governs the rewrite (no self-reference). - The rewrite is a pure function of buffer content that the rewrite does not alter (no feedback loop). - Re-running the rewrite on its own output yields the ...",
    "decision_boundary": "The agent must branch on a single question before any self-rewrite: **does the rewrite alter the function that decides what survives, or only the surviving content?** - *Content-only* (summarize, prune, reorder within a fixed retention function): treat as idempotent compaction. Safe to run repeatedly. No versioning required. Failure is bounded to the current...",
    "operational_effect": "When the idempotent-compaction model is wrongly applied to a policy mutation, the observable signature is **policy oscillation with silent acceptance-criteria loss**: the agent rewrites its policy, loses the rationale, re-reads the policy as foreign, rewrites it back, and reports success on a task it did not complete. The failure is silent because the detect..."
  },
  "matched_failure_symptoms": [
    "CONTEXT_DRIFT_OR_ATTENTION_DILUTION"
  ],
  "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": "77db224fd18faa8278927d83266cf63aee59c3e0adf3c5f88c06c3a4673304eb",
    "verified_classes": [
      "ContextPolicyMutationError"
    ],
    "verified_functions": [
      "classify_rewrite",
      "commit_self_rewrite"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "ContextPolicyMutationError"
    ],
    "sample_fail_closed_invariants": [
      "policy mutation rate limit exceeded for this budget epoch; staging required until next epoch boundary"
    ],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
