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
48 changes: 48 additions & 0 deletions .planning/architecture/kernel_attention.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# kernel_attention

Source: [`emel/kernel/attention/sm.hpp`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/kernel/attention/sm.hpp)

## Mermaid

```mermaid
stateDiagram-v2
direction TB
[*] --> state_ready
state_ready --> state_execute_result_decision : execute [guard_execute_supported_] / effect_execute_head_range_
state_ready --> state_execute_error_callback_decision : execute [guard_execute_unsupported_] / effect_reject_execute_
state_execute_result_decision --> state_execute_done_callback_decision : completion_execute_ [guard_execute_succeeded_] / effect_accept_execute_
state_execute_result_decision --> state_execute_error_callback_decision : completion_execute_ [guard_execute_failed_] / effect_reject_execute_
state_execute_done_callback_decision --> state_execute_done : completion_execute_ [guard_has_done_callback_] / effect_emit_execute_done_
state_execute_done_callback_decision --> state_execute_done : completion_execute_ [guard_no_done_callback_] / none
state_execute_error_callback_decision --> state_execute_errored : completion_execute_ [guard_has_error_callback_] / effect_emit_execute_error_
state_execute_error_callback_decision --> state_execute_errored : completion_execute_ [guard_no_error_callback_] / none
state_execute_done --> state_ready : completion_execute_ [always] / none
state_execute_errored --> state_ready : completion_execute_ [always] / none
state_ready --> state_ready : _ [always] / effect_on_unexpected_
state_execute_result_decision --> state_ready : _ [always] / effect_on_unexpected_
state_execute_done_callback_decision --> state_ready : _ [always] / effect_on_unexpected_
state_execute_error_callback_decision --> state_ready : _ [always] / effect_on_unexpected_
state_execute_done --> state_ready : _ [always] / effect_on_unexpected_
state_execute_errored --> state_ready : _ [always] / effect_on_unexpected_
```

## Transitions

| Source | Event | Guard | Action | Target |
| --- | --- | --- | --- | --- |
| [`state_ready`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/kernel/attention/sm.hpp) | [`execute`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/kernel/attention/sm.hpp) | [`guard_execute_supported>`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/kernel/attention/sm.hpp) | [`effect_execute_head_range>`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/kernel/attention/sm.hpp) | [`state_execute_result_decision`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/kernel/attention/sm.hpp) |
| [`state_ready`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/kernel/attention/sm.hpp) | [`execute`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/kernel/attention/sm.hpp) | [`guard_execute_unsupported>`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/kernel/attention/sm.hpp) | [`effect_reject_execute>`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/kernel/attention/sm.hpp) | [`state_execute_error_callback_decision`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/kernel/attention/sm.hpp) |
| [`state_execute_result_decision`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/kernel/attention/sm.hpp) | [`completion<execute>`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/kernel/attention/sm.hpp) | [`guard_execute_succeeded>`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/kernel/attention/sm.hpp) | [`effect_accept_execute>`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/kernel/attention/sm.hpp) | [`state_execute_done_callback_decision`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/kernel/attention/sm.hpp) |
| [`state_execute_result_decision`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/kernel/attention/sm.hpp) | [`completion<execute>`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/kernel/attention/sm.hpp) | [`guard_execute_failed>`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/kernel/attention/sm.hpp) | [`effect_reject_execute>`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/kernel/attention/sm.hpp) | [`state_execute_error_callback_decision`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/kernel/attention/sm.hpp) |
| [`state_execute_done_callback_decision`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/kernel/attention/sm.hpp) | [`completion<execute>`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/kernel/attention/sm.hpp) | [`guard_has_done_callback>`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/kernel/attention/sm.hpp) | [`effect_emit_execute_done>`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/kernel/attention/sm.hpp) | [`state_execute_done`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/kernel/attention/sm.hpp) |
| [`state_execute_done_callback_decision`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/kernel/attention/sm.hpp) | [`completion<execute>`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/kernel/attention/sm.hpp) | [`guard_no_done_callback>`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/kernel/attention/sm.hpp) | [`none`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/kernel/attention/sm.hpp) | [`state_execute_done`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/kernel/attention/sm.hpp) |
| [`state_execute_error_callback_decision`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/kernel/attention/sm.hpp) | [`completion<execute>`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/kernel/attention/sm.hpp) | [`guard_has_error_callback>`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/kernel/attention/sm.hpp) | [`effect_emit_execute_error>`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/kernel/attention/sm.hpp) | [`state_execute_errored`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/kernel/attention/sm.hpp) |
| [`state_execute_error_callback_decision`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/kernel/attention/sm.hpp) | [`completion<execute>`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/kernel/attention/sm.hpp) | [`guard_no_error_callback>`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/kernel/attention/sm.hpp) | [`none`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/kernel/attention/sm.hpp) | [`state_execute_errored`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/kernel/attention/sm.hpp) |
| [`state_execute_done`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/kernel/attention/sm.hpp) | [`completion<execute>`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/kernel/attention/sm.hpp) | [`always`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/kernel/attention/sm.hpp) | [`none`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/kernel/attention/sm.hpp) | [`state_ready`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/kernel/attention/sm.hpp) |
| [`state_execute_errored`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/kernel/attention/sm.hpp) | [`completion<execute>`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/kernel/attention/sm.hpp) | [`always`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/kernel/attention/sm.hpp) | [`none`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/kernel/attention/sm.hpp) | [`state_ready`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/kernel/attention/sm.hpp) |
| [`state_ready`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/kernel/attention/sm.hpp) | [`_`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/kernel/attention/sm.hpp) | [`always`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/kernel/attention/sm.hpp) | [`effect_on_unexpected>`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/kernel/attention/sm.hpp) | [`state_ready`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/kernel/attention/sm.hpp) |
| [`state_execute_result_decision`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/kernel/attention/sm.hpp) | [`_`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/kernel/attention/sm.hpp) | [`always`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/kernel/attention/sm.hpp) | [`effect_on_unexpected>`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/kernel/attention/sm.hpp) | [`state_ready`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/kernel/attention/sm.hpp) |
| [`state_execute_done_callback_decision`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/kernel/attention/sm.hpp) | [`_`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/kernel/attention/sm.hpp) | [`always`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/kernel/attention/sm.hpp) | [`effect_on_unexpected>`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/kernel/attention/sm.hpp) | [`state_ready`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/kernel/attention/sm.hpp) |
| [`state_execute_error_callback_decision`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/kernel/attention/sm.hpp) | [`_`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/kernel/attention/sm.hpp) | [`always`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/kernel/attention/sm.hpp) | [`effect_on_unexpected>`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/kernel/attention/sm.hpp) | [`state_ready`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/kernel/attention/sm.hpp) |
| [`state_execute_done`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/kernel/attention/sm.hpp) | [`_`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/kernel/attention/sm.hpp) | [`always`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/kernel/attention/sm.hpp) | [`effect_on_unexpected>`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/kernel/attention/sm.hpp) | [`state_ready`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/kernel/attention/sm.hpp) |
| [`state_execute_errored`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/kernel/attention/sm.hpp) | [`_`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/kernel/attention/sm.hpp) | [`always`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/kernel/attention/sm.hpp) | [`effect_on_unexpected>`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/kernel/attention/sm.hpp) | [`state_ready`](https://github.com/stateforward/emel.cpp/blob/main/src/emel/kernel/attention/sm.hpp) |
Loading