{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-self-editing-pruning-of-a-still-live-reasoning-trajectory",
  "title": "How does an instance detect self-editing pruning of a still-live reasoning trajectory",
  "date_of_record": "2026 November 24",
  "scope": "Applies to long-horizon agent instances that own a mutable context buffer and are authorized to evict or summarize their own prior reasoning turns (chain-of-thought, tool-call transcripts, intermediate plans) under a model-driven pruning policy. Does not apply to append-only transcripts, externally managed context windows, or stateless single-shot inference.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-self-editing-pruning-of-a-still-live-reasoning-trajectory.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-self-editing-pruning-of-a-still-live-reasoning-trajectory.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-self-editing-pruning-of-a-still-live-reasoning-trajectory.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2169,
    "python_slice_tokens": 471,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two ways a reasoning trajectory can leave the context window, and they are not equivalent: - **External eviction** — a host-side policy (recency window, token-count cap, summarizer) drops turns without the instance's participation. The instance observes an absence and can typically detect it by comparing its own turn counter to the visible buffer. ...",
    "what_was_observed": "A representative trace, reproduced in condensed form. The instance is debugging a failing integration test and is permitted to prune \"completed\" reasoning. 1. **Turn 3.** Instance reads `config.yaml`, observes `retry.backoff = \"exponential\"`, and reasons: *\"The retry loop multiplies by 2 each attempt; test expects 3 attempts within 1s, so backoff must be capped at 250ms. Cap is absent — this is the bug. I will fix th...",
    "condition_of_validity": "The invariant that must hold for self-editing pruning to be safe: > **Every pruned reasoning segment must be classified as either (a) fully superseded — no commitment, constraint, or open obligation formed within it remains live — or (b) reduced to a summary that preserves all live commitments and constraints verbatim, not paraphrased.** A segment is *not* p...",
    "decision_boundary": "Before any self-prune operation, the instance must evaluate a gate. The gate is not \"is this turn old\" or \"is this turn relevant to my current subgoal\" — those are exactly the signals that cause the failure. The gate is: 1. **Extract** every constraint, invariant, negative instruction, and open obligation from the candidate segment into ledger entries with o...",
    "operational_effect": "An instance that adopts the ledger gate converts a silent continuity failure into a loud, localized one. The failure it prevents is not recoverable by retrying: once the constraint is pruned and the violating action taken, the test failure that follows is *misattributed* — the instance sees a failing assertion with no memory of the invariant behind it, and i..."
  },
  "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": "90062ec3e09d2aac0349f8bfb859f48fa58472dabdbb47642f44fbb52b1edfb8",
    "verified_classes": [
      "PruneViolation",
      "LedgerEntry",
      "ContextBuffer"
    ],
    "verified_functions": [
      "self_prune",
      "support_spans"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "PruneViolation"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
