OpenFeatureRulestead

open_feature_rulestead is the optional OpenFeature companion for Rulestead's Elixir runtime.

Use it when a host application already uses the Elixir open_feature SDK and wants OpenFeature evaluations to resolve through Rulestead.Runtime instead of a custom provider adapter.

Current posture

Install

Add the Elixir OpenFeature SDK plus the Rulestead provider companion:

defp deps do
[
{:open_feature, "~> 0.1.3"},
{:open_feature_rulestead, "~> 1.0"}
]
end

Then fetch dependencies:

mix deps.get

Your host app is still responsible for configuring and booting rulestead itself. This companion only provides the OpenFeature provider layer.

Provider setup

Initialize the provider with an explicit OpenFeature domain that matches the Rulestead environment you want to evaluate against. In this package, that domain becomes the provider's environment_key.

provider = %OpenFeatureRulestead.Provider{}
{:ok, provider} =
OpenFeatureRulestead.Provider.initialize(provider, "production", %{})
OpenFeature.set_provider(provider, domain: "production")

Two setup footguns are intentional and should stay explicit:

Context mapping boundary

OpenFeatureRulestead.ContextMapper.translate/1 recognizes these standard OpenFeature keys and maps them into the matching Rulestead fields:

Any other keys stay available as custom context attributes under %Rulestead.Context{attributes: ...}.

Resolution metadata boundary

The provider returns OpenFeature ResolutionDetails values and exposes only the documented scalar metadata from Rulestead.Result:

It does not promise the full internal Rulestead explanation payload through the OpenFeature metadata surface.

Package-local proof

The package-local proof command is:

mix test test/open_feature_rulestead/context_mapper_test.exs \
test/open_feature_rulestead/provider_test.exs

Run it from open_feature_rulestead/. This is the primary proof bar for the Elixir provider contract taught in this README.

Demo and repo-level proof

If you also want a browser-facing example, see ../examples/demo/README.md. That path uses host-owned HTTP and frontend glue on top of this package and should be treated as a secondary demo surface, not the package contract.

For the shared repo support posture, start from ../README.md and ../MAINTAINING.md.