Rulestead.Governance.BlastRadiusThreshold (rulestead v0.1.2)

Copy Markdown View Source

Pure blast-radius threshold evaluation for protected-environment audience mutations.

Default protected-environment limits (profile :default):

  • :update — direct apply when reference_count <= 2
  • :archive — direct apply only when reference_count == 0
  • Any indeterminate input — fail-closed (treated as apply-blocked in protected env)

Override thresholds via assess/2 opts (:threshold_profile, :protected_environment?). Host-level Rulestead.Config integration is intentionally deferred.

Summary

Functions

assess(attrs, opts \\ [])

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

validate_protected_apply(command, preview, opts \\ [])

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