## Summary - add canonical onboarding lifecycle and checkpoint fields plus optimistic locking versioning for managed tenant onboarding drafts - introduce centralized onboarding lifecycle and mutation services and route wizard mutations through version-checked writes - convert Verify Access and Bootstrap into live checkpoint-driven wizard states with conditional polling and updated browser/feature/unit coverage - add Spec Kit artifacts for feature 140, including spec, plan, tasks, research, data model, quickstart, checklist, and logical contract ## Validation - branch was committed and pushed cleanly - focused tests and formatting were updated during implementation work - full validation was not re-run as part of this final git/PR step ## Notes - base branch: `dev` - feature branch: `140-onboarding-lifecycle-operation-checkpoints-concurrency-mvp` - outstanding follow-up items, if any, remain tracked in `specs/140-onboarding-lifecycle-operation-checkpoints-concurrency-mvp/tasks.md` Co-authored-by: Ahmed Darrazi <ahmed.darrazi@live.de> Reviewed-on: #169
4.4 KiB
4.4 KiB
Quickstart: Onboarding Lifecycle, Operation Checkpoints & Concurrency MVP
Goal
Validate the lifecycle, checkpoint-monitoring, and optimistic-locking design on the existing managed tenant onboarding wizard without adding routes or replacing the current flow.
Prerequisites
- Start the local stack with
vendor/bin/sail up -d. - Ensure the database is migrated after implementation with
vendor/bin/sail artisan migrate --no-interaction. - Use a workspace member with onboarding permissions and, for activation scenarios, an owner-capable actor.
Manual Validation Flow
Scenario 1: New draft lifecycle foundation
- Open
/admin/onboarding. - Create or resume a draft.
- Confirm the persisted draft starts in
draftandcurrent_checkpointreflects the current wizard step.
Scenario 2: Verify Access as a live checkpoint
- Select a provider connection.
- Start Verify Access from Step 3.
- Confirm the draft moves to
verifyingand the step shows live checkpoint messaging. - Keep the page open until the run becomes terminal.
- Confirm the step updates within the active
5spolling cadence without manual refresh and the lifecycle transitions to eitherready_for_activationoraction_required. - Confirm the Spec 139 required-permissions assist still works when verification is blocked or needs attention.
Scenario 3: Bootstrap as an optional live checkpoint
- Select one or more bootstrap actions in Step 4.
- Start bootstrap.
- Confirm the draft moves to
bootstrapping. - Keep the page open until selected runs become terminal.
- Confirm the step renders per-run status within the active
5spolling cadence and stops polling when no relevant runs remain active.
Scenario 4: Activation gating
- Reach a state that appears ready for activation.
- Invalidate readiness by changing the provider connection or by forcing a relevant blocking condition in another session.
- Attempt activation.
- Confirm activation rechecks backend truth and refuses to complete until readiness is restored.
Scenario 5: Optimistic locking conflict
- Open the same onboarding draft in two tabs.
- Save a draft mutation in Tab A.
- Submit a stale mutation in Tab B.
- Confirm Tab B sees a clear conflict notification, remains on the wizard, and does not show a false success state.
Focused Test Targets
tests/Feature/Onboarding/OnboardingDraftLifecycleTest.phptests/Feature/Onboarding/OnboardingDraftMultiTabTest.phptests/Feature/Onboarding/OnboardingActivationTest.phptests/Feature/Onboarding/OnboardingVerificationAssistTest.phptests/Feature/Onboarding/OnboardingDraftAuthorizationTest.phptests/Feature/Rbac/OnboardingWizardUiEnforcementTest.phptests/Feature/OpsUx/QueuedToastCopyTest.phptests/Feature/OperationRunServiceTest.phptests/Browser/OnboardingDraftRefreshTest.phptests/Browser/OnboardingDraftVerificationResumeTest.phptests/Unit/Onboarding/OnboardingLifecycleServiceTest.phptests/Unit/Onboarding/OnboardingDraftStageResolverTest.php
Suggested Verification Commands
vendor/bin/sail artisan test --compact tests/Feature/Onboarding/OnboardingDraftLifecycleTest.phpvendor/bin/sail artisan test --compact tests/Feature/Onboarding/OnboardingDraftMultiTabTest.phpvendor/bin/sail artisan test --compact tests/Feature/Onboarding/OnboardingActivationTest.phpvendor/bin/sail artisan test --compact tests/Feature/Onboarding/OnboardingVerificationAssistTest.phpvendor/bin/sail artisan test --compact tests/Feature/Onboarding/OnboardingDraftAuthorizationTest.phpvendor/bin/sail artisan test --compact tests/Feature/Rbac/OnboardingWizardUiEnforcementTest.phpvendor/bin/sail artisan test --compact tests/Feature/OpsUx/QueuedToastCopyTest.phpvendor/bin/sail artisan test --compact tests/Feature/OperationRunServiceTest.phpvendor/bin/sail artisan test --compact tests/Browser/OnboardingDraftRefreshTest.phpvendor/bin/sail artisan test --compact tests/Browser/OnboardingDraftVerificationResumeTest.phpvendor/bin/sail artisan test --compact tests/Unit/Onboarding/OnboardingLifecycleServiceTest.php
Expected Outcome
- No new onboarding routes are needed.
- Verify Access and Bootstrap behave as operation-backed checkpoints.
- Lifecycle truth is queryable from top-level draft fields.
- Terminal drafts remain immutable.
- Stale mutations fail safely with visible conflict guidance.