Skip to content

RunToCasePromoter

Namespace AgentPrism · Assembly AgentPrism.Core.dll

Promotes a production run to an evaluation case.

public sealed class RunToCasePromoter

objectRunToCasePromoter

object.GetType(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

The query text is read from the RunEventType.RunStarted event in run_events; see RunRecordingAgent.ExtractQuery. It is the only durable input location because a session is saved only after successful completion. Therefore, the query of a failed run can never be read from a session. The original session-based design always returned 422 for failed-run promotion.

Multi-turn behavior is detected by checking for an earlier run in this run’s session. When present, this run’s query alone cannot reproduce the original behavior because prior-turn context is missing. which forbids silent context loss.

RunToCasePromoter(IRunStore, IRunScoreStore, IEvalStore)

Section titled “ RunToCasePromoter(IRunStore, IRunScoreStore, IEvalStore)”

Initializes a promotion service.

public RunToCasePromoter(IRunStore runs, IRunScoreStore scores, IEvalStore evalStore)

runs IRunStore

scores IRunScoreStore

evalStore IEvalStore

PromoteAsync(string, EvalSuite, Guid, EvalCaseSource?, CancellationToken)

Section titled “ PromoteAsync(string, EvalSuite, Guid, EvalCaseSource?, CancellationToken)”

Attempts to promote a run to the supplied suite.

public ValueTask<RunPromotionOutcome> PromoteAsync(string tenantId, EvalSuite suite, Guid runId, EvalCaseSource? sourceKindOverride, CancellationToken cancellationToken = default)

tenantId string

The requesting tenant.

suite EvalSuite

The target evaluation suite.

runId Guid

The run to promote.

sourceKindOverride EvalCaseSource?

Overrides the promotion reason. When null, it is inferred from the run’s status and score.

cancellationToken CancellationToken

The cancellation token.

ValueTask<RunPromotionOutcome>

The promotion outcome.