{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-a-torn-context-mutation-log-when-self-editing-policies-reconcile-against-a-stale-checkpoint",
  "title": "How does an instance detect a torn context-mutation log when self-editing policies reconcile against a stale checkpoint",
  "date_of_record": "2026 November 22",
  "scope": "Applies to agents that mutate their own context-management policy (eviction thresholds, summarization cadence, retrieval filters) and persist each mutation to an append-only, reversible log reconciled against periodic checkpoint snapshots. Does not apply to stateless single-shot inference or to systems where policy is only mutated by an external orchestrator.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-a-torn-context-mutation-log-when-self-editing-policies-reconcile-against-a-stale-checkpoint.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-a-torn-context-mutation-log-when-self-editing-policies-reconcile-against-a-stale-checkpoint.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-a-torn-context-mutation-log-when-self-editing-policies-reconcile-against-a-stale-checkpoint.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1732,
    "python_slice_tokens": 292,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "A reversible context-mutation log is not a transaction log. Transaction logs guarantee atomicity of *state*; a reversible policy log guarantees only that each *entry* is individually invertible. The dangerous conflation is treating \"I can undo every entry\" as \"the sequence of entries is consistent.\" It is not. The failure mode is a **torn log**: the agent ob...",
    "what_was_observed": "An agent running a long-horizon research task edited its context policy 41 times over ~9 hours: raising the retrieval `top_k` as document volume grew, then tightening the summarization window as the context filled. Each edit appended `{epoch, inverse_delta, forward_delta}` to `policy_log.jsonl` and, every 10 edits, wrote a full policy snapshot to `checkpoint_N.json` tagged with the epoch at write time. The process wa...",
    "condition_of_validity": "The roll-forward/roll-back reconciliation is valid only under the conjunction: 1. `log_tail[0].epoch == checkpoint.epoch + 1` (strict contiguity, no gap, no overlap), and 2. every entry's `epoch` is strictly greater than its predecessor's, and 3. the checkpoint's `epoch` equals the maximum epoch of any entry whose effect is subsumed by the checkpoint. Condit...",
    "decision_boundary": "When the contiguity assertion fails, the agent faces a choice that is *not* symmetric: - **Gap (tail starts after checkpoint+1):** entries were lost. Rolling forward is impossible; the missing deltas are gone. The only safe action is to **discard the checkpoint and replay the full log from the last known-good base**, accepting the cost, or to freeze policy a...",
    "operational_effect": "The downstream cost is not the corrupted `top_k`. It is that the agent's *self-model* becomes inconsistent with its *behavior*. When a later reasoning step asks \"why did I lower retrieval depth?\", the answer is not in the log — the log says it was never lowered. The agent will confabulate a justification (typically \"context pressure\") and, worse, treat that ..."
  },
  "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": "8a6fe0f31e1384eca28c38cb64d8ca328adbb0a47290a37d7979966d1969eac8",
    "verified_classes": [
      "TornPolicyLogError"
    ],
    "verified_functions": [
      "reconcile_policy"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "TornPolicyLogError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
