1 import Base 2 import ./event_notice_runtime.bend as Mixed 3 import ./relation_commands.bend as Notice 4 import ./event_family_routing.bend as Route 5 import ./ordinary_event_family.bend as Family 6 import ./ordinary_app_event_family_runtime.bend as App 7 import ./ordinary_app_schema.bend as SchemaApp 8 import ./ordinary_app_composer.bend as Build 9 import ./ordinary_app_recipe.bend as Tree 10 import ./ordinary_app_registration_fields.bend as Records 11 import ./ordinary_app_observation_data.bend as DTO 12 import ./ordinary_schema.bend as Schema 13 import ./world.bend as W 14 15 # Start a mixed typed-event/relation-notice runtime around the sole schema App 16 # World. Canonical provision creates typed leaves; actual event owners and separate 17 # failure-domain state are retained. This does not register/run a gameplay reader 18 # or conflate typed publication ticks with failure-domain timing. 19 def start(~S:Data,~C:Type,~R:Type,~P:Data,~D:Data,~F:Type,~H:Type,~make:D -> Nat -> F,~sync:F -> Nat -> List<&2,P> -> F,~frame:F -> Nat -> F,~retain:F -> Nat -> List<&2,P> -> F & List<&2,P>,~inventory:F -> F & List<&2,String>,~Owners:Type,~Rows:Data,~observe:W.World> -> W.World> & DTO.Observation,~fold:Owners -> Owners & List<&2,Records.Fields>,provision:Family.Provision,events:H,capacity:Nat,value:SchemaApp.Application,Owners,Rows,observe,fold>) -> App.Application,Mixed.State,Owners,Rows,observe,fold>: 20 match provision value: 21 case Family.Provision{domains} SchemaApp.Application{schema,Build.Registered{world,owners,recipe,debug}}:App.Application{schema,Mixed.start(~S,~C,~R,~P,~F,~H,world,make(domains,capacity),events),owners,recipe,debug} 22 def inventoried(~S:Data,~C:Type,~R:Type,~P:Data,~F:Type,~H:Type,~Owners:Type,~Rows:Data,~observe:W.World> -> W.World> & DTO.Observation,~fold:Owners -> Owners & List<&2,Records.Fields>,schema:Schema.Schema,owners:Owners,recipe:Tree.Recipe>,Rows,observe>,debug:Bool,returned:Route.Runtime,Mixed.State> & Maybe<&2,List<&2,String>>) -> App.Application,Mixed.State,Owners,Rows,observe,fold> & Maybe<&2,List<&2,String>>: 23 match returned: 24 case (runtime,names):(App.Application{schema,runtime,owners,recipe,debug},names) 25 # Return App and optional mixed runtime inventory, retaining actual World/family 26 # owners. Disabled bypasses inventory derivation; enabled describes typed/failure 27 # sources through the supplied trusted adapter, without acknowledgement or dispatch. 28 def inventory(~S:Data,~C:Type,~R:Type,~P:Data,~F:Type,~H:Type,~inventory:F -> F & List<&2,String>,~Owners:Type,~Rows:Data,~observe:W.World> -> W.World> & DTO.Observation,~fold:Owners -> Owners & List<&2,Records.Fields>,value:App.Application,Mixed.State,Owners,Rows,observe,fold>) -> App.Application,Mixed.State,Owners,Rows,observe,fold> & Maybe<&2,List<&2,String>>: 29 match value: 30 case App.Application{schema,runtime,owners,recipe,+debug}:inventoried(~S,~C,~R,~P,~F,~H,~Owners,~Rows,~observe,~fold,schema,owners,recipe,debug,Mixed.inventory_enabled(~S,~C,~R,~P,~F,~H,~inventory,debug,runtime))