structural.bend checks
raw source on the hub · import bendvy-ecs-core@0.1.0.1/structural.bend as Structural
7 imports
import Base import ./deferred_command.bend as Deferred import ./trace_facts.bend as TraceFacts import ./column.bend as Col import ./component.bend as F import ./world.bend as W import ./transaction.bend as T
Types
type Queued source · line 12 · raw
@Tx:Type -> @C:Type -> Type
Deferred structural admission result. Queued owns the updated transaction; QueueRejected returns the transaction, incoming optional affine payload and World error. Acceptance is not proof the command will apply at its barrier.
Queued@Tx:Type -> @C:Type -> @tx:Tx -> Queued<Tx, C>
QueueRejected@Tx:Type -> @C:Type -> @tx:Tx -> @incoming:Maybe<&1, C> -> @error:0xf435da9e535b3846d643dad16580e35f/world.WorldError -> Queued<Tx, C>
Templates
template applied source · line 17 · raw
@-S:Data -> @-Store:Type -> @-R:Type -> @-E:Data -> @-Rest:Type -> @-C:Type -> @-V:Data -> @-Token:Data -> @-take:(@_:Store -> Pair(Rest, 0xf435da9e535b3846d643dad16580e35f/column.Column<S, C>)) -> @-put:(@_:Rest -> @_:0xf435da9e535b3846d643dad16580e35f/column.Column<S, C> -> Store) -> @-project:(@_:C -> Pair(C, V)) -> @result:0xf435da9e535b3846d643dad16580e35f/component.Replacement<0xf435da9e535b3846d643dad16580e35f/world.World<S, Store, R, E>, C> -> 0xf435da9e535b3846d643dad16580e35f/world.World<S, Store, R, E>
Deferred structural changes own incoming payloads until barrier or discard.
template apply source · line 22 · raw
@-S:Data -> @-Store:Type -> @-R:Type -> @-E:Data -> @-Rest:Type -> @-C:Type -> @-V:Data -> @-Token:Data -> @-take:(@_:Store -> Pair(Rest, 0xf435da9e535b3846d643dad16580e35f/column.Column<S, C>)) -> @-put:(@_:Rest -> @_:0xf435da9e535b3846d643dad16580e35f/column.Column<S, C> -> Store) -> @-project:(@_:C -> Pair(C, V)) -> @family:0xf435da9e535b3846d643dad16580e35f/component.Family<S, Store, Rest, C, V, Token, take, put, project> -> @world:0xf435da9e535b3846d643dad16580e35f/world.World<S, Store, R, E> -> @handle:0xf435da9e535b3846d643dad16580e35f/world.Handle<S> -> @incoming:Maybe<&1, C> -> 0xf435da9e535b3846d643dad16580e35f/world.World<S, Store, R, E>
template queue_checked source · line 25 · raw
@-S:Data -> @-Store:Type -> @-R:Type -> @-E:Data -> @-Rest:Type -> @-C:Type -> @-V:Data -> @-Token:Data -> @-take:(@_:Store -> Pair(Rest, 0xf435da9e535b3846d643dad16580e35f/column.Column<S, C>)) -> @-put:(@_:Rest -> @_:0xf435da9e535b3846d643dad16580e35f/column.Column<S, C> -> Store) -> @-project:(@_:C -> Pair(C, V)) -> @allowed:Bool -> @family:0xf435da9e535b3846d643dad16580e35f/component.Family<S, Store, Rest, C, V, Token, take, put, project> -> @world:0xf435da9e535b3846d643dad16580e35f/world.World<S, Store, R, E> -> @undo:List<&1, @_:0xf435da9e535b3846d643dad16580e35f/world.World<S, Store, R, E> -> 0xf435da9e535b3846d643dad16580e35f/world.World<S, Store, R, E>> -> @commands:List<&1, 0xf435da9e535b3846d643dad16580e35f/deferred_command.Command<0xf435da9e535b3846d643dad16580e35f/world.World<S, Store, R, E>>> -> @events:List<&2, E> -> @trace:0xf435da9e535b3846d643dad16580e35f/trace_facts.State -> @handle:0xf435da9e535b3846d643dad16580e35f/world.Handle<S> -> @incoming:Maybe<&1, C> -> Queued<0xf435da9e535b3846d643dad16580e35f/transaction.Tx<0xf435da9e535b3846d643dad16580e35f/world.World<S, Store, R, E>, E>, C>
template queue_join source · line 30 · raw
@-S:Data -> @-Store:Type -> @-R:Type -> @-E:Data -> @-Rest:Type -> @-C:Type -> @-V:Data -> @-Token:Data -> @-take:(@_:Store -> Pair(Rest, 0xf435da9e535b3846d643dad16580e35f/column.Column<S, C>)) -> @-put:(@_:Rest -> @_:0xf435da9e535b3846d643dad16580e35f/column.Column<S, C> -> Store) -> @-project:(@_:C -> Pair(C, V)) -> @family:0xf435da9e535b3846d643dad16580e35f/component.Family<S, Store, Rest, C, V, Token, take, put, project> -> @checked:Pair(0xf435da9e535b3846d643dad16580e35f/world.World<S, Store, R, E>, Bool) -> @undo:List<&1, @_:0xf435da9e535b3846d643dad16580e35f/world.World<S, Store, R, E> -> 0xf435da9e535b3846d643dad16580e35f/world.World<S, Store, R, E>> -> @commands:List<&1, 0xf435da9e535b3846d643dad16580e35f/deferred_command.Command<0xf435da9e535b3846d643dad16580e35f/world.World<S, Store, R, E>>> -> @events:List<&2, E> -> @trace:0xf435da9e535b3846d643dad16580e35f/trace_facts.State -> @handle:0xf435da9e535b3846d643dad16580e35f/world.Handle<S> -> @incoming:Maybe<&1, C> -> Queued<0xf435da9e535b3846d643dad16580e35f/transaction.Tx<0xf435da9e535b3846d643dad16580e35f/world.World<S, Store, R, E>, E>, C>
template tx_replace source · line 41 · raw
@-S:Data -> @-Store:Type -> @-R:Type -> @-E:Data -> @-Rest:Type -> @-C:Type -> @-V:Data -> @-Token:Data -> @-take:(@_:Store -> Pair(Rest, 0xf435da9e535b3846d643dad16580e35f/column.Column<S, C>)) -> @-put:(@_:Rest -> @_:0xf435da9e535b3846d643dad16580e35f/column.Column<S, C> -> Store) -> @-project:(@_:C -> Pair(C, V)) -> @family:0xf435da9e535b3846d643dad16580e35f/component.Family<S, Store, Rest, C, V, Token, take, put, project> -> @tx:0xf435da9e535b3846d643dad16580e35f/transaction.Tx<0xf435da9e535b3846d643dad16580e35f/world.World<S, Store, R, E>, E> -> @+handle:0xf435da9e535b3846d643dad16580e35f/world.Handle<S> -> @incoming:Maybe<&1, C> -> Queued<0xf435da9e535b3846d643dad16580e35f/transaction.Tx<0xf435da9e535b3846d643dad16580e35f/world.World<S, Store, R, E>, E>, C>
Stage a deferred optional replacement for a currently live checked handle. Foreign/stale/not-live targets return QueueRejected with incoming owner and unchanged queue. Accepted commands own incoming until commit/barrier or discard; the transaction does not expose the replacement immediately. Barrier application revalidates through component.replace. This lower-level adapter drops displaced or later-rejected payload receipts; it does not return them to the original caller or invoke a user finalizer.
template tx_insert source · line 48 · raw
@-S:Data -> @-Store:Type -> @-R:Type -> @-E:Data -> @-Rest:Type -> @-C:Type -> @-V:Data -> @-Token:Data -> @-take:(@_:Store -> Pair(Rest, 0xf435da9e535b3846d643dad16580e35f/column.Column<S, C>)) -> @-put:(@_:Rest -> @_:0xf435da9e535b3846d643dad16580e35f/column.Column<S, C> -> Store) -> @-project:(@_:C -> Pair(C, V)) -> @family:0xf435da9e535b3846d643dad16580e35f/component.Family<S, Store, Rest, C, V, Token, take, put, project> -> @tx:0xf435da9e535b3846d643dad16580e35f/transaction.Tx<0xf435da9e535b3846d643dad16580e35f/world.World<S, Store, R, E>, E> -> @handle:0xf435da9e535b3846d643dad16580e35f/world.Handle<S> -> @incoming:C -> Queued<0xf435da9e535b3846d643dad16580e35f/transaction.Tx<0xf435da9e535b3846d643dad16580e35f/world.World<S, Store, R, E>, E>, C>
Stage Some incoming through tx_replace. Immediate refusal returns the original payload in QueueRejected; acceptance consumes it into the deferred command. Visibility and late refusal follow tx_replace/explicit barriers.
template tx_remove source · line 54 · raw
@-S:Data -> @-Store:Type -> @-R:Type -> @-E:Data -> @-Rest:Type -> @-C:Type -> @-V:Data -> @-Token:Data -> @-take:(@_:Store -> Pair(Rest, 0xf435da9e535b3846d643dad16580e35f/column.Column<S, C>)) -> @-put:(@_:Rest -> @_:0xf435da9e535b3846d643dad16580e35f/column.Column<S, C> -> Store) -> @-project:(@_:C -> Pair(C, V)) -> @family:0xf435da9e535b3846d643dad16580e35f/component.Family<S, Store, Rest, C, V, Token, take, put, project> -> @tx:0xf435da9e535b3846d643dad16580e35f/transaction.Tx<0xf435da9e535b3846d643dad16580e35f/world.World<S, Store, R, E>, E> -> @handle:0xf435da9e535b3846d643dad16580e35f/world.Handle<S> -> Queued<0xf435da9e535b3846d643dad16580e35f/transaction.Tx<0xf435da9e535b3846d643dad16580e35f/world.World<S, Store, R, E>, E>, C>
Stage None through tx_replace, without removing the component now. Returns Queued or immediate QueueRejected. Ordinary removal here publishes no removal notice; use tx_remove_observed for an explicit notice callback.
template removal_published source · line 58 · raw
@-S:Data -> @-Store:Type -> @-R:Type -> @-E:Data -> @-Rest:Type -> @-C:Type -> @-V:Data -> @-Token:Data -> @-take:(@_:Store -> Pair(Rest, 0xf435da9e535b3846d643dad16580e35f/column.Column<S, C>)) -> @-put:(@_:Rest -> @_:0xf435da9e535b3846d643dad16580e35f/column.Column<S, C> -> Store) -> @-project:(@_:C -> Pair(C, V)) -> @-record:(@_:0xf435da9e535b3846d643dad16580e35f/world.Handle<S> -> E) -> @handle:0xf435da9e535b3846d643dad16580e35f/world.Handle<S> -> @result:0xf435da9e535b3846d643dad16580e35f/component.Replacement<0xf435da9e535b3846d643dad16580e35f/world.World<S, Store, R, E>, C> -> 0xf435da9e535b3846d643dad16580e35f/world.World<S, Store, R, E>
Observed removal publishes only after successful barrier application and a real owned slot.
template remove_apply_observed source · line 64 · raw
@-S:Data -> @-Store:Type -> @-R:Type -> @-E:Data -> @-Rest:Type -> @-C:Type -> @-V:Data -> @-Token:Data -> @-take:(@_:Store -> Pair(Rest, 0xf435da9e535b3846d643dad16580e35f/column.Column<S, C>)) -> @-put:(@_:Rest -> @_:0xf435da9e535b3846d643dad16580e35f/column.Column<S, C> -> Store) -> @-project:(@_:C -> Pair(C, V)) -> @-record:(@_:0xf435da9e535b3846d643dad16580e35f/world.Handle<S> -> E) -> @family:0xf435da9e535b3846d643dad16580e35f/component.Family<S, Store, Rest, C, V, Token, take, put, project> -> @world:0xf435da9e535b3846d643dad16580e35f/world.World<S, Store, R, E> -> @+handle:0xf435da9e535b3846d643dad16580e35f/world.Handle<S> -> @incoming:Maybe<&1, C> -> 0xf435da9e535b3846d643dad16580e35f/world.World<S, Store, R, E>
template removed_queue_checked source · line 67 · raw
@-S:Data -> @-Store:Type -> @-R:Type -> @-E:Data -> @-Rest:Type -> @-C:Type -> @-V:Data -> @-Token:Data -> @-take:(@_:Store -> Pair(Rest, 0xf435da9e535b3846d643dad16580e35f/column.Column<S, C>)) -> @-put:(@_:Rest -> @_:0xf435da9e535b3846d643dad16580e35f/column.Column<S, C> -> Store) -> @-project:(@_:C -> Pair(C, V)) -> @-record:(@_:0xf435da9e535b3846d643dad16580e35f/world.Handle<S> -> E) -> @allowed:Bool -> @family:0xf435da9e535b3846d643dad16580e35f/component.Family<S, Store, Rest, C, V, Token, take, put, project> -> @world:0xf435da9e535b3846d643dad16580e35f/world.World<S, Store, R, E> -> @undo:List<&1, @_:0xf435da9e535b3846d643dad16580e35f/world.World<S, Store, R, E> -> 0xf435da9e535b3846d643dad16580e35f/world.World<S, Store, R, E>> -> @commands:List<&1, 0xf435da9e535b3846d643dad16580e35f/deferred_command.Command<0xf435da9e535b3846d643dad16580e35f/world.World<S, Store, R, E>>> -> @events:List<&2, E> -> @trace:0xf435da9e535b3846d643dad16580e35f/trace_facts.State -> @handle:0xf435da9e535b3846d643dad16580e35f/world.Handle<S> -> @incoming:Maybe<&1, C> -> Queued<0xf435da9e535b3846d643dad16580e35f/transaction.Tx<0xf435da9e535b3846d643dad16580e35f/world.World<S, Store, R, E>, E>, C>
template removed_queue_join source · line 72 · raw
@-S:Data -> @-Store:Type -> @-R:Type -> @-E:Data -> @-Rest:Type -> @-C:Type -> @-V:Data -> @-Token:Data -> @-take:(@_:Store -> Pair(Rest, 0xf435da9e535b3846d643dad16580e35f/column.Column<S, C>)) -> @-put:(@_:Rest -> @_:0xf435da9e535b3846d643dad16580e35f/column.Column<S, C> -> Store) -> @-project:(@_:C -> Pair(C, V)) -> @-record:(@_:0xf435da9e535b3846d643dad16580e35f/world.Handle<S> -> E) -> @family:0xf435da9e535b3846d643dad16580e35f/component.Family<S, Store, Rest, C, V, Token, take, put, project> -> @checked:Pair(0xf435da9e535b3846d643dad16580e35f/world.World<S, Store, R, E>, Bool) -> @undo:List<&1, @_:0xf435da9e535b3846d643dad16580e35f/world.World<S, Store, R, E> -> 0xf435da9e535b3846d643dad16580e35f/world.World<S, Store, R, E>> -> @commands:List<&1, 0xf435da9e535b3846d643dad16580e35f/deferred_command.Command<0xf435da9e535b3846d643dad16580e35f/world.World<S, Store, R, E>>> -> @events:List<&2, E> -> @trace:0xf435da9e535b3846d643dad16580e35f/trace_facts.State -> @handle:0xf435da9e535b3846d643dad16580e35f/world.Handle<S> -> @incoming:Maybe<&1, C> -> Queued<0xf435da9e535b3846d643dad16580e35f/transaction.Tx<0xf435da9e535b3846d643dad16580e35f/world.World<S, Store, R, E>, E>, C>
template tx_remove_observed source · line 81 · raw
@-S:Data -> @-Store:Type -> @-R:Type -> @-E:Data -> @-Rest:Type -> @-C:Type -> @-V:Data -> @-Token:Data -> @-take:(@_:Store -> Pair(Rest, 0xf435da9e535b3846d643dad16580e35f/column.Column<S, C>)) -> @-put:(@_:Rest -> @_:0xf435da9e535b3846d643dad16580e35f/column.Column<S, C> -> Store) -> @-project:(@_:C -> Pair(C, V)) -> @-record:(@_:0xf435da9e535b3846d643dad16580e35f/world.Handle<S> -> E) -> @family:0xf435da9e535b3846d643dad16580e35f/component.Family<S, Store, Rest, C, V, Token, take, put, project> -> @tx:0xf435da9e535b3846d643dad16580e35f/transaction.Tx<0xf435da9e535b3846d643dad16580e35f/world.World<S, Store, R, E>, E> -> @+handle:0xf435da9e535b3846d643dad16580e35f/world.Handle<S> -> Queued<0xf435da9e535b3846d643dad16580e35f/transaction.Tx<0xf435da9e535b3846d643dad16580e35f/world.World<S, Store, R, E>, E>, C>
Stage removal plus a Data notice callback. Immediate invalid-handle refusal changes no queue. At the barrier a notice is published only when replacement succeeds and a component owner was actually displaced. No notice is emitted for absent/already-invalid targets; this does not return the removed payload or invent finalization of user-owned resources.