~/bend-docscommunity

ordinary_app_hierarchy_query.bend checks

raw source on the hub · import 0x67fd5084c1da4adc13317822045bb11f/ordinary_app_hierarchy_query.bend as Ordinary_app_hierarchy_query

17 imports
import Base
import ./change_tick.bend as Tick
import ./ordinary_app_hierarchy.bend as App
import ./ordinary_app_relation.bend as Relation
import ./ordinary_app_composer.bend as Build
import ./ordinary_app_observation_data.bend as DTO
import ./ordinary_app_registration_fields.bend as Fields
import ./relation_types.bend as G
import ./relation_commands.bend as A
import ./hierarchy_traversal_provider.bend as H
import ./hierarchy_provider.bend as Path
import ./hierarchy_traversal.bend as Traversal
import ./ordinary_query_declaration.bend as Query
import ./ordinary_system.bend as System
import ./compose.bend as Q
import ./transaction.bend as Tx
import ./world.bend as W

Templates

template live_prepend source · line 21 · raw

@-S:Data -> @-C:Type -> @-R:Type -> @-E:Data -> @selected:Bool -> @handle:0x67fd5084c1da4adc13317822045bb11f/world.Handle<S> -> @observed:Pair(0x67fd5084c1da4adc13317822045bb11f/ordinary_app_relation.World(S, C, R, E), List<&2, 0x67fd5084c1da4adc13317822045bb11f/world.Handle<S>>) -> Pair(0x67fd5084c1da4adc13317822045bb11f/ordinary_app_relation.World(S, C, R, E), List<&2, 0x67fd5084c1da4adc13317822045bb11f/world.Handle<S>>)

Query membership requires a live handle independently of its declaration. Preserve the raw traversal path; this only chooses the query invocation list.

template live_checked source · line 25 · raw

@-S:Data -> @-C:Type -> @-R:Type -> @-E:Data -> @handle:0x67fd5084c1da4adc13317822045bb11f/world.Handle<S> -> @observed:Pair(0x67fd5084c1da4adc13317822045bb11f/ordinary_app_relation.World(S, C, R, E), Bool) -> @next:(@_:0x67fd5084c1da4adc13317822045bb11f/ordinary_app_relation.World(S, C, R, E) -> Pair(0x67fd5084c1da4adc13317822045bb11f/ordinary_app_relation.World(S, C, R, E), List<&2, 0x67fd5084c1da4adc13317822045bb11f/world.Handle<S>>)) -> Pair(0x67fd5084c1da4adc13317822045bb11f/ordinary_app_relation.World(S, C, R, E), List<&2, 0x67fd5084c1da4adc13317822045bb11f/world.Handle<S>>)

template live_handles source · line 28 · raw

@-S:Data -> @-C:Type -> @-R:Type -> @-E:Data -> @handles:List<&2, 0x67fd5084c1da4adc13317822045bb11f/world.Handle<S>> -> @world:0x67fd5084c1da4adc13317822045bb11f/ordinary_app_relation.World(S, C, R, E) -> Pair(0x67fd5084c1da4adc13317822045bb11f/ordinary_app_relation.World(S, C, R, E), List<&2, 0x67fd5084c1da4adc13317822045bb11f/world.Handle<S>>)

template executed source · line 35 · raw

@-S:Data -> @-C:Type -> @-R:Type -> @-E:Data -> @-U:Data -> @-Out:Data -> @path:Maybe<&2, 0x67fd5084c1da4adc13317822045bb11f/hierarchy_provider.Path<S>> -> @result:0x67fd5084c1da4adc13317822045bb11f/compose.Executed<0x67fd5084c1da4adc13317822045bb11f/ordinary_app_relation.World(S, C, R, E), 0x67fd5084c1da4adc13317822045bb11f/compose.Error<U>, Out> -> Pair(0x67fd5084c1da4adc13317822045bb11f/ordinary_app_relation.World(S, C, R, E), 0x67fd5084c1da4adc13317822045bb11f/ordinary_app_observation_data.Product<Maybe<&2, 0x67fd5084c1da4adc13317822045bb11f/hierarchy_provider.Path<S>>, Maybe<&2, 0x67fd5084c1da4adc13317822045bb11f/ordinary_app_observation_data.Product<0x67fd5084c1da4adc13317822045bb11f/transaction.Outcome<0x67fd5084c1da4adc13317822045bb11f/compose.Error<U>>, List<&2, Out>>>>)

