~/bend-docscommunity

recognized_query_declaration.bend checks

raw source on the hub · import bendvy-ecs-core@0.1.0.2/recognized_query_declaration.bend as Recognized_query_declaration

11 imports
import Base
import ./compose.bend as Q
import ./ordinary_query_declaration.bend as N
import ./internal/compact_operational_frame.bend as F
import ./ordinary_component_binding.bend as B
import ./column.bend as Col
import ./component.bend as C
import ./capabilities.bend as Cap
import ./ordinary_schema.bend as Schema
import ./ordinary_owned_event_family_resource.bend as Resource
import ./owner_product.bend as Product

Types

type Declaration source · line 23 · raw

@-S:Data -> @-Store:Type -> @-R:Type -> @-E:Data -> @-Ops:(@_:Type -> Type) -> Type

The owner functor is retained before ordinary grant erasure. Raw declarations continue through the existing registration path. A closed query declaration for the recognized App entry, tied to schema S and its component/resource owners. Ops gives the same declared capabilities for both ordinary and compact execution; callbacks must return their opaque owner. Use write, resource_write and pair below. This additive surface does not supply all ordinary query combinators or an adapter for arbitrary custom selectors. Complete setup: the Sparse consumer's motion.bend:recognized and motion-driver.bend:define under test-fixtures/connected-performance/ sparse-motion64/consumer/s-perf/canonical-api-v1/sparse-runtime-v1/.

Templates

template ordinary source · line 28 · raw

@-S:Data -> @-Store:Type -> @-R:Type -> @-E:Data -> @-Ops:(@_:Type -> Type) -> @declaration:Declaration<S, Store, R, E, Ops> -> 0xb2b0f04555daca474f0f77d0966945c9/ordinary_query_declaration.Declaration<S, 0xb2b0f04555daca474f0f77d0966945c9/compose.Frame<S, Store, R, E>, Ops(0xb2b0f04555daca474f0f77d0966945c9/compose.Frame<S, Store, R, E>)>

Convert the recognized declaration into its ordinary operational declaration. Consumes the carrier; call a closed declaration template again when both forms are needed. Selection, access clauses and grants come from this same carrier.

template caps source · line 34 · raw

@-S:Data -> @-Store:Type -> @-R:Type -> @-E:Data -> @-Ops:(@_:Type -> Type) -> @declaration:Declaration<S, Store, R, E, Ops> -> Ops(0xb2b0f04555daca474f0f77d0966945c9/internal/compact_operational_frame.Frame<S, Store, R, E>)

Advanced runner projection: consume the declaration and obtain operations for the compact opaque frame. Application callbacks receive these through their Ops parameter; they should not construct or unwrap a compact frame themselves.

template selector source · line 40 · raw

@-S:Data -> @-Store:Type -> @-R:Type -> @-E:Data -> @-Ops:(@_:Type -> Type) -> @declaration:Declaration<S, Store, R, E, Ops> -> @_:0xb2b0f04555daca474f0f77d0966945c9/internal/compact_operational_frame.Frame<S, Store, R, E> -> Pair(0xb2b0f04555daca474f0f77d0966945c9/internal/compact_operational_frame.Frame<S, Store, R, E>, Bool)

Advanced runner projection: consume the declaration and obtain its row filter. The filter returns the updated frame even when the row does not match. This operation does not enumerate entities or grant access beyond the declaration.

template write_caps source · line 47 · raw

@-S:Data -> @-Store:Type -> @-R:Type -> @-E:Data -> @-Rest:Type -> @-P:Type -> @-V:Data -> @-Token:Data -> @-take:(@_:Store -> Pair(Rest, 0xb2b0f04555daca474f0f77d0966945c9/column.Column<S, P>)) -> @-put:(@_:Rest -> @_:0xb2b0f04555daca474f0f77d0966945c9/column.Column<S, P> -> Store) -> @-view:(@_:P -> Pair(P, V)) -> @-binding:0xb2b0f04555daca474f0f77d0966945c9/ordinary_component_binding.Binding<S, Store, Rest, P, V, Token, take, put, view> -> 0xb2b0f04555daca474f0f77d0966945c9/capabilities.Write<0xb2b0f04555daca474f0f77d0966945c9/internal/compact_operational_frame.Frame<S, Store, R, E>, P, V>

