~/bend-docscommunity

check.bend checks

raw source on the hub · import bendvy-ecs-core@0.1.0.1/check.bend as Check

7 imports
import Base
import inspector.bend as I
import inspector_query_projection.bend as Q
import world.bend as W
import component.bend as C
import column.bend as Col
import capabilities.bend as Cap

Types

type Frame source · line 15 · raw

@-S:Data -> @-Store:Type -> @-R:Type -> @-E:Data -> Type

Trusted declaration setup receives a nominal cursor-free frame. The public query grant exposes neither lifecycle filters nor added/changed observations. Machine conditions belong to #55; services/streams have no grant here. Trusted cursor-free Check frame owning World. Ordinary condition bodies receive opaque H with read capabilities, not raw world constructors. No lifecycle cursor or event reader is allocated by this frame.

type PlainSelection source · line 19 · raw

Data

Condition query membership: Required excludes absent components; Optional retains live rows with explicit absence. No Added/Changed mode is offered.

type Row source · line 24 · raw

@S:Data -> @V:Data -> Data

Detached condition-query row: entity handle plus component Access<V>. Does not expose added/changed flags or an affine component payload.

type Error source · line 28 · raw

Data

Preflight failure listing required runtime resources absent from the plan. Check body is not invoked when this error is returned.

type Plan source · line 33 · raw

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

Trusted setup pairing runtime-requirement observation with read grants. required must return World; arbitrary callback mutations are not isolated by the Check abstraction. Bodies receive only the declared Ops(H).

type Checked source · line 37 · raw

@S:Data -> @Store:Type -> @R:Type -> @E:Data -> Type

Check outcome retaining World with either a preflight Error or Bool. False is a successful condition result, distinct from missing requirements.

Definitions

def selection source · line 40 · raw

@value:PlainSelection -> 0xf435da9e535b3846d643dad16580e35f/inspector_query_projection.Selection

Templates

template plain_row source · line 44 · raw

@-S:Data -> @-V:Data -> @value:0xf435da9e535b3846d643dad16580e35f/inspector_query_projection.Row<S, V> -> Row<S, V>

template plain_rows source · line 47 · raw

@-S:Data -> @-V:Data -> @values:List<&2, 0xf435da9e535b3846d643dad16580e35f/inspector_query_projection.Row<S, V>> -> List<&2, Row<S, V>>

template query_done source · line 51 · raw

@-S:Data -> @-Store:Type -> @-R:Type -> @-E:Data -> @-V:Data -> @result:Pair(0xf435da9e535b3846d643dad16580e35f/inspector.Frame<S, Store, R, E>, List<&2, 0xf435da9e535b3846d643dad16580e35f/inspector_query_projection.Row<S, V>>) -> Pair(Frame<S, Store, R, E>, List<&2, Row<S, V>>)

template query_read source · line 54 · raw

@-S:Data -> @-Store:Type -> @-R:Type -> @-E:Data -> @-Rest:Type -> @-Payload:Type -> @-V:Data -> @-Token:Data -> @-take:(@_:Store -> Pair(Rest, 0xf435da9e535b3846d643dad16580e35f/column.Column<S, Payload>)) -> @-put:(@_:Rest -> @_:0xf435da9e535b3846d643dad16580e35f/column.Column<S, Payload> -> Store) -> @-project:(@_:Payload -> Pair(Payload, V)) -> @-family:0xf435da9e535b3846d643dad16580e35f/component.Family<S, Store, Rest, Payload, V, Token, take, put, project> -> @-mode:PlainSelection -> @frame:Frame<S, Store, R, E> -> Pair(Frame<S, Store, R, E>, List<&2, Row<S, V>>)

template query_grant source · line 61 · raw

@-S:Data -> @-Store:Type -> @-R:Type -> @-E:Data -> @-Rest:Type -> @-Payload:Type -> @-V:Data -> @-Token:Data -> @-take:(@_:Store -> Pair(Rest, 0xf435da9e535b3846d643dad16580e35f/column.Column<S, Payload>)) -> @-put:(@_:Rest -> @_:0xf435da9e535b3846d643dad16580e35f/column.Column<S, Payload> -> Store) -> @-project:(@_:Payload -> Pair(Payload, V)) -> @-family:0xf435da9e535b3846d643dad16580e35f/component.Family<S, Store, Rest, Payload, V, Token, take, put, project> -> @-mode:PlainSelection -> 0xf435da9e535b3846d643dad16580e35f/capabilities.ValueRead<Frame<S, Store, R, E>, List<&2, Row<S, V>>>

