---
title: "Prioritize tests with Weka"
description: "Score candidate tests against changed files, affected contracts, dependency paths, recent failures, and the cost of missing a regression."
slug: "models/weka/use-cases/prioritize-tests-with-weka"
sidebar:
  label: "Prioritize tests"
seo:
  canonical: "https://autohand.ai/use-cases/prioritize-tests-with-weka/"
---
Prioritize tests with Weka is a Weka typed-decision workflow that score candidate tests against changed files, affected contracts, dependency paths, recent failures, and the cost of missing a regression. It returns a bounded answer and probabilities so application code can keep final policy enforcement deterministic.

## At a glance

| Question | Answer |
| --- | --- |
| Best for | Choose the smallest useful test set for a change |
| Input | Minimal JSON state built from observable evidence |
| Weka returns | A ranked test plan with probabilities that CI can combine with mandatory suites. Available through the Weka API, Autohand SDK, and Console Playground. |
| Policy boundary | Your code owns thresholds, permissions, retries, audit logs, and the final action |

Weka can score candidate tests against a change so CI runs the most relevant checks early while preserving mandatory suites. Weka is in Public Preview and is available only through the Autohand API, SDK, and Console Playground.

## Build the candidate set in code

Use repository metadata, dependency graphs, ownership, historical failures, and changed paths to produce a bounded candidate list. Mark policy-required tests separately so no model answer can remove them.

## Score each candidate in one request

```json
{
  "model": "weka",
  "state": {
    "change": { "files": ["src/auth/session.ts"], "contracts": ["SessionCookie"] },
    "candidates": {
      "auth_unit": "tests/auth/session.test.ts",
      "login_e2e": "tests/e2e/login.spec.ts",
      "billing_e2e": "tests/e2e/billing.spec.ts"
    }
  },
  "questions": {
    "auth_unit_relevance": { "type": "score", "instructions": "How directly can this test detect a regression from the change?", "legend": ["none", "indirect", "useful", "required"] },
    "login_e2e_relevance": { "type": "score", "instructions": "How directly can this test detect a regression from the change?", "legend": ["none", "indirect", "useful", "required"] }
  }
}
```

## Run policy-required checks regardless

Use scores to order or add tests, not to bypass protected checks. This adapts the one-request reranking shape documented by [Turbo Rerank](https://github.com/dabit3/jev-experiments/tree/main/turbo-rerank) to SDLC evidence.

## Review before accepting

Measure missed regressions, time to first useful failure, full-suite completion, and confidence distribution on real changes. Do not claim build savings until a labeled replay supports them.

## Source and validation signals

Autohand AI maintains this page as first-party Weka product guidance. Verify the current request contract in the [Weka model guide](/models/weka) and build application flows with the [Autohand SDK](https://autohand.ai/code/sdk/). Community patterns from the [AY Automate Jev builds index](https://www.ayautomate.com/jev-builds) and [dabit3/jev-experiments](https://github.com/dabit3/jev-experiments) informed the use-case taxonomy. Their measurements describe their own Jev implementations and are not Weka benchmarks.

## Frequently asked questions

**What is Prioritize tests with Weka?**

Prioritize tests with Weka is a Weka typed-decision workflow that score candidate tests against changed files, affected contracts, dependency paths, recent failures, and the cost of missing a regression. It returns a bounded answer and probabilities so application code can keep final policy enforcement deterministic.

**When should a team use Prioritize tests with Weka?**

Choose the smallest useful test set for a change. Use it when the next software step needs one bounded decision and the application can preserve the evidence, probability, and policy outcome.

**What does Weka return for this workflow?**

A ranked test plan with probabilities that CI can combine with mandatory suites. Available through the Weka API, Autohand SDK, and Console Playground.

**Does Weka take the final action?**

No. Weka evaluates the state and returns a typed answer. Application code remains responsible for authorization, thresholds, deterministic safety rules, logging, retries, and the final action.

## Related resources

**[Guide: Weka model guide](/models/weka)**

Score bounded candidates and keep thresholds in code.

**[Playground: Console Playground](https://console.autohand.ai/playground/)**

Try candidate test relevance questions with example changes.

**[SDK: Autohand SDK](https://autohand.ai/code/sdk/)**

Collect change evidence and invoke test selection from an agent.

**[Pattern: Turbo Rerank](https://github.com/dabit3/jev-experiments/tree/main/turbo-rerank)**

A public example of scoring many candidates in one typed-decision request.

**[Samples: Weka samples on GitHub](https://github.com/autohandai/weka-samples)**

Run typed release, CI, patch, data, research, and Code Agent SDK examples.

## API request starter

```text
POST /v1/decisions with model "weka", change evidence and candidate tests, then score relevance and ask whether each test is required
```