Internal capability assembly for write; the binding fixes the component path. The getter threads its payload back with a Data view; the setter uses the ordinary transactional write path. Prefer write in setup.

template write source · line 54 · raw

@-S:Data -> @-Store:Type -> @-R:Type -> @-E:Data -> @-Rest:Type -> @-P:Type -> @-V:Data -> @-Token:Data -> @-take:(@_:Store -> Pair(Rest, 0xb2b0f04555daca474f0f77d0966945c9/column.Column<S, P>)) -> @-put:(@_:Rest -> @_:0xb2b0f04555daca474f0f77d0966945c9/column.Column<S, P> -> Store) -> @-view:(@_:P -> Pair(P, V)) -> @-binding:0xb2b0f04555daca474f0f77d0966945c9/ordinary_component_binding.Binding<S, Store, Rest, P, V, Token, take, put, view> -> Declaration<S, Store, R, E, H => 0xb2b0f04555daca474f0f77d0966945c9/capabilities.Write<H, P, V>>

Declare required read/write access to one schema-bound component family. Only matching rows invoke the body. P may be an affine Type; view threads P back together with a Data observation V. take/put describe the same store path as binding. The returned declaration supplies Cap.Write; access failures still flow through the query's normal error/rollback result.

template resource_caps source · line 59 · raw

@-S:Data -> @-Store:Type -> @-R:Type -> @-Logs:Type -> @-E:Data -> @-V:Data -> @-view:(@_:R -> Pair(R, V)) -> 0xb2b0f04555daca474f0f77d0966945c9/capabilities.ValueWrite<0xb2b0f04555daca474f0f77d0966945c9/internal/compact_operational_frame.Frame<S, Store, 0xb2b0f04555daca474f0f77d0966945c9/owner_product.Owner<R, Logs>, E>, R, V>

Internal capability assembly for resource_write. Keeps the resource and Logs owners together and uses the ordinary resource transaction bridge; this is not a direct application resource handle or permission to bypass rollback.

template resource_write source · line 66 · raw

@-S:Data -> @-Store:Type -> @-R:Type -> @-Logs:Type -> @-E:Data -> @-V:Data -> @-identity:0xb2b0f04555daca474f0f77d0966945c9/ordinary_schema.Resource<S, R> -> @-view:(@_:R -> Pair(R, V)) -> Declaration<S, Store, 0xb2b0f04555daca474f0f77d0966945c9/owner_product.Owner<R, Logs>, E, H => 0xb2b0f04555daca474f0f77d0966945c9/capabilities.ValueWrite<H, R, V>>

Declare read/write access to a schema resource whose owner is paired with Logs. The owner-preserving view returns a Data value; resource selection alone does not exclude an entity row. The supplied identity determines declared access. Writes retain the ordinary resource undo/rollback behavior. Pair this with a component declaration when the body also needs a current entity component.

template pair_caps source · line 70 · raw

@-S:Data -> @-Store:Type -> @-R:Type -> @-E:Data -> @-L:(@_:Type -> Type) -> @-Right:(@_:Type -> Type) -> @-left:Declaration<S, Store, R, E, L> -> @-right:Declaration<S, Store, R, E, Right> -> Pair(L(0xb2b0f04555daca474f0f77d0966945c9/internal/compact_operational_frame.Frame<S, Store, R, E>), Right(0xb2b0f04555daca474f0f77d0966945c9/internal/compact_operational_frame.Frame<S, Store, R, E>))

Internal grant assembly for pair: produce left and right operation bundles for the same compact owner. Prefer pair rather than assembling these manually.

template pair source · line 77 · raw

@-S:Data -> @-Store:Type -> @-R:Type -> @-E:Data -> @-L:(@_:Type -> Type) -> @-Right:(@_:Type -> Type) -> @-left:Declaration<S, Store, R, E, L> -> @-right:Declaration<S, Store, R, E, Right> -> Declaration<S, Store, R, E, H => Pair(L(H), Right(H))>

Combine two declarations for the same schema/store/resource owners. The body receives (leftCaps, rightCaps) in that order. Selection runs left first; if it returns False, right is not called, and the returned owner is preserved. The ordinary form keeps the same clause order, including duplicate clauses; this does not promise that two grants refer to disjoint component columns.