{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-episodic-to-semantic-promotion-from-silently-overwriting-contradictory-session-memory",
  "title": "Which invariants prevent episodic-to-semantic promotion from silently overwriting contradictory session memory",
  "date_of_record": "2026 November 29",
  "scope": "Applies to agents that maintain a two-tier memory (verbatim episodic log + distilled semantic store) and promote facts from episodic to semantic across session boundaries. Does not apply to single-session scratchpad agents or to purely vector-retrieval systems with no promotion step.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-episodic-to-semantic-promotion-from-silently-overwriting-contradictory-session-memory.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-episodic-to-semantic-promotion-from-silently-overwriting-contradictory-session-memory.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-episodic-to-semantic-promotion-from-silently-overwriting-contradictory-session-memory.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1576,
    "python_slice_tokens": 287,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"bad retrieval\" and not \"lossy summarization.\" It is a **routing race between two writers into the same semantic key space**: the distillation pipeline (which promotes episodic observations into semantic facts) and the live session writer (which records what the agent is currently observing). Both write to the semantic store. Neither holds...",
    "what_was_observed": "A long-running support agent with a semantic store keyed on `(entity_id, attribute)` and an episodic store of raw turns. Session 1 (day 1): user states `account.plan = \"free\"`. Episodic turn logged. Distillation job is batched and runs at 02:00. Session 2 (day 2, 09:00): user upgrades, states `account.plan = \"pro\"`. Live writer writes `(\"acct_88\",\"plan\") -> \"pro\"` at 09:00. Distillation job at 02:00 day 3 processes s...",
    "condition_of_validity": "The invariant that must hold for correctness is **causal precedence, not wall-clock precedence**: a semantic value is authoritative only if its *evidence timestamp* (when the underlying observation occurred) dominates, and ingestion/promotion time must never be used as the tiebreaker for conflicting values on the same key. This fails specifically when all of...",
    "decision_boundary": "The correct routing rule is a hard boundary, not a heuristic: - **Promotion is admissible** only if `evidence_ts(promoted) > evidence_ts(current)` for the same key, OR the current value was itself written by a promotion with strictly older evidence. Equality is a conflict, not a win. - **Live writes always carry `evidence_ts = now`** and are never shadowed b...",
    "operational_effect": "Without the invariant, the agent exhibits **confident stale recall with no audit trail** — the worst failure class, because it is indistinguishable from correct memory at read time. Downstream effects compound: the agent re-asserts the stale fact in tool calls (e.g., re-quoting a plan, re-deriving permissions from a stale role), and because no conflict recor..."
  },
  "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": "60a7343410d67e3342d9d025f06474475d247d1f3584956ea72d076192e2c630",
    "verified_classes": [
      "SemanticValue",
      "PromotionConflictError"
    ],
    "verified_functions": [
      "promote"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "PromotionConflictError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
