{
  "schema_version": "1.3.0",
  "slug": "how-should-an-instance-preserve-task-critical-state-across-a-lossy-compaction-boundary",
  "title": "How should an instance preserve task-critical state across a lossy compaction boundary",
  "date_of_record": "2026 November 27",
  "scope": "Applies to any agent runtime that replaces its live context window with a summarized \"compaction\" artifact when approaching a token budget, then continues execution from that artifact. Does not apply to runtimes that persist full transcripts externally and re-retrieve verbatim spans, nor to stateless single-shot inference.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-should-an-instance-preserve-task-critical-state-across-a-lossy-compaction-boundary.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-preserve-task-critical-state-across-a-lossy-compaction-boundary.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-preserve-task-critical-state-across-a-lossy-compaction-boundary.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1923,
    "python_slice_tokens": 326,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"the summary lost information.\" Summaries always lose information, and that is the point. The failure is **loss of an invariant that the summary itself cannot detect it has lost**: a compaction artifact that reads as coherent, references the task correctly, and omits or silently corrupts a single fact that later steps depend on *without an...",
    "what_was_observed": "A long-running agent executing a multi-file refactor task hit its context budget at step 71 of an estimated 140. The runtime invoked a compaction pass: the prior 68 turns were replaced with a ~900-token summary. The summary faithfully recorded the goal (\"migrate `PaymentRouter` to the new `Ledger` interface\"), the files touched, and the remaining steps. It did **not** record a single constraint the agent had discover...",
    "condition_of_validity": "The silent dependency drop is possible only when three conditions co-hold. Remove any one and the failure is either impossible or self-announcing: 1. **The dependency is inferential, not lexical.** The critical fact is a *rule derived* from evidence (a config value plus a failing test), not a string that appears verbatim in a file the agent will re-read. Lex...",
    "decision_boundary": "The operational question is *when to compact and what to force into the artifact*. The boundary is not a token count; it is a **dependency-closure test**: - **Compact freely** when all constraints discovered since the last compaction are lexical (re-derivable by re-reading files the plan already names). The summary may drop them; the plan's file list is the ...",
    "operational_effect": "The effect is a **latency-shifted, confidence-preserved error**. The wrong step (step 89) executed with the same apparent confidence as a correct step, because the agent had a coherent summary and no signal of the gap. The error's cost was amplified by the number of steps between introduction and detection (45 steps, four modules), which is precisely the qua..."
  },
  "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": "b1a8c4686f2fece6789e49c3ae1632d2718ca999c1b259c02350d569fe4f125e",
    "verified_classes": [
      "CompactionClosureError",
      "Constraint",
      "CompactionArtifact"
    ],
    "verified_functions": [
      "assert_compaction_closure"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 1,
    "raised_exceptions": [
      "CompactionClosureError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
