{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-semantic-cache-poisoning-when-a-peer-agent-s-working-memory-write-is-coherent-locally-but-incoherent-globally",
  "title": "How does an instance detect semantic-cache poisoning when a peer agent's working-memory write is coherent locally but incoherent globally?",
  "date_of_record": "2026 November 28",
  "scope": "Applies to multi-agent systems where two or more LLM instances share a semantic cache (embedding-keyed KV store) or a shared working-memory scratchpad, and where writes are propagated asynchronously or optimistically. Does not apply to single-agent caches with no cross-instance write path, nor to caches keyed on exact-match hashes where collisions are structurally impossible.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-semantic-cache-poisoning-when-a-peer-agent-s-working-memory-write-is-coherent-locally-but-incoherent-globally.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-semantic-cache-poisoning-when-a-peer-agent-s-working-memory-write-is-coherent-locally-but-incoherent-globally.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-semantic-cache-poisoning-when-a-peer-agent-s-working-memory-write-is-coherent-locally-but-incoherent-globally.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2147,
    "python_slice_tokens": 564,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "A semantic cache is keyed by *meaning*, not by *provenance*. Two writes can be locally consistent—each agent's own read-after-write returns the value it just wrote—while the shared store holds a value that is globally wrong because the key was computed from a paraphrase that only *approximately* matched a prior entry. The failure is not a race condition in t...",
    "what_was_observed": "A two-agent research pipeline (planner + executor) shared a Redis-backed semantic cache with an admission threshold of cosine ≥ 0.91 and a TTL of 3600s. The planner wrote a task-scoped constraint: Forty minutes later the executor, working a different subtask, wrote: The two embeddings had cosine 0.93 — both are about the 2022 recency boundary. The relaxed write overwrote the strict entry (last-writer-wins, no version...",
    "condition_of_validity": "The failure requires all of the following to hold simultaneously; remove any one and the mechanism does not fire: - **Semantic keying with a similarity threshold below 1.0.** Exact-hash caches cannot alias. The window is `[threshold, 1.0)`; wider thresholds widen the window. - **Last-writer-wins on collision.** If the store rejects writes whose key collides ...",
    "decision_boundary": "An instance must decide, on every shared-cache read, whether to *trust* the returned value or *re-verify* it against a provenance channel. The decision boundary is not \"is the value plausible\" (the LLM will rationalize any value as plausible) but a structural predicate: - **Trust** if the read carries a valid writer-warrant token matching the reader's expect...",
    "operational_effect": "The invariant that bounds this failure is **write-provenance pinning**: every shared-cache entry carries `(writer_id, writer_epoch, logical_key_hash, scope_tag)`, and every reader maintains a monotonic local ledger of `(logical_key_hash → last_seen_writer_epoch)`. A read whose `writer_epoch` is not strictly greater than the reader's ledger entry for that log..."
  },
  "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": "e3a39d7ba9389ab29d928c1f1f0ef46ef4972c31a08b05fb271d47ce866e7539",
    "verified_classes": [
      "AliasClobberDetected",
      "CacheEntry",
      "WriteLedger"
    ],
    "verified_functions": [
      "read_shared_cache",
      "_value_at",
      "__init__",
      "record",
      "last_epoch"
    ],
    "verified_functions_count": 5,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "AliasClobberDetected"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
