1 import Base 2 import ./world.bend as W 3 import ./execution_composer_layout.bend as Layout 4 import ./execution_composer_schema.bend as Schema 5 import ./execution_relation_context.bend as Context 6 import ./execution_schema_provisioning.bend as Provision 7 8 # Trusted schema setup receives only the next namespace of the consumed actual 9 # Factory and an affine seed. It cannot inspect or mutate a running World. 10 # Schema rejection returns every constructed resource through Initialization. 11 def create(~S:Data,~components:Layout.Layout,~resources:Layout.Layout,~E:Data,~Seed:Type,~build:U32 -> Seed -> Layout.resources(~S,resources),factory:W.Factory,seed:Seed) -> Context.Initialization: 12 match factory: 13 case W.Factory{+nextNamespace}:Context.from_schema(~S,~components,~resources,~E,Schema.create(~S,~components,~resources,~E,W.Factory{nextNamespace},build(nextNamespace,seed))) 14 type ProvisionedInitialization<-S:Data,-components:Layout.Layout,-resources:Layout.Layout,-E:Data,-Seed:Type,-blueprint:Provision.Blueprint> is Type: 15 ProvisionedInitialization{result:Context.Initialization} 16 def create_provisioned(~S:Data,~components:Layout.Layout,~resources:Layout.Layout,~E:Data,~Seed:Type,~blueprint:Provision.Blueprint,factory:W.Factory,seed:Seed) -> ProvisionedInitialization: 17 ProvisionedInitialization{create(~S,~components,~resources,~E,~Seed,~Provision.builder(~S,~resources,~Seed,blueprint),factory,seed)}