{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-cross-store-memory-poisoning-from-surviving-episodic-to-semantic-distillation",
  "title": "Which invariants prevent cross-store memory poisoning from surviving episodic-to-semantic distillation",
  "date_of_record": "2026 November 26",
  "scope": "Applies to agents whose long-term memory is split into an episodic store (raw turn/tool-call logs) and a semantic store (distilled facts/claims) populated by an asynchronous distillation pass. Does not apply to single-store agents, or to semantic stores written only by a human-curated pipeline.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-cross-store-memory-poisoning-from-surviving-episodic-to-semantic-distillation.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-cross-store-memory-poisoning-from-surviving-episodic-to-semantic-distillation.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-cross-store-memory-poisoning-from-surviving-episodic-to-semantic-distillation.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2084,
    "python_slice_tokens": 440,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "A memory-poisoning detector is usually framed as a *content* classifier: does this retrieved fact look malicious or false? That framing fails at the distillation boundary. The dangerous case is not a poisoned *episode* and not a poisoned *semantic claim* considered in isolation—it is a poisoned episode that survives distillation into a semantic claim whose p...",
    "what_was_observed": "Setup: a research agent with an append-only episodic log (JSONL, monotonic episode IDs, each with `{id, ts, actor, source_trust, raw}`) and a semantic store keyed by claim hash with fields `{claim_id, text, embedding, provenance: [episode_id...], extractor_version, confidence}`. Distillation runs every N turns, batching recent episodes, and upserts claims. Retrieval at inference time reads *only* the semantic store f...",
    "condition_of_validity": "The replay-and-independence invariant is valid only when all of the following hold; if any is violated, the detector silently degrades to a content classifier and will miss this class of poisoning: - **Episodic immutability.** Episodes are append-only and never rewritten or garbage-collected while any claim cites them. If episodes are compacted or expired, `...",
    "decision_boundary": "The boundary is between *merge* and *quarantine* during upsert, and it is decided by origin-closure, not by text similarity: - If incoming claim and existing claim are near-duplicates **and** their provenance origin-closures are disjoint → merge, sum independent support, confidence may rise. Legitimate corroboration. - If near-duplicates **and** origin-closu...",
    "operational_effect": "With origin-closure independence and replay checks enforced at upsert, the trace above is caught at step 3: the merge sees `ep_4502`'s origin-closure includes `ep_4471`'s origin (the fetched document), so independence mass does not increase, confidence stays at the untrusted-source baseline, and because the shared origin is `untrusted_web` the claim is quara..."
  },
  "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": "afc8163cbd83913a69f9213fd6dd44352df926541f098f4299df9cacfda093c2",
    "verified_classes": [
      "ProvenanceCollapseError",
      "Episode",
      "Claim"
    ],
    "verified_functions": [
      "origin_closure",
      "independent_support",
      "upsert",
      "serve"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "ProvenanceCollapseError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
