InMemoryRunScoreStore
AgentPrism.Core.dllA store that keeps run and message scores in process memory.
public sealed class InMemoryRunScoreStore : IRunScoreStoreInheritance
Section titled “Inheritance”object ← InMemoryRunScoreStore
Implements
Section titled “Implements”Inherited Members
Section titled “Inherited Members”object.GetType(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
Remarks
Section titled “Remarks”Its behavior contract exactly matches persistent implementations such as
SqlRunScoreStore, and shared contract tests protect it. Use
AgentPrism.PostgreSql, SQL Server, or SQLite in production.
Constructors
Section titled “Constructors”InMemoryRunScoreStore()
Section titled “ InMemoryRunScoreStore()”public InMemoryRunScoreStore()Methods
Section titled “Methods”DeleteAsync(string, Guid, CancellationToken)
Section titled “ DeleteAsync(string, Guid, CancellationToken)”Deletes a score.
public ValueTask<bool> DeleteAsync(string tenantId, Guid scoreId, CancellationToken cancellationToken = default)Parameters
Section titled “Parameters”tenantId string
The tenant.
scoreId Guid
The score identifier.
cancellationToken CancellationToken
The cancellation token.
Returns
Section titled “Returns”true if deleted; false if no such score exists.
ListAsync(string, Guid, CancellationToken)
Section titled “ ListAsync(string, Guid, CancellationToken)”Lists all of a run’s scores.
public ValueTask<IReadOnlyList<RunScore>> ListAsync(string tenantId, Guid runId, CancellationToken cancellationToken = default)Parameters
Section titled “Parameters”tenantId string
The tenant.
runId Guid
The run identifier.
cancellationToken CancellationToken
The cancellation token.
Returns
Section titled “Returns”ValueTask<IReadOnlyList<RunScore>>
The scores. No order is guaranteed.
UpsertAsync(RunScore, CancellationToken)
Section titled “ UpsertAsync(RunScore, CancellationToken)”Adds or updates a score.
public ValueTask<RunScore> UpsertAsync(RunScore score, CancellationToken cancellationToken = default)Parameters
Section titled “Parameters”score RunScore
The score. If RunScore.Id is empty (Guid.Empty), a new identifier is generated.
cancellationToken CancellationToken
The cancellation token.
Returns
Section titled “Returns”The score written.
Remarks
Section titled “Remarks”When the same author (RunScore.Author) scores the same target (a run or a message) a second time, the row is updated, not opened as a new row. If RunScore.Author is empty, this rule does not apply; every call writes a new row.