ExtractionRunTransition

class ExtractionRunTransition constructor(val status: ExtractionRunStatus, val finishedAt: Instant, val counts: ExtractionRunCounts? = null, failures: List<ExtractionFailure>? = null)

One terminal write against a run: the state it ends in, when it ended, and the counts and failures that go with it.

This type is how a run becomes a different run. ExtractionRun publishes no withStatus, no finished() and no copy, so applyTo is the only place a terminal run is derived. A store applies it under compare-and-set; nothing else may.

Null means keep, a value means replace. counts and failures are both nullable and both follow the same rule, so a coordinator that only knows the run stopped can say that and nothing more. An empty failures list is a value: it replaces whatever the run accumulated with none.

A FAILED transition need not carry a failure. A run can stop on something the coordinator classifies at the run level with no per-attempt detail, and requiring the pairing would make an honest "we know it failed and not why" unrecordable. A COMPLETED transition may carry failures for the same reason from the other side: a run that retried past a failed attempt and finished still happened.

fingerprint names the write, and the counts and failures ride beside it. A store compares a repeated terminal write against the digest of status and finishedAt alone. Two transitions that agree on those are the same write, so the second replays and the run keeps the counts and failures the first one delivered — a run's outcome is written once. See ExtractionRunFingerprint for the encoding, and for why a payload that grows leaves the digest where it is.

EXPERIMENTAL. The shape may still change while extraction runs (DICE #67) land.

Constructors

Link copied to clipboard
constructor(status: ExtractionRunStatus, finishedAt: Instant, counts: ExtractionRunCounts? = null, failures: List<ExtractionFailure>? = null)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

The run's final counts, or null to keep what the run already recorded

Link copied to clipboard

The run's final failures, or null to keep what the run already recorded.

Link copied to clipboard

The digest a store compares a repeated terminal write against, computed once at construction.

Link copied to clipboard

When the run reached it

Link copied to clipboard

The terminal state the run ends in

Functions

Link copied to clipboard

Derives the terminal run this transition produces from the running one it is applied to.

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
open override fun toString(): String

Identity and sizes. Failure details stay out of it, as they do on the run.