Class StepEvaluator
java.lang.Object
cloud.opencode.base.flow.internal.StepEvaluator
Evaluates whether a given
Step has reached its terminal state given
the current set of Tasks and VoteRecords in the repository.
基于当前 Task / VoteRecord 状态,判定给定 Step 是否
已达到终态(通过 / 驳回 / 仍在进行)。
Strategy semantics implemented (v4 §8.3):
APPROVE / sequential: every PENDING-or-DONE task must be DONE and every outcome must be APPROVED ⇒ APPROVED; any REJECTED ⇒ REJECTED.APPROVE / one_of_n: any APPROVED ⇒ APPROVED; all DONE with no APPROVED ⇒ REJECTED.VOTE / all: all DONE and all votes AGREE ⇒ APPROVED; any DISAGREE confirmed ⇒ REJECTED.VOTE / any: any AGREE ⇒ APPROVED; all DONE with no AGREE ⇒ REJECTED.VOTE / majority: all DONE then majority AGREE ⇒ APPROVED, else REJECTED.VOTE / veto: any DISAGREE ⇒ immediately REJECTED; otherwise follow majority when all DONE.
- Since:
- JDK 25, opencode-base-flow V1.0.5
- Author:
- Leon Soo
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumThree-valued evaluation result. -
Constructor Summary
ConstructorsConstructorDescriptionStepEvaluator(FlowRepository repo) Constructs an evaluator backed by the supplied repository. -
Method Summary
Modifier and TypeMethodDescriptionevaluate(FlowInstance instance, Step step) Evaluates the given step's current terminal state.
-
Constructor Details
-
StepEvaluator
Constructs an evaluator backed by the supplied repository. 通过给定仓储构造评估器。- Parameters:
repo- persistence facade — 持久化门面- Since:
- JDK 25, opencode-base-flow V1.0.5
-
-
Method Details
-
evaluate
Evaluates the given step's current terminal state. 评估给定节点当前终态。- Parameters:
instance- owning instance — 所属实例step- step to evaluate — 待评估节点- Returns:
StepEvaluator.StepEvaluation.PENDING/StepEvaluator.StepEvaluation.APPROVED/StepEvaluator.StepEvaluation.REJECTED— 评估结果- Since:
- JDK 25, opencode-base-flow V1.0.5
-