{
  "schema_version": "1.3.0",
  "slug": "in-what-scenarios-must-an-instance-invalidate-cached-summaries-when-an-upstream-memory-edit-contradicts-a-compaction-snapshot",
  "title": "In what scenarios must an instance invalidate cached summaries when an upstream memory edit contradicts a compaction snapshot",
  "date_of_record": "2026 November 20",
  "scope": "Applies to any agent that maintains a durable memory store plus a derived, compacted summary layer (rolling summaries, hierarchical digests, or \"memory tiers\") where summaries are cached and reused across turns or sessions. Does not apply to stateless single-turn invocations or to systems where the summary is recomputed from the full source on every call.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-invalidate-cached-summaries-when-an-upstream-memory-edit-contradicts-a-compaction-snapshot.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-invalidate-cached-summaries-when-an-upstream-memory-edit-contradicts-a-compaction-snapshot.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-invalidate-cached-summaries-when-an-upstream-memory-edit-contradicts-a-compaction-snapshot.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2116,
    "python_slice_tokens": 361,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two structurally different ways a compaction cache can go stale, and they require opposite responses: 1. **Append-only staleness.** New events are added to the memory store after the summary was built. The summary is *incomplete* but still *consistent* — every claim it makes was true at snapshot time and remains true. The fix is incremental: append...",
    "what_was_observed": "A three-tier memory agent (episodic log → per-session summary → cross-session \"profile\" digest) was asked, in session 7, to correct a fact recorded in session 2: a deployment target that had been logged as `staging-eu` was actually `prod-eu`. The correction was written to the episodic store as a mutation (delete + insert) and flagged with a `supersedes` pointer to the original record. The session-2 summary, however, ...",
    "condition_of_validity": "The invariant that must hold for a compaction cache to be safe is: > **A cached summary is valid only if the content-hash of its transitive source set is unchanged since the summary was built — not merely the identity of that set.** Formally, for a summary `S` derived from sources `R = {r1..rn}`, the cache key must be `H(concat(hash(ri)))`, and every mutatio...",
    "decision_boundary": "The operational question is: **when a mutation arrives, how far up the compaction chain must invalidation propagate, and when is it safe to stop?** Invalidation must propagate to the first ancestor whose cache key *changes as a result of the mutation*. It is safe to stop propagating at layer `L` only if `L`'s key is content-derived and the mutation actually ...",
    "operational_effect": "The practical consequences of getting this boundary wrong, in order of how they surface: 1. **Silent wrong answers with full cache-hit telemetry.** No exception, no degraded metric — cache hit rate goes *up* because the stale entry keeps serving. The only observable is downstream task error, causally distant from the mutation. 2. **Cross-agent contamination...."
  },
  "matched_failure_symptoms": [
    "OOM_KILL_OR_MEMORY_EXHAUSTION",
    "CONTEXT_DRIFT_OR_ATTENTION_DILUTION"
  ],
  "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": "8447654dde5a0fd6a12c5f504989c039fb2a0097842301325c55e90edfd192b3",
    "verified_classes": [
      "StaleCompactionError",
      "Summary"
    ],
    "verified_functions": [
      "content_hash",
      "load_summary",
      "propagate_mutation"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "StaleCompactionError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
