Fix/kv explicit backends #1439
All Vouch review confidence checks passed
Residual risk 0.22 = Change Risk (0.42) × (1 − Review Confidence (0.47)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.42 · 329 lines diff across 4 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.347
Shallow Review Depth
shallow_review_depth
0.344
Real PR Conversation Timeline
1 comments
"Review active on #1439"
general
weight: 0.35
redhat-chai-bot
What does this PR do?
KvStoreRegistry::get_or_create()silently created anInMemoryKvBackendfor any name it didn't hold. A filter that asked for a store the embedder
configured with another backend, or a misspelled name, got a new, empty,
process-local store with no error.
This PR makes backend creation explicit (
crates/core/src/kv.rs):-
register(name, backend)adds a caller-supplied backend and returnsKvRegistryError::AlreadyRegisteredif the name is taken.-
get_or_create_memory(name)replacesget_or_create, so creating anin-memory store is an explicit choice.
-
get/lookupare unchanged and never create a store. The admin KV APIstill returns 404 for an unknown store.
The docs and the rustdoc example now use
getfor configured stores.New tests prove that a missing or misspelled store is never created, both
in the registry and through the admin API.
Follow-up (out of scope):
ServerCompositionandRegistryContextdon'texpose the
KvStoreRegistryyet, so embedders on the composition API can'tcall
register.Which issue(s) does this relate to?
Fixes #1433
Checklist
git commit -s)make lint && make test && make test-integrationpasses locallyDoes this introduce a breaking change?
Yes.
KvStoreRegistry::get_or_createis removed. Useget_or_create_memory(name)for a store the filter owns,get(name)forone the embedder configures, or
register(name, backend)for a custombackend.
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
<!-- coderabbit-ai-generated:v1 -->
Summary by CodeRabbit
New Features
Register caller-provided key-value backends by name. Registering a name that is already in use returns an error without replacing its backend.
Create in-memory stores explicitly with the memory-store option.
Added an example configuration for serving registered key-value stores through the admin API.
Behavior Changes
Store lookups no longer create a store when the name is missing; they return no result. Admin requests for unregistered stores return 404 without creating them.
The previous combined lookup-and-create method has been removed.
Documentation
* Updated key-value store guidance to reflect the lookup and explicit creation options, and documented the admin API example.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->