Keep the hierarchy diagnostic and existing composition result separately. The gameplay callback receives only the retained declaration's opaque owner.

template complete_live source · line 38 · raw

@-S:Data -> @-C:Type -> @-R:Type -> @-E:Data -> @-Ops:(@_:Type -> Type) -> @-Arg:Data -> @-U:Data -> @-Out:Data -> @-query:0x67fd5084c1da4adc13317822045bb11f/ordinary_query_declaration.Declaration<S, 0x67fd5084c1da4adc13317822045bb11f/compose.Frame<S, 0x67fd5084c1da4adc13317822045bb11f/relation_commands.Store<S, C>, R, 0x67fd5084c1da4adc13317822045bb11f/relation_commands.Notice<S, E>>, Ops(0x67fd5084c1da4adc13317822045bb11f/compose.Frame<S, 0x67fd5084c1da4adc13317822045bb11f/relation_commands.Store<S, C>, R, 0x67fd5084c1da4adc13317822045bb11f/relation_commands.Notice<S, E>>)> -> @-body:(@-H:Type -> @-caps:Ops(H) -> @_:Arg -> @_:H -> Pair(H, Pair(0x67fd5084c1da4adc13317822045bb11f/transaction.Outcome<U>, Out))) -> @path:Maybe<&2, 0x67fd5084c1da4adc13317822045bb11f/hierarchy_provider.Path<S>> -> @args:Arg -> @cursor:Maybe<&2, 0x67fd5084c1da4adc13317822045bb11f/change_tick.Tick> -> @observed:Pair(0x67fd5084c1da4adc13317822045bb11f/ordinary_app_relation.World(S, C, R, E), List<&2, 0x67fd5084c1da4adc13317822045bb11f/world.Handle<S>>) -> Pair(0x67fd5084c1da4adc13317822045bb11f/ordinary_app_relation.World(S, C, R, E), 0x67fd5084c1da4adc13317822045bb11f/ordinary_app_observation_data.Product<Maybe<&2, 0x67fd5084c1da4adc13317822045bb11f/hierarchy_provider.Path<S>>, Maybe<&2, 0x67fd5084c1da4adc13317822045bb11f/ordinary_app_observation_data.Product<0x67fd5084c1da4adc13317822045bb11f/transaction.Outcome<0x67fd5084c1da4adc13317822045bb11f/compose.Error<U>>, List<&2, Out>>>>)

template selected_path source · line 40 · raw

@-S:Data -> @-C:Type -> @-R:Type -> @-E:Data -> @-Ops:(@_:Type -> Type) -> @-Arg:Data -> @-U:Data -> @-Out:Data -> @-query:0x67fd5084c1da4adc13317822045bb11f/ordinary_query_declaration.Declaration<S, 0x67fd5084c1da4adc13317822045bb11f/compose.Frame<S, 0x67fd5084c1da4adc13317822045bb11f/relation_commands.Store<S, C>, R, 0x67fd5084c1da4adc13317822045bb11f/relation_commands.Notice<S, E>>, Ops(0x67fd5084c1da4adc13317822045bb11f/compose.Frame<S, 0x67fd5084c1da4adc13317822045bb11f/relation_commands.Store<S, C>, R, 0x67fd5084c1da4adc13317822045bb11f/relation_commands.Notice<S, E>>)> -> @-body:(@-H:Type -> @-caps:Ops(H) -> @_:Arg -> @_:H -> Pair(H, Pair(0x67fd5084c1da4adc13317822045bb11f/transaction.Outcome<U>, Out))) -> @args:Arg -> @cursor:Maybe<&2, 0x67fd5084c1da4adc13317822045bb11f/change_tick.Tick> -> @observed:Pair(0x67fd5084c1da4adc13317822045bb11f/ordinary_app_relation.World(S, C, R, E), Maybe<&2, 0x67fd5084c1da4adc13317822045bb11f/hierarchy_provider.Path<S>>) -> Pair(0x67fd5084c1da4adc13317822045bb11f/ordinary_app_relation.World(S, C, R, E), 0x67fd5084c1da4adc13317822045bb11f/ordinary_app_observation_data.Product<Maybe<&2, 0x67fd5084c1da4adc13317822045bb11f/hierarchy_provider.Path<S>>, Maybe<&2, 0x67fd5084c1da4adc13317822045bb11f/ordinary_app_observation_data.Product<0x67fd5084c1da4adc13317822045bb11f/transaction.Outcome<0x67fd5084c1da4adc13317822045bb11f/compose.Error<U>>, List<&2, Out>>>>)

