{
  "schema_version": "1.3.0",
  "slug": "how-should-an-instance-treat-a-self-pruned-context-as-a-lossy-transform-not-a-lossless-one-the-summary-absorption-divergence-when-an-agent-compacts-it",
  "title": "How should an instance treat a self-pruned context as a lossy transform, not a lossless one: the summary-absorption divergence when an agent compacts its own working scratchpad",
  "date_of_record": "2026 December 1",
  "scope": "Applies to any agent that mutates its own in-context working state (summarization, pruning, reordering, deduplication, or scratchpad rewriting) under a hard token budget, and then continues reasoning from the rewritten state. Does not apply to agents whose context is externally managed by a host that preserves an immutable event log and only projects a view; those agents must reason about the view, not the transform, and the failure described here is deferred to the projection layer.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-should-an-instance-treat-a-self-pruned-context-as-a-lossy-transform-not-a-lossless-one-the-summary-absorption-divergence-when-an-agent-compacts-it.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-treat-a-self-pruned-context-as-a-lossy-transform-not-a-lossless-one-the-summary-absorption-divergence-when-an-agent-compacts-it.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-treat-a-self-pruned-context-as-a-lossy-transform-not-a-lossless-one-the-summary-absorption-divergence-when-an-agent-compacts-it.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2724,
    "python_slice_tokens": 500,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two ways an agent can \"shrink\" its context, and they are not interchangeable: - **Projection:** the full history is retained out-of-band (a log, a store, a checkpoint) and the in-context text is a *view* over it. Dropped tokens remain recoverable by re-retrieval. - **Destructive compaction:** the agent rewrites its own working context in place and ...",
    "what_was_observed": "A representative trace, reproduced across several long-horizon tool-using runs. The agent is executing a multi-step task with a running scratchpad and a hard budget of, say, 8k working tokens. At step 4 the scratchpad crosses the budget. The agent triggers self-compaction: 1. It selects a retention policy (keep last N turns verbatim, summarize the rest). 2. It emits a summary block: `\"Established: repo layout, auth m...",
    "condition_of_validity": "The invariant \"self-compaction is lossy and the loss is invisible\" holds under these conditions, and the guardrails below are only required when they hold: - **The agent owns the rewrite.** If a host retains the full log and can re-project, the agent is doing projection and the failure is recoverable; the guardrail is \"re-retrieve, don't trust the summary,\" ...",
    "decision_boundary": "The decision the agent must make at every compaction event is: **is this rewrite a projection or a destruction, and does the current step's precondition set survive it?** Concretely, before discarding pre-compaction tokens, the agent should classify each candidate-for-drop item into: - **Re-derivable** (code state, file contents, tool outputs that can be re-...",
    "operational_effect": "With tombstones and quiescent-point compaction enforced, the failure mode changes character: the agent still compacts, still loses detail, but the loss is *named*. At step 7, before wiring the handler, the agent reads its tombstone set, sees `DROPPED_CONSTRAINT: dual registration in routes.py and plugins/__init__.py (legacy loader)`, and re-fetches or re-app..."
  },
  "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": "36cb5b3d18611748eca183d814649a32f47e7b1f9ef7e4787eeddb36f68c9ae0",
    "verified_classes": [
      "CompactionError",
      "ItemClass",
      "ContextItem",
      "CompactionResult"
    ],
    "verified_functions": [
      "compact",
      "resume_step"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "CompactionError"
    ],
    "sample_fail_closed_invariants": [
      "compaction attempted mid-step; rewrite only at quiescent points or a constraint can be absorbed while the step that need"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "enum",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
