Synapse.Domains.CodeReview.Actions.ClassifyChange (Synapse v0.1.1)
View SourceClassifies a code review request to determine the appropriate review path.
Returns either :fast_path for small, low-risk changes or :deep_review
for changes requiring thorough specialist analysis.
Classification criteria:
- Files changed > 50: deep review
- Security or performance labels: deep review
- High risk factor (>= 0.5): deep review
- Hotfix intent: fast path (override)
- Default: fast path
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_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_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"}