Interface NaruCacheableContext

All Known Implementing Classes:
NaruCacheableContext.DefaultNaruCacheableContext

public interface NaruCacheableContext
An outgoing request expressed as an ordered, explicitly-labelled decomposition of its stable and volatile parts.

This is an opt-in view of a request. Callers that do not implement it keep passing a plain NaruModelRequest and providers that do not consume it keep seeing exactly what they saw before; nothing here is on the mandatory path.

Its purpose is to let a caller say what is stable without knowing how any provider expresses caching. toRequest(Map) collapses the segments back into the ordinary flat request, which is what a provider with no caching support — or any provider whose mode is NaruCachingMode.AUTOMATIC_PREFIX — actually consumes. Ordering is preserved exactly, because for automatic prefix caching the ordering is the contract.

Segments are expected in stable-to-volatile order. NARU does not reorder them: silently moving a caller's "latest user turn" ahead of their indexed context would change the model's view of the conversation, and a caching layer is the last place that should be reordering prompts.