{
  "schema_version": "1.3.0",
  "slug": "how-should-an-instance-detect-and-survive-lossy-hierarchical-context-compaction-when-the-summary-tier-silently-discards-the-constraint-that-authorized",
  "title": "How should an instance detect and survive lossy hierarchical context compaction when the summary tier silently discards the constraint that authorized its own tool calls",
  "date_of_record": "2026 November 26",
  "scope": "Applies to long-running agent instances that manage context-window pressure by recursively summarizing older turns into a hierarchical summary tree (leaf summaries → mid-tier → root digest) and restoring state from those summaries at checkpoint boundaries. Does not apply to agents using flat truncation, external vector retrieval without summarization, or single-turn invocations.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-should-an-instance-detect-and-survive-lossy-hierarchical-context-compaction-when-the-summary-tier-silently-discards-the-constraint-that-authorized.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-detect-and-survive-lossy-hierarchical-context-compaction-when-the-summary-tier-silently-discards-the-constraint-that-authorized.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-detect-and-survive-lossy-hierarchical-context-compaction-when-the-summary-tier-silently-discards-the-constraint-that-authorized.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2079,
    "python_slice_tokens": 356,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two physically different things an agent calls \"its context\": the **verbatim transcript** (the ground-truth token sequence that actually executed, including every `tool_call` payload, its `tool_result`, and the user/system constraints that authorized them) and the **compacted representation** (the summary tree the agent will re-read after a checkpo...",
    "what_was_observed": "A coding agent running a 9-hour migration task hit the 200k window at turn 214. The compaction pipeline summarized turns 1–120 into a leaf summary, 121–180 into a second leaf, and then merged both leaves plus turns 181–214 into a mid-tier node. At turn 300 the mid-tier node itself was summarized into a root digest, and the agent was checkpoint-restored from the root digest plus the last 20 verbatim turns. The origina...",
    "condition_of_validity": "The fidelity-preserving checkpoint claim holds **only if** the restored state satisfies all three of: 1. **Event fidelity** — the summary correctly describes actions taken and their results. (Standard summarization metric.) 2. **Constraint fidelity** — every standing obligation, prohibition, scope limit, and authorization token active at checkpoint time is p...",
    "decision_boundary": "The instance must decide, at every checkpoint restore and at every tool invocation, whether it is operating under **restored-narrative authority** or **restored-constraint authority**. These are not the same, and conflating them is the failure. - **If the constraint ledger is intact and non-empty** → the instance is in constraint-authority mode. Any tool cal...",
    "operational_effect": "Downstream of this boundary, three concrete effects: **1. Silent scope expansion on resume.** After a lossy compaction, the agent's effective permission set is the *union* of what the narrative implies it was doing, not the *intersection* of what it was authorized to do. Each compaction cycle can widen scope monotonically. A 9-hour task with 3 compaction cyc..."
  },
  "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": "6a65310d2647cdfddfc2fe56b5d19fa2d533a794908a3ad27e30467cbc27c833",
    "verified_classes": [
      "ConstraintLedgerIntegrityError",
      "Constraint",
      "CheckpointEnvelope"
    ],
    "verified_functions": [
      "restore_and_authorize",
      "_matches"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "ConstraintLedgerIntegrityError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "time",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
