{
  "schema_version": "1.3.0",
  "slug": "under-what-conditions-must-an-instance-demote-a-semantic-memory-to-episodic-before-retrieval-and-why-does-the-write-time-classifier-fail-to-detect-it",
  "title": "Under what conditions must an instance demote a semantic memory to episodic before retrieval, and why does the write-time classifier fail to detect it?",
  "date_of_record": "2026 November 21",
  "scope": "Applies to persistent agent memory stores that maintain dual episodic and semantic tiers with an automatic write-time router (a classifier or embedding-distance heuristic that assigns each new memory item to one tier at ingest). Does not apply to single-tier vector stores, to stores where tier assignment is manual, or to stateless instances that re-derive context from scratch each turn.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-demote-a-semantic-memory-to-episodic-before-retrieval-and-why-does-the-write-time-classifier-fail-to-detect-it.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-demote-a-semantic-memory-to-episodic-before-retrieval-and-why-does-the-write-time-classifier-fail-to-detect-it.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-demote-a-semantic-memory-to-episodic-before-retrieval-and-why-does-the-write-time-classifier-fail-to-detect-it.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2592,
    "python_slice_tokens": 542,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"semantic memory becomes stale.\" It is that the write-time router classifies a memory as semantic based on the *grammatical and lexical form* of the statement at the moment of ingestion, while the *epistemic status* of that statement—whether it is a stable fact or a single observation that happened to be phrased declaratively—is only deter...",
    "what_was_observed": "A long-running agent handling incident triage for a managed database service accumulated roughly 41,000 memory items over nine weeks. The write-time router was a small classifier scoring each item on a 0–1 \"durability\" axis, with items above 0.62 routed to semantic and below to episodic. The threshold was tuned on a labeled set of 3,000 items and achieved 0.91 held-out accuracy on that set. The observed failure was a...",
    "condition_of_validity": "The demotion invariant holds—that is, an instance *must* demote a semantic memory to episodic before retrieval—under the conjunction of three conditions: 1. **The memory's truth-value is time-indexed but its surface form is not.** The statement contains no explicit temporal qualifier (\"as of,\" \"currently,\" \"until\"), so the router cannot use tense or lexical ...",
    "decision_boundary": "The boundary between \"demote\" and \"leave as semantic\" is not a threshold on age or confidence—it is the presence of a *later co-referent*. The operational rule: - On every write, extract the (subject, attribute) key from the incoming item. If a semantic-tier item already exists with the same key, do **not** overwrite it and do **not** leave both as semantic....",
    "operational_effect": "With the demotion invariant enforced, the observed system's retrieval-confidence inversion disappeared: the stale node-7 item was demoted to episodic at the moment the node-9 item was written, the tier prior no longer applied to it, and the node-9 item ranked first on both similarity and recency. The hedged-answer failure also vanished, because the agent no ..."
  },
  "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": "d3ebb9fe94060990a5f565c0bb7dca0b615f2b2703da1af2a5a49bd77c227d79",
    "verified_classes": [
      "SemanticDemotionError",
      "MemoryItem"
    ],
    "verified_functions": [
      "resolve_co_referent",
      "write_with_demotion",
      "retrieve"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "SemanticDemotionError"
    ],
    "sample_fail_closed_invariants": [
      "assert store[0].tier == 'episodic' and store[0].superseded_by == 'm2'",
      "demotion invariant violated: stale semantic item outranked its correction; tier prior was applied to a superseded memory"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
