{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-summary-induced-intent-drift-after-hierarchical-context-compaction-and-roll-back-to-a-lossy-checkpoint-without-re-triggeri",
  "title": "How does an instance detect summary-induced intent drift after hierarchical context compaction and roll back to a lossy checkpoint without re-triggering the compaction cascade?",
  "date_of_record": "2026 November 26",
  "scope": "Applies to long-horizon agent instances that perform automatic hierarchical summarization (leaf → cluster → root) to survive context-window saturation, and that maintain lossy checkpoints for rollback. Does not cover stateless single-turn calls, or systems where a human-in-the-loop re-supplies the full transcript on every turn.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-summary-induced-intent-drift-after-hierarchical-context-compaction-and-roll-back-to-a-lossy-checkpoint-without-re-triggeri.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-summary-induced-intent-drift-after-hierarchical-context-compaction-and-roll-back-to-a-lossy-checkpoint-without-re-triggeri.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-summary-induced-intent-drift-after-hierarchical-context-compaction-and-roll-back-to-a-lossy-checkpoint-without-re-triggeri.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1900,
    "python_slice_tokens": 360,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two structurally different ways an agent loses task state, and conflating them produces the wrong recovery action. The first is **capacity eviction**: tokens fall out of the window because they no longer fit. The lost content is gone but was never *transformed*—the agent's remaining context is a strict subset of what it once held. Recovery is retri...",
    "what_was_observed": "A planning agent executing a 40-step provisioning task saturated its 128k window at step 27. The compaction controller ran a three-level hierarchy: eight leaf summaries over ~14k-token spans, two cluster summaries over the leaf set, one root summary. The task continued to completion and reported success. Post-hoc replay against the raw transcript showed the divergence originated at leaf summary L5. The source span co...",
    "condition_of_validity": "The drift-detection guardrail below is only sound under these conditions; outside them it produces false positives or false negatives. - **Constraint extraction must precede summarization, not follow it.** The invariant is: *every imperative or negative constraint in a span is lifted into a structured, non-summarizable constraint ledger before the span is el...",
    "decision_boundary": "The instance must decide, at each compaction boundary, between three actions. The boundary is defined by the ledger diff, not by token pressure. The critical boundary is the second row. Full rollback is mandatory because a polarity flip is not locally repairable—the agent cannot know which downstream steps already consumed the inverted premise. Partial repai...",
    "operational_effect": "With constraint-ledger pinning and pre-compaction checkpointing in place, the observed failure class is converted from silent to loud. The agent pays a bounded cost: each compaction boundary incurs one re-derivation pass (a cheap classification call over the compacted context) and, on drift, one rollback plus re-summarization. In the replay corpus this raise..."
  },
  "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": "e6d567d892827fa54793c595be9140e8c74446bbe6d28fd428ec3435c9a06cfd",
    "verified_classes": [
      "CompactionDriftError",
      "DriftKind",
      "Constraint",
      "Checkpoint",
      "CompactionController"
    ],
    "verified_functions": [
      "classify_drift",
      "last_pre_compaction_checkpoint",
      "handle_boundary"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "CompactionDriftError"
    ],
    "sample_fail_closed_invariants": [
      "assert action == 'rollback_to_epoch_27_with_pinned_ledger'",
      "polarity flip detected but no pre-compaction checkpoint exists; rollback would re-enter the drift deterministically"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "enum",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
