feature.bend checks
raw source on the hub · import 0x67fd5084c1da4adc13317822045bb11f/feature.bend as Feature
3 imports
import Base import ./schema_fragments.bend as SF import ./schedule_provision.bend as P
Types
type Tree source · line 9 · raw
@S:Data -> Data
Recursive author metadata contains no payload owners or gameplay authority. Detached feature selection metadata with named dependencies and schema entries. A dependency reference does not automatically select/build it; selected features must include required names. Owns no live world or payload.
Empty@S:Data -> Tree<S>
Feature@S:Data -> @name:String -> @entries:List<&2, 0x67fd5084c1da4adc13317822045bb11f/schema_fragments.Entry<S>> -> @dependencies:Tree<S> -> Tree<S>
Sequence@S:Data -> @left:Tree<S> -> @right:Tree<S> -> Tree<S>
type Error source · line 15 · raw
Data
Feature composition refusal: duplicate selected feature, absent dependency name or schema descriptor conflict. No builder has run on validation refusal.
DuplicateFeature@name:String -> Error
MissingDependency@name:String -> Error
SchemaConflict@error:0x67fd5084c1da4adc13317822045bb11f/schema_fragments.Error -> Error
type Validation source · line 20 · raw
Data
Pure feature validation result; owns no application payload or context.
ValidValidation
Invalid@error:Error -> Validation
type Composition source · line 25 · raw
@S:Data -> @Owners:Type -> @Output:Type -> Type
Validated composition outcome. Built owns build output; Rejected returns the original affine Owners with the validation error for recovery or retry.
Built@S:Data -> @Owners:Type -> @Output:Type -> @output:Output -> Composition<S, Owners, Output>
Rejected@S:Data -> @Owners:Type -> @Output:Type -> @error:Error -> @owners:Owners -> Composition<S, Owners, Output>
type Pack source · line 102 · raw
@Head:Type -> @Tail:Type -> Type
Typed builder composition threads Context and recursive heterogeneous owners. Schedule plans retain authored nested requirements and selected order. Heterogeneous affine head/tail feature owners or outputs, preserving order. Nest this product for additional features; payloads need not be Data.
Pack@Head:Type -> @Tail:Type -> @head:Head -> @tail:Tail -> Pack<Head, Tail>
type Output source · line 106 · raw
@S:Data -> @Extra:Type -> Type
Owned extra feature result plus bootstrap/update operational schedule plans. These plans describe later execution; constructing Output runs no schedule.
Output@S:Data -> @Extra:Type -> @extra:Extra -> @bootstrap:0x67fd5084c1da4adc13317822045bb11f/schedule_provision.Plan<S> -> @update:0x67fd5084c1da4adc13317822045bb11f/schedule_provision.Plan<S> -> Output<S, Extra>
type Definition source · line 124 · raw
@S:Data -> Data
Trusted schema constructors pair each definition with its actual owned builder. Gameplay does not receive these raw constructors or callback fields. Trusted static feature definition: name, own schema entries and dependency references. It contains no live feature owners or gameplay authority.
Definition@S:Data -> @name:String -> @entries:List<&2, 0x67fd5084c1da4adc13317822045bb11f/schema_fragments.Entry<S>> -> @dependencies:Tree<S> -> Definition<S>
type Feature source · line 129 · raw
@S:Data -> @Ctx:Type -> @Owners:Type -> @Extra:Type -> Type
Owned feature definition and trusted builder. build consumes/returns its context and consumes Owners to produce Extra plus plans; raw callbacks remain trusted setup rather than constrained system-body capabilities.
FeatureOwner@S:Data -> @Ctx:Type -> @Owners:Type -> @Extra:Type -> @definition:Definition<S> -> @owners:Owners -> @build:(@_:Ctx -> @_:Owners -> Pair(Ctx, Output<S, Extra>)) -> Feature<S, Ctx, Owners, Extra>
type Recipe source · line 133 · raw
@S:Data -> @Ctx:Type -> @Owners:Type -> @Extra:Type -> Type
Selected feature metadata with actual heterogeneous owners and builder. Thread affinely into run_recipe; metadata validation never copies owners.
Recipe@S:Data -> @Ctx:Type -> @Owners:Type -> @Extra:Type -> @selected:Tree<S> -> @owners:Owners -> @build:(@_:Ctx -> @_:Owners -> Pair(Ctx, Output<S, Extra>)) -> Recipe<S, Ctx, Owners, Extra>
type RecipeResult source · line 138 · raw
@S:Data -> @Ctx:Type -> @Owners:Type -> @Extra:Type -> Type
Completed returns context and built output; Refused returns context and the entire original recipe on metadata validation failure. No builder runs in Refused, so its owners can be retried or disposed by the caller.
Completed@S:Data -> @Ctx:Type -> @Owners:Type -> @Extra:Type -> @ctx:Ctx -> @output:Output<S, Extra> -> RecipeResult<S, Ctx, Owners, Extra>
Refused@S:Data -> @Ctx:Type -> @Owners:Type -> @Extra:Type -> @error:Error -> @ctx:Ctx -> @recipe:Recipe<S, Ctx, Owners, Extra> -> RecipeResult<S, Ctx, Owners, Extra>
Definitions
def contains source · line 49 · raw
@items:List<&2, String> -> @+name:String -> Bool
def repeated source · line 53 · raw
@present:Bool -> @name:String -> @next:(@_:Unit -> Validation) -> Validation
def duplicates source · line 57 · raw
@items:List<&2, String> -> @+seen:List<&2, String> -> Validation
def missing source · line 61 · raw
@present:Bool -> @name:String -> @next:(@_:Unit -> Validation) -> Validation
def required source · line 65 · raw
@items:List<&2, String> -> @+selected:List<&2, String> -> Validation
def continue_validation source · line 69 · raw
@result:Validation -> @next:(@_:Unit -> Validation) -> Validation
def schema_validation source · line 78 · raw
@result:0x67fd5084c1da4adc13317822045bb11f/schema_fragments.Validation -> Validation
Templates
template names source · line 30 · raw
@-S:Data -> @tree:Tree<S> -> List<&2, String>
List selected feature names in authored sequence order, without recursively treating dependency references as additional selected features.
template entries source · line 37 · raw
@-S:Data -> @tree:Tree<S> -> List<&2, 0x67fd5084c1da4adc13317822045bb11f/schema_fragments.Entry<S>>
List entries from selected features in authored sequence order. Dependency metadata does not implicitly add those features or their schema entries.
template visibility source · line 44 · raw
@-S:Data -> @tree:Tree<S> -> List<&2, 0x67fd5084c1da4adc13317822045bb11f/schema_fragments.Entry<S>>
Collect own and referenced dependency entries recursively for visibility description. This does not select/build dependencies or validate composition.
template dependencies source · line 73 · raw
@-S:Data -> @tree:Tree<S> -> @+selected:List<&2, String> -> Validation
template validate source · line 85 · raw
@-S:Data -> @+tree:Tree<S> -> Validation
Check selected feature names, required dependency names and schema entries before any owned builder runs. Dependencies are name requirements, not an automatic dependency resolver or topological reorder of authored selection.
template compose_checked source · line 87 · raw
@-S:Data -> @-Owners:Type -> @-Output:Type -> @-build:(@_:Owners -> Output) -> @result:Validation -> @owners:Owners -> Composition<S, Owners, Output>
template compose source · line 95 · raw
@-S:Data -> @-Owners:Type -> @-Output:Type -> @-build:(@_:Owners -> Output) -> @tree:Tree<S> -> @owners:Owners -> Composition<S, Owners, Output>
Validate the metadata tree before passing affine Owners to the trusted build callback. Invalid returns Rejected with original owners; valid invokes build once. Does not make arbitrary builder effects transactional. Contract and accepted consumers: docs/parity/features.md.
template combine source · line 108 · raw
@-S:Data -> @-Ctx:Type -> @-HE:Type -> @-TE:Type -> @observed:Pair(Ctx, Output<S, TE>) -> @head:Output<S, HE> -> Pair(Ctx, Output<S, Pack<HE, TE>>)
template build_head_done source · line 111 · raw
@-S:Data -> @-Ctx:Type -> @-HO:Type -> @-TO:Type -> @-HE:Type -> @-TE:Type -> @-tail:(@_:Ctx -> @_:TO -> Pair(Ctx, Output<S, TE>)) -> @owners:TO -> @observed:Pair(Ctx, Output<S, HE>) -> Pair(Ctx, Output<S, Pack<HE, TE>>)
template build_head source · line 114 · raw
@-S:Data -> @-Ctx:Type -> @-HO:Type -> @-TO:Type -> @-HE:Type -> @-TE:Type -> @-head:(@_:Ctx -> @_:HO -> Pair(Ctx, Output<S, HE>)) -> @-tail:(@_:Ctx -> @_:TO -> Pair(Ctx, Output<S, TE>)) -> @ctx:Ctx -> @owners:Pack<HO, TO> -> Pair(Ctx, Output<S, Pack<HE, TE>>)
template build_empty source · line 117 · raw
@-S:Data -> @-Ctx:Type -> @ctx:Ctx -> @owner:Unit -> Pair(Ctx, Output<S, Unit>)
template definition_tree source · line 141 · raw
@-S:Data -> @definition:Definition<S> -> Tree<S>
template callbacks_done source · line 144 · raw
@-S:Data -> @-Ctx:Type -> @-HO:Type -> @-TO:Type -> @-HE:Type -> @-TE:Type -> @tail:(@_:Ctx -> @_:TO -> Pair(Ctx, Output<S, TE>)) -> @owners:TO -> @observed:Pair(Ctx, Output<S, HE>) -> Pair(Ctx, Output<S, Pack<HE, TE>>)
template callbacks source · line 147 · raw
@-S:Data -> @-Ctx:Type -> @-HO:Type -> @-TO:Type -> @-HE:Type -> @-TE:Type -> @head:(@_:Ctx -> @_:HO -> Pair(Ctx, Output<S, HE>)) -> @tail:(@_:Ctx -> @_:TO -> Pair(Ctx, Output<S, TE>)) -> @ctx:Ctx -> @owners:Pack<HO, TO> -> Pair(Ctx, Output<S, Pack<HE, TE>>)
template prepend source · line 153 · raw
@-S:Data -> @-Ctx:Type -> @-HO:Type -> @-TO:Type -> @-HE:Type -> @-TE:Type -> @head:Feature<S, Ctx, HO, HE> -> @tail:Recipe<S, Ctx, TO, TE> -> Recipe<S, Ctx, Pack<HO, TO>, Pack<HE, TE>>
Prepend an owned feature to a recipe, retaining head-before-tail build and bootstrap/update plan order. Does not validate, invoke builders or automatically add dependencies; run_recipe validates the completed selection.
template recipe_empty source · line 158 · raw
@-S:Data -> @-Ctx:Type -> Recipe<S, Ctx, Unit, Unit>
Create the empty recipe with Unit owners and empty schedule plans. No context is consumed until the resulting builder is executed.
template recipe_completed source · line 160 · raw
@-S:Data -> @-Ctx:Type -> @-Owners:Type -> @-Extra:Type -> @observed:Pair(Ctx, Output<S, Extra>) -> RecipeResult<S, Ctx, Owners, Extra>
template recipe_checked source · line 163 · raw
@-S:Data -> @-Ctx:Type -> @-Owners:Type -> @-Extra:Type -> @result:Validation -> @ctx:Ctx -> @recipe:Recipe<S, Ctx, Owners, Extra> -> RecipeResult<S, Ctx, Owners, Extra>
template run_recipe source · line 171 · raw
@-S:Data -> @-Ctx:Type -> @-Owners:Type -> @-Extra:Type -> @ctx:Ctx -> @recipe:Recipe<S, Ctx, Owners, Extra> -> RecipeResult<S, Ctx, Owners, Extra>
Validate the selected tree before executing its trusted owned builder. Refusal returns context and original recipe; success returns context plus built extras/plans. Authored order is preserved; no automatic rollback of arbitrary callback effects or host IO is provided.