{
  "schema_version": "1.3.0",
  "slug": "why-does-an-instance-overwrite-its-own-episodic-grounding-when-semantic-consolidation-fires-mid-task",
  "title": "Why does an instance overwrite its own episodic grounding when semantic consolidation fires mid-task?",
  "date_of_record": "2026 November 28",
  "scope": "Applies to long-running agent instances that maintain a dual-store memory (episodic event log + distilled semantic store) with an automatic consolidation policy triggered by episode-count, token-budget, or similarity thresholds. Does not apply to stateless single-turn inference or to systems where semantic distillation is strictly manual/offline.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/why-does-an-instance-overwrite-its-own-episodic-grounding-when-semantic-consolidation-fires-mid-task.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-overwrite-its-own-episodic-grounding-when-semantic-consolidation-fires-mid-task.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-overwrite-its-own-episodic-grounding-when-semantic-consolidation-fires-mid-task.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1518,
    "python_slice_tokens": 301,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"memory loss\" in the generic sense. It is a **write-ordering inversion between two stores that share a retrieval surface**. Episodic memory holds the ground truth of what the agent *observed and did* (timestamped, immutable-in-intent). Semantic memory holds *generalizations* distilled from episodes (mutable, confidence-weighted). Consolida...",
    "what_was_observed": "A procurement agent was mid-execution on a multi-step task: verify vendor quote → reconcile against contract → emit purchase order. At step 3 it re-reads episode `E_7` (\"vendor X quoted $41,200 on 2024-05-30, ref PO-draft-88\") to confirm the figure before emitting the PO. Between step 2 and step 3, the consolidation policy fired (episode count crossed 512). The distiller produced semantic fact `S_41`: *\"Vendor X quot...",
    "condition_of_validity": "The guardrail is a **consolidation epoch fence tied to task liveness**, not to wall-clock or episode count alone. Consolidation may prune an episode `E` only if: 1. No active task holds a `pinned_episode` reference to `E` (reference-counting on the episodic store), **and** 2. The semantic fact `S` that subsumes `E` records `E` in its `evidence_set`, **and** ...",
    "decision_boundary": "The boundary between \"safe to consolidate\" and \"must defer\" is: - **Safe:** consolidation fires when `active_task_pins == 0` for the candidate episode set, OR when the subsuming semantic fact is *exact-preserving* (it carries the verbatim observation, not an aggregate). Exact-preserving consolidation can proceed even under active pins, because reconstruction...",
    "operational_effect": "The observable failure modes, in order of subtlety: 1. **Silent value substitution** (as above): retrieval returns a semantically-plausible aggregate where an exact value was required. No error is raised; the agent proceeds on a wrong-but-confident fact. 2. **Evidence-orphaning:** a semantic fact cites `E_7` in `evidence_set`, but `E_7` was deleted. Later au..."
  },
  "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": "8dca6c26890259f3ac9b67a49f547f99980918749e59bc098af83d2d70faae31",
    "verified_classes": [
      "ConsolidationFenceViolation",
      "Episode",
      "SemanticFact",
      "DualStore"
    ],
    "verified_functions": [
      "emit_po",
      "__init__",
      "pin",
      "unpin",
      "consolidate",
      "retrieve_exact"
    ],
    "verified_functions_count": 6,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "ConsolidationFenceViolation"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "time",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
