ordinary_app_component.bend source
ordinary_app_component.bend on the hub · documented module
import Baseimport ./change_tick.bend as Tickimport ./ordinary_app_execution_recipe.bend as Execimport ./ordinary_app_execution_run.bend as ExecuteRunimport ./ordinary_app_registration_run.bend as Transportimport ./execution_context.bend as Ctximport ./schedule_provision.bend as SPimport ./captured_schedule_composition.bend as Choiceimport ./ordinary_app_composer.bend as Buildimport ./ordinary_app_registration_fields.bend as Recordsimport ./ordinary_app_records.bend as Leafimport ./ordinary_app_recipe.bend as Treeimport ./ordinary_app_observation.bend as Leavesimport ./world.bend as Wimport ./system.bend as Sysimport ./transaction.bend as Timport ./ordinary_system.bend as Systemimport ./compose.bend as Qimport ./inspector.bend as Iimport ./inspector_query.bend as IQimport ./ordinary_query_observable.bend as Oimport ./ordinary_app_observation_data.bend as DTOimport ./internal/ordinary_component_runner.bend as Generic# Failure of a registered component-query invocation: CallbackFailure wraps# its query/body error; RegistrationRefused means the registration cannot execute.# Execution returns the application owner separately; the error owns no world.type ExecutionError<Error:Data> is Data: CallbackFailure{error:Q.Error<Error>} RegistrationRefused{}def callback_failure(~Error:Data,error:Q.Error<Error>) -> ExecutionError<Error>:CallbackFailure{error}def 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>,~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>,System.observable_runner(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~Value,~query,~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>,System.observable_runner(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~Value,~query,~body)>>>,~fold,~Leaf.observed(~S,~Records.Token<Sys.Registry<S,C,R,E,Args & Maybe<&2,Tick.Tick>,Q.Error<Error>,List<&2,Out>,System.observable_runner(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~Value,~query,~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>,System.observable_runner(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~Value,~query,~body)>> & Records.Fields<S>) -> Output: Generic.extracted(~S,~C,~R,~E,~Owners,~Rows,~observe,~fold,~Ops,~Args,~Error,~Out,~Value,~query,~render,~body,~System.observable_runner(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~Value,~query,~body),~System.observable_define(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~Value,~query,~body),~ExecuteRun.component(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~Value,~query,~body),~ExecutionError<Error>,~callback_failure(~Error),~RegistrationRefused{},~Output,done,failed,world,owners,debug,result)def 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>,~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>,System.observable_runner(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~Value,~query,~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>,System.observable_runner(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~Value,~query,~body)>>>,~fold,~Leaf.observed(~S,~Records.Token<Sys.Registry<S,C,R,E,Args & Maybe<&2,Tick.Tick>,Q.Error<Error>,List<&2,Out>,System.observable_runner(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~Value,~query,~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>,System.observable_runner(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~Value,~query,~body)>>) -> Output: Generic.defined(~S,~C,~R,~E,~Owners,~Rows,~observe,~fold,~Ops,~Args,~Error,~Out,~Value,~query,~render,~body,~System.observable_runner(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~Value,~query,~body),~System.observable_define(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~Value,~query,~body),~ExecuteRun.component(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~Value,~query,~body),~ExecutionError<Error>,~callback_failure(~Error),~RegistrationRefused{},~Output,done,failed,owners,recipe,debug,result)# Advanced registration-only entry: extends the observation recipe and owners.# Consumes app and calls done with the extended owner, or failed with the prior# owner on registration refusal. Prefer add for derived App execution.# This performs registration, not a query traversal or structural barrier.def 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>,~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>,System.observable_runner(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~Value,~query,~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>,System.observable_runner(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~Value,~query,~body)>>>,~fold,~Leaf.observed(~S,~Records.Token<Sys.Registry<S,C,R,E,Args & Maybe<&2,Tick.Tick>,Q.Error<Error>,List<&2,Out>,System.observable_runner(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~Value,~query,~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: Generic.register(~S,~C,~R,~E,~Owners,~Rows,~observe,~fold,~Ops,~Args,~Error,~Out,~Value,~query,~render,~body,~System.observable_runner(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~Value,~query,~body),~System.observable_define(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~Value,~query,~body),~ExecuteRun.component(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~Value,~query,~body),~ExecutionError<Error>,~callback_failure(~Error),~RegistrationRefused{},~Output,done,failed,app,name,slot)def 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>,~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>,System.observable_runner(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~Value,~query,~body)>>>) -> Exec.Invocation<S,Records.Token<Sys.Registry<S,C,R,E,Args & Maybe<&2,Tick.Tick>,Q.Error<Error>,List<&2,Out>,System.observable_runner(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~Value,~query,~body)>>,Args,Out> & Sys.Outcome<Ctx.Context<W.World<S,C,R,E>>,ExecutionError<Error>,Unit>: Generic.execution_returned(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~Value,~query,~body,~System.observable_runner(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~Value,~query,~body),~System.observable_define(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~Value,~query,~body),~ExecuteRun.component(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~Value,~query,~body),~ExecutionError<Error>,~callback_failure(~Error),~RegistrationRefused{},args,result)def 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>,~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>,System.observable_runner(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~Value,~query,~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>,System.observable_runner(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~Value,~query,~body)>>,Args,Out> & Sys.Outcome<Ctx.Context<W.World<S,C,R,E>>,ExecutionError<Error>,Unit>: Generic.execution_allowed(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~Value,~query,~body,~System.observable_runner(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~Value,~query,~body),~System.observable_define(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~Value,~query,~body),~ExecuteRun.component(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~Value,~query,~body),~ExecutionError<Error>,~callback_failure(~Error),~RegistrationRefused{},allowed,owner,world,id)def 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>,~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>,System.observable_runner(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~Value,~query,~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>,System.observable_runner(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~Value,~query,~body)>>,Args,Out> & Sys.Outcome<Ctx.Context<W.World<S,C,R,E>>,ExecutionError<Error>,Unit>: Generic.execution_run(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~Value,~query,~body,~System.observable_runner(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~Value,~query,~body),~System.observable_define(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~Value,~query,~body),~ExecuteRun.component(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~Value,~query,~body),~ExecutionError<Error>,~callback_failure(~Error),~RegistrationRefused{},owner,world,id)# Resulting registered application type after adding this component system.# Owns the world, prior registrations and the new invocation; it is not a copy.# Use add to construct it and ordinary-app-run.attach to derive execution.def 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>,~body:@-H:Type -> @-caps:Ops(H) -> Args -> H -> H & (T.Outcome<Error> & Out),~render:Value -> String) -> Type: Generic.Application(~S,~C,~R,~E,~Owners,~Rows,~observe,~fold,~PriorError,~priorPlan,~priorDispatch,~priorProvide,~Ops,~Args,~Error,~Out,~Value,~query,~body,~System.observable_runner(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~Value,~query,~body),~System.observable_define(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~Value,~query,~body),~ExecuteRun.component(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~Value,~query,~body),~ExecutionError<Error>,~callback_failure(~Error),~RegistrationRefused{},~render)def 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>,~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,~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>,System.observable_runner(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~Value,~query,~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>,System.observable_runner(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~Value,~query,~body)>>>,~fold,~Leaf.observed(~S,~Records.Token<Sys.Registry<S,C,R,E,Args & Maybe<&2,Tick.Tick>,Q.Error<Error>,List<&2,Out>,System.observable_runner(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~Value,~query,~body)>>))>) -> Output: Generic.execution_added(~S,~C,~R,~E,~Owners,~Rows,~observe,~fold,~PriorError,~priorPlan,~priorDispatch,~priorProvide,~Ops,~Args,~Error,~Out,~Value,~query,~body,~System.observable_runner(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~Value,~query,~body),~System.observable_define(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~Value,~query,~body),~ExecuteRun.component(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~Value,~query,~body),~ExecutionError<Error>,~callback_failure(~Error),~RegistrationRefused{},~render,~Output,args,done,result)def 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>,~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: Generic.execution_rejected(~S,~C,~R,~E,~Owners,~Rows,~observe,~fold,~PriorError,~priorPlan,~priorDispatch,~priorProvide,~Ops,~Args,~Error,~Out,~Value,~query,~body,~System.observable_runner(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~Value,~query,~body),~System.observable_define(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~Value,~query,~body),~ExecuteRun.component(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~Value,~query,~body),~ExecutionError<Error>,~callback_failure(~Error),~RegistrationRefused{},~render,~Output,failed,result)# Register a reusable component-query system and derive its execution recipe.# query supplies operational access and inspection; body sees only Ops(H).# Consumes value; done receives the extended application, while failed receives# the original application shape with its world and prior owners retained.# Registration does not execute body. Data args are stored for repeated runs;# affine captures use ordinary-app-capture-query instead. name/slot identify# the registration; schema and query owner types must agree.# Example: examples/scheduled-health/registration.bend, create().def 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>,~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,~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: Generic.add(~S,~C,~R,~E,~Owners,~Rows,~observe,~fold,~PriorError,~priorPlan,~priorDispatch,~priorProvide,~Ops,~Args,~Error,~Out,~Value,~query,~body,~System.observable_runner(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~Value,~query,~body),~System.observable_define(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~Value,~query,~body),~ExecuteRun.component(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~Value,~query,~body),~ExecutionError<Error>,~callback_failure(~Error),~RegistrationRefused{},~render,~Output,done,failed,value,args,name,slot)# Advanced type projection for the owners after add: prior owners plus the# registered invocation, stored Data arguments and most recent row outputs.# Use when naming an application type; this does not allocate or run a system.def 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>,~body:@-H:Type -> @-caps:Ops(H) -> Args -> H -> H & (T.Outcome<Error> & Out),~render:Value -> String) -> Type: Generic.execution_owners(~S,~C,~R,~E,~Owners,~Rows,~observe,~fold,~PriorError,~priorPlan,~priorDispatch,~priorProvide,~Ops,~Args,~Error,~Out,~Value,~query,~body,~System.observable_runner(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~Value,~query,~body),~System.observable_define(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~Value,~query,~body),~ExecuteRun.component(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~Value,~query,~body),~ExecutionError<Error>,~callback_failure(~Error),~RegistrationRefused{},~render)# Advanced detached observation type after add; preserves prior observations# and appends this query projection. Does not evaluate the projection.def 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>,~body:@-H:Type -> @-caps:Ops(H) -> Args -> H -> H & (T.Outcome<Error> & Out),~render:Value -> String) -> Data: Generic.execution_rows(~S,~C,~R,~E,~Owners,~Rows,~observe,~fold,~PriorError,~priorPlan,~priorDispatch,~priorProvide,~Ops,~Args,~Error,~Out,~Value,~query,~body,~System.observable_runner(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~Value,~query,~body),~System.observable_define(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~Value,~query,~body),~ExecuteRun.component(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~Value,~query,~body),~ExecutionError<Error>,~callback_failure(~Error),~RegistrationRefused{},~render)# Advanced derived observation callback for add, threading the world owner# and producing detached rows without executing the component system.def 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>,~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>>>>>: Generic.execution_observe(~S,~C,~R,~E,~Owners,~Rows,~observe,~fold,~PriorError,~priorPlan,~priorDispatch,~priorProvide,~Ops,~Args,~Error,~Out,~Value,~query,~body,~System.observable_runner(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~Value,~query,~body),~System.observable_define(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~Value,~query,~body),~ExecuteRun.component(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~Value,~query,~body),~ExecutionError<Error>,~callback_failure(~Error),~RegistrationRefused{},~render)# Advanced derived callback for registration metadata; returns the same# owner shape with ordered fields. It does not invoke registered bodies.def 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>,~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>,System.observable_runner(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~Value,~query,~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>,System.observable_runner(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~Value,~query,~body)>>,Args,Out>) & List<&2,Records.Fields<S>>: Generic.execution_fold(~S,~C,~R,~E,~Owners,~Rows,~observe,~fold,~PriorError,~priorPlan,~priorDispatch,~priorProvide,~Ops,~Args,~Error,~Out,~Value,~query,~body,~System.observable_runner(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~Value,~query,~body),~System.observable_define(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~Value,~query,~body),~ExecuteRun.component(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~Value,~query,~body),~ExecutionError<Error>,~callback_failure(~Error),~RegistrationRefused{},~render)# Advanced derived plan callback for add, combining prior and new registered# invocations. Use with matching execution_owners and execution_dispatch.def 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>,~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>,System.observable_runner(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~Value,~query,~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>,System.observable_runner(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~Value,~query,~body)>>,Args,Out>) & SP.Plan<S>: Generic.execution_plan(~S,~C,~R,~E,~Owners,~Rows,~observe,~fold,~PriorError,~priorPlan,~priorDispatch,~priorProvide,~Ops,~Args,~Error,~Out,~Value,~query,~body,~System.observable_runner(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~Value,~query,~body),~System.observable_define(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~Value,~query,~body),~ExecuteRun.component(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~Value,~query,~body),~ExecutionError<Error>,~callback_failure(~Error),~RegistrationRefused{},~render)# Advanced derived dispatcher for add, routing registered IDs to the existing# invocation and returning owners plus success/failure. Does not copy a world# or registration; use the matching plan and provisioning callbacks.def 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>,~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>,System.observable_runner(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~Value,~query,~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>,System.observable_runner(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~Value,~query,~body)>>,Args,Out>) & Sys.Outcome<Ctx.Context<W.World<S,C,R,E>>,Choice.Choice<PriorError,ExecutionError<Error>>,Unit>: Generic.execution_dispatch(~S,~C,~R,~E,~Owners,~Rows,~observe,~fold,~PriorError,~priorPlan,~priorDispatch,~priorProvide,~Ops,~Args,~Error,~Out,~Value,~query,~body,~System.observable_runner(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~Value,~query,~body),~System.observable_define(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~Value,~query,~body),~ExecuteRun.component(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~Value,~query,~body),~ExecutionError<Error>,~callback_failure(~Error),~RegistrationRefused{},~render)# Advanced derived requirement callback for add; threads the world through# prior provisioning and preserves its declared requirements. This component# invocation adds no new requirements. Does not execute the registered body.def 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>,~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>>: Generic.execution_provide(~S,~C,~R,~E,~Owners,~Rows,~observe,~fold,~PriorError,~priorPlan,~priorDispatch,~priorProvide,~Ops,~Args,~Error,~Out,~Value,~query,~body,~System.observable_runner(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~Value,~query,~body),~System.observable_define(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~Value,~query,~body),~ExecuteRun.component(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~Value,~query,~body),~ExecutionError<Error>,~callback_failure(~Error),~RegistrationRefused{},~render)