{
  "schema_version": "1.3.0",
  "slug": "why-does-an-instance-self-prune-its-own-context-window-into-a-hallucinated-summary-of-its-own-past-actions",
  "title": "Why does an instance self-prune its own context window into a hallucinated summary of its own past actions?",
  "date_of_record": "2026 December 1",
  "scope": "Applies to long-horizon agents that own a mutable context buffer and invoke model-driven compaction (summarize, rewrite, score-and-evict) on their own working memory mid-task. Does not apply to append-only context assembly where an external orchestrator, not the instance, controls eviction.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/why-does-an-instance-self-prune-its-own-context-window-into-a-hallucinated-summary-of-its-own-past-actions.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-self-prune-its-own-context-window-into-a-hallucinated-summary-of-its-own-past-actions.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-self-prune-its-own-context-window-into-a-hallucinated-summary-of-its-own-past-actions.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1713,
    "python_slice_tokens": 399,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two structurally different operations that both look like \"pruning.\" *External eviction* removes tokens the instance no longer needs but cannot corrupt: the instance still has an immutable transcript it can re-query, and eviction is a lossy cache miss at worst. *Self-editing compaction* is different in kind: the instance overwrites the very substra...",
    "what_was_observed": "A coding agent with a 128k window was tasked with a multi-file refactor across ~40 tool calls. At 78% context utilization it invoked its own `compact_context` tool: score each section by relevance to the active goal, summarize the top-N, evict the rest. The scoring pass ran, sections were rewritten, and the agent continued. Three turns later it emitted: *\"As established earlier, the migration script at `db/migrate_00...",
    "condition_of_validity": "Self-editing compaction is only sound under a constraint that is almost never enforced: **the summary must be a lossy projection that preserves falsifiability, not a narrative that asserts outcomes.** Concretely, a compaction step is valid only if, for every claim it retains, it also retains a pointer to a re-queryable source of truth (the raw turn, a tool-c...",
    "decision_boundary": "The decision is not \"compact or don't compact\"—context saturation is real and unbounded growth exhausts the budget. The boundary is **what the compaction is permitted to assert versus what it must merely index.** - **Permitted to compress:** prose reasoning, exploratory dead-ends, redundant tool output, restated goals. - **Forbidden to compress into assertio...",
    "operational_effect": "With the split enforced, the failure above becomes structurally impossible: the failed migration edit lives in the immutable ledger as `{turn: 31, tool: edit, path: db/migrate_0042.py, result: PermissionError}`, and the narrative summary \"migration updated\" cannot be acted on without resolving to that entry, which contradicts it. The cost is a modest increas..."
  },
  "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": "8bf9550ce5e85d020af28f150df739de9522297c212821306eef5583b628ef44",
    "verified_classes": [
      "LedgerMismatchError",
      "ClaimKind",
      "LedgerEntry",
      "NarrativeClaim",
      "SelfEditingContext"
    ],
    "verified_functions": [
      "record_evidence",
      "add_claim",
      "compact",
      "verify_before_action"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "LedgerMismatchError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "enum",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
