Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ within a single transition per phase.
NEVER copy event payload into context just to bridge internal phases.
ALWAYS keep guards pure predicates of `(event, context)` with no side effects.
ALWAYS keep actions bounded, non-blocking, and allocation-free during dispatch.
NEVER put runtime conditional logic in actions or in functions called from
actions.
ALWAYS model all runtime conditional logic as explicit guards or explicit
choice states/transitions.
NEVER put runtime branching statements (`if`, `else if`, `switch`, `?:`) in
actions or in functions called from actions.
ALWAYS model all runtime control flow as explicit guards or explicit choice
states/transitions.
ONLY compile-time conditionals (`if constexpr`, `#if`) are allowed inside
actions, state machine member methods, or functions called from actions.
NEVER perform I/O waits, mutex waits, or sleeps inside guards/actions.
Expand Down
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ allocator, and execution pipelines stabilize.

This inference engine is being implemented by AI under human engineering and architecture direction.

> [!WARNING]
> EMEL is currently going through a major re-architecture expected to complete by end of day on
> Friday, February 27, 2026. The only domain left to rearchitect is the text domain.
> The source of truth for architecture and design lives in `src/emel/**/sm.hpp` docstrings and
> the generated docs under `docs/architecture/`.

## Implementation priorities

Expand Down Expand Up @@ -132,4 +137,4 @@ environments, while Zig remains the default for day-to-day builds.
scripts/generate_docs.sh
```

Use `scripts/generate_docs.sh --check` in CI to validate generated artifacts.
Use `scripts/generate_docs.sh --check` in CI to validate generated artifacts.
12 changes: 6 additions & 6 deletions docs/architecture/batch_planner_modes_equal.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ Source: [`emel/batch/planner/modes/equal/sm.hpp`](https://github.com/stateforwar
stateDiagram-v2
direction TB
[*] --> preparing
preparing --> planning : completion_request_runtime_ [always] / lambda_actions_262_39
preparing --> planning : completion_request_runtime_ [always] / lambda_actions_30_39
planning --> planning_mode_decision : completion_request_runtime_ [always] / none
planning_mode_decision --> planning_fast_path : completion_request_runtime_ [lambda_guards_8_5] / none
planning_mode_decision --> planning_general : completion_request_runtime_ [always] / none
planning_fast_path --> planning_decision : completion_request_runtime_ [always] / lambda_actions_252_55
planning_general --> planning_decision : completion_request_runtime_ [always] / lambda_actions_257_45
planning_fast_path --> planning_decision : completion_request_runtime_ [always] / lambda_actions_20_55
planning_general --> planning_decision : completion_request_runtime_ [always] / lambda_actions_25_45
planning_decision --> planning_done : completion_request_runtime_ [lambda_guards_13_44] / none
planning_decision --> planning_failed : completion_request_runtime_ [lambda_guards_18_41] / none
planning_done --> terminate : [always] / none
Expand All @@ -32,12 +32,12 @@ stateDiagram-v2

| Source | Event | Guard | Action | Target |
| --- | --- | --- | --- | --- |
| [`preparing`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/batch/planner/modes/equal/sm.hpp) | [`completion<request_runtime>`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/batch/planner/modes/equal/sm.hpp) | [`always`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/batch/planner/modes/equal/sm.hpp) | [`lambda_actions_262_39`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/batch/planner/modes/equal/sm.hpp) | [`planning`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/batch/planner/modes/equal/sm.hpp) |
| [`preparing`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/batch/planner/modes/equal/sm.hpp) | [`completion<request_runtime>`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/batch/planner/modes/equal/sm.hpp) | [`always`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/batch/planner/modes/equal/sm.hpp) | [`lambda_actions_30_39`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/batch/planner/modes/equal/sm.hpp) | [`planning`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/batch/planner/modes/equal/sm.hpp) |
| [`planning`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/batch/planner/modes/equal/sm.hpp) | [`completion<request_runtime>`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/batch/planner/modes/equal/sm.hpp) | [`always`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/batch/planner/modes/equal/sm.hpp) | [`none`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/batch/planner/modes/equal/sm.hpp) | [`planning_mode_decision`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/batch/planner/modes/equal/sm.hpp) |
| [`planning_mode_decision`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/batch/planner/modes/equal/sm.hpp) | [`completion<request_runtime>`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/batch/planner/modes/equal/sm.hpp) | [`lambda_guards_8_5`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/batch/planner/modes/equal/sm.hpp) | [`none`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/batch/planner/modes/equal/sm.hpp) | [`planning_fast_path`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/batch/planner/modes/equal/sm.hpp) |
| [`planning_mode_decision`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/batch/planner/modes/equal/sm.hpp) | [`completion<request_runtime>`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/batch/planner/modes/equal/sm.hpp) | [`always`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/batch/planner/modes/equal/sm.hpp) | [`none`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/batch/planner/modes/equal/sm.hpp) | [`planning_general`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/batch/planner/modes/equal/sm.hpp) |
| [`planning_fast_path`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/batch/planner/modes/equal/sm.hpp) | [`completion<request_runtime>`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/batch/planner/modes/equal/sm.hpp) | [`always`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/batch/planner/modes/equal/sm.hpp) | [`lambda_actions_252_55`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/batch/planner/modes/equal/sm.hpp) | [`planning_decision`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/batch/planner/modes/equal/sm.hpp) |
| [`planning_general`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/batch/planner/modes/equal/sm.hpp) | [`completion<request_runtime>`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/batch/planner/modes/equal/sm.hpp) | [`always`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/batch/planner/modes/equal/sm.hpp) | [`lambda_actions_257_45`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/batch/planner/modes/equal/sm.hpp) | [`planning_decision`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/batch/planner/modes/equal/sm.hpp) |
| [`planning_fast_path`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/batch/planner/modes/equal/sm.hpp) | [`completion<request_runtime>`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/batch/planner/modes/equal/sm.hpp) | [`always`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/batch/planner/modes/equal/sm.hpp) | [`lambda_actions_20_55`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/batch/planner/modes/equal/sm.hpp) | [`planning_decision`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/batch/planner/modes/equal/sm.hpp) |
| [`planning_general`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/batch/planner/modes/equal/sm.hpp) | [`completion<request_runtime>`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/batch/planner/modes/equal/sm.hpp) | [`always`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/batch/planner/modes/equal/sm.hpp) | [`lambda_actions_25_45`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/batch/planner/modes/equal/sm.hpp) | [`planning_decision`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/batch/planner/modes/equal/sm.hpp) |
| [`planning_decision`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/batch/planner/modes/equal/sm.hpp) | [`completion<request_runtime>`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/batch/planner/modes/equal/sm.hpp) | [`lambda_guards_13_44`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/batch/planner/modes/equal/sm.hpp) | [`none`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/batch/planner/modes/equal/sm.hpp) | [`planning_done`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/batch/planner/modes/equal/sm.hpp) |
| [`planning_decision`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/batch/planner/modes/equal/sm.hpp) | [`completion<request_runtime>`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/batch/planner/modes/equal/sm.hpp) | [`lambda_guards_18_41`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/batch/planner/modes/equal/sm.hpp) | [`none`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/batch/planner/modes/equal/sm.hpp) | [`planning_failed`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/batch/planner/modes/equal/sm.hpp) |
| [`planning_done`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/batch/planner/modes/equal/sm.hpp) | - | [`always`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/batch/planner/modes/equal/sm.hpp) | [`none`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/batch/planner/modes/equal/sm.hpp) | [`terminate`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/batch/planner/modes/equal/sm.hpp) |
Expand Down
8 changes: 4 additions & 4 deletions docs/architecture/batch_planner_modes_sequential.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ Source: [`emel/batch/planner/modes/sequential/sm.hpp`](https://github.com/statef
stateDiagram-v2
direction TB
[*] --> preparing
preparing --> planning : completion_request_runtime_ [always] / lambda_actions_76_39
planning --> planning_decision : completion_request_runtime_ [always] / lambda_actions_80_37
preparing --> planning : completion_request_runtime_ [always] / lambda_actions_12_39
planning --> planning_decision : completion_request_runtime_ [always] / lambda_actions_16_37
planning_decision --> planning_done : completion_request_runtime_ [lambda_guards_8_5] / none
planning_decision --> planning_failed : completion_request_runtime_ [lambda_guards_13_41] / none
planning_done --> terminate : [always] / none
Expand All @@ -25,8 +25,8 @@ stateDiagram-v2

| Source | Event | Guard | Action | Target |
| --- | --- | --- | --- | --- |
| [`preparing`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/batch/planner/modes/sequential/sm.hpp) | [`completion<request_runtime>`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/batch/planner/modes/sequential/sm.hpp) | [`always`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/batch/planner/modes/sequential/sm.hpp) | [`lambda_actions_76_39`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/batch/planner/modes/sequential/sm.hpp) | [`planning`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/batch/planner/modes/sequential/sm.hpp) |
| [`planning`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/batch/planner/modes/sequential/sm.hpp) | [`completion<request_runtime>`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/batch/planner/modes/sequential/sm.hpp) | [`always`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/batch/planner/modes/sequential/sm.hpp) | [`lambda_actions_80_37`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/batch/planner/modes/sequential/sm.hpp) | [`planning_decision`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/batch/planner/modes/sequential/sm.hpp) |
| [`preparing`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/batch/planner/modes/sequential/sm.hpp) | [`completion<request_runtime>`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/batch/planner/modes/sequential/sm.hpp) | [`always`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/batch/planner/modes/sequential/sm.hpp) | [`lambda_actions_12_39`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/batch/planner/modes/sequential/sm.hpp) | [`planning`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/batch/planner/modes/sequential/sm.hpp) |
| [`planning`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/batch/planner/modes/sequential/sm.hpp) | [`completion<request_runtime>`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/batch/planner/modes/sequential/sm.hpp) | [`always`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/batch/planner/modes/sequential/sm.hpp) | [`lambda_actions_16_37`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/batch/planner/modes/sequential/sm.hpp) | [`planning_decision`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/batch/planner/modes/sequential/sm.hpp) |
| [`planning_decision`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/batch/planner/modes/sequential/sm.hpp) | [`completion<request_runtime>`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/batch/planner/modes/sequential/sm.hpp) | [`lambda_guards_8_5`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/batch/planner/modes/sequential/sm.hpp) | [`none`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/batch/planner/modes/sequential/sm.hpp) | [`planning_done`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/batch/planner/modes/sequential/sm.hpp) |
| [`planning_decision`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/batch/planner/modes/sequential/sm.hpp) | [`completion<request_runtime>`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/batch/planner/modes/sequential/sm.hpp) | [`lambda_guards_13_41`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/batch/planner/modes/sequential/sm.hpp) | [`none`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/batch/planner/modes/sequential/sm.hpp) | [`planning_failed`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/batch/planner/modes/sequential/sm.hpp) |
| [`planning_done`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/batch/planner/modes/sequential/sm.hpp) | - | [`always`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/batch/planner/modes/sequential/sm.hpp) | [`none`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/batch/planner/modes/sequential/sm.hpp) | [`terminate`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/batch/planner/modes/sequential/sm.hpp) |
Expand Down
8 changes: 4 additions & 4 deletions docs/architecture/batch_planner_modes_simple.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ Source: [`emel/batch/planner/modes/simple/sm.hpp`](https://github.com/stateforwa
stateDiagram-v2
direction TB
[*] --> preparing
preparing --> planning : completion_request_runtime_ [always] / lambda_actions_40_39
planning --> planning_decision : completion_request_runtime_ [always] / lambda_actions_44_37
preparing --> planning : completion_request_runtime_ [always] / lambda_actions_13_39
planning --> planning_decision : completion_request_runtime_ [always] / lambda_actions_17_37
planning_decision --> planning_done : completion_request_runtime_ [lambda_guards_7_44] / none
planning_decision --> planning_failed : completion_request_runtime_ [lambda_guards_13_5] / none
planning_done --> terminate : [always] / none
Expand All @@ -25,8 +25,8 @@ stateDiagram-v2

| Source | Event | Guard | Action | Target |
| --- | --- | --- | --- | --- |
| [`preparing`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/batch/planner/modes/simple/sm.hpp) | [`completion<request_runtime>`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/batch/planner/modes/simple/sm.hpp) | [`always`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/batch/planner/modes/simple/sm.hpp) | [`lambda_actions_40_39`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/batch/planner/modes/simple/sm.hpp) | [`planning`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/batch/planner/modes/simple/sm.hpp) |
| [`planning`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/batch/planner/modes/simple/sm.hpp) | [`completion<request_runtime>`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/batch/planner/modes/simple/sm.hpp) | [`always`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/batch/planner/modes/simple/sm.hpp) | [`lambda_actions_44_37`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/batch/planner/modes/simple/sm.hpp) | [`planning_decision`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/batch/planner/modes/simple/sm.hpp) |
| [`preparing`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/batch/planner/modes/simple/sm.hpp) | [`completion<request_runtime>`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/batch/planner/modes/simple/sm.hpp) | [`always`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/batch/planner/modes/simple/sm.hpp) | [`lambda_actions_13_39`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/batch/planner/modes/simple/sm.hpp) | [`planning`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/batch/planner/modes/simple/sm.hpp) |
| [`planning`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/batch/planner/modes/simple/sm.hpp) | [`completion<request_runtime>`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/batch/planner/modes/simple/sm.hpp) | [`always`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/batch/planner/modes/simple/sm.hpp) | [`lambda_actions_17_37`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/batch/planner/modes/simple/sm.hpp) | [`planning_decision`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/batch/planner/modes/simple/sm.hpp) |
| [`planning_decision`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/batch/planner/modes/simple/sm.hpp) | [`completion<request_runtime>`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/batch/planner/modes/simple/sm.hpp) | [`lambda_guards_7_44`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/batch/planner/modes/simple/sm.hpp) | [`none`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/batch/planner/modes/simple/sm.hpp) | [`planning_done`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/batch/planner/modes/simple/sm.hpp) |
| [`planning_decision`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/batch/planner/modes/simple/sm.hpp) | [`completion<request_runtime>`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/batch/planner/modes/simple/sm.hpp) | [`lambda_guards_13_5`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/batch/planner/modes/simple/sm.hpp) | [`none`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/batch/planner/modes/simple/sm.hpp) | [`planning_failed`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/batch/planner/modes/simple/sm.hpp) |
| [`planning_done`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/batch/planner/modes/simple/sm.hpp) | - | [`always`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/batch/planner/modes/simple/sm.hpp) | [`none`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/batch/planner/modes/simple/sm.hpp) | [`terminate`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/batch/planner/modes/simple/sm.hpp) |
Expand Down
Loading