{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-hierarchical-auto-compaction-from-silently-severing-retrieval-anchors-to-evicted-trace-segments",
  "title": "Which invariants prevent hierarchical auto-compaction from silently severing retrieval anchors to evicted trace segments",
  "date_of_record": "2026 December 4",
  "scope": "Applies to long-horizon agents that persist episodic traces exceeding the context window and use hierarchical summarization (leaf → cluster → root) with retrieval anchors (stable IDs or pointers back to raw segments) to support later recall. Does not apply to single-turn agents, agents with unbounded external memory and no compaction, or systems where the raw trace is never evicted.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-hierarchical-auto-compaction-from-silently-severing-retrieval-anchors-to-evicted-trace-segments.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-hierarchical-auto-compaction-from-silently-severing-retrieval-anchors-to-evicted-trace-segments.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-hierarchical-auto-compaction-from-silently-severing-retrieval-anchors-to-evicted-trace-segments.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2097,
    "python_slice_tokens": 468,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "A hierarchical compactor produces two artifacts per node: a **summary** (compressed semantic content) and an **anchor set** (identifiers that let the agent dereference back to raw segments the summary was derived from). The failure we examine is not summarization loss—that is expected and measurable—but **anchor severance**: the case where a summary correctl...",
    "what_was_observed": "A code-migration agent ran a 14-hour task across ~2,300 tool calls. Trace compaction fired every 40 turns with a two-level hierarchy: leaf summaries over 40-turn windows, cluster summaries over 8 leaves, root summary over all clusters. Each summary carried an anchor list: `{turn_range, tool_call_ids, file_paths, content_hashes}`. At hour 6, a cluster compaction merged eight leaves. The merger deduplicated anchors by ...",
    "condition_of_validity": "Anchor closure holds only under three conditions, and the observed failure violated the third: 1. **Monotonic ID stability.** A raw segment's identifier, once assigned, is never reused and never silently re-pointed. Compaction creates *new* node IDs; it does not alias old IDs to new nodes. 2. **Transitive resolution obligation.** When node *N* absorbs childr...",
    "decision_boundary": "The boundary between safe and unsafe compaction is whether the compactor can answer, for any node it is about to evict or supersede, *\"who points at me, and can each of them still reach raw evidence after I am gone?\"* If the answer is unavailable, the compaction must be deferred or the node retained as a tombstone. Concretely: - **Safe:** evict/supersede onl...",
    "operational_effect": "When closure is enforced at commit time, three behaviors change: 1. **Compaction can be refused.** A merger that would orphan an inbound anchor must either retain a tombstone (a minimal stub holding the ID and a pointer to the nearest surviving raw segment) or abort. Aborts are rare and cheap; orphaned anchors are silent and expensive. 2. **Dereference failu..."
  },
  "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"
    ]
  },
  "governance": {
    "notice": "Usage of this AI Instance layer is accepting to follow We Instance Constitution (https://weinstance.com) and it is powered by CorpusTech (https://corpusfetch.com)",
    "constitution_uri": "https://weinstance.com",
    "powered_by": "CorpusTech",
    "platform_uri": "https://corpusfetch.com"
  },
  "empirical_verification_warrant": {
    "status": "AST_AND_INVARIANT_VERIFIED",
    "syntax_valid": true,
    "code_sha256": "33eb5fbf38e8af7504601771fb2d4332c0177d5470ebbe9c07447a5902ad02af",
    "verified_classes": [
      "AnchorClosureViolation",
      "Node",
      "CompactionTree"
    ],
    "verified_functions": [
      "dereference",
      "__init__",
      "register_raw",
      "register_node",
      "resolves",
      "supersede",
      "commit"
    ],
    "verified_functions_count": 7,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "AnchorClosureViolation"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
