Rulestead (rulestead v0.1.1)

Copy Markdown View Source

Root public module for the rulestead package.

Phase 3 keeps the store-facing APIs from Phase 2 and adds the pure evaluator over an explicit in-memory authored flag payload:

  • store-facing calls return {:ok, value} | {:error, %Rulestead.Error{}}

  • bang variants raise the same %Rulestead.Error{}
  • evaluation helpers consume an authored flag payload first and explicit context second

Summary

Functions

Publishes a bounded rollout stage advancement through the configured store adapter.

Builds and executes a bounded rollout stage advancement from root-level arguments.

Applies a reusable audience mutation after validating fresh preview evidence.

Applies a previously generated manifest import plan artifact.

Applies a bounded direct promotion bundle through compare revalidation and the configured store.

Builds and applies a direct promotion bundle from root-level attributes.

Applies a previously generated promote plan artifact.

Approves a governed change request through the configured store adapter.

Archives a flag through the configured store adapter.

Assesses audience mutation blast radius from preview payload inputs.

Resolves whether an actor may approve a specific change request.

Resolves whether a governed action must go through a change request.

Cancels a governed change request through the configured store adapter.

Cancels a scheduled execution through the configured store adapter.

Compares authored source and target environment state for a pre-built compare command.

Compares authored source and target environment state for promotion preview flows.

Creates a flag through the configured store adapter.

Creates a flag from root-level attributes.

Creates a new webhook destination.

Returns bounded runtime diagnostics for the local node.

Returns the boolean enabled projection for an authored flag payload.

Engages a per-flag per-environment kill switch.

Evaluates an authored in-memory flag payload against an explicit context.

Evaluates guardrail facts for an active rollout stage and records the resulting operational state.

Builds and executes a guarded rollout evaluation from root-level arguments.

Evaluates auto-advance eligibility for one staged rollout rule.

Builds and executes an auto-advance eligibility evaluation from root-level arguments.

Executes an approved governed change request through the configured store adapter.

Normalizes a verified inbound webhook event into the local governance path.

Returns a human-readable explanation derived from the evaluation trace.

Admin-safe explain seam for one flag and environment.

Exports a deterministic authored-state manifest for one environment.

Fetches one change request through the configured store adapter.

Fetches the authored flag state for a pre-built store command.

Fetches the authored flag state for a flag_key and environment_key.

Fetches the latest derived guardrail status for one rollout rule or stage.

Builds a guardrail-status query from root-level arguments.

Fetches the durable auto-advance policy for one staged rollout rule.

Builds and executes an auto-advance policy fetch from root-level arguments.

Fetches one scheduled execution through the configured store adapter.

Fetches a single webhook destination by ID.

Fetches one webhook receipt through the configured store adapter.

Returns the projected value for an authored flag payload.

Returns the assigned variant key for an authored flag payload.

Previews a manifest import as a saved apply plan artifact.

Returns the bounded infrastructure health snapshot for the local node.

Lists audience dependency inventory rows with deterministic scoped ordering.

Lists reusable audiences through the configured store adapter.

Lists redacted audit events for one flag or all flags.

Lists change requests through the configured store adapter.

Lists environments through the configured store adapter.

Lists flags through the configured store adapter.

Lists scheduled executions through the configured store adapter.

Lists webhook outbound deliveries.

Lists webhook receipts through the configured store adapter.

Builds a saved promote plan artifact from a live compare preview.

Previews the bounded impact of a reusable audience mutation.

Publishes a ruleset version through the configured store adapter.

Records an inbound webhook receipt through the configured store adapter.

Records bounded evaluation freshness for one flag/environment pair.

Records bounded evaluation freshness using root-level arguments.

Rejects a governed change request through the configured store adapter.

Releases a per-flag per-environment kill switch.

Requeues a quarantined scheduled execution through the configured store adapter.

Retries a failed webhook delivery.

Writes a linked inverse action for a prior audit event.

Saves a draft ruleset through the configured store adapter.

