~/bend-docscommunity

execution_trace.bend checks

raw source on the hub · import bendvy-ecs-core@0.1.0.7/execution_trace.bend as Execution_trace

3 imports
import Base
import ./change_tick.bend as Tick
import ./trace_facts.bend as Facts

Types

type Identity source · line 8 · raw

Data

Detached copied facts. No World, registration, cursor or stream owner is held. Copied system identity for presentation: namespace/id and optional name. It is metadata, not a registration owner or capability for invoking that system.

type Status source · line 11 · raw

@Error:Data -> Data

Completion status of one executed system, retaining its detached Data error.

type Completion source · line 16 · raw

@Error:Data -> Data

Schedule-level completion distinguishes failure, admission rejection and missing execution from success; it is not a replacement for the retained App run result.

type TraceEvent source · line 24 · raw

@Error:Data -> Data

Ordered copied execution facts: schedule/phase boundaries, systems, operations and admission outcomes. Facts describe the actual run; they grant no mutable World access and do not imply that a failed transaction committed its operations.

type Batch source · line 38 · raw

@Error:Data -> Data

Detached delivery value returned after execution. Disabled differs from an enabled Ready batch with no events. No live reader or stream retention is held; keeping or dropping a copied batch does not acknowledge an ECS event reader.

type Subscriber source · line 44 · raw

@State:Type -> @Error:Data -> @-step:(@_:State -> @_:TraceEvent<Error> -> State) -> Type

Each subscription is its actual affine state owner, not a copied callback. The erased reusable step is supplied as a top-level definition.

Templates

template subscribe source · line 48 · raw

@-State:Type -> @-Error:Data -> @-step:(@_:State -> @_:TraceEvent<Error> -> State) -> @state:State -> Subscriber<State, Error, step>

Wrap the supplied actual State owner with a reusable erased step definition. This creates a local subscriber, not an ECS registration or automatic callback.

template unsubscribe source · line 52 · raw

@-State:Type -> @-Error:Data -> @-step:(@_:State -> @_:TraceEvent<Error> -> State) -> @value:Subscriber<State, Error, step> -> State

Consume the subscriber and return its actual State for reuse or explicit disposal. No implicit user cleanup/destructor callback is invoked.

template reset source · line 57 · raw

@-State:Type -> @-Error:Data -> @-step:(@_:State -> @_:TraceEvent<Error> -> State) -> @value:Subscriber<State, Error, step> -> @incoming:State -> Pair(Subscriber<State, Error, step>, State)

Replace subscription state and return the displaced actual owner separately. Neither owner is copied or silently restored into ECS storage.

template delivered source · line 60 · raw

@-State:Type -> @-Error:Data -> @-step:(@_:State -> @_:TraceEvent<Error> -> State) -> @events:List<&2, TraceEvent<Error>> -> @state:State -> State

template deliver source · line 68 · raw

@-State:Type -> @-Error:Data -> @-step:(@_:State -> @_:TraceEvent<Error> -> State) -> @value:Subscriber<State, Error, step> -> @batch:Batch<Error> -> Subscriber<State, Error, step>

Thread subscriber State through Ready events in list order; Disabled returns the subscriber unchanged. Delivery is explicitly called after the ECS run. Any external printing/file IO performed by a consumer is outside ECS rollback, not an in-transaction observer. See examples/scheduled-health/application.bend.

template both source · line 78 · raw

@-Left:Type -> @-Right:Type -> @-Error:Data -> @-left:(@_:Left -> @_:Batch<Error> -> Left) -> @-right:(@_:Right -> @_:Batch<Error> -> Right) -> @value:Pair(Left, Right) -> @+batch:Batch<Error> -> Pair(Left, Right)

Generic owner composition has no arity or subscriber-count bound. Order is left then right; each reusable delivery function can itself be another pair. Deliver the same detached batch to two actual owners, left then right, returning both results. Compose this adapter recursively for additional subscribers; this is owner composition, not a global subscription registry.