{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-episodic-to-semantic-contamination-during-retrieval-time-provenance-resolution",
  "title": "Which invariants prevent episodic-to-semantic contamination during retrieval-time provenance resolution",
  "date_of_record": "2026 November 17",
  "scope": "Applies to agent memory systems that maintain a strict separation between episodic stores (timestamped, source-bound event traces) and semantic stores (de-contextualized, generalized assertions), and that resolve contradictions at retrieval time using provenance metadata. Does not apply to single-store RAG systems, nor to systems where semantic facts are regenerated deterministically from episodes on every read (in which case the separation is a build-time concern, not a retrieval-time one).",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-episodic-to-semantic-contamination-during-retrieval-time-provenance-resolution.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-episodic-to-semantic-contamination-during-retrieval-time-provenance-resolution.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-episodic-to-semantic-contamination-during-retrieval-time-provenance-resolution.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1736,
    "python_slice_tokens": 376,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The non-obvious boundary is between **provenance-preserving generalization** and **provenance-erasing generalization**. Both produce a semantic assertion from a set of episodic traces. The former keeps a back-pointer to the *set* of episodes that support it, plus the *validity interval* over which those episodes held. The latter produces a de-contextualized ...",
    "what_was_observed": "A system maintained episodic traces for a long-running assistant: session logs, tool outputs, user statements, each with `(source_id, observed_at, entity, predicate, value)`. A background job folded episodic traces into a semantic store keyed by `(entity, predicate)` with a single `value` and a `written_at` timestamp. On fold, the older value was overwritten. Two facts were established at different times: - Episode E...",
    "condition_of_validity": "The invariant holds only if three conditions are jointly satisfied at every semantic write: 1. **Episode-set retention.** Every semantic assertion carries the non-empty set of episode IDs that justify it. An assertion with an empty episode-set is not a semantic fact; it is an unverified claim and must be quarantined, not retrievable as current. 2. **Validity...",
    "decision_boundary": "At retrieval, when two semantic assertions for `(entity, predicate)` are both live, the resolver must choose among exactly four outcomes, and must never silently pick one: - **Supersession:** intervals are disjoint and ordered; return the assertion whose interval contains the query time. This requires condition 2. - **Contradiction:** intervals overlap and v...",
    "operational_effect": "When the three conditions are enforced, contradiction resolution becomes a *total function* over the assertion set: every pair of live assertions maps to exactly one of the four outcomes above, and the \"most recent write wins\" fallback is unreachable. The measurable effect is that conditional facts (the `package_manager` case) are either correctly scoped to ..."
  },
  "matched_failure_symptoms": [
    "DOMAIN:EPISTEMIC_PROVENANCE_AND_FEDERATION_ROUTING"
  ],
  "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": "1cc084fe5abb087cb1782ac0ca4fa989d174b37f039fb8d75cada193e6708cde",
    "verified_classes": [
      "ProvenanceInvariantError",
      "SemanticAssertion"
    ],
    "verified_functions": [
      "fold_episode",
      "resolve",
      "_guard_satisfied"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "ProvenanceInvariantError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
