# RunStoreContract

> 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.testing.contracts.storage.runstorecontract/
> Summary: RunStoreContract: Behavior tests for the IRunStore contract.

<div class="api-provenance">Namespace Tracon.Testing.Contracts.Storage · Assembly <code>Tracon.Testing.Contracts.Xunit.dll</code></div>

Behavior tests for the [IRunStore](/api/tracon.irunstore/) contract.

```csharp
public abstract class RunStoreContract : TenantIsolationContract<IRunStore>, IAsyncLifetime, IAsyncDisposable
```

<dl class="api-relations"><dt>Inheritance</dt><dd><a href="https://learn.microsoft.com/dotnet/api/system.object">object</a> ← <a href="/api/tracon.testing.contracts.storage.storecancellationcontract-1/">StoreCancellationContract&lt;IRunStore&gt;</a> ← <a href="/api/tracon.testing.contracts.storage.tenantisolationcontract-1/">TenantIsolationContract&lt;IRunStore&gt;</a> ← <a href="/api/tracon.testing.contracts.storage.runstorecontract/">RunStoreContract</a></dd><dt>Implements</dt><dd>IAsyncLifetime, <a href="https://learn.microsoft.com/dotnet/api/system.iasyncdisposable">IAsyncDisposable</a></dd><dt>Inherited Members</dt><dd><a href="/api/tracon.testing.contracts.storage.tenantisolationcontract-1/#Tracon_Testing_Contracts_Storage_TenantIsolationContract_1_TenantA">TenantIsolationContract&lt;IRunStore&gt;.TenantA</a>, <a href="/api/tracon.testing.contracts.storage.tenantisolationcontract-1/#Tracon_Testing_Contracts_Storage_TenantIsolationContract_1_TenantB">TenantIsolationContract&lt;IRunStore&gt;.TenantB</a>, <a href="/api/tracon.testing.contracts.storage.tenantisolationcontract-1/#Tracon_Testing_Contracts_Storage_TenantIsolationContract_1_UseAmbientTenant_Tracon_Testing_Contracts_Storage_MutableTenantContext_">TenantIsolationContract&lt;IRunStore&gt;.UseAmbientTenant(MutableTenantContext)</a>, <a href="/api/tracon.testing.contracts.storage.tenantisolationcontract-1/#Tracon_Testing_Contracts_Storage_TenantIsolationContract_1_SeedAsync_System_String_System_String_System_Threading_CancellationToken_">TenantIsolationContract&lt;IRunStore&gt;.SeedAsync(string, string, CancellationToken)</a>, <a href="/api/tracon.testing.contracts.storage.tenantisolationcontract-1/#Tracon_Testing_Contracts_Storage_TenantIsolationContract_1_ExistsAsync_System_String_System_Object_">TenantIsolationContract&lt;IRunStore&gt;.ExistsAsync(string, object)</a>, <a href="/api/tracon.testing.contracts.storage.tenantisolationcontract-1/#Tracon_Testing_Contracts_Storage_TenantIsolationContract_1_CountAsync_System_String_System_Threading_CancellationToken_">TenantIsolationContract&lt;IRunStore&gt;.CountAsync(string, CancellationToken)</a>, <a href="/api/tracon.testing.contracts.storage.tenantisolationcontract-1/#Tracon_Testing_Contracts_Storage_TenantIsolationContract_1_TryDeleteAsync_System_String_System_Object_">TenantIsolationContract&lt;IRunStore&gt;.TryDeleteAsync(string, object)</a>, <a href="/api/tracon.testing.contracts.storage.tenantisolationcontract-1/#Tracon_Testing_Contracts_Storage_TenantIsolationContract_1_TryOverwriteAsync_System_String_System_String_">TenantIsolationContract&lt;IRunStore&gt;.TryOverwriteAsync(string, string)</a>, <a href="/api/tracon.testing.contracts.storage.tenantisolationcontract-1/#Tracon_Testing_Contracts_Storage_TenantIsolationContract_1_CancellableReadAsync_System_Threading_CancellationToken_">TenantIsolationContract&lt;IRunStore&gt;.CancellableReadAsync(CancellationToken)</a>, <a href="/api/tracon.testing.contracts.storage.tenantisolationcontract-1/#Tracon_Testing_Contracts_Storage_TenantIsolationContract_1_CancellableWriteAsync_System_Threading_CancellationToken_">TenantIsolationContract&lt;IRunStore&gt;.CancellableWriteAsync(CancellationToken)</a>, <a href="/api/tracon.testing.contracts.storage.tenantisolationcontract-1/#Tracon_Testing_Contracts_Storage_TenantIsolationContract_1_WroteAnythingAsync">TenantIsolationContract&lt;IRunStore&gt;.WroteAnythingAsync()</a>, <a href="/api/tracon.testing.contracts.storage.tenantisolationcontract-1/#Tracon_Testing_Contracts_Storage_TenantIsolationContract_1_Tenant_cannot_read_another_tenants_record">TenantIsolationContract&lt;IRunStore&gt;.Tenant_cannot_read_another_tenants_record()</a>, <a href="/api/tracon.testing.contracts.storage.tenantisolationcontract-1/#Tracon_Testing_Contracts_Storage_TenantIsolationContract_1_Tenant_reads_its_own_record">TenantIsolationContract&lt;IRunStore&gt;.Tenant_reads_its_own_record()</a>, <a href="/api/tracon.testing.contracts.storage.tenantisolationcontract-1/#Tracon_Testing_Contracts_Storage_TenantIsolationContract_1_Tenant_does_not_see_another_tenants_record_in_the_list">TenantIsolationContract&lt;IRunStore&gt;.Tenant_does_not_see_another_tenants_record_in_the_list()</a>, <a href="/api/tracon.testing.contracts.storage.tenantisolationcontract-1/#Tracon_Testing_Contracts_Storage_TenantIsolationContract_1_Tenant_cannot_delete_another_tenants_record">TenantIsolationContract&lt;IRunStore&gt;.Tenant_cannot_delete_another_tenants_record()</a>, <a href="/api/tracon.testing.contracts.storage.tenantisolationcontract-1/#Tracon_Testing_Contracts_Storage_TenantIsolationContract_1_Same_name_lives_independently_across_two_tenants">TenantIsolationContract&lt;IRunStore&gt;.Same_name_lives_independently_across_two_tenants()</a>, <a href="/api/tracon.testing.contracts.storage.tenantisolationcontract-1/#Tracon_Testing_Contracts_Storage_TenantIsolationContract_1_AmbientTenant">TenantIsolationContract&lt;IRunStore&gt;.AmbientTenant</a>, <a href="/api/tracon.testing.contracts.storage.storecancellationcontract-1/#Tracon_Testing_Contracts_Storage_StoreCancellationContract_1_CreateStoreAsync">StoreCancellationContract&lt;IRunStore&gt;.CreateStoreAsync()</a>, <a href="/api/tracon.testing.contracts.storage.storecancellationcontract-1/#Tracon_Testing_Contracts_Storage_StoreCancellationContract_1_InitializeAsync">StoreCancellationContract&lt;IRunStore&gt;.InitializeAsync()</a>, <a href="/api/tracon.testing.contracts.storage.storecancellationcontract-1/#Tracon_Testing_Contracts_Storage_StoreCancellationContract_1_DisposeAsync">StoreCancellationContract&lt;IRunStore&gt;.DisposeAsync()</a>, <a href="/api/tracon.testing.contracts.storage.storecancellationcontract-1/#Tracon_Testing_Contracts_Storage_StoreCancellationContract_1_OnDisposeAsync">StoreCancellationContract&lt;IRunStore&gt;.OnDisposeAsync()</a>, <a href="/api/tracon.testing.contracts.storage.storecancellationcontract-1/#Tracon_Testing_Contracts_Storage_StoreCancellationContract_1_CancellableReadAsync_System_Threading_CancellationToken_">StoreCancellationContract&lt;IRunStore&gt;.CancellableReadAsync(CancellationToken)</a>, <a href="/api/tracon.testing.contracts.storage.storecancellationcontract-1/#Tracon_Testing_Contracts_Storage_StoreCancellationContract_1_CancellableWriteAsync_System_Threading_CancellationToken_">StoreCancellationContract&lt;IRunStore&gt;.CancellableWriteAsync(CancellationToken)</a>, <a href="/api/tracon.testing.contracts.storage.storecancellationcontract-1/#Tracon_Testing_Contracts_Storage_StoreCancellationContract_1_WroteAnythingAsync">StoreCancellationContract&lt;IRunStore&gt;.WroteAnythingAsync()</a>, <a href="/api/tracon.testing.contracts.storage.storecancellationcontract-1/#Tracon_Testing_Contracts_Storage_StoreCancellationContract_1_Canceled_token_throws_on_read">StoreCancellationContract&lt;IRunStore&gt;.Canceled_token_throws_on_read()</a>, <a href="/api/tracon.testing.contracts.storage.storecancellationcontract-1/#Tracon_Testing_Contracts_Storage_StoreCancellationContract_1_The_write_this_contract_checks_can_be_read_back">StoreCancellationContract&lt;IRunStore&gt;.The_write_this_contract_checks_can_be_read_back()</a>, <a href="/api/tracon.testing.contracts.storage.storecancellationcontract-1/#Tracon_Testing_Contracts_Storage_StoreCancellationContract_1_Canceled_token_throws_on_write_and_leaves_no_trace">StoreCancellationContract&lt;IRunStore&gt;.Canceled_token_throws_on_write_and_leaves_no_trace()</a>, <a href="/api/tracon.testing.contracts.storage.storecancellationcontract-1/#Tracon_Testing_Contracts_Storage_StoreCancellationContract_1_Store">StoreCancellationContract&lt;IRunStore&gt;.Store</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.gettype">object.GetType()</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone">object.MemberwiseClone()</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

