Skip to main content
scenarios.ScenarioBuilder Construct a bounded recipe. Its methods perform no reads or writes.

Constructors

constructor

• new ScenarioBuilder(options?)

Parameters

Methods

operation

▸ operation<Op>(id, operation, args): ScenarioOperation<Op["_returnType"]>

Type parameters

Parameters

Returns

ScenarioOperation<Op["_returnType"]>

assume

▸ assume<Result>(id, operation, delay?): void Assume every held call’s declared state change; this records no delivery. A delay expands to bounded advancement followed by the same assumption. Its advancement has the stable instruction ID ${id}:delay.

Type parameters

Parameters

Returns

void

assumeStates

▸ assumeStates<Result, S>(id, operation, source, values, delay?): void Model an alternative within the held command’s declared field scope. The source schema types values; native admission checks the exact target. Omitted fields stay unchanged; an empty patch assumes no source change. No provider receipt is created.

Type parameters

Parameters

Returns

void

observe

▸ observe(id, source, observation): void Select a captured external history at an explicit business decision.

Parameters

Returns

void

realize

▸ realize(id, source, history, timing): void Admit a retained model prediction as simulated source observations.

Parameters

Returns

void

snapshot

▸ snapshot(id, options?): void

Parameters

Returns

void

advance

▸ advance(id, options): void Advance business time and drain modeled scheduled mutations. Ordinary inherited live jobs are outside this population.

Parameters

Returns

void

query

▸ query<Query>(id, query, args): Object

Type parameters

Parameters

Returns

Object

measure

▸ measure<Query>(id, evaluator, args): Object Evaluate exact readings with the program captured at the starting state.

Type parameters

Parameters

Returns

Object

infer

▸ infer<Input, Output>(id, model, input, options?): Object Call the version of model that this run’s program declares. The live program runs it with its own provider code and credentials; the run retains the validated output for later steps. binding: "fixed" uses the original evaluator program’s complete model dependency graph.

Type parameters

Parameters

Returns

Object

decide

▸ decide<Input, Output>(id, model, input): Object Invoke the candidate program’s decision computation.

Type parameters

Parameters

Returns

Object

environment

▸ environment<Input, Output>(id, model, input): Object Invoke the environment captured from the original evaluator program.

Type parameters

Parameters

Returns

Object

add

▸ add(...values): ScenarioValue<bigint>

Parameters

Returns

ScenarioValue<bigint>

count

▸ count(collection): ScenarioValue<bigint>

Parameters

Returns

ScenarioValue<bigint>

expect

▸ expect(id, actual): Object

Parameters

Returns

Object ▸ expect<T>(id, actual): ScenarioExpectation<T>

Type parameters

Parameters

Returns

ScenarioExpectation<T> ▸ expect<T>(id, actual): ScenarioExpectation<T>

Type parameters

Parameters

Returns

ScenarioExpectation<T>

sequence

▸ sequence<Item>(items, build): void

Type parameters

Parameters

Returns

void