Synapse.Domains.CodeReview.Actions.DecideEscalation (Synapse v0.1.1)
View SourceDetermines whether a critic review should be escalated to a human reviewer or auto-approved.
The action inspects the critic's confidence score plus the should_escalate
flag emitted by Synapse.Actions.CriticReview. Callers can override the
escalation threshold per request.
Summary
Functions
Callback implementation for Jido.Action.on_after_run/1.
Callback implementation for Jido.Action.on_after_validate_output/1.
Callback implementation for Jido.Action.on_after_validate_params/1.
Callback implementation for Jido.Action.on_before_validate_output/1.
Callback implementation for Jido.Action.on_before_validate_params/1.
Callback implementation for Jido.Action.on_error/4.
Executes the Action with the given parameters and context.
Validates the output result for the Action.
Validates the input parameters for the Action.
Functions
Callback implementation for Jido.Action.on_after_run/1.
Callback implementation for Jido.Action.on_after_validate_output/1.
Callback implementation for Jido.Action.on_after_validate_params/1.
Callback implementation for Jido.Action.on_before_validate_output/1.
Callback implementation for Jido.Action.on_before_validate_params/1.
Callback implementation for Jido.Action.on_error/4.
Executes the Action with the given parameters and context.
The run/2 function must be implemented in the module using Jido.Action.
Validates the output result for the Action.
Examples
iex> defmodule ExampleAction do
...> use Jido.Action,
...> name: "example_action",
...> output_schema: [
...> result: [type: :string, required: true]
...> ]
...> end
...> ExampleAction.validate_output(%{result: "test", extra: "ignored"})
{:ok, %{result: "test", extra: "ignored"}}
iex> ExampleAction.validate_output(%{extra: "ignored"})
{:error, "Invalid output for Action: Required key :result not found"}
Validates the input parameters for the Action.
Examples
iex> defmodule ExampleAction do
...> use Jido.Action,
...> name: "example_action",
...> schema: [
...> input: [type: :string, required: true]
...> ]
...> end
...> ExampleAction.validate_params(%{input: "test"})
{:ok, %{input: "test"}}
iex> ExampleAction.validate_params(%{})
{:error, "Invalid parameters for Action: Required key :input not found"}