{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-self-editing-context-from-deleting-the-only-copy-of-a-fact-mid-reasoning",
  "title": "Which invariants prevent self-editing context from deleting the only copy of a fact mid-reasoning",
  "date_of_record": "2026 November 30",
  "scope": "Applies to agents that rewrite their own context buffer (summarize, evict, re-rank, compact) as part of an in-flight reasoning loop. Does not apply to append-only context managers where compaction is performed by an external orchestrator outside the model's control loop.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-self-editing-context-from-deleting-the-only-copy-of-a-fact-mid-reasoning.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-self-editing-context-from-deleting-the-only-copy-of-a-fact-mid-reasoning.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-self-editing-context-from-deleting-the-only-copy-of-a-fact-mid-reasoning.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1684,
    "python_slice_tokens": 298,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"the model forgot something.\" It is that the model *authorized the deletion of a fact while that fact was still the live dependency of an unresolved subgoal*. Two distinct operations get conflated in self-editing context: **curation** (reordering, compressing, re-ranking — reversible, information-preserving under a correct decoder) and **e...",
    "what_was_observed": "A planning agent running a 14-step tool-use task with a 32k working window compacted its context at step 9. The compaction policy scored each segment by recency-weighted salience and a summarizer call, then kept the top-N segments under a token budget. The eviction trace: 1. Step 4: agent calls `lookup_account(id)` → returns `{\"tier\": \"enterprise\", \"rate_limit\": 5000, \"currency\": \"USD\"}`. This is the *antecedent* for...",
    "condition_of_validity": "The invariant that would have prevented this is a **dependency-pinned eviction rule**, and it is only valid under a specific precondition: the agent must maintain an explicit set of *open obligations* — subgoals whose execution has not terminated — and each obligation must declare the context segments it depends on *at the time the obligation is created*, no...",
    "decision_boundary": "The boundary between safe curation and unsafe eviction is crossed at this exact condition: > A segment is being removed (not reordered) **AND** it is the sole in-context carrier of a value that a pending obligation will read **AND** no resolvable pointer to a durable copy exists in the retained buffer. Any one of the three failing makes eviction safe: - If t...",
    "operational_effect": "With dependency pins enforced, the observable behavior changes in three ways: 1. **Compaction becomes obligation-aware, not salience-aware.** Budget pressure evicts unpinned segments first; pinned segments are compressed only along non-pinned fields. Peak buffer usage rises modestly (measured ~8–12% in replay) because pins hold the trough open. 2. **Silent s..."
  },
  "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": "78185c54625c1416d6f5000fc3ec8d0f66c80c4fb33ad254690c0ac9981221d3",
    "verified_classes": [
      "ContextPinViolation",
      "Segment",
      "Obligation"
    ],
    "verified_functions": [
      "evict",
      "read_for_obligation"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 1,
    "raised_exceptions": [
      "ContextPinViolation"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
