# IRunJudge

> Tracon documentation. Tracon is a .NET package family that adds a control
> plane on Microsoft Agent Framework, published as NuGet packages that run
> inside your own ASP.NET Core application.
>
> Page: https://tracon.dev/api/tracon.irunjudge/
> Summary: IRunJudge: The extension point that scores a completed production run.

<div class="api-provenance">Namespace Tracon · Assembly <code>Tracon.Abstractions.dll</code></div>

The extension point that scores a completed production run.

```csharp
public interface IRunJudge
```

## Remarks

Implementations are singleton services. The same instance can receive
concurrent calls, so it must be thread-safe and must not keep per-run state
in instance fields.

A call can still be repeated for the same run: once when another judge
causes the whole job to retry (a judge that already wrote a score for this
run is not called again on that retry — only a judge that has not yet
scored the run runs), and always when a caller re-triggers manual scoring
via `POST /api/runs/{id}/judge`. Implementations must make side
effects idempotent. [IRunJudge.Name](/api/tracon.irunjudge/#Tracon_IRunJudge_Name) is a stable low-cardinality
identifier. It must match `[A-Za-z0-9._-]{1,64}` and is used in metric
tags and score fields.

The supplied cancellation token is the call budget. Do not throw an
[OperationCanceledException](https://learn.microsoft.com/dotnet/api/system.operationcanceledexception) for an implementation-owned timeout.
Tracon applies its own timeout to each call.

[RunJudgeContext.TenantId](/api/tracon.runjudgecontext/#Tracon_RunJudgeContext_TenantId) is authoritative. A judge that starts
a Tracon run must set its run kind to [RunKind.Eval](/api/tracon.runkind/). A
model-backed judge uses [IModelProviderRegistry.CreateSetupChatClientAsync](/api/tracon.imodelproviderregistry/#Tracon_IModelProviderRegistry_CreateSetupChatClientAsync_Tracon_ModelBinding_System_Threading_CancellationToken_).

## Properties

### <a id="Tracon_IRunJudge_Name"></a> Name

The stable judge name, written as `judge:{Name}` in score fields.

```csharp
string Name { get; }
```

#### Property Value

 [string](https://learn.microsoft.com/dotnet/api/system.string)

## Methods

### <a id="Tracon_IRunJudge_JudgeAsync_Tracon_RunJudgeContext_System_Threading_CancellationToken_"></a> JudgeAsync\(RunJudgeContext, CancellationToken\)

Scores the run.

```csharp
ValueTask<RunJudgment> JudgeAsync(RunJudgeContext context, CancellationToken cancellationToken = default)
```

#### Parameters

`context` [RunJudgeContext](/api/tracon.runjudgecontext/)

The context the judge sees.

`cancellationToken` [CancellationToken](https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken)

The cancellation token.

#### Returns

 [ValueTask](https://learn.microsoft.com/dotnet/api/system.threading.tasks.valuetask\-1)<[RunJudgment](/api/tracon.runjudgment/)\>

The judge's verdict.
