recognized_app_component.bend
bendvy-ecs-core@0.1.0.0 · 139 lines · 0 definitions
1import Base
2import bendvy-ecs-core@0.1.0.0/change_tick.bend as Tick
3import bendvy-ecs-core@0.1.0.0/ordinary_app_execution_recipe.bend as Exec
4import bendvy-ecs-core@0.1.0.0/ordinary_app_execution_run.bend as ExecuteRun
5import bendvy-ecs-core@0.1.0.0/ordinary_app_registration_run.bend as Transport
6import bendvy-ecs-core@0.1.0.0/execution_context.bend as Ctx
7import bendvy-ecs-core@0.1.0.0/schedule_provision.bend as SP
8import bendvy-ecs-core@0.1.0.0/captured_schedule_composition.bend as Choice
9import bendvy-ecs-core@0.1.0.0/ordinary_app_composer.bend as Build
10import bendvy-ecs-core@0.1.0.0/ordinary_app_registration_fields.bend as Records
11import bendvy-ecs-core@0.1.0.0/ordinary_app_records.bend as Leaf
12import bendvy-ecs-core@0.1.0.0/ordinary_app_recipe.bend as Tree
13import bendvy-ecs-core@0.1.0.0/ordinary_app_observation.bend as Leaves
14import bendvy-ecs-core@0.1.0.0/world.bend as W
15import bendvy-ecs-core@0.1.0.0/system.bend as Sys
16import bendvy-ecs-core@0.1.0.0/transaction.bend as T
17import bendvy-ecs-core@0.1.0.0/ordinary_system.bend as System
18import bendvy-ecs-core@0.1.0.0/compose.bend as Q
19import bendvy-ecs-core@0.1.0.0/inspector.bend as I
20import bendvy-ecs-core@0.1.0.0/inspector_query.bend as IQ
21import bendvy-ecs-core@0.1.0.0/ordinary_query_observable.bend as O
22import bendvy-ecs-core@0.1.0.0/ordinary_app_observation_data.bend as DTO
23import bendvy-ecs-core@0.1.0.0/internal/ordinary_component_runner.bend as Generic
24import bendvy-ecs-core@0.1.0.0/ordinary_app_component.bend as Legacy
25import bendvy-ecs-core@0.1.0.0/recognized_query_declaration.bend as Recognized
26import bendvy-ecs-core@0.1.0.0/recognized_system.bend as RecognizedSystem
27import bendvy-ecs-core@0.1.0.0/trace_facts.bend as Facts
28
29# Execution failure reported by this App leaf. CallbackFailure carries the
30# query access/user error; RegistrationRefused means the stored registration
31# could not be used. The schedule result still returns its execution context.
32def ExecutionError(Error:Data) -> Data:Legacy.ExecutionError<Error>
33def callback_failure(~Error:Data,error:Q.Error<Error>) -> ExecutionError(Error):Legacy.CallbackFailure{error}
34# The supplied observable declaration contributes inspection only. Operational
35# authority, selection and clauses always come from the recognized carrier.
36def effective_query(~S:Data,~C:Type,~R:Type,~E:Data,~Ops:Type -> Type,~Value:Data,~query:O.Declaration<S,Q.Frame<S,C,R,E>,Ops(Q.Frame<S,C,R,E>),I.Frame<S,C,R,E>,Value>,~recognized:Recognized.Declaration<S,C,R,E,Ops>) -> O.Declaration<S,Q.Frame<S,C,R,E>,Ops(Q.Frame<S,C,R,E>),I.Frame<S,C,R,E>,Value>:
37 O.PreparedDeclaration{_=>Recognized.ordinary(~S,~C,~R,~E,~Ops,recognized),_=>O.inspection(~S,~Q.Frame<S,C,R,E>,~Ops(Q.Frame<S,C,R,E>),~I.Frame<S,C,R,E>,~Value,query),frame=>IQ.each_composed(~I.Frame<S,C,R,E>,~S,~Value,~O.inspect_query(~S,~C,~R,~E,~Q.Frame<S,C,R,E>,~Ops(Q.Frame<S,C,R,E>),~Value,~query),frame)}
38def observed_result(~S:Data,~C:Type,~R:Type,~E:Data,~Error:Data,~Out:Data,result:Sys.Outcome<W.World<S,C,R,E>,Q.Error<Error>,List<&2,Out>>) -> Sys.Outcome<W.World<S,C,R,E>,Q.Error<Error>,List<&2,Out>> & Facts.State:
39 (result,Facts.Off{})
40def observed(~S:Data,~C:Type,~R:Type,~E:Data,~Ops:Type -> Type,~Args:Data,~Error:Data,~Out:Data,~Value:Data,~query:O.Declaration<S,Q.Frame<S,C,R,E>,Ops(Q.Frame<S,C,R,E>),I.Frame<S,C,R,E>,Value>,~recognized:Recognized.Declaration<S,C,R,E,Ops>,~body:@-H:Type -> @-caps:Ops(H) -> Args -> H -> H & (T.Outcome<Error> & Out),trace:Facts.State,world:W.World<S,C,R,E>,args:Args & Maybe<&2,Tick.Tick>) -> Sys.Outcome<W.World<S,C,R,E>,Q.Error<Error>,List<&2,Out>> & Facts.State:
41 match trace:
42 case Facts.Off{}:observed_result(~S,~C,~R,~E,~Error,~Out,RecognizedSystem.runner(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~recognized,~body)(world,args))
43 case Facts.On{entries}:System.observable_runner_observed(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~Value,~effective_query(~S,~C,~R,~E,~Ops,~Value,~query,~recognized),~body,Facts.On{entries},world,args)
44def execute_context(~S:Data,~C:Type,~R:Type,~E:Data,~Ops:Type -> Type,~Args:Data,~Error:Data,~Out:Data,~Value:Data,~query:O.Declaration<S,Q.Frame<S,C,R,E>,Ops(Q.Frame<S,C,R,E>),I.Frame<S,C,R,E>,Value>,~recognized:Recognized.Declaration<S,C,R,E,Ops>,~body:@-H:Type -> @-caps:Ops(H) -> Args -> H -> H & (T.Outcome<Error> & Out),token:Records.Token<Sys.Registry<S,C,R,E,Args & Maybe<&2,Tick.Tick>,Q.Error<Error>,List<&2,Out>,RecognizedSystem.runner(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~recognized,~body)>>,fields:Records.Fields<S>,world:W.World<S,C,R,E>,trace:Facts.State,args:Args) -> Transport.TransportResult<S,Ctx.Context<W.World<S,C,R,E>>,Args & Maybe<&2,Tick.Tick>,Q.Error<Error>,List<&2,Out>,Records.Token<Sys.Registry<S,C,R,E,Args & Maybe<&2,Tick.Tick>,Q.Error<Error>,List<&2,Out>,RecognizedSystem.runner(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~recognized,~body)>>>:
45 match fields:
46 case Records.Fields{namespace,id,name,access,+cursor,slot,clauses,kind}:ExecuteRun.returned(~S,~W.World<S,C,R,E>,~(Args & Maybe<&2,Tick.Tick>),~Q.Error<Error>,~List<&2,Out>,~Records.Token<Sys.Registry<S,C,R,E,Args & Maybe<&2,Tick.Tick>,Q.Error<Error>,List<&2,Out>,RecognizedSystem.runner(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~recognized,~body)>>,Transport.run_observed(~S,~C,~R,~E,~(Args & Maybe<&2,Tick.Tick>),~Q.Error<Error>,~List<&2,Out>,~RecognizedSystem.runner(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~recognized,~body),~observed(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~Value,~query,~recognized,~body),token,Records.Fields{namespace,id,name,access,cursor,slot,clauses,kind},trace,world,(args,cursor)))
47def execute(~S:Data,~C:Type,~R:Type,~E:Data,~Ops:Type -> Type,~Args:Data,~Error:Data,~Out:Data,~Value:Data,~query:O.Declaration<S,Q.Frame<S,C,R,E>,Ops(Q.Frame<S,C,R,E>),I.Frame<S,C,R,E>,Value>,~recognized:Recognized.Declaration<S,C,R,E,Ops>,~body:@-H:Type -> @-caps:Ops(H) -> Args -> H -> H & (T.Outcome<Error> & Out),token:Records.Token<Sys.Registry<S,C,R,E,Args & Maybe<&2,Tick.Tick>,Q.Error<Error>,List<&2,Out>,RecognizedSystem.runner(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~recognized,~body)>>,fields:Records.Fields<S>,context:Ctx.Context<W.World<S,C,R,E>>,args:Args) -> Transport.TransportResult<S,Ctx.Context<W.World<S,C,R,E>>,Args & Maybe<&2,Tick.Tick>,Q.Error<Error>,List<&2,Out>,Records.Token<Sys.Registry<S,C,R,E,Args & Maybe<&2,Tick.Tick>,Q.Error<Error>,List<&2,Out>,RecognizedSystem.runner(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~recognized,~body)>>>:
48 match context:
49 case Ctx.Context{world,trace}:execute_context(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~Value,~query,~recognized,~body,token,fields,world,trace,args)
50def extracted(~S:Data,~C:Type,~R:Type,~E:Data,~Owners:Type,~Rows:Data,~observe:W.World<S,C,R,E> -> W.World<S,C,R,E> & DTO.Observation<Rows>,~fold:Owners -> Owners & List<&2,Records.Fields<S>>,~Ops:Type -> Type,~Args:Data,~Error:Data,~Out:Data,~Value:Data,~query:O.Declaration<S,Q.Frame<S,C,R,E>,Ops(Q.Frame<S,C,R,E>),I.Frame<S,C,R,E>,Value>,~recognized:Recognized.Declaration<S,C,R,E,Ops>,~render:Value -> String,~body:@-H:Type -> @-caps:Ops(H) -> Args -> H -> H & (T.Outcome<Error> & Out),~Output:Type,done:Build.Registered<S,W.World<S,C,R,E>,Owners & Leaf.Record<S,Records.Token<Sys.Registry<S,C,R,E,Args & Maybe<&2,Tick.Tick>,Q.Error<Error>,List<&2,Out>,RecognizedSystem.runner(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~recognized,~body)>>>,DTO.Product<Rows,DTO.Product<Unit,List<&2,IQ.ProjectedRow<S,Value>>>>,Tree.observe_pair(~W.World<S,C,R,E>,~Rows,~DTO.Product<Unit,List<&2,IQ.ProjectedRow<S,Value>>>,~observe,~Leaves.component_observe(~S,~C,~R,~E,~Ops,~Value,~query,~render)),Leaf.fold_pair(~S,~Owners,~Leaf.Record<S,Records.Token<Sys.Registry<S,C,R,E,Args & Maybe<&2,Tick.Tick>,Q.Error<Error>,List<&2,Out>,RecognizedSystem.runner(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~recognized,~body)>>>,~fold,~Leaf.observed(~S,~Records.Token<Sys.Registry<S,C,R,E,Args & Maybe<&2,Tick.Tick>,Q.Error<Error>,List<&2,Out>,RecognizedSystem.runner(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~recognized,~body)>>))> -> Output,failed:Build.Registered<S,W.World<S,C,R,E>,Owners,Rows,observe,fold> -> Output,world:W.World<S,C,R,E>,owners:Owners,debug:Bool,result:Records.Token<Sys.Registry<S,C,R,E,Args & Maybe<&2,Tick.Tick>,Q.Error<Error>,List<&2,Out>,RecognizedSystem.runner(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~recognized,~body)>> & Records.Fields<S>) -> Output:
51 Generic.extracted(~S,~C,~R,~E,~Owners,~Rows,~observe,~fold,~Ops,~Args,~Error,~Out,~Value,~query,~render,~body,~RecognizedSystem.runner(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~recognized,~body),~RecognizedSystem.define(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~recognized,~body),~execute(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~Value,~query,~recognized,~body),~ExecutionError(Error),~callback_failure(~Error),~Legacy.RegistrationRefused{},~Output,done,failed,world,owners,debug,result)
52
53def defined(~S:Data,~C:Type,~R:Type,~E:Data,~Owners:Type,~Rows:Data,~observe:W.World<S,C,R,E> -> W.World<S,C,R,E> & DTO.Observation<Rows>,~fold:Owners -> Owners & List<&2,Records.Fields<S>>,~Ops:Type -> Type,~Args:Data,~Error:Data,~Out:Data,~Value:Data,~query:O.Declaration<S,Q.Frame<S,C,R,E>,Ops(Q.Frame<S,C,R,E>),I.Frame<S,C,R,E>,Value>,~recognized:Recognized.Declaration<S,C,R,E,Ops>,~render:Value -> String,~body:@-H:Type -> @-caps:Ops(H) -> Args -> H -> H & (T.Outcome<Error> & Out),~Output:Type,done:Build.Registered<S,W.World<S,C,R,E>,Owners & Leaf.Record<S,Records.Token<Sys.Registry<S,C,R,E,Args & Maybe<&2,Tick.Tick>,Q.Error<Error>,List<&2,Out>,RecognizedSystem.runner(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~recognized,~body)>>>,DTO.Product<Rows,DTO.Product<Unit,List<&2,IQ.ProjectedRow<S,Value>>>>,Tree.observe_pair(~W.World<S,C,R,E>,~Rows,~DTO.Product<Unit,List<&2,IQ.ProjectedRow<S,Value>>>,~observe,~Leaves.component_observe(~S,~C,~R,~E,~Ops,~Value,~query,~render)),Leaf.fold_pair(~S,~Owners,~Leaf.Record<S,Records.Token<Sys.Registry<S,C,R,E,Args & Maybe<&2,Tick.Tick>,Q.Error<Error>,List<&2,Out>,RecognizedSystem.runner(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~recognized,~body)>>>,~fold,~Leaf.observed(~S,~Records.Token<Sys.Registry<S,C,R,E,Args & Maybe<&2,Tick.Tick>,Q.Error<Error>,List<&2,Out>,RecognizedSystem.runner(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~recognized,~body)>>))> -> Output,failed:Build.Registered<S,W.World<S,C,R,E>,Owners,Rows,observe,fold> -> Output,owners:Owners,recipe:Tree.Recipe<W.World<S,C,R,E>,Rows,observe>,debug:Bool,result:System.Defined<S,W.World<S,C,R,E>,Sys.Registry<S,C,R,E,Args & Maybe<&2,Tick.Tick>,Q.Error<Error>,List<&2,Out>,RecognizedSystem.runner(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~recognized,~body)>>) -> Output:
54 Generic.defined(~S,~C,~R,~E,~Owners,~Rows,~observe,~fold,~Ops,~Args,~Error,~Out,~Value,~query,~render,~body,~RecognizedSystem.runner(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~recognized,~body),~RecognizedSystem.define(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~recognized,~body),~execute(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~Value,~query,~recognized,~body),~ExecutionError(Error),~callback_failure(~Error),~Legacy.RegistrationRefused{},~Output,done,failed,owners,recipe,debug,result)
55
56# Advanced setup entry for a registered composer before execution is attached.
57# Consumes app; done receives the extended composer, while failed receives the
58# returned previous composer. Recognition supplies operational authority; query
59# supplies inspection. Ordinary applications should normally use add below.
60def register(~S:Data,~C:Type,~R:Type,~E:Data,~Owners:Type,~Rows:Data,~observe:W.World<S,C,R,E> -> W.World<S,C,R,E> & DTO.Observation<Rows>,~fold:Owners -> Owners & List<&2,Records.Fields<S>>,~Ops:Type -> Type,~Args:Data,~Error:Data,~Out:Data,~Value:Data,~query:O.Declaration<S,Q.Frame<S,C,R,E>,Ops(Q.Frame<S,C,R,E>),I.Frame<S,C,R,E>,Value>,~recognized:Recognized.Declaration<S,C,R,E,Ops>,~render:Value -> String,~body:@-H:Type -> @-caps:Ops(H) -> Args -> H -> H & (T.Outcome<Error> & Out),~Output:Type,done:Build.Registered<S,W.World<S,C,R,E>,Owners & Leaf.Record<S,Records.Token<Sys.Registry<S,C,R,E,Args & Maybe<&2,Tick.Tick>,Q.Error<Error>,List<&2,Out>,RecognizedSystem.runner(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~recognized,~body)>>>,DTO.Product<Rows,DTO.Product<Unit,List<&2,IQ.ProjectedRow<S,Value>>>>,Tree.observe_pair(~W.World<S,C,R,E>,~Rows,~DTO.Product<Unit,List<&2,IQ.ProjectedRow<S,Value>>>,~observe,~Leaves.component_observe(~S,~C,~R,~E,~Ops,~Value,~query,~render)),Leaf.fold_pair(~S,~Owners,~Leaf.Record<S,Records.Token<Sys.Registry<S,C,R,E,Args & Maybe<&2,Tick.Tick>,Q.Error<Error>,List<&2,Out>,RecognizedSystem.runner(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~recognized,~body)>>>,~fold,~Leaf.observed(~S,~Records.Token<Sys.Registry<S,C,R,E,Args & Maybe<&2,Tick.Tick>,Q.Error<Error>,List<&2,Out>,RecognizedSystem.runner(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~recognized,~body)>>))> -> Output,failed:Build.Registered<S,W.World<S,C,R,E>,Owners,Rows,observe,fold> -> Output,app:Build.Registered<S,W.World<S,C,R,E>,Owners,Rows,observe,fold>,name:String,slot:String) -> Output:
61 Generic.register(~S,~C,~R,~E,~Owners,~Rows,~observe,~fold,~Ops,~Args,~Error,~Out,~Value,~query,~render,~body,~RecognizedSystem.runner(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~recognized,~body),~RecognizedSystem.define(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~recognized,~body),~execute(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~Value,~query,~recognized,~body),~ExecutionError(Error),~callback_failure(~Error),~Legacy.RegistrationRefused{},~Output,done,failed,app,name,slot)
62
63def execution_returned(~S:Data,~C:Type,~R:Type,~E:Data,~Ops:Type -> Type,~Args:Data,~Error:Data,~Out:Data,~Value:Data,~query:O.Declaration<S,Q.Frame<S,C,R,E>,Ops(Q.Frame<S,C,R,E>),I.Frame<S,C,R,E>,Value>,~recognized:Recognized.Declaration<S,C,R,E,Ops>,~body:@-H:Type -> @-caps:Ops(H) -> Args -> H -> H & (T.Outcome<Error> & Out),+args:Args,result:Transport.TransportResult<S,Ctx.Context<W.World<S,C,R,E>>,Args & Maybe<&2,Tick.Tick>,Q.Error<Error>,List<&2,Out>,Records.Token<Sys.Registry<S,C,R,E,Args & Maybe<&2,Tick.Tick>,Q.Error<Error>,List<&2,Out>,RecognizedSystem.runner(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~recognized,~body)>>>) -> Exec.Invocation<S,Records.Token<Sys.Registry<S,C,R,E,Args & Maybe<&2,Tick.Tick>,Q.Error<Error>,List<&2,Out>,RecognizedSystem.runner(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~recognized,~body)>>,Args,Out> & Sys.Outcome<Ctx.Context<W.World<S,C,R,E>>,ExecutionError(Error),Unit>:
64 Generic.execution_returned(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~Value,~query,~body,~RecognizedSystem.runner(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~recognized,~body),~RecognizedSystem.define(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~recognized,~body),~execute(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~Value,~query,~recognized,~body),~ExecutionError(Error),~callback_failure(~Error),~Legacy.RegistrationRefused{},args,result)
65
66def execution_allowed(~S:Data,~C:Type,~R:Type,~E:Data,~Ops:Type -> Type,~Args:Data,~Error:Data,~Out:Data,~Value:Data,~query:O.Declaration<S,Q.Frame<S,C,R,E>,Ops(Q.Frame<S,C,R,E>),I.Frame<S,C,R,E>,Value>,~recognized:Recognized.Declaration<S,C,R,E,Ops>,~body:@-H:Type -> @-caps:Ops(H) -> Args -> H -> H & (T.Outcome<Error> & Out),allowed:Bool,owner:Exec.Invocation<S,Records.Token<Sys.Registry<S,C,R,E,Args & Maybe<&2,Tick.Tick>,Q.Error<Error>,List<&2,Out>,RecognizedSystem.runner(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~recognized,~body)>>,Args,Out>,world:Ctx.Context<W.World<S,C,R,E>>,id:U32) -> Exec.Invocation<S,Records.Token<Sys.Registry<S,C,R,E,Args & Maybe<&2,Tick.Tick>,Q.Error<Error>,List<&2,Out>,RecognizedSystem.runner(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~recognized,~body)>>,Args,Out> & Sys.Outcome<Ctx.Context<W.World<S,C,R,E>>,ExecutionError(Error),Unit>:
67 Generic.execution_allowed(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~Value,~query,~body,~RecognizedSystem.runner(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~recognized,~body),~RecognizedSystem.define(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~recognized,~body),~execute(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~Value,~query,~recognized,~body),~ExecutionError(Error),~callback_failure(~Error),~Legacy.RegistrationRefused{},allowed,owner,world,id)
68
69def execution_run(~S:Data,~C:Type,~R:Type,~E:Data,~Ops:Type -> Type,~Args:Data,~Error:Data,~Out:Data,~Value:Data,~query:O.Declaration<S,Q.Frame<S,C,R,E>,Ops(Q.Frame<S,C,R,E>),I.Frame<S,C,R,E>,Value>,~recognized:Recognized.Declaration<S,C,R,E,Ops>,~body:@-H:Type -> @-caps:Ops(H) -> Args -> H -> H & (T.Outcome<Error> & Out),owner:Exec.Invocation<S,Records.Token<Sys.Registry<S,C,R,E,Args & Maybe<&2,Tick.Tick>,Q.Error<Error>,List<&2,Out>,RecognizedSystem.runner(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~recognized,~body)>>,Args,Out>,world:Ctx.Context<W.World<S,C,R,E>>,id:U32) -> Exec.Invocation<S,Records.Token<Sys.Registry<S,C,R,E,Args & Maybe<&2,Tick.Tick>,Q.Error<Error>,List<&2,Out>,RecognizedSystem.runner(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~recognized,~body)>>,Args,Out> & Sys.Outcome<Ctx.Context<W.World<S,C,R,E>>,ExecutionError(Error),Unit>:
70 Generic.execution_run(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~Value,~query,~body,~RecognizedSystem.runner(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~recognized,~body),~RecognizedSystem.define(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~recognized,~body),~execute(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~Value,~query,~recognized,~body),~ExecutionError(Error),~callback_failure(~Error),~Legacy.RegistrationRefused{},owner,world,id)
71
72# App type after adding one recognized, noncapturing query system.
73# It retains earlier owners plus the new invocation token and its row outputs.
74# Use add to construct it, then the ordinary App attach/schedule/run operations.
75# Args, Error, Out and inspection Value are Data; component/resource owners may
76# be affine Type values. The recognized carrier currently covers write,
77# resource_write and pair; other query shapes use ordinary-app-component.
78def Application(~S:Data,~C:Type,~R:Type,~E:Data,~Owners:Type,~Rows:Data,~observe:W.World<S,C,R,E> -> W.World<S,C,R,E> & DTO.Observation<Rows>,~fold:Owners -> Owners & List<&2,Records.Fields<S>>,~PriorError:Data,~priorPlan:Owners -> Owners & SP.Plan<S>,~priorDispatch:Owners -> Ctx.Context<W.World<S,C,R,E>> -> U32 -> Owners & Sys.Outcome<Ctx.Context<W.World<S,C,R,E>>,PriorError,Unit>,~priorProvide:W.World<S,C,R,E> -> W.World<S,C,R,E> & List<&2,SP.Requirement<S>>,~Ops:Type -> Type,~Args:Data,~Error:Data,~Out:Data,~Value:Data,~query:O.Declaration<S,Q.Frame<S,C,R,E>,Ops(Q.Frame<S,C,R,E>),I.Frame<S,C,R,E>,Value>,~recognized:Recognized.Declaration<S,C,R,E,Ops>,~body:@-H:Type -> @-caps:Ops(H) -> Args -> H -> H & (T.Outcome<Error> & Out),~render:Value -> String) -> Type:
79 Generic.Application(~S,~C,~R,~E,~Owners,~Rows,~observe,~fold,~PriorError,~priorPlan,~priorDispatch,~priorProvide,~Ops,~Args,~Error,~Out,~Value,~query,~body,~RecognizedSystem.runner(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~recognized,~body),~RecognizedSystem.define(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~recognized,~body),~execute(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~Value,~query,~recognized,~body),~ExecutionError(Error),~callback_failure(~Error),~Legacy.RegistrationRefused{},~render)
80
81def execution_added(~S:Data,~C:Type,~R:Type,~E:Data,~Owners:Type,~Rows:Data,~observe:W.World<S,C,R,E> -> W.World<S,C,R,E> & DTO.Observation<Rows>,~fold:Owners -> Owners & List<&2,Records.Fields<S>>,~PriorError:Data,~priorPlan:Owners -> Owners & SP.Plan<S>,~priorDispatch:Owners -> Ctx.Context<W.World<S,C,R,E>> -> U32 -> Owners & Sys.Outcome<Ctx.Context<W.World<S,C,R,E>>,PriorError,Unit>,~priorProvide:W.World<S,C,R,E> -> W.World<S,C,R,E> & List<&2,SP.Requirement<S>>,~Ops:Type -> Type,~Args:Data,~Error:Data,~Out:Data,~Value:Data,~query:O.Declaration<S,Q.Frame<S,C,R,E>,Ops(Q.Frame<S,C,R,E>),I.Frame<S,C,R,E>,Value>,~recognized:Recognized.Declaration<S,C,R,E,Ops>,~body:@-H:Type -> @-caps:Ops(H) -> Args -> H -> H & (T.Outcome<Error> & Out),~render:Value -> String,~Output:Type,args:Args,done:Application(~S,~C,~R,~E,~Owners,~Rows,~observe,~fold,~PriorError,~priorPlan,~priorDispatch,~priorProvide,~Ops,~Args,~Error,~Out,~Value,~query,~recognized,~body,~render) -> Output,result:Build.Registered<S,W.World<S,C,R,E>,Owners & Leaf.Record<S,Records.Token<Sys.Registry<S,C,R,E,Args & Maybe<&2,Tick.Tick>,Q.Error<Error>,List<&2,Out>,RecognizedSystem.runner(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~recognized,~body)>>>,DTO.Product<Rows,DTO.Product<Unit,List<&2,IQ.ProjectedRow<S,Value>>>>,Tree.observe_pair(~W.World<S,C,R,E>,~Rows,~DTO.Product<Unit,List<&2,IQ.ProjectedRow<S,Value>>>,~observe,~Leaves.component_observe(~S,~C,~R,~E,~Ops,~Value,~query,~render)),Leaf.fold_pair(~S,~Owners,~Leaf.Record<S,Records.Token<Sys.Registry<S,C,R,E,Args & Maybe<&2,Tick.Tick>,Q.Error<Error>,List<&2,Out>,RecognizedSystem.runner(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~recognized,~body)>>>,~fold,~Leaf.observed(~S,~Records.Token<Sys.Registry<S,C,R,E,Args & Maybe<&2,Tick.Tick>,Q.Error<Error>,List<&2,Out>,RecognizedSystem.runner(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~recognized,~body)>>))>) -> Output:
82 Generic.execution_added(~S,~C,~R,~E,~Owners,~Rows,~observe,~fold,~PriorError,~priorPlan,~priorDispatch,~priorProvide,~Ops,~Args,~Error,~Out,~Value,~query,~body,~RecognizedSystem.runner(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~recognized,~body),~RecognizedSystem.define(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~recognized,~body),~execute(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~Value,~query,~recognized,~body),~ExecutionError(Error),~callback_failure(~Error),~Legacy.RegistrationRefused{},~render,~Output,args,done,result)
83
84def execution_rejected(~S:Data,~C:Type,~R:Type,~E:Data,~Owners:Type,~Rows:Data,~observe:W.World<S,C,R,E> -> W.World<S,C,R,E> & DTO.Observation<Rows>,~fold:Owners -> Owners & List<&2,Records.Fields<S>>,~PriorError:Data,~priorPlan:Owners -> Owners & SP.Plan<S>,~priorDispatch:Owners -> Ctx.Context<W.World<S,C,R,E>> -> U32 -> Owners & Sys.Outcome<Ctx.Context<W.World<S,C,R,E>>,PriorError,Unit>,~priorProvide:W.World<S,C,R,E> -> W.World<S,C,R,E> & List<&2,SP.Requirement<S>>,~Ops:Type -> Type,~Args:Data,~Error:Data,~Out:Data,~Value:Data,~query:O.Declaration<S,Q.Frame<S,C,R,E>,Ops(Q.Frame<S,C,R,E>),I.Frame<S,C,R,E>,Value>,~recognized:Recognized.Declaration<S,C,R,E,Ops>,~body:@-H:Type -> @-caps:Ops(H) -> Args -> H -> H & (T.Outcome<Error> & Out),~render:Value -> String,~Output:Type,failed:Exec.Registered<S,W.World<S,C,R,E>,Owners,Rows,observe,fold,PriorError,priorPlan,priorDispatch,priorProvide> -> Output,result:Build.Registered<S,W.World<S,C,R,E>,Owners,Rows,observe,fold>) -> Output:
85 Generic.execution_rejected(~S,~C,~R,~E,~Owners,~Rows,~observe,~fold,~PriorError,~priorPlan,~priorDispatch,~priorProvide,~Ops,~Args,~Error,~Out,~Value,~query,~body,~RecognizedSystem.runner(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~recognized,~body),~RecognizedSystem.define(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~recognized,~body),~execute(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~Value,~query,~recognized,~body),~ExecutionError(Error),~callback_failure(~Error),~Legacy.RegistrationRefused{},~render,~Output,failed,result)
86
87# Register one recognized query system on an executable App during setup.
88# Consumes value and calls exactly one continuation: done with the extended App,
89# or failed with the returned prior App if registration is refused. name and
90# slot use the normal registry rules. args is retained for repeatable runs.
91# The recognized declaration owns selection/access authority; the observable
92# query contributes inspection only, even if its operational clauses differ.
93# Tracing Off uses compact execution; tracing On uses the ordinary observed path
94# with that same recognized authority. Query failure rolls back this system's
95# transactional writes and clears its outputs; prior committed systems remain.
96# This operation neither runs the schedule nor applies deferred commands.
97# Complete example: motion-driver.bend:define in test-fixtures/
98# connected-performance/sparse-motion64/consumer/s-perf/canonical-api-v1/
99# sparse-runtime-v1/; recognized-controls.bend in that fixture's
100# diagnostics/typed-observation-v1/ exercises both trace modes.
101def add(~S:Data,~C:Type,~R:Type,~E:Data,~Owners:Type,~Rows:Data,~observe:W.World<S,C,R,E> -> W.World<S,C,R,E> & DTO.Observation<Rows>,~fold:Owners -> Owners & List<&2,Records.Fields<S>>,~PriorError:Data,~priorPlan:Owners -> Owners & SP.Plan<S>,~priorDispatch:Owners -> Ctx.Context<W.World<S,C,R,E>> -> U32 -> Owners & Sys.Outcome<Ctx.Context<W.World<S,C,R,E>>,PriorError,Unit>,~priorProvide:W.World<S,C,R,E> -> W.World<S,C,R,E> & List<&2,SP.Requirement<S>>,~Ops:Type -> Type,~Args:Data,~Error:Data,~Out:Data,~Value:Data,~query:O.Declaration<S,Q.Frame<S,C,R,E>,Ops(Q.Frame<S,C,R,E>),I.Frame<S,C,R,E>,Value>,~recognized:Recognized.Declaration<S,C,R,E,Ops>,~body:@-H:Type -> @-caps:Ops(H) -> Args -> H -> H & (T.Outcome<Error> & Out),~render:Value -> String,~Output:Type,done:Application(~S,~C,~R,~E,~Owners,~Rows,~observe,~fold,~PriorError,~priorPlan,~priorDispatch,~priorProvide,~Ops,~Args,~Error,~Out,~Value,~query,~recognized,~body,~render) -> Output,failed:Exec.Registered<S,W.World<S,C,R,E>,Owners,Rows,observe,fold,PriorError,priorPlan,priorDispatch,priorProvide> -> Output,value:Exec.Registered<S,W.World<S,C,R,E>,Owners,Rows,observe,fold,PriorError,priorPlan,priorDispatch,priorProvide>,args:Args,name:String,slot:String) -> Output:
102 Generic.add(~S,~C,~R,~E,~Owners,~Rows,~observe,~fold,~PriorError,~priorPlan,~priorDispatch,~priorProvide,~Ops,~Args,~Error,~Out,~Value,~query,~body,~RecognizedSystem.runner(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~recognized,~body),~RecognizedSystem.define(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~recognized,~body),~execute(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~Value,~query,~recognized,~body),~ExecutionError(Error),~callback_failure(~Error),~Legacy.RegistrationRefused{},~render,~Output,done,failed,value,args,name,slot)
103
104# Advanced App-composition type projection: owners after this leaf is appended.
105# Use with the matching execution_* projections; it does not register a system.
106def execution_owners(~S:Data,~C:Type,~R:Type,~E:Data,~Owners:Type,~Rows:Data,~observe:W.World<S,C,R,E> -> W.World<S,C,R,E> & DTO.Observation<Rows>,~fold:Owners -> Owners & List<&2,Records.Fields<S>>,~PriorError:Data,~priorPlan:Owners -> Owners & SP.Plan<S>,~priorDispatch:Owners -> Ctx.Context<W.World<S,C,R,E>> -> U32 -> Owners & Sys.Outcome<Ctx.Context<W.World<S,C,R,E>>,PriorError,Unit>,~priorProvide:W.World<S,C,R,E> -> W.World<S,C,R,E> & List<&2,SP.Requirement<S>>,~Ops:Type -> Type,~Args:Data,~Error:Data,~Out:Data,~Value:Data,~query:O.Declaration<S,Q.Frame<S,C,R,E>,Ops(Q.Frame<S,C,R,E>),I.Frame<S,C,R,E>,Value>,~recognized:Recognized.Declaration<S,C,R,E,Ops>,~body:@-H:Type -> @-caps:Ops(H) -> Args -> H -> H & (T.Outcome<Error> & Out),~render:Value -> String) -> Type:
107 Generic.execution_owners(~S,~C,~R,~E,~Owners,~Rows,~observe,~fold,~PriorError,~priorPlan,~priorDispatch,~priorProvide,~Ops,~Args,~Error,~Out,~Value,~query,~body,~RecognizedSystem.runner(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~recognized,~body),~RecognizedSystem.define(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~recognized,~body),~execute(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~Value,~query,~recognized,~body),~ExecutionError(Error),~callback_failure(~Error),~Legacy.RegistrationRefused{},~render)
108
109# Advanced App-composition type projection: inspection rows after this leaf.
110# These rows describe observations, not the callback's per-run output list.
111def execution_rows(~S:Data,~C:Type,~R:Type,~E:Data,~Owners:Type,~Rows:Data,~observe:W.World<S,C,R,E> -> W.World<S,C,R,E> & DTO.Observation<Rows>,~fold:Owners -> Owners & List<&2,Records.Fields<S>>,~PriorError:Data,~priorPlan:Owners -> Owners & SP.Plan<S>,~priorDispatch:Owners -> Ctx.Context<W.World<S,C,R,E>> -> U32 -> Owners & Sys.Outcome<Ctx.Context<W.World<S,C,R,E>>,PriorError,Unit>,~priorProvide:W.World<S,C,R,E> -> W.World<S,C,R,E> & List<&2,SP.Requirement<S>>,~Ops:Type -> Type,~Args:Data,~Error:Data,~Out:Data,~Value:Data,~query:O.Declaration<S,Q.Frame<S,C,R,E>,Ops(Q.Frame<S,C,R,E>),I.Frame<S,C,R,E>,Value>,~recognized:Recognized.Declaration<S,C,R,E,Ops>,~body:@-H:Type -> @-caps:Ops(H) -> Args -> H -> H & (T.Outcome<Error> & Out),~render:Value -> String) -> Data:
112 Generic.execution_rows(~S,~C,~R,~E,~Owners,~Rows,~observe,~fold,~PriorError,~priorPlan,~priorDispatch,~priorProvide,~Ops,~Args,~Error,~Out,~Value,~query,~body,~RecognizedSystem.runner(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~recognized,~body),~RecognizedSystem.define(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~recognized,~body),~execute(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~Value,~query,~recognized,~body),~ExecutionError(Error),~callback_failure(~Error),~Legacy.RegistrationRefused{},~render)
113
114# Advanced App-composition projection of the owner-preserving observer.
115# It combines earlier observations with this leaf's supplied inspection query.
116def execution_observe(~S:Data,~C:Type,~R:Type,~E:Data,~Owners:Type,~Rows:Data,~observe:W.World<S,C,R,E> -> W.World<S,C,R,E> & DTO.Observation<Rows>,~fold:Owners -> Owners & List<&2,Records.Fields<S>>,~PriorError:Data,~priorPlan:Owners -> Owners & SP.Plan<S>,~priorDispatch:Owners -> Ctx.Context<W.World<S,C,R,E>> -> U32 -> Owners & Sys.Outcome<Ctx.Context<W.World<S,C,R,E>>,PriorError,Unit>,~priorProvide:W.World<S,C,R,E> -> W.World<S,C,R,E> & List<&2,SP.Requirement<S>>,~Ops:Type -> Type,~Args:Data,~Error:Data,~Out:Data,~Value:Data,~query:O.Declaration<S,Q.Frame<S,C,R,E>,Ops(Q.Frame<S,C,R,E>),I.Frame<S,C,R,E>,Value>,~recognized:Recognized.Declaration<S,C,R,E,Ops>,~body:@-H:Type -> @-caps:Ops(H) -> Args -> H -> H & (T.Outcome<Error> & Out),~render:Value -> String) -> W.World<S,C,R,E> -> W.World<S,C,R,E> & DTO.Observation<DTO.Product<Rows,DTO.Product<Unit,List<&2,IQ.ProjectedRow<S,Value>>>>>:
117 Generic.execution_observe(~S,~C,~R,~E,~Owners,~Rows,~observe,~fold,~PriorError,~priorPlan,~priorDispatch,~priorProvide,~Ops,~Args,~Error,~Out,~Value,~query,~body,~RecognizedSystem.runner(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~recognized,~body),~RecognizedSystem.define(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~recognized,~body),~execute(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~Value,~query,~recognized,~body),~ExecutionError(Error),~callback_failure(~Error),~Legacy.RegistrationRefused{},~render)
118
119# Advanced App-composition projection of registration-field collection.
120# Returns all owners with their metadata; it does not execute gameplay callbacks.
121def execution_fold(~S:Data,~C:Type,~R:Type,~E:Data,~Owners:Type,~Rows:Data,~observe:W.World<S,C,R,E> -> W.World<S,C,R,E> & DTO.Observation<Rows>,~fold:Owners -> Owners & List<&2,Records.Fields<S>>,~PriorError:Data,~priorPlan:Owners -> Owners & SP.Plan<S>,~priorDispatch:Owners -> Ctx.Context<W.World<S,C,R,E>> -> U32 -> Owners & Sys.Outcome<Ctx.Context<W.World<S,C,R,E>>,PriorError,Unit>,~priorProvide:W.World<S,C,R,E> -> W.World<S,C,R,E> & List<&2,SP.Requirement<S>>,~Ops:Type -> Type,~Args:Data,~Error:Data,~Out:Data,~Value:Data,~query:O.Declaration<S,Q.Frame<S,C,R,E>,Ops(Q.Frame<S,C,R,E>),I.Frame<S,C,R,E>,Value>,~recognized:Recognized.Declaration<S,C,R,E,Ops>,~body:@-H:Type -> @-caps:Ops(H) -> Args -> H -> H & (T.Outcome<Error> & Out),~render:Value -> String) -> (Owners & Exec.Invocation<S,Records.Token<Sys.Registry<S,C,R,E,Args & Maybe<&2,Tick.Tick>,Q.Error<Error>,List<&2,Out>,RecognizedSystem.runner(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~recognized,~body)>>,Args,Out>) -> (Owners & Exec.Invocation<S,Records.Token<Sys.Registry<S,C,R,E,Args & Maybe<&2,Tick.Tick>,Q.Error<Error>,List<&2,Out>,RecognizedSystem.runner(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~recognized,~body)>>,Args,Out>) & List<&2,Records.Fields<S>>:
122 Generic.execution_fold(~S,~C,~R,~E,~Owners,~Rows,~observe,~fold,~PriorError,~priorPlan,~priorDispatch,~priorProvide,~Ops,~Args,~Error,~Out,~Value,~query,~body,~RecognizedSystem.runner(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~recognized,~body),~RecognizedSystem.define(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~recognized,~body),~execute(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~Value,~query,~recognized,~body),~ExecutionError(Error),~callback_failure(~Error),~Legacy.RegistrationRefused{},~render)
123
124# Advanced App-composition projection of the combined registered-ID plan.
125# Preserves owners and appends this system with condition slot zero and no
126# requirements, retaining the prior plan order.
127def execution_plan(~S:Data,~C:Type,~R:Type,~E:Data,~Owners:Type,~Rows:Data,~observe:W.World<S,C,R,E> -> W.World<S,C,R,E> & DTO.Observation<Rows>,~fold:Owners -> Owners & List<&2,Records.Fields<S>>,~PriorError:Data,~priorPlan:Owners -> Owners & SP.Plan<S>,~priorDispatch:Owners -> Ctx.Context<W.World<S,C,R,E>> -> U32 -> Owners & Sys.Outcome<Ctx.Context<W.World<S,C,R,E>>,PriorError,Unit>,~priorProvide:W.World<S,C,R,E> -> W.World<S,C,R,E> & List<&2,SP.Requirement<S>>,~Ops:Type -> Type,~Args:Data,~Error:Data,~Out:Data,~Value:Data,~query:O.Declaration<S,Q.Frame<S,C,R,E>,Ops(Q.Frame<S,C,R,E>),I.Frame<S,C,R,E>,Value>,~recognized:Recognized.Declaration<S,C,R,E,Ops>,~body:@-H:Type -> @-caps:Ops(H) -> Args -> H -> H & (T.Outcome<Error> & Out),~render:Value -> String) -> (Owners & Exec.Invocation<S,Records.Token<Sys.Registry<S,C,R,E,Args & Maybe<&2,Tick.Tick>,Q.Error<Error>,List<&2,Out>,RecognizedSystem.runner(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~recognized,~body)>>,Args,Out>) -> (Owners & Exec.Invocation<S,Records.Token<Sys.Registry<S,C,R,E,Args & Maybe<&2,Tick.Tick>,Q.Error<Error>,List<&2,Out>,RecognizedSystem.runner(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~recognized,~body)>>,Args,Out>) & SP.Plan<S>:
128 Generic.execution_plan(~S,~C,~R,~E,~Owners,~Rows,~observe,~fold,~PriorError,~priorPlan,~priorDispatch,~priorProvide,~Ops,~Args,~Error,~Out,~Value,~query,~body,~RecognizedSystem.runner(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~recognized,~body),~RecognizedSystem.define(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~recognized,~body),~execute(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~Value,~query,~recognized,~body),~ExecutionError(Error),~callback_failure(~Error),~Legacy.RegistrationRefused{},~render)
129
130# Advanced App-composition projection of registered-ID dispatch.
131# Returns owners and the execution context on success or typed failure; prefer
132# the App schedule/run entry instead of supplying numeric IDs in gameplay.
133def execution_dispatch(~S:Data,~C:Type,~R:Type,~E:Data,~Owners:Type,~Rows:Data,~observe:W.World<S,C,R,E> -> W.World<S,C,R,E> & DTO.Observation<Rows>,~fold:Owners -> Owners & List<&2,Records.Fields<S>>,~PriorError:Data,~priorPlan:Owners -> Owners & SP.Plan<S>,~priorDispatch:Owners -> Ctx.Context<W.World<S,C,R,E>> -> U32 -> Owners & Sys.Outcome<Ctx.Context<W.World<S,C,R,E>>,PriorError,Unit>,~priorProvide:W.World<S,C,R,E> -> W.World<S,C,R,E> & List<&2,SP.Requirement<S>>,~Ops:Type -> Type,~Args:Data,~Error:Data,~Out:Data,~Value:Data,~query:O.Declaration<S,Q.Frame<S,C,R,E>,Ops(Q.Frame<S,C,R,E>),I.Frame<S,C,R,E>,Value>,~recognized:Recognized.Declaration<S,C,R,E,Ops>,~body:@-H:Type -> @-caps:Ops(H) -> Args -> H -> H & (T.Outcome<Error> & Out),~render:Value -> String) -> (Owners & Exec.Invocation<S,Records.Token<Sys.Registry<S,C,R,E,Args & Maybe<&2,Tick.Tick>,Q.Error<Error>,List<&2,Out>,RecognizedSystem.runner(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~recognized,~body)>>,Args,Out>) -> Ctx.Context<W.World<S,C,R,E>> -> U32 -> (Owners & Exec.Invocation<S,Records.Token<Sys.Registry<S,C,R,E,Args & Maybe<&2,Tick.Tick>,Q.Error<Error>,List<&2,Out>,RecognizedSystem.runner(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~recognized,~body)>>,Args,Out>) & Sys.Outcome<Ctx.Context<W.World<S,C,R,E>>,Choice.Choice<PriorError,ExecutionError(Error)>,Unit>:
134 Generic.execution_dispatch(~S,~C,~R,~E,~Owners,~Rows,~observe,~fold,~PriorError,~priorPlan,~priorDispatch,~priorProvide,~Ops,~Args,~Error,~Out,~Value,~query,~body,~RecognizedSystem.runner(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~recognized,~body),~RecognizedSystem.define(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~recognized,~body),~execute(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~Value,~query,~recognized,~body),~ExecutionError(Error),~callback_failure(~Error),~Legacy.RegistrationRefused{},~render)
135
136# Advanced App-composition projection of the combined provisioning requirements.
137# It preserves the World and does not grant extra capabilities to the body.
138def execution_provide(~S:Data,~C:Type,~R:Type,~E:Data,~Owners:Type,~Rows:Data,~observe:W.World<S,C,R,E> -> W.World<S,C,R,E> & DTO.Observation<Rows>,~fold:Owners -> Owners & List<&2,Records.Fields<S>>,~PriorError:Data,~priorPlan:Owners -> Owners & SP.Plan<S>,~priorDispatch:Owners -> Ctx.Context<W.World<S,C,R,E>> -> U32 -> Owners & Sys.Outcome<Ctx.Context<W.World<S,C,R,E>>,PriorError,Unit>,~priorProvide:W.World<S,C,R,E> -> W.World<S,C,R,E> & List<&2,SP.Requirement<S>>,~Ops:Type -> Type,~Args:Data,~Error:Data,~Out:Data,~Value:Data,~query:O.Declaration<S,Q.Frame<S,C,R,E>,Ops(Q.Frame<S,C,R,E>),I.Frame<S,C,R,E>,Value>,~recognized:Recognized.Declaration<S,C,R,E,Ops>,~body:@-H:Type -> @-caps:Ops(H) -> Args -> H -> H & (T.Outcome<Error> & Out),~render:Value -> String) -> W.World<S,C,R,E> -> W.World<S,C,R,E> & List<&2,SP.Requirement<S>>:
139 Generic.execution_provide(~S,~C,~R,~E,~Owners,~Rows,~observe,~fold,~PriorError,~priorPlan,~priorDispatch,~priorProvide,~Ops,~Args,~Error,~Out,~Value,~query,~body,~RecognizedSystem.runner(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~recognized,~body),~RecognizedSystem.define(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~recognized,~body),~execute(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~Value,~query,~recognized,~body),~ExecutionError(Error),~callback_failure(~Error),~Legacy.RegistrationRefused{},~render)