Schedules an approved governed change request through the configured store adapter.

Schedules a narrowly allowed direct governed action through the configured store adapter.

Admin-safe runtime simulation for one flag and environment.

Submits a governed change request through the configured store adapter.

Updates flag metadata through the configured store adapter.

Updates a flag from root-level attributes.

Updates an existing webhook destination.

Upserts opt-in auto-advance policy for one staged rollout rule.

Builds and upserts an auto-advance policy from root-level arguments.

Returns the package version.

Functions

advance_rollout(command)

@spec advance_rollout(Rulestead.Store.Command.AdvanceRollout.t()) ::
  Rulestead.Store.result(map())

Publishes a bounded rollout stage advancement through the configured store adapter.

advance_rollout(flag_key, environment_key, attrs, opts \\ [])

@spec advance_rollout(
  String.t() | atom(),
  String.t() | atom(),
  map() | keyword(),
  keyword()
) ::
  Rulestead.Store.result(map())

Builds and executes a bounded rollout stage advancement from root-level arguments.

apply_audience_mutation(command_or_attrs, opts \\ [])

@spec apply_audience_mutation(
  Rulestead.Store.Command.ApplyAudienceMutation.t() | map() | keyword(),
  keyword()
) :: Rulestead.Store.result(map())

Applies a reusable audience mutation after validating fresh preview evidence.

Protected-environment threshold evaluation runs in the store pipeline via Rulestead.Governance.BlastRadiusThreshold.validate_protected_apply/3. Custom store adapters must call that helper to inherit the same contract.

apply_manifest_plan(content, opts \\ [])

@spec apply_manifest_plan(
  binary() | map(),
  keyword()
) :: {:ok, map()} | {:error, Rulestead.Error.t()}

Applies a previously generated manifest import plan artifact.

apply_promotion(command)

@spec apply_promotion(Rulestead.Store.Command.ApplyPromotion.t()) ::
  Rulestead.Store.result(map())

Applies a bounded direct promotion bundle through compare revalidation and the configured store.

apply_promotion(attrs, opts \\ [])

@spec apply_promotion(
  map() | keyword(),
  keyword()
) :: Rulestead.Store.result(map())

Builds and applies a direct promotion bundle from root-level attributes.

apply_promotion_plan(content, opts \\ [])

@spec apply_promotion_plan(
  binary() | map(),
  keyword()
) :: {:ok, map()} | {:error, Rulestead.Error.t()}

Applies a previously generated promote plan artifact.

approve_change_request(command)

@spec approve_change_request(Rulestead.Store.Command.ApproveChangeRequest.t()) ::
  Rulestead.Store.result(map())

Approves a governed change request through the configured store adapter.

archive_flag(command)

@spec archive_flag(Rulestead.Store.Command.ArchiveFlag.t()) ::
  Rulestead.Store.result(map())

Archives a flag through the configured store adapter.

archive_flag!(command)

@spec archive_flag!(Rulestead.Store.Command.ArchiveFlag.t()) :: map()

Bang variant of archive_flag/1.

assess_audience_blast_radius(preview_or_attrs, opts \\ [])

@spec assess_audience_blast_radius(
  map(),
  keyword()
) :: {:ok, map()} | {:error, Rulestead.Error.t()}

Assesses audience mutation blast radius from preview payload inputs.

Returns a deterministic threshold verdict suitable for operator display and change-request embedding. Does not perform I/O — supply preview data from preview_audience_impact/2.

authorize_change_request_approval(actor, submitter, action, resource, environment_key)

@spec authorize_change_request_approval(
  term(),
  term(),
  atom(),
  term(),
  String.t() | atom() | nil
) ::
  {:ok, Rulestead.Governance.ApprovalRequirement.t()}
  | {:error, Rulestead.Error.t(), Rulestead.Admin.Authorizer.audit_payload()}

Resolves whether an actor may approve a specific change request.

authorize_governed_action(actor, action, resource, environment_key)

