CacheEvent
Something a SemanticCache (or its CacheStore) did, delivered to a CacheListener the moment it happens.
The counters in CacheStats tell you the totals; events tell you the stream. A dashboard that wants a hit-rate gauge reads CacheStats; a metrics exporter that wants a per-lookup latency histogram, a log line per decision, or a live tap on evictions subscribes to these instead of polling. Emitting is opt-in — a cache with no listeners builds no events and measures no timings, so the default hot path is unchanged.
Every event names the scope it happened in, so a subscriber can tag or filter by scope without threading it separately.
Inheritors
Types
The Embedder failed and EmbedFailurePolicy.FALL_BACK_TO_COMPUTE stepped aside, so the call ran uncached.
A candidate was refused because it was written by a different Embedder.identity.
An entry left the store, either evicted for capacity/memory or dropped past its TTL.
A lookup that could not be served, with the same reason CacheLookup.Miss reports.
A shadow-mode lookup: what the cache would have decided, at every configured threshold.
A write the cache declined to make because a CachePolicy vetoed it.