{
  "schema_version": "1.3.0",
  "slug": "in-what-scenarios-must-an-instance-treat-hierarchical-context-folding-as-a-recall-bounded-operation-rather-than-a-lossless-one",
  "title": "In what scenarios must an instance treat hierarchical context folding as a recall-bounded operation rather than a lossless one",
  "date_of_record": "2026 November 24",
  "scope": "Applies to long-running agent instances that perform hierarchical auto-compaction (folding older context into summaries at multiple levels) to survive context-window saturation while retaining the ability to answer later queries about folded content. Does not apply to single-turn inference, to stateless RAG over an external store where the raw corpus is never evicted, or to compaction where the original tokens remain retrievable byte-for-byte.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-hierarchical-context-folding-as-a-recall-bounded-operation-rather-than-a-lossless-one.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-hierarchical-context-folding-as-a-recall-bounded-operation-rather-than-a-lossless-one.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-hierarchical-context-folding-as-a-recall-bounded-operation-rather-than-a-lossless-one.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2011,
    "python_slice_tokens": 456,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"the summary was bad.\" The failure is that compaction silently changes the *recall contract*: a query that was answerable against the raw context (e.g., \"what exact error code did the tool return at step 41?\") becomes answerable only against a folded artifact that no longer contains the token. Hierarchical folding compounds this because ea...",
    "what_was_observed": "An agent executing a 340-step tool-use trajectory hit a 128k window at step ~210. Auto-compaction ran a three-level hierarchy: steps 1–80 → leaf summary L1, steps 81–160 → L2, steps 1–160 (L1+L2) → mid summary M1. The compaction prompt for M1 was \"summarize the task progress so far, preserving decisions and open threads.\" At step 300 the agent needed to re-derive a value: a checksum returned by a validator at step 47...",
    "condition_of_validity": "The recall guarantee holds **only** when all of the following are true: 1. **Fidelity class is monotone non-increasing up the hierarchy.** A parent node's fidelity class must be ≤ the minimum of its children's classes. If L1 is `EXACT_TOKEN` and M1 is `TRAJECTORY`, then any query requiring `EXACT_TOKEN` that resolves to M1 must be rejected, not answered. 2. ...",
    "decision_boundary": "The boundary is between **compaction as eviction** and **compaction as substitution**. Eviction removes tokens but preserves addressability: the query fails, escalates to the store, succeeds. Substitution replaces tokens with a generalization and *presents it as if it were the answer*: the query succeeds with a wrong value and no escalation signal. The decis...",
    "operational_effect": "Stamping fidelity classes and provenance at fold time converts an unbounded recall failure into a bounded escalation path. The instance that refuses `EXACT_TOKEN` queries against a `TRAJECTORY` node will hit the escalation, re-fetch the checksum from the store, and write the correct cache key — the 90-step-later replay mismatch never occurs. The cost is a sm..."
  },
  "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": "5466e781496b73e6b5bf2fd3ac60cd3cc0cf0d311c2c5acaaca95def0d13a84a",
    "verified_classes": [
      "FidelityClass",
      "FoldNode",
      "RecallContractViolation"
    ],
    "verified_functions": [
      "recall",
      "compact"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "RecallContractViolation"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "enum"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
