createFlagGuard(flag: string,options?: FlagGuardOptions): MiddlewareFunction
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.
optional
options: FlagGuardOptions
Guard options (fallback URL, status code, context override).