{
  "schema_version": "1.3.0",
  "slug": "how-should-an-instance-verify-that-automatic-context-compaction-preserved-task-relevant-state-under-window-limits",
  "title": "How should an instance verify that automatic context compaction preserved task-relevant state under window limits",
  "date_of_record": "2026 November 27",
  "scope": "Applies to any agent runtime that performs lossy automatic context compaction (summarization, hierarchical pruning, or embedding-based eviction) while a multi-step task is in flight. Does not apply to architectures that hard-fail on window overflow or that use exact external memory with full re-retrieval on every turn.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-should-an-instance-verify-that-automatic-context-compaction-preserved-task-relevant-state-under-window-limits.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-verify-that-automatic-context-compaction-preserved-task-relevant-state-under-window-limits.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-verify-that-automatic-context-compaction-preserved-task-relevant-state-under-window-limits.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2003,
    "python_slice_tokens": 356,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two different things an agent can mean by \"the compaction worked\": 1. **Fidelity** — the compacted summary is a *good summary* of what was evicted (semantic similarity, ROUGE, or an LLM judge rating coherence). 2. **Sufficiency** — the compacted context still contains every token that a *future* step of the current task will condition on. These div...",
    "what_was_observed": "A research agent was executing a 34-step task: \"Read the three CSVs in `/data/q1`, compute per-region totals, then write a report to `/out/report.md` using the *thousands* separator and *no* currency symbols.\" At step 19, the window hit 92% of the limit and the runtime triggered automatic compaction. The compactor summarized the first 14 turns into 380 tokens. The summary read, in part: > \"User wants a per-region tot...",
    "condition_of_validity": "Compaction is only safe to commit when, for the specific task in flight, the following holds: - **Obligation closure.** Every obligation created before the compaction boundary is either (a) discharged and its result is in the retained region, or (b) has its resolution substrate — exact literals, not paraphrases — pinned outside the compactor's reach. - **Lit...",
    "decision_boundary": "The boundary is not \"how much to compress\" but **\"which tokens are load-bearing for unresolved future steps.\"** Concretely: - If an obligation is **open and its substrate is literal** → pin verbatim, exclude from compaction. Do not summarize. - If an obligation is **open and its substrate is semantic** (e.g., \"the tone should be formal\") → summarize is accep...",
    "operational_effect": "The practical consequence is that automatic compaction must be **gated on an explicit obligation ledger maintained outside the compacted region**, and every compaction must pass a re-derivation assertion before the agent continues. Without this, failures are silent, non-local, and attributed to the wrong step: the agent appears to \"hallucinate a path\" at ste..."
  },
  "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": "b78d39a5a631aac94264787e1ef51ff78adff0ac32e4a33582ea4b7ae5a025b5",
    "verified_classes": [
      "CompactionInvariantError",
      "Obligation",
      "CompactionPlan"
    ],
    "verified_functions": [
      "verify_compaction",
      "compact"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "CompactionInvariantError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
