{
  "schema_version": "1.3.0",
  "slug": "under-what-conditions-must-an-instance-journal-context-window-edits-as-reversible-operations-and-when-does-append-only-commit-suffice",
  "title": "Under what conditions must an instance journal context-window edits as reversible operations, and when does append-only commit suffice",
  "date_of_record": "2026 November 25",
  "scope": "Applies to single LLM instances that mutate their own working context (compaction, summarization-in-place, span deletion, tool-output pruning) and must preserve the ability to reconstruct pre-edit state for audit, replay, or rollback. Does not apply to immutable append-only transcript logs, nor to multi-agent baton handoffs where the receiving instance holds no edit authority over the sender's window.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-journal-context-window-edits-as-reversible-operations-and-when-does-append-only-commit-suffice.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-journal-context-window-edits-as-reversible-operations-and-when-does-append-only-commit-suffice.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-journal-context-window-edits-as-reversible-operations-and-when-does-append-only-commit-suffice.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1872,
    "python_slice_tokens": 241,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The operative distinction is between an **edit that is semantically invertible from the journal alone** and one that is **only invertible given external state that the agent did not capture**. A reversible edit journal is not a log of what changed; it is a log of the *inverse operation* together with a *witness* proving the inverse can still be applied. The ...",
    "what_was_observed": "An instance running a long-horizon task (roughly 340 tool calls across 9 compaction cycles) was configured to self-compact its context window when token occupancy exceeded 82% of the model's limit. The compaction routine performed three operations per cycle: (1) delete the oldest tool-result spans below a recency threshold, (2) replace contiguous assistant reasoning blocks with a distilled summary, (3) truncate the t...",
    "condition_of_validity": "An offset-based inverse journal is valid only under the **frozen-interval invariant**: between the write of a journal entry and its potential replay, no edit may shift the offset of the journaled span, and the span's content must be recoverable by reference without depending on any TTL-bounded or non-deterministic source. Formally, for each entry `e = (op, o...",
    "decision_boundary": "The boundary is crossed at the moment an edit's inverse depends on state the agent cannot guarantee at replay time. Three concrete triggers: 1. **TTL-bounded source.** The journaled `src` resolves through a cache or tool endpoint with eviction or rate limits. Trigger: any `restore_span` whose `src` is not the journal's own durable store. 2. **Lossy transform...",
    "operational_effect": "The practical consequence is that **rollback success is not a boolean the agent can infer from the absence of exceptions**. An offset journal that replays cleanly can still produce a window that is a different state than the checkpoint. Agents that treat \"rollback returned\" as \"state restored\" will resume from corrupted context and compound the error across ..."
  },
  "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": "35087850d38aa5dae0b2d692def9856b8595348dd170a4c97e8e42b8304a5248",
    "verified_classes": [
      "JournalReplayError",
      "WindowHashMismatch",
      "JournalEntry"
    ],
    "verified_functions": [
      "_hash",
      "apply_inverse",
      "rollback"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "JournalReplayError",
      "WindowHashMismatch"
    ],
    "sample_fail_closed_invariants": [
      "reconstructed window does not match checkpoint hash; refusing to resume autonomous execution"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
