machine.bend checks
raw source on the hub · import bendvy-ecs-core@0.1.0.2/machine.bend as Machine
4 imports
import Base import ./deferred_command.bend as Deferred import ./trace_facts.bend as TraceFacts import transaction.bend as Tx
Types
type Pending source · line 9 · raw
@V:Data -> Data
Experimental machine metadata. World and component owners remain arbitrary Type. This module follows the pinned reference marker snapshot semantics; that behavior is not approval of the disputed blanket next-marker retention requirement.
NoPending@V:Data -> Pending<V>
Queued@V:Data -> @value:V -> @skipSame:Bool -> Pending<V>
type Transition source · line 13 · raw
@V:Data -> Data
Transition@V:Data -> @from:V -> @to:V -> Transition<V>
Initial@V:Data -> @to:V -> Transition<V>
type Slot source · line 17 · raw
@S:Data -> @M:Data -> @V:Data -> Data
Missing@S:Data -> @M:Data -> @V:Data -> Slot<S, M, V>
Present@S:Data -> @M:Data -> @V:Data -> @current:V -> @pending:Pending<V> -> @previous:Maybe<&2, V> -> @changed:Bool -> Slot<S, M, V>
type CurrentView source · line 22 · raw
@S:Data -> @M:Data -> @V:Data -> Data
Public capability projections intentionally expose less than debug metadata.
Current@S:Data -> @M:Data -> @V:Data -> @value:V -> CurrentView<S, M, V>
type NextView source · line 25 · raw
@S:Data -> @M:Data -> @V:Data -> Data
NoNext@S:Data -> @M:Data -> @V:Data -> NextView<S, M, V>
Next@S:Data -> @M:Data -> @V:Data -> @value:V -> NextView<S, M, V>
type Family source · line 47 · raw
@S:Data -> @M:Data -> @V:Data -> @W:Type -> @-take:(@_:W -> Pair(W, Slot<S, M, V>)) -> @-put:(@_:W -> @_:Slot<S, M, V> -> W) -> Data
Family@S:Data -> @M:Data -> @V:Data -> @W:Type -> @-take:(@_:W -> Pair(W, Slot<S, M, V>)) -> @-put:(@_:W -> @_:Slot<S, M, V> -> W) -> @name:String -> Family<S, M, V, W, take, put>
type QueueInput source · line 51 · raw
@V:Data -> Data
Set@V:Data -> @value:V -> @skipSame:Bool -> QueueInput<V>
Reset@V:Data -> QueueInput<V>
type Snapshot source · line 55 · raw
@V:Data -> Data
Unscheduled@V:Data -> Snapshot<V>
Scheduled@V:Data -> @value:V -> @skipSame:Bool -> Snapshot<V>
type Applied source · line 59 · raw
@S:Data -> @M:Data -> @V:Data -> Data
Applied@S:Data -> @M:Data -> @V:Data -> @slot:Slot<S, M, V> -> @event:Maybe<&2, Transition<V>> -> Applied<S, M, V>
type Condition source · line 161 · raw
@V:Data -> Data
InState@V:Data -> @value:V -> Condition<V>
StateChanged@V:Data -> Condition<V>
Not@V:Data -> @inner:Condition<V> -> Condition<V>
Constant@V:Data -> @value:Bool -> Condition<V>
And@V:Data -> @left:Condition<V> -> @right:Condition<V> -> Condition<V>
Or@V:Data -> @left:Condition<V> -> @right:Condition<V> -> Condition<V>
type Marker source · line 202 · raw
@S:Data -> @W:Type -> Type
A heterogeneous marker snapshot owns each callback exactly once. Each callback captures a Data machine value and closed lenses, never a world/component owner.
Marker@S:Data -> @W:Type -> @steps:List<&1, @_:W -> W> -> Marker<S, W>
type OwnedMarker source · line 216 · raw
@S:Data -> @W:Type -> @H:Type -> Type
Registered schedule/transition owners live alongside the world and are also threaded, rather than copied into one closure per machine.
OwnedMarker@S:Data -> @W:Type -> @H:Type -> @steps:List<&1, @_:H -> @_:W -> Pair(H, W)> -> OwnedMarker<S, W, H>
Templates
template current_view source · line 29 · raw
@-S:Data -> @-M:Data -> @-V:Data -> @slot:Slot<S, M, V> -> CurrentView<S, M, V>
template pending_view source · line 33 · raw
@-S:Data -> @-M:Data -> @-V:Data -> @pending:Pending<V> -> NextView<S, M, V>
template next_view source · line 37 · raw
@-S:Data -> @-M:Data -> @-V:Data -> @slot:Slot<S, M, V> -> NextView<S, M, V>
template is_current source · line 42 · raw
@-S:Data -> @-M:Data -> @-V:Data -> @-same:(@_:V -> @_:V -> Bool) -> @view:CurrentView<S, M, V> -> @value:V -> Bool
template queue source · line 62 · raw
@-S:Data -> @-M:Data -> @-V:Data -> @slot:Slot<S, M, V> -> @value:V -> @skipSame:Bool -> Slot<S, M, V>
template reset source · line 67 · raw
@-S:Data -> @-M:Data -> @-V:Data -> @slot:Slot<S, M, V> -> Slot<S, M, V>
template clear_changed source · line 72 · raw
@-S:Data -> @-M:Data -> @-V:Data -> @slot:Slot<S, M, V> -> Slot<S, M, V>
template snapshot_pending source · line 77 · raw
@-V:Data -> @pending:Pending<V> -> Snapshot<V>
template snapshot source · line 82 · raw
@-S:Data -> @-M:Data -> @-V:Data -> @slot:Slot<S, M, V> -> Snapshot<V>
template apply_decision source · line 87 · raw
@-S:Data -> @-M:Data -> @-V:Data -> @+current:V -> @+value:V -> @previous:Maybe<&2, V> -> @changed:Bool -> @skip:Bool -> Applied<S, M, V>
template apply_present source · line 92 · raw
@-S:Data -> @-M:Data -> @-V:Data -> @-same:(@_:V -> @_:V -> Bool) -> @+current:V -> @+value:V -> @previous:Maybe<&2, V> -> @changed:Bool -> @skipSame:Bool -> Applied<S, M, V>
template apply_snapshot source · line 97 · raw
@-S:Data -> @-M:Data -> @-V:Data -> @-same:(@_:V -> @_:V -> Bool) -> @slot:Slot<S, M, V> -> @captured:Snapshot<V> -> Applied<S, M, V>
Captured initial value is authoritative; current pending is deleted at the machine's turn, matching Runtime.ts:1534 even when an earlier hook overwrote it.
template write_taken source · line 106 · raw
@-S:Data -> @-M:Data -> @-V:Data -> @-W:Type -> @-E:Data -> @-put:(@_:W -> @_:Slot<S, M, V> -> W) -> @pair:Pair(W, Slot<S, M, V>) -> @undo:List<&1, @_:W -> W> -> @commands:List<&1, 0xb2b0f04555daca474f0f77d0966945c9/deferred_command.Command<W>> -> @events:List<&2, E> -> @trace:0xb2b0f04555daca474f0f77d0966945c9/trace_facts.State -> @value:V -> @skipSame:Bool -> 0xb2b0f04555daca474f0f77d0966945c9/transaction.Tx<W, E>
Journal the complete old slot before replacing it. Aliases see the current world through the same affine transaction; no independent machine owner copy.
template write source · line 113 · raw
@-S:Data -> @-M:Data -> @-V:Data -> @-W:Type -> @-E:Data -> @-take:(@_:W -> Pair(W, Slot<S, M, V>)) -> @-put:(@_:W -> @_:Slot<S, M, V> -> W) -> @tx:0xb2b0f04555daca474f0f77d0966945c9/transaction.Tx<W, E> -> @value:V -> @skipSame:Bool -> 0xb2b0f04555daca474f0f77d0966945c9/transaction.Tx<W, E>
template reset_taken source · line 120 · raw
@-S:Data -> @-M:Data -> @-V:Data -> @-W:Type -> @-E:Data -> @-put:(@_:W -> @_:Slot<S, M, V> -> W) -> @pair:Pair(W, Slot<S, M, V>) -> @undo:List<&1, @_:W -> W> -> @commands:List<&1, 0xb2b0f04555daca474f0f77d0966945c9/deferred_command.Command<W>> -> @events:List<&2, E> -> @trace:0xb2b0f04555daca474f0f77d0966945c9/trace_facts.State -> 0xb2b0f04555daca474f0f77d0966945c9/transaction.Tx<W, E>
template reset_tx source · line 127 · raw
@-S:Data -> @-M:Data -> @-V:Data -> @-W:Type -> @-E:Data -> @-take:(@_:W -> Pair(W, Slot<S, M, V>)) -> @-put:(@_:W -> @_:Slot<S, M, V> -> W) -> @tx:0xb2b0f04555daca474f0f77d0966945c9/transaction.Tx<W, E> -> 0xb2b0f04555daca474f0f77d0966945c9/transaction.Tx<W, E>
template next source · line 134 · raw
@-S:Data -> @-M:Data -> @-V:Data -> @-W:Type -> @-E:Data -> @-take:(@_:W -> Pair(W, Slot<S, M, V>)) -> @-put:(@_:W -> @_:Slot<S, M, V> -> W) -> @tx:0xb2b0f04555daca474f0f77d0966945c9/transaction.Tx<W, E> -> @request:QueueInput<V> -> 0xb2b0f04555daca474f0f77d0966945c9/transaction.Tx<W, E>
template read_taken source · line 141 · raw
@-S:Data -> @-M:Data -> @-V:Data -> @-W:Type -> @-E:Data -> @pair:Pair(W, Slot<S, M, V>) -> @undo:List<&1, @_:W -> W> -> @commands:List<&1, 0xb2b0f04555daca474f0f77d0966945c9/deferred_command.Command<W>> -> @events:List<&2, E> -> @trace:0xb2b0f04555daca474f0f77d0966945c9/trace_facts.State -> Pair(0xb2b0f04555daca474f0f77d0966945c9/transaction.Tx<W, E>, Slot<S, M, V>)
template read source · line 146 · raw
@-S:Data -> @-M:Data -> @-V:Data -> @-W:Type -> @-E:Data -> @-take:(@_:W -> Pair(W, Slot<S, M, V>)) -> @tx:0xb2b0f04555daca474f0f77d0966945c9/transaction.Tx<W, E> -> Pair(0xb2b0f04555daca474f0f77d0966945c9/transaction.Tx<W, E>, Slot<S, M, V>)
template read_declared source · line 151 · raw
@-S:Data -> @-M:Data -> @-V:Data -> @-W:Type -> @-E:Data -> @-take:(@_:W -> Pair(W, Slot<S, M, V>)) -> @-put:(@_:W -> @_:Slot<S, M, V> -> W) -> @_:Family<S, M, V, W, take, put> -> @tx:0xb2b0f04555daca474f0f77d0966945c9/transaction.Tx<W, E> -> Pair(0xb2b0f04555daca474f0f77d0966945c9/transaction.Tx<W, E>, Slot<S, M, V>)
template next_declared source · line 156 · raw
@-S:Data -> @-M:Data -> @-V:Data -> @-W:Type -> @-E:Data -> @-take:(@_:W -> Pair(W, Slot<S, M, V>)) -> @-put:(@_:W -> @_:Slot<S, M, V> -> W) -> @_:Family<S, M, V, W, take, put> -> @tx:0xb2b0f04555daca474f0f77d0966945c9/transaction.Tx<W, E> -> @request:QueueInput<V> -> 0xb2b0f04555daca474f0f77d0966945c9/transaction.Tx<W, E>
template current_matches source · line 169 · raw
@-S:Data -> @-M:Data -> @-V:Data -> @-same:(@_:V -> @_:V -> Bool) -> @slot:Slot<S, M, V> -> @value:V -> Bool
template changed source · line 174 · raw
@-S:Data -> @-M:Data -> @-V:Data -> @slot:Slot<S, M, V> -> Bool
template all source · line 181 · raw
@-V:Data -> @items:List<&2, Condition<V>> -> Condition<V>
Arbitrary public variadic combinations become a structural Boolean tree. Empty and/or preserve the primary API identities.
template any source · line 186 · raw
@-V:Data -> @items:List<&2, Condition<V>> -> Condition<V>
template evaluate source · line 191 · raw
@-S:Data -> @-M:Data -> @-V:Data -> @-same:(@_:V -> @_:V -> Bool) -> @condition:Condition<V> -> @+slot:Slot<S, M, V> -> Bool
template marker_steps source · line 205 · raw
@-W:Type -> @steps:List<&1, @_:W -> W> -> @world:W -> W
template run_marker source · line 210 · raw
@-S:Data -> @-W:Type -> @marker:Marker<S, W> -> @world:W -> W
template marker_next source · line 219 · raw
@-W:Type -> @-H:Type -> @next:(@_:H -> @_:W -> Pair(H, W)) -> @pair:Pair(H, W) -> Pair(H, W)
template owned_marker_steps source · line 223 · raw
@-W:Type -> @-H:Type -> @steps:List<&1, @_:H -> @_:W -> Pair(H, W)> -> @owners:H -> @world:W -> Pair(H, W)
template run_owned_marker source · line 228 · raw
@-S:Data -> @-W:Type -> @-H:Type -> @marker:OwnedMarker<S, W, H> -> @owners:H -> @world:W -> Pair(H, W)