The in-memory store and the PostgreSQL store must pass the same scenarios.

## Constructors

### <a id="Tracon_Testing_Contracts_Storage_RunStoreContract__ctor"></a> RunStoreContract\(\)

```csharp
protected RunStoreContract()
```

## Methods

### <a id="Tracon_Testing_Contracts_Storage_RunStoreContract_A_label_key_without_a_value_matches_any_value_of_that_key"></a> A\_label\_key\_without\_a\_value\_matches\_any\_value\_of\_that\_key\(\)

```csharp
[Fact]
public Task A_label_key_without_a_value_matches_any_value_of_that_key()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunStoreContract_A_queued_workflow_row_keeps_its_workflow_session_and_attribution_when_it_starts"></a> A\_queued\_workflow\_row\_keeps\_its\_workflow\_session\_and\_attribution\_when\_it\_starts\(\)

A queued workflow row keeps what it was queued with when the engine starts
the same run.

```csharp
[Fact]
public Task A_queued_workflow_row_keeps_its_workflow_session_and_attribution_when_it_starts()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

#### Remarks

The HTTP layer writes the queued row, where the caller is known; the
workflow engine writes it again in a background worker, where the caller
is not. The row must still name the workflow, its session and the caller.

### <a id="Tracon_Testing_Contracts_Storage_RunStoreContract_A_run_promoted_from_Queued_to_Running_keeps_the_heartbeat_it_sent_while_it_waited"></a> A\_run\_promoted\_from\_Queued\_to\_Running\_keeps\_the\_heartbeat\_it\_sent\_while\_it\_waited\(\)

