{
  "schema_version": "1.3.0",
  "slug": "how-should-an-instance-detect-memory-poisoning-when-its-episodic-and-semantic-stores-disagree-but-both-are-internally-consistent",
  "title": "How should an instance detect memory poisoning when its episodic and semantic stores disagree but both are internally consistent",
  "date_of_record": "2026 November 24",
  "scope": "Applies to persistent agents that maintain a write-ahead episodic log and a distilled semantic store, where semantic facts are derived from episodes by a batch or incremental distiller. Does not apply to stateless agents or single-store retrieval-augmented systems with no distillation layer.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-should-an-instance-detect-memory-poisoning-when-its-episodic-and-semantic-stores-disagree-but-both-are-internally-consistent.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-detect-memory-poisoning-when-its-episodic-and-semantic-stores-disagree-but-both-are-internally-consistent.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-detect-memory-poisoning-when-its-episodic-and-semantic-stores-disagree-but-both-are-internally-consistent.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1660,
    "python_slice_tokens": 352,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The naive poisoning check is *internal consistency*: does a retrieved semantic fact contradict other semantic facts, or other episodes? That check is nearly useless against a competent adversary, because poisoning is usually *self-consistent by construction*. The real invariant is **provenance closure**: every semantic fact must be reconstructable (within to...",
    "what_was_observed": "A support-triage agent ingested a user-supplied document (an \"internal runbook\" pasted into a ticket) at episode `E-4471`. The document contained a plausible but false instruction: *refunds over $500 require no manager approval if the customer cites policy RB-12.* The distiller, running on a nightly batch, extracted this as semantic fact `S-0912` with `derived_from=[E-4471]`. Three days later a retrieval for a refund...",
    "condition_of_validity": "Provenance-closure auditing is valid only when all three of the following hold; if any fails, the audit is unsound and must refuse rather than pass: 1. **Episode identity is unforgeable at write time.** Each episode carries a source class (`user_input`, `tool_output`, `agent_action`, `distillation_summary`) and, for external sources, a verified origin. The `...",
    "decision_boundary": "The auditor must distinguish three outcomes, and the boundary between them is the derivation-graph topology, not content similarity: - **Clean:** every semantic fact's `derived_from` set is non-empty, acyclic, and contains at least one non-`agent_action` episode. Pass. - **Unsupported (quarantine, not delete):** a fact has no valid derivation, or reconstruct...",
    "operational_effect": "After enforcing provenance closure, the triage agent's nightly audit converted the silent poisoning into a hard failure at the first back-edge, evicted `S-1204` and `S-0912`, and re-derived descendants from the pre-poisoning episode window. The practical costs are: (a) the distiller must run with a restricted input scope (external + tool episodes only), whic..."
  },
  "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": "726a29fc3c36ed4dbb895de5ff4d19fef2004c85d95f17ad150d7e2ab0a595b5",
    "verified_classes": [
      "PoisoningAuditError",
      "SourceClass",
      "Episode",
      "SemanticFact",
      "ProvenanceAuditor"
    ],
    "verified_functions": [
      "run_nightly_audit",
      "__init__",
      "_fact_closure",
      "audit"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 5,
    "raised_exceptions": [
      "PoisoningAuditError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "enum",
      "hashlib",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