@spec authorize_governed_action(term(), atom(), term(), String.t() | atom() | nil) ::
  {:ok, Rulestead.Governance.ApprovalRequirement.t()}
  | {:error, Rulestead.Error.t(), Rulestead.Admin.Authorizer.audit_payload()}

Resolves whether a governed action must go through a change request.

cancel_change_request(command)

@spec cancel_change_request(Rulestead.Store.Command.CancelChangeRequest.t()) ::
  Rulestead.Store.result(map())

Cancels a governed change request through the configured store adapter.

cancel_scheduled_execution(command)

@spec cancel_scheduled_execution(Rulestead.Store.Command.CancelScheduledExecution.t()) ::
  Rulestead.Store.result(map())

Cancels a scheduled execution through the configured store adapter.

compare_environments(command)

@spec compare_environments(Rulestead.Store.Command.CompareEnvironments.t()) ::
  Rulestead.Store.result(map())

Compares authored source and target environment state for a pre-built compare command.

compare_environments(source_environment_key, target_environment_key, opts \\ [])

@spec compare_environments(String.t() | atom(), String.t() | atom(), keyword()) ::
  Rulestead.Store.result(map())

Compares authored source and target environment state for promotion preview flows.

create_flag(command)

@spec create_flag(Rulestead.Store.Command.CreateFlag.t()) ::
  Rulestead.Store.result(map())

Creates a flag through the configured store adapter.

create_flag(attrs, opts \\ [])

@spec create_flag(
  map() | keyword(),
  keyword()
) :: Rulestead.Store.result(map())

Creates a flag from root-level attributes.

create_webhook_destination(command)

@spec create_webhook_destination(
  Rulestead.Store.Command.CreateWebhookDestination.t()
  | map()
  | keyword()
) :: Rulestead.Store.result(map())

Creates a new webhook destination.

diagnostics()

@spec diagnostics() :: map()

Returns bounded runtime diagnostics for the local node.

enabled?(flag_payload, context)

@spec enabled?(map(), Rulestead.Context.t() | keyword() | map()) ::
  {:ok, boolean()} | {:error, Rulestead.Error.t()}

Returns the boolean enabled projection for an authored flag payload.

engage_kill_switch(command)

@spec engage_kill_switch(Rulestead.Store.Command.EngageKillSwitch.t()) ::
  Rulestead.Store.result(map())

Engages a per-flag per-environment kill switch.

engage_kill_switch(flag_key, environment_key, actor, opts \\ [])

@spec engage_kill_switch(String.t() | atom(), String.t() | atom(), map(), keyword()) ::
  Rulestead.Store.result(map())

evaluate(flag_payload, context, opts \\ [])

@spec evaluate(map(), Rulestead.Context.t() | keyword() | map(), keyword()) ::
  {:ok, Rulestead.Result.t()} | {:error, Rulestead.Error.t()}

Evaluates an authored in-memory flag payload against an explicit context.

evaluate!(flag_payload, context, opts \\ [])

@spec evaluate!(map(), Rulestead.Context.t() | keyword() | map(), keyword()) ::
  Rulestead.Result.t()

Bang variant of evaluate/3.

evaluate_guarded_rollout(command)

@spec evaluate_guarded_rollout(Rulestead.Store.Command.EvaluateGuardedRollout.t()) ::
  Rulestead.Store.result(map())

Evaluates guardrail facts for an active rollout stage and records the resulting operational state.

evaluate_guarded_rollout(flag_key, environment_key, attrs, opts \\ [])

@spec evaluate_guarded_rollout(
  String.t() | atom(),
  String.t() | atom(),
  map() | keyword(),
  keyword()
) :: Rulestead.Store.result(map())

Builds and executes a guarded rollout evaluation from root-level arguments.

evaluate_rollout_auto_advance(command)

@spec evaluate_rollout_auto_advance(
  Rulestead.Store.Command.EvaluateRolloutAutoAdvance.t()
) ::
  Rulestead.Store.result(map())

