Creates a middleware function that guards a route based on a feature flag.
Resolves IFeatureFlags from the service registry per request, evaluates
the flag, and either calls next() (flag on) or short-circuits to a
redirect / 404 (flag off).
When the CAPABILITIES.FEATURE_FLAGS capability is unregistered, the
registry's error propagates — the guard does not fail silently.
Creates a middleware function that guards a route based on a feature flag.
Resolves
IFeatureFlagsfrom the service registry per request, evaluates the flag, and either callsnext()(flag on) or short-circuits to a redirect / 404 (flag off).When the
CAPABILITIES.FEATURE_FLAGScapability is unregistered, the registry's error propagates — the guard does not fail silently.