You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This issue tracks the stacked onboarding finite-state-machine (FSM) migration work and explains the current intended end-state for reviewers and maintainers.
The stack moves onboarding from a large manual sequence in src/lib/onboard.ts toward explicit FSM state results, a strict runtime/runner, and phase slices. Fresh onboarding is now being migrated onto FSM slices. Resume/ahead-state flows intentionally remain compatibility-driven for now so historical repair and backstop checks still execute even when the saved machine state is already ahead.
Initial slice: preflight/gateway → stops at provider_selection
Core slice: provider/inference + sandbox → stops at openclaw or agent_setup
Final slice: branch setup + policies + finalization → completion
Step helpers can now record status without mutating the durable machine state. Fresh flows use record-only step mutation so OnboardRuntime owns machine transitions.
Resume compatibility is intentional
Resume/ahead-state flows still use the compatibility execution path. This is intentional because many historical fixes are repair/backstop checks inside phase bodies. Those checks must still run even if a saved session has already advanced beyond the phase's nominal FSM state.
Examples of this pattern include preflight/gateway backstops, provider repair, sandbox reuse/repair decisions, policy reconciliation, and final verification/recovery checks.
A future project can model resume repairs as first-class FSM behavior, but this stack keeps resume conservative to avoid regressions.
Summary
This issue tracks the stacked onboarding finite-state-machine (FSM) migration work and explains the current intended end-state for reviewers and maintainers.
The stack moves onboarding from a large manual sequence in
src/lib/onboard.tstoward explicit FSM state results, a strict runtime/runner, and phase slices. Fresh onboarding is now being migrated onto FSM slices. Resume/ahead-state flows intentionally remain compatibility-driven for now so historical repair and backstop checks still execute even when the saved machine state is already ahead.Stack overview
1. FSM target, metadata, and mappings
2. Runtime lifecycle/events/result primitives
3. Existing handlers return FSM results
4. Runner, record-only steps, and compatibility bridge
5. Ordered results and sequence adapter
6. Flow context, phase adapters, and slice helpers
7. Live fresh-flow migration and boundary tests
Current behavior after the stack
Fresh onboarding is migrated to FSM slices:
provider_selectionopenclaworagent_setupStep helpers can now record status without mutating the durable machine state. Fresh flows use record-only step mutation so
OnboardRuntimeowns machine transitions.Resume compatibility is intentional
Resume/ahead-state flows still use the compatibility execution path. This is intentional because many historical fixes are repair/backstop checks inside phase bodies. Those checks must still run even if a saved session has already advanced beyond the phase's nominal FSM state.
Examples of this pattern include preflight/gateway backstops, provider repair, sandbox reuse/repair decisions, policy reconciliation, and final verification/recovery checks.
A future project can model resume repairs as first-class FSM behavior, but this stack keeps resume conservative to avoid regressions.
Suggested review order
onboard.tsexecution path for fresh runs.Follow-up work after this stack
src/lib/onboard.tsinto a dedicated module.