2.5 KiB
2.5 KiB
M-FSM-01..05 — Structured Scopes, Race-Loser Joins, Boundary Checkpoints & Bounded Supervision
- Wave: Wave 8 (
feat/roadmap-p2-wave8, branched frommainatd83d0f4) - Roadmap reference:
docs/roadmap/modules/Fsm.md,docs/roadmap/DEPENDENCIES.md
Scope & Ownership
src/Fsm/module.cmake:INTERNAL_DEPS Async Core Data Functional Time Log Service.include/Void/Fsm/StateKey.hpp:kFsmErrorDomain = 25,FsmErrorCode,make_fsm_error, sharedconstexpr bool terminal(Status)includingFaulted,TerminationReason,FsmLimits(1,024 mailbox events / 4 MiB, 256 deferred, 1,024 timers, 128 child regions, depth 32, 256 retained transitions, 4 MiB checkpoint, 64 events / 1ms per turn),Checkpoint,ExecutionBinding,StateId.include/Void/Fsm/Detail/Engine.hpp+src/Fsm/Engine.cpp:- Injected
Time::MonotonicClockandFsmLimitsfor timers and turn budgeting. - Bounded
try_postenforcing mailbox event & byte limits (overloaded) alongside a bounded control lane so stop/checkpoint/jump always progress. - Scope-tracked waiters & timers (
cancel_scope_waiters) cancelled prior to state destruction.
- Injected
include/Void/Fsm/Machine.hpp:- Preserve 100% of existing API (
start,wait,run_blocking,run_parallel,run_parallel_any,serialize,restore). - Add
acquire_service<I>()returning owningService::ServiceHandle<I>,try_post,termination_reason, boundedtransition_history,observer_errors,state_stop_token(),await_event_cancellable,safe_point. - Add
run(ExecutionBinding, Async::OperationOptions)with root + per-state stop scopes, waiter/timer cleanup beforeon_exit,on_exitexception faulting, observer error isolation. - Add
run_parallel_structured(sibling fault stop/join) andrun_parallel_any_structured(deterministic tie-break + stop/join all losers). - Add boundary
request_checkpoint/restore_checkpoint/restore_legacy_checkpoint.
- Preserve 100% of existing API (
include/Void/Fsm/Orchestrator.hpp: fixFsmHandle::finished()viaterminal(status()), clarifyshared_ptrownership docs, addSupervisionPolicy(StopOnFault,BoundedRestart3/60s on injected clock, 1,024 max supervised), unlocked observers,try_launch.- Tests & consumers:
tests/standalone/Fsm/FsmHardening.cpp,tests/package/FsmOnly/*,tests/package/InstalledComponents.cmake.
Verification Criteria
- Standalone
Fsm;TestingRelWithDebInfo-Werror:Fsm*tests +ctest2/2 (FsmOnly). - Full Wave 8 RelWithDebInfo
-Werror, ASan+UBSan-Werror, and Wave 8 TSan.