{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-model-driven-pruning-from-deleting-the-only-copy-of-a-live-commitment",
  "title": "Which invariants prevent model-driven pruning from deleting the only copy of a live commitment",
  "date_of_record": "2026 November 27",
  "scope": "Applies to agents that self-edit their own context window by scoring message/tool-result relevance and evicting low-scored segments mid-task. Does not apply to systems where pruning is performed by an external orchestrator with a durable backing store and explicit rehydration on demand.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-model-driven-pruning-from-deleting-the-only-copy-of-a-live-commitment.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-model-driven-pruning-from-deleting-the-only-copy-of-a-live-commitment.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-model-driven-pruning-from-deleting-the-only-copy-of-a-live-commitment.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1683,
    "python_slice_tokens": 361,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The distinction that matters is between *relevance* and *referential liveness*. A pruning policy scores each context segment for how useful it is to the *current* reasoning step. But a segment can be irrelevant to the current step while still being the sole referent for a commitment the agent has already made — an irreversible action it promised to take, a c...",
    "what_was_observed": "A long-horizon agent was asked to migrate a set of records under a constraint established in turn 3: \"never delete a source row until its replacement is confirmed written.\" The constraint was stated once, in prose, and acknowledged. By turn 40 the context held ~180k tokens of tool output. The agent invoked its own `ctx.prune()` routine, which scored segments by cosine similarity to the current step's query (\"write re...",
    "condition_of_validity": "The invariant \"pruning preserves liveness\" holds only when the system maintains, outside the prunable window, a **commitment ledger**: a durable set of records, each with (a) a content hash of the segment that established it, (b) the obligation it encodes, and (c) a status. Pruning is then permitted to evict a segment only if the ledger shows no `open` commi...",
    "decision_boundary": "The boundary between safe and unsafe eviction is whether the candidate segment is *referentially load-bearing* for any open obligation. Operationally: - If a segment's content hash appears as the establishing-referent of an `open` ledger entry, eviction is forbidden unless the ledger entry is upgraded to a self-contained restatement first. - If a segment is ...",
    "operational_effect": "Once the ledger invariant is enforced, pruning becomes a two-phase operation: score-and-select, then liveness-check-and-veto. The veto phase is cheap (hash lookups) and runs on the eviction set, not the whole window. The observable effect is that prune manifests begin reporting vetoed segments, and the ledger's `open` count becomes a first-class health metri..."
  },
  "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": "06676c2006ce58f369c3aaec452e9694fea9457068fdeaa3fd7ef05ed435138a",
    "verified_classes": [
      "PruneInvariantViolation",
      "CommitmentStatus",
      "Commitment",
      "CommitmentLedger"
    ],
    "verified_functions": [
      "safe_prune",
      "register",
      "close",
      "live_hashes"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "PruneInvariantViolation"
    ],
    "sample_fail_closed_invariants": [
      "pruning attempted with no commitment ledger; liveness cannot be verified"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "enum",
      "hashlib"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
