TenantAtlas/specs/279-workspace-managed-environment-core/quickstart.md
ahmido e64bae9cfc feat: cut over tenant core to managed environments (#335)
## Summary
- replace the legacy Tenant and TenantMembership core models with ManagedEnvironment and ManagedEnvironmentMembership
- propagate the managed environment naming and key changes across Filament resources, pages, controllers, jobs, models, and supporting runtime paths
- add feature 279 spec artifacts and focused managed-environment test coverage for model behavior, route binding, panel context, authorization, and legacy guardrails

## Validation
- `cd apps/platform && ./vendor/bin/sail artisan test --compact tests/Feature/ManagedEnvironment/LegacyTenantCoreGuardTest.php tests/Feature/ManagedEnvironment/ManagedEnvironmentAuthorizationTest.php tests/Feature/ManagedEnvironment/ManagedEnvironmentPanelContextTest.php tests/Feature/ManagedEnvironment/ManagedEnvironmentRouteBindingTest.php tests/Unit/ManagedEnvironment/ManagedEnvironmentContextResolverTest.php tests/Unit/ManagedEnvironment/ManagedEnvironmentModelTest.php`
- `cd apps/platform && ./vendor/bin/sail bin pint --dirty --format agent`

## Notes
- branch pushed from commit `1123b122`
- browser smoke test file was added but not run in this pass

Co-authored-by: Ahmed Darrazi <ahmed.darrazi@live.de>
Reviewed-on: #335
2026-05-07 06:38:14 +00:00

43 lines
4.1 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Quickstart: Workspace-first Managed Environment Core Cutover
## Reviewer Flow
1. Read [spec.md](./spec.md), [plan.md](./plan.md), [research.md](./research.md), and [data-model.md](./data-model.md) together.
2. Confirm the bounded scope: this package owns the breaking core entity cutover only, not the full route/IA/provider/artifact/RBAC pack.
3. Confirm the one documented exception: temporary `/admin/t/{environment}` retention while the bound model changes to `ManagedEnvironment`.
4. Confirm the temporary shell bridge is explicit and that the final `Workspace` Filament-tenancy end state remains deferred to Spec `280`.
5. Confirm `ManagedEnvironment` stays provider-neutral and that provider-specific identity remains follow-up work.
6. Confirm `specs/279-workspace-managed-environment-core/checklists/constitution-scope-001-exception.md` remains the active constitution-gate evidence, or replace it with the actual constitution-amendment reference before treating the package as implementation-startable.
7. Confirm the planned proof suite below is consistent across `spec.md`, `plan.md`, and `tasks.md`.
## Planned Validation Commands
```bash
export PATH="/bin:/usr/bin:/usr/local/bin:$PATH" && REPO_ROOT="$(git rev-parse --show-toplevel)" && (cd "$REPO_ROOT/apps/platform" && ./vendor/bin/sail artisan test --compact tests/Unit/ManagedEnvironment/ManagedEnvironmentModelTest.php tests/Unit/ManagedEnvironment/ManagedEnvironmentContextResolverTest.php)
export PATH="/bin:/usr/bin:/usr/local/bin:$PATH" && REPO_ROOT="$(git rev-parse --show-toplevel)" && (cd "$REPO_ROOT/apps/platform" && ./vendor/bin/sail artisan test --compact tests/Feature/ManagedEnvironment/ManagedEnvironmentRouteBindingTest.php tests/Feature/ManagedEnvironment/ManagedEnvironmentAuthorizationTest.php tests/Feature/ManagedEnvironment/ManagedEnvironmentPanelContextTest.php tests/Feature/ManagedEnvironment/LegacyTenantCoreGuardTest.php)
export PATH="/bin:/usr/bin:/usr/local/bin:$PATH" && REPO_ROOT="$(git rev-parse --show-toplevel)" && (cd "$REPO_ROOT/apps/platform" && ./vendor/bin/sail artisan test --compact tests/Browser/Spec279ManagedEnvironmentCoreCutoverSmokeTest.php)
export PATH="/bin:/usr/bin:/usr/local/bin:$PATH" && REPO_ROOT="$(git rev-parse --show-toplevel)" && (cd "$REPO_ROOT/apps/platform" && ./vendor/bin/sail bin pint --dirty --format agent)
export PATH="/bin:/usr/bin:/usr/local/bin:$PATH" && REPO_ROOT="$(git rev-parse --show-toplevel)" && rg -n --fixed-strings 'App\Models\Tenant' "$REPO_ROOT/apps/platform/app" "$REPO_ROOT/apps/platform/tests" "$REPO_ROOT/apps/platform/database"
export PATH="/bin:/usr/bin:/usr/local/bin:$PATH" && REPO_ROOT="$(git rev-parse --show-toplevel)" && rg -n -- '->tenant\(Tenant::class' "$REPO_ROOT/apps/platform/app" "$REPO_ROOT/apps/platform/tests" "$REPO_ROOT/apps/platform/database"
```
## Review Questions
- Does the package avoid alias models, dual columns, and dual route families?
- Is the `/admin/t/{environment}` exception explicit, bounded, and owned by Spec `279` only?
- Is the temporary ManagedEnvironment-backed shell bridge explicit, and is the final `Workspace` Filament-tenancy end state still clearly deferred to Spec `280`?
- Does the legacy-core guard prove `tenant_id` removal inside the declared core-owned cutover inventory while leaving Spec `281` and `282` residuals explicit?
- If any destructive action is touched during implementation, does it still preserve `->requiresConfirmation()` and current authorization?
- If any globally searchable resource is touched, does it still satisfy Filaments edit/view eligibility rule or remain out of global search, and did the slice avoid any new asset registration or deployment-step change?
- Does the package keep provider-specific identity off `ManagedEnvironment`?
- Are Specs `280`-`287` still explicitly deferred instead of being silently absorbed?
## Notes
- No application implementation was performed while preparing this package.
- The package is ready with the approved feature-local exception in place while `specs/279-workspace-managed-environment-core/checklists/constitution-scope-001-exception.md` remains the active gate evidence, or once it is superseded by the constitution update itself.