# EvalRunDiff

> 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.evalrundiff/
> Summary: EvalRunDiff: The case-by-case difference between two completed EvalRun records of the same suite.

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

The case-by-case difference between two completed [EvalRun](/api/tracon.evalrun/)
records of the same suite.

```csharp
public sealed record EvalRunDiff : IEquatable<EvalRunDiff>
```

<dl class="api-relations"><dt>Inheritance</dt><dd><a href="https://learn.microsoft.com/dotnet/api/system.object">object</a> ← <a href="/api/tracon.evalrundiff/">EvalRunDiff</a></dd><dt>Implements</dt><dd><a href="https://learn.microsoft.com/dotnet/api/system.iequatable-1">IEquatable&lt;EvalRunDiff&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 single "how many broke" number is not enough to act on: the engineer on
call wants to know *which* case broke. Every aligned case therefore
lands in exactly one [EvalCaseDiffKind](/api/tracon.evalcasediffkind/) bucket, and each entry
carries both sides' agent run identifier, so a regression is one click away
from the two conversations that produced it.

**Cases are aligned by [EvalCaseResult.CaseId](/api/tracon.evalcaseresult/#Tracon_EvalCaseResult_CaseId), and case
content is not snapshotted per run.** If a case's
[EvalCase.Query](/api/tracon.evalcase/#Tracon_EvalCase_Query) is edited between the two runs while its
identifier is kept, the two sides describe different questions and the diff
silently compares them as one. Through the HTTP surface this cannot happen
(`PUT /api/evals/{name}/cases` replaces cases and assigns fresh
identifiers, so an edit shows up as a [EvalCaseDiffKind.Removed](/api/tracon.evalcasediffkind/)
plus an [EvalCaseDiffKind.Added](/api/tracon.evalcasediffkind/) entry); it can only happen when
a consumer calls [IEvalStore.ReplaceCasesAsync](/api/tracon.ievalstore/#Tracon_IEvalStore_ReplaceCasesAsync_System_Guid_System_Collections_Generic_IReadOnlyList_Tracon_EvalCase__System_Threading_CancellationToken_) directly and
preserves identifiers. Nothing here detects that, and no guarantee is
offered against it.

The counters are for the whole diff and do **not** shrink with
paging; [EvalRunDiff.Cases](/api/tracon.evalrundiff/#Tracon_EvalRunDiff_Cases) is the requested page.

## Constructors

### <a id="Tracon_EvalRunDiff__ctor"></a> EvalRunDiff\(\)

```csharp
public EvalRunDiff()
```

## Properties

### <a id="Tracon_EvalRunDiff_AddedCount"></a> AddedCount

The number of cases present only in the candidate run.

```csharp
public required int AddedCount { get; init; }
```

#### Property Value

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

The run being compared against (the older, known-good side).

```csharp
public required EvalRun Baseline { get; init; }
```

#### Property Value

 [EvalRun](/api/tracon.evalrun/)

### <a id="Tracon_EvalRunDiff_Candidate"></a> Candidate

The run being judged.

```csharp
public required EvalRun Candidate { get; init; }
```

#### Property Value

 [EvalRun](/api/tracon.evalrun/)

### <a id="Tracon_EvalRunDiff_Cases"></a> Cases

The requested page of aligned cases, ordered so that the buckets an
engineer looks for come first: [EvalCaseDiffKind.Regressed](/api/tracon.evalcasediffkind/),
[EvalCaseDiffKind.StillFailing](/api/tracon.evalcasediffkind/),
[EvalCaseDiffKind.Added](/api/tracon.evalcasediffkind/), [EvalCaseDiffKind.Fixed](/api/tracon.evalcasediffkind/),
[EvalCaseDiffKind.Removed](/api/tracon.evalcasediffkind/), then
[EvalCaseDiffKind.Unchanged](/api/tracon.evalcasediffkind/); within a bucket by case
identifier.

```csharp
public required IReadOnlyList<EvalCaseDiff> Cases { get; init; }
```

#### Property Value

 [IReadOnlyList](https://learn.microsoft.com/dotnet/api/system.collections.generic.ireadonlylist\-1)<[EvalCaseDiff](/api/tracon.evalcasediff/)\>

### <a id="Tracon_EvalRunDiff_FixedCount"></a> FixedCount

The number of cases that failed on the baseline and pass now.

```csharp
public required int FixedCount { get; init; }
```

#### Property Value

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

The number of cases that passed on the baseline and fail now.

```csharp
public required int RegressedCount { get; init; }
```

#### Property Value

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

The number of cases present only in the baseline run.

```csharp
public required int RemovedCount { get; init; }
```

#### Property Value

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

The number of cases that failed on both sides.

```csharp
public required int StillFailingCount { get; init; }
```

#### Property Value

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

The number of aligned cases across both runs, ignoring paging.

```csharp
public required int TotalCases { get; init; }
```

#### Property Value

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

The number of cases that passed on both sides.

```csharp
public required int UnchangedCount { get; init; }
```

#### Property Value

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

### <a id="Tracon_EvalRunDiff_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_EvalRunDiff_Equals_Tracon_EvalRunDiff_"></a> Equals\(EvalRunDiff?\)

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

`other` [EvalRunDiff](/api/tracon.evalrundiff/)?

#### Returns

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

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

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

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

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

### <a id="Tracon_EvalRunDiff_op_Equality_Tracon_EvalRunDiff_Tracon_EvalRunDiff_"></a> operator ==\(EvalRunDiff?, EvalRunDiff?\)

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

`left` [EvalRunDiff](/api/tracon.evalrundiff/)?

`right` [EvalRunDiff](/api/tracon.evalrundiff/)?

#### Returns

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

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

`left` [EvalRunDiff](/api/tracon.evalrundiff/)?

`right` [EvalRunDiff](/api/tracon.evalrundiff/)?

#### Returns

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