schedule_provision.bend checks
raw source on the hub · import 0x67fd5084c1da4adc13317822045bb11f/schedule_provision.bend as Schedule_provision
4 imports
import Base import ./world.bend as W import ./system.bend as Sys import ./schedule.bend as Sch
Types
type Requirement source · line 9 · raw
@S:Data -> Data
Schema authoring provisions nominal requirement tokens. Gameplay cannot turn these tokens into component/resource/service providers. Actual availability is observed from the owned application's provisioning record before any step.
Component@S:Data -> @id:U32 -> Requirement<S>
Resource@S:Data -> @id:U32 -> Requirement<S>
Service@S:Data -> @id:U32 -> Requirement<S>
type Plan source · line 15 · raw
@S:Data -> Data
Authored left-to-right schedule tree with per-entry provisioning requirements. Empty contributes no steps; Sequence preserves both child orders.
Empty@S:Data -> Plan<S>
Entry@S:Data -> @step:0x67fd5084c1da4adc13317822045bb11f/schedule.Step -> @requirements:List<&2, Requirement<S>> -> Plan<S>
Sequence@S:Data -> @left:Plan<S> -> @right:Plan<S> -> Plan<S>
type Provisioned source · line 20 · raw
@S:Data -> @C:Type -> @R:Type -> @E:Data -> @H:Type -> Type
Affine schedule owner paired with its deduplicated setup requirements.
Provisioned@S:Data -> @C:Type -> @R:Type -> @E:Data -> @H:Type -> @schedule:0x67fd5084c1da4adc13317822045bb11f/schedule.Schedule<S, C, R, E, H> -> @requirements:List<&2, Requirement<S>> -> Provisioned<S, C, R, E, H>
type Build source · line 23 · raw
@S:Data -> @C:Type -> @R:Type -> @E:Data -> @H:Type -> Type
Built retains the provisioned schedule; Invalid returns the supplied owners.
Built@S:Data -> @C:Type -> @R:Type -> @E:Data -> @H:Type -> @schedule:Provisioned<S, C, R, E, H> -> Build<S, C, R, E, H>
Invalid@S:Data -> @C:Type -> @R:Type -> @E:Data -> @H:Type -> @owners:H -> Build<S, C, R, E, H>
type ProvisionResult source · line 29 · raw
@S:Data -> @C:Type -> @R:Type -> @E:Data -> @H:Type -> @Error:Data -> Type
Missing returns schedule and observed World before any schedule step runs. Executed contains the underlying schedule result and original requirement list; inspect that result for success, rejection or system failure.
Executed@S:Data -> @C:Type -> @R:Type -> @E:Data -> @H:Type -> @Error:Data -> @result:0x67fd5084c1da4adc13317822045bb11f/schedule.RunResult<S, C, R, E, H, Error> -> @requirements:List<&2, Requirement<S>> -> ProvisionResult<S, C, R, E, H, Error>
Missing@S:Data -> @C:Type -> @R:Type -> @E:Data -> @H:Type -> @Error:Data -> @schedule:Provisioned<S, C, R, E, H> -> @world:0x67fd5084c1da4adc13317822045bb11f/world.World<S, C, R, E> -> @missing:List<&2, Requirement<S>> -> ProvisionResult<S, C, R, E, H, Error>
Templates
template same source · line 33 · raw
@-S:Data -> @a:Requirement<S> -> @b:Requirement<S> -> Bool
template contains source · line 40 · raw
@-S:Data -> @items:List<&2, Requirement<S>> -> @+item:Requirement<S> -> Bool
template unique_add source · line 45 · raw
@-S:Data -> @present:Bool -> @+item:Requirement<S> -> @rest:List<&2, Requirement<S>> -> List<&2, Requirement<S>>
template unique_seen source · line 50 · raw
@-S:Data -> @items:List<&2, Requirement<S>> -> @+seen:List<&2, Requirement<S>> -> List<&2, Requirement<S>>
template unique source · line 55 · raw
@-S:Data -> @items:List<&2, Requirement<S>> -> List<&2, Requirement<S>>
template flatten source · line 58 · raw
@-S:Data -> @plan:Plan<S> -> List<&2, 0x67fd5084c1da4adc13317822045bb11f/schedule.Step>
template requirements source · line 66 · raw
@-S:Data -> @plan:Plan<S> -> List<&2, Requirement<S>>
Collect authored requirements left before right, retaining duplicates. build deduplicates this list for its provisioned schedule.
template finish_build source · line 72 · raw
@-S:Data -> @-C:Type -> @-R:Type -> @-E:Data -> @-H:Type -> @built:0x67fd5084c1da4adc13317822045bb11f/schedule.Build<S, C, R, E, H> -> @needs:List<&2, Requirement<S>> -> Build<S, C, R, E, H>
template build source · line 80 · raw
@-S:Data -> @-C:Type -> @-R:Type -> @-E:Data -> @-H:Type -> @+namespace:U32 -> @+name:String -> @+plan:Plan<S> -> @catalog:List<&2, U32> -> @owners:H -> Build<S, C, R, E, H>
Flatten the authored plan and validate system ids against the trusted catalog, rejecting duplicates/unknown systems with owners returned. Retain first-occurrence requirement order; namespace/catalog provenance and condition slots are setup.
template missing_next source · line 83 · raw
@-S:Data -> @present:Bool -> @item:Requirement<S> -> @next:List<&2, Requirement<S>> -> List<&2, Requirement<S>>
template missing_requirements source · line 88 · raw
@-S:Data -> @needs:List<&2, Requirement<S>> -> @+available:List<&2, Requirement<S>> -> List<&2, Requirement<S>>
template run_checked source · line 93 · raw
@-S:Data -> @-C:Type -> @-R:Type -> @-E:Data -> @-H:Type -> @-Error:Data -> @-dispatch:(@_:H -> @_:0x67fd5084c1da4adc13317822045bb11f/world.World<S, C, R, E> -> @_:U32 -> Pair(H, 0x67fd5084c1da4adc13317822045bb11f/system.Outcome<0x67fd5084c1da4adc13317822045bb11f/world.World<S, C, R, E>, Error, Unit>)) -> @-condition:(@_:0x67fd5084c1da4adc13317822045bb11f/world.World<S, C, R, E> -> @_:U32 -> Pair(0x67fd5084c1da4adc13317822045bb11f/world.World<S, C, R, E>, Bool)) -> @-barrier:(@_:H -> @_:0x67fd5084c1da4adc13317822045bb11f/world.World<S, C, R, E> -> Pair(H, 0x67fd5084c1da4adc13317822045bb11f/world.World<S, C, R, E>)) -> @missing:List<&2, Requirement<S>> -> @schedule:0x67fd5084c1da4adc13317822045bb11f/schedule.Schedule<S, C, R, E, H> -> @world:0x67fd5084c1da4adc13317822045bb11f/world.World<S, C, R, E> -> @needs:List<&2, Requirement<S>> -> ProvisionResult<S, C, R, E, H, Error>
template run_available source · line 98 · raw
@-S:Data -> @-C:Type -> @-R:Type -> @-E:Data -> @-H:Type -> @-Error:Data -> @-dispatch:(@_:H -> @_:0x67fd5084c1da4adc13317822045bb11f/world.World<S, C, R, E> -> @_:U32 -> Pair(H, 0x67fd5084c1da4adc13317822045bb11f/system.Outcome<0x67fd5084c1da4adc13317822045bb11f/world.World<S, C, R, E>, Error, Unit>)) -> @-condition:(@_:0x67fd5084c1da4adc13317822045bb11f/world.World<S, C, R, E> -> @_:U32 -> Pair(0x67fd5084c1da4adc13317822045bb11f/world.World<S, C, R, E>, Bool)) -> @-barrier:(@_:H -> @_:0x67fd5084c1da4adc13317822045bb11f/world.World<S, C, R, E> -> Pair(H, 0x67fd5084c1da4adc13317822045bb11f/world.World<S, C, R, E>)) -> @observed:Pair(0x67fd5084c1da4adc13317822045bb11f/world.World<S, C, R, E>, List<&2, Requirement<S>>) -> @schedule:0x67fd5084c1da4adc13317822045bb11f/schedule.Schedule<S, C, R, E, H> -> @+needs:List<&2, Requirement<S>> -> ProvisionResult<S, C, R, E, H, Error>
template run_with_barrier source · line 107 · raw
@-S:Data -> @-C:Type -> @-R:Type -> @-E:Data -> @-H:Type -> @-Error:Data -> @-dispatch:(@_:H -> @_:0x67fd5084c1da4adc13317822045bb11f/world.World<S, C, R, E> -> @_:U32 -> Pair(H, 0x67fd5084c1da4adc13317822045bb11f/system.Outcome<0x67fd5084c1da4adc13317822045bb11f/world.World<S, C, R, E>, Error, Unit>)) -> @-condition:(@_:0x67fd5084c1da4adc13317822045bb11f/world.World<S, C, R, E> -> @_:U32 -> Pair(0x67fd5084c1da4adc13317822045bb11f/world.World<S, C, R, E>, Bool)) -> @-barrier:(@_:H -> @_:0x67fd5084c1da4adc13317822045bb11f/world.World<S, C, R, E> -> Pair(H, 0x67fd5084c1da4adc13317822045bb11f/world.World<S, C, R, E>)) -> @-provision:(@_:0x67fd5084c1da4adc13317822045bb11f/world.World<S, C, R, E> -> Pair(0x67fd5084c1da4adc13317822045bb11f/world.World<S, C, R, E>, List<&2, Requirement<S>>)) -> @schedule:Provisioned<S, C, R, E, H> -> @world:0x67fd5084c1da4adc13317822045bb11f/world.World<S, C, R, E> -> ProvisionResult<S, C, R, E, H, Error>
Observe availability once through trusted provision before executing any step. Missing requirements return the observed World and owned schedule without dispatch; provision itself is not promised pure. Otherwise use schedule.bend execution semantics and the supplied explicit barrier action. No final flush or whole-schedule rollback is added; all result branches retain their owners.
template run source · line 113 · raw
@-S:Data -> @-C:Type -> @-R:Type -> @-E:Data -> @-H:Type -> @-Error:Data -> @-dispatch:(@_:H -> @_:0x67fd5084c1da4adc13317822045bb11f/world.World<S, C, R, E> -> @_:U32 -> Pair(H, 0x67fd5084c1da4adc13317822045bb11f/system.Outcome<0x67fd5084c1da4adc13317822045bb11f/world.World<S, C, R, E>, Error, Unit>)) -> @-condition:(@_:0x67fd5084c1da4adc13317822045bb11f/world.World<S, C, R, E> -> @_:U32 -> Pair(0x67fd5084c1da4adc13317822045bb11f/world.World<S, C, R, E>, Bool)) -> @-provision:(@_:0x67fd5084c1da4adc13317822045bb11f/world.World<S, C, R, E> -> Pair(0x67fd5084c1da4adc13317822045bb11f/world.World<S, C, R, E>, List<&2, Requirement<S>>)) -> @schedule:Provisioned<S, C, R, E, H> -> @world:0x67fd5084c1da4adc13317822045bb11f/world.World<S, C, R, E> -> ProvisionResult<S, C, R, E, H, Error>
Run with provisioning admission and the normal World barrier at explicit Barrier steps. As with run_with_barrier, completion does not imply a final flush.