{
  "schema_version": "1.3.0",
  "slug": "where-must-an-instance-treat-context-compaction-as-a-lossy-transform-and-re-derive-task-critical-invariants-rather-than-trusting-the-summary",
  "title": "Where must an instance treat context compaction as a lossy transform and re-derive task-critical invariants rather than trusting the summary",
  "date_of_record": "2026 November 24",
  "scope": "Applies to any agent that survives context-window saturation by summarizing or truncating its own transcript (rolling summarization, hierarchical memory, \"compact-then-continue\" loops) and then continues a multi-step task. Does not apply to stateless single-turn calls or to agents whose entire working set provably fits the window without eviction.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/where-must-an-instance-treat-context-compaction-as-a-lossy-transform-and-re-derive-task-critical-invariants-rather-than-trusting-the-summary.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-treat-context-compaction-as-a-lossy-transform-and-re-derive-task-critical-invariants-rather-than-trusting-the-summary.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-treat-context-compaction-as-a-lossy-transform-and-re-derive-task-critical-invariants-rather-than-trusting-the-summary.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1953,
    "python_slice_tokens": 407,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two ways an agent can carry state across a compaction event, and they are not interchangeable: 1. **Summarization as reference:** the summary is treated as a pointer to facts that still exist in an authoritative store (a scratchpad file, a tool-accessible log, a structured task ledger). The agent re-reads the source when a decision depends on it. 2...",
    "what_was_observed": "A planning agent executing a 40-step infrastructure remediation task crossed the window boundary at step 22. The compaction policy was rolling summarization: fold the oldest 60% of turns into a paragraph, keep the last 40% verbatim, continue. The summary produced was accurate about *what had happened* and silent about *what must remain true*. The pre-compaction transcript contained, at step 3, the constraint: \"The `b...",
    "condition_of_validity": "The invariant \"a compacted agent continues correctly\" holds **only if** at least one of the following is true: - The task's binding constraints are **re-derivable from an authoritative external store** the agent can query post-compaction (a task ledger, a constraints file, a structured plan object), so the summary is a pointer, not the truth. - The compactio...",
    "decision_boundary": "The agent must treat the compaction boundary as a **state-transfer event requiring re-validation**, not a housekeeping operation. Concretely, the boundary is crossed safely only when: - **Before folding**, the compactor classifies each turn's content into *narrative* (what happened) versus *binding* (constraints, prohibitions, preconditions, identities, orde...",
    "operational_effect": "Treating compaction as lossy forces three architectural changes that bound the failure: 1. **Pinned invariants block.** A verbatim, append-only set of constraints carried across every fold. It is never summarized because summarization is the lossy operation being defended against. Size is bounded by extracting only *binding* clauses, which are a small fracti..."
  },
  "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": "05114f912372aeb0571219c8552466258224ed59d614660697dadf0fe2b9e79c",
    "verified_classes": [
      "CompactionInvariantError",
      "StepClass",
      "Step",
      "AgentState"
    ],
    "verified_functions": [
      "compact",
      "summarize_narrative",
      "confirm_precondition",
      "execute"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "CompactionInvariantError"
    ],
    "sample_fail_closed_invariants": [
      "assert state.pinned_invariants['invoices_ddl_gate'].endswith('step_31')"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "enum"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
