execution_trace.bend checks
raw source on the hub · import bendvy-ecs-core@0.1.0.2/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.
Identity@namespace:U32 -> @id:U32 -> @name:Maybe<&2, String> -> Identity
type Status source · line 11 · raw
@Error:Data -> Data
Completion status of one executed system, retaining its detached Data error.
SystemOk@Error:Data -> Status<Error>
SystemError@Error:Data -> @error:Error -> Status<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.
EndOk@Error:Data -> Completion<Error>
EndFailed@Error:Data -> @error:Error -> Completion<Error>
EndRejected@Error:Data -> Completion<Error>
EndMissing@Error:Data -> Completion<Error>
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.
ScheduleStarted@Error:Data -> @namespace:U32 -> @name:String -> TraceEvent<Error>
PhaseEntered@Error:Data -> @name:String -> TraceEvent<Error>
SystemCompleted@Error:Data -> @identity:Identity -> @before:0xb2b0f04555daca474f0f77d0966945c9/change_tick.Tick -> @after:0xb2b0f04555daca474f0f77d0966945c9/change_tick.Tick -> @status:Status<Error> -> TraceEvent<Error>
OperationObserved@Error:Data -> @identity:Identity -> @fact:0xb2b0f04555daca474f0f77d0966945c9/trace_facts.Fact -> TraceEvent<Error>
BarrierOperationObserved@Error:Data -> @fact:0xb2b0f04555daca474f0f77d0966945c9/trace_facts.Fact -> TraceEvent<Error>
ExecutionOperationObserved@Error:Data -> @fact:0xb2b0f04555daca474f0f77d0966945c9/trace_facts.Fact -> TraceEvent<Error>
SystemSkipped@Error:Data -> @id:U32 -> TraceEvent<Error>
DeferredApplied@Error:Data -> TraceEvent<Error>
ScheduleEnded@Error:Data -> @outcome:Completion<Error> -> TraceEvent<Error>
ScheduleAdmissionRefused@Error:Data -> @namespace:U32 -> @name:String -> @outcome:Completion<Error> -> TraceEvent<Error>
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.
Disabled@Error:Data -> Batch<Error>
BendvyReady@Error:Data -> @events:List<&2, TraceEvent<Error>> -> Batch<Error>
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.
Subscriber@State:Type -> @Error:Data -> @-step:(@_:State -> @_:TraceEvent<Error> -> State) -> @state:State -> Subscriber<State, Error, step>
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.