ordinary_app_resource_field_declaration.bend checks
raw source on the hub · import bendvy-ecs-core@0.1.0.5/ordinary_app_resource_field_declaration.bend as Ordinary_app_resource_field_declaration
21 imports
import Base import ./schema_fragments.bend as Fragments import ./relation_commands.bend as RelationWorld import ./relation_providers.bend as RelationOps import ./ordinary_app_relation.bend as Relation import ./relation_failure_reader.bend as RelationDecl import ./relation_types.bend as RelationTypes import ./ordinary_app_observation_data.bend as DTO import ./machine.bend as Machine import ./ordinary_machine_declaration.bend as MachineDecl import ./ordinary_machine_operations.bend as MachineOps import ./inspector.bend as Inspect import ./capabilities.bend as Cap import ./ordinary_query_declaration.bend as Query import ./resource_field_binding.bend as Binding import ./resource_field.bend as Lens import ./ordinary_resource_field_system.bend as Field import ./ordinary_schema.bend as Schema import ./owner_product.bend as Product import ./world.bend as W import ./transaction.bend as T
Types
type Declaration source · line 29 · raw
@-S:Data -> @-C:Type -> @-R:Type -> @-E:Data -> @-Ops:(@_:Type -> Type) -> @-V:Data -> Type
Same canonical field binding drives the grant and detached owning observation. App declaration for a selected resource field or a declared machine/relation. Combines an operational grant with its owner-threading Data observation and renderer. Schema and resource path are fixed by the typed constructors below; there is no live resource owner in this declaration. Ordinary resource-field operations and explicit recoverable operations are distinct APIs; see ordinary-recovery-resource-field for returned recovery owners.
Declaration@-S:Data -> @-C:Type -> @-R:Type -> @-E:Data -> @-Ops:(@_:Type -> Type) -> @-V:Data -> @ordinary:0x2a0aaf4f2cb3f416a9b91fd887916a5d/ordinary_resource_field_system.Declaration<S, 0x2a0aaf4f2cb3f416a9b91fd887916a5d/transaction.Tx<0x2a0aaf4f2cb3f416a9b91fd887916a5d/world.World<S, C, R, E>, E>, Ops(0x2a0aaf4f2cb3f416a9b91fd887916a5d/transaction.Tx<0x2a0aaf4f2cb3f416a9b91fd887916a5d/world.World<S, C, R, E>, E>)> -> @observe:(@_:0x2a0aaf4f2cb3f416a9b91fd887916a5d/world.World<S, C, R, E> -> Pair(0x2a0aaf4f2cb3f416a9b91fd887916a5d/world.World<S, C, R, E>, V)) -> @render:(@_:V -> String) -> Declaration<S, C, R, E, Ops, V>
Templates
template read_ops source · line 34 · raw
@-S:Data -> @-P:Type -> @-identity:0x2a0aaf4f2cb3f416a9b91fd887916a5d/ordinary_schema.Resource<S, P> -> @-V:Data -> @H:Type -> Type
Operation-family alias for reading one declared field as a Data view. The resource identity remains in the grant type, so equal payload types do not make distinct schema resource declarations interchangeable.
template write_ops source · line 39 · raw
@-S:Data -> @-P:Type -> @-identity:0x2a0aaf4f2cb3f416a9b91fd887916a5d/ordinary_schema.Resource<S, P> -> @-V:Data -> @H:Type -> Type
Operation-family alias for reading and replacing one declared field P. Replacement consumes P; the enclosing resource and affine sibling owners stay inside the opaque callback owner H.
template read source · line 47 · raw
@-S:Data -> @-C:Type -> @-R:Type -> @-E:Data -> @-P:Type -> @-Rest:Type -> @-V:Data -> @-lens:0x2a0aaf4f2cb3f416a9b91fd887916a5d/owner_product.Lens<R, P, Rest> -> @-identity:0x2a0aaf4f2cb3f416a9b91fd887916a5d/ordinary_schema.Resource<S, P> -> @-binding:0x2a0aaf4f2cb3f416a9b91fd887916a5d/resource_field_binding.Binding<S, R, P, Rest, lens, identity> -> @-view:(@_:P -> Pair(P, V)) -> @-render:(@_:V -> String) -> Declaration<S, C, R, E, read_ops(S, P, identity, V), V>
Declare selected-field read access through the canonical binding. lens, identity and binding must describe the same field of resource owner R; view threads the selected P back with Data V. The observer uses that same lens and view, returning the World and siblings rather than exposing live aliases. Construct bindings with resource-field-binding; do not supply a metadata-only name as authority. No field operation runs while building this declaration.
template write source · line 56 · raw
@-S:Data -> @-C:Type -> @-R:Type -> @-E:Data -> @-P:Type -> @-Rest:Type -> @-V:Data -> @-lens:0x2a0aaf4f2cb3f416a9b91fd887916a5d/owner_product.Lens<R, P, Rest> -> @-identity:0x2a0aaf4f2cb3f416a9b91fd887916a5d/ordinary_schema.Resource<S, P> -> @-binding:0x2a0aaf4f2cb3f416a9b91fd887916a5d/resource_field_binding.Binding<S, R, P, Rest, lens, identity> -> @-view:(@_:P -> Pair(P, V)) -> @-render:(@_:V -> String) -> Declaration<S, C, R, E, write_ops(S, P, identity, V), V>
Declare selected-field read/replacement access through the canonical binding. The setter journals the displaced field and threads siblings through the lens; a failed transaction restores its recorded field owner. With tracing enabled, the declared view/render functions supply before/after resource observations. view returns P with its observation; render receives only detached V and returns String. This is not general rollback for projector side effects or IO. For explicit displaced/rejected owner recovery, use ordinary-recovery-resource-field rather than this declaration.
template ordinary source · line 60 · raw
@-S:Data -> @-C:Type -> @-R:Type -> @-E:Data -> @-Ops:(@_:Type -> Type) -> @-V:Data -> @declaration:Declaration<S, C, R, E, Ops, V> -> 0x2a0aaf4f2cb3f416a9b91fd887916a5d/ordinary_resource_field_system.Declaration<S, 0x2a0aaf4f2cb3f416a9b91fd887916a5d/transaction.Tx<0x2a0aaf4f2cb3f416a9b91fd887916a5d/world.World<S, C, R, E>, E>, Ops(0x2a0aaf4f2cb3f416a9b91fd887916a5d/transaction.Tx<0x2a0aaf4f2cb3f416a9b91fd887916a5d/world.World<S, C, R, E>, E>)>
Advanced App projection: consume this declaration and obtain its operational field grant and access clauses. This does not register a system or run a write.
template observer source · line 65 · raw
@-S:Data -> @-C:Type -> @-R:Type -> @-E:Data -> @-Ops:(@_:Type -> Type) -> @-V:Data -> @declaration:Declaration<S, C, R, E, Ops, V> -> @_:0x2a0aaf4f2cb3f416a9b91fd887916a5d/world.World<S, C, R, E> -> Pair(0x2a0aaf4f2cb3f416a9b91fd887916a5d/world.World<S, C, R, E>, V)
Advanced App projection: consume this declaration to obtain its World-returning Data observer. Observing uses the declared projection; no live owner is copied.
template renderer source · line 70 · raw
@-S:Data -> @-C:Type -> @-R:Type -> @-E:Data -> @-Ops:(@_:Type -> Type) -> @-V:Data -> @declaration:Declaration<S, C, R, E, Ops, V> -> @_:V -> String
Obtain the declared V -> String renderer, consuming the declaration. The renderer receives only a Data view, not the selected affine field.
template names source · line 74 · raw
@-S:Data -> @clauses:List<&2, 0x2a0aaf4f2cb3f416a9b91fd887916a5d/ordinary_query_declaration.Clause<S>> -> String
template name source · line 81 · raw
@-S:Data -> @-C:Type -> @-R:Type -> @-E:Data -> @-Ops:(@_:Type -> Type) -> @-V:Data -> @declaration:Declaration<S, C, R, E, Ops, V> -> String
Return clause keys in declaration order, comma-separated, consuming the carrier. The returned display string is not a schema identity or capability.
template presenter source · line 85 · raw
@-S:Data -> @-C:Type -> @-R:Type -> @-E:Data -> @-Ops:(@_:Type -> Type) -> @-V:Data -> @declaration:Declaration<S, C, R, E, Ops, V> -> @_:V -> String
App-facing alias of renderer for the same declaration and Data view. Consumes the carrier; it performs no read, write or registration itself.
template machine_ops source · line 92 · raw
@-S:Data -> @-K:Data -> @-V:Data -> @H:Type -> Type
The same declared machine supplies its grant, access name and current observer. Operation-family alias for reading a declared machine's CurrentView and submitting QueueInput. The write input is a queued transition request, not a replacement for the complete resource owner or immediate transition execution.
template machine_presented source · line 94 · raw
@-S:Data -> @-K:Data -> @-V:Data -> @-C:Type -> @-R:Type -> @-E:Data -> @result:Pair(0x2a0aaf4f2cb3f416a9b91fd887916a5d/inspector.Frame<S, C, R, E>, 0x2a0aaf4f2cb3f416a9b91fd887916a5d/machine.CurrentView<S, K, V>) -> Pair(0x2a0aaf4f2cb3f416a9b91fd887916a5d/world.World<S, C, R, E>, 0x2a0aaf4f2cb3f416a9b91fd887916a5d/machine.CurrentView<S, K, V>)
template machine_observe source · line 100 · raw
@-S:Data -> @-K:Data -> @-V:Data -> @-C:Type -> @-R:Type -> @-E:Data -> @-take:(@_:R -> Pair(R, 0x2a0aaf4f2cb3f416a9b91fd887916a5d/machine.Slot<S, K, V>)) -> @-machine:0x2a0aaf4f2cb3f416a9b91fd887916a5d/ordinary_machine_declaration.Declaration<S, K, V, R, take> -> @world:0x2a0aaf4f2cb3f416a9b91fd887916a5d/world.World<S, C, R, E> -> Pair(0x2a0aaf4f2cb3f416a9b91fd887916a5d/world.World<S, C, R, E>, 0x2a0aaf4f2cb3f416a9b91fd887916a5d/machine.CurrentView<S, K, V>)
Advanced observation route for the declared machine's current value. Returns (World, CurrentView), including Unavailable when the slot has no value; uses a fresh inspector cursor and does not run queued transitions.
template machine_render source · line 102 · raw
@-S:Data -> @-K:Data -> @-V:Data -> @-render:(@_:V -> String) -> @view:0x2a0aaf4f2cb3f416a9b91fd887916a5d/machine.CurrentView<S, K, V> -> String
template machine_write source · line 112 · raw
@-S:Data -> @-K:Data -> @-V:Data -> @-C:Type -> @-R:Type -> @-E:Data -> @-take:(@_:R -> Pair(R, 0x2a0aaf4f2cb3f416a9b91fd887916a5d/machine.Slot<S, K, V>)) -> @-put:(@_:R -> @_:0x2a0aaf4f2cb3f416a9b91fd887916a5d/machine.Slot<S, K, V> -> R) -> @-same:(@_:V -> @_:V -> Bool) -> @-machine:0x2a0aaf4f2cb3f416a9b91fd887916a5d/ordinary_machine_declaration.Declaration<S, K, V, R, take> -> @-render:(@_:V -> String) -> Declaration<S, C, R, E, machine_ops(S, K, V), 0x2a0aaf4f2cb3f416a9b91fd887916a5d/machine.CurrentView<S, K, V>>
Build a resource-style App declaration for one declared state machine. The same machine supplies the access key, current-value observer and queued write operation. take/put select its Slot and same compares values. The grant submits QueueInput through ordinary-machine-operations; constructing or reading this declaration does not apply a queued transition. See ordinary-machine-declaration and ordinary-machine-operations for that boundary.
template relation_ops source · line 117 · raw
@-S:Data -> @H:Type -> Type
Operation-family alias for a declared schema relation's writable operations. The callback still threads its opaque owner; this is not a raw relation store.
template relation_name source · line 118 · raw
@-S:Data -> @declaration:0x2a0aaf4f2cb3f416a9b91fd887916a5d/relation_failure_reader.Declaration<S> -> String
template relation_viewed source · line 121 · raw
@-S:Data -> @-C:Type -> @-R:Type -> @-E:Data -> @result:Pair(0x2a0aaf4f2cb3f416a9b91fd887916a5d/ordinary_app_relation.World(S, C, R, E), 0x2a0aaf4f2cb3f416a9b91fd887916a5d/ordinary_app_observation_data.Observation<0x2a0aaf4f2cb3f416a9b91fd887916a5d/ordinary_app_relation.View<S>>) -> Pair(0x2a0aaf4f2cb3f416a9b91fd887916a5d/ordinary_app_relation.World(S, C, R, E), 0x2a0aaf4f2cb3f416a9b91fd887916a5d/ordinary_app_relation.View<S>)
template relation_observe source · line 127 · raw
@-S:Data -> @-C:Type -> @-R:Type -> @-E:Data -> @-relation:0x2a0aaf4f2cb3f416a9b91fd887916a5d/relation_failure_reader.Declaration<S> -> @world:0x2a0aaf4f2cb3f416a9b91fd887916a5d/ordinary_app_relation.World(S, C, R, E) -> Pair(0x2a0aaf4f2cb3f416a9b91fd887916a5d/ordinary_app_relation.World(S, C, R, E), 0x2a0aaf4f2cb3f416a9b91fd887916a5d/ordinary_app_relation.View<S>)
Advanced observation route returning the relation World with the declared relation's descriptor and projected rows. It uses the ordinary relation observer; it does not consume an application failure-reader cursor.
template relation_render source · line 129 · raw
@-S:Data -> @view:0x2a0aaf4f2cb3f416a9b91fd887916a5d/ordinary_app_relation.View<S> -> String
template relation_write source · line 137 · raw
@-S:Data -> @-C:Type -> @-R:Type -> @-E:Data -> @-relation:0x2a0aaf4f2cb3f416a9b91fd887916a5d/relation_failure_reader.Declaration<S> -> Declaration<S, 0x2a0aaf4f2cb3f416a9b91fd887916a5d/relation_commands.Store<S, C>, R, 0x2a0aaf4f2cb3f416a9b91fd887916a5d/relation_commands.Notice<S, E>, relation_ops(S), 0x2a0aaf4f2cb3f416a9b91fd887916a5d/ordinary_app_relation.View<S>>
Build an App resource-style declaration for a canonical relation descriptor. The World uses the relation Store wrapper and relation Notice event wrapper; its write grant, access clause and observer come from that same descriptor. This constructor does not execute relation commands or apply a barrier. See ordinary-app-relation and relation-providers for execution and observation.
template relation_entries source · line 142 · raw
@-S:Data -> @relation:0x2a0aaf4f2cb3f416a9b91fd887916a5d/relation_failure_reader.Declaration<S> -> List<&2, 0x2a0aaf4f2cb3f416a9b91fd887916a5d/schema_fragments.Entry<S>>
Schema-assembly projection: consume a relation declaration and emit entries for its forward name followed by its inverse name. Entries describe schema metadata; they do not create an edge, register a system or grant write access.