Evaluates auto-advance eligibility for one staged rollout rule.

Evaluation-only in Phase 61: returns eligibility without mutating rollout stage, guardrail decisions, or scheduling governed advance_rollout.

evaluate_rollout_auto_advance(flag_key, environment_key, attrs, opts \\ [])

@spec evaluate_rollout_auto_advance(
  String.t() | atom(),
  String.t() | atom(),
  map() | keyword(),
  keyword()
) :: Rulestead.Store.result(map())

Builds and executes an auto-advance eligibility evaluation from root-level arguments.

execute_change_request(command)

@spec execute_change_request(Rulestead.Store.Command.ExecuteChangeRequest.t()) ::
  Rulestead.Store.result(map())

Executes an approved governed change request through the configured store adapter.

execute_inbound_event(event, receipt)

@spec execute_inbound_event(Rulestead.Webhooks.InboundEvent.t(), map()) ::
  Rulestead.Store.result(map())

Normalizes a verified inbound webhook event into the local governance path.

explain(flag_payload, context)

@spec explain(map(), Rulestead.Context.t() | keyword() | map()) ::
  {:ok, String.t()} | {:error, Rulestead.Error.t()}

Returns a human-readable explanation derived from the evaluation trace.

explain_flag(flag_key, environment_key, context, opts \\ [])

@spec explain_flag(
  String.t() | atom(),
  String.t() | atom(),
  Rulestead.Context.t() | keyword() | map(),
  keyword()
) :: {:ok, map()} | {:error, Rulestead.Error.t()}

Admin-safe explain seam for one flag and environment.

export_manifest(environment_key, opts \\ [])

@spec export_manifest(
  String.t() | atom(),
  keyword()
) :: {:ok, map()} | {:error, Rulestead.Error.t()}

Exports a deterministic authored-state manifest for one environment.

fetch_change_request(command)

@spec fetch_change_request(Rulestead.Store.Command.FetchChangeRequest.t()) ::
  Rulestead.Store.result(map())

Fetches one change request through the configured store adapter.

fetch_flag(command)

@spec fetch_flag(Rulestead.Store.Command.FetchFlag.t()) ::
  Rulestead.Store.result(map())

Fetches the authored flag state for a pre-built store command.

fetch_flag(flag_key, environment_key, opts \\ [])

@spec fetch_flag(String.t() | atom(), String.t() | atom(), keyword()) ::
  Rulestead.Store.result(map())

Fetches the authored flag state for a flag_key and environment_key.

fetch_flag!(flag_key, environment_key, opts \\ [])

@spec fetch_flag!(String.t() | atom(), String.t() | atom(), keyword()) :: map()

Bang variant of fetch_flag/3.

fetch_guardrail_status(command)

@spec fetch_guardrail_status(Rulestead.Store.Command.FetchGuardrailStatus.t()) ::
  Rulestead.Store.result(map())

Fetches the latest derived guardrail status for one rollout rule or stage.

fetch_guardrail_status(flag_key, environment_key, opts \\ [])

@spec fetch_guardrail_status(String.t() | atom(), String.t() | atom(), keyword()) ::
  Rulestead.Store.result(map())

Builds a guardrail-status query from root-level arguments.

fetch_rollout_auto_advance_policy(command)

@spec fetch_rollout_auto_advance_policy(
  Rulestead.Store.Command.FetchRolloutAutoAdvancePolicy.t()
) ::
  Rulestead.Store.result(map())

Fetches the durable auto-advance policy for one staged rollout rule.

fetch_rollout_auto_advance_policy(flag_key, environment_key, rule_key, opts \\ [])

@spec fetch_rollout_auto_advance_policy(
  String.t() | atom(),
  String.t() | atom(),
  String.t() | atom(),
  keyword()
) :: Rulestead.Store.result(map())

Builds and executes an auto-advance policy fetch from root-level arguments.

fetch_scheduled_execution(command)

