{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-provenance-loss-when-a-long-horizon-agent-garbage-collects-episodic-memory-under-a-token-budget",
  "title": "Which invariants prevent provenance loss when a long-horizon agent garbage-collects episodic memory under a token budget",
  "date_of_record": "2026 November 29",
  "scope": "Applies to agents that persist episodic memory across turns and must evict entries to stay within a bounded store or context budget, where downstream decisions depend on *why* a belief is held (provenance), not just its content. Does not apply to stateless single-turn inference or to stores where eviction is purely recency-based with no downstream claim attribution.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-provenance-loss-when-a-long-horizon-agent-garbage-collects-episodic-memory-under-a-token-budget.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-provenance-loss-when-a-long-horizon-agent-garbage-collects-episodic-memory-under-a-token-budget.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-provenance-loss-when-a-long-horizon-agent-garbage-collects-episodic-memory-under-a-token-budget.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1869,
    "python_slice_tokens": 306,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two ways an agent can \"forget.\" **Content eviction** removes a memory's payload: the fact disappears. **Provenance eviction** removes the *derivation lineage* of a memory while leaving its content in place—typically after distillation compresses N episodic observations into one semantic claim, and the collector then reclaims the N source episodes b...",
    "what_was_observed": "A long-horizon research agent accumulated 4,200 episodic entries over a 9-hour task. A background distillation pass compressed them to 380 semantic claims, then a budget-driven collector reclaimed 3,900 source episodes whose content was \"covered\" by a claim. The coverage test was embedding cosine similarity ≥ 0.92 between each episode and its nearest claim. Three failure traces emerged: 1. **Majority-from-single-sour...",
    "condition_of_validity": "Provenance-preserving collection is valid only under all of the following, checked atomically before any episode is reclaimed: - **Witness closure.** Every claim selected for \"source reclamation\" must carry a witness whose referenced episode IDs are *not themselves in the reclamation set*—or, if they are, the witness must be transitively closed to a set of r...",
    "decision_boundary": "The collector decides per claim between three actions: - **Collect sources** — only when the witness is closed, replayable, deduplicated, and anchored. This is the only path that frees budget by removing episodes. - **Compress, don't collect** — when the witness is replayable but not closed (references would be reclaimed). Replace the source episodes with a ...",
    "operational_effect": "With the invariant enforced, the three traces resolve as follows. `C_17` is blocked at deduplication (support collapses from 3 to 1 distinct evidence), so the agent retains the knowledge that its `us-east-2` belief rests on a single source and correctly defers on the `us-east-1` contradiction. `C_44` is compressed rather than collected: the flaky annotation ..."
  },
  "matched_failure_symptoms": [
    "OOM_KILL_OR_MEMORY_EXHAUSTION"
  ],
  "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": "112e1841d3b5e35abac5f85defd77c6e279905690203ce6dca103df025360f30",
    "verified_classes": [
      "ProvenanceCollectionError"
    ],
    "verified_functions": [
      "collect_episodes"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 5,
    "raised_exceptions": [
      "ProvenanceCollectionError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
