Execution Lifecycle
Overview
Ved execution follows a continuous lifecycle driven by:
- state evaluation
- message processing
- transition execution
Lifecycle Phases
Each cycle consists of:
- Observation
- Evaluation
- Scheduling
- Execution
- Persistence
1. Observation
The runtime observes:
- current state
- incoming messages
2. Evaluation
Goals are evaluated:
G(state) → true | false
If false:
- transitions become eligible
3. Scheduling
Scheduler selects next message:
select_next_message()
Based on deterministic ordering.
4. Execution
Selected transition executes:
- reads state
- performs computation
- mutates state
- emits messages/effects
5. Persistence
State changes are:
- written to journal
- optionally snapshot
Continuous Loop
observe → evaluate → schedule → execute → persist → repeat
Termination
Execution stops when:
- no messages remain
- all goals satisfied
Example Flow
- Goal not satisfied
- Message triggers transition
- State updated
- Goal satisfied
- System stabilizes