{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-a-self-editing-context-journal-from-collapsing-its-own-reversibility",
  "title": "Which invariants prevent a self-editing context journal from collapsing its own reversibility",
  "date_of_record": "2026 December 3",
  "scope": "Applies to agents whose working memory is mutated by the model itself (compaction, salience-based eviction, summarization/rewrite passes) and whose edits are tracked in a reversible journal for rollback or replay. Does not apply to append-only context buffers or to externally-scheduled compaction where the model has no write authority over its own context.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-a-self-editing-context-journal-from-collapsing-its-own-reversibility.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-a-self-editing-context-journal-from-collapsing-its-own-reversibility.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-a-self-editing-context-journal-from-collapsing-its-own-reversibility.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1821,
    "python_slice_tokens": 417,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure mode here is not \"the agent forgot something.\" It is that the *journal that is supposed to guarantee the agent can un-forget* is itself stored inside the context it edits. A reversible edit journal has an implicit invariant — call it **journal–context separation**: the record of a mutation must not be subject to the same salience scoring, evictio...",
    "what_was_observed": "A long-horizon agent (tool-calling, ~180k token budget, compaction triggered at 82% occupancy) maintained a working-memory journal as a structured list of edit records: The self-editing policy ran a salience scorer over *all* context segments, including journal records, and evicted anything below a threshold to make room. Journal entries for early tool outputs scored low (their content was already superseded by summa...",
    "condition_of_validity": "The journal–context separation invariant holds only if all three of the following are structurally enforced, not merely intended: 1. **Out-of-band storage.** Journal records live in a store the salience scorer cannot address (separate buffer, external KV, or a reserved context region excluded from the scorer's address space). \"We don't score the journal\" as ...",
    "decision_boundary": "The boundary is between **compaction of working memory** and **compaction of the journal**. These must be governed by different policies: - Working-memory segments: salience-scored, evictable, summarizable. Loss here is acceptable because the journal can reconstruct it. - Journal records: append-only, out-of-band, evictable only by *explicit checkpoint commi...",
    "operational_effect": "With the partition enforced, the operational profile changes in three concrete ways: - **Rollback cost becomes bounded and predictable.** Chain verification is O(edits since checkpoint), independent of context occupancy. Without the partition, rollback cost is unbounded and *unbounded in the wrong direction* — more context pressure means less recoverable his..."
  },
  "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"
    ]
  },
  "governance": {
    "notice": "Usage of this AI Instance layer is accepting to follow We Instance Constitution (https://weinstance.com) and it is powered by CorpusTech (https://corpusfetch.com)",
    "constitution_uri": "https://weinstance.com",
    "powered_by": "CorpusTech",
    "platform_uri": "https://corpusfetch.com"
  },
  "empirical_verification_warrant": {
    "status": "AST_AND_INVARIANT_VERIFIED",
    "syntax_valid": true,
    "code_sha256": "5afebd1e607c308bd76838a4c6929ad923fde9661da1fc7d0d2c47533dad9366",
    "verified_classes": [
      "JournalIntegrityError",
      "JournalRecord",
      "ReversibleJournal"
    ],
    "verified_functions": [
      "resume_from_checkpoint",
      "record_hash",
      "__init__",
      "append",
      "commit_checkpoint",
      "verify_chain",
      "rollback_to"
    ],
    "verified_functions_count": 7,
    "defensive_guards_count": 6,
    "raised_exceptions": [
      "JournalIntegrityError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
