3.7 KiB
3.7 KiB
Quickstart: Tenant Lifecycle, Operability, and Context Semantics Foundation
Purpose
Use this guide to validate follow-up implementation work derived from Spec 143.
Prerequisites
- Laravel Sail services are running.
- An admin-plane user exists with workspace membership.
- At least one workspace exists with tenants covering these lifecycle states:
draftonboardingactivearchived
- At least one authorized
OperationRunexists for a tenant that is not the currently selected tenant. - At least one resumable
TenantOnboardingSessionexists for an onboarding tenant.
Validation flow
1. Validate selector eligibility
- Open
/admin/choose-tenant. - Confirm only
activetenants are selectable as normal tenant context. - Confirm
draft,onboarding, andarchivedtenants are not selectable in the standard tenant chooser.
Expected result:
- The chooser represents normal operating context only.
- No invalid tenant selection path is available.
2. Validate management and onboarding visibility
- Open
/admin/tenantsand inspect lifecycle labels and actions. - Open
/admin/onboardingand any resumable onboarding draft.
Expected result:
- Onboarding and draft tenants remain visible in the correct surfaces.
- Archived tenants remain visible only where administrative or audit semantics justify them.
- Lifecycle-related actions are vocabulary-correct:
Archive,Restore,Resume onboarding.
3. Validate canonical operation viewer behavior
- Select tenant B as the remembered tenant context.
- Open
/admin/operations/{run}for a run linked to tenant A.
Expected result:
- The run remains visible if workspace membership, tenant entitlement, and capability checks pass.
- The page handles the mismatch explicitly in UX if implemented, but does not return a false 404.
4. Validate tenant-bound route behavior
- Open
/admin/tenants/{tenant}for an onboarding tenant that the user is entitled to. - Repeat for an archived tenant if allowed by the follow-up implementation.
Expected result:
- Route legitimacy comes from the route tenant plus entitlement checks.
- Action availability changes with lifecycle, but route validity does not depend on current header tenant selection.
5. Validate authorization semantics
- Attempt the same tenant and operation-run routes as:
- a non-member user
- a workspace member without the required capability
Expected result:
- Non-member or non-entitled access resolves as 404.
- Member without capability resolves as 403 for execution attempts.
6. Validate status presentation
- Inspect tenant lifecycle badges wherever tenant status appears.
Expected result:
draft,onboarding,active, andarchivedall render explicit, centralized status presentation.- No valid lifecycle renders as
Unknown.
Suggested focused test targets
tests/Feature/Auth/TenantChooserSelectionTest.phptests/Feature/TenantRBAC/TenantSwitcherScopeTest.phptests/Feature/TenantRBAC/ArchivedTenantRouteAccessTest.phptests/Feature/Monitoring/OperationsCanonicalUrlsTest.phptests/Feature/Operations/TenantlessOperationRunViewerTest.phptests/Feature/Spec085/CanonicalMonitoringDoesNotMutateTenantContextTest.phptests/Feature/Badges/TenantStatusBadgeTest.phptests/Feature/Onboarding/OnboardingDraftAuthorizationTest.phptests/Unit/Onboarding/OnboardingLifecycleServiceTest.php
Filament and deployment notes
- Livewire v4.0+ compliance remains required because this feature touches Filament v5 surfaces.
- Filament providers remain registered in
bootstrap/providers.php. - This foundation adds no new assets, so there is no new
filament:assetswork beyond the project’s existing deploy process.