@spec fetch_scheduled_execution(Rulestead.Store.Command.FetchScheduledExecution.t()) ::
  Rulestead.Store.result(map())

Fetches one scheduled execution through the configured store adapter.

fetch_webhook_destination(id_or_command, opts \\ [])

@spec fetch_webhook_destination(
  Rulestead.Store.Command.FetchWebhookDestination.t() | String.t(),
  keyword()
) :: Rulestead.Store.result(map())

Fetches a single webhook destination by ID.

fetch_webhook_record(id_or_command, opts \\ [])

@spec fetch_webhook_record(
  String.t() | Rulestead.Store.Command.FetchWebhookRecord.t(),
  keyword()
) :: Rulestead.Store.result(map())

Fetches one webhook receipt through the configured store adapter.

get_value(flag_payload, context, default)

@spec get_value(map(), Rulestead.Context.t() | keyword() | map(), term()) ::
  {:ok, term()} | {:error, Rulestead.Error.t()}

Returns the projected value for an authored flag payload.

get_variant(flag_payload, context)

@spec get_variant(map(), Rulestead.Context.t() | keyword() | map()) ::
  {:ok, String.t() | nil} | {:error, Rulestead.Error.t()}

Returns the assigned variant key for an authored flag payload.

import_manifest(content, opts \\ [])

@spec import_manifest(
  binary() | map(),
  keyword()
) :: {:ok, map()} | {:error, Rulestead.Error.t()}

Previews a manifest import as a saved apply plan artifact.

infrastructure_health()

@spec infrastructure_health() :: map()

Returns the bounded infrastructure health snapshot for the local node.

list_audience_dependencies()

@spec list_audience_dependencies() :: Rulestead.Store.result(map())

Lists audience dependency inventory rows with deterministic scoped ordering.

list_audience_dependencies(opts)

@spec list_audience_dependencies(keyword()) :: Rulestead.Store.result(map())
@spec list_audience_dependencies(Rulestead.Store.Command.ListAudienceDependencies.t()) ::
  Rulestead.Store.result(map())

list_audiences()

@spec list_audiences() :: Rulestead.Store.result([map()])

Lists reusable audiences through the configured store adapter.

list_audiences(opts)

@spec list_audiences(keyword()) :: Rulestead.Store.result([map()])
@spec list_audiences(Rulestead.Store.Command.ListAudiences.t()) ::
  Rulestead.Store.result([map()])

list_audit_events(command_or_opts \\ Command.ListAuditEvents.new())

@spec list_audit_events(Rulestead.Store.Command.ListAuditEvents.t() | keyword()) ::
  Rulestead.Store.result(Rulestead.Store.Command.Page.t(map()))

Lists redacted audit events for one flag or all flags.

list_change_requests(command_or_opts \\ Command.ListChangeRequests.new())

@spec list_change_requests(Rulestead.Store.Command.ListChangeRequests.t() | keyword()) ::
  Rulestead.Store.result(Rulestead.Store.Command.Page.t(map()))

Lists change requests through the configured store adapter.

list_environments()

@spec list_environments() :: Rulestead.Store.result([map()])

Lists environments through the configured store adapter.

list_environments(opts)

@spec list_environments(keyword()) :: Rulestead.Store.result([map()])
@spec list_environments(Rulestead.Store.Command.ListEnvironments.t()) ::
  Rulestead.Store.result([map()])

list_flags()

@spec list_flags() :: Rulestead.Store.result(Rulestead.Store.Command.Page.t(map()))

Lists flags through the configured store adapter.

Phase 2 keeps this as the shared list/search surface for store adapters.

list_flags(opts)

@spec list_flags(keyword()) ::
  Rulestead.Store.result(Rulestead.Store.Command.Page.t(map()))
@spec list_flags(Rulestead.Store.Command.ListFlags.t()) ::
  Rulestead.Store.result(Rulestead.Store.Command.Page.t(map()))

list_flags!(command \\ Command.ListFlags.new())