Build a read-only component query for Required or Optional membership. Canonical scan returns detached Access rows in its live-handle traversal order, without lifecycle flags or consuming registered system cursors. project must preserve payload owners; raw family lenses remain trusted schema setup.

template resource_done source · line 63 · raw

@-S:Data -> @-Store:Type -> @-R:Type -> @-E:Data -> @-V:Data -> @result:Pair(0xf435da9e535b3846d643dad16580e35f/world.World<S, Store, R, E>, V) -> Pair(Frame<S, Store, R, E>, V)

template resource_read source · line 66 · raw

@-S:Data -> @-Store:Type -> @-R:Type -> @-E:Data -> @-V:Data -> @-project:(@_:R -> Pair(R, V)) -> @frame:Frame<S, Store, R, E> -> Pair(Frame<S, Store, R, E>, V)

template resource_grant source · line 72 · raw

@-S:Data -> @-Store:Type -> @-R:Type -> @-E:Data -> @-V:Data -> @-project:(@_:R -> Pair(R, V)) -> 0xf435da9e535b3846d643dad16580e35f/capabilities.ValueRead<Frame<S, Store, R, E>, V>

Build read-only access to a detached resource Data view. project threads affine R back unchanged in ownership; no replacement or event-read grant is provided and no resource projection runs during declaration construction.

template completed source · line 75 · raw

@-S:Data -> @-Store:Type -> @-R:Type -> @-E:Data -> @result:Pair(Frame<S, Store, R, E>, Bool) -> Checked<S, Store, R, E>

template ready source · line 78 · raw

@-S:Data -> @-Store:Type -> @-R:Type -> @-E:Data -> @-Ops:(@_:Type -> Type) -> @-A:Data -> @-body:(@-H:Type -> @-caps:Ops(H) -> @_:A -> @_:H -> Pair(H, Bool)) -> @-caps:Ops(Frame<S, Store, R, E>) -> @args:A -> @result:Pair(0xf435da9e535b3846d643dad16580e35f/world.World<S, Store, R, E>, List<&2, String>) -> Checked<S, Store, R, E>

template required_field source · line 82 · raw

@-S:Data -> @-Store:Type -> @-R:Type -> @-E:Data -> @-Ops:(@_:Type -> Type) -> @plan:Plan<S, Store, R, E, Ops> -> @_:0xf435da9e535b3846d643dad16580e35f/world.World<S, Store, R, E> -> Pair(0xf435da9e535b3846d643dad16580e35f/world.World<S, Store, R, E>, List<&2, String>)

template caps_field source · line 85 · raw

@-S:Data -> @-Store:Type -> @-R:Type -> @-E:Data -> @-Ops:(@_:Type -> Type) -> @plan:Plan<S, Store, R, E, Ops> -> Ops(Frame<S, Store, R, E>)

template run source · line 95 · raw

@-S:Data -> @-Store:Type -> @-R:Type -> @-E:Data -> @-Ops:(@_:Type -> Type) -> @-A:Data -> @-body:(@-H:Type -> @-caps:Ops(H) -> @_:A -> @_:H -> Pair(H, Bool)) -> @-plan:Plan<S, Store, R, E, Ops> -> @args:A -> @world:0xf435da9e535b3846d643dad16580e35f/world.World<S, Store, R, E> -> Checked<S, Store, R, E>

Check runtime requirements, then evaluate a cursor-free Bool body through its declared capabilities. Missing requirements return Checked with Fail without invoking body; otherwise Done contains True or False. World is returned on both paths, including any changes made by trusted requirement callbacks. Check itself advances no system/lifecycle/event cursor or clock. No automatic transaction rollback applies to arbitrary setup callbacks. Condition contract and consumers: docs/parity/inspect.md.