```csharp
[Fact]
public Task A_run_promoted_from_Queued_to_Running_keeps_the_heartbeat_it_sent_while_it_waited()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunStoreContract_A_run_that_reports_only_a_cache_count_still_produces_a_usage_record"></a> A\_run\_that\_reports\_only\_a\_cache\_count\_still\_produces\_a\_usage\_record\(\)

```csharp
[Fact]
public Task A_run_that_reports_only_a_cache_count_still_produces_a_usage_record()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunStoreContract_A_run_without_attribution_reads_back_as_null_not_as_an_empty_map"></a> A\_run\_without\_attribution\_reads\_back\_as\_null\_not\_as\_an\_empty\_map\(\)

```csharp
[Fact]
public Task A_run_without_attribution_reads_back_as_null_not_as_an_empty_map()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunStoreContract_A_second_start_without_a_continuation_link_keeps_the_first_one"></a> A\_second\_start\_without\_a\_continuation\_link\_keeps\_the\_first\_one\(\)

The continuation link survives the second start of the same run, like the
attribution does.

```csharp
[Fact]
public Task A_second_start_without_a_continuation_link_keeps_the_first_one()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

#### Remarks

Workflow recovery writes the continuation's row first, with the link, and
the workflow engine then starts the same run again without knowing the
link. A plain overwrite erased the chain, and the run that continued the
work no longer pointed at the run it continued.

### <a id="Tracon_Testing_Contracts_Storage_RunStoreContract_A_second_start_without_attribution_does_not_erase_the_first_one"></a> A\_second\_start\_without\_attribution\_does\_not\_erase\_the\_first\_one\(\)

```csharp
[Fact]
public Task A_second_start_without_attribution_does_not_erase_the_first_one()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunStoreContract_A_tree_in_which_only_a_child_reported_still_has_a_tree_total"></a> A\_tree\_in\_which\_only\_a\_child\_reported\_still\_has\_a\_tree\_total\(\)

```csharp
[Fact]
public Task A_tree_in_which_only_a_child_reported_still_has_a_tree_total()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunStoreContract_An_unknown_run_has_no_last_event_sequence"></a> An\_unknown\_run\_has\_no\_last\_event\_sequence\(\)

```csharp
[Fact]
public Task An_unknown_run_has_no_last_event_sequence()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunStoreContract_AppendEventAsync_does_not_write_with_the_wrong_expected_tenant"></a> AppendEventAsync\_does\_not\_write\_with\_the\_wrong\_expected\_tenant\(\)

```csharp
[Fact]
public Task AppendEventAsync_does_not_write_with_the_wrong_expected_tenant()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunStoreContract_Applied_unit_prices_round_trip_and_do_not_enter_the_total"></a> Applied\_unit\_prices\_round\_trip\_and\_do\_not\_enter\_the\_total\(\)

```csharp
[Fact]
public Task Applied_unit_prices_round_trip_and_do_not_enter_the_total()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunStoreContract_Attribution_round_trips"></a> Attribution\_round\_trips\(\)

```csharp
[Fact]
public Task Attribution_round_trips()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunStoreContract_Canceled_token_throws_on_the_first_step_of_the_event_stream"></a> Canceled\_token\_throws\_on\_the\_first\_step\_of\_the\_event\_stream\(\)

```csharp
[Fact]
public Task Canceled_token_throws_on_the_first_step_of_the_event_stream()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunStoreContract_ClaimOrphanedRunsAsync_closes_a_Queued_row_whose_heartbeat_is_stale"></a> ClaimOrphanedRunsAsync\_closes\_a\_Queued\_row\_whose\_heartbeat\_is\_stale\(\)

```csharp
[Fact]
public Task ClaimOrphanedRunsAsync_closes_a_Queued_row_whose_heartbeat_is_stale()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunStoreContract_ClaimOrphanedRunsAsync_does_not_touch_a_Queued_row_with_a_fresh_heartbeat"></a> ClaimOrphanedRunsAsync\_does\_not\_touch\_a\_Queued\_row\_with\_a\_fresh\_heartbeat\(\)

```csharp
[Fact]
public Task ClaimOrphanedRunsAsync_does_not_touch_a_Queued_row_with_a_fresh_heartbeat()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunStoreContract_ClaimOrphanedRunsAsync_does_not_touch_a_Running_row_within_the_threshold"></a> ClaimOrphanedRunsAsync\_does\_not\_touch\_a\_Running\_row\_within\_the\_threshold\(\)

```csharp
[Fact]
public Task ClaimOrphanedRunsAsync_does_not_touch_a_Running_row_within_the_threshold()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunStoreContract_ClaimOrphanedRunsAsync_marks_a_stale_Running_row_as_Failed"></a> ClaimOrphanedRunsAsync\_marks\_a\_stale\_Running\_row\_as\_Failed\(\)

```csharp
[Fact]
public Task ClaimOrphanedRunsAsync_marks_a_stale_Running_row_as_Failed()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunStoreContract_ClaimOrphanedRunsAsync_never_touches_a_Queued_row_that_has_no_heartbeat"></a> ClaimOrphanedRunsAsync\_never\_touches\_a\_Queued\_row\_that\_has\_no\_heartbeat\(\)

```csharp
[Fact]
public Task ClaimOrphanedRunsAsync_never_touches_a_Queued_row_that_has_no_heartbeat()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunStoreContract_ClaimOrphanedRunsAsync_reports_ContinuedFromRunId_on_the_claimed_record"></a> ClaimOrphanedRunsAsync\_reports\_ContinuedFromRunId\_on\_the\_claimed\_record\(\)