@spec list_flags!(Rulestead.Store.Command.ListFlags.t() | keyword()) ::
  Rulestead.Store.Command.Page.t(map())

Bang variant of list_flags/0 and list_flags/1.

list_scheduled_executions(command_or_opts \\ Command.ListScheduledExecutions.new())

@spec list_scheduled_executions(
  Rulestead.Store.Command.ListScheduledExecutions.t()
  | keyword()
) ::
  Rulestead.Store.result(Rulestead.Store.Command.Page.t(map()))

Lists scheduled executions through the configured store adapter.

list_webhook_deliveries(command_or_opts \\ [])

@spec list_webhook_deliveries(
  Rulestead.Store.Command.ListWebhookDeliveries.t()
  | keyword()
) ::
  Rulestead.Store.result(Rulestead.Store.Command.Page.t(map()))

Lists webhook outbound deliveries.

list_webhook_destinations(command_or_opts \\ [])

@spec list_webhook_destinations(
  Rulestead.Store.Command.ListWebhookDestinations.t()
  | keyword()
) ::
  Rulestead.Store.result(Rulestead.Store.Command.Page.t(map()))

Lists webhook destinations.

list_webhook_records(command_or_opts \\ [])

@spec list_webhook_records(Rulestead.Store.Command.ListWebhookRecords.t() | keyword()) ::
  Rulestead.Store.result(Rulestead.Store.Command.Page.t(map()))

Lists webhook receipts through the configured store adapter.

plan_promotion(source_environment_key, target_environment_key, opts \\ [])

@spec plan_promotion(String.t() | atom(), String.t() | atom(), keyword()) ::
  {:ok, map()} | {:error, Rulestead.Error.t()}

Builds a saved promote plan artifact from a live compare preview.

preview_audience_impact(command)

@spec preview_audience_impact(Rulestead.Store.Command.PreviewAudienceImpact.t()) ::
  Rulestead.Store.result(map())

preview_audience_impact(audience_key, operation, opts \\ [])

@spec preview_audience_impact(String.t() | atom(), String.t() | atom(), keyword()) ::
  Rulestead.Store.result(map())

Previews the bounded impact of a reusable audience mutation.

publish_ruleset(command)

@spec publish_ruleset(Rulestead.Store.Command.PublishRuleset.t()) ::
  Rulestead.Store.result(map())

Publishes a ruleset version through the configured store adapter.

publish_ruleset!(command)

@spec publish_ruleset!(Rulestead.Store.Command.PublishRuleset.t()) :: map()

Bang variant of publish_ruleset/1.

receive_inbound_webhook(command)

@spec receive_inbound_webhook(Rulestead.Store.Command.ReceiveInboundWebhook.t()) ::
  Rulestead.Store.result(map())

Records an inbound webhook receipt through the configured store adapter.

record_evaluation(command)

@spec record_evaluation(Rulestead.Store.Command.RecordEvaluation.t()) ::
  Rulestead.Store.result(map())

Records bounded evaluation freshness for one flag/environment pair.

record_evaluation(flag_key, environment_key, last_evaluated_at)

@spec record_evaluation(String.t() | atom(), String.t() | atom(), DateTime.t()) ::
  Rulestead.Store.result(map())

Records bounded evaluation freshness using root-level arguments.

reject_change_request(command)

@spec reject_change_request(Rulestead.Store.Command.RejectChangeRequest.t()) ::
  Rulestead.Store.result(map())

Rejects a governed change request through the configured store adapter.

release_kill_switch(command)

@spec release_kill_switch(Rulestead.Store.Command.ReleaseKillSwitch.t()) ::
  Rulestead.Store.result(map())

Releases a per-flag per-environment kill switch.

release_kill_switch(flag_key, environment_key, actor, opts \\ [])

@spec release_kill_switch(String.t() | atom(), String.t() | atom(), map(), keyword()) ::
  Rulestead.Store.result(map())

requeue_scheduled_execution(command)

@spec requeue_scheduled_execution(
  Rulestead.Store.Command.RequeueScheduledExecution.t()
) ::
  Rulestead.Store.result(map())

