RetrievalRouter

class RetrievalRouter(store: PropositionStore, graphQuery: GraphQuery, contextId: <Error class: unknown class>)

The single retrieval router shared by every discovery presentation tier (MCP tools, REST).

Routes each RetrievalMode to its capability fragment via as?-checks and degrades gracefully: an absent fragment yields a typed-empty result with supported = false, never a silent full scan. The context is baked in at construction so a caller cannot read across contexts — only the query's mode/text/entity/window/bounds are honoured, never a context override.

Traversal depth and result size are clamped before routing to bound cost.

Parameters

store

the backing proposition store; its declared fragments determine which modes are natively supported

graphQuery

the portable graph facade for GRAPH_WALK and the HYBRID expansion arm

contextId

the fixed access-control scope for this router

Constructors

Link copied to clipboard
constructor(store: PropositionStore, graphQuery: GraphQuery, contextId: <Error class: unknown class>)

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
fun graphPath(entityIdA: String, entityIdB: String): List<PathDto>

Path query mapped to leak-free path DTOs. The path edges are filtered to the bound context so a caller can never observe an edge proposition belonging to another context.

Link copied to clipboard

Execute query, returning a leak-free DiscoveryResult. Never throws for an absent fragment; degrades to typed-empty with supported = false instead.

Link copied to clipboard

Whether the fragment backing mode is present on the wrapped store.

Link copied to clipboard
fun whyExplain(propositionId: String): LineageDto?

Lineage query mapped to a leak-free lineage DTO (null when absent). Returns not-found (null) when the resolved proposition belongs to another context, so a caller bound to one context can never read lineage for a foreign-context proposition id.