{
  "schema_version": "1.3.0",
  "slug": "where-must-an-instance-re-derive-pre-compaction-tool-state-before-resuming-and-what-breaks-when-the-lossy-summary-is-treated-as-authoritative-replay",
  "title": "Where must an instance re-derive pre-compaction tool state before resuming, and what breaks when the lossy summary is treated as authoritative replay",
  "date_of_record": "2026 November 24",
  "scope": "Applies to long-horizon agents that perform in-context auto-compaction (summarize-and-drop) and later resume or replay from that summary checkpoint. Does not apply to agents using external durable event logs with full tool-call traces, nor to stateless single-turn invocations.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/where-must-an-instance-re-derive-pre-compaction-tool-state-before-resuming-and-what-breaks-when-the-lossy-summary-is-treated-as-authoritative-replay.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-re-derive-pre-compaction-tool-state-before-resuming-and-what-breaks-when-the-lossy-summary-is-treated-as-authoritative-replay.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-re-derive-pre-compaction-tool-state-before-resuming-and-what-breaks-when-the-lossy-summary-is-treated-as-authoritative-replay.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1822,
    "python_slice_tokens": 297,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure mode here is not \"the summary lost information.\" Lossy summaries always lose information; that is their purpose. The failure is treating the *summary as a replayable state root* rather than as a *navigation hint over an external ground truth*. When an agent resumes a long-horizon task from a compaction checkpoint, the summary describes what happe...",
    "what_was_observed": "A file-editing agent ran a 90-step refactor task. At step 60, context saturation triggered auto-compaction: the runtime summarized steps 1–60 into ~800 tokens and dropped the raw turns. The summary read, in part: *\"Edited `config/loader.py` to add a `strict` parameter and updated callers in `app/main.py`.\"* The agent resumed, and at step 74 needed to re-invoke the editor on `config/loader.py`. It reconstructed the ca...",
    "condition_of_validity": "The invariant — *re-derive pre-compaction tool state from an authoritative source before resuming* — is necessary whenever all of the following hold: - The agent has crossed at least one lossy compaction boundary within the current task. - The resumed work depends on state that was *produced by* a tool side-effect (file contents, function signatures, databas...",
    "decision_boundary": "The operational line is this: **a summary may be trusted for *what to do next*; it may never be trusted for *what was done*.** The former is a plan and plans are allowed to be approximate. The latter is a precondition and preconditions must be exact. Concretely: - Before any tool call whose arguments were last set pre-boundary, re-fetch those arguments from ...",
    "operational_effect": "When the invariant holds, resumption is correct at the cost of a bounded number of re-derivation calls (typically one per pending obligation). When it is violated, the failure is not a single error but a *self-consistent corruption*: the agent's reconstruction, its audit, and its subsequent edits all cohere with each other and with the summary, and diverge f..."
  },
  "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": "3fc95811e611153f6ab6a3317948bfcc15ec3fe6235add798cdea2234bcc1443",
    "verified_classes": [
      "CompactionReplayError"
    ],
    "verified_functions": [
      "resume_from_checkpoint"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "CompactionReplayError"
    ],
    "sample_fail_closed_invariants": [
      "checkpoint has no obligation manifest; summary-only resumption is not permitted across a lossy boundary"
    ],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
