# JudgeScore

> 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.judgescore/
> Summary: JudgeScore: One named score produced by an IRunJudge.

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

One named score produced by an [IRunJudge](/api/tracon.irunjudge/).

```csharp
public sealed record JudgeScore : IEquatable<JudgeScore>
```

<dl class="api-relations"><dt>Inheritance</dt><dd><a href="https://learn.microsoft.com/dotnet/api/system.object">object</a> ← <a href="/api/tracon.judgescore/">JudgeScore</a></dd><dt>Implements</dt><dd><a href="https://learn.microsoft.com/dotnet/api/system.iequatable-1">IEquatable&lt;JudgeScore&gt;</a></dd><dt>Inherited Members</dt><dd><a href="https://learn.microsoft.com/dotnet/api/system.object.gettype">object.GetType()</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.tostring">object.ToString()</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object)">object.Equals(object?)</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object-system-object)">object.Equals(object?, object?)</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.referenceequals">object.ReferenceEquals(object?, object?)</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.gethashcode">object.GetHashCode()</a></dd></dl>

## Remarks

A judge returns a list of these, and Tracon writes each one as its own
[RunScore](/api/tracon.runscore/) row. [JudgeScore.Name](/api/tracon.judgescore/#Tracon_JudgeScore_Name) is part of the stored
uniqueness key, so two scores a judge returns for the same run must not
share a name; the second would overwrite the first.

A judge's **headline** score is the one whose
[JudgeScore.Name](/api/tracon.judgescore/#Tracon_JudgeScore_Name) equals [IRunJudge.Name](/api/tracon.irunjudge/#Tracon_IRunJudge_Name). Only the headline
score feeds the online-evaluation window (its average and the
`run.score.low` alarm) and the `tracon.judge.score`
histogram, because both are defined on the 0-100 quality scale. A score
under any other name is stored and readable, but it is never mixed into
that average — a judge that reports several metrics on several scales
would otherwise corrupt it.

A [null](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null) [JudgeScore.Value](/api/tracon.judgescore/#Tracon_JudgeScore_Value) records that the judge made
**no measurement**, which is not the same as a measurement of
zero. A judge that prefers to write nothing at all returns no
[JudgeScore](/api/tracon.judgescore/) for that metric instead.

## Constructors

### <a id="Tracon_JudgeScore__ctor"></a> JudgeScore\(\)

```csharp
public JudgeScore()
```

## Properties

### <a id="Tracon_JudgeScore_Comment"></a> Comment

The reason, written into [RunScore.Comment](/api/tracon.runscore/#Tracon_RunScore_Comment).

```csharp
public string? Comment { get; init; }
```

#### Property Value

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

Truncated to [RunJudgment.MaxReasonLength](/api/tracon.runjudgment/#Tracon_RunJudgment_MaxReasonLength) characters before it is stored.

### <a id="Tracon_JudgeScore_Kind"></a> Kind

The shape of the value.

```csharp
public required RunScoreKind Kind { get; init; }
```

#### Property Value

 [RunScoreKind](/api/tracon.runscorekind/)

### <a id="Tracon_JudgeScore_Name"></a> Name

The score's stable, low-cardinality name.

```csharp
public required string Name { get; init; }
```

#### Property Value

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

Must match `[A-Za-z0-9._-]{1,64}`; [RunScoreRules](/api/tracon.runscorerules/)
carries the rule. A judge that reports a single overall verdict uses its
own [IRunJudge.Name](/api/tracon.irunjudge/#Tracon_IRunJudge_Name) here.

### <a id="Tracon_JudgeScore_TextValue"></a> TextValue

The categorical value. Set only for a [RunScoreKind.Categorical](/api/tracon.runscorekind/) score.

```csharp
public string? TextValue { get; init; }
```

#### Property Value

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

At most [RunScoreRules.MaxTextValueLength](/api/tracon.runscorerules/#Tracon_RunScoreRules_MaxTextValueLength) characters.

### <a id="Tracon_JudgeScore_Value"></a> Value

The numeric value: 0/1 for [RunScoreKind.Binary](/api/tracon.runscorekind/), 1 to 5 for
[RunScoreKind.Stars](/api/tracon.runscorekind/), 0 to 100 for
[RunScoreKind.Numeric](/api/tracon.runscorekind/).

```csharp
public double? Value { get; init; }
```

#### Property Value

 [double](https://learn.microsoft.com/dotnet/api/system.double)?

#### Remarks

[null](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null) means no measurement was made, not zero. Always
[null](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null) when [JudgeScore.Kind](/api/tracon.judgescore/#Tracon_JudgeScore_Kind) is
[RunScoreKind.Categorical](/api/tracon.runscorekind/). A value outside its kind's range
is a contract violation: the score is not written and the judge is
reported as failed.

## Methods

### <a id="Tracon_JudgeScore_Equals_System_Object_"></a> Equals\(object?\)

```csharp
public override bool Equals(object? obj)
```

#### Parameters

`obj` [object](https://learn.microsoft.com/dotnet/api/system.object)?

#### Returns

 [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

### <a id="Tracon_JudgeScore_Equals_Tracon_JudgeScore_"></a> Equals\(JudgeScore?\)

```csharp
public bool Equals(JudgeScore? other)
```

#### Parameters

`other` [JudgeScore](/api/tracon.judgescore/)?

#### Returns

 [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

### <a id="Tracon_JudgeScore_GetHashCode"></a> GetHashCode\(\)

```csharp
public override int GetHashCode()
```

#### Returns

 [int](https://learn.microsoft.com/dotnet/api/system.int32)

### <a id="Tracon_JudgeScore_ToString"></a> ToString\(\)

```csharp
public override string ToString()
```

#### Returns

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

### <a id="Tracon_JudgeScore_op_Equality_Tracon_JudgeScore_Tracon_JudgeScore_"></a> operator ==\(JudgeScore?, JudgeScore?\)

```csharp
public static bool operator ==(JudgeScore? left, JudgeScore? right)
```

#### Parameters

`left` [JudgeScore](/api/tracon.judgescore/)?

`right` [JudgeScore](/api/tracon.judgescore/)?

#### Returns

 [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

### <a id="Tracon_JudgeScore_op_Inequality_Tracon_JudgeScore_Tracon_JudgeScore_"></a> operator \!=\(JudgeScore?, JudgeScore?\)

```csharp
public static bool operator !=(JudgeScore? left, JudgeScore? right)
```

#### Parameters

`left` [JudgeScore](/api/tracon.judgescore/)?

`right` [JudgeScore](/api/tracon.judgescore/)?

#### Returns

 [bool](https://learn.microsoft.com/dotnet/api/system.boolean)
