TenantAtlas/specs/311-workspace-environment-surface-scope-contract/tasks.md
ahmido bf43dad3d1 fix: enforce workspace surface scope for customer review workspace (#366)
## Summary
- keep `/admin/reviews/workspace` workspace-scoped in shell and sidebar context
- treat `tenant` query hints on the customer review workspace as page-level filters only
- update the customer review workspace tests and Spec 311 navigation contract to match the workspace-hub IA

## Testing
- `cd apps/platform && ./vendor/bin/sail artisan test --compact tests/Feature/Reviews/CustomerReviewWorkspacePageTest.php`
- `cd apps/platform && ./vendor/bin/sail artisan test --compact tests/Feature/Filament/WorkspaceContextTopbarAndTenantSelectionTest.php tests/Feature/Filament/PanelNavigationSegregationTest.php`
- `cd apps/platform && ./vendor/bin/sail bin pint --dirty --format agent`
- `git diff --check`

Co-authored-by: Ahmed Darrazi <ahmed.darrazi@live.de>
Reviewed-on: #366
2026-05-15 20:52:37 +00:00

7.5 KiB

Tasks: Workspace / Environment Surface Scope Contract

Input: /Users/ahmeddarrazi/Documents/projects/wt-plattform/specs/311-workspace-environment-surface-scope-contract/spec.md, /Users/ahmeddarrazi/Documents/projects/wt-plattform/specs/311-workspace-environment-surface-scope-contract/plan.md Prerequisites: Current branch is 311-workspace-environment-surface-scope-contract; Customer Review Workspace product completion is deferred to 312. Scope: Global admin shell/navigation/filter contract only.

Tests: Pest/Livewire feature tests and route-category unit test.

Test Governance Checklist

  • Lane assignment is named and is the narrowest sufficient proof: focused Feature/Unit lane.
  • New or changed tests stay in existing surface families.
  • No new shared test helper, seed, factory, or heavy family is introduced.
  • Browser smoke is not required because no visual layout/styling changed.
  • Legacy tenant-owned resource parity remains covered to prevent over-broad scope regression.

Format: [ID] [P?] [Story?] Description with file path

Phase 1: Branch and WIP Split

  • T001 Save dirty Customer Review Workspace WIP patch to /tmp/311-customer-review-workspace-wip.patch.
  • T002 Stash dirty WIP, including untracked files, before switching branches.
  • T003 Switch from the mixed branch to platform-dev, pull, and create 311-workspace-environment-surface-scope-contract.
  • T004 Confirm no commits are made during implementation.

Phase 2: Contract Tests First

  • T005 [US1] Add workspace-wide query-independence cases to /Users/ahmeddarrazi/Documents/projects/wt-plattform/apps/platform/tests/Feature/Filament/PanelNavigationSegregationTest.php.
  • T006 [US1] Add representative shell-contract coverage to /Users/ahmeddarrazi/Documents/projects/wt-plattform/apps/platform/tests/Feature/Workspaces/GlobalContextShellContractTest.php.
  • T007 [US1] Update Operations topbar/filter tests in /Users/ahmeddarrazi/Documents/projects/wt-plattform/apps/platform/tests/Feature/Filament/WorkspaceContextTopbarAndTenantSelectionTest.php, /Users/ahmeddarrazi/Documents/projects/wt-plattform/apps/platform/tests/Feature/Monitoring/OperationsTenantScopeTest.php, /Users/ahmeddarrazi/Documents/projects/wt-plattform/apps/platform/tests/Feature/Monitoring/OperationsKpiHeaderTenantContextTest.php, /Users/ahmeddarrazi/Documents/projects/wt-plattform/apps/platform/tests/Feature/Monitoring/OperationsCanonicalUrlsTest.php, and /Users/ahmeddarrazi/Documents/projects/wt-plattform/apps/platform/tests/Feature/Spec085/OperationsIndexHeaderTest.php.
  • T008 [US1] Update Customer Review Workspace and Review Register filter tests in /Users/ahmeddarrazi/Documents/projects/wt-plattform/apps/platform/tests/Feature/Reviews/CustomerReviewWorkspacePageTest.php, /Users/ahmeddarrazi/Documents/projects/wt-plattform/apps/platform/tests/Feature/EnvironmentReview/EnvironmentReviewRegisterPrefilterTest.php, and /Users/ahmeddarrazi/Documents/projects/wt-plattform/apps/platform/tests/Feature/EnvironmentReview/EnvironmentReviewRegisterTest.php.
  • T009 [US1] Update Audit Log and Alerts workspace-wide tests in /Users/ahmeddarrazi/Documents/projects/wt-plattform/apps/platform/tests/Feature/Filament/AuditLogPageTest.php, /Users/ahmeddarrazi/Documents/projects/wt-plattform/apps/platform/tests/Feature/Alerts/AlertDeliveryDeepLinkFiltersTest.php, /Users/ahmeddarrazi/Documents/projects/wt-plattform/apps/platform/tests/Feature/Filament/Alerts/AlertsKpiHeaderTest.php, and /Users/ahmeddarrazi/Documents/projects/wt-plattform/apps/platform/tests/Feature/Filament/Alerts/AlertDeliveryViewerTest.php.
  • T010 [US2] Add route-category coverage to /Users/ahmeddarrazi/Documents/projects/wt-plattform/apps/platform/tests/Unit/Tenants/TenantPageCategoryTest.php.
  • T011 [US3] Keep /Users/ahmeddarrazi/Documents/projects/wt-plattform/apps/platform/tests/Feature/Filament/TenantOwnedResourceScopeParityTest.php green as a legacy tenant-owned regression guard.

Phase 3: Runtime Contract

  • T012 [US1] Add WorkspaceWideSurface classification to /Users/ahmeddarrazi/Documents/projects/wt-plattform/apps/platform/app/Support/Tenants/TenantPageCategory.php.
  • T013 [US1] Make /Users/ahmeddarrazi/Documents/projects/wt-plattform/apps/platform/app/Support/Tenants/TenantPageCategory.php resolve Livewire update/request paths from referer when needed.
  • T014 [US1] Update /Users/ahmeddarrazi/Documents/projects/wt-plattform/apps/platform/app/Support/Tenants/TenantInteractionLane.php for the new route category.
  • T015 [US1] Update /Users/ahmeddarrazi/Documents/projects/wt-plattform/apps/platform/app/Support/OperateHub/OperateHubShell.php so WorkspaceWideSurface resolves tenantless before query, Filament tenant, or remembered tenant hints.
  • T016 [US1] Remove remembered-tenant default filters and global-context clearing from /Users/ahmeddarrazi/Documents/projects/wt-plattform/apps/platform/app/Filament/Pages/Reviews/CustomerReviewWorkspace.php and /Users/ahmeddarrazi/Documents/projects/wt-plattform/apps/platform/app/Filament/Pages/Reviews/ReviewRegister.php.
  • T017 [US1] Make Provider Connection list filtering query-driven only in /Users/ahmeddarrazi/Documents/projects/wt-plattform/apps/platform/app/Filament/Resources/ProviderConnectionResource.php.
  • T018 [US1] Make Alert Delivery list and Alerts KPI workspace-wide in /Users/ahmeddarrazi/Documents/projects/wt-plattform/apps/platform/app/Filament/Resources/AlertDeliveryResource.php and /Users/ahmeddarrazi/Documents/projects/wt-plattform/apps/platform/app/Filament/Widgets/Alerts/AlertsKpiHeader.php.
  • T019 [US1] Make Operations KPI use workspace entitlement scope when shell is tenantless in /Users/ahmeddarrazi/Documents/projects/wt-plattform/apps/platform/app/Filament/Widgets/Operations/OperationsKpiHeader.php.

Phase 4: Spec Artifacts

  • T020 Create /Users/ahmeddarrazi/Documents/projects/wt-plattform/specs/311-workspace-environment-surface-scope-contract/spec.md.
  • T021 Create /Users/ahmeddarrazi/Documents/projects/wt-plattform/specs/311-workspace-environment-surface-scope-contract/plan.md.
  • T022 Create /Users/ahmeddarrazi/Documents/projects/wt-plattform/specs/311-workspace-environment-surface-scope-contract/tasks.md.

Phase 5: Validation and Close-Out

  • T023 Run the focused 311 Feature/Unit test selection from /Users/ahmeddarrazi/Documents/projects/wt-plattform/apps/platform.
  • T024 Run cd /Users/ahmeddarrazi/Documents/projects/wt-plattform/apps/platform && ./vendor/bin/sail bin pint --dirty --format agent.
  • T025 Run git diff --check from /Users/ahmeddarrazi/Documents/projects/wt-plattform.
  • T026 Record final changed files, validation, no-migration/no-RBAC/no-CRW-product-logic close-out.

Dependencies

  • T001-T004 before runtime edits.
  • T005-T011 before or alongside T012-T019.
  • T012-T019 before final validation.
  • T020-T022 before final close-out because runtime files changed.
  • T023-T026 last.

Parallel Work Examples

  • T005-T011 can be maintained by surface family after the contract is known.
  • T016-T019 are disjoint runtime surface updates after T012-T015.
  • T023 can run before T024/T025; T024 and T025 are final formatting/whitespace checks.

Implementation Strategy

  1. Preserve 312 WIP by patch/stash.
  2. Establish route-scope tests first.
  3. Harden central taxonomy and shell.
  4. Remove remembered/global tenant defaults from explicit workspace-wide surfaces.
  5. Preserve legacy tenant-owned list parity.
  6. Validate focused suite, format, and whitespace.