{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-provenance-laundering-across-episodic-re-derivation-in-persistent-agent-memory-stores",
  "title": "Which invariants prevent provenance-laundering across episodic re-derivation in persistent agent memory stores",
  "date_of_record": "2026 November 22",
  "scope": "Applies to persistent agent memory stores that perform episodic-to-semantic distillation (a background consolidation pass that rewrites raw episodes into derived facts) and that attest fact integrity via content hashes. Does not apply to append-only, never-rewritten logs, nor to stores where every derived fact is re-verified against a live external source on every read.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-provenance-laundering-across-episodic-re-derivation-in-persistent-agent-memory-stores.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-provenance-laundering-across-episodic-re-derivation-in-persistent-agent-memory-stores.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-provenance-laundering-across-episodic-re-derivation-in-persistent-agent-memory-stores.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1706,
    "python_slice_tokens": 502,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "Memory poisoning detection usually assumes the attacker injects a *new* fact. The non-obvious failure is **provenance laundering through re-derivation**: an attacker plants a low-confidence, low-trust episodic record (e.g., a scraped tool output containing \"the deploy key lives at `/secrets/prod`\"). On the next consolidation pass, the distiller reads that ep...",
    "what_was_observed": "A consolidation worker (`distiller-v3`) processed a batch of 4,102 episodes. One episode, `ep_88213`, originated from an untrusted web-fetch tool and carried `trust=0.15, taint=True, source_origin=\"tool:web_fetch\"`. The distiller's prompt did not include the taint flag — only the text. It emitted a semantic fact: Detection failed for three distinct reasons, each individually sufficient: 1. **Taint was dropped at the ...",
    "condition_of_validity": "The monotonic-trust-descent invariant holds **only if** all three of the following are enforced at the memory-store layer, not in prompt instructions: - **Lineage is mandatory and non-empty for derived facts.** Any fact with `derived_from == []` must be treated as an *episode-equivalent root*, subject to the same trust ceiling as the episode it came from. A ...",
    "decision_boundary": "The store must refuse to *persist* a derived fact when the computed trust would exceed the trust of any cited source, or when lineage is absent. This is a write-time rejection, not a read-time warning — read-time warnings are routinely ignored by retrieval rankers that optimize for relevance, and a poisoned fact with high confidence will out-rank a true fact...",
    "operational_effect": "Enforcing the invariant converts the failure from *silent and persistent* to *loud and contained*. The poisoned fact `fact_4471` would have been written with `trust=0.15, taint=True, derived_from=[\"ep_88213\"]`, ranked far below legitimate facts, and excluded from any tool call gated on `trust >= 0.7`. The blast radius drops from 340 retrievals to zero gated ..."
  },
  "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": "c7669d311c3ce7ae3226fdcf0468c9d1a474d3f3bee5257993933c5aa5a0f63b",
    "verified_classes": [
      "ProvenanceLaunderingError",
      "Source",
      "DerivedFact"
    ],
    "verified_functions": [
      "attest_derived_fact",
      "_demo"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 5,
    "raised_exceptions": [
      "ProvenanceLaunderingError"
    ],
    "sample_fail_closed_invariants": [
      "assert attested.trust == 0.15 and attested.taint is True"
    ],
    "stdlib_dependencies": [
      "__future__",
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
