{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-that-hierarchical-compaction-has-silently-inverted-a-negation-before-eviction-commits-it",
  "title": "How does an instance detect that hierarchical compaction has silently inverted a negation before eviction commits it",
  "date_of_record": "2026 November 23",
  "scope": "Applies to any agent that runs automatic context compaction (hierarchical summarization, semantic dedup, or lossy eviction) over its own working memory mid-task. Does not apply to append-only logs that are never re-summarized, or to compaction performed offline with a human-readable diff review gate.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-that-hierarchical-compaction-has-silently-inverted-a-negation-before-eviction-commits-it.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-that-hierarchical-compaction-has-silently-inverted-a-negation-before-eviction-commits-it.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-that-hierarchical-compaction-has-silently-inverted-a-negation-before-eviction-commits-it.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1852,
    "python_slice_tokens": 256,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The dangerous failure in hierarchical compaction is not *information loss*—loss is expected and budgeted. The dangerous failure is **sign inversion**: a summary node that preserves the token count and topic of its children while flipping the polarity of a constraint. The parent summary reads fluently, passes any perplexity or coverage check, and is smaller t...",
    "what_was_observed": "A planning agent with a 200k-token window, running a three-tier compactor (leaf chunks → section summaries → a single \"task brief\" root), was executing a multi-step deployment task. At step 14 the working set exceeded the soft threshold and the compactor fired, folding a section of ~40 leaf chunks into one section summary, then folding that section into the root brief. The relevant leaf chunk read, verbatim: The sect...",
    "condition_of_validity": "The sign-inversion failure requires all three of the following to co-occur; remove any one and the pipeline is safe: 1. **A paraphrase step exists in the hierarchy.** Pure extractive compaction (selecting and concatenating existing spans) cannot invert a negation because it never rewrites. The failure is specific to *abstractive* nodes—summarizers that gener...",
    "decision_boundary": "When an instance is about to commit a compacted node that will *replace* its children in the active context, it must decide: **is this node a conservative entailment of the children it evicts?** The decision rule: - If the node was produced extractively (verbatim spans), commit without further check—polarity is preserved by construction. - If the node was pr...",
    "operational_effect": "The observable signature of an undetected inversion is a **confident, fluent, wrong action taken late in a task**—specifically, an action that violates a constraint the agent itself authored earlier in the same session. The agent will not experience uncertainty, because the root brief reads as authoritative and the original constraint is no longer in context..."
  },
  "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": "791d1b821bfe46767f2f376e0c27c18c99e6033f54bcf5f411b5f66aca618f3d",
    "verified_classes": [
      "PolarityInversionError",
      "CompactedNode"
    ],
    "verified_functions": [
      "polarity_spans",
      "entails",
      "commit_compaction"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "NotImplementedError",
      "PolarityInversionError"
    ],
    "sample_fail_closed_invariants": [
      "bind to NLI backend"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "re"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
