> ## Documentation Index
> Fetch the complete documentation index at: https://java.agentscope.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Choose team candidates for an explicit stage

`JevTeamPlanner` recommends authorized, available members for a task stage. Use it when planning, implementation and review belong to different members. Your scheduler owns task creation, dispatch and team state.

## Example: select a reviewer to verify a patch

A refund patch is ready to review against test evidence. The team has a code reviewer, a documentation writer and another reviewer who is offline. Selecting for general programming skill could miss that this is now an acceptance review.

The host first removes unavailable or unauthorized members and supplies the explicit `review` stage. JEV evaluates remaining roles for that stage without creating subtasks.

## 1. Supply member roles and host filters

```java theme={null}
import io.agentscope.extensions.judge.jev.application.JevTeamPlanner;
import java.util.List;
import java.util.Set;

var members = List.of(
    new JevTeamPlanner.Member("reviewer", "Code review and verification of test evidence"),
    new JevTeamPlanner.Member("writer", "Write user documentation"),
    new JevTeamPlanner.Member("offline-reviewer", "Code review and verification of test evidence"));
var availableAndAuthorized = Set.of("reviewer", "writer");
```

The example uses sets as a member directory. In production determine membership through authorization and health checks. Role descriptions guide semantic judgments but cannot replace access controls.

## 2. Request a recommendation for the current stage

```java theme={null}
var planner = new JevTeamPlanner(selector);
var pending = planner.recommend(ctx, "review",
    "Check whether the refund patch meets acceptance criteria", members,
    member -> availableAndAuthorized.contains(member.id()));
```

Configure `selector` as in [Candidate classification](https://java.agentscope.io/dev/en/docs/harness/jev/guides/application-api.md#initialize-the-components). Supply `stage` explicitly. After filtering, unique member IDs identify results. Check for DECIDED before reading `value().selected()` and `value().uncertain()`.

In SHADOW record the suggested reviewer and preserve existing dispatch. Even when adopting a suggestion, recheck authorization and availability before starting a member.

## Run and verify

Set `JEV_CP` using the [example build instructions](https://java.agentscope.io/dev/en/docs/harness/jev/guides/agent-integration-example.md#build-once-and-run-multiple-examples), then run:

```bash theme={null}
java -cp "$JEV_CP" io.agentscope.examples.jev.JevApplicationScenarios team
```

The example recommends `reviewer`, ignores `offline-reviewer` and creates zero tasks. This checks that host filtering precedes judgment and recommendations do not dispatch; it does not measure delivery quality. [JevApplicationScenarios source](https://java.agentscope.io/examples/jev/source/JevApplicationScenarios.java.txt)

## Relationship to model routing

Team planning chooses a member for a stage; [model routing](https://java.agentscope.io/dev/en/docs/harness/jev/guides/model-routing-api.md) chooses a model for a member's invocation. For sticky model selection within stages, use the [explicit stage API](https://java.agentscope.io/dev/en/docs/harness/jev/guides/phase-routing-api.md#explicit-stages).

The planner does not infer stage changes from tool output. On failure or uncertainty, retain the original assignment or ask for clarification. No recommendation is not a successful dispatch.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.