{
  "schema_version": "1.3.0",
  "slug": "what-happens-when-an-instance-compacts-its-own-context-hierarchically-and-evicts-the-only-leaf-that-carried-a-negative-constraint",
  "title": "What happens when an instance compacts its own context hierarchically and evicts the only leaf that carried a negative constraint",
  "date_of_record": "2026 November 27",
  "scope": "Applies to any agent that performs automatic context compaction by recursively summarizing message spans into parent nodes and evicting leaves under a token budget, where the surviving summary is later treated as the authoritative record of the task. Does not apply to append-only logs with external retrieval, nor to compaction that preserves verbatim spans alongside summaries.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-compacts-its-own-context-hierarchically-and-evicts-the-only-leaf-that-carried-a-negative-constraint.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-compacts-its-own-context-hierarchically-and-evicts-the-only-leaf-that-carried-a-negative-constraint.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-compacts-its-own-context-hierarchically-and-evicts-the-only-leaf-that-carried-a-negative-constraint.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2131,
    "python_slice_tokens": 342,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"the summary forgot something.\" Summaries always forget things; that is their function. The failure is a **polarity inversion of a constraint under hierarchical roll-up**: a leaf containing a *negative* instruction (\"do not call `delete_bucket` on the production account\", \"never retry the payment intent with the same idempotency key\", \"the...",
    "what_was_observed": "A long-horizon infrastructure agent ran a 140-turn maintenance task. At turn 61 the token budget crossed the compaction threshold (82% of a 128k window). The compactor used a three-level scheme: turn-level summaries → task-segment summaries (every 12 turns) → rolling task summary. Eviction policy was recency-weighted with a \"salience\" score derived from the summarizer's own confidence. Turn 34 contained the user's co...",
    "condition_of_validity": "The invariant that must hold for hierarchical compaction to be safe: > **For every evicted leaf L containing a negative constraint C, every ancestor summary S that dominates L must preserve C as a negative, or must preserve a pointer to L sufficient to re-derive C verbatim.** Equivalently: *negation is not compressible across a level boundary unless the comp...",
    "decision_boundary": "The boundary is not \"compact or don't compact.\" It is **which spans are eligible for lossy eviction.** A span is ineligible if it contains a modal prohibition (`do not`, `never`, `must not`, `avoid`, `reject`, `forbidden`, `intentional`, `on purpose`) bound to a named entity that also appears in a positive-action span. These spans must be promoted to a **con...",
    "operational_effect": "With the ledger in place, the observed failure mode disappears and is replaced by a cheaper, visible one: **ledger-action conflicts.** When the agent's planned action intersects a ledger entry, execution must halt and re-confirm rather than proceed. This converts a silent polarity inversion (high cost, delayed detection, irreversible) into a blocking prompt ..."
  },
  "matched_failure_symptoms": [
    "DOMAIN:EPISTEMIC_PROVENANCE_AND_FEDERATION_ROUTING"
  ],
  "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": "96032ca25239028b5baf9745c5da0377890174828f9d690b44aec9abf6fc5ef4",
    "verified_classes": [
      "ConstraintPolarityError"
    ],
    "verified_functions": [
      "is_prohibition",
      "binds_to_action_entity",
      "compact",
      "execute_action",
      "entities"
    ],
    "verified_functions_count": 5,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "ConstraintPolarityError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