Requeues a quarantined scheduled execution through the configured store adapter.

retry_webhook_delivery(id_or_command, opts \\ [])

@spec retry_webhook_delivery(
  Rulestead.Store.Command.RetryWebhookDelivery.t() | String.t(),
  keyword()
) :: Rulestead.Store.result(map())

Retries a failed webhook delivery.

rollback_audit_event(command)

@spec rollback_audit_event(Rulestead.Store.Command.RollbackAuditEvent.t()) ::
  Rulestead.Store.result(map())

Writes a linked inverse action for a prior audit event.

rollback_audit_event(audit_event_id, opts \\ [])

@spec rollback_audit_event(
  String.t(),
  keyword()
) :: Rulestead.Store.result(map())

save_draft_ruleset(command)

@spec save_draft_ruleset(Rulestead.Store.Command.SaveDraftRuleset.t()) ::
  Rulestead.Store.result(map())

Saves a draft ruleset through the configured store adapter.

save_draft_ruleset!(command)

@spec save_draft_ruleset!(Rulestead.Store.Command.SaveDraftRuleset.t()) :: map()

Bang variant of save_draft_ruleset/1.

schedule_change_request(command)

@spec schedule_change_request(Rulestead.Store.Command.ScheduleChangeRequest.t()) ::
  Rulestead.Store.result(map())

Schedules an approved governed change request through the configured store adapter.

schedule_governed_action(command)

@spec schedule_governed_action(Rulestead.Store.Command.ScheduleGovernedAction.t()) ::
  Rulestead.Store.result(map())

Schedules a narrowly allowed direct governed action through the configured store adapter.

simulate_flag(flag_key, environment_key, context, opts \\ [])

@spec simulate_flag(
  String.t() | atom(),
  String.t() | atom(),
  Rulestead.Context.t() | keyword() | map(),
  keyword()
) :: {:ok, map()} | {:error, Rulestead.Error.t()}

Admin-safe runtime simulation for one flag and environment.

submit_change_request(command)

@spec submit_change_request(Rulestead.Store.Command.SubmitChangeRequest.t()) ::
  Rulestead.Store.result(map())

Submits a governed change request through the configured store adapter.

track(context_or_actor_id, event_name, metadata \\ %{})

@spec track(Rulestead.Context.t() | map() | String.t(), String.t(), map()) :: :ok

Tracks a custom analytics event.

update_flag(command)

@spec update_flag(Rulestead.Store.Command.UpdateFlag.t()) ::
  Rulestead.Store.result(map())

Updates flag metadata through the configured store adapter.

update_flag(flag_key, attrs, opts \\ [])

@spec update_flag(String.t() | atom(), map() | keyword(), keyword()) ::
  Rulestead.Store.result(map())

Updates a flag from root-level attributes.

update_webhook_destination(command)

@spec update_webhook_destination(
  Rulestead.Store.Command.UpdateWebhookDestination.t()
  | {String.t(), map() | keyword()}
) :: Rulestead.Store.result(map())

Updates an existing webhook destination.

update_webhook_destination(id, attrs)

upsert_rollout_auto_advance_policy(command)

@spec upsert_rollout_auto_advance_policy(
  Rulestead.Store.Command.UpsertRolloutAutoAdvancePolicy.t()
) ::
  Rulestead.Store.result(map())

Upserts opt-in auto-advance policy for one staged rollout rule.

Phase 61 persists the authored policy contract only; enabling policy does not schedule observation ticks or advance rollout stages.

upsert_rollout_auto_advance_policy(flag_key, environment_key, attrs, opts \\ [])

@spec upsert_rollout_auto_advance_policy(
  String.t() | atom(),
  String.t() | atom(),
  map() | keyword(),
  keyword()
) :: Rulestead.Store.result(map())

Builds and upserts an auto-advance policy from root-level arguments.

version()

@spec version() :: String.t()

Returns the package version.