import Base import ./execution_composer_layout.bend as Layout import ./execution_resource_policy.bend as Policy import ./execution_relation_context.bend as Context import ./execution_relation_store.bend as Store import ./relation_types.bend as T # Provisioning gives the canonical leaf its actual protected access policy. # Persistence remains independent; this leaf has ordinary persistence behavior. def layout(~S:Data,~descriptor:T.Descriptor,key:String) -> Layout.Layout: Layout.LayoutLeaf{Store.Store,Store.View,Store.project(~S,~descriptor),key,Policy.ProtectedRelation{S,descriptor}} # Authority is derived from the actual full schema and exact selected leaf, not # from a key lookup or a policy tag interpreted as a payload type. def bind(~S:Data,~WR:Type,~resources:Layout.Layout,~same:{WR == Layout.resources(~S,resources) : Type},~route:Layout.Route,~valid:{Layout.grant_valid(~resources,~route) == True{} : Bool},~descriptor:T.Descriptor,~payload:{Layout.payload(resources,route) == Store.Store : Type},~view:{Layout.view(resources,route) == Store.View : Data},~protected:{Layout.policy(resources,route) == Policy.ProtectedRelation{S,descriptor} : Policy.Policy},context:Context.Context) -> Context.Binding: Context.Binding{context}