Skip to content

Feature ​

A feature is a typed component of subroutine state. Edge conditions observe its value; edge effects constrain its change. Every feature starts uninitialized and receives values through Feature-node visits.

Countdown example ​

The Countdown subroutine owns one feature:

Feature propertyCountdown
IDcounter
KindInteger (non-negative int)
Initial valueNone at graph entry; the initialize_counter visit proposes the invocation's Count.value
Initialization effectcounter? on initialize_counter → check_counter permits the first integer value
Declaration◆ features/counter/__init__.py

Feature kinds ​

KindPython valueConditions can observe
Booleanbooltrue or false
Integernon-negative intzero or greater than zero
Floatfinite, non-negative floatzero or greater than zero
Enumstrone declared value

Authored files ​

Features have no authored module or initializer callback. Initialization and updates belong to authored Feature visits, stored at ● nodes/<node>/visit/<edge-id>/impl.py.

Initialization ​

Every subroutine invocation starts with all feature values set to None. A Feature visit proposes the first domain value through state.replace(FEATURE, value). Evaluating a condition on an uninitialized feature raises ValueError. Increase and decrease effects also require an initialized source value, whereas assignment and unconstrained effects can initialize a feature. An unchanged effect preserves None. Once initialized, a feature cannot be reset to None.

Conditions read the state before the source visit. An initialization node must therefore precede any node whose outgoing conditions read the initialized feature; a condition on the initialization node's own outgoing edge would still read None.

Conditions and effects ​

Conditions and effects do not add files to the feature directory. They update each affected ◆ edges/<edge-id>/__init__.py declaration, which imports this feature's entry from FEATURE_IDS and builds the corresponding typed observation.

Only an edge originating at a Feature node may carry explicit effects. Edge defines the observations; Visit describes the candidate values against which the runtime evaluates them.

Files ​

Each feature has a generated declaration and no authored file. Its subroutine also has one generated registry for all feature declarations.

General feature structure

features/
├── ◆ __init__.py
└── <feature>/
    └── ◆ __init__.py
FileRole
◆ features/<feature>/__init__.pyDeclares the feature ID, label, description, kind, and allowed enum values.
◆ features/__init__.pyImports every FEATURE in the subroutine and exports them as the FEATURES tuple.

Generated files ​

See the generated declaration reference for the Python declarations and registries maintained by generation.