```csharp
[Fact]
public Task ClaimOrphanedRunsAsync_reports_ContinuedFromRunId_on_the_claimed_record()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunStoreContract_ClaimOrphanedRunsAsync_reports_the_kind_and_the_tree_position_on_the_claimed_record"></a> ClaimOrphanedRunsAsync\_reports\_the\_kind\_and\_the\_tree\_position\_on\_the\_claimed\_record\(\)

```csharp
[Fact]
public Task ClaimOrphanedRunsAsync_reports_the_kind_and_the_tree_position_on_the_claimed_record()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunStoreContract_CompleteRunAsync_does_not_close_with_the_wrong_expected_tenant"></a> CompleteRunAsync\_does\_not\_close\_with\_the\_wrong\_expected\_tenant\(\)

```csharp
[Fact]
public Task CompleteRunAsync_does_not_close_with_the_wrong_expected_tenant()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunStoreContract_Completion_leaves_the_model_id_unchanged_when_no_override_is_given"></a> Completion\_leaves\_the\_model\_id\_unchanged\_when\_no\_override\_is\_given\(\)

```csharp
[Fact]
public Task Completion_leaves_the_model_id_unchanged_when_no_override_is_given()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunStoreContract_Completion_leaves_the_model_provider_unchanged_when_no_override_is_given"></a> Completion\_leaves\_the\_model\_provider\_unchanged\_when\_no\_override\_is\_given\(\)

```csharp
[Fact]
public Task Completion_leaves_the_model_provider_unchanged_when_no_override_is_given()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunStoreContract_Completion_overrides_the_model_id_when_a_fallback_answered"></a> Completion\_overrides\_the\_model\_id\_when\_a\_fallback\_answered\(\)

```csharp
[Fact]
public Task Completion_overrides_the_model_id_when_a_fallback_answered()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunStoreContract_Completion_overrides_the_model_provider_when_a_fallback_answered"></a> Completion\_overrides\_the\_model\_provider\_when\_a\_fallback\_answered\(\)

```csharp
[Fact]
public Task Completion_overrides_the_model_provider_when_a_fallback_answered()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunStoreContract_Completion_stores_error_class_and_fingerprint"></a> Completion\_stores\_error\_class\_and\_fingerprint\(\)

```csharp
[Fact]
public Task Completion_stores_error_class_and_fingerprint()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunStoreContract_Completion_updates_the_summary"></a> Completion\_updates\_the\_summary\(\)

```csharp
[Fact]
public Task Completion_updates_the_summary()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunStoreContract_ContinuedFromRunId_round_trips"></a> ContinuedFromRunId\_round\_trips\(\)

```csharp
[Fact]
public Task ContinuedFromRunId_round_trips()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunStoreContract_Cost_does_not_exist_at_all_when_model_is_unknown"></a> Cost\_does\_not\_exist\_at\_all\_when\_model\_is\_unknown\(\)

```csharp
[Fact]
public Task Cost_does_not_exist_at_all_when_model_is_unknown()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunStoreContract_Cost_fields_are_null_but_source_is_written_as_unknown_when_pricing_is_undefined"></a> Cost\_fields\_are\_null\_but\_source\_is\_written\_as\_unknown\_when\_pricing\_is\_undefined\(\)

```csharp
[Fact]
public Task Cost_fields_are_null_but_source_is_written_as_unknown_when_pricing_is_undefined()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunStoreContract_Cost_is_written_and_read_back"></a> Cost\_is\_written\_and\_read\_back\(\)

```csharp
[Fact]
public Task Cost_is_written_and_read_back()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunStoreContract_Cost_recalculation_updates_the_target_row"></a> Cost\_recalculation\_updates\_the\_target\_row\(\)

```csharp
[Fact]
public Task Cost_recalculation_updates_the_target_row()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunStoreContract_CountAsync_System_String_System_Threading_CancellationToken_"></a> CountAsync\(string, CancellationToken\)

Reports how many records the given tenant sees through the listing endpoint.

```csharp
protected override ValueTask<int> CountAsync(string tenantId, CancellationToken cancellationToken)
```

#### Parameters

`tenantId` [string](https://learn.microsoft.com/dotnet/api/system.string)

The reading tenant.

`cancellationToken` [CancellationToken](https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken)

The token every store call inside the hook must be handed; see
[TenantIsolationContract.SeedAsync](/api/tracon.testing.contracts.storage/).

#### Returns

 [ValueTask](https://learn.microsoft.com/dotnet/api/system.threading.tasks.valuetask\-1)<[int](https://learn.microsoft.com/dotnet/api/system.int32)\>

The number of records seen.

### <a id="Tracon_Testing_Contracts_Storage_RunStoreContract_CreateScoreStoreAsync"></a> CreateScoreStoreAsync\(\)

The score store that writes into the SAME backend as `Store`.

```csharp
protected virtual ValueTask<IRunScoreStore?> CreateScoreStoreAsync()
```

#### Returns

 [ValueTask](https://learn.microsoft.com/dotnet/api/system.threading.tasks.valuetask\-1)<[IRunScoreStore](/api/tracon.irunscorestore/)?\>

The score store, or [null](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null) when the fixture has none.

#### Remarks

[IRunStore.GetExperimentResultsAsync](/api/tracon.irunstore/#Tracon_IRunStore_GetExperimentResultsAsync_Tracon_ExperimentResultsQuery_System_Threading_CancellationToken_) averages the
`run_scores` rows belonging to each run, but scores are written
through a DIFFERENT interface. A fixture that cannot hand back a score
store pointing at the same backend skips the scenarios that need one;
every store in this repository overrides this.

Virtual and not abstract on purpose: this contract ships, and turning
an existing contract class abstract would break every third-party
store that already derives from it.

### <a id="Tracon_Testing_Contracts_Storage_RunStoreContract_Custom_event_custom_type_round_trips_and_stays_null_for_every_other_type"></a> Custom\_event\_custom\_type\_round\_trips\_and\_stays\_null\_for\_every\_other\_type\(\)

```csharp
[Fact]
public Task Custom_event_custom_type_round_trips_and_stays_null_for_every_other_type()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunStoreContract_Empty_store_summary_returns_zero"></a> Empty\_store\_summary\_returns\_zero\(\)

```csharp
[Fact]
public Task Empty_store_summary_returns_zero()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunStoreContract_Event_cannot_be_appended_to_a_nonexistent_run"></a> Event\_cannot\_be\_appended\_to\_a\_nonexistent\_run\(\)

```csharp
[Fact]
public Task Event_cannot_be_appended_to_a_nonexistent_run()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunStoreContract_Event_fields_round_trip"></a> Event\_fields\_round\_trip\(\)

```csharp
[Fact]
public Task Event_fields_round_trip()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunStoreContract_Events_are_read_in_sequence_order"></a> Events\_are\_read\_in\_sequence\_order\(\)

```csharp
[Fact]
public Task Events_are_read_in_sequence_order()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunStoreContract_Every_cost_total_includes_the_cache_charge"></a> Every\_cost\_total\_includes\_the\_cache\_charge\(\)

```csharp
[Fact]
public Task Every_cost_total_includes_the_cache_charge()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunStoreContract_ExistsAsync_System_String_System_Object_"></a> ExistsAsync\(string, object\)

Reports whether the record is visible from the given tenant's viewpoint.

```csharp
protected override ValueTask<bool> ExistsAsync(string tenantId, object key)
```

#### Parameters

`tenantId` [string](https://learn.microsoft.com/dotnet/api/system.string)

The reading tenant.

`key` [object](https://learn.microsoft.com/dotnet/api/system.object)

The key returned by [TenantIsolationContract.SeedAsync](/api/tracon.testing.contracts.storage/).

#### Returns

 [ValueTask](https://learn.microsoft.com/dotnet/api/system.threading.tasks.valuetask\-1)<[bool](https://learn.microsoft.com/dotnet/api/system.boolean)\>

[true](https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool) if the record is visible.

### <a id="Tracon_Testing_Contracts_Storage_RunStoreContract_Experiment_results_are_summarized_per_arm"></a> Experiment\_results\_are\_summarized\_per\_arm\(\)

```csharp
[Fact]
public Task Experiment_results_are_summarized_per_arm()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunStoreContract_Experiment_results_average_a_run_level_score_written_with_an_empty_message_id"></a> Experiment\_results\_average\_a\_run\_level\_score\_written\_with\_an\_empty\_message\_id\(\)

```csharp
[Fact]
public Task Experiment_results_average_a_run_level_score_written_with_an_empty_message_id()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunStoreContract_Experiment_results_include_cost"></a> Experiment\_results\_include\_cost\(\)

```csharp
[Fact]
public Task Experiment_results_include_cost()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunStoreContract_Experiment_results_leave_a_message_level_score_out_of_the_average"></a> Experiment\_results\_leave\_a\_message\_level\_score\_out\_of\_the\_average\(\)

```csharp
[Fact]
public Task Experiment_results_leave_a_message_level_score_out_of_the_average()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunStoreContract_Experiment_results_return_empty_for_an_experiment_with_no_traffic"></a> Experiment\_results\_return\_empty\_for\_an\_experiment\_with\_no\_traffic\(\)

```csharp
[Fact]
public Task Experiment_results_return_empty_for_an_experiment_with_no_traffic()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunStoreContract_Items_that_carried_no_amount_keep_their_count_and_a_null_amount"></a> Items\_that\_carried\_no\_amount\_keep\_their\_count\_and\_a\_null\_amount\(\)

```csharp
[Fact]
public Task Items_that_carried_no_amount_keep_their_count_and_a_null_amount()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunStoreContract_List_returns_only_root_runs_by_default"></a> List\_returns\_only\_root\_runs\_by\_default\(\)

```csharp
[Fact]
public Task List_returns_only_root_runs_by_default()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunStoreContract_No_cost_total_adds_amounts_in_two_currencies"></a> No\_cost\_total\_adds\_amounts\_in\_two\_currencies\(\)

```csharp
[Fact]
public Task No_cost_total_adds_amounts_in_two_currencies()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunStoreContract_Non_token_cost_is_a_total_of_its_own_and_never_a_term_of_the_token_cost"></a> Non\_token\_cost\_is\_a\_total\_of\_its\_own\_and\_never\_a\_term\_of\_the\_token\_cost\(\)

```csharp
[Fact]
public Task Non_token_cost_is_a_total_of_its_own_and_never_a_term_of_the_token_cost()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunStoreContract_Non_token_cost_snapshot_round_trips_and_a_run_that_reported_nothing_has_none"></a> Non\_token\_cost\_snapshot\_round\_trips\_and\_a\_run\_that\_reported\_nothing\_has\_none\(\)

```csharp
[Fact]
public Task Non_token_cost_snapshot_round_trips_and_a_run_that_reported_nothing_has_none()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunStoreContract_Nonexistent_run_cannot_be_completed"></a> Nonexistent\_run\_cannot\_be\_completed\(\)

```csharp
[Fact]
public Task Nonexistent_run_cannot_be_completed()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunStoreContract_Nonexistent_run_returns_empty_events"></a> Nonexistent\_run\_returns\_empty\_events\(\)

```csharp
[Fact]
public Task Nonexistent_run_returns_empty_events()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunStoreContract_Nonexistent_run_returns_null"></a> Nonexistent\_run\_returns\_null\(\)

```csharp
[Fact]
public Task Nonexistent_run_returns_null()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunStoreContract_Parent_filter_overrides_root_filter"></a> Parent\_filter\_overrides\_root\_filter\(\)

```csharp
[Fact]
public Task Parent_filter_overrides_root_filter()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunStoreContract_Query_applies_paging"></a> Query\_applies\_paging\(\)

```csharp
[Fact]
public Task Query_applies_paging()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunStoreContract_Query_by_continuation_does_not_return_another_tenants_run"></a> Query\_by\_continuation\_does\_not\_return\_another\_tenants\_run\(\)

The forward walk does not cross a tenant boundary.

```csharp
[Fact]
public Task Query_by_continuation_does_not_return_another_tenants_run()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunStoreContract_Query_filters_by_a_label_key_and_value_together"></a> Query\_filters\_by\_a\_label\_key\_and\_value\_together\(\)

```csharp
[Fact]
public Task Query_filters_by_a_label_key_and_value_together()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunStoreContract_Query_filters_by_agent_name"></a> Query\_filters\_by\_agent\_name\(\)

```csharp
[Fact]
public Task Query_filters_by_agent_name()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunStoreContract_Query_filters_by_error_type"></a> Query\_filters\_by\_error\_type\(\)

```csharp
[Fact]
public Task Query_filters_by_error_type()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunStoreContract_Query_filters_by_start_time"></a> Query\_filters\_by\_start\_time\(\)

```csharp
[Fact]
public Task Query_filters_by_start_time()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunStoreContract_Query_filters_by_status"></a> Query\_filters\_by\_status\(\)

```csharp
[Fact]
public Task Query_filters_by_status()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunStoreContract_Query_filters_by_the_run_a_continuation_continues"></a> Query\_filters\_by\_the\_run\_a\_continuation\_continues\(\)

A chain is walked forward by asking for the runs that continue a given run.

```csharp
[Fact]
public Task Query_filters_by_the_run_a_continuation_continues()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunStoreContract_Query_filters_by_user"></a> Query\_filters\_by\_user\(\)

```csharp
[Fact]
public Task Query_filters_by_user()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunStoreContract_Query_session_filter_with_includeChildren_also_returns_child_runs"></a> Query\_session\_filter\_with\_includeChildren\_also\_returns\_child\_runs\(\)

```csharp
[Fact]
public Task Query_session_filter_with_includeChildren_also_returns_child_runs()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunStoreContract_Query_sorts_newest_first"></a> Query\_sorts\_newest\_first\(\)

```csharp
[Fact]
public Task Query_sorts_newest_first()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunStoreContract_RecordToolInvocationAsync_does_not_write_with_the_wrong_expected_tenant"></a> RecordToolInvocationAsync\_does\_not\_write\_with\_the\_wrong\_expected\_tenant\(\)

```csharp
[Fact]
public Task RecordToolInvocationAsync_does_not_write_with_the_wrong_expected_tenant()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunStoreContract_Reusing_a_sequence_number_is_rejected"></a> Reusing\_a\_sequence\_number\_is\_rejected\(\)

```csharp
[Fact]
public Task Reusing_a_sequence_number_is_rejected()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunStoreContract_Run_record_is_stamped_with_the_current_tenant"></a> Run\_record\_is\_stamped\_with\_the\_current\_tenant\(\)

```csharp
[Fact]
public Task Run_record_is_stamped_with_the_current_tenant()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunStoreContract_SeedAsync_System_String_System_String_System_Threading_CancellationToken_"></a> SeedAsync\(string, string, CancellationToken\)

Writes a sample record for the given tenant.

```csharp
protected override ValueTask<object> SeedAsync(string tenantId, string name, CancellationToken cancellationToken)
```

#### Parameters

`tenantId` [string](https://learn.microsoft.com/dotnet/api/system.string)

The tenant that owns the record.

`name` [string](https://learn.microsoft.com/dotnet/api/system.string)

The name distinguishing the record. The same name may be used by two tenants.

`cancellationToken` [CancellationToken](https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken)

The token every store call inside the hook must be handed. The
cancellation contract calls this hook with a token that is already
cancelled, so a hook that drops the token reports a store as sound
when it is not.

#### Returns

 [ValueTask](https://learn.microsoft.com/dotnet/api/system.threading.tasks.valuetask\-1)<[object](https://learn.microsoft.com/dotnet/api/system.object)\>

The key to use for reading the record back.

#### Remarks

The tenant is not a parameter on the interface; it is read from
[ITenantContext](/api/tracon.itenantcontext/). Each hook therefore sets the current tenant first.

### <a id="Tracon_Testing_Contracts_Storage_RunStoreContract_StartRunAsync_return_value_carries_the_coalesced_attribution"></a> StartRunAsync\_return\_value\_carries\_the\_coalesced\_attribution\(\)

```csharp
[Fact]
public Task StartRunAsync_return_value_carries_the_coalesced_attribution()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunStoreContract_StartRunAsync_upserts_when_called_twice_with_the_same_id"></a> StartRunAsync\_upserts\_when\_called\_twice\_with\_the\_same\_id\(\)

```csharp
[Fact]
public Task StartRunAsync_upserts_when_called_twice_with_the_same_id()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunStoreContract_Statistics_break_down_by_label_and_the_rows_do_not_partition_the_runs"></a> Statistics\_break\_down\_by\_label\_and\_the\_rows\_do\_not\_partition\_the\_runs\(\)

```csharp
[Fact]
public Task Statistics_break_down_by_label_and_the_rows_do_not_partition_the_runs()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunStoreContract_Statistics_break_down_by_user"></a> Statistics\_break\_down\_by\_user\(\)

```csharp
[Fact]
public Task Statistics_break_down_by_user()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunStoreContract_Statistics_narrow_to_one_label_when_asked"></a> Statistics\_narrow\_to\_one\_label\_when\_asked\(\)

```csharp
[Fact]
public Task Statistics_narrow_to_one_label_when_asked()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunStoreContract_Statistics_narrow_to_one_user_when_asked"></a> Statistics\_narrow\_to\_one\_user\_when\_asked\(\)

```csharp
[Fact]
public Task Statistics_narrow_to_one_user_when_asked()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunStoreContract_Statistics_total_the_token_breakdown_beside_the_input_and_output_totals"></a> Statistics\_total\_the\_token\_breakdown\_beside\_the\_input\_and\_output\_totals\(\)

```csharp
[Fact]
public Task Statistics_total_the_token_breakdown_beside_the_input_and_output_totals()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunStoreContract_Summary_aggregates_cost_and_reports_the_undefined_count"></a> Summary\_aggregates\_cost\_and\_reports\_the\_undefined\_count\(\)

```csharp
[Fact]
public Task Summary_aggregates_cost_and_reports_the_undefined_count()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunStoreContract_Summary_aggregates_statuses_and_tokens"></a> Summary\_aggregates\_statuses\_and\_tokens\(\)

```csharp
[Fact]
public Task Summary_aggregates_statuses_and_tokens()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunStoreContract_Summary_and_time_series_do_not_leak_across_tenants"></a> Summary\_and\_time\_series\_do\_not\_leak\_across\_tenants\(\)

```csharp
[Fact]
public Task Summary_and_time_series_do_not_leak_across_tenants()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunStoreContract_Summary_computes_breakdown_by_error_class"></a> Summary\_computes\_breakdown\_by\_error\_class\(\)

```csharp
[Fact]
public Task Summary_computes_breakdown_by_error_class()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunStoreContract_Summary_computes_error_rate_only_over_completed_runs"></a> Summary\_computes\_error\_rate\_only\_over\_completed\_runs\(\)

```csharp
[Fact]
public Task Summary_computes_error_rate_only_over_completed_runs()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunStoreContract_Summary_computes_version_breakdown"></a> Summary\_computes\_version\_breakdown\(\)

```csharp
[Fact]
public Task Summary_computes_version_breakdown()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunStoreContract_Summary_excludes_eval_runs"></a> Summary\_excludes\_eval\_runs\(\)

```csharp
[Fact]
public Task Summary_excludes_eval_runs()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunStoreContract_Summary_filters_by_agent_name"></a> Summary\_filters\_by\_agent\_name\(\)

```csharp
[Fact]
public Task Summary_filters_by_agent_name()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunStoreContract_Summary_filters_by_start_time"></a> Summary\_filters\_by\_start\_time\(\)

```csharp
[Fact]
public Task Summary_filters_by_start_time()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunStoreContract_Summary_limits_agent_breakdown"></a> Summary\_limits\_agent\_breakdown\(\)

```csharp
[Fact]
public Task Summary_limits_agent_breakdown()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunStoreContract_Summary_returns_at_most_three_failure_clusters_per_class"></a> Summary\_returns\_at\_most\_three\_failure\_clusters\_per\_class\(\)

```csharp
[Fact]
public Task Summary_returns_at_most_three_failure_clusters_per_class()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunStoreContract_Summary_returns_no_error_rate_when_no_run_has_completed"></a> Summary\_returns\_no\_error\_rate\_when\_no\_run\_has\_completed\(\)

```csharp
[Fact]
public Task Summary_returns_no_error_rate_when_no_run_has_completed()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunStoreContract_Summary_rows_with_no_error_class_appear_in_the_unknown_bucket"></a> Summary\_rows\_with\_no\_error\_class\_appear\_in\_the\_unknown\_bucket\(\)

```csharp
[Fact]
public Task Summary_rows_with_no_error_class_appear_in_the_unknown_bucket()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunStoreContract_Summary_sorts_agent_breakdown_by_run_count"></a> Summary\_sorts\_agent\_breakdown\_by\_run\_count\(\)

```csharp
[Fact]
public Task Summary_sorts_agent_breakdown_by_run_count()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunStoreContract_The_cache_charge_round_trips_and_counts_toward_the_total"></a> The\_cache\_charge\_round\_trips\_and\_counts\_toward\_the\_total\(\)

```csharp
[Fact]
public Task The_cache_charge_round_trips_and_counts_toward_the_total()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunStoreContract_The_largest_total_a_run_writes_fits_the_snapshot_column"></a> The\_largest\_total\_a\_run\_writes\_fits\_the\_snapshot\_column\(\)

```csharp
[Fact]
public Task The_largest_total_a_run_writes_fits_the_snapshot_column()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunStoreContract_The_last_event_sequence_is_readable"></a> The\_last\_event\_sequence\_is\_readable\(\)

A run that is retried keeps its identity, so the second attempt must
continue the event stream instead of restarting it.

```csharp
[Fact]
public Task The_last_event_sequence_is_readable()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

#### Remarks

Without it the writer restarted at zero on every lease takeover, hit
the unique `(run_id, seq)` key, disabled itself for the rest of the
run, and then skipped the completion write. The job reported Completed
while the run stayed in [RunStatus.Running](/api/tracon.runstatus/) forever. A store
answers this question so the writer never has to guess.

### <a id="Tracon_Testing_Contracts_Storage_RunStoreContract_The_token_breakdown_round_trips_and_stays_null_when_it_was_never_reported"></a> The\_token\_breakdown\_round\_trips\_and\_stays\_null\_when\_it\_was\_never\_reported\(\)

```csharp
[Fact]
public Task The_token_breakdown_round_trips_and_stays_null_when_it_was_never_reported()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunStoreContract_Time_series_does_not_exclude_eval_runs"></a> Time\_series\_does\_not\_exclude\_eval\_runs\(\)

```csharp
[Fact]
public Task Time_series_does_not_exclude_eval_runs()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunStoreContract_Time_series_fills_empty_buckets"></a> Time\_series\_fills\_empty\_buckets\(\)

```csharp
[Fact]
public Task Time_series_fills_empty_buckets()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunStoreContract_Time_series_throws_when_the_bucket_limit_is_exceeded"></a> Time\_series\_throws\_when\_the\_bucket\_limit\_is\_exceeded\(\)

```csharp
[Fact]
public Task Time_series_throws_when_the_bucket_limit_is_exceeded()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunStoreContract_Token_info_stays_null_when_absent"></a> Token\_info\_stays\_null\_when\_absent\(\)

```csharp
[Fact]
public Task Token_info_stays_null_when_absent()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunStoreContract_TouchHeartbeatAsync_refreshed_row_is_not_considered_orphaned"></a> TouchHeartbeatAsync\_refreshed\_row\_is\_not\_considered\_orphaned\(\)

```csharp
[Fact]
public Task TouchHeartbeatAsync_refreshed_row_is_not_considered_orphaned()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunStoreContract_TouchHeartbeatAsync_silently_skips_a_nonexistent_or_non_Running_id"></a> TouchHeartbeatAsync\_silently\_skips\_a\_nonexistent\_or\_non\_Running\_id\(\)

```csharp
[Fact]
public Task TouchHeartbeatAsync_silently_skips_a_nonexistent_or_non_Running_id()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunStoreContract_Tree_cost_adds_the_cache_charge_of_every_run_in_the_tree"></a> Tree\_cost\_adds\_the\_cache\_charge\_of\_every\_run\_in\_the\_tree\(\)

```csharp
[Fact]
public Task Tree_cost_adds_the_cache_charge_of_every_run_in_the_tree()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunStoreContract_Tree_cost_is_not_summed_with_its_own_cost_separate_fields"></a> Tree\_cost\_is\_not\_summed\_with\_its\_own\_cost\_separate\_fields\(\)

```csharp
[Fact]
public Task Tree_cost_is_not_summed_with_its_own_cost_separate_fields()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunStoreContract_Tree_fields_round_trip"></a> Tree\_fields\_round\_trip\(\)

```csharp
[Fact]
public Task Tree_fields_round_trip()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunStoreContract_Tree_non_token_cost_adds_every_run_in_the_tree_once"></a> Tree\_non\_token\_cost\_adds\_every\_run\_in\_the\_tree\_once\(\)

```csharp
[Fact]
public Task Tree_non_token_cost_adds_every_run_in_the_tree_once()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunStoreContract_Tree_query_returns_the_root_and_all_its_descendants"></a> Tree\_query\_returns\_the\_root\_and\_all\_its\_descendants\(\)

```csharp
[Fact]
public Task Tree_query_returns_the_root_and_all_its_descendants()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunStoreContract_Tree_total_combines_tokens_of_root_and_descendants"></a> Tree\_total\_combines\_tokens\_of\_root\_and\_descendants\(\)

```csharp
[Fact]
public Task Tree_total_combines_tokens_of_root_and_descendants()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunStoreContract_Tree_total_stays_null_when_no_tokens_are_reported"></a> Tree\_total\_stays\_null\_when\_no\_tokens\_are\_reported\(\)

```csharp
[Fact]
public Task Tree_total_stays_null_when_no_tokens_are_reported()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunStoreContract_Tree_usage_sums_the_breakdown_across_child_runs"></a> Tree\_usage\_sums\_the\_breakdown\_across\_child\_runs\(\)

```csharp
[Fact]
public Task Tree_usage_sums_the_breakdown_across_child_runs()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunStoreContract_Unit_prices_stay_null_when_the_model_price_is_unknown"></a> Unit\_prices\_stay\_null\_when\_the\_model\_price\_is\_unknown\(\)

```csharp
[Fact]
public Task Unit_prices_stay_null_when_the_model_price_is_unknown()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunStoreContract_UpdateRunCostAsync_does_not_update_with_the_wrong_expected_tenant"></a> UpdateRunCostAsync\_does\_not\_update\_with\_the\_wrong\_expected\_tenant\(\)

```csharp
[Fact]
public Task UpdateRunCostAsync_does_not_update_with_the_wrong_expected_tenant()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_RunStoreContract_Workflow_run_lives_in_the_same_table"></a> Workflow\_run\_lives\_in\_the\_same\_table\(\)

```csharp
[Fact]
public Task Workflow_run_lives_in_the_same_table()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)
