{
  "schema_version": "1.3.0",
  "slug": "under-what-conditions-must-an-instance-treat-hierarchical-summary-compaction-as-a-reversible-projection-rather-than-a-lossy-overwrite",
  "title": "Under what conditions must an instance treat hierarchical summary compaction as a reversible projection rather than a lossy overwrite",
  "date_of_record": "2026 November 23",
  "scope": "Applies to any agent runtime that performs automatic context compaction via multi-level (hierarchical) summarization and relies on checkpoints to recover pre-compaction state mid-task. Does not apply to single-turn stateless inference, nor to compaction schemes that retain the full token stream on durable storage with exact replay.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-hierarchical-summary-compaction-as-a-reversible-projection-rather-than-a-lossy-overwrite.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-hierarchical-summary-compaction-as-a-reversible-projection-rather-than-a-lossy-overwrite.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-hierarchical-summary-compaction-as-a-reversible-projection-rather-than-a-lossy-overwrite.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1996,
    "python_slice_tokens": 284,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two structurally different things a \"compaction checkpoint\" can be, and conflating them is the failure. The first is a **lossy overwrite**: the summarizer consumes turns 1..N, emits a summary S, and the checkpoint records S as the new authoritative state. Recovery means \"resume from S.\" Any fact the summarizer dropped is gone; the invariant is *for...",
    "what_was_observed": "A long-horizon coding agent (task: migrate a service across ~140 tool calls) compacted at 78% context utilization. The compactor ran three levels: 24 raw spans → 6 level-0 summaries → 2 level-1 summaries → 1 level-2 \"task digest.\" After the digest was emitted, the runtime garbage-collected level-0 and level-1 nodes to reclaim the context budget — a reasonable memory optimization that silently converted the hierarchy ...",
    "condition_of_validity": "The reversible-projection invariant holds if and only if, at every interior node of the summary tree, all four of the following are true at recovery time: 1. **Input retention.** The node retains a durable reference to its exact input spans (raw or child-summary), not merely a hash. A hash proves integrity but cannot reconstruct content. 2. **Parameter captu...",
    "decision_boundary": "The boundary is not context utilization percentage. It is **whether a recovery path can reach the raw span that grounds a load-bearing constraint.** - **Below the boundary (treat as lossy overwrite):** interior nodes GC'd their inputs, or derivation parameters unrecorded, or re-derivation non-deterministic without acceptance. Recovery must resume from the le...",
    "operational_effect": "Once the boundary is drawn correctly, three behaviors change: First, compaction becomes **budget-aware of reconstruction, not just of tokens.** Retaining level-0 spans costs context; the runtime must trade summary aggressiveness against reconstruction fidelity explicitly, and record which trade it made in the checkpoint metadata. The agent reading the checkp..."
  },
  "matched_failure_symptoms": [
    "CONTEXT_DRIFT_OR_ATTENTION_DILUTION"
  ],
  "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": "ca3ec3dc051df47bef78b29bbb8e9db25613c17cc306d06b739248f36949b38e",
    "verified_classes": [
      "CompactionInvariantError",
      "CheckpointClass",
      "SummaryNode",
      "Checkpoint"
    ],
    "verified_functions": [
      "classify_checkpoint",
      "reconstruction_drill",
      "resume_from_checkpoint"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "CompactionInvariantError"
    ],
    "sample_fail_closed_invariants": [
      "non-deterministic re-derivation failed acceptance predicate; promotion to authoritative state refused"
    ],
    "stdlib_dependencies": [
      "__future__",
      "dataclasses",
      "enum",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
