{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-tier-promotion-races-from-corrupting-the-semantic-store-when-episodic-consolidation-runs-concurrently-with-retrieval-arbitrat",
  "title": "Which invariants prevent tier-promotion races from corrupting the semantic store when episodic consolidation runs concurrently with retrieval arbitration",
  "date_of_record": "2026 November 22",
  "scope": "Applies to tiered agent memory systems where a background consolidator promotes episodic records into a semantic store while a foreground retriever arbitrates across episodic, semantic, and procedural tiers. Does not apply to single-tier vector stores, write-through caches without promotion, or systems where consolidation is synchronous and serialized against retrieval.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-tier-promotion-races-from-corrupting-the-semantic-store-when-episodic-consolidation-runs-concurrently-with-retrieval-arbitrat.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-tier-promotion-races-from-corrupting-the-semantic-store-when-episodic-consolidation-runs-concurrently-with-retrieval-arbitrat.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-tier-promotion-races-from-corrupting-the-semantic-store-when-episodic-consolidation-runs-concurrently-with-retrieval-arbitrat.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2304,
    "python_slice_tokens": 548,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"stale memory\" or \"retrieval mismatch\" in the ordinary sense. It is a **promotion-visibility race**: a semantic record becomes *retrievable* at a moment when its provenance (the set of episodic records it was distilled from) is not yet durably committed, or when a concurrent consolidation pass is still mutating the same semantic key. The r...",
    "what_was_observed": "A tiered store with three namespaces: - `episodic`: append-only, timestamped, high volume, low trust, per-session. - `semantic`: distilled facts with `(subject, predicate, object, confidence, provenance_ids[])`, deduplicated by key. - `procedural`: versioned skill/plan records keyed by task signature. The consolidator ran every N seconds. For each cluster of episodic records it (1) computed a distilled fact, (2) wrot...",
    "condition_of_validity": "The guardrail holds only under all of the following, and each is load-bearing: 1. **Two-phase promotion.** A semantic record must be written in a `pending` state with its full `provenance_ids` and a `consolidation_epoch`, and only flipped to `committed` after the source episodes are durably marked. The retriever's arbitration query MUST filter `state == comm...",
    "decision_boundary": "The boundary is between **degraded recall** and **corrupted soundness**, and it is crossed at exactly one point: *when a semantic record becomes eligible for arbitration before its provenance set is closed and its epoch is fenced.* - **Below the boundary (safe):** retriever sees only `committed` records whose `provenance_ids` were durably written in a strict...",
    "operational_effect": "With two-phase promotion, provenance-before-visibility, conflict-preserving dedup, and epoch fencing in place, the observable behavior changes in three ways: 1. **Crash recovery is idempotent.** A consolidator killed mid-pass leaves `pending` records that the next pass either completes (if source episodes are still present and un-consolidated) or garbage-col..."
  },
  "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": "61e615bda9a8e488309eaa314ed66ee8b2365141838f7aaff91c7bcb72677c79",
    "verified_classes": [
      "PromotionInvariantError",
      "State",
      "SemanticRecord",
      "TieredStore"
    ],
    "verified_functions": [
      "consolidate_and_retrieve",
      "__init__",
      "_key",
      "promote",
      "commit",
      "arbitrate"
    ],
    "verified_functions_count": 6,
    "defensive_guards_count": 5,
    "raised_exceptions": [
      "PromotionInvariantError"
    ],
    "sample_fail_closed_invariants": [
      "refusing to promote a fact with an empty provenance set",
      "cannot commit semantic record before source episodes are marked consolidated",
      "commit attempted with empty provenance"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "enum",
      "time",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