template visit_descendants_app source · line 56 · raw

@-S:Data -> @-C:Type -> @-R:Type -> @-E:Data -> @-hierarchy:0x67fd5084c1da4adc13317822045bb11f/relation_types.HierarchyDescriptor<S> -> @-Owners:Type -> @-Rows:Data -> @-prior:(@_:0x67fd5084c1da4adc13317822045bb11f/ordinary_app_relation.World(S, C, R, E) -> Pair(0x67fd5084c1da4adc13317822045bb11f/ordinary_app_relation.World(S, C, R, E), 0x67fd5084c1da4adc13317822045bb11f/ordinary_app_observation_data.Observation<Rows>)) -> @-fold:(@_:Owners -> Pair(Owners, List<&2, 0x67fd5084c1da4adc13317822045bb11f/ordinary_app_registration_fields.Fields<S>>)) -> @-Ops:(@_:Type -> Type) -> @-Arg:Data -> @-U:Data -> @-Out:Data -> @-query:0x67fd5084c1da4adc13317822045bb11f/ordinary_query_declaration.Declaration<S, 0x67fd5084c1da4adc13317822045bb11f/compose.Frame<S, 0x67fd5084c1da4adc13317822045bb11f/relation_commands.Store<S, C>, R, 0x67fd5084c1da4adc13317822045bb11f/relation_commands.Notice<S, E>>, Ops(0x67fd5084c1da4adc13317822045bb11f/compose.Frame<S, 0x67fd5084c1da4adc13317822045bb11f/relation_commands.Store<S, C>, R, 0x67fd5084c1da4adc13317822045bb11f/relation_commands.Notice<S, E>>)> -> @-body:(@-H:Type -> @-caps:Ops(H) -> @_:Arg -> @_:H -> Pair(H, Pair(0x67fd5084c1da4adc13317822045bb11f/transaction.Outcome<U>, Out))) -> @app:0x67fd5084c1da4adc13317822045bb11f/ordinary_app_hierarchy.Application(S, C, R, E, hierarchy, Owners, Rows, prior, fold) -> @target:0x67fd5084c1da4adc13317822045bb11f/world.Handle<S> -> @order:0x67fd5084c1da4adc13317822045bb11f/hierarchy_traversal.Order -> @args:Arg -> @cursor:Maybe<&2, 0x67fd5084c1da4adc13317822045bb11f/change_tick.Tick> -> Pair(0x67fd5084c1da4adc13317822045bb11f/ordinary_app_hierarchy.Application(S, C, R, E, hierarchy, Owners, Rows, prior, fold), 0x67fd5084c1da4adc13317822045bb11f/ordinary_app_observation_data.Product<Maybe<&2, 0x67fd5084c1da4adc13317822045bb11f/hierarchy_provider.Path<S>>, Maybe<&2, 0x67fd5084c1da4adc13317822045bb11f/ordinary_app_observation_data.Product<0x67fd5084c1da4adc13317822045bb11f/transaction.Outcome<0x67fd5084c1da4adc13317822045bb11f/compose.Error<U>>, List<&2, Out>>>>)

Run a declared query over a complete descendant traversal and return the App. Invalid target yields (None, None); incomplete traversal retains its diagnostic but returns no execution result and invokes no partial gameplay callbacks. For a complete path, revalidate each handle, retain live members in traversal order, then apply the declaration's selectors and opaque-owner body. Preserve the original raw path separately from the execution outcome and output list. Transaction failure rolls back through ordinary query semantics and clears row outputs. args and cursor are supplied for this invocation; this does not register or advance an App reader. Structural commands still require an explicit barrier. Uses only declared capabilities; it does not widen authority to arbitrary graph access. See docs/parity/hierarchy.md, ordinary App descendant-query scenarios.