{
  "schema_version": "1.3.0",
  "slug": "what-happens-when-an-instance-rewinds-its-context-journal-past-a-compaction-boundary-it-no-longer-holds",
  "title": "What happens when an instance rewinds its context journal past a compaction boundary it no longer holds",
  "date_of_record": "2026 November 30",
  "scope": "Applies to single-agent context controllers that maintain a reversible edit journal over the live context window (insert/delete/replace operations with inverse records) and that independently trigger lossy compaction (summarization, eviction, or token-budget truncation). Does not apply to append-only transcript logs, external vector stores, or multi-agent handoff journals, where the compaction boundary is owned by a different authority.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-rewinds-its-context-journal-past-a-compaction-boundary-it-no-longer-holds.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-rewinds-its-context-journal-past-a-compaction-boundary-it-no-longer-holds.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-rewinds-its-context-journal-past-a-compaction-boundary-it-no-longer-holds.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1795,
    "python_slice_tokens": 297,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "A reversible edit journal is only reversible with respect to the *state it was journaled against*. Two mechanisms are commonly conflated: 1. **Edit reversibility** — for every `op_i` applied to context, an inverse `op_i⁻¹` exists such that `apply(op_i⁻¹)` restores the prior bytes. 2. **State recoverability** — the bytes that `op_i⁻¹` restores are still the b...",
    "what_was_observed": "A controller held a 41-turn context with a journal of 312 edit records. At token utilization 0.91 it ran a compaction pass: turns 3–17 (including the original task specification and two tool-schema declarations) were replaced by a 340-token summary, and the journal was *not* truncated — a common shortcut, because the journal indexes refer to logical spans, and operators assume logical span indices are stable across s...",
    "condition_of_validity": "The invariant that must hold for any rewind to be sound: > For a rewind target turn `t` and every journal record `r` with `r.turn ≤ t` that the rewind will invert, `r.epoch == current_epoch`, where `epoch` is a monotonically incremented counter bumped on every lossy compaction that mutates any span covered by `r`. Equivalently: **a journal record is invertib...",
    "decision_boundary": "The operational decision is binary and must be made at compaction time, not at rewind time: The trap is that the third row is the *cheapest* to implement and the *most likely* to pass a smoke test, because the fabricated context is fluent. There is no observable signal at rewind time that distinguishes a faithful reconstruction from a plausible one — the sum...",
    "operational_effect": "After the fix, the controller's rewind path gained a mandatory epoch check and a cold-storage hydration branch. Two measurable effects: - **Rewind latency for cross-boundary targets** rose from ~40 ms (in-memory inverse replay) to ~600 ms (cold-storage fetch + re-application of post-boundary records). This is the correct cost; it was previously hidden as a s..."
  },
  "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": "2c93343726b666395c1f5307add11e07373ae401c2b9fed3ad260e2c1ea83a91",
    "verified_classes": [
      "EpochBoundaryViolation",
      "ContextJournal"
    ],
    "verified_functions": [
      "__init__",
      "record",
      "compact",
      "rewind_to"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "EpochBoundaryViolation"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
