Expand description
RFC-018 Stage A — backend capability discovery surface.
Consumers of Arc<dyn EngineBackend> (and HTTP clients hitting
ff-server) historically had no typed way to ask “what can this
backend actually do?” before dispatching — they discovered
capability gaps empirically, by trying a trait method and catching
crate::engine_error::EngineError::Unavailable. This module
adds a first-class discovery primitive: a Capability enum,
CapabilityStatus shape, BackendIdentity tuple, and a
CapabilityMatrix container that crate::engine_backend::EngineBackend
exposes via capabilities_matrix().
Stage A (this module) is additive: the trait method has a default
impl that returns an empty matrix tagged family = "unknown", so
out-of-tree backends keep compiling. Concrete in-tree backends
(ValkeyBackend, PostgresBackend) override to report real caps.
Stages B + C (follow-up PRs) derive docs/POSTGRES_PARITY_MATRIX.md
from the runtime matrix and expose GET /v1/capabilities on
ff-server.
See rfcs/RFC-018-backend-capability-discovery.md for the full
design, the four owner-adjudicated open questions, and the
Alternatives-considered record.
Structs§
- Backend
Identity - Minimal-identity triple for a backend. Consumers that only need
the family label + version (e.g. for metrics dimensioning) read
this rather than the full
CapabilityMatrix. - Capability
Matrix - Full capability snapshot for a backend: its
BackendIdentityplus a stable-ordered map ofCapability→CapabilityStatus. - Version
- Backend crate version. Kept as a struct (not a semver string) per
RFC-018 §9 Q2: consumers can write
if backend.capabilities_matrix().identity.version >= Version::new(0, 10, 0) { .. }without pulling a semver-parsing dep.
Enums§
- Capability
- Coarse-grained unit of functionality a backend may or may not
provide. Granularity is one entry per operator-UI grey-renderable
feature — not per trait method. See RFC-018 §9 Q1 for the
owner adjudication (
coarse, recommended by the draft). - Capability
Status - Per-
Capabilitysupport status reported by a concrete backend.