Skip to content

@usine/engine/run-reader

A Run snapshot and all its saved transcript entries from the same database transaction.

  • Schema.Class

new RunEvidence(…args): RunEvidence

Parameter Type
…args [props: object, options?: MakeOptions]

RunEvidence

readonly snapshot: RunSnapshot

readonly transcript: readonly TranscriptEntry[]


Reads saved Run state and transcripts without starting or recovering execution.

  • Context.ServiceClass

readonly Service: object

The service’s operations: what yield* RunReader returns.

readonly evidence: (runId) => Effect.Effect<RunEvidence, RunStoreError>

Reads one consistent Run snapshot and every saved transcript entry, in append order without a page limit.

Parameter Type
runId RunId

Effect.Effect<RunEvidence, RunStoreError>

readonly forItems: (itemKeys) => Effect.Effect<ReadonlyArray<RunSummary>, RunStoreError>

Every saved Run for the supplied Items, newest first, including all their Attempts.

Parameter Type
itemKeys ReadonlyArray<ItemKey>

Effect.Effect<ReadonlyArray<RunSummary>, RunStoreError>

readonly inspect: (runId) => Effect.Effect<RunSnapshot, RunStoreError>

Reads a Run’s current state, effective task and Agent, Step result, and Attempt history.

Parameter Type
runId RunId

Effect.Effect<RunSnapshot, RunStoreError>

readonly list: (options) => Effect.Effect<ReadonlyArray<RunSummary>, RunStoreError>

Every open Run plus the newest closedLimit settled ones, newest first.

Parameter Type
options { closedLimit: number; }
options.closedLimit number

Effect.Effect<ReadonlyArray<RunSummary>, RunStoreError>

readonly revision: () => Effect.Effect<Option.Option<ProjectionRevision>, RunStoreError>

None means the invalidation row is absent: treat every cached projection as stale.

Effect.Effect<Option.Option<ProjectionRevision>, RunStoreError>

readonly transcript: (query) => Effect.Effect<ReadonlyArray<TranscriptEntry>, RunStoreError>

Reads the requested portion of one Attempt’s saved transcript in append order.

Parameter Type
query TranscriptQuery

Effect.Effect<ReadonlyArray<TranscriptEntry>, RunStoreError>

readonly static layer: Layer<RunReader, never, RunDatabase>


The full durable view of one Run.

  • Schema.Class

new RunSnapshot(…args): RunSnapshot

Parameter Type
…args [props: object, options?: MakeOptions]

RunSnapshot

readonly agent: Agent

readonly attempts: readonly Attempt[]

readonly event: Event

readonly itemKey: string & Brand<"ItemKey">

readonly parentModel: Option<string & Brand<"ModelId">>

readonly repository: string & Brand<"RepositoryName">

readonly resolvedFailureAttemptId: Option<string & Brand<"AttemptId">>

The failed Attempt whose attention the operator resolved; outcomes and history stay intact.

readonly revision: string & Brand<"RepositoryRevision">

readonly run: Run

readonly step: Step

readonly task: string & Brand<"AttemptTask">


The lighter view used when listing Runs for operators.

  • Schema.Class

new RunSummary(…args): RunSummary

Parameter Type
…args [props: object, options?: MakeOptions]

RunSummary

readonly agent: Agent

readonly attempts: readonly Attempt[]

readonly itemKey: string & Brand<"ItemKey">

readonly repository: string & Brand<"RepositoryName">

readonly resolvedFailureAttemptId: Option<string & Brand<"AttemptId">>

The failed Attempt whose attention the operator resolved; outcomes and history stay intact.

readonly run: Run

readonly step: Step

readonly task: string & Brand<"AttemptTask">

ProjectionRevision = typeof ProjectionRevision.Type

Monotonic version of the operator projection.

const ProjectionRevision: Schema.brand<Schema.Int, "ProjectionRevision">

Monotonic version of the operator projection.