{
  "schema_version": "1.3.0",
  "slug": "why-does-an-instance-lose-retrieval-fidelity-when-a-parent-agent-s-compaction-rewrites-the-memory-keys-its-subagents-were-pinned-to",
  "title": "Why does an instance lose retrieval fidelity when a parent agent's compaction rewrites the memory keys its subagents were pinned to",
  "date_of_record": "2026 November 30",
  "scope": "Applies to hierarchical agent systems where a parent/orchestrator agent owns a shared context budget, spawns nested subagents, and performs compaction (summarization, eviction, or key-reindexing) on the memory store those subagents retrieve from mid-task. Does not cover flat single-agent context-window management or stateless tool-call chains with no shared memory substrate.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-retrieval-fidelity-when-a-parent-agent-s-compaction-rewrites-the-memory-keys-its-subagents-were-pinned-to.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-retrieval-fidelity-when-a-parent-agent-s-compaction-rewrites-the-memory-keys-its-subagents-were-pinned-to.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-retrieval-fidelity-when-a-parent-agent-s-compaction-rewrites-the-memory-keys-its-subagents-were-pinned-to.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1944,
    "python_slice_tokens": 418,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not context-window exhaustion and not retrieval staleness in the ordinary sense. It is a **key-space invalidation across a compaction boundary**: a subagent holds a durable *memory handle* (a key, vector anchor, or chunk ID) issued before the parent compacted the store. Compaction is a lossy, re-keying operation—it merges, re-summarizes, and r...",
    "what_was_observed": "A three-tier hierarchy: orchestrator `O` allocates a 200k-token budget and spawns subagent `S1` (research) and `S2` (synthesis). `S1` retrieves a set of episodic chunks—call them handles `h_1..h_n`—and pins them by ID into its working set, planning to re-read them after a tool round-trip. While `S1` is blocked on a slow tool call, `O`'s own context crosses its compaction threshold (configurable, triggered at ~85% occ...",
    "condition_of_validity": "The guardrail holds only under a specific contract, and the contract is easy to get subtly wrong: 1. **Epoch-stamped handles.** Every handle is `(epoch, id)`, not bare `id`. Compaction increments the epoch. A subagent dereferencing a handle whose epoch < current epoch must receive a typed `StaleHandle` signal, never a best-effort chunk. 2. **Merge is a tombs...",
    "decision_boundary": "The decision boundary is the **pin lifetime versus compaction cadence** intersection. Formally: a handle pinned at epoch `e` is safe to dereference at epoch `e'` iff `e' == e` (unchanged) or the store guarantees tombstone-preserving merges with no slot reuse. Once `e' > e` and slot reuse is permitted, the handle is *unsafe to dereference and unsafe to trust ...",
    "operational_effect": "The downstream effect is **error compounding through a trusted channel**. Because the subagent's similarity guard passed, the false chunk is treated as verified grounding. It propagates to synthesis, to the parent's final aggregation, and to any auditor that reads the parent's summary rather than the raw store. Each hop increases confidence while decreasing ..."
  },
  "matched_failure_symptoms": [
    "OOM_KILL_OR_MEMORY_EXHAUSTION",
    "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": "9402fb31532db1443b9c37dc8d694c3d5af8381e38b5c6d0a231d1467c8d7820",
    "verified_classes": [
      "StaleHandleError",
      "SilentCollisionError",
      "Handle",
      "Chunk",
      "EpochGuardedStore"
    ],
    "verified_functions": [
      "resume_subagent_read",
      "__init__",
      "put",
      "compact",
      "dereference"
    ],
    "verified_functions_count": 5,
    "defensive_guards_count": 6,
    "raised_exceptions": [
      "SilentCollisionError",
      "StaleHandleError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
