Appearance
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 property | Countdown |
|---|---|
| ID | counter |
| Kind | Integer (non-negative int) |
| Initial value | None at graph entry; the initialize_counter visit proposes the invocation's Count.value |
| Initialization effect | counter? on initialize_counter → check_counter permits the first integer value |
| Declaration | ◆ features/counter/__init__.py |
Feature kinds
| Kind | Python value | Conditions can observe |
|---|---|---|
| Boolean | bool | true or false |
| Integer | non-negative int | zero or greater than zero |
| Float | finite, non-negative float | zero or greater than zero |
| Enum | str | one 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
| File | Role |
|---|---|
◆ features/<feature>/__init__.py | Declares the feature ID, label, description, kind, and allowed enum values. |
◆ features/__init__.py